summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.manual444
-rw-r--r--Docs/cmake-mode.el23
-rw-r--r--Modules/AutomocInfo.cmake.in1
-rw-r--r--Modules/BasicConfigVersion-AnyNewerVersion.cmake.in2
-rw-r--r--Modules/BasicConfigVersion-SameMajorVersion.cmake.in2
-rw-r--r--Modules/CMakeCCompilerId.c.in16
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in16
-rw-r--r--Modules/CMakeDetermineVSServicePack.cmake3
-rw-r--r--Modules/CTest.cmake14
-rw-r--r--Modules/CTestUseLaunchers.cmake49
-rw-r--r--Modules/CheckIncludeFiles.cmake2
-rw-r--r--Modules/CheckSymbolExists.cmake2
-rw-r--r--Modules/Compiler/Clang-ASM.cmake6
-rw-r--r--Modules/Compiler/Clang-C.cmake3
-rw-r--r--Modules/Compiler/Clang-CXX.cmake3
-rw-r--r--Modules/Compiler/Clang.cmake26
-rw-r--r--Modules/DartConfiguration.tcl.in1
-rw-r--r--Modules/ExternalProject.cmake2
-rw-r--r--Modules/FindCURL.cmake4
-rw-r--r--Modules/FindGTK2.cmake53
-rw-r--r--Modules/FindMPI.cmake5
-rw-r--r--Modules/FindOpenSSL.cmake7
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake3
-rw-r--r--Modules/FindPostgreSQL.cmake1
-rw-r--r--Modules/FindSDL.cmake59
-rw-r--r--Modules/FindSDL_image.cmake81
-rw-r--r--Modules/FindSDL_mixer.cmake81
-rw-r--r--Modules/FindSDL_net.cmake82
-rw-r--r--Modules/FindSDL_sound.cmake89
-rw-r--r--Modules/FindSDL_ttf.cmake81
-rw-r--r--Modules/FortranCInterface.cmake6
-rw-r--r--Modules/NSIS.template.in2
-rw-r--r--Modules/Platform/Windows-Intel.cmake12
-rw-r--r--Modules/Platform/Windows-MSVC.cmake10
-rw-r--r--Modules/Platform/Windows-df.cmake3
-rw-r--r--Modules/SelectLibraryConfigurations.cmake18
-rw-r--r--Modules/readme.txt8
-rw-r--r--Source/CMakeLists.txt7
-rw-r--r--Source/CMakeVersion.cmake6
-rw-r--r--Source/CPack/cmCPackDocumentVariables.cxx18
-rw-r--r--Source/CPack/cmCPackGenerator.cxx6
-rw-r--r--Source/CTest/cmCTestMemCheckHandler.cxx173
-rw-r--r--Source/CTest/cmCTestSVN.cxx79
-rw-r--r--Source/CTest/cmCTestSVN.h4
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx5
-rw-r--r--Source/CTest/cmCTestUpdateCommand.cxx2
-rw-r--r--Source/CTest/cmCTestVC.h4
-rw-r--r--Source/QtDialog/CMakeLists.txt2
-rw-r--r--Source/cmAddTestCommand.h2
-rw-r--r--Source/cmDocumentGeneratorExpressions.h19
-rw-r--r--Source/cmDocumentLocationUndefined.h4
-rw-r--r--Source/cmDocumentVariables.cxx15
-rw-r--r--Source/cmDocumentation.cxx2
-rw-r--r--Source/cmExportBuildFileGenerator.cxx23
-rw-r--r--Source/cmExportBuildFileGenerator.h10
-rw-r--r--Source/cmExportFileGenerator.cxx56
-rw-r--r--Source/cmExportFileGenerator.h19
-rw-r--r--Source/cmExportInstallFileGenerator.cxx124
-rw-r--r--Source/cmExportInstallFileGenerator.h59
-rw-r--r--Source/cmExportSet.cxx32
-rw-r--r--Source/cmExportSet.h46
-rw-r--r--Source/cmExportSetMap.cxx34
-rw-r--r--Source/cmExportSetMap.h33
-rw-r--r--Source/cmExtraCodeBlocksGenerator.cxx93
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx13
-rw-r--r--Source/cmFileCommand.cxx35
-rw-r--r--Source/cmFileCommand.h12
-rw-r--r--Source/cmFindPackageCommand.cxx12
-rw-r--r--Source/cmGeneratorExpression.cxx57
-rw-r--r--Source/cmGeneratorExpression.h19
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.cxx106
-rw-r--r--Source/cmGeneratorExpressionDAGChecker.h44
-rw-r--r--Source/cmGeneratorExpressionEvaluator.cxx243
-rw-r--r--Source/cmGeneratorExpressionEvaluator.h19
-rw-r--r--Source/cmGeneratorExpressionParser.cxx67
-rw-r--r--Source/cmGeneratorTarget.cxx184
-rw-r--r--Source/cmGeneratorTarget.h26
-rw-r--r--Source/cmGlobalGenerator.cxx111
-rw-r--r--Source/cmGlobalGenerator.h34
-rw-r--r--Source/cmGlobalNinjaGenerator.cxx12
-rw-r--r--Source/cmGlobalNinjaGenerator.h1
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx2
-rw-r--r--Source/cmGlobalVisualStudio8Win64Generator.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx21
-rw-r--r--Source/cmIfCommand.h2
-rw-r--r--Source/cmIncludeDirectoryCommand.cxx16
-rw-r--r--Source/cmInstallCommand.cxx19
-rw-r--r--Source/cmInstallExportGenerator.cxx18
-rw-r--r--Source/cmInstallExportGenerator.h18
-rw-r--r--Source/cmInstallTargetGenerator.cxx30
-rw-r--r--Source/cmInstallTargetGenerator.h5
-rw-r--r--Source/cmLocalGenerator.cxx114
-rw-r--r--Source/cmLocalGenerator.h26
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx61
-rw-r--r--Source/cmLocalVisualStudio6Generator.h2
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx29
-rw-r--r--Source/cmMakeDepend.cxx20
-rw-r--r--Source/cmMakefile.cxx6
-rw-r--r--Source/cmMakefile.h17
-rw-r--r--Source/cmMakefileExecutableTargetGenerator.cxx22
-rw-r--r--Source/cmMakefileLibraryTargetGenerator.cxx19
-rw-r--r--Source/cmMakefileTargetGenerator.cxx45
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx52
-rw-r--r--Source/cmNinjaTargetGenerator.cxx57
-rw-r--r--Source/cmNinjaTargetGenerator.h3
-rw-r--r--Source/cmQtAutomoc.cxx64
-rw-r--r--Source/cmQtAutomoc.h1
-rw-r--r--Source/cmStringCommand.h3
-rw-r--r--Source/cmTarget.cxx274
-rw-r--r--Source/cmTarget.h31
-rw-r--r--Source/cmTargetExport.h39
-rw-r--r--Source/cmTargetLinkLibrariesCommand.cxx4
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx29
-rw-r--r--Source/cmake.cxx29
-rw-r--r--Source/cmake.h3
-rw-r--r--Templates/DLLHeader.dsptemplate16
-rw-r--r--Templates/EXEHeader.dsptemplate18
-rw-r--r--Templates/EXEWinHeader.dsptemplate16
-rw-r--r--Templates/staticLibHeader.dsptemplate16
-rw-r--r--Tests/CMakeLists.txt4
-rw-r--r--Tests/CMakeOnly/CMakeLists.txt2
-rw-r--r--Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt64
-rw-r--r--Tests/CMakeTests/FileDownloadTest.cmake.in12
-rw-r--r--Tests/CTestTestMemcheck/CMakeLists.txt81
-rw-r--r--Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyBC/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyPurify/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in26
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in26
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt6
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake9
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in24
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in27
-rw-r--r--Tests/CTestTestMemcheck/NotExist/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/NotExist/test.cmake.in18
-rw-r--r--Tests/CTestTestMemcheck/Unknown/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/Unknown/test.cmake.in18
-rw-r--r--Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt5
-rw-r--r--Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake7
-rw-r--r--Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in18
-rw-r--r--Tests/CompileDefinitions/compiletest.cpp18
-rw-r--r--Tests/CompileDefinitions/target_prop/CMakeLists.txt7
-rw-r--r--Tests/ExportImport/Export/CMakeLists.txt12
-rw-r--r--Tests/ExportImport/Export/testLibDepends.c4
-rw-r--r--Tests/ExportImport/Export/testLibRequired.c1
-rw-r--r--Tests/ExportImport/Import/A/CMakeLists.txt4
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt52
-rw-r--r--Tests/GeneratorExpression/check.cmake53
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt23
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp7
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h1
-rw-r--r--Tests/PDBDirectoryAndName/CMakeLists.txt79
-rw-r--r--Tests/PDBDirectoryAndName/check_pdbs.cmake10
-rw-r--r--Tests/PDBDirectoryAndName/myexe.c5
-rw-r--r--Tests/PDBDirectoryAndName/myexe2.c3
-rw-r--r--Tests/PDBDirectoryAndName/mylibA.c1
-rw-r--r--Tests/PDBDirectoryAndName/mylibB.c1
-rw-r--r--Tests/PDBDirectoryAndName/mylibC.c1
-rw-r--r--Tests/PDBDirectoryAndName/mylibD.c1
-rw-r--r--Tests/RunCMake/CMakeLists.txt2
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt2
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt38
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake6
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake9
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake9
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake7
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake9
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake8
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake10
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake10
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt1
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt6
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake10
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt8
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake17
-rw-r--r--Tests/RunCMake/include_directories/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/include_directories/NotFoundContent-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/NotFoundContent-stderr.txt6
-rw-r--r--Tests/RunCMake/include_directories/NotFoundContent.cmake9
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake3
-rwxr-xr-xbootstrap5
232 files changed, 4227 insertions, 1141 deletions
diff --git a/ChangeLog.manual b/ChangeLog.manual
index cdab442..ef8571b 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -1,3 +1,447 @@
+Changes in CMake 2.8.10 (since 2.8.10-rc3)
+----------------------------------------------
+None
+
+Changes in CMake 2.8.10-rc3 (since 2.8.10-rc2)
+----------------------------------------------
+Rolf Eike Beer (2):
+ SelectLibraryConfigurations: add testcase
+ SelectLibraryConfigurations: fix for release and debug libs being the same
+
+Stephen Kelly (5):
+ BasicConfigVersion: Make docs refer to the macro, not the module name
+ Document LOCATION undefined behavior with use of LINKER_LANGUAGE.
+ GenEx: Add an accessor for imported targets in a makefile.
+ GenEx: Create cmGeneratorTargets for imported targets.
+ GexEx: Validate Target names and property names differently.
+
+Thomas Arcila (1):
+ SelectLibraryConfigurations: Fix foreach(x IN LISTS ...) syntax
+
+Changes in CMake 2.8.10-rc2 (since 2.8.10-rc1)
+----------------------------------------------
+Alex Neundorf (2):
+ Document CMAKE_FIND_PACKAGE_NAME
+ Automoc: fix #13572: issue with symbolic links
+
+Brad King (4):
+ cmCTestSVN: Fix compilation with Sun CC 5.1
+ if: Document that plain 'NOTFOUND' is a false constant
+ string: Clarify regex documentation of '-' behavior
+ FortranCInterface: Pass all flags to VERIFY project (#13579)
+
+David Cole (1):
+ NSIS: Fix incorrect uninstall registry key name (#13578)
+
+Eric NOULARD (3):
+ CPACK_XX_ON_ABSOLUTE_INSTALL_DESTINATION is now properly checked for ON/OFF
+ Document CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY and fix some typo.
+ Make CPACK_SET_DESTDIR work with archive generator + component-based packaging
+
+Jean-Christophe Fillion-Robin (1):
+ CTest: Ensure CTEST_USE_LAUNCHERS behaves nicely in Superbuild setup
+
+Pere Nubiola i Radigales (1):
+ Find PostgreSQL headers on Debian
+
+Peter Kümmel (4):
+ Ninja: also set OBJECT_DIR when compiling
+ Ninja: don't pollute current dir when using gui (#13495)
+ Ninja: implicit dependency for custom command files
+ Fix regression: write compile definitions if any
+
+Philip Lowman (4):
+ FindGTK2: Rollback lib64 changes which broke header file finding
+ FindGTK2: #12049 fix detection of header files on multiarch systems
+ FindGTK2: #12596 Missing paths for FindGTK2 on NetBSD
+ FindGTK2: Update local changelog
+
+Rolf Eike Beer (6):
+ CTest: fix usage of memory checker with spaces in path
+ CTest: fix pre and post test commands with spaces
+ CTest: add tests that simulate memcheck runs
+ CTest: improve memory checker type detection
+ CTest: add a test for CTEST_CUSTOM_MEMCHECK_IGNORE
+ CTest: add a check with a quoted memory checker
+
+Stephen Kelly (18):
+ GenEx: It is not an error to specify an empty parameter
+ GenEx: Return after error reported.
+ GenEx: Report actual target name not found, not "0" each time.
+ GenEx: Parse comma after colon tokens specially
+ GenEx: Validate target and property names.
+ GenEx: Ensure that the empty CONFIGURATION can be used conditionally.
+ GenEx: Add test for $<BOOL:> with empty parameter.
+ GenEx: Add tests for "0" and "1" expressions with literal commas.
+ GenEx: Don't use std::vector::at(int).
+ Attempt to fix the compile of cmake on Sun CC.
+ GenEx: Parse colon after arguments separator colon specially.
+ GenEx: Test the use of generator expressions to generate lists.
+ GenEx: Fix termination bugs in generator expression parser.
+ GenEx: Break if there are no more commas in the container
+ GenEx: Add some more asserts to verify code-sanity.
+ GenEx: Replace some failing tests with Borland and NMake makefiles.
+ GenEx: Fix reporting about not-found include directories and libraries.
+ Fix config-specific INCLUDE_DIRECTORIES in multi-config generators
+
+Changes in CMake 2.8.10-rc1 (since 2.8.9)
+-----------------------------------------
+Scripted Changes (3):
+ Remove trailing whitespace from most CMake and C/C++ code
+ Convert CMake-language commands to lower case
+ Remove CMake-language block-end command arguments
+
+Alex Neundorf (27):
+ Eclipse: add support for the 4.2 Juno release (#13367)
+ Eclipse: improve (fix ?) version detection on OSX
+ Eclipse: fix #13358: don't create bad linked resources
+ Eclipse: fix #13358: don't create bad linked resources
+ remove non-working KDE4 test
+ Eclipse on OSX: fix handling of framework include dirs (#13464)
+ Eclipse on OSX: improve handling of framework include dirs (#13367)
+ -fix line length
+ fix #13474: also rescan dependencies if the depender does not exist
+ -fix line length
+ -fix Java dependency scanning, broken in previous commit
+ error out if CTEST_USE_LAUNCHERS is TRUE but RULE_LAUNCH_* are not set
+ fix #13494: rerun automoc also if include dirs or moc options change
+ CMakeDetermineFortranCompiler: add support for cross-compiling (#13379)
+ Automoc: fix #13493, use target properties for include dirs
+ Automoc: do not use DEFINITIONS, but only COMPILE_DEFINITIONS
+ Automoc: also the makefile-COMPILE_DEFINITIONS
+ cmGlobalGenerator.h: some minor coding style fixes
+ Modules/readme.txt: fix typo
+ find_package: add support for a <package>_NOT_FOUND_MESSAGE variable
+ exports: store pointers to all installations of each export set
+ exports: accept a missing target if it is exported exactly once
+ exports: first try at error handling if a target is missing
+ exports: fix build with MSVC6
+ exports: move the handling of missing targets into subclasses
+ exports: define a CMAKE_FIND_PACKAGE_NAME var set by find_package()
+ exports: add a test for exporting dependent targets
+
+Andreas Mohr (1):
+ FindCURL: Find older MSVC prebuilts
+
+Andy Piper (1):
+ Do not include directories which are part of the package install prefix.
+
+Benjamin Eikel (21):
+ Initial version of find module
+ FindSDL: Add version support for FindSDL_net
+ FindSDL: Version support for FindSDL_image
+ FindSDL: Use prefix SDL_NET, because it matches the file name.
+ FindSDL: Use SDL_IMAGE prefix for varibales
+ FindSDL: Add "cmake_minimum_required" to "try_compile" project
+ FindSDL: Format the documentation
+ FindSDL: Version support for FindSDL_sound
+ FindSDL: Use same capitalization for FPHSA as file name
+ FindSDL: Pass SDL_SOUND_LIBRARY to FIND_PACKAGE_HANDLE_STANDARD_ARGS
+ FindSDL: Use SDL_MIXER prefix for variables
+ FindSDL: Add version support for FindSDL_mixer
+ FindSDL: Update documentation
+ FindSDL: Use SDL_TTF prefix for variables
+ FindSDL: Add version support for FindSDL_ttf
+ FindSDL: Update documentation
+ FindSDL: Format documentation
+ FindSDL: Add version support
+ FindSDL: Add my copyright tag to all FindSDL_* modules
+ FindSDL: Remove from find_... calls PATHS that are set by default
+ FindSDL: Stay compatible with old input variables
+
+Bill Hoffman (8):
+ Use OUTPUT_NORMAL instead of OUTPUT_MERGE for cmake -E chdir.
+ curl: Use find_package(OpenSSL)
+ curl: Make OpenSSL DLLs available to CMake on Windows
+ file(DOWNLOAD): Generalize EXPECTED_MD5 to EXPECTED_HASH
+ file(DOWNLOAD): Add options for SSL
+ Utilities/Release: Enable CMAKE_USE_OPENSSL in nightly binaries
+ Add SSL_VERIFYPEER and CAINFO file options to ExternalProject_Add.
+ Revert "Ninja: don't expand any rsp files"
+
+Brad King (83):
+ find_library: Add test covering lib->lib64 cases
+ find_library: Refactor lib->lib64 conversion
+ find_library: Simplify lib->lib<arch> expansion
+ find_library: Fix mixed lib->lib64 (non-)conversion cases (#13419)
+ CMakeDetermine(C|CXX)Compiler: Consider Clang compilers
+ Factor common code out of CMakeDetermine(ASM|C|CXX|Fortran)Compiler
+ Prefer generic system compilers by default for C, C++, and Fortran
+ Xcode: Fix object library references in multi-project trees (#13452)
+ Xcode: Run xcode-select to find Xcode version file (#13463)
+ Watcom: Simplify compiler version detection (#11866)
+ Remove trailing TAB from NSIS.template.in
+ Fix WarnUnusedUnusedViaUnset test pass/fail regex
+ CMakeVersion.bash: Update sed expression for lower-case 'set'
+ GetPrerequisites: Mark file_cmd as advanced cache entry
+ Add boolean generator expressions
+ Add $<CONFIG:...> boolean query generator expression
+ Recognize Clang ASM support (#13473)
+ Xcode: Set ASM source language in project file (#13472)
+ Tests/Assembler: Do not use assembler in universal binaries
+ Add FindHg module to find Mercurial
+ ExternalProject: Add Mercurial (hg) repository support
+ Qt4Macros: Fix recently broken resource file parsing
+ Tests/ObjectLibrary: Do not enable CXX in subdirectories
+ VS11: Rename 'Immersive' to 'WindowsAppContainer' (#12930)
+ VS: Disable precompiled headers unless enabled by project (#12930)
+ VS11: Generate flag tables from MSBuild V110 tool files
+ Detect Compaq compiler version with its id
+ Detect PathScale compiler version with its id
+ Detect TI compiler version with its id
+ Detect Comeau compiler version with its id
+ Detect SDCC compiler version with its id
+ Detect Cray compiler version with its id
+ Detect Analog VisualDSP++ compiler version with its id
+ Re-order C/C++/Fortran compiler determination logic
+ CMakeDetermineCompilerId: Prepare to detect IDE compiler id
+ Xcode: Detect the compiler id and tool location
+ VS10: Define CMAKE_VS_PLATFORM_TOOLSET variable
+ VS: Detect the compiler id and tool location
+ Cleanly enable a language in multiple subdirectories
+ Test variables CMAKE_(C|CXX|Fortran)_COMPILER(|_ID|_VERSION)
+ Document CMAKE_<LANG>_COMPILER_(ID|VERSION) values
+ Make platform information files specific to the CMake version
+ Move CMAKE_<LANG>_COMPILER_WORKS to compiler information files
+ Store ABI detection results in compiler information files
+ VS: Remove support for "free" version 2003 tools
+ VS: Simplify MSVC version reporting
+ Modernize MSVC compiler information files
+ VS: Fix MSVC_IDE definition recently broken by refactoring
+ add_library: Document POSITION_INDEPENDENT_CODE default (#13479)
+ magrathea: Tell cmELF about DT_RUNPATH (#13497)
+ Utilities/Release: Link AIX binary with large maxdata
+ Utilities/xml: Add .gitattributes to disable whitespace checks
+ Utilities/xml: Add docbook-4.5 DTD (#13508)
+ docbook: Fix formatter naming convention to avoid shadow
+ docbook: Fix Sun CC warning on ptr_fun(isalnum)
+ curl: Honor OPENSSL_NO_SSL2
+ if: Compare up to 8 components in VERSION tests
+ ExternalProject: Generalize URL_MD5 option to URL_HASH
+ Rename SSL terminology to TLS
+ file(DOWNLOAD): Make TLS options behave as documented
+ OS X: Add platform-specific Clang compiler info files (#13536)
+ VS11: Detect VS 2012 Express for default generator (#13348)
+ VS11: Add VS 2012 Express support (#13348)
+ file(DOWNLOAD): Add HTTP User-Agent string
+ ExternalProject: Add DOWNLOAD_NAME option
+ file(DOWNLOAD): Change EXPECTED_HASH to take ALGO=value
+ VS8: Remove '.NET' from generator description (#10158)
+ Clang: Split Compiler/Clang* modules out from GNU (#13550)
+ Clang: All versions know about -fPIE (#13550)
+ Xcode: Remove unused code reading CMAKE_OSX_SYSROOT_DEFAULT
+ OS X: Always generate -isysroot if any SDK is in use
+ OS X: Improve default CMAKE_OSX_SYSROOT selection
+ bootstrap: Suppress CMAKE_OSX_SYSROOT if CFLAGS have -isysroot
+ Tests/Assembler: Use CMAKE_OSX_SYSROOT to generate .s file
+ OS X: Allow CMAKE_OSX_SYSROOT to be a logical SDK name
+ OS X: Simplify selection of CMAKE_OSX_ARCHITECTURES
+ OS X: If CMAKE_OSX_SYSROOT is already set do not compute default
+ OS X: Further improve default CMAKE_OSX_SYSROOT selection
+ OS X: Teach deployment target sanity check about SDK names
+ OS X: Ignore MACOSX_DEPLOYMENT_TARGET during Xcode compiler id
+ Verify that PDB_(NAME|OUTPUT_DIRECTORY) are honored in test
+ Document that PDB_(NAME|OUTPUT_DIRECTORY) are ignored for VS 6
+ Run PDBDirectoryAndName test on MSVC and Intel
+
+Clinton Stimpson (8):
+ fphsa: clarify message about minimum required version found.
+ DeployQt4: Include DESTDIR for some cpack generators.
+ Add -DNDEBUG to RelWithDebInfo flags where where Release flags had it.
+ Fix regex for qt minor version.
+ FindQt4: Give precedence to QTDIR environment variable, if set.
+ FindQt4: Give precedence to QTDIR environment variable, if set.
+ Fix errors detecting Qt4 on Windows 8.
+ cmake-gui: Fix error status when interrupted.
+
+Daniel Pfeifer (8):
+ Simplify CMake.HTML documentation test command line
+ docbook: Remove table of contents
+ docbook: Factor out code to write valid DocBook IDs
+ docbook: Fix the DocBook section output
+ docbook: Cleanup formatter and generated DocBook
+ docbook: Add support for <abstract> at section level 1
+ docbook: Add CMake.DocBook test to validate xml (#13508)
+ docbook: Remove redundant docs that cause invalid DocBook
+
+David Cole (9):
+ Begin post-2.8.9 development
+ Release: Temporarily exclude ExternalProject test on cygwin
+ Add ability to run as a ctest -S script also
+ CMake: Clarify the documentation for if(f1 IS_NEWER_THAN f2)
+ Convert the CPACK_CYGWIN_PATCH_NUMBER variable to a cache variable
+ InstallRequiredSystemLibraries: Use correct file names (#13315)
+ ProcessorCount: Mark find_program vars as advanced (#13236)
+ FindQt4: Avoid "finding" non-existent library in a .framework
+ FindMPI: Set correct variables for calls to FPHSA
+
+Eric NOULARD (2):
+ Enhance DESTDIR documentation. Fixes #0012374.
+ Handles %attr(nnn,-,-) /path/to/file in CPACK_RPM_USER_FILELIST properly.
+
+James Bigler (3):
+ Replace -g3 with -g for CUDA 4.1 and 4.2 in addition to CUDA < 3.0.
+ Added CUDA_SOURCE_PROPERTY_FORMAT. Allows setting per file format (OBJ or PTX)
+ FindCUDA: Added CUDA_HOST_COMPILER variable.
+
+Marcin Wojdyr (1):
+ Remove CMake multiline block-end command arguments
+
+Nils Gladitz (1):
+ ctest_update: Tell svn not to prompt interactively (#13024)
+
+Patrick Gansterer (4):
+ VS: Cleanup AddPlatformDefinitions() of Visual Studio generators
+ Add additional architectures to CMakePlatformId.h.in
+ Add WindowsCE platform information files
+ VS: Remove duplicated implementations of CreateLocalGenerator()
+
+Peter Kuemmel (1):
+ Ninja: don't expand any rsp files
+
+Peter Kümmel (15):
+ Ninja: cmcldeps needs a compiler
+ Ninja: don't crash on returned 0 pointer
+ Ninja: prepare msvc pdb cleanup
+ Ninja:split out setting of msvc TARGET_PDB
+ Ninja: remove GetTargetPDB because it is used only once
+ Ninja: also detect /showInclude prefix for icl
+ Find mingw's windres also when Unix Makefiles are used
+ Ninja: don't suppress warning about compiler options
+ Ninja: suppress cmcldeps only for source file signature try_compiles
+ Ninja: filter target specific compile flags with language specific regex
+ Ninja: OBJECT_DEPENDS should set an implicit dependency
+ Ninja: don't confuse ninja's rsp files with nmake's
+ Ninja: move -LIBPATH behind -link option
+ Ninja: move <OBJECTS> in front of the first linker option
+ Ninja: add option to enforce usage of response files
+
+Philip Lowman (3):
+ FindOpenSceneGraph: CMake variable OSG_DIR influences detection now too
+ FindGTK2: Add GTK2_CAIROMMCONFIG_INCLUDE_DIR for cairommconfig.h
+ CMakeDetermineVSServicePack: Visual Studio 2012 added
+
+Rolf Eike Beer (25):
+ remove lib64 Unix paths if the respective lib path is also given
+ FindOpenSSL: find cross-compiled OpenSSL from MinGW (#13431)
+ FindOpenSSL: use SelectLibraryConfigurations
+ FindOpenSSL: let CMake handle environment variable HINTS
+ FindOpenSSL: cleanup path hints
+ FindOpenSSL: remove leftover comment
+ SelectLibraryConfiguration: generate correct output when input vars are lists
+ Fix typo direcotry -> directory (and similar) [#13444]
+ FindSelfPackers: fix typo (#13456)
+ CheckTypeSize: show in documentation how to get struct member size (#10579)
+ CheckTypeSize: add a test for size of struct members
+ FindX11: remove duplicates from X11 include path list (#13316)
+ FindX11: avoid calling list(REMOVE_DUPLICATES) on an empty list
+ list command: error on too many arguments
+ CMake.List test: explicitely test with lists containing only an empty string
+ use the find_* functions ENV parameter
+ use PATH_SUFFIXES to simplify find_* calls
+ do not escape spaces in regular expressions
+ read less from version headers into variables
+ FindFLEX: fix version extraction on Apple
+ FindGettext: remove code duplicating FPHSA checks
+ include FPHSA from current directory in all modules
+ FindOpenSceneGraph: simplify by using more features of FPHSA
+ FindSDL: add SDLMAIN_LIBRARY only once (#13262)
+ add documentation for all MSVCxxx version variables (#12567)
+
+Sergei Nikulov (1):
+ fix for discovering ft2build.h using FREETYPE_DIR environment var (#13502)
+
+Stephen Kelly (60):
+ Add new qt4_use_modules function.
+ Add missing whitespace to docs.
+ Fix some typos in the docs.
+ Remove incorrect doc string for link type enum
+ Remove duplicate 'of' from docs.
+ Fix unfortunate documentation error for PIC feature.
+ Don't duplicate -D defines sent to the compiler.
+ Fix CompileDefinitions test on Visual Studio.
+ Fix the test setting COMPILE_DEFINITIONS target property
+ Rename files from main.cpp to more meaningful names.
+ Fix casing of 'Qt' in docs, comments and user-visible strings.
+ Read entire Qt4 qrc file when parsing for depends info.
+ Add a return-after-error if an old Qt is found.
+ Use CMake platform variables instead of Qt ones.
+ Move variable setting down to where it relates to.
+ Remove an if which is always true.
+ Use add_subdirectory instead of the obsolete subdirs.
+ Replace two include_directories with a setting.
+ Compile with both Qt4 and Qt5.
+ Build with Qt5 if it is found.
+ cmGeneratorExpression: Re-write for multi-stage evaluation
+ cmGeneratorExpression: Port users to two-stage processing
+ Fix the regular expression validator for target names.
+ Handle colons as a special case in the generator expression parser.
+ Enable deprecated API when using Qt 5.
+ Add more forwarding API to cmGeneratorTarget.
+ Store cmGeneratorTargets with the makefile.
+ Move GenerateTargetManifest to cmGeneratorTarget.
+ Move GetLinkInformation to cmGeneratorTarget
+ Make cmLocalGenerator::AddArchitectureFlags take a cmGeneratorTarget.
+ Move GetCreateRuleVariable to cmGeneratorTarget.
+ Port cmLocalGenerator::GetTargetFlags to cmGeneratorTarget.
+ Move GetIncludeDirectories to cmGeneratorTarget.
+ Append the COMPILE_DEFINITIONS from the Makefile to all targets.
+ Add a wrapper for accessing config-specific compile-definitions.
+ Add convenience for getting a cmGeneratorTarget to use.
+ Fix compiler warning with initialization order.
+ Revert "Move GenerateTargetManifest to cmGeneratorTarget."
+ Use the cmGeneratorTarget for the include directories API.
+ Fix indentation in the code blocks generator.
+ Port remaining code to GetCompileDefinitions().
+ Add include guard for cmGeneratorExpression.
+ Don't prepend a path before generator expressions in include_directories.
+ Convert paths in INCLUDE_DIRECTORIES property to Unix slashes.
+ Add an AppendDefines std::string overload.
+ Return a std::string from GetCompileDefinitions.
+ Refactor GetCompileDefinitions a bit.
+ Extend the generator expression language with more logic.
+ Add a generator expression for target properties.
+ Add API to check that dependent target properties form a DAG.
+ Add a self-reference check for target properties.
+ Early return if there is no target.
+ Process generator expressions in the INCLUDE_DIRECTORIES property.
+ Process generator expressions in the COMPILE_DEFINITIONS target property.
+ Fix the layout of the generator expression documentation.
+ Fix punctuation in some variables documentation.
+ Document that generator expressions can be used in target properties.
+ Remove unused parameter marker and the unused parameter.
+ Fix minor typos.
+ Remove period at the end of the check message.
+
+Tom Schutter (2):
+ cmake-mode.el: Use more readable regex and case-fold-search
+ cmake-mode.el: add local keybindings
+
+Xavier Besseron (7):
+ cmCTestSVN: Add the new SVNInfo structure
+ cmCTestSVN: Extend Revision struct with SVN repo information
+ cmCTestSVN: Add the Repositories list and the RootInfo pointer
+ cmCTestSVN: Create the SVNInfo for the root repository
+ cmCTestSVN: Use the SVNInfo structure
+ cmCTestSVN: Add a LoadExternal() function and an ExternalParser class
+ cmCTestSVN: Load and process information from externals
+
+Yuchen Deng (1):
+ Add PDB_OUTPUT_DIRECTORY and PDB_NAME target properties (#10830)
+
+Yury G. Kudryashov (7):
+ exports: Move cmTargetExport to a dedicated header file
+ exports: Remove cmTargetExport constructor
+ exports: Rename cmGlobalGenerator::AddTargetToExport{s,}
+ exports: Create class cmExportSet
+ exports: Add cmExportSetMap class
+ exports: Hold an ExportSet pointer in cm*Export*Generator
+ exports: cmGlobalGenerator::ExportSets destructor will clear it
+
+Zack Galbreath (2):
+ Clean up documentation formatting so that it is rendered properly in HTML.
+ cmparseMSBuildXML: Include DisplayName in the output
+
Changes in CMake 2.8.9 (since 2.8.9-rc3)
----------------------------------------
None
diff --git a/Docs/cmake-mode.el b/Docs/cmake-mode.el
index 478bc7a..6feed94 100644
--- a/Docs/cmake-mode.el
+++ b/Docs/cmake-mode.el
@@ -68,9 +68,9 @@ set the path with these commands:
"\\|" "[ \t\r\n]"
"\\)*"))
(defconst cmake-regex-block-open
- "^\\([iI][fF]\\|[mM][aA][cC][rR][oO]\\|[fF][oO][rR][eE][aA][cC][hH]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[wW][hH][iI][lL][eE]\\|[fF][uU][nN][cC][tT][iI][oO][nN]\\)$")
+ "^\\(if\\|macro\\|foreach\\|else\\|elseif\\|while\\|function\\)$")
(defconst cmake-regex-block-close
- "^[ \t]*\\([eE][nN][dD][iI][fF]\\|[eE][nN][dD][fF][oO][rR][eE][aA][cC][hH]\\|[eE][nN][dD][mM][aA][cC][rR][oO]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[eE][nN][dD][wW][hH][iI][lL][eE]\\|[eE][nN][dD][fF][uU][nN][cC][tT][iI][oO][nN]\\)[ \t]*(")
+ "^[ \t]*\\(endif\\|endforeach\\|endmacro\\|else\\|elseif\\|endwhile\\|endfunction\\)[ \t]*(")
;------------------------------------------------------------------------------
@@ -126,6 +126,7 @@ set the path with these commands:
(beginning-of-line)
(let ((point-start (point))
+ (case-fold-search t) ;; case-insensitive
token)
; Search back for the last indented line.
@@ -229,13 +230,26 @@ the indentation. Otherwise it retains the same position on the line"
;;
(defvar cmake-tab-width 2)
+;;
+;; Keymap.
+;;
+(defvar cmake-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-ch" 'cmake-help-command)
+ (define-key map "\C-cl" 'cmake-help-list-commands)
+ (define-key map "\C-cu" 'unscreamify-cmake-buffer)
+ map)
+ "Keymap used in cmake-mode buffers.")
+
;------------------------------------------------------------------------------
;;
;; CMake mode startup function.
;;
(defun cmake-mode ()
- "Major mode for editing CMake listfiles."
+ "Major mode for editing CMake listfiles.
+
+\\{cmake-mode-map}"
(interactive)
(kill-all-local-variables)
(setq major-mode 'cmake-mode)
@@ -262,6 +276,9 @@ the indentation. Otherwise it retains the same position on the line"
(make-local-variable 'comment-start)
(setq comment-start "#")
+ ; Setup keymap.
+ (use-local-map cmake-mode-map)
+
; Run user hooks.
(run-hooks 'cmake-mode-hook))
diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in
index 13f2161..640bf70 100644
--- a/Modules/AutomocInfo.cmake.in
+++ b/Modules/AutomocInfo.cmake.in
@@ -1,7 +1,6 @@
set(AM_SOURCES @_moc_files@ )
set(AM_HEADERS @_moc_headers@ )
set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
-set(AM_MOC_DEFINITIONS @_moc_defs@)
set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS @_moc_options@)
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")
diff --git a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
index 9f7f03e..b1c4fdf 100644
--- a/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
+++ b/Modules/BasicConfigVersion-AnyNewerVersion.cmake.in
@@ -1,5 +1,5 @@
# This is a basic version file for the Config-mode of find_package().
-# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
+# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
diff --git a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
index 7bcea88..4acd9bb 100644
--- a/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
+++ b/Modules/BasicConfigVersion-SameMajorVersion.cmake.in
@@ -1,5 +1,5 @@
# This is a basic version file for the Config-mode of find_package().
-# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file()
+# It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file.
#
# The created file sets PACKAGE_VERSION_EXACT if the current version string and
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index c5bde9a..2d76c7a 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -20,6 +20,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
+#elif defined(__PATHCC__)
+# define COMPILER_ID "PathScale"
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
+
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@@ -95,14 +103,6 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 2c8dd4b..5e70a41 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -25,6 +25,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif
+#elif defined(__PATHCC__)
+# define COMPILER_ID "PathScale"
+# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
+# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
+# if defined(__PATHCC_PATCHLEVEL__)
+# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
+# endif
+
#elif defined(__clang__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@@ -100,14 +108,6 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
-#elif defined(__PATHCC__)
-# define COMPILER_ID "PathScale"
-# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
-# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
-# if defined(__PATHCC_PATCHLEVEL__)
-# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
-# endif
-
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
diff --git a/Modules/CMakeDetermineVSServicePack.cmake b/Modules/CMakeDetermineVSServicePack.cmake
index 33f0141..98e5bb8 100644
--- a/Modules/CMakeDetermineVSServicePack.cmake
+++ b/Modules/CMakeDetermineVSServicePack.cmake
@@ -9,6 +9,7 @@
# vc90sp1
# vc100
# vc100sp1
+# vc110
#
# Usage:
# ===========================
@@ -54,6 +55,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
set(_version "vc100")
elseif(${_cl_version} VERSION_EQUAL "16.00.40219.01")
set(_version "vc100sp1")
+ elseif(${_cl_version} VERSION_EQUAL "17.00.50727.1")
+ set(_version "vc110")
else()
set(_version "")
endif()
diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake
index 1e2dd5c..562e248 100644
--- a/Modules/CTest.cmake
+++ b/Modules/CTest.cmake
@@ -73,6 +73,8 @@ function(GET_VS_VERSION_STRING generator var)
set(${var} ${ver_string} PARENT_SCOPE)
endfunction()
+include(CTestUseLaunchers)
+
if(BUILD_TESTING)
# Setup some auxilary macros
macro(SET_IF_NOT_SET var val)
@@ -243,18 +245,6 @@ if(BUILD_TESTING)
set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
endif()
- if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
- set(CTEST_USE_LAUNCHERS 0)
- endif()
- if(CTEST_USE_LAUNCHERS)
- set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
- set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
- set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
- set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
- set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
- set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
- endif()
-
mark_as_advanced(
BZRCOMMAND
BZR_UPDATE_OPTIONS
diff --git a/Modules/CTestUseLaunchers.cmake b/Modules/CTestUseLaunchers.cmake
new file mode 100644
index 0000000..6731d37
--- /dev/null
+++ b/Modules/CTestUseLaunchers.cmake
@@ -0,0 +1,49 @@
+# - Set the RULE_LAUNCH_* global properties when CTEST_USE_LAUNCHERS is on.
+# CTestUseLaunchers is automatically included when you include(CTest).
+# However, it is split out into its own module file so projects
+# can use the CTEST_USE_LAUNCHERS functionality independently.
+#
+# To use launchers, set CTEST_USE_LAUNCHERS to ON in a ctest -S
+# dashboard script, and then also set it in the cache of the configured
+# project. Both cmake and ctest need to know the value of it for the launchers
+# to work properly. CMake needs to know in order to generate proper build
+# rules, and ctest, in order to produce the proper error and warning
+# analysis.
+#
+# For convenience, you may set the ENV variable CTEST_USE_LAUNCHERS_DEFAULT
+# in your ctest -S script, too. Then, as long as your CMakeLists uses
+# include(CTest) or include(CTestUseLaunchers), it will use the value of the
+# ENV variable to initialize a CTEST_USE_LAUNCHERS cache variable. This cache
+# variable initialization only occurs if CTEST_USE_LAUNCHERS is not already
+# defined.
+
+#=============================================================================
+# Copyright 2008-2012 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+if(NOT DEFINED CTEST_USE_LAUNCHERS AND DEFINED ENV{CTEST_USE_LAUNCHERS_DEFAULT})
+ set(CTEST_USE_LAUNCHERS "$ENV{CTEST_USE_LAUNCHERS_DEFAULT}"
+ CACHE INTERNAL "CTEST_USE_LAUNCHERS initial value from ENV")
+endif()
+
+if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
+ set(CTEST_USE_LAUNCHERS 0)
+endif()
+
+if(CTEST_USE_LAUNCHERS)
+ set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
+ set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
+ set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
+ set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
+endif()
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 70ab9be..daf2dd0 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -71,7 +71,7 @@ macro(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
"exist passed with the following output:\n"
"${OUTPUT}\n\n")
else()
- message(STATUS "Looking for ${_description} - not found.")
+ message(STATUS "Looking for ${_description} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} "
diff --git a/Modules/CheckSymbolExists.cmake b/Modules/CheckSymbolExists.cmake
index 59b9942..5a8597f 100644
--- a/Modules/CheckSymbolExists.cmake
+++ b/Modules/CheckSymbolExists.cmake
@@ -89,7 +89,7 @@ macro(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
"${OUTPUT}\nFile ${SOURCEFILE}:\n"
"${CMAKE_CONFIGURABLE_FILE_CONTENT}\n")
else()
- message(STATUS "Looking for ${SYMBOL} - not found.")
+ message(STATUS "Looking for ${SYMBOL} - not found")
set(${VARIABLE} "" CACHE INTERNAL "Have symbol ${SYMBOL}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the ${SYMBOL} "
diff --git a/Modules/Compiler/Clang-ASM.cmake b/Modules/Compiler/Clang-ASM.cmake
index a908b60..16c9c15 100644
--- a/Modules/Compiler/Clang-ASM.cmake
+++ b/Modules/Compiler/Clang-ASM.cmake
@@ -1 +1,5 @@
-include(Compiler/GNU-ASM)
+include(Compiler/Clang)
+
+set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S;asm)
+
+__compiler_clang(ASM)
diff --git a/Modules/Compiler/Clang-C.cmake b/Modules/Compiler/Clang-C.cmake
index f7baf68..98fcd0b 100644
--- a/Modules/Compiler/Clang-C.cmake
+++ b/Modules/Compiler/Clang-C.cmake
@@ -1 +1,2 @@
-include(Compiler/GNU-C)
+include(Compiler/Clang)
+__compiler_clang(C)
diff --git a/Modules/Compiler/Clang-CXX.cmake b/Modules/Compiler/Clang-CXX.cmake
index d3c403a..486e2af 100644
--- a/Modules/Compiler/Clang-CXX.cmake
+++ b/Modules/Compiler/Clang-CXX.cmake
@@ -1 +1,2 @@
-include(Compiler/GNU-CXX)
+include(Compiler/Clang)
+__compiler_clang(CXX)
diff --git a/Modules/Compiler/Clang.cmake b/Modules/Compiler/Clang.cmake
new file mode 100644
index 0000000..75a971d
--- /dev/null
+++ b/Modules/Compiler/Clang.cmake
@@ -0,0 +1,26 @@
+
+#=============================================================================
+# Copyright 2002-2012 Kitware, Inc.
+#
+# Distributed under the OSI-approved BSD License (the "License");
+# see accompanying file Copyright.txt for details.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+# (To distribute this file outside of CMake, substitute the full
+# License text for the above reference.)
+
+# This module is shared by multiple languages; use include blocker.
+if(__COMPILER_CLANG)
+ return()
+endif()
+set(__COMPILER_CLANG 1)
+
+include(Compiler/GNU)
+
+macro(__compiler_clang lang)
+ __compiler_gnu(${lang})
+ set(CMAKE_${lang}_COMPILE_OPTIONS_PIE "-fPIE")
+endmacro()
diff --git a/Modules/DartConfiguration.tcl.in b/Modules/DartConfiguration.tcl.in
index ad7f805..9e49ac7 100644
--- a/Modules/DartConfiguration.tcl.in
+++ b/Modules/DartConfiguration.tcl.in
@@ -44,6 +44,7 @@ CVSUpdateOptions: @CVS_UPDATE_OPTIONS@
# Subversion options
SVNCommand: @SVNCOMMAND@
+SVNOptions: @CTEST_SVN_OPTIONS@
SVNUpdateOptions: @SVN_UPDATE_OPTIONS@
# Git options
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index 5b29c30..8d57860 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -412,7 +412,7 @@ function(_ep_write_downloadfile_script script_filename remote local timeout hash
endif()
if("${hash}" MATCHES "${_ep_hash_regex}")
- set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1} ${CMAKE_MATCH_2})
+ set(hash_args EXPECTED_HASH ${CMAKE_MATCH_1}=${CMAKE_MATCH_2})
else()
set(hash_args "# no EXPECTED_HASH")
endif()
diff --git a/Modules/FindCURL.cmake b/Modules/FindCURL.cmake
index e080f1a..0fb8f45 100644
--- a/Modules/FindCURL.cmake
+++ b/Modules/FindCURL.cmake
@@ -24,13 +24,15 @@
find_path(CURL_INCLUDE_DIR NAMES curl/curl.h)
mark_as_advanced(CURL_INCLUDE_DIR)
-# Look for the library.
+# Look for the library (sorted from most current/relevant entry to least).
find_library(CURL_LIBRARY NAMES
curl
# Windows MSVC prebuilts:
curllib
libcurl_imp
curllib_static
+ # Windows older "Win32 - MSVC" prebuilts (libcurl.lib, e.g. libcurl-7.15.5-win32-msvc.zip):
+ libcurl
)
mark_as_advanced(CURL_LIBRARY)
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 49af0f2..517a9ac 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -54,7 +54,7 @@
#=============================================================================
# Copyright 2009 Kitware, Inc.
-# Copyright 2008-2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2008-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -66,10 +66,13 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.4 (10/4/2012) (CMake 2.8.10)
+# * 12596: Missing paths for FindGTK2 on NetBSD
+# * 12049: Fixed detection of GTK include files in the lib folder on
+# multiarch systems.
# Version 1.3 (11/9/2010) (CMake 2.8.4)
# * 11429: Add support for detecting GTK2 built with Visual Studio 10.
# Thanks to Vincent Levesque for the patch.
-
# Version 1.2 (8/30/2010) (CMake 2.8.3)
# * Merge patch for detecting gdk-pixbuf library (split off
# from core GTK in 2.21). Thanks to Vincent Untz for the patch
@@ -151,7 +154,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
"_GTK2_FIND_INCLUDE_DIR( ${_var} ${_hdr} )")
endif()
- set(_relatives
+ set(_gtk_packages
# If these ever change, things will break.
${GTK2_ADDITIONAL_SUFFIXES}
glibmm-2.4
@@ -172,8 +175,15 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
sigc++-2.0
)
- set(_suffixes include lib)
- foreach(_d ${_relatives})
+ #
+ # NOTE: The following suffixes cause searching for header files in both of
+ # these directories:
+ # /usr/include/<pkg>
+ # /usr/lib/<pkg>/include
+ #
+
+ set(_suffixes)
+ foreach(_d ${_gtk_packages})
list(APPEND _suffixes ${_d})
list(APPEND _suffixes ${_d}/include) # for /usr/lib/gtk-2.0/include
endforeach()
@@ -183,18 +193,35 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
"include suffixes = ${_suffixes}")
endif()
+ if(CMAKE_LIBRARY_ARCHITECTURE)
+ set(_gtk2_arch_dir /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE})
+ if(GTK2_DEBUG)
+ message(STATUS "Adding ${_gtk2_arch_dir} to search path for multiarch support")
+ endif()
+ endif()
find_path(${_var} ${_hdr}
PATHS
+ ${_gtk2_arch_dir}
/usr/local/lib64
+ /usr/local/lib
/usr/lib64
- /opt/gnome
- /opt/openwin
- /usr/openwin
- /sw
- /opt/local
- ENV GTKMM_BASEPATH
- [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]
+ /usr/lib
+ /opt/gnome/include
+ /opt/gnome/lib
+ /opt/openwin/include
+ /usr/openwin/lib
+ /sw/include
+ /sw/lib
+ /opt/local/include
+ /opt/local/lib
+ /usr/pkg/lib
+ /usr/pkg/include/glib
+ $ENV{GTKMM_BASEPATH}/include
+ $ENV{GTKMM_BASEPATH}/lib
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include
+ [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/lib
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/include
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\gtkmm\\2.4;Path]/lib
PATH_SUFFIXES
${_suffixes}
)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index ae50ca7..4ce4de9 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -576,6 +576,11 @@ foreach (lang C CXX Fortran)
try_regular_compiler(${lang} regular_compiler_worked)
endif()
+ set(MPI_${lang}_FIND_QUIETLY ${MPI_FIND_QUIETLY})
+ set(MPI_${lang}_FIND_REQUIRED ${MPI_FIND_REQUIRED})
+ set(MPI_${lang}_FIND_VERSION ${MPI_FIND_VERSION})
+ set(MPI_${lang}_FIND_VERSION_EXACT ${MPI_FIND_VERSION_EXACT})
+
if (regular_compiler_worked)
find_package_handle_standard_args(MPI_${lang} DEFAULT_MSG MPI_${lang}_COMPILER)
else()
diff --git a/Modules/FindOpenSSL.cmake b/Modules/FindOpenSSL.cmake
index e2cc427..224c88e 100644
--- a/Modules/FindOpenSSL.cmake
+++ b/Modules/FindOpenSSL.cmake
@@ -87,6 +87,7 @@ if(WIN32 AND NOT CYGWIN)
find_library(LIB_EAY_DEBUG
NAMES
libeay32MDd
+ libeay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
@@ -108,6 +109,7 @@ if(WIN32 AND NOT CYGWIN)
find_library(SSL_EAY_DEBUG
NAMES
ssleay32MDd
+ ssleay32d
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
"lib"
@@ -127,6 +129,11 @@ if(WIN32 AND NOT CYGWIN)
"lib/VC"
)
+ set(LIB_EAY_LIBRARY_DEBUG "${LIB_EAY_DEBUG}")
+ set(LIB_EAY_LIBRARY_RELEASE "${LIB_EAY_RELEASE}")
+ set(SSL_EAY_LIBRARY_DEBUG "${SSL_EAY_DEBUG}")
+ set(SSL_EAY_LIBRARY_RELEASE "${SSL_EAY_RELEASE}")
+
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
select_library_configurations(LIB_EAY)
select_library_configurations(SSL_EAY)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 888e109..25d8df3 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -120,6 +120,9 @@ macro(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
list(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
set(configsText "${configsText} ${filename} (version ${version})\n")
endforeach()
+ if (${_NAME}_NOT_FOUND_MESSAGE)
+ set(configsText "${configsText} Reason given by package: ${${_NAME}_NOT_FOUND_MESSAGE}\n")
+ endif()
_FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
else()
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 6a1d349..e3c898b 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -111,6 +111,7 @@ find_path(PostgreSQL_TYPE_INCLUDE_DIR
# Look in other places.
${PostgreSQL_ROOT_DIRECTORIES}
PATH_SUFFIXES
+ postgresql
pgsql/server
postgresql/server
include/server
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index adaec95..f2e9f25 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -1,16 +1,17 @@
-# Locate SDL library
+# - Locate SDL library
# This module defines
-# SDL_LIBRARY, the name of the library to link against
-# SDL_FOUND, if false, do not try to link to SDL
-# SDL_INCLUDE_DIR, where to find SDL.h
+# SDL_LIBRARY, the name of the library to link against
+# SDL_FOUND, if false, do not try to link to SDL
+# SDL_INCLUDE_DIR, where to find SDL.h
+# SDL_VERSION_STRING, human-readable string containing the version of SDL
#
# This module responds to the the flag:
-# SDL_BUILDING_LIBRARY
-# If this is defined, then no SDL_main will be linked in because
-# only applications need main().
-# Otherwise, it is assumed you are building an application and this
-# module will attempt to locate and set the the proper link flags
-# as part of the returned SDL_LIBRARY variable.
+# SDL_BUILDING_LIBRARY
+# If this is defined, then no SDL_main will be linked in because
+# only applications need main().
+# Otherwise, it is assumed you are building an application and this
+# module will attempt to locate and set the the proper link flags
+# as part of the returned SDL_LIBRARY variable.
#
# Don't forget to include SDLmain.h and SDLmain.m your project for the
# OS X framework based version. (Other versions link to -lSDLmain which
@@ -54,6 +55,7 @@
#=============================================================================
# Copyright 2003-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -68,18 +70,7 @@
find_path(SDL_INCLUDE_DIR SDL.h
HINTS
ENV SDLDIR
- PATH_SUFFIXES include/SDL include
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ PATH_SUFFIXES include/SDL include/SDL12 include/SDL11 include
)
# SDL-1.1 is the name used by FreeBSD ports...
@@ -89,11 +80,6 @@ find_library(SDL_LIBRARY_TEMP
HINTS
ENV SDLDIR
PATH_SUFFIXES lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
)
if(NOT SDL_BUILDING_LIBRARY)
@@ -169,7 +155,24 @@ if(SDL_LIBRARY_TEMP)
set(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
endif()
+if(SDL_INCLUDE_DIR AND EXISTS "${SDL_INCLUDE_DIR}/SDL_version.h")
+ file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_INCLUDE_DIR}/SDL_version.h" SDL_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MAJOR "${SDL_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_VERSION_MINOR "${SDL_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_VERSION_PATCH "${SDL_VERSION_PATCH_LINE}")
+ set(SDL_VERSION_STRING ${SDL_VERSION_MAJOR}.${SDL_VERSION_MINOR}.${SDL_VERSION_PATCH})
+ unset(SDL_VERSION_MAJOR_LINE)
+ unset(SDL_VERSION_MINOR_LINE)
+ unset(SDL_VERSION_PATCH_LINE)
+ unset(SDL_VERSION_MAJOR)
+ unset(SDL_VERSION_MINOR)
+ unset(SDL_VERSION_PATCH)
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
- REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)
+ REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR
+ VERSION_VAR SDL_VERSION_STRING)
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 8c9e891..4cae032 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -1,8 +1,14 @@
-# Locate SDL_image library
-# This module defines
-# SDLIMAGE_LIBRARY, the name of the library to link against
-# SDLIMAGE_FOUND, if false, do not try to link to SDL
-# SDLIMAGE_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_image library
+# This module defines:
+# SDL_IMAGE_LIBRARIES, the name of the library to link against
+# SDL_IMAGE_INCLUDE_DIRS, where to find the headers
+# SDL_IMAGE_FOUND, if false, do not try to link against
+# SDL_IMAGE_VERSION_STRING - human-readable string containing the version of SDL_image
+#
+# For backward compatiblity the following variables are also set:
+# SDLIMAGE_LIBRARY (same value as SDL_IMAGE_LIBRARIES)
+# SDLIMAGE_INCLUDE_DIR (same value as SDL_IMAGE_INCLUDE_DIRS)
+# SDLIMAGE_FOUND (same value as SDL_IMAGE_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
@@ -14,6 +20,7 @@
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,40 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h
+if(NOT SDL_IMAGE_INCLUDE_DIR AND SDLIMAGE_INCLUDE_DIR)
+ set(SDL_IMAGE_INCLUDE_DIR ${SDLIMAGE_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_IMAGE_INCLUDE_DIR SDL_image.h
HINTS
ENV SDLIMAGEDIR
ENV SDLDIR
- PATH_SUFFIXES include include/SDL
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-find_library(SDLIMAGE_LIBRARY
+if(NOT SDL_IMAGE_LIBRARY AND SDLIMAGE_LIBRARY)
+ set(SDL_IMAGE_LIBRARY ${SDLIMAGE_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_IMAGE_LIBRARY
NAMES SDL_image
HINTS
ENV SDLIMAGEDIR
ENV SDLDIR
- PATH_SUFFIXES lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
)
+if(SDL_IMAGE_INCLUDE_DIR AND EXISTS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h")
+ file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_IMAGE_INCLUDE_DIR}/SDL_image.h" SDL_IMAGE_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_MAJOR "${SDL_IMAGE_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_MINOR "${SDL_IMAGE_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_IMAGE_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_IMAGE_VERSION_PATCH "${SDL_IMAGE_VERSION_PATCH_LINE}")
+ set(SDL_IMAGE_VERSION_STRING ${SDL_IMAGE_VERSION_MAJOR}.${SDL_IMAGE_VERSION_MINOR}.${SDL_IMAGE_VERSION_PATCH})
+ unset(SDL_IMAGE_VERSION_MAJOR_LINE)
+ unset(SDL_IMAGE_VERSION_MINOR_LINE)
+ unset(SDL_IMAGE_VERSION_PATCH_LINE)
+ unset(SDL_IMAGE_VERSION_MAJOR)
+ unset(SDL_IMAGE_VERSION_MINOR)
+ unset(SDL_IMAGE_VERSION_PATCH)
+endif()
+
+set(SDL_IMAGE_LIBRARIES ${SDL_IMAGE_LIBRARY})
+set(SDL_IMAGE_INCLUDE_DIRS ${SDL_IMAGE_INCLUDE_DIR})
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
- REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_image
+ REQUIRED_VARS SDL_IMAGE_LIBRARIES SDL_IMAGE_INCLUDE_DIRS
+ VERSION_VAR SDL_IMAGE_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLIMAGE_LIBRARY ${SDL_IMAGE_LIBRARIES})
+set(SDLIMAGE_INCLUDE_DIR ${SDL_IMAGE_INCLUDE_DIRS})
+set(SDLIMAGE_FOUND ${SDL_IMAGE_FOUND})
+
+mark_as_advanced(SDL_IMAGE_LIBRARY SDL_IMAGE_INCLUDE_DIR)
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index 97a8330..666fc6e 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -1,8 +1,14 @@
-# Locate SDL_mixer library
-# This module defines
-# SDLMIXER_LIBRARY, the name of the library to link against
-# SDLMIXER_FOUND, if false, do not try to link to SDL
-# SDLMIXER_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_mixer library
+# This module defines:
+# SDL_MIXER_LIBRARIES, the name of the library to link against
+# SDL_MIXER_INCLUDE_DIRS, where to find the headers
+# SDL_MIXER_FOUND, if false, do not try to link against
+# SDL_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer
+#
+# For backward compatiblity the following variables are also set:
+# SDLMIXER_LIBRARY (same value as SDL_MIXER_LIBRARIES)
+# SDLMIXER_INCLUDE_DIR (same value as SDL_MIXER_INCLUDE_DIRS)
+# SDLMIXER_FOUND (same value as SDL_MIXER_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
@@ -14,6 +20,7 @@
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,40 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h
+if(NOT SDL_MIXER_INCLUDE_DIR AND SDLMIXER_INCLUDE_DIR)
+ set(SDL_MIXER_INCLUDE_DIR ${SDLMIXER_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_MIXER_INCLUDE_DIR SDL_mixer.h
HINTS
ENV SDLMIXERDIR
ENV SDLDIR
- PATH_SUFFIXES include include/SDL
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-find_library(SDLMIXER_LIBRARY
+if(NOT SDL_MIXER_LIBRARY AND SDLMIXER_LIBRARY)
+ set(SDL_MIXER_LIBRARY ${SDLMIXER_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_MIXER_LIBRARY
NAMES SDL_mixer
HINTS
ENV SDLMIXERDIR
ENV SDLDIR
- PATH_SUFFIXES lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
)
+if(SDL_MIXER_INCLUDE_DIR AND EXISTS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h")
+ file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_MIXER_INCLUDE_DIR}/SDL_mixer.h" SDL_MIXER_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_MAJOR "${SDL_MIXER_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_MINOR "${SDL_MIXER_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_MIXER_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_MIXER_VERSION_PATCH "${SDL_MIXER_VERSION_PATCH_LINE}")
+ set(SDL_MIXER_VERSION_STRING ${SDL_MIXER_VERSION_MAJOR}.${SDL_MIXER_VERSION_MINOR}.${SDL_MIXER_VERSION_PATCH})
+ unset(SDL_MIXER_VERSION_MAJOR_LINE)
+ unset(SDL_MIXER_VERSION_MINOR_LINE)
+ unset(SDL_MIXER_VERSION_PATCH_LINE)
+ unset(SDL_MIXER_VERSION_MAJOR)
+ unset(SDL_MIXER_VERSION_MINOR)
+ unset(SDL_MIXER_VERSION_PATCH)
+endif()
+
+set(SDL_MIXER_LIBRARIES ${SDL_MIXER_LIBRARY})
+set(SDL_MIXER_INCLUDE_DIRS ${SDL_MIXER_INCLUDE_DIR})
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
- REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_mixer
+ REQUIRED_VARS SDL_MIXER_LIBRARIES SDL_MIXER_INCLUDE_DIRS
+ VERSION_VAR SDL_MIXER_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLMIXER_LIBRARY ${SDL_MIXER_LIBRARIES})
+set(SDLMIXER_INCLUDE_DIR ${SDL_MIXER_INCLUDE_DIRS})
+set(SDLMIXER_FOUND ${SDL_MIXER_FOUND})
+
+mark_as_advanced(SDL_MIXER_LIBRARY SDL_MIXER_INCLUDE_DIR)
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index 7e90e90..d8f479f 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -1,8 +1,14 @@
-# Locate SDL_net library
-# This module defines
-# SDLNET_LIBRARY, the name of the library to link against
-# SDLNET_FOUND, if false, do not try to link against
-# SDLNET_INCLUDE_DIR, where to find the headers
+# - Locate SDL_net library
+# This module defines:
+# SDL_NET_LIBRARIES, the name of the library to link against
+# SDL_NET_INCLUDE_DIRS, where to find the headers
+# SDL_NET_FOUND, if false, do not try to link against
+# SDL_NET_VERSION_STRING - human-readable string containing the version of SDL_net
+#
+# For backward compatiblity the following variables are also set:
+# SDLNET_LIBRARY (same value as SDL_NET_LIBRARIES)
+# SDLNET_INCLUDE_DIR (same value as SDL_NET_INCLUDE_DIRS)
+# SDLNET_FOUND (same value as SDL_NET_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
@@ -14,6 +20,7 @@
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,39 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-find_path(SDLNET_INCLUDE_DIR SDL_net.h
+if(NOT SDL_NET_INCLUDE_DIR AND SDLNET_INCLUDE_DIR)
+ set(SDL_NET_INCLUDE_DIR ${SDLNET_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_NET_INCLUDE_DIR SDL_net.h
HINTS
ENV SDLNETDIR
ENV SDLDIR
- PATH_SUFFIXES include include/SDL
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-find_library(SDLNET_LIBRARY
+
+if(NOT SDL_NET_LIBRARY AND SDLNET_LIBRARY)
+ set(SDL_NET_LIBRARY ${SDLNET_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_NET_LIBRARY
NAMES SDL_net
HINTS
ENV SDLNETDIR
ENV SDLDIR
- PATH_SUFFIXES lib
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
)
+if(SDL_NET_INCLUDE_DIR AND EXISTS "${SDL_NET_INCLUDE_DIR}/SDL_net.h")
+ file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_NET_INCLUDE_DIR}/SDL_net.h" SDL_NET_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_NET_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_MAJOR "${SDL_NET_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_NET_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_MINOR "${SDL_NET_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_NET_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_NET_VERSION_PATCH "${SDL_NET_VERSION_PATCH_LINE}")
+ set(SDL_NET_VERSION_STRING ${SDL_NET_VERSION_MAJOR}.${SDL_NET_VERSION_MINOR}.${SDL_NET_VERSION_PATCH})
+ unset(SDL_NET_VERSION_MAJOR_LINE)
+ unset(SDL_NET_VERSION_MINOR_LINE)
+ unset(SDL_NET_VERSION_PATCH_LINE)
+ unset(SDL_NET_VERSION_MAJOR)
+ unset(SDL_NET_VERSION_MINOR)
+ unset(SDL_NET_VERSION_PATCH)
+endif()
+
+set(SDL_NET_LIBRARIES ${SDL_NET_LIBRARY})
+set(SDL_NET_INCLUDE_DIRS ${SDL_NET_INCLUDE_DIR})
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
- REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_net
+ REQUIRED_VARS SDL_NET_LIBRARIES SDL_NET_INCLUDE_DIRS
+ VERSION_VAR SDL_NET_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLNET_LIBRARY ${SDL_NET_LIBRARIES})
+set(SDLNET_INCLUDE_DIR ${SDL_NET_INCLUDE_DIRS})
+set(SDLNET_FOUND ${SDL_NET_FOUND})
+
+mark_as_advanced(SDL_NET_LIBRARY SDL_NET_INCLUDE_DIR)
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index a9153c1..5ff50be 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -1,34 +1,34 @@
-# Locates the SDL_sound library
-
+# - Locates the SDL_sound library
+#
# This module depends on SDL being found and
# must be called AFTER FindSDL.cmake is called.
-
+#
# This module defines
-# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
-# SDL_SOUND_FOUND, if false, do not try to link to SDL
-# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
-# to link against. This is a read-only variable and is marked INTERNAL.
-# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
-# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
-# This is available mostly for cases this module failed to anticipate for
-# and you must add additional flags. This is marked as ADVANCED.
-
+# SDL_SOUND_INCLUDE_DIR, where to find SDL_sound.h
+# SDL_SOUND_FOUND, if false, do not try to link to SDL_sound
+# SDL_SOUND_LIBRARIES, this contains the list of libraries that you need
+# to link against. This is a read-only variable and is marked INTERNAL.
+# SDL_SOUND_EXTRAS, this is an optional variable for you to add your own
+# flags to SDL_SOUND_LIBRARIES. This is prepended to SDL_SOUND_LIBRARIES.
+# This is available mostly for cases this module failed to anticipate for
+# and you must add additional flags. This is marked as ADVANCED.
+# SDL_SOUND_VERSION_STRING, human-readable string containing the version of SDL_sound
#
# This module also defines (but you shouldn't need to use directly)
-# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
-# against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
+# SDL_SOUND_LIBRARY, the name of just the SDL_sound library you would link
+# against. Use SDL_SOUND_LIBRARIES for you link instructions and not this one.
# And might define the following as needed
-# MIKMOD_LIBRARY
-# MODPLUG_LIBRARY
-# OGG_LIBRARY
-# VORBIS_LIBRARY
-# SMPEG_LIBRARY
-# FLAC_LIBRARY
-# SPEEX_LIBRARY
+# MIKMOD_LIBRARY
+# MODPLUG_LIBRARY
+# OGG_LIBRARY
+# VORBIS_LIBRARY
+# SMPEG_LIBRARY
+# FLAC_LIBRARY
+# SPEEX_LIBRARY
#
# Typically, you should not use these variables directly, and you should use
# SDL_SOUND_LIBRARIES which contains SDL_SOUND_LIBRARY and the other audio libraries
-# (if needed) to successfully compile on your system .
+# (if needed) to successfully compile on your system.
#
# Created by Eric Wing.
# This module is a bit more complicated than the other FindSDL* family modules.
@@ -54,10 +54,10 @@
# People will have to manually change the cache values of
# SDL_LIBRARY to override this selectionor set the CMake environment
# CMAKE_INCLUDE_PATH to modify the search paths.
-#
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -77,17 +77,7 @@ find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
HINTS
ENV SDLSOUNDDIR
ENV SDLDIR
- PATH_SUFFIXES
- include include/SDL
- PATHS
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ PATH_SUFFIXES SDL SDL12 SDL11
)
find_library(SDL_SOUND_LIBRARY
@@ -95,13 +85,6 @@ find_library(SDL_SOUND_LIBRARY
HINTS
ENV SDLSOUNDDIR
ENV SDLDIR
- PATH_SUFFIXES
- lib
- PATHS
- /sw
- /opt/local
- /opt/csw
- /opt
)
if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
@@ -176,7 +159,8 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# in the SDL_LIBRARY string after the "-framework".
# But if I quote the stuff in INCLUDE_DIRECTORIES, it doesn't work.
file(WRITE ${PROJECT_BINARY_DIR}/CMakeTmp/CMakeLists.txt
- "project(DetermineSoundLibs)
+ "cmake_minimum_required(VERSION 2.8)
+ project(DetermineSoundLibs)
include_directories(${SDL_INCLUDE_DIR} ${SDL_SOUND_INCLUDE_DIR})
add_executable(DetermineSoundLibs DetermineSoundLibs.c)
target_link_libraries(DetermineSoundLibs ${TMP_TRY_LIBS})"
@@ -376,7 +360,24 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
set(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
endif()
+if(SDL_SOUND_INCLUDE_DIR AND EXISTS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h")
+ file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SOUND_VER_MAJOR[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_MINOR_LINE REGEX "^#define[ \t]+SOUND_VER_MINOR[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_SOUND_INCLUDE_DIR}/SDL_sound.h" SDL_SOUND_VERSION_PATCH_LINE REGEX "^#define[ \t]+SOUND_VER_PATCH[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SOUND_VER_MAJOR[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_MAJOR "${SDL_SOUND_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SOUND_VER_MINOR[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_MINOR "${SDL_SOUND_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SOUND_VER_PATCH[ \t]+([0-9]+)$" "\\1" SDL_SOUND_VERSION_PATCH "${SDL_SOUND_VERSION_PATCH_LINE}")
+ set(SDL_SOUND_VERSION_STRING ${SDL_SOUND_VERSION_MAJOR}.${SDL_SOUND_VERSION_MINOR}.${SDL_SOUND_VERSION_PATCH})
+ unset(SDL_SOUND_VERSION_MAJOR_LINE)
+ unset(SDL_SOUND_VERSION_MINOR_LINE)
+ unset(SDL_SOUND_VERSION_PATCH_LINE)
+ unset(SDL_SOUND_VERSION_MAJOR)
+ unset(SDL_SOUND_VERSION_MINOR)
+ unset(SDL_SOUND_VERSION_PATCH)
+endif()
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
- REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_sound
+ REQUIRED_VARS SDL_SOUND_LIBRARY SDL_SOUND_INCLUDE_DIR
+ VERSION_VAR SDL_SOUND_VERSION_STRING)
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 1e68ccf..2cc5ee2 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -1,8 +1,14 @@
-# Locate SDL_ttf library
-# This module defines
-# SDLTTF_LIBRARY, the name of the library to link against
-# SDLTTF_FOUND, if false, do not try to link to SDL
-# SDLTTF_INCLUDE_DIR, where to find SDL/SDL.h
+# - Locate SDL_ttf library
+# This module defines:
+# SDL_TTF_LIBRARIES, the name of the library to link against
+# SDL_TTF_INCLUDE_DIRS, where to find the headers
+# SDL_TTF_FOUND, if false, do not try to link against
+# SDL_TTF_VERSION_STRING - human-readable string containing the version of SDL_ttf
+#
+# For backward compatiblity the following variables are also set:
+# SDLTTF_LIBRARY (same value as SDL_TTF_LIBRARIES)
+# SDLTTF_INCLUDE_DIR (same value as SDL_TTF_INCLUDE_DIRS)
+# SDLTTF_FOUND (same value as SDL_TTF_FOUND)
#
# $SDLDIR is an environment variable that would
# correspond to the ./configure --prefix=$SDLDIR
@@ -14,6 +20,7 @@
#=============================================================================
# Copyright 2005-2009 Kitware, Inc.
+# Copyright 2012 Benjamin Eikel
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -25,40 +32,56 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h
+if(NOT SDL_TTF_INCLUDE_DIR AND SDLTTF_INCLUDE_DIR)
+ set(SDL_TTF_INCLUDE_DIR ${SDLTTF_INCLUDE_DIR} CACHE PATH "directory cache
+entry initialized from old variable name")
+endif()
+find_path(SDL_TTF_INCLUDE_DIR SDL_ttf.h
HINTS
ENV SDLTTFDIR
ENV SDLDIR
- PATH_SUFFIXES include include/SDL
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /usr/local/include/SDL12
- /usr/local/include/SDL11 # FreeBSD ports
- /usr/include/SDL12
- /usr/include/SDL11
- /sw # Fink
- /opt/local # DarwinPorts
- /opt/csw # Blastwave
- /opt
+ PATH_SUFFIXES SDL SDL12 SDL11
)
-find_library(SDLTTF_LIBRARY
+if(NOT SDL_TTF_LIBRARY AND SDLTTF_LIBRARY)
+ set(SDL_TTF_LIBRARY ${SDLTTF_LIBRARY} CACHE FILEPATH "file cache entry
+initialized from old variable name")
+endif()
+find_library(SDL_TTF_LIBRARY
NAMES SDL_ttf
HINTS
ENV SDLTTFDIR
ENV SDLDIR
- PATHS
- ~/Library/Frameworks
- /Library/Frameworks
- /sw
- /opt/local
- /opt/csw
- /opt
- PATH_SUFFIXES lib
)
+if(SDL_TTF_INCLUDE_DIR AND EXISTS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h")
+ file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MAJOR_LINE REGEX "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_MINOR_LINE REGEX "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+[0-9]+$")
+ file(STRINGS "${SDL_TTF_INCLUDE_DIR}/SDL_ttf.h" SDL_TTF_VERSION_PATCH_LINE REGEX "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+[0-9]+$")
+ string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MAJOR "${SDL_TTF_VERSION_MAJOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_MINOR "${SDL_TTF_VERSION_MINOR_LINE}")
+ string(REGEX REPLACE "^#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)$" "\\1" SDL_TTF_VERSION_PATCH "${SDL_TTF_VERSION_PATCH_LINE}")
+ set(SDL_TTF_VERSION_STRING ${SDL_TTF_VERSION_MAJOR}.${SDL_TTF_VERSION_MINOR}.${SDL_TTF_VERSION_PATCH})
+ unset(SDL_TTF_VERSION_MAJOR_LINE)
+ unset(SDL_TTF_VERSION_MINOR_LINE)
+ unset(SDL_TTF_VERSION_PATCH_LINE)
+ unset(SDL_TTF_VERSION_MAJOR)
+ unset(SDL_TTF_VERSION_MINOR)
+ unset(SDL_TTF_VERSION_PATCH)
+endif()
+
+set(SDL_TTF_LIBRARIES ${SDL_TTF_LIBRARY})
+set(SDL_TTF_INCLUDE_DIRS ${SDL_TTF_INCLUDE_DIR})
+
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF
- REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_ttf
+ REQUIRED_VARS SDL_TTF_LIBRARIES SDL_TTF_INCLUDE_DIRS
+ VERSION_VAR SDL_TTF_VERSION_STRING)
+
+# for backward compatiblity
+set(SDLTTF_LIBRARY ${SDL_TTF_LIBRARIES})
+set(SDLTTF_INCLUDE_DIR ${SDL_TTF_INCLUDE_DIRS})
+set(SDLTTF_FOUND ${SDL_TTF_FOUND})
+
+mark_as_advanced(SDL_TTF_LIBRARY SDL_TTF_INCLUDE_DIR)
diff --git a/Modules/FortranCInterface.cmake b/Modules/FortranCInterface.cmake
index aafecb4..c59e1f8 100644
--- a/Modules/FortranCInterface.cmake
+++ b/Modules/FortranCInterface.cmake
@@ -61,7 +61,7 @@
# If the check fails and QUIET is not given the function terminates
# with a FATAL_ERROR message describing the problem. The purpose of
# this check is to stop a build early for incompatible compiler
-# combinations.
+# combinations. The test is built in the Release configuration.
#
# FortranCInterface is aware of possible GLOBAL and MODULE manglings
# for many Fortran compilers, but it also provides an interface to
@@ -250,6 +250,7 @@ function(FortranCInterface_VERIFY)
message(STATUS "${_desc}")
# Build a sample project which reports symbols.
+ set(CMAKE_TRY_COMPILE_CONFIGURATION Release)
try_compile(FortranCInterface_VERIFY_${lang}_COMPILED
${FortranCInterface_BINARY_DIR}/Verify${lang}
${FortranCInterface_SOURCE_DIR}/Verify
@@ -259,6 +260,9 @@ function(FortranCInterface_VERIFY)
"-DCMAKE_C_FLAGS:STRING=${CMAKE_C_FLAGS}"
"-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}"
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
+ "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELEASE}"
+ "-DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELEASE}"
+ "-DCMAKE_Fortran_FLAGS_RELEASE:STRING=${CMAKE_Fortran_FLAGS_RELEASE}"
OUTPUT_VARIABLE _output)
file(WRITE "${FortranCInterface_BINARY_DIR}/Verify${lang}/output.txt" "${_output}")
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 9e8a6d9..ffc425e 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -902,7 +902,7 @@ SectionEnd
Function .onInit
StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst
- ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_NAME@" "UninstallString"
+ ReadRegStr $0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@CPACK_PACKAGE_INSTALL_REGISTRY_KEY@" "UninstallString"
StrCmp $0 "" inst
MessageBox MB_YESNOCANCEL|MB_ICONEXCLAMATION \
diff --git a/Modules/Platform/Windows-Intel.cmake b/Modules/Platform/Windows-Intel.cmake
index 41e150a..58da8c5 100644
--- a/Modules/Platform/Windows-Intel.cmake
+++ b/Modules/Platform/Windows-Intel.cmake
@@ -89,8 +89,9 @@ macro(__windows_compiler_intel lang)
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_SHARED_MODULE "${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+ set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_${lang}_LINK_EXECUTABLE
- "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> <OBJECTS> /link /implib:<TARGET_IMPLIB> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Od /RTC1")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/DNDEBUG /MD /O1")
@@ -98,14 +99,11 @@ macro(__windows_compiler_intel lang)
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/DNDEBUG /MD /Zi /O2")
if(_INTEL_COMPILER_SUPPORTS_MANIFEST)
- if(CMAKE_GENERATOR MATCHES "Ninja")
- set(NO_RSP_EXPAND _no_rsp_expand)
- endif()
set(CMAKE_${lang}_LINK_EXECUTABLE
- "<CMAKE_COMMAND> -E vs_link_exe${NO_RSP_EXPAND} ${CMAKE_${lang}_LINK_EXECUTABLE}")
+ "<CMAKE_COMMAND> -E vs_link_exe ${CMAKE_${lang}_LINK_EXECUTABLE}")
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
- "<CMAKE_COMMAND> -E vs_link_dll${NO_RSP_EXPAND} ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
+ "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}")
set(CMAKE_${lang}_CREATE_SHARED_MODULE
- "<CMAKE_COMMAND> -E vs_link_dll${NO_RSP_EXPAND} ${CMAKE_${lang}_CREATE_SHARED_MODULE}")
+ "<CMAKE_COMMAND> -E vs_link_dll ${CMAKE_${lang}_CREATE_SHARED_MODULE}")
endif()
endmacro()
diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake
index da0dba9..1f28c50 100644
--- a/Modules/Platform/Windows-MSVC.cmake
+++ b/Modules/Platform/Windows-MSVC.cmake
@@ -212,11 +212,8 @@ set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZER
macro(__windows_compiler_msvc lang)
if(NOT "${CMAKE_${lang}_COMPILER_VERSION}" VERSION_LESS 14)
# for 2005 make sure the manifest is put in the dll with mt
- if(CMAKE_GENERATOR MATCHES "Ninja")
- set(NO_RSP_EXPAND _no_rsp_expand)
- endif()
- set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll${NO_RSP_EXPAND} ")
- set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe${NO_RSP_EXPAND} ")
+ set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
+ set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
endif()
set(CMAKE_${lang}_CREATE_SHARED_LIBRARY
"${_CMAKE_VS_LINK_DLL}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
@@ -231,9 +228,10 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
"<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_LINK_EXECUTABLE
- "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> -link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> <OBJECTS> /link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3 /Zm1000${_FLAGS_${lang}}")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}")
diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake
index 9a87be1..7e2ac9f 100644
--- a/Modules/Platform/Windows-df.cmake
+++ b/Modules/Platform/Windows-df.cmake
@@ -26,8 +26,9 @@ set(CMAKE_Fortran_COMPILE_OBJECT
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_Fortran_LINK_EXECUTABLE
- "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /exe:<TARGET> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ "<CMAKE_Fortran_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /exe:<TARGET> <OBJECTS> /link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_CREATE_WIN32_EXE /winapp)
set(CMAKE_CREATE_CONSOLE_EXE )
diff --git a/Modules/SelectLibraryConfigurations.cmake b/Modules/SelectLibraryConfigurations.cmake
index 82bb173..62137bb 100644
--- a/Modules/SelectLibraryConfigurations.cmake
+++ b/Modules/SelectLibraryConfigurations.cmake
@@ -48,24 +48,28 @@ macro( select_library_configurations basename )
# if only the debug version was found, set the release value to be the
# debug value.
_set_library_name( ${basename} DEBUG RELEASE )
+
+ # Set a default case, which will come into effect if
+ # -no build type is set and the generator only supports one build type
+ # at a time (i.e. CMAKE_CONFIGURATION_TYPES is false)
+ # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are the same
+ # -${basename}_LIBRARY_DEBUG and ${basename}_LIBRARY_RELEASE are both empty
+ set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
+ set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
+
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE )
# if the generator supports configuration types or CMAKE_BUILD_TYPE
# is set, then set optimized and debug options.
if( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE )
set( ${basename}_LIBRARY )
- foreach( _libname LISTS ${basename}_LIBRARY_RELEASE )
+ foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
endforeach()
- foreach( _libname LISTS ${basename}_LIBRARY_DEBUG )
+ foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
endforeach()
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
- else()
- # If there are no configuration types or build type, just use
- # the release version
- set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
- set( ${basename}_LIBRARIES ${${basename}_LIBRARY_RELEASE} )
endif()
endif()
diff --git a/Modules/readme.txt b/Modules/readme.txt
index 7d61d8d..9dc1c6a 100644
--- a/Modules/readme.txt
+++ b/Modules/readme.txt
@@ -18,6 +18,9 @@ XXX_VERSION_YY Expect Version YY if true. Make sure at most one of thes
XXX_WRAP_YY If False, do not try to use the relevent CMake wrapping command.
XXX_YY_FOUND If False, optional YY part of XXX sytem is not available.
XXX_FOUND Set to false, or undefined, if we haven't found, or don't want to use XXX.
+XXX_NOT_FOUND_MESSAGE Should be set by config-files in the case that it has set XXX_FOUND to FALSE.
+ The contained message will be printed by the find_package() command and by
+ find_package_handle_standard_args() to inform the user about the problem.
XXX_RUNTIME_LIBRARY_DIRS Optionally, the runtime library search path for use when running an executable linked to shared libraries.
The list should be used by user code to create the PATH on windows or LD_LIBRARY_PATH on unix.
This should not be a cache entry.
@@ -124,7 +127,10 @@ If neither the QUIET nor REQUIRED options are given then the
FindXXX.cmake module should look for the package and complain without
error if the module is not found.
-A package can be provide sub-components.
+FIND_PACKAGE() will set the variable CMAKE_FIND_PACKAGE_NAME to
+contain the actual name of the package.
+
+A package can provide sub-components.
Those components can be listed after the COMPONENTS (or REQUIRED)
or OPTIONAL_COMPONENTS keywords. The set of all listed components will be
specified in a XXX_FIND_COMPONENTS variable.
diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt
index 354f123..8bf6c40 100644
--- a/Source/CMakeLists.txt
+++ b/Source/CMakeLists.txt
@@ -176,6 +176,10 @@ set(SRCS
cmExportFileGenerator.cxx
cmExportInstallFileGenerator.h
cmExportInstallFileGenerator.cxx
+ cmExportSet.h
+ cmExportSet.cxx
+ cmExportSetMap.h
+ cmExportSetMap.cxx
cmExtraCodeBlocksGenerator.cxx
cmExtraCodeBlocksGenerator.h
cmExtraEclipseCDT4Generator.cxx
@@ -183,6 +187,8 @@ set(SRCS
cmFileTimeComparison.cxx
cmFileTimeComparison.h
cmGeneratedFileStream.cxx
+ cmGeneratorExpressionDAGChecker.cxx
+ cmGeneratorExpressionDAGChecker.h
cmGeneratorExpressionEvaluator.cxx
cmGeneratorExpressionEvaluator.h
cmGeneratorExpressionLexer.cxx
@@ -257,6 +263,7 @@ set(SRCS
cmSystemTools.h
cmTarget.cxx
cmTarget.h
+ cmTargetExport.h
cmTest.cxx
cmTest.h
cmTestGenerator.cxx
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 3dbb051..0894fa0 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,6 +1,6 @@
# CMake version number components.
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
-set(CMake_VERSION_PATCH 9)
-set(CMake_VERSION_TWEAK 20120921)
-#set(CMake_VERSION_RC 1)
+set(CMake_VERSION_PATCH 10)
+set(CMake_VERSION_TWEAK 0)
+#set(CMake_VERSION_RC 3)
diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index 7fa401c..6a841fa 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -31,15 +31,25 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
"Each CPack generator as a built-in default value for this"
" variable. E.g. Archive generators (ZIP, TGZ, ...) includes"
" the top level whereas RPM or DEB don't. The user may override"
- " the default value byt setting this variable.\n"
+ " the default value by setting this variable.\n"
"There is a similar variable "
- "CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"
+ "CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY "
"which may be used to override the behavior for the component"
- "packaging case which may have different default value for"
- "historical (now backward compatibility) reason.", false,
+ " packaging case which may have different default value for"
+ " historical (now backward compatibility) reason.", false,
"Variables common to all CPack generators");
cm->DefineProperty
+ ("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY", cmProperty::VARIABLE,
+ "Boolean toggle to include/exclude top level directory "
+ "(component case).",
+ "Similar usage as CPACK_INCLUDE_TOPLEVEL_DIRECTORY"
+ " but for the component case. "
+ "See CPACK_INCLUDE_TOPLEVEL_DIRECTORY documentation for"
+ " the detail.", false,
+ "Variables common to all CPack generators");
+
+ cm->DefineProperty
("CPACK_SET_DESTDIR", cmProperty::VARIABLE,
"Boolean toggle to make CPack use DESTDIR mechanism when"
" packaging.", "DESTDIR means DESTination DIRectory."
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index f113400..e964696 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -855,7 +855,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// If CPack was asked to warn on ABSOLUTE INSTALL DESTINATION
// then forward request to cmake_install.cmake script
- if (this->GetOption("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
+ if (this->IsOn("CPACK_WARN_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
mf->AddDefinition("CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
@@ -865,7 +865,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// then ask cmake_install.cmake script to error out
// as soon as it occurs (before installing file)
if (!SupportsAbsoluteDestination() ||
- this->GetOption("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
+ this->IsOn("CPACK_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION"))
{
mf->AddDefinition("CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION",
"1");
@@ -905,7 +905,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
localFileName =
cmSystemTools::RelativePath(InstallPrefix, fit->c_str());
localFileName =
- localFileName.substr(localFileName.find('/')+1,
+ localFileName.substr(localFileName.find_first_not_of('/'),
std::string::npos);
Components[installComponent].Files.push_back(localFileName);
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <"
diff --git a/Source/CTest/cmCTestMemCheckHandler.cxx b/Source/CTest/cmCTestMemCheckHandler.cxx
index a2a16d3..80218ad 100644
--- a/Source/CTest/cmCTestMemCheckHandler.cxx
+++ b/Source/CTest/cmCTestMemCheckHandler.cxx
@@ -247,7 +247,8 @@ void cmCTestMemCheckHandler::GenerateTestCommand(
{
std::vector<cmStdString>::size_type pp;
std::string memcheckcommand = "";
- memcheckcommand = this->MemoryTester;
+ memcheckcommand
+ = cmSystemTools::ConvertToOutputPath(this->MemoryTester.c_str());
for ( pp = 0; pp < this->MemoryTesterOptions.size(); pp ++ )
{
args.push_back(this->MemoryTesterOptions[pp]);
@@ -410,29 +411,46 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
"MemoryCheckCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "MemoryCheckCommand").c_str());
+ = this->CTest->GetCTestConfiguration("MemoryCheckCommand").c_str();
+
+ // determine the checker type
+ if ( this->MemoryTester.find("valgrind") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
+ }
+ else if ( this->MemoryTester.find("purify") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
+ }
+ else if ( this->MemoryTester.find("BC") != std::string::npos )
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
+ }
+ else
+ {
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::UNKNOWN;
+ }
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"PurifyCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "PurifyCommand").c_str());
+ = this->CTest->GetCTestConfiguration("PurifyCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"ValgrindCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "ValgrindCommand").c_str());
+ = this->CTest->GetCTestConfiguration("ValgrindCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
}
else if ( cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
"BoundsCheckerCommand").c_str()) )
{
this->MemoryTester
- = cmSystemTools::ConvertToOutputPath(this->CTest->GetCTestConfiguration(
- "BoundsCheckerCommand").c_str());
+ = this->CTest->GetCTestConfiguration("BoundsCheckerCommand").c_str();
+ this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
}
else
{
@@ -470,82 +488,81 @@ bool cmCTestMemCheckHandler::InitializeMemoryChecking()
this->MemoryTesterOutputFile
= this->CTest->GetBinaryDir() + "/Testing/Temporary/MemoryChecker.log";
- if ( this->MemoryTester.find("valgrind") != std::string::npos )
+ switch ( this->MemoryTesterStyle )
{
- this->MemoryTesterStyle = cmCTestMemCheckHandler::VALGRIND;
- if ( this->MemoryTesterOptions.empty() )
- {
- this->MemoryTesterOptions.push_back("-q");
- this->MemoryTesterOptions.push_back("--tool=memcheck");
- this->MemoryTesterOptions.push_back("--leak-check=yes");
- this->MemoryTesterOptions.push_back("--show-reachable=yes");
- this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
- this->MemoryTesterOptions.push_back("--num-callers=50");
- }
- if ( this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").size() )
- {
- if ( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) )
+ case cmCTestMemCheckHandler::VALGRIND:
+ if ( this->MemoryTesterOptions.empty() )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot find memory checker suppression file: "
- << this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str() << std::endl);
- return false;
- }
- std::string suppressions = "--suppressions="
- + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
- this->MemoryTesterOptions.push_back(suppressions);
- }
- }
- else if ( this->MemoryTester.find("purify") != std::string::npos )
- {
- this->MemoryTesterStyle = cmCTestMemCheckHandler::PURIFY;
- std::string outputFile;
-#ifdef _WIN32
- if( this->CTest->GetCTestConfiguration(
+ this->MemoryTesterOptions.push_back("-q");
+ this->MemoryTesterOptions.push_back("--tool=memcheck");
+ this->MemoryTesterOptions.push_back("--leak-check=yes");
+ this->MemoryTesterOptions.push_back("--show-reachable=yes");
+ this->MemoryTesterOptions.push_back("--workaround-gcc296-bugs=yes");
+ this->MemoryTesterOptions.push_back("--num-callers=50");
+ }
+ if ( this->CTest->GetCTestConfiguration(
"MemoryCheckSuppressionFile").size() )
+ {
+ if ( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str()) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot find memory checker suppression file: "
+ << this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str() << std::endl);
+ return false;
+ }
+ std::string suppressions = "--suppressions="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(suppressions);
+ }
+ break;
+ case cmCTestMemCheckHandler::PURIFY:
{
- if( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str()) )
+ std::string outputFile;
+#ifdef _WIN32
+ if( this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").size() )
{
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Cannot find memory checker suppression file: "
- << this->CTest->GetCTestConfiguration(
- "MemoryCheckSuppressionFile").c_str() << std::endl);
- return false;
- }
- std::string filterFiles = "/FilterFiles="
- + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
- this->MemoryTesterOptions.push_back(filterFiles);
- }
- outputFile = "/SAVETEXTDATA=";
+ if( !cmSystemTools::FileExists(this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str()) )
+ {
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Cannot find memory checker suppression file: "
+ << this->CTest->GetCTestConfiguration(
+ "MemoryCheckSuppressionFile").c_str() << std::endl);
+ return false;
+ }
+ std::string filterFiles = "/FilterFiles="
+ + this->CTest->GetCTestConfiguration("MemoryCheckSuppressionFile");
+ this->MemoryTesterOptions.push_back(filterFiles);
+ }
+ outputFile = "/SAVETEXTDATA=";
#else
- outputFile = "-log-file=";
+ outputFile = "-log-file=";
#endif
- outputFile += this->MemoryTesterOutputFile;
- this->MemoryTesterOptions.push_back(outputFile);
- }
- else if ( this->MemoryTester.find("BC") != std::string::npos )
- {
- this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
- std::string dpbdFile = this->CTest->GetBinaryDir()
- + "/Testing/Temporary/MemoryChecker.DPbd";
- this->BoundsCheckerDPBDFile = dpbdFile;
- this->MemoryTesterStyle = cmCTestMemCheckHandler::BOUNDS_CHECKER;
- this->MemoryTesterOptions.push_back("/B");
- this->MemoryTesterOptions.push_back(dpbdFile);
- this->MemoryTesterOptions.push_back("/X");
- this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
- this->MemoryTesterOptions.push_back("/M");
- }
- else
- {
- cmCTestLog(this->CTest, ERROR_MESSAGE,
- "Do not understand memory checker: " << this->MemoryTester.c_str()
- << std::endl);
- return false;
+ outputFile += this->MemoryTesterOutputFile;
+ this->MemoryTesterOptions.push_back(outputFile);
+ break;
+ }
+ case cmCTestMemCheckHandler::BOUNDS_CHECKER:
+ {
+ this->BoundsCheckerXMLFile = this->MemoryTesterOutputFile;
+ std::string dpbdFile = this->CTest->GetBinaryDir()
+ + "/Testing/Temporary/MemoryChecker.DPbd";
+ this->BoundsCheckerDPBDFile = dpbdFile;
+ this->MemoryTesterOptions.push_back("/B");
+ this->MemoryTesterOptions.push_back(dpbdFile);
+ this->MemoryTesterOptions.push_back("/X");
+ this->MemoryTesterOptions.push_back(this->MemoryTesterOutputFile);
+ this->MemoryTesterOptions.push_back("/M");
+ break;
+ }
+ default:
+ cmCTestLog(this->CTest, ERROR_MESSAGE,
+ "Do not understand memory checker: " << this->MemoryTester.c_str()
+ << std::endl);
+ return false;
}
std::vector<cmStdString>::size_type cc;
diff --git a/Source/CTest/cmCTestSVN.cxx b/Source/CTest/cmCTestSVN.cxx
index 49cea2e..2668c8e 100644
--- a/Source/CTest/cmCTestSVN.cxx
+++ b/Source/CTest/cmCTestSVN.cxx
@@ -38,11 +38,11 @@ cmCTestSVN::~cmCTestSVN()
//----------------------------------------------------------------------------
void cmCTestSVN::CleanupImpl()
{
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_cleanup[] = {svn, "cleanup", 0};
+ std::vector<const char*> svn_cleanup;
+ svn_cleanup.push_back("cleanup");
OutputLogger out(this->Log, "cleanup-out> ");
OutputLogger err(this->Log, "cleanup-err> ");
- this->RunChild(svn_cleanup, &out, &err);
+ this->RunSVNCommand(svn_cleanup, &out, &err);
}
//----------------------------------------------------------------------------
@@ -106,12 +106,13 @@ static bool cmCTestSVNPathStarts(std::string const& p1, std::string const& p2)
std::string cmCTestSVN::LoadInfo(SVNInfo& svninfo)
{
// Run "svn info" to get the repository info from the work tree.
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_info[] = {svn, "info", svninfo.LocalPath.c_str(), 0};
+ std::vector<const char*> svn_info;
+ svn_info.push_back("info");
+ svn_info.push_back(svninfo.LocalPath.c_str());
std::string rev;
InfoParser out(this, "info-out> ", rev, svninfo);
OutputLogger err(this->Log, "info-err> ");
- this->RunChild(svn_info, &out, &err);
+ this->RunSVNCommand(svn_info, &out, &err);
return rev;
}
@@ -285,19 +286,52 @@ bool cmCTestSVN::UpdateImpl()
}
std::vector<char const*> svn_update;
- svn_update.push_back(this->CommandLineTool.c_str());
svn_update.push_back("update");
- svn_update.push_back("--non-interactive");
for(std::vector<cmStdString>::const_iterator ai = args.begin();
ai != args.end(); ++ai)
{
svn_update.push_back(ai->c_str());
}
- svn_update.push_back(0);
UpdateParser out(this, "up-out> ");
OutputLogger err(this->Log, "up-err> ");
- return this->RunUpdateCommand(&svn_update[0], &out, &err);
+ return this->RunSVNCommand(svn_update, &out, &err);
+}
+
+//----------------------------------------------------------------------------
+bool cmCTestSVN::RunSVNCommand(std::vector<char const*> const& parameters,
+ OutputParser* out, OutputParser* err)
+{
+ if(parameters.empty()) return false;
+
+ std::vector<char const*> args;
+ args.push_back(this->CommandLineTool.c_str());
+
+ args.insert(args.end(), parameters.begin(), parameters.end());
+
+ args.push_back("--non-interactive");
+
+ std::string userOptions =
+ this->CTest->GetCTestConfiguration("SVNOptions");
+
+ std::vector<cmStdString> parsedUserOptions =
+ cmSystemTools::ParseArguments(userOptions.c_str());
+ for(std::vector<cmStdString>::iterator i = parsedUserOptions.begin();
+ i != parsedUserOptions.end(); ++i)
+ {
+ args.push_back(i->c_str());
+ }
+
+ args.push_back(0);
+
+ if(strcmp(parameters[0], "update") == 0)
+ {
+ return RunUpdateCommand(&args[0], out, err);
+ }
+ else
+ {
+ return RunChild(&args[0], out, err);
+ }
}
//----------------------------------------------------------------------------
@@ -417,14 +451,15 @@ void cmCTestSVN::LoadRevisions(SVNInfo &svninfo)
}
// Run "svn log" to get all global revisions of interest.
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_log[] = {svn, "log", "--xml", "-v", revs.c_str(),
- svninfo.LocalPath.c_str(), 0};
- {
+ std::vector<const char*> svn_log;
+ svn_log.push_back("log");
+ svn_log.push_back("--xml");
+ svn_log.push_back("-v");
+ svn_log.push_back(revs.c_str());
+ svn_log.push_back(svninfo.LocalPath.c_str());
LogParser out(this, "log-out> ", svninfo);
OutputLogger err(this->Log, "log-err> ");
- this->RunChild(svn_log, &out, &err);
- }
+ this->RunSVNCommand(svn_log, &out, &err);
}
//----------------------------------------------------------------------------
@@ -492,11 +527,11 @@ private:
void cmCTestSVN::LoadModifications()
{
// Run "svn status" which reports local modifications.
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_status[] = {svn, "status", "--non-interactive", 0};
+ std::vector<const char*> svn_status;
+ svn_status.push_back("status");
StatusParser out(this, "status-out> ");
OutputLogger err(this->Log, "status-err> ");
- this->RunChild(svn_status, &out, &err);
+ this->RunSVNCommand(svn_status, &out, &err);
}
//----------------------------------------------------------------------------
@@ -550,11 +585,11 @@ private:
void cmCTestSVN::LoadExternals()
{
// Run "svn status" to get the list of external repositories
- const char* svn = this->CommandLineTool.c_str();
- const char* svn_status[] = {svn, "status", 0};
+ std::vector<const char*> svn_status;
+ svn_status.push_back("status");
ExternalParser out(this, "external-out> ");
OutputLogger err(this->Log, "external-err> ");
- this->RunChild(svn_status, &out, &err);
+ this->RunSVNCommand(svn_status, &out, &err);
}
//----------------------------------------------------------------------------
diff --git a/Source/CTest/cmCTestSVN.h b/Source/CTest/cmCTestSVN.h
index 56265d0..c6548e3 100644
--- a/Source/CTest/cmCTestSVN.h
+++ b/Source/CTest/cmCTestSVN.h
@@ -33,6 +33,9 @@ private:
virtual void NoteNewRevision();
virtual bool UpdateImpl();
+ bool RunSVNCommand(std::vector<char const*> const& parameters,
+ OutputParser* out, OutputParser* err);
+
// Information about an SVN repository (root repository or external)
struct SVNInfo {
@@ -60,6 +63,7 @@ private:
// Extended revision structure to include info about external it refers to.
struct Revision;
+ friend struct Revision;
// Info of all the repositories (root, externals and nested ones).
std::list<SVNInfo> Repositories;
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index ead449e..b796b83 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -1304,9 +1304,10 @@ int cmCTestTestHandler::ExecuteCommands(std::vector<cmStdString>& vec)
for ( it = vec.begin(); it != vec.end(); ++it )
{
int retVal = 0;
- cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << *it
+ std::string cmd = cmSystemTools::ConvertToOutputPath(it->c_str());
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Run command: " << cmd
<< std::endl);
- if ( !cmSystemTools::RunSingleCommand(it->c_str(), 0, &retVal, 0,
+ if ( !cmSystemTools::RunSingleCommand(cmd.c_str(), 0, &retVal, 0,
cmSystemTools::OUTPUT_MERGE
/*this->Verbose*/) || retVal != 0 )
{
diff --git a/Source/CTest/cmCTestUpdateCommand.cxx b/Source/CTest/cmCTestUpdateCommand.cxx
index 8414349..2ca9f6c 100644
--- a/Source/CTest/cmCTestUpdateCommand.cxx
+++ b/Source/CTest/cmCTestUpdateCommand.cxx
@@ -44,6 +44,8 @@ cmCTestGenericHandler* cmCTestUpdateCommand::InitializeHandler()
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"SVNUpdateOptions", "CTEST_SVN_UPDATE_OPTIONS");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
+ "SVNOptions", "CTEST_SVN_OPTIONS");
+ this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"BZRCommand", "CTEST_BZR_COMMAND");
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"BZRUpdateOptions", "CTEST_BZR_UPDATE_OPTIONS");
diff --git a/Source/CTest/cmCTestVC.h b/Source/CTest/cmCTestVC.h
index 44e1dac..9dd0651 100644
--- a/Source/CTest/cmCTestVC.h
+++ b/Source/CTest/cmCTestVC.h
@@ -67,6 +67,9 @@ protected:
virtual void NoteNewRevision();
virtual bool WriteXMLUpdates(std::ostream& xml);
+#if defined(__SUNPRO_CC) && __SUNPRO_CC <= 0x510
+public: // Sun CC 5.1 needs help to allow cmCTestSVN::Revision to see this
+#endif
/** Basic information about one revision of a tree or file. */
struct Revision
{
@@ -80,6 +83,7 @@ protected:
std::string Log;
};
+protected:
struct File;
friend struct File;
diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt
index a1ffa20..29daffd 100644
--- a/Source/QtDialog/CMakeLists.txt
+++ b/Source/QtDialog/CMakeLists.txt
@@ -25,6 +25,8 @@ if (Qt5Widgets_FOUND)
qt5_add_resources(${ARGN})
endmacro()
set(QT_LIBRARIES ${Qt5Widgets_LIBRARIES})
+ # Remove this when the minimum version of Qt is 4.6.
+ add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0)
else()
set(QT_MIN_VERSION "4.4.0")
find_package(Qt4 REQUIRED)
diff --git a/Source/cmAddTestCommand.h b/Source/cmAddTestCommand.h
index b11bff9..6a0cd9d 100644
--- a/Source/cmAddTestCommand.h
+++ b/Source/cmAddTestCommand.h
@@ -81,7 +81,7 @@ public:
"\n"
"Arguments after COMMAND may use \"generator expressions\" with the "
"syntax \"$<...>\". "
- CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
+ CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS
"Example usage:\n"
" add_test(NAME mytest\n"
" COMMAND testDriver --config $<CONFIGURATION>\n"
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 74c673a..445fd0e 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -12,7 +12,7 @@
#ifndef cmDocumentGeneratorExpressions_h
#define cmDocumentGeneratorExpressions_h
-#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS \
+#define CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
"Generator expressions are evaluted during build system generation " \
"to produce information specific to each build configuration. " \
"Valid expressions are:\n" \
@@ -20,6 +20,12 @@
" $<1:...> = content of \"...\"\n" \
" $<CONFIG:cfg> = '1' if config is \"cfg\", else '0'\n" \
" $<CONFIGURATION> = configuration name\n" \
+ " $<BOOL:...> = '1' if the '...' is true, else '0'\n" \
+ " $<STREQUAL:a,b> = '1' if a is STREQUAL b, else '0'\n" \
+ " $<ANGLE-R> = A literal '>'. Used to compare " \
+ "strings which contain a '>' for example.\n" \
+ " $<COMMA> = A literal ','. Used to compare " \
+ "strings which contain a ',' for example.\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
" $<TARGET_SONAME_FILE:tgt> = file with soname (.so.3)\n" \
@@ -29,6 +35,10 @@
" $<TARGET_FILE_DIR:tgt>/$<TARGET_FILE_NAME:tgt>\n" \
" $<TARGET_LINKER_FILE_DIR:tgt>/$<TARGET_LINKER_FILE_NAME:tgt>\n" \
" $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n" \
+ "\n" \
+ " $<TARGET_PROPERTY:tgt,prop> = The value of the property prop\n" \
+ "on the target tgt. Note that tgt is not added as a dependency of\n" \
+ "the target this expression is evaluated on.\n" \
"Boolean expressions:\n" \
" $<AND:?[,?]...> = '1' if all '?' are '1', else '0'\n" \
" $<OR:?[,?]...> = '0' if all '?' are '0', else '1'\n" \
@@ -36,4 +46,11 @@
"where '?' is always either '0' or '1'.\n" \
""
+#define CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS \
+ CM_DOCUMENT_ADD_TEST_GENERATOR_EXPRESSIONS \
+ "Expressions with an implicit 'this' target:\n" \
+ " $<TARGET_PROPERTY:prop> = The value of the property prop on\n" \
+ "the target on which the generator expression is evaluated.\n" \
+ ""
+
#endif
diff --git a/Source/cmDocumentLocationUndefined.h b/Source/cmDocumentLocationUndefined.h
index d1be77a..9aecf21 100644
--- a/Source/cmDocumentLocationUndefined.h
+++ b/Source/cmDocumentLocationUndefined.h
@@ -16,8 +16,8 @@
"\n" \
"Do not set properties that affect the location of a target after " \
action ". These include properties whose names match " \
- "\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\" " \
- "or \"(IMPLIB_)?(PREFIX|SUFFIX)\". " \
+ "\"(RUNTIME|LIBRARY|ARCHIVE)_OUTPUT_(NAME|DIRECTORY)(_<CONFIG>)?\", " \
+ "\"(IMPLIB_)?(PREFIX|SUFFIX)\", or \"LINKER_LANGUAGE\". " \
"Failure to follow this rule is not diagnosed and leaves the location " \
"of the target undefined."
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index 5e7e081..8db0e8f 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -701,7 +701,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_SYSTEM_IGNORE_PATH", cmProperty::VARIABLE,
"Path to be ignored by FIND_XXX() commands.",
- "Specifies directories to be ignored by searches in FIND_XXX() commands "
+ "Specifies directories to be ignored by searches in FIND_XXX() "
+ "commands. "
"This is useful in cross-compiled environments where some system "
"directories contain incompatible but possibly linkable libraries. For "
"example, on cross-compiled cluster environments, this allows a user to "
@@ -716,7 +717,8 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty
("CMAKE_IGNORE_PATH", cmProperty::VARIABLE,
"Path to be ignored by FIND_XXX() commands.",
- "Specifies directories to be ignored by searches in FIND_XXX() commands "
+ "Specifies directories to be ignored by searches in FIND_XXX() "
+ "commands. "
"This is useful in cross-compiled environments where some system "
"directories contain incompatible but possibly linkable libraries. For "
"example, on cross-compiled cluster environments, this allows a user to "
@@ -1211,6 +1213,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Variables that Control the Build");
cm->DefineProperty
+ ("CMAKE_PDB_OUTPUT_DIRECTORY", cmProperty::VARIABLE,
+ "Where to put all the MS debug symbol files.",
+ "This variable is used to initialize the "
+ "PDB_OUTPUT_DIRECTORY property on all the targets. "
+ "See that target property for additional information.",
+ false,
+ "Variables that Control the Build");
+
+ cm->DefineProperty
("CMAKE_AUTOMOC", cmProperty::VARIABLE,
"Whether to handle moc automatically for Qt targets.",
"This variable is used to initialize the "
diff --git a/Source/cmDocumentation.cxx b/Source/cmDocumentation.cxx
index c1360ef..debde3b 100644
--- a/Source/cmDocumentation.cxx
+++ b/Source/cmDocumentation.cxx
@@ -155,7 +155,7 @@ static const char *cmDocumentationStandardSeeAlso[][3] =
static const char *cmDocumentationCopyright[][3] =
{
{0,
- "Copyright 2000-2009 Kitware, Inc., Insight Software Consortium. "
+ "Copyright 2000-2012 Kitware, Inc., Insight Software Consortium. "
"All rights reserved.", 0},
{0,
"Redistribution and use in source and binary forms, with or without "
diff --git a/Source/cmExportBuildFileGenerator.cxx b/Source/cmExportBuildFileGenerator.cxx
index 32595ee..fb3f39f 100644
--- a/Source/cmExportBuildFileGenerator.cxx
+++ b/Source/cmExportBuildFileGenerator.cxx
@@ -72,8 +72,9 @@ cmExportBuildFileGenerator
if(!properties.empty())
{
// Get the rest of the target details.
+ std::vector<std::string> missingTargets;
this->SetImportDetailProperties(config, suffix,
- target, properties);
+ target, properties, missingTargets);
// TOOD: PUBLIC_HEADER_LOCATION
// This should wait until the build feature propagation stuff
@@ -82,6 +83,7 @@ cmExportBuildFileGenerator
// properties);
// Generate code in the export file.
+ this->GenerateMissingTargetsCheckCode(os, missingTargets);
this->GenerateImportPropertyCode(os, config, target, properties);
}
}
@@ -133,6 +135,25 @@ cmExportBuildFileGenerator
//----------------------------------------------------------------------------
void
+cmExportBuildFileGenerator::HandleMissingTarget(
+ std::string& link_libs, std::vector<std::string>&,
+ cmMakefile*, cmTarget* depender, cmTarget* dependee)
+{
+ // The target is not in the export.
+ if(!this->AppendMode)
+ {
+ // We are not appending, so all exported targets should be
+ // known here. This is probably user-error.
+ this->ComplainAboutMissingTarget(depender, dependee);
+ }
+ // Assume the target will be exported by another command.
+ // Append it with the export namespace.
+ link_libs += this->Namespace;
+ link_libs += dependee->GetName();
+}
+
+//----------------------------------------------------------------------------
+void
cmExportBuildFileGenerator
::ComplainAboutMissingTarget(cmTarget* depender,
cmTarget* dependee)
diff --git a/Source/cmExportBuildFileGenerator.h b/Source/cmExportBuildFileGenerator.h
index 0f37626..726537b 100644
--- a/Source/cmExportBuildFileGenerator.h
+++ b/Source/cmExportBuildFileGenerator.h
@@ -45,8 +45,14 @@ protected:
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
std::string const& suffix);
- virtual void ComplainAboutMissingTarget(cmTarget* depender,
- cmTarget* dependee);
+ virtual void HandleMissingTarget(std::string& link_libs,
+ std::vector<std::string>& missingTargets,
+ cmMakefile* mf,
+ cmTarget* depender,
+ cmTarget* dependee);
+
+ void ComplainAboutMissingTarget(cmTarget* depender,
+ cmTarget* dependee);
/** Fill in properties indicating built file locations. */
void SetImportLocationProperty(const char* config,
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index eb19df5e..8dffae4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -11,10 +11,15 @@
============================================================================*/
#include "cmExportFileGenerator.h"
+#include "cmExportSet.h"
#include "cmGeneratedFileStream.h"
+#include "cmGlobalGenerator.h"
+#include "cmInstallExportGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmSystemTools.h"
#include "cmTarget.h"
+#include "cmTargetExport.h"
#include "cmVersion.h"
#include <cmsys/auto_ptr.hxx>
@@ -123,7 +128,9 @@ void cmExportFileGenerator::GenerateImportConfig(std::ostream& os,
void
cmExportFileGenerator
::SetImportDetailProperties(const char* config, std::string const& suffix,
- cmTarget* target, ImportPropertyMap& properties)
+ cmTarget* target, ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets
+ )
{
// Get the makefile in which to lookup target information.
cmMakefile* mf = target->GetMakefile();
@@ -159,13 +166,13 @@ cmExportFileGenerator
{
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_INTERFACE_LANGUAGES",
- iface->Languages, properties);
+ iface->Languages, properties, missingTargets);
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_INTERFACE_LIBRARIES",
- iface->Libraries, properties);
+ iface->Libraries, properties, missingTargets);
this->SetImportLinkProperty(suffix, target,
"IMPORTED_LINK_DEPENDENT_LIBRARIES",
- iface->SharedDeps, properties);
+ iface->SharedDeps, properties, missingTargets);
if(iface->Multiplicity > 0)
{
std::string prop = "IMPORTED_LINK_INTERFACE_MULTIPLICITY";
@@ -184,7 +191,9 @@ cmExportFileGenerator
cmTarget* target,
const char* propName,
std::vector<std::string> const& libs,
- ImportPropertyMap& properties)
+ ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets
+ )
{
// Skip the property if there are no libraries.
if(libs.empty())
@@ -224,17 +233,7 @@ cmExportFileGenerator
}
else
{
- // The target is not in the export.
- if(!this->AppendMode)
- {
- // We are not appending, so all exported targets should be
- // known here. This is probably user-error.
- this->ComplainAboutMissingTarget(target, tgt);
- }
- // Assume the target will be exported by another command.
- // Append it with the export namespace.
- link_libs += this->Namespace;
- link_libs += *li;
+ this->HandleMissingTarget(link_libs, missingTargets, mf, target, tgt);
}
}
else
@@ -250,6 +249,7 @@ cmExportFileGenerator
properties[prop] = link_libs;
}
+
//----------------------------------------------------------------------------
void cmExportFileGenerator::GenerateImportHeaderCode(std::ostream& os,
const char* config)
@@ -381,6 +381,30 @@ cmExportFileGenerator
//----------------------------------------------------------------------------
+void cmExportFileGenerator::GenerateMissingTargetsCheckCode(std::ostream& os,
+ const std::vector<std::string>& missingTargets)
+{
+ os << "# Make sure the targets which have been exported in some other \n"
+ "# export set exist.\n";
+ for(unsigned int i=0; i<missingTargets.size(); ++i)
+ {
+ os << "IF(NOT TARGET \"" << missingTargets[i] << "\" )\n"
+ << " IF(CMAKE_FIND_PACKAGE_NAME)\n"
+ << " SET( ${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE)\n"
+ << " SET( ${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "
+ << "\"Required imported target \\\"" << missingTargets[i]
+ << "\\\" not found ! \")\n"
+ << " ELSE()\n"
+ << " MESSAGE(FATAL_ERROR \"Required imported target \\\""
+ << missingTargets[i] << "\\\" not found ! \")\n"
+ << " ENDIF()\n"
+ << "ENDIF()\n";
+ }
+ os << "\n";
+}
+
+
+//----------------------------------------------------------------------------
void
cmExportFileGenerator::GenerateImportedFileCheckLoop(std::ostream& os)
{
diff --git a/Source/cmExportFileGenerator.h b/Source/cmExportFileGenerator.h
index f271e55..70bc65d 100644
--- a/Source/cmExportFileGenerator.h
+++ b/Source/cmExportFileGenerator.h
@@ -60,17 +60,21 @@ protected:
ImportPropertyMap const& properties,
const std::set<std::string>& importedLocations);
void GenerateImportedFileCheckLoop(std::ostream& os);
+ void GenerateMissingTargetsCheckCode(std::ostream& os,
+ const std::vector<std::string>& missingTargets);
// Collect properties with detailed information about targets beyond
// their location on disk.
void SetImportDetailProperties(const char* config,
std::string const& suffix, cmTarget* target,
- ImportPropertyMap& properties);
+ ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets);
void SetImportLinkProperty(std::string const& suffix,
cmTarget* target, const char* propName,
std::vector<std::string> const& libs,
- ImportPropertyMap& properties);
+ ImportPropertyMap& properties,
+ std::vector<std::string>& missingTargets);
/** Each subclass knows how to generate its kind of export file. */
virtual bool GenerateMainFile(std::ostream& os) = 0;
@@ -80,10 +84,13 @@ protected:
const char* config,
std::string const& suffix) = 0;
- /** Each subclass knows how to complain about a target that is
- missing from an export set. */
- virtual void ComplainAboutMissingTarget(cmTarget* depender,
- cmTarget* dependee) = 0;
+ /** Each subclass knows how to deal with a target that is missing from an
+ * export set. */
+ virtual void HandleMissingTarget(std::string& link_libs,
+ std::vector<std::string>& missingTargets,
+ cmMakefile* mf,
+ cmTarget* depender,
+ cmTarget* dependee) = 0;
// The namespace in which the exports are placed in the generated file.
std::string Namespace;
diff --git a/Source/cmExportInstallFileGenerator.cxx b/Source/cmExportInstallFileGenerator.cxx
index da14dd7..7841731 100644
--- a/Source/cmExportInstallFileGenerator.cxx
+++ b/Source/cmExportInstallFileGenerator.cxx
@@ -11,14 +11,19 @@
============================================================================*/
#include "cmExportInstallFileGenerator.h"
+#include "cmExportSet.h"
+#include "cmExportSetMap.h"
#include "cmGeneratedFileStream.h"
+#include "cmGlobalGenerator.h"
+#include "cmLocalGenerator.h"
#include "cmInstallExportGenerator.h"
#include "cmInstallTargetGenerator.h"
+#include "cmTargetExport.h"
//----------------------------------------------------------------------------
cmExportInstallFileGenerator
::cmExportInstallFileGenerator(cmInstallExportGenerator* iegen):
- InstallExportGenerator(iegen)
+ IEGen(iegen)
{
}
@@ -36,10 +41,10 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
{
// Create all the imported targets.
for(std::vector<cmTargetExport*>::const_iterator
- tei = this->ExportSet->begin();
- tei != this->ExportSet->end(); ++tei)
+ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
+ tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
{
- cmTargetExport* te = *tei;
+ cmTargetExport const* te = *tei;
if(this->ExportedTargets.insert(te->Target).second)
{
this->GenerateImportTargetCode(os, te->Target);
@@ -47,8 +52,9 @@ bool cmExportInstallFileGenerator::GenerateMainFile(std::ostream& os)
else
{
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\" ...) "
- << "includes target \"" << te->Target->GetName()
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\" ...) " << "includes target \"" << te->Target->GetName()
<< "\" more than once in the export set.";
cmSystemTools::Error(e.str().c_str());
return false;
@@ -84,7 +90,7 @@ bool
cmExportInstallFileGenerator::GenerateImportFileConfig(const char* config)
{
// Skip configurations not enabled for this export.
- if(!this->InstallExportGenerator->InstallsForConfig(config))
+ if(!this->IEGen->InstallsForConfig(config))
{
return true;
}
@@ -140,7 +146,7 @@ cmExportInstallFileGenerator
{
// Add code to compute the installation prefix relative to the
// import file location.
- const char* installDest = this->InstallExportGenerator->GetDestination();
+ const char* installDest = this->IEGen->GetDestination();
if(!cmSystemTools::FileIsFullPath(installDest))
{
std::string dest = installDest;
@@ -161,11 +167,11 @@ cmExportInstallFileGenerator
// Add each target in the set to the export.
for(std::vector<cmTargetExport*>::const_iterator
- tei = this->ExportSet->begin();
- tei != this->ExportSet->end(); ++tei)
+ tei = this->IEGen->GetExportSet()->GetTargetExports()->begin();
+ tei != this->IEGen->GetExportSet()->GetTargetExports()->end(); ++tei)
{
// Collect import properties for this target.
- cmTargetExport* te = *tei;
+ cmTargetExport const* te = *tei;
ImportPropertyMap properties;
std::set<std::string> importedLocations;
this->SetImportLocationProperty(config, suffix, te->ArchiveGenerator,
@@ -185,8 +191,9 @@ cmExportInstallFileGenerator
if(!properties.empty())
{
// Get the rest of the target details.
+ std::vector<std::string> missingTargets;
this->SetImportDetailProperties(config, suffix,
- te->Target, properties);
+ te->Target, properties, missingTargets);
// TOOD: PUBLIC_HEADER_LOCATION
// This should wait until the build feature propagation stuff
@@ -195,6 +202,7 @@ cmExportInstallFileGenerator
// properties);
// Generate code in the export file.
+ this->GenerateMissingTargetsCheckCode(os, missingTargets);
this->GenerateImportPropertyCode(os, config, te->Target, properties);
this->GenerateImportedFileChecksCode(os, te->Target, properties,
importedLocations);
@@ -306,12 +314,80 @@ cmExportInstallFileGenerator
//----------------------------------------------------------------------------
void
+cmExportInstallFileGenerator::HandleMissingTarget(
+ std::string& link_libs, std::vector<std::string>& missingTargets,
+ cmMakefile* mf, cmTarget* depender, cmTarget* dependee)
+{
+ std::string name = dependee->GetName();
+ std::vector<std::string> namespaces = this->FindNamespaces(mf, name);
+ int targetOccurrences = (int)namespaces.size();
+ if (targetOccurrences == 1)
+ {
+ std::string missingTarget = namespaces[0];
+ missingTarget += name;
+ link_libs += missingTarget;
+ missingTargets.push_back(missingTarget);
+ }
+ else
+ {
+ // We are not appending, so all exported targets should be
+ // known here. This is probably user-error.
+ this->ComplainAboutMissingTarget(depender, dependee, targetOccurrences);
+ }
+}
+
+//----------------------------------------------------------------------------
+std::vector<std::string>
+cmExportInstallFileGenerator
+::FindNamespaces(cmMakefile* mf, const std::string& name)
+{
+ std::vector<std::string> namespaces;
+ cmGlobalGenerator* gg = mf->GetLocalGenerator()->GetGlobalGenerator();
+ const cmExportSetMap& exportSets = gg->GetExportSets();
+
+ for(cmExportSetMap::const_iterator expIt = exportSets.begin();
+ expIt != exportSets.end();
+ ++expIt)
+ {
+ const cmExportSet* exportSet = expIt->second;
+ std::vector<cmTargetExport*> const* targets =
+ exportSet->GetTargetExports();
+
+ bool containsTarget = false;
+ for(unsigned int i=0; i<targets->size(); i++)
+ {
+ if (name == (*targets)[i]->Target->GetName())
+ {
+ containsTarget = true;
+ break;
+ }
+ }
+
+ if (containsTarget)
+ {
+ std::vector<cmInstallExportGenerator const*> const* installs =
+ exportSet->GetInstallations();
+ for(unsigned int i=0; i<installs->size(); i++)
+ {
+ namespaces.push_back((*installs)[i]->GetNamespace());
+ }
+ }
+ }
+
+ return namespaces;
+}
+
+
+//----------------------------------------------------------------------------
+void
cmExportInstallFileGenerator
::ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen)
{
- const char* installDest = this->InstallExportGenerator->GetDestination();
+ const char* installDest = this->IEGen->GetDestination();
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\") given absolute "
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\") given absolute "
<< "DESTINATION \"" << installDest << "\" but the export "
<< "references an installation of target \""
<< itgen->GetTarget()->GetName() << "\" which has relative "
@@ -322,12 +398,24 @@ cmExportInstallFileGenerator
//----------------------------------------------------------------------------
void
cmExportInstallFileGenerator
-::ComplainAboutMissingTarget(cmTarget* depender, cmTarget* dependee)
+::ComplainAboutMissingTarget(cmTarget* depender,
+ cmTarget* dependee,
+ int occurrences)
{
cmOStringStream e;
- e << "INSTALL(EXPORT \"" << this->Name << "\" ...) "
+ e << "INSTALL(EXPORT \""
+ << this->IEGen->GetExportSet()->GetName()
+ << "\" ...) "
<< "includes target \"" << depender->GetName()
- << "\" which requires target \"" << dependee->GetName()
- << "\" that is not in the export set.";
+ << "\" which requires target \"" << dependee->GetName() << "\" ";
+ if (occurrences == 0)
+ {
+ e << "that is not in the export set.";
+ }
+ else
+ {
+ e << "that is not in this export set, but " << occurrences
+ << " times in others.";
+ }
cmSystemTools::Error(e.str().c_str());
}
diff --git a/Source/cmExportInstallFileGenerator.h b/Source/cmExportInstallFileGenerator.h
index fb678e8..e719ecc 100644
--- a/Source/cmExportInstallFileGenerator.h
+++ b/Source/cmExportInstallFileGenerator.h
@@ -18,6 +18,7 @@ class cmInstallExportGenerator;
class cmInstallFilesGenerator;
class cmInstallTargetGenerator;
class cmTargetExport;
+class cmExportSet;
/** \class cmExportInstallFileGenerator
* \brief Generate a file exporting targets from an install tree.
@@ -40,15 +41,6 @@ public:
files. */
cmExportInstallFileGenerator(cmInstallExportGenerator* iegen);
- /** Set the name of the export associated with the files. This is
- the name given to the install(EXPORT) command mode. */
- void SetName(const char* name) { this->Name = name; }
-
- /** Set the set of targets to be exported. These are the targets
- associated with the export name. */
- void SetExportSet(std::vector<cmTargetExport*> const* eSet)
- { this->ExportSet = eSet; }
-
/** Get the per-config file generated for each configuraiton. This
maps from the configuration name to the file temporary location
for installation. */
@@ -65,8 +57,19 @@ protected:
virtual void GenerateImportTargetsConfig(std::ostream& os,
const char* config,
std::string const& suffix);
- virtual void ComplainAboutMissingTarget(cmTarget* depender,
- cmTarget* dependee);
+ virtual void HandleMissingTarget(std::string& link_libs,
+ std::vector<std::string>& missingTargets,
+ cmMakefile* mf,
+ cmTarget* depender,
+ cmTarget* dependee);
+
+ void ComplainAboutMissingTarget(cmTarget* depender,
+ cmTarget* dependee,
+ int occurrences);
+
+ std::vector<std::string> FindNamespaces(cmMakefile* mf,
+ const std::string& name);
+
/** Generate a per-configuration file for the targets. */
bool GenerateImportFileConfig(const char* config);
@@ -81,9 +84,7 @@ protected:
void ComplainAboutImportPrefix(cmInstallTargetGenerator* itgen);
- cmInstallExportGenerator* InstallExportGenerator;
- std::string Name;
- std::vector<cmTargetExport*> const* ExportSet;
+ cmInstallExportGenerator* IEGen;
std::string ImportPrefix;
@@ -91,34 +92,4 @@ protected:
std::map<cmStdString, cmStdString> ConfigImportFiles;
};
-/*
- cmTargetExport is used in cmGlobalGenerator to collect the install
- generators for targets associated with an export.
-*/
-class cmTargetExport
-{
-public:
- cmTargetExport(cmTarget* tgt,
- cmInstallTargetGenerator* archive,
- cmInstallTargetGenerator* runtime,
- cmInstallTargetGenerator* library,
- cmInstallTargetGenerator* framework,
- cmInstallTargetGenerator* bundle,
- cmInstallFilesGenerator* headers
- ) : Target(tgt), ArchiveGenerator(archive),
- RuntimeGenerator(runtime), LibraryGenerator(library),
- FrameworkGenerator(framework), BundleGenerator(bundle),
- HeaderGenerator(headers) {}
-
- cmTarget* Target;
- cmInstallTargetGenerator* ArchiveGenerator;
- cmInstallTargetGenerator* RuntimeGenerator;
- cmInstallTargetGenerator* LibraryGenerator;
- cmInstallTargetGenerator* FrameworkGenerator;
- cmInstallTargetGenerator* BundleGenerator;
- cmInstallFilesGenerator* HeaderGenerator;
-private:
- cmTargetExport();
-};
-
#endif
diff --git a/Source/cmExportSet.cxx b/Source/cmExportSet.cxx
new file mode 100644
index 0000000..33b0630
--- /dev/null
+++ b/Source/cmExportSet.cxx
@@ -0,0 +1,32 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "cmExportSet.h"
+#include "cmTargetExport.h"
+
+cmExportSet::~cmExportSet()
+{
+ for(unsigned int i = 0; i < this->TargetExports.size(); ++ i)
+ {
+ delete this->TargetExports[i];
+ }
+}
+
+void cmExportSet::AddTargetExport(cmTargetExport* te)
+{
+ this->TargetExports.push_back(te);
+}
+
+void cmExportSet::AddInstallation(cmInstallExportGenerator const* installation)
+{
+ this->Installations.push_back(installation);
+}
diff --git a/Source/cmExportSet.h b/Source/cmExportSet.h
new file mode 100644
index 0000000..a57aa12
--- /dev/null
+++ b/Source/cmExportSet.h
@@ -0,0 +1,46 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmExportSet_h
+#define cmExportSet_h
+
+#include "cmSystemTools.h"
+class cmTargetExport;
+class cmInstallExportGenerator;
+
+/// A set of targets that were installed with the same EXPORT parameter.
+class cmExportSet
+{
+public:
+ /// Construct an empty export set named \a name
+ cmExportSet(const std::string &name) : Name(name) {}
+ /// Destructor
+ ~cmExportSet();
+
+ void AddTargetExport(cmTargetExport* tgt);
+
+ void AddInstallation(cmInstallExportGenerator const* installation);
+
+ std::string const& GetName() const { return this->Name; }
+
+ std::vector<cmTargetExport*> const* GetTargetExports() const
+ { return &this->TargetExports; }
+
+ std::vector<cmInstallExportGenerator const*> const* GetInstallations() const
+ { return &this->Installations; }
+
+private:
+ std::vector<cmTargetExport*> TargetExports;
+ std::string Name;
+ std::vector<cmInstallExportGenerator const*> Installations;
+};
+
+#endif
diff --git a/Source/cmExportSetMap.cxx b/Source/cmExportSetMap.cxx
new file mode 100644
index 0000000..96fdb3e
--- /dev/null
+++ b/Source/cmExportSetMap.cxx
@@ -0,0 +1,34 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "cmExportSetMap.h"
+#include "cmExportSet.h"
+
+cmExportSet* cmExportSetMap::operator[](const std::string &name)
+{
+ std::map<std::string, cmExportSet*>::iterator it = this->find(name);
+ if (it == this->end()) // Export set not found
+ {
+ it = this->insert(std::make_pair(name, new cmExportSet(name))).first;
+ }
+ return it->second;
+}
+
+cmExportSetMap::~cmExportSetMap()
+{
+ for(std::map<std::string, cmExportSet*>::iterator it = this->begin();
+ it != this->end();
+ ++ it)
+ {
+ delete it->second;
+ }
+}
diff --git a/Source/cmExportSetMap.h b/Source/cmExportSetMap.h
new file mode 100644
index 0000000..4663c55
--- /dev/null
+++ b/Source/cmExportSetMap.h
@@ -0,0 +1,33 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmExportSetMap_h
+#define cmExportSetMap_h
+
+#include "cmSystemTools.h"
+class cmExportSet;
+
+/// A name -> cmExportSet map with overloaded operator[].
+class cmExportSetMap : public std::map<std::string, cmExportSet*>
+{
+public:
+ /** \brief Overloaded operator[].
+ *
+ * The operator is overloaded because cmExportSet has no default constructor:
+ * we do not want unnamed export sets.
+ */
+ cmExportSet* operator[](const std::string &name);
+
+ /// Overloaded destructor deletes all member export sets.
+ ~cmExportSetMap();
+};
+
+#endif
diff --git a/Source/cmExtraCodeBlocksGenerator.cxx b/Source/cmExtraCodeBlocksGenerator.cxx
index ad4ab76..25b13e5 100644
--- a/Source/cmExtraCodeBlocksGenerator.cxx
+++ b/Source/cmExtraCodeBlocksGenerator.cxx
@@ -617,14 +617,17 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
" <Option compiler=\"" << compiler << "\" />\n"
" <Compiler>\n";
+ cmGeneratorTarget *gtgt = this->GlobalGenerator
+ ->GetGeneratorTarget(target);
+
// the compilerdefines for this target
- const char* cdefs = target->GetMakefile()->GetProperty(
- "COMPILE_DEFINITIONS");
- if(cdefs)
+ std::string cdefs = gtgt->GetCompileDefinitions();
+
+ if(!cdefs.empty())
{
// Expand the list.
std::vector<std::string> defs;
- cmSystemTools::ExpandListArgument(cdefs, defs);
+ cmSystemTools::ExpandListArgument(cdefs.c_str(), defs);
for(std::vector<std::string>::const_iterator di = defs.begin();
di != defs.end(); ++di)
{
@@ -633,57 +636,59 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
}
}
- // the include directories for this target
- std::set<std::string> uniqIncludeDirs;
+ // the include directories for this target
+ std::set<std::string> uniqIncludeDirs;
+
+ std::vector<std::string> includes;
+ const char *config = target->GetMakefile()
+ ->GetDefinition("CMAKE_BUILD_TYPE");
+ target->GetMakefile()->GetLocalGenerator()->
+ GetIncludeDirectories(includes, gtgt, "C", config);
+ for(std::vector<std::string>::const_iterator dirIt=includes.begin();
+ dirIt != includes.end();
+ ++dirIt)
+ {
+ uniqIncludeDirs.insert(*dirIt);
+ }
- std::vector<std::string> includes;
- target->GetMakefile()->GetLocalGenerator()->
- GetIncludeDirectories(includes, target);
- for(std::vector<std::string>::const_iterator dirIt=includes.begin();
- dirIt != includes.end();
+ std::string systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
++dirIt)
{
uniqIncludeDirs.insert(*dirIt);
}
+ }
- std::string systemIncludeDirs = makefile->GetSafeDefinition(
- "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
- if (!systemIncludeDirs.empty())
- {
- std::vector<std::string> dirs;
- cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
- for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
- dirIt != dirs.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
- }
-
- systemIncludeDirs = makefile->GetSafeDefinition(
- "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
- if (!systemIncludeDirs.empty())
- {
- std::vector<std::string> dirs;
- cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
- for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
- dirIt != dirs.end();
- ++dirIt)
- {
- uniqIncludeDirs.insert(*dirIt);
- }
- }
-
- for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
- dirIt != uniqIncludeDirs.end();
+ systemIncludeDirs = makefile->GetSafeDefinition(
+ "CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS");
+ if (!systemIncludeDirs.empty())
+ {
+ std::vector<std::string> dirs;
+ cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
+ for(std::vector<std::string>::const_iterator dirIt=dirs.begin();
+ dirIt != dirs.end();
++dirIt)
{
- fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n";
+ uniqIncludeDirs.insert(*dirIt);
}
+ }
- fout<<" </Compiler>\n";
+ for(std::set<std::string>::const_iterator dirIt=uniqIncludeDirs.begin();
+ dirIt != uniqIncludeDirs.end();
+ ++dirIt)
+ {
+ fout <<" <Add directory=\"" << dirIt->c_str() << "\" />\n";
}
- else // e.g. all and the GLOBAL and UTILITY targets
+
+ fout<<" </Compiler>\n";
+ }
+ else // e.g. all and the GLOBAL and UTILITY targets
{
fout<<" <Option working_dir=\""
<< makefile->GetStartOutputDirectory() << "\" />\n"
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 1f976f7..96b8a09 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -884,11 +884,18 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
it != this->GlobalGenerator->GetLocalGenerators().end();
++it)
{
- cmTargets & targets = (*it)->GetMakefile()->GetTargets();
- for (cmTargets::iterator l = targets.begin(); l != targets.end(); ++l)
+ cmGeneratorTargetsType targets = (*it)->GetMakefile()
+ ->GetGeneratorTargets();
+ for (cmGeneratorTargetsType::iterator l = targets.begin();
+ l != targets.end(); ++l)
{
+ if (l->first->IsImported())
+ {
+ continue;
+ }
std::vector<std::string> includeDirs;
- (*it)->GetIncludeDirectories(includeDirs, &l->second);
+ const char *config = mf->GetDefinition("CMAKE_BUILD_TYPE");
+ (*it)->GetIncludeDirectories(includeDirs, l->second, "C", config);
this->AppendIncludeDirectories(fout, includeDirs, emmited);
}
}
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 2bc4290..8de24b3 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2767,30 +2767,31 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string> const& args)
else if(*i == "EXPECTED_HASH")
{
++i;
- if(i != args.end())
+ if(i == args.end())
{
- hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New(i->c_str()));
- if(!hash.get())
- {
- std::string err = "DOWNLOAD bad SHA type: ";
- err += *i;
- this->SetError(err.c_str());
- return false;
- }
- hashMatchMSG = *i;
- hashMatchMSG += " hash";
-
- ++i;
+ this->SetError("DOWNLOAD missing ALGO=value for EXPECTED_HASH.");
+ return false;
}
- if(i != args.end())
+ std::string::size_type pos = i->find("=");
+ if(pos == std::string::npos)
{
- expectedHash = cmSystemTools::LowerCase(*i);
+ std::string err =
+ "DOWNLOAD EXPECTED_HASH expects ALGO=value but got: ";
+ err += *i;
+ this->SetError(err.c_str());
+ return false;
}
- else
+ std::string algo = i->substr(0, pos);
+ expectedHash = cmSystemTools::LowerCase(i->substr(pos+1));
+ hash = cmsys::auto_ptr<cmCryptoHash>(cmCryptoHash::New(algo.c_str()));
+ if(!hash.get())
{
- this->SetError("DOWNLOAD missing time for EXPECTED_HASH.");
+ std::string err = "DOWNLOAD EXPECTED_HASH given unknown ALGO: ";
+ err += algo;
+ this->SetError(err.c_str());
return false;
}
+ hashMatchMSG = algo + " hash";
}
++i;
}
diff --git a/Source/cmFileCommand.h b/Source/cmFileCommand.h
index bd6f612..b4aa903 100644
--- a/Source/cmFileCommand.h
+++ b/Source/cmFileCommand.h
@@ -83,8 +83,7 @@ public:
" file(TO_NATIVE_PATH path result)\n"
" file(DOWNLOAD url file [INACTIVITY_TIMEOUT timeout]\n"
" [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS]\n"
- " [EXPECTED_HASH MD5|SHA1|SHA224|SHA256|SHA384|SHA512 hash]\n"
- " [EXPECTED_MD5 sum]\n"
+ " [EXPECTED_HASH ALGO=value] [EXPECTED_MD5 sum]\n"
" [TLS_VERIFY on|off] [TLS_CAINFO file])\n"
" file(UPLOAD filename url [INACTIVITY_TIMEOUT timeout]\n"
" [TIMEOUT timeout] [STATUS status] [LOG log] [SHOW_PROGRESS])\n"
@@ -170,10 +169,11 @@ public:
"timeout after time seconds, time should be specified as an integer. "
"The INACTIVITY_TIMEOUT specifies an integer number of seconds of "
"inactivity after which the operation should terminate. "
- "If EXPECTED_HASH is specified, the operation will verify that the "
- "downloaded file's actual hash matches the expected value. If it "
- "does not match, the operation fails with an error. "
- "(EXPECTED_MD5 is short-hand for EXPECTED_HASH MD5.) "
+ "If EXPECTED_HASH ALGO=value is specified, the operation will verify "
+ "that the downloaded file's actual hash matches the expected value, "
+ "where ALGO is one of MD5, SHA1, SHA224, SHA256, SHA384, or SHA512. "
+ "If it does not match, the operation fails with an error. "
+ "(\"EXPECTED_MD5 sum\" is short-hand for \"EXPECTED_HASH MD5=sum\".) "
"If SHOW_PROGRESS is specified, progress information will be printed "
"as status messages until the operation is complete. "
"For https URLs CMake must be built with OpenSSL. "
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index be47f95..470ceca 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -840,6 +840,8 @@ bool cmFindPackageCommand
//----------------------------------------------------------------------------
void cmFindPackageCommand::SetModuleVariables(const std::string& components)
{
+ this->AddFindDefinition("CMAKE_FIND_PACKAGE_NAME", this->Name.c_str());
+
// Store the list of components.
std::string components_var = this->Name + "_FIND_COMPONENTS";
this->AddFindDefinition(components_var.c_str(), components.c_str());
@@ -1016,6 +1018,9 @@ bool cmFindPackageCommand::HandlePackageMode()
std::string foundVar = this->Name;
foundVar += "_FOUND";
+ std::string notFoundMessageVar = this->Name;
+ notFoundMessageVar += "_NOT_FOUND_MESSAGE";
+ std::string notFoundMessage;
// If the directory for the config file was found, try to read the file.
bool result = true;
@@ -1033,6 +1038,7 @@ bool cmFindPackageCommand::HandlePackageMode()
// has set Foo_FOUND to FALSE itself:
this->Makefile->RemoveDefinition(foundVar.c_str());
}
+ this->Makefile->RemoveDefinition(notFoundMessageVar.c_str());
// Set the version variables before loading the config file.
// It may override them.
@@ -1051,6 +1057,8 @@ bool cmFindPackageCommand::HandlePackageMode()
// we get here if the Config file has set Foo_FOUND actively to FALSE
found = false;
configFileSetFOUNDFalse = true;
+ notFoundMessage = this->Makefile->GetSafeDefinition(
+ notFoundMessageVar.c_str());
}
}
else
@@ -1071,6 +1079,10 @@ bool cmFindPackageCommand::HandlePackageMode()
" " << this->FileFound << "\n"
"but it set " << foundVar << " to FALSE so package \"" <<
this->Name << "\" is considered to be NOT FOUND.";
+ if (!notFoundMessage.empty())
+ {
+ e << " Reason given by package: \n" << notFoundMessage << "\n";
+ }
}
// If there are files in ConsideredConfigs, it means that FooConfig.cmake
// have been found, but they didn't have appropriate versions.
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index 0885616..7d8df37 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -13,12 +13,14 @@
#include "cmMakefile.h"
#include "cmTarget.h"
+#include "assert.h"
#include <cmsys/String.h>
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGeneratorExpressionLexer.h"
#include "cmGeneratorExpressionParser.h"
+#include "cmGeneratorExpressionDAGChecker.h"
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
@@ -65,7 +67,9 @@ cmGeneratorExpression::~cmGeneratorExpression()
//----------------------------------------------------------------------------
const char *cmCompiledGeneratorExpression::Evaluate(
- cmMakefile* mf, const char* config, bool quiet) const
+ cmMakefile* mf, const char* config, bool quiet,
+ cmGeneratorTarget *target,
+ cmGeneratorExpressionDAGChecker *dagChecker) const
{
if (!this->NeedsParsing)
{
@@ -84,11 +88,12 @@ const char *cmCompiledGeneratorExpression::Evaluate(
context.Config = config;
context.Quiet = quiet;
context.HadError = false;
+ context.Target = target;
context.Backtrace = this->Backtrace;
for ( ; it != end; ++it)
{
- this->Output += (*it)->Evaluate(&context);
+ this->Output += (*it)->Evaluate(&context, dagChecker);
if (context.HadError)
{
this->Output = "";
@@ -125,3 +130,51 @@ cmCompiledGeneratorExpression::~cmCompiledGeneratorExpression()
delete *it;
}
}
+
+std::string cmGeneratorExpression::Preprocess(const std::string &input,
+ PreprocessContext context)
+{
+ if (context != StripAllGeneratorExpressions)
+ {
+ assert(!"cmGeneratorExpression::Preprocess called with invalid args");
+ return std::string();
+ }
+
+ std::string result;
+ std::string::size_type pos = 0;
+ std::string::size_type lastPos = pos;
+ while((pos = input.find("$<", lastPos)) != input.npos)
+ {
+ result += input.substr(lastPos, pos - lastPos);
+ pos += 2;
+ int nestingLevel = 1;
+ const char *c = input.c_str() + pos;
+ const char * const cStart = c;
+ for ( ; *c; ++c)
+ {
+ if(c[0] == '$' && c[1] == '<')
+ {
+ ++nestingLevel;
+ ++c;
+ continue;
+ }
+ if(c[0] == '>')
+ {
+ --nestingLevel;
+ if (nestingLevel == 0)
+ {
+ break;
+ }
+ }
+ }
+ const std::string::size_type traversed = (c - cStart) + 1;
+ if (!*c)
+ {
+ result += "$<" + input.substr(pos, traversed);
+ }
+ pos += traversed;
+ lastPos = pos;
+ }
+ result += input.substr(lastPos);
+ return result;
+}
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index b8467c2..29d3f44 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -9,6 +9,10 @@
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
+
+#ifndef cmGeneratorExpression_h
+#define cmGeneratorExpression_h
+
#include "cmStandardIncludes.h"
#include <stack>
@@ -16,10 +20,12 @@
#include <cmsys/RegularExpression.hxx>
class cmTarget;
+class cmGeneratorTarget;
class cmMakefile;
class cmListFileBacktrace;
struct cmGeneratorExpressionEvaluator;
+struct cmGeneratorExpressionDAGChecker;
class cmCompiledGeneratorExpression;
@@ -42,6 +48,13 @@ public:
const cmCompiledGeneratorExpression& Parse(std::string const& input);
const cmCompiledGeneratorExpression& Parse(const char* input);
+ enum PreprocessContext {
+ StripAllGeneratorExpressions
+ };
+
+ static std::string Preprocess(const std::string &input,
+ PreprocessContext context);
+
private:
cmGeneratorExpression(const cmGeneratorExpression &);
void operator=(const cmGeneratorExpression &);
@@ -54,7 +67,9 @@ class cmCompiledGeneratorExpression
{
public:
const char* Evaluate(cmMakefile* mf, const char* config,
- bool quiet = false) const;
+ bool quiet = false,
+ cmGeneratorTarget *target = 0,
+ cmGeneratorExpressionDAGChecker *dagChecker = 0) const;
/** Get set of targets found during evaluations. */
std::set<cmTarget*> const& GetTargets() const
@@ -80,3 +95,5 @@ private:
mutable std::set<cmTarget*> Targets;
mutable std::string Output;
};
+
+#endif
diff --git a/Source/cmGeneratorExpressionDAGChecker.cxx b/Source/cmGeneratorExpressionDAGChecker.cxx
new file mode 100644
index 0000000..bfb0ddf
--- /dev/null
+++ b/Source/cmGeneratorExpressionDAGChecker.cxx
@@ -0,0 +1,106 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2012 Stephen Kelly <steveire@gmail.com>
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+
+#include "cmGeneratorExpressionDAGChecker.h"
+
+#include "cmMakefile.h"
+
+//----------------------------------------------------------------------------
+cmGeneratorExpressionDAGChecker::cmGeneratorExpressionDAGChecker(
+ const cmListFileBacktrace &backtrace,
+ const std::string &target,
+ const std::string &property,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *parent)
+ : Parent(parent), Target(target), Property(property),
+ Content(content), Backtrace(backtrace)
+{
+ this->IsDAG = this->isDAG();
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::check() const
+{
+ return this->IsDAG;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorExpressionDAGChecker::reportError(
+ cmGeneratorExpressionContext *context,
+ const std::string &expr)
+{
+ if (this->IsDAG)
+ {
+ return;
+ }
+
+ context->HadError = true;
+ if (context->Quiet)
+ {
+ return;
+ }
+
+ const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+
+ if (parent && !parent->Parent)
+ {
+ cmOStringStream e;
+ e << "Error evaluating generator expression:\n"
+ << " " << expr << "\n"
+ << "Self reference on target \""
+ << context->Target->GetName() << "\".\n";
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ parent->Backtrace);
+ return;
+ }
+
+ {
+ cmOStringStream e;
+ e << "Error evaluating generator expression:\n"
+ << " " << expr << "\n"
+ << "Dependency loop found.";
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ context->Backtrace);
+ }
+
+ int loopStep = 1;
+ while (parent)
+ {
+ cmOStringStream e;
+ e << "Loop step " << loopStep << "\n"
+ << " "
+ << (parent->Content ? parent->Content->GetOriginalExpression() : expr)
+ << "\n";
+ context->Makefile->GetCMakeInstance()
+ ->IssueMessage(cmake::FATAL_ERROR, e.str().c_str(),
+ parent->Backtrace);
+ parent = parent->Parent;
+ ++loopStep;
+ }
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorExpressionDAGChecker::isDAG() const
+{
+ const cmGeneratorExpressionDAGChecker *parent = this->Parent;
+ while (parent)
+ {
+ if (this->Target == parent->Target && this->Property == parent->Property)
+ {
+ return false;
+ }
+ parent = parent->Parent;
+ }
+ return true;
+}
diff --git a/Source/cmGeneratorExpressionDAGChecker.h b/Source/cmGeneratorExpressionDAGChecker.h
new file mode 100644
index 0000000..ffc84f8
--- /dev/null
+++ b/Source/cmGeneratorExpressionDAGChecker.h
@@ -0,0 +1,44 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2012 Stephen Kelly <steveire@gmail.com>
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmGeneratorExpressionDAGChecker_h
+#define cmGeneratorExpressionDAGChecker_h
+
+#include "cmStandardIncludes.h"
+
+#include "cmGeneratorExpressionEvaluator.h"
+
+//----------------------------------------------------------------------------
+struct cmGeneratorExpressionDAGChecker
+{
+ cmGeneratorExpressionDAGChecker(const cmListFileBacktrace &backtrace,
+ const std::string &target,
+ const std::string &property,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *parent);
+
+ bool check() const;
+
+ void reportError(cmGeneratorExpressionContext *context,
+ const std::string &expr);
+private:
+ bool isDAG() const;
+
+private:
+ const cmGeneratorExpressionDAGChecker * const Parent;
+ const std::string Target;
+ const std::string Property;
+ const GeneratorExpressionContent * const Content;
+ const cmListFileBacktrace Backtrace;
+ bool IsDAG;
+};
+
+#endif
diff --git a/Source/cmGeneratorExpressionEvaluator.cxx b/Source/cmGeneratorExpressionEvaluator.cxx
index acc844a..2e123a4 100644
--- a/Source/cmGeneratorExpressionEvaluator.cxx
+++ b/Source/cmGeneratorExpressionEvaluator.cxx
@@ -13,9 +13,16 @@
#include "cmGeneratorExpressionEvaluator.h"
#include "cmGeneratorExpressionParser.h"
+#include "cmGeneratorExpressionDAGChecker.h"
+#include "cmGeneratorExpression.h"
+
+#include <cmsys/String.h>
//----------------------------------------------------------------------------
-static void reportError(cmGeneratorExpressionContext *context,
+#if !defined(__SUNPRO_CC) || __SUNPRO_CC > 0x510
+static
+#endif
+void reportError(cmGeneratorExpressionContext *context,
const std::string &expr, const std::string &result)
{
context->HadError = true;
@@ -47,7 +54,8 @@ struct cmGeneratorExpressionNode
virtual std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *content
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *dagChecker
) const = 0;
};
@@ -60,7 +68,8 @@ static const struct ZeroNode : public cmGeneratorExpressionNode
std::string Evaluate(const std::vector<std::string> &,
cmGeneratorExpressionContext *,
- const GeneratorExpressionContent *) const
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
{
// Unreachable
return std::string();
@@ -76,7 +85,8 @@ static const struct OneNode : public cmGeneratorExpressionNode
std::string Evaluate(const std::vector<std::string> &,
cmGeneratorExpressionContext *,
- const GeneratorExpressionContent *) const
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
{
// Unreachable
return std::string();
@@ -93,7 +103,8 @@ static const struct OP ## Node : public cmGeneratorExpressionNode \
\
std::string Evaluate(const std::vector<std::string> &parameters, \
cmGeneratorExpressionContext *context, \
- const GeneratorExpressionContent *content) const \
+ const GeneratorExpressionContent *content, \
+ cmGeneratorExpressionDAGChecker *) const \
{ \
std::vector<std::string>::const_iterator it = parameters.begin(); \
const std::vector<std::string>::const_iterator end = parameters.end(); \
@@ -123,9 +134,11 @@ BOOLEAN_OP_NODE(orNode, OR, 0, 1)
static const struct NotNode : public cmGeneratorExpressionNode
{
NotNode() {}
+
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *content) const
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
{
if (*parameters.begin() != "0" && *parameters.begin() != "1")
{
@@ -138,14 +151,80 @@ static const struct NotNode : public cmGeneratorExpressionNode
} notNode;
//----------------------------------------------------------------------------
+static const struct BoolNode : public cmGeneratorExpressionNode
+{
+ BoolNode() {}
+
+ virtual int NumExpectedParameters() const { return 1; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return !cmSystemTools::IsOff(parameters.begin()->c_str()) ? "1" : "0";
+ }
+} boolNode;
+
+//----------------------------------------------------------------------------
+static const struct StrEqualNode : public cmGeneratorExpressionNode
+{
+ StrEqualNode() {}
+
+ virtual int NumExpectedParameters() const { return 2; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return *parameters.begin() == parameters[1] ? "1" : "0";
+ }
+} strEqualNode;
+
+//----------------------------------------------------------------------------
+static const struct Angle_RNode : public cmGeneratorExpressionNode
+{
+ Angle_RNode() {}
+
+ virtual int NumExpectedParameters() const { return 0; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return ">";
+ }
+} angle_rNode;
+
+//----------------------------------------------------------------------------
+static const struct CommaNode : public cmGeneratorExpressionNode
+{
+ CommaNode() {}
+
+ virtual int NumExpectedParameters() const { return 0; }
+
+ std::string Evaluate(const std::vector<std::string> &,
+ cmGeneratorExpressionContext *,
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
+ {
+ return ",";
+ }
+} commaNode;
+
+//----------------------------------------------------------------------------
static const struct ConfigurationNode : public cmGeneratorExpressionNode
{
ConfigurationNode() {}
+
virtual int NumExpectedParameters() const { return 0; }
std::string Evaluate(const std::vector<std::string> &,
cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *) const
+ const GeneratorExpressionContent *,
+ cmGeneratorExpressionDAGChecker *) const
{
return context->Config ? context->Config : "";
}
@@ -160,13 +239,9 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *content) const
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
{
- if (!context->Config)
- {
- return std::string();
- }
-
cmsys::RegularExpression configValidator;
configValidator.compile("^[A-Za-z0-9_]*$");
if (!configValidator.find(parameters.begin()->c_str()))
@@ -175,11 +250,123 @@ static const struct ConfigurationTestNode : public cmGeneratorExpressionNode
"Expression syntax not recognized.");
return std::string();
}
- return *parameters.begin() == context->Config ? "1" : "0";
+ if (!context->Config)
+ {
+ return parameters.front().empty() ? "1" : "0";
+ }
+
+ return cmsysString_strcasecmp(parameters.begin()->c_str(),
+ context->Config) == 0 ? "1" : "0";
}
} configurationTestNode;
//----------------------------------------------------------------------------
+static const struct TargetPropertyNode : public cmGeneratorExpressionNode
+{
+ TargetPropertyNode() {}
+
+ // This node handles errors on parameter count itself.
+ virtual int NumExpectedParameters() const { return -1; }
+
+ std::string Evaluate(const std::vector<std::string> &parameters,
+ cmGeneratorExpressionContext *context,
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *dagCheckerParent
+ ) const
+ {
+ if (parameters.size() != 1 && parameters.size() != 2)
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:...> expression requires one or two parameters");
+ return std::string();
+ }
+ cmsys::RegularExpression targetNameValidator;
+ // The ':' is supported to allow use with IMPORTED targets. At least
+ // Qt 4 and 5 IMPORTED targets use ':' as the namespace delimiter.
+ targetNameValidator.compile("^[A-Za-z0-9_.:-]+$");
+ cmsys::RegularExpression propertyNameValidator;
+ propertyNameValidator.compile("^[A-Za-z0-9_]+$");
+
+ cmGeneratorTarget* target = context->Target;
+ std::string propertyName = *parameters.begin();
+ if (parameters.size() == 2)
+ {
+ if (parameters.begin()->empty() && parameters[1].empty())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty "
+ "target name and property name.");
+ return std::string();
+ }
+ if (parameters.begin()->empty())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty "
+ "target name.");
+ return std::string();
+ }
+
+ std::string targetName = parameters.front();
+ propertyName = parameters[1];
+ if (!targetNameValidator.find(targetName.c_str()))
+ {
+ if (!propertyNameValidator.find(propertyName.c_str()))
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "Target name and property name not supported.");
+ return std::string();
+ }
+ ::reportError(context, content->GetOriginalExpression(),
+ "Target name not supported.");
+ return std::string();
+ }
+ target = context->Makefile->FindGeneratorTargetToUse(
+ targetName.c_str());
+
+ if (!target)
+ {
+ cmOStringStream e;
+ e << "Target \""
+ << targetName
+ << "\" not found.";
+ reportError(context, content->GetOriginalExpression(), e.str());
+ return std::string();
+ }
+ }
+
+ if (propertyName.empty())
+ {
+ reportError(context, content->GetOriginalExpression(),
+ "$<TARGET_PROPERTY:...> expression requires a non-empty property "
+ "name.");
+ return std::string();
+ }
+
+ if (!propertyNameValidator.find(propertyName.c_str()))
+ {
+ ::reportError(context, content->GetOriginalExpression(),
+ "Property name not supported.");
+ return std::string();
+ }
+
+ cmGeneratorExpressionDAGChecker dagChecker(context->Backtrace,
+ target->GetName(),
+ propertyName,
+ content,
+ dagCheckerParent);
+
+ if (!dagChecker.check())
+ {
+ dagChecker.reportError(context, content->GetOriginalExpression());
+ return std::string();
+ }
+
+ const char *prop = target->GetProperty(propertyName.c_str());
+ return prop ? prop : "";
+ }
+} targetPropertyNode;
+
+//----------------------------------------------------------------------------
template<bool linker, bool soname>
struct TargetFilesystemArtifactResultCreator
{
@@ -293,13 +480,15 @@ struct TargetFilesystemArtifact : public cmGeneratorExpressionNode
std::string Evaluate(const std::vector<std::string> &parameters,
cmGeneratorExpressionContext *context,
- const GeneratorExpressionContent *content) const
+ const GeneratorExpressionContent *content,
+ cmGeneratorExpressionDAGChecker *) const
{
// Lookup the referenced target.
std::string name = *parameters.begin();
cmsys::RegularExpression targetValidator;
- targetValidator.compile("^[A-Za-z0-9_]+$");
+ // The ':' is supported to allow use with IMPORTED targets.
+ targetValidator.compile("^[A-Za-z0-9_.:-]+$");
if (!targetValidator.find(name.c_str()))
{
::reportError(context, content->GetOriginalExpression(),
@@ -392,7 +581,18 @@ cmGeneratorExpressionNode* GetNode(const std::string &identifier)
return &targetLinkerFileDirNode;
else if (identifier == "TARGET_SONAME_FILE_DIR")
return &targetSoNameFileDirNode;
+ else if (identifier == "STREQUAL")
+ return &strEqualNode;
+ else if (identifier == "BOOL")
+ return &boolNode;
+ else if (identifier == "ANGLE-R")
+ return &angle_rNode;
+ else if (identifier == "COMMA")
+ return &commaNode;
+ else if (identifier == "TARGET_PROPERTY")
+ return &targetPropertyNode;
return 0;
+
}
//----------------------------------------------------------------------------
@@ -412,7 +612,8 @@ std::string GeneratorExpressionContent::GetOriginalExpression() const
//----------------------------------------------------------------------------
std::string GeneratorExpressionContent::Evaluate(
- cmGeneratorExpressionContext *context) const
+ cmGeneratorExpressionContext *context,
+ cmGeneratorExpressionDAGChecker *dagChecker) const
{
std::string identifier;
{
@@ -422,7 +623,7 @@ std::string GeneratorExpressionContent::Evaluate(
= this->IdentifierChildren.end();
for ( ; it != end; ++it)
{
- identifier += (*it)->Evaluate(context);
+ identifier += (*it)->Evaluate(context, dagChecker);
if (context->HadError)
{
return std::string();
@@ -465,7 +666,7 @@ std::string GeneratorExpressionContent::Evaluate(
= pit->end();
for ( ; it != end; ++it)
{
- result += (*it)->Evaluate(context);
+ result += (*it)->Evaluate(context, dagChecker);
if (context->HadError)
{
return std::string();
@@ -491,7 +692,7 @@ std::string GeneratorExpressionContent::Evaluate(
pit->end();
for ( ; it != end; ++it)
{
- parameter += (*it)->Evaluate(context);
+ parameter += (*it)->Evaluate(context, dagChecker);
if (context->HadError)
{
return std::string();
@@ -534,7 +735,7 @@ std::string GeneratorExpressionContent::Evaluate(
return std::string();
}
- return node->Evaluate(parameters, context, this);
+ return node->Evaluate(parameters, context, this, dagChecker);
}
//----------------------------------------------------------------------------
diff --git a/Source/cmGeneratorExpressionEvaluator.h b/Source/cmGeneratorExpressionEvaluator.h
index 5163ca0..04a2acd 100644
--- a/Source/cmGeneratorExpressionEvaluator.h
+++ b/Source/cmGeneratorExpressionEvaluator.h
@@ -15,6 +15,11 @@
#include <vector>
#include <string>
+#include "cmListFileCache.h"
+
+class cmTarget;
+class cmGeneratorTarget;
+
//----------------------------------------------------------------------------
struct cmGeneratorExpressionContext
{
@@ -22,11 +27,13 @@ struct cmGeneratorExpressionContext
std::set<cmTarget*> Targets;
cmMakefile *Makefile;
const char *Config;
- cmTarget *Target;
+ cmGeneratorTarget *Target;
bool Quiet;
bool HadError;
};
+struct cmGeneratorExpressionDAGChecker;
+
//----------------------------------------------------------------------------
struct cmGeneratorExpressionEvaluator
{
@@ -41,8 +48,8 @@ struct cmGeneratorExpressionEvaluator
virtual Type GetType() const = 0;
- virtual std::string Evaluate(cmGeneratorExpressionContext *context
- ) const = 0;
+ virtual std::string Evaluate(cmGeneratorExpressionContext *context,
+ cmGeneratorExpressionDAGChecker *) const = 0;
private:
cmGeneratorExpressionEvaluator(const cmGeneratorExpressionEvaluator &);
@@ -57,7 +64,8 @@ struct TextContent : public cmGeneratorExpressionEvaluator
}
- std::string Evaluate(cmGeneratorExpressionContext *) const
+ std::string Evaluate(cmGeneratorExpressionContext *,
+ cmGeneratorExpressionDAGChecker *) const
{
return std::string(this->Content, this->Length);
}
@@ -102,7 +110,8 @@ struct GeneratorExpressionContent : public cmGeneratorExpressionEvaluator
return cmGeneratorExpressionEvaluator::Generator;
}
- std::string Evaluate(cmGeneratorExpressionContext *context) const;
+ std::string Evaluate(cmGeneratorExpressionContext *context,
+ cmGeneratorExpressionDAGChecker *) const;
std::string GetOriginalExpression() const;
diff --git a/Source/cmGeneratorExpressionParser.cxx b/Source/cmGeneratorExpressionParser.cxx
index 2a5cc7a..7a8fc51 100644
--- a/Source/cmGeneratorExpressionParser.cxx
+++ b/Source/cmGeneratorExpressionParser.cxx
@@ -14,6 +14,8 @@
#include "cmGeneratorExpressionEvaluator.h"
+#include "assert.h"
+
//----------------------------------------------------------------------------
cmGeneratorExpressionParser::cmGeneratorExpressionParser(
const std::vector<cmGeneratorExpressionToken> &tokens)
@@ -75,6 +77,7 @@ static void extendResult(std::vector<cmGeneratorExpressionEvaluator*> &result,
void cmGeneratorExpressionParser::ParseGeneratorExpression(
std::vector<cmGeneratorExpressionEvaluator*> &result)
{
+ assert(this->it != this->Tokens.end());
unsigned int nestedLevel = this->NestingLevel;
++this->NestingLevel;
@@ -96,12 +99,14 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
// ERROR
}
- if (this->it->TokenType == cmGeneratorExpressionToken::EndExpression)
+ if (this->it != this->Tokens.end() &&
+ this->it->TokenType == cmGeneratorExpressionToken::EndExpression)
{
GeneratorExpressionContent *content = new GeneratorExpressionContent(
startToken->Content, this->it->Content
- startToken->Content
+ this->it->Length);
+ assert(this->it != this->Tokens.end());
++this->it;
--this->NestingLevel;
content->SetIdentifier(identifier);
@@ -113,34 +118,60 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
std::vector<std::vector<cmGeneratorExpressionToken>::const_iterator>
commaTokens;
std::vector<cmGeneratorExpressionToken>::const_iterator colonToken;
- if (this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
+ if (this->it != this->Tokens.end() &&
+ this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
{
colonToken = this->it;
parameters.resize(parameters.size() + 1);
+ assert(this->it != this->Tokens.end());
++this->it;
- while(this->it->TokenType != cmGeneratorExpressionToken::EndExpression)
+
+ while (this->it != this->Tokens.end() &&
+ this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
+ {
+ commaTokens.push_back(this->it);
+ parameters.resize(parameters.size() + 1);
+ assert(this->it != this->Tokens.end());
+ ++this->it;
+ }
+ while (this->it != this->Tokens.end() &&
+ this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
+ {
+ extendText(*(parameters.end() - 1), this->it);
+ assert(this->it != this->Tokens.end());
+ ++this->it;
+ }
+ while (this->it != this->Tokens.end() &&
+ this->it->TokenType != cmGeneratorExpressionToken::EndExpression)
{
this->ParseContent(*(parameters.end() - 1));
- if (this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
+ if (this->it == this->Tokens.end())
+ {
+ break;
+ }
+ while (this->it != this->Tokens.end() &&
+ this->it->TokenType == cmGeneratorExpressionToken::CommaSeparator)
{
commaTokens.push_back(this->it);
parameters.resize(parameters.size() + 1);
+ assert(this->it != this->Tokens.end());
++this->it;
}
- if (this->it == this->Tokens.end())
+ while (this->it != this->Tokens.end() &&
+ this->it->TokenType == cmGeneratorExpressionToken::ColonSeparator)
{
- break;
+ extendText(*(parameters.end() - 1), this->it);
+ assert(this->it != this->Tokens.end());
+ ++this->it;
}
}
- if(this->it->TokenType == cmGeneratorExpressionToken::EndExpression)
+ if(this->it != this->Tokens.end()
+ && this->it->TokenType == cmGeneratorExpressionToken::EndExpression)
{
--this->NestingLevel;
+ assert(this->it != this->Tokens.end());
++this->it;
}
- if (parameters.empty())
- {
- // ERROR
- }
}
if (nestedLevel != this->NestingLevel)
@@ -161,6 +192,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
parameters.end();
std::vector<TokenVector::const_iterator>::const_iterator commaIt =
commaTokens.begin();
+ assert(parameters.size() > commaTokens.size());
for ( ; pit != pend; ++pit, ++commaIt)
{
extendResult(result, *pit);
@@ -168,6 +200,10 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
{
extendText(result, *commaIt);
}
+ else
+ {
+ break;
+ }
}
}
return;
@@ -187,6 +223,7 @@ void cmGeneratorExpressionParser::ParseGeneratorExpression(
void cmGeneratorExpressionParser::ParseContent(
std::vector<cmGeneratorExpressionEvaluator*> &result)
{
+ assert(this->it != this->Tokens.end());
switch(this->it->TokenType)
{
case cmGeneratorExpressionToken::Text:
@@ -203,6 +240,7 @@ void cmGeneratorExpressionParser::ParseContent(
TextContent *textContent =
static_cast<TextContent*>(*(result.end() - 1));
textContent->Extend(this->it->Length);
+ assert(this->it != this->Tokens.end());
++this->it;
return;
}
@@ -210,10 +248,12 @@ void cmGeneratorExpressionParser::ParseContent(
cmGeneratorExpressionEvaluator* n = new TextContent(this->it->Content,
this->it->Length);
result.push_back(n);
+ assert(this->it != this->Tokens.end());
++this->it;
return ;
}
case cmGeneratorExpressionToken::BeginExpression:
+ assert(this->it != this->Tokens.end());
++this->it;
this->ParseGeneratorExpression(result);
return;
@@ -226,10 +266,11 @@ void cmGeneratorExpressionParser::ParseContent(
}
else
{
- // TODO: Unreachable. Assert?
+ assert(!"Got unexpected syntax token.");
}
+ assert(this->it != this->Tokens.end());
++this->it;
return;
}
- // Unreachable. Assert?
+ assert(!"Unhandled token in generator expression.");
}
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 6e2e23d..19b55c6 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -14,8 +14,13 @@
#include "cmTarget.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
+#include "cmComputeLinkInformation.h"
#include "cmGlobalGenerator.h"
#include "cmSourceFile.h"
+#include "cmGeneratorExpression.h"
+#include "cmGeneratorExpressionDAGChecker.h"
+
+#include <assert.h>
//----------------------------------------------------------------------------
cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
@@ -27,6 +32,45 @@ cmGeneratorTarget::cmGeneratorTarget(cmTarget* t): Target(t)
this->LookupObjectLibraries();
}
+cmGeneratorTarget::~cmGeneratorTarget()
+{
+ for(std::map<cmStdString, cmComputeLinkInformation*>::iterator i
+ = LinkInformation.begin(); i != LinkInformation.end(); ++i)
+ {
+ delete i->second;
+ }
+}
+
+//----------------------------------------------------------------------------
+int cmGeneratorTarget::GetType() const
+{
+ return this->Target->GetType();
+}
+
+//----------------------------------------------------------------------------
+const char *cmGeneratorTarget::GetName() const
+{
+ return this->Target->GetName();
+}
+
+//----------------------------------------------------------------------------
+const char *cmGeneratorTarget::GetProperty(const char *prop)
+{
+ return this->Target->GetProperty(prop);
+}
+
+//----------------------------------------------------------------------------
+bool cmGeneratorTarget::GetPropertyAsBool(const char *prop)
+{
+ return this->Target->GetPropertyAsBool(prop);
+}
+
+//----------------------------------------------------------------------------
+std::vector<cmSourceFile*> const& cmGeneratorTarget::GetSourceFiles()
+{
+ return this->Target->GetSourceFiles();
+}
+
//----------------------------------------------------------------------------
void cmGeneratorTarget::ClassifySources()
{
@@ -175,3 +219,143 @@ void cmGeneratorTarget::UseObjectLibraries(std::vector<std::string>& objs)
}
}
}
+
+//----------------------------------------------------------------------------
+cmComputeLinkInformation*
+cmGeneratorTarget::GetLinkInformation(const char* config)
+{
+ // Lookup any existing information for this configuration.
+ std::map<cmStdString, cmComputeLinkInformation*>::iterator
+ i = this->LinkInformation.find(config?config:"");
+ if(i == this->LinkInformation.end())
+ {
+ // Compute information for this configuration.
+ cmComputeLinkInformation* info =
+ new cmComputeLinkInformation(this->Target, config);
+ if(!info || !info->Compute())
+ {
+ delete info;
+ info = 0;
+ }
+
+ // Store the information for this configuration.
+ std::map<cmStdString, cmComputeLinkInformation*>::value_type
+ entry(config?config:"", info);
+ i = this->LinkInformation.insert(entry).first;
+ }
+ return i->second;
+}
+
+//----------------------------------------------------------------------------
+void cmGeneratorTarget::GetAppleArchs(const char* config,
+ std::vector<std::string>& archVec)
+{
+ const char* archs = 0;
+ if(config && *config)
+ {
+ std::string defVarName = "OSX_ARCHITECTURES_";
+ defVarName += cmSystemTools::UpperCase(config);
+ archs = this->Target->GetProperty(defVarName.c_str());
+ }
+ if(!archs)
+ {
+ archs = this->Target->GetProperty("OSX_ARCHITECTURES");
+ }
+ if(archs)
+ {
+ cmSystemTools::ExpandListArgument(std::string(archs), archVec);
+ }
+}
+
+//----------------------------------------------------------------------------
+const char* cmGeneratorTarget::GetCreateRuleVariable()
+{
+ switch(this->GetType())
+ {
+ case cmTarget::STATIC_LIBRARY:
+ return "_CREATE_STATIC_LIBRARY";
+ case cmTarget::SHARED_LIBRARY:
+ return "_CREATE_SHARED_LIBRARY";
+ case cmTarget::MODULE_LIBRARY:
+ return "_CREATE_SHARED_MODULE";
+ case cmTarget::EXECUTABLE:
+ return "_LINK_EXECUTABLE";
+ default:
+ break;
+ }
+ return "";
+}
+
+//----------------------------------------------------------------------------
+std::vector<std::string> cmGeneratorTarget::GetIncludeDirectories(
+ const char *config)
+{
+ std::vector<std::string> includes;
+ const char *prop = this->Target->GetProperty("INCLUDE_DIRECTORIES");
+ if(!prop)
+ {
+ return includes;
+ }
+
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ "INCLUDE_DIRECTORIES", 0, 0);
+
+ cmSystemTools::ExpandListArgument(ge.Parse(prop)
+ .Evaluate(this->Makefile,
+ config,
+ false,
+ this,
+ &dagChecker),
+ includes);
+
+ std::set<std::string> uniqueIncludes;
+ std::vector<std::string> orderedAndUniqueIncludes;
+ for(std::vector<std::string>::const_iterator
+ li = includes.begin(); li != includes.end(); ++li)
+ {
+ std::string inc = *li;
+ if (!cmSystemTools::IsOff(inc.c_str()))
+ {
+ cmSystemTools::ConvertToUnixSlashes(inc);
+ }
+ if(uniqueIncludes.insert(inc).second)
+ {
+ orderedAndUniqueIncludes.push_back(inc);
+ }
+ }
+
+ return orderedAndUniqueIncludes;
+}
+
+//----------------------------------------------------------------------------
+std::string cmGeneratorTarget::GetCompileDefinitions(const char *config)
+{
+ std::string defPropName = "COMPILE_DEFINITIONS";
+ if (config)
+ {
+ defPropName += "_" + cmSystemTools::UpperCase(config);
+ }
+
+ const char *prop = this->Target->GetProperty(defPropName.c_str());
+
+ if (!prop)
+ {
+ return "";
+ }
+
+ cmListFileBacktrace lfbt;
+ cmGeneratorExpression ge(lfbt);
+
+ cmGeneratorExpressionDAGChecker dagChecker(lfbt,
+ this->GetName(),
+ defPropName, 0, 0);
+ return ge.Parse(prop).Evaluate(this->Makefile,
+ config,
+ false,
+ this,
+ &dagChecker);
+}
diff --git a/Source/cmGeneratorTarget.h b/Source/cmGeneratorTarget.h
index 5c7578d..a29a9f9 100644
--- a/Source/cmGeneratorTarget.h
+++ b/Source/cmGeneratorTarget.h
@@ -14,6 +14,7 @@
#include "cmStandardIncludes.h"
+class cmComputeLinkInformation;
class cmCustomCommand;
class cmGlobalGenerator;
class cmLocalGenerator;
@@ -25,6 +26,13 @@ class cmGeneratorTarget
{
public:
cmGeneratorTarget(cmTarget*);
+ ~cmGeneratorTarget();
+
+ int GetType() const;
+ const char *GetName() const;
+ const char *GetProperty(const char *prop);
+ bool GetPropertyAsBool(const char *prop);
+ std::vector<cmSourceFile*> const& GetSourceFiles();
cmTarget* Target;
cmMakefile* Makefile;
@@ -52,6 +60,22 @@ public:
void UseObjectLibraries(std::vector<std::string>& objs);
+ std::map<cmStdString, cmComputeLinkInformation*> LinkInformation;
+
+ cmComputeLinkInformation* GetLinkInformation(const char* config);
+
+ void GetAppleArchs(const char* config,
+ std::vector<std::string>& archVec);
+
+ ///! Return the rule variable used to create this type of target,
+ // need to add CMAKE_(LANG) for full name.
+ const char* GetCreateRuleVariable();
+
+ /** Get the include directories for this target. */
+ std::vector<std::string> GetIncludeDirectories(const char *config);
+
+ std::string GetCompileDefinitions(const char *config = 0);
+
private:
void ClassifySources();
void LookupObjectLibraries();
@@ -60,4 +84,6 @@ private:
void operator=(cmGeneratorTarget const&);
};
+typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
+
#endif
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 578fa9e..b9de4d8 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -21,10 +21,11 @@
#include "cmQtAutomoc.h"
#include "cmSourceFile.h"
#include "cmVersion.h"
-#include "cmExportInstallFileGenerator.h"
+#include "cmTargetExport.h"
#include "cmComputeTargetDepends.h"
#include "cmGeneratedFileStream.h"
#include "cmGeneratorTarget.h"
+#include "cmGeneratorExpression.h"
#include <cmsys/Directory.hxx>
@@ -76,12 +77,12 @@ cmGlobalGenerator::~cmGlobalGenerator()
}
this->ClearGeneratorTargets();
- this->ClearExportSets();
}
void cmGlobalGenerator::ResolveLanguageCompiler(const std::string &lang,
cmMakefile *mf,
- bool optional) {
+ bool optional)
+{
std::string langComp = "CMAKE_";
langComp += lang;
langComp += "_COMPILER";
@@ -817,7 +818,7 @@ void cmGlobalGenerator::Configure()
{
this->FirstTimeProgress = 0.0f;
this->ClearGeneratorTargets();
- this->ClearExportSets();
+ this->ExportSets.clear();
// Delete any existing cmLocalGenerators
unsigned int i;
for (i = 0; i < this->LocalGenerators.size(); ++i)
@@ -893,7 +894,7 @@ bool cmGlobalGenerator::CheckALLOW_DUPLICATE_CUSTOM_TARGETS()
<< "The \"" << this->GetName() << "\" generator does not support "
<< "duplicate custom targets. "
<< "Consider using a Makefiles generator or fix the project to not "
- << "use duplicat target names.";
+ << "use duplicate target names.";
cmSystemTools::Error(e.str().c_str());
return false;
}
@@ -1075,23 +1076,56 @@ void cmGlobalGenerator::CreateGeneratorTargets()
// Construct per-target generator information.
for(unsigned int i=0; i < this->LocalGenerators.size(); ++i)
{
- cmTargets& targets =
- this->LocalGenerators[i]->GetMakefile()->GetTargets();
+ cmGeneratorTargetsType generatorTargets;
+
+ cmMakefile *mf = this->LocalGenerators[i]->GetMakefile();
+ const char *noconfig_compile_definitions =
+ mf->GetProperty("COMPILE_DEFINITIONS");
+
+ std::vector<std::string> configs;
+ mf->GetConfigurations(configs);
+
+ cmTargets& targets = mf->GetTargets();
for(cmTargets::iterator ti = targets.begin();
ti != targets.end(); ++ti)
{
cmTarget* t = &ti->second;
+
+ {
+ t->AppendProperty("COMPILE_DEFINITIONS", noconfig_compile_definitions);
+ for(std::vector<std::string>::const_iterator ci = configs.begin();
+ ci != configs.end(); ++ci)
+ {
+ std::string defPropName = "COMPILE_DEFINITIONS_";
+ defPropName += cmSystemTools::UpperCase(*ci);
+ t->AppendProperty(defPropName.c_str(),
+ mf->GetProperty(defPropName.c_str()));
+ }
+ }
+
cmGeneratorTarget* gt = new cmGeneratorTarget(t);
this->GeneratorTargets[t] = gt;
this->ComputeTargetObjects(gt);
+ generatorTargets[t] = gt;
+ }
+
+ for(std::vector<cmTarget*>::const_iterator
+ j = mf->GetOwnedImportedTargets().begin();
+ j != mf->GetOwnedImportedTargets().end(); ++j)
+ {
+ cmGeneratorTarget* gt = new cmGeneratorTarget(*j);
+ this->GeneratorTargets[*j] = gt;
+ generatorTargets[*j] = gt;
}
+
+ mf->SetGeneratorTargets(generatorTargets);
}
}
//----------------------------------------------------------------------------
void cmGlobalGenerator::ClearGeneratorTargets()
{
- for(GeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
+ for(cmGeneratorTargetsType::iterator i = this->GeneratorTargets.begin();
i != this->GeneratorTargets.end(); ++i)
{
delete i->second;
@@ -1102,7 +1136,7 @@ void cmGlobalGenerator::ClearGeneratorTargets()
//----------------------------------------------------------------------------
cmGeneratorTarget* cmGlobalGenerator::GetGeneratorTarget(cmTarget* t) const
{
- GeneratorTargetsType::const_iterator ti = this->GeneratorTargets.find(t);
+ cmGeneratorTargetsType::const_iterator ti = this->GeneratorTargets.find(t);
if(ti == this->GeneratorTargets.end())
{
this->CMakeInstance->IssueMessage(
@@ -1129,7 +1163,7 @@ void cmGlobalGenerator::CheckLocalGenerators()
{
manager = this->LocalGenerators[i]->GetMakefile()->GetCacheManager();
this->LocalGenerators[i]->ConfigureFinalPass();
- cmTargets & targets =
+ cmTargets &targets =
this->LocalGenerators[i]->GetMakefile()->GetTargets();
for (cmTargets::iterator l = targets.begin();
l != targets.end(); l++)
@@ -1158,7 +1192,16 @@ void cmGlobalGenerator::CheckLocalGenerators()
}
}
std::vector<std::string> incs;
- this->LocalGenerators[i]->GetIncludeDirectories(incs, &l->second);
+ const char *incDirProp = l->second.GetProperty("INCLUDE_DIRECTORIES");
+ if (!incDirProp)
+ {
+ continue;
+ }
+
+ std::string incDirs = cmGeneratorExpression::Preprocess(incDirProp,
+ cmGeneratorExpression::StripAllGeneratorExpressions);
+
+ cmSystemTools::ExpandListArgument(incDirs.c_str(), incs);
for( std::vector<std::string>::const_iterator incDir = incs.begin();
incDir != incs.end(); ++incDir)
@@ -1466,52 +1509,6 @@ void cmGlobalGenerator::AddInstallComponent(const char* component)
}
}
-void cmGlobalGenerator::AddTargetToExports(const char* exportSetName,
- cmTarget* target,
- cmInstallTargetGenerator* archive,
- cmInstallTargetGenerator* runTime,
- cmInstallTargetGenerator* library,
- cmInstallTargetGenerator* framework,
- cmInstallTargetGenerator* bundle,
- cmInstallFilesGenerator* headers)
-{
- if ((exportSetName) && (*exportSetName) && (target))
- {
- cmTargetExport* te = new cmTargetExport(target, archive, runTime, library,
- framework, bundle, headers);
- this->ExportSets[exportSetName].push_back(te);
- }
-}
-
-//----------------------------------------------------------------------------
-void cmGlobalGenerator::ClearExportSets()
-{
- for(std::map<cmStdString, std::vector<cmTargetExport*> >::iterator
- setIt = this->ExportSets.begin();
- setIt != this->ExportSets.end(); ++setIt)
- {
- for(unsigned int i = 0; i < setIt->second.size(); ++i)
- {
- delete setIt->second[i];
- }
- }
- this->ExportSets.clear();
-}
-
-const std::vector<cmTargetExport*>* cmGlobalGenerator::GetExportSet(
- const char* name) const
-{
- std::map<cmStdString, std::vector<cmTargetExport*> >::const_iterator
- exportSetIt = this->ExportSets.find(name);
- if (exportSetIt != this->ExportSets.end())
- {
- return &exportSetIt->second;
- }
-
- return 0;
-}
-
-
void cmGlobalGenerator::EnableInstallTarget()
{
this->InstallTargetEnabled = true;
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index ce91793..0aab2d6 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -18,13 +18,15 @@
#include "cmTarget.h" // For cmTargets
#include "cmTargetDepend.h" // For cmTargetDependSet
#include "cmSystemTools.h" // for cmSystemTools::OutputOption
+#include "cmExportSetMap.h" // For cmExportSetMap
+#include "cmGeneratorTarget.h"
+
class cmake;
class cmGeneratorTarget;
class cmMakefile;
class cmLocalGenerator;
class cmExternalMakefileProjectGenerator;
class cmTarget;
-class cmTargetExport;
class cmInstallTargetGenerator;
class cmInstallFilesGenerator;
@@ -127,8 +129,8 @@ public:
void SetCMakeInstance(cmake *cm);
///! Get the CMake instance
- cmake *GetCMakeInstance() { return this->CMakeInstance; };
- const cmake *GetCMakeInstance() const { return this->CMakeInstance; };
+ cmake *GetCMakeInstance() { return this->CMakeInstance; }
+ const cmake *GetCMakeInstance() const { return this->CMakeInstance; }
void SetConfiguredFilesPath(cmGlobalGenerator* gen);
const std::vector<cmLocalGenerator *>& GetLocalGenerators() const {
@@ -151,18 +153,9 @@ public:
void AddInstallComponent(const char* component);
const std::set<cmStdString>* GetInstallComponents() const
- { return &InstallComponents; }
-
- ///! Add one installed target to the sets of the exports
- void AddTargetToExports(const char* exportSet, cmTarget* target,
- cmInstallTargetGenerator* archive,
- cmInstallTargetGenerator* runTime,
- cmInstallTargetGenerator* library,
- cmInstallTargetGenerator* framework,
- cmInstallTargetGenerator* bundle,
- cmInstallFilesGenerator* publicHeaders);
- ///! Get the export target set with the given name
- const std::vector<cmTargetExport*>* GetExportSet(const char* name) const;
+ { return &this->InstallComponents; }
+
+ cmExportSetMap& GetExportSets() {return this->ExportSets;}
/** Add a file to the manifest of generated targets for a configuration. */
void AddToManifest(const char* config, std::string const& f);
@@ -222,7 +215,7 @@ public:
/** Get the manifest of all targets that will be built for each
configuration. This is valid during generation only. */
cmTargetManifest const& GetTargetManifest() const
- { return this->TargetManifest; }
+ { return this->TargetManifest; }
/** Get the content of a directory. Directory listings are loaded
from disk at most once and cached. During the generation step
@@ -328,15 +321,13 @@ protected:
cmLocalGenerator* CurrentLocalGenerator;
// map from project name to vector of local generators in that project
std::map<cmStdString, std::vector<cmLocalGenerator*> > ProjectMap;
- std::map<cmLocalGenerator*, std::set<cmTarget *> >
- LocalGeneratorToTargetMap;
+ std::map<cmLocalGenerator*, std::set<cmTarget *> > LocalGeneratorToTargetMap;
// Set of named installation components requested by the project.
std::set<cmStdString> InstallComponents;
bool InstallTargetEnabled;
// Sets of named target exports
- std::map<cmStdString, std::vector<cmTargetExport*> > ExportSets;
- void ClearExportSets();
+ cmExportSetMap ExportSets;
// Manifest of all targets that will be built for each configuration.
// This is computed just before local generators generate.
@@ -383,8 +374,7 @@ private:
TargetDependMap TargetDependencies;
// Per-target generator information.
- typedef std::map<cmTarget*, cmGeneratorTarget*> GeneratorTargetsType;
- GeneratorTargetsType GeneratorTargets;
+ cmGeneratorTargetsType GeneratorTargets;
void CreateGeneratorTargets();
void ClearGeneratorTargets();
virtual void ComputeTargetObjects(cmGeneratorTarget* gt) const;
diff --git a/Source/cmGlobalNinjaGenerator.cxx b/Source/cmGlobalNinjaGenerator.cxx
index 3f3cfbb..05f5b4c 100644
--- a/Source/cmGlobalNinjaGenerator.cxx
+++ b/Source/cmGlobalNinjaGenerator.cxx
@@ -106,6 +106,7 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
const cmNinjaDeps& implicitDeps,
const cmNinjaDeps& orderOnlyDeps,
const cmNinjaVars& variables,
+ const std::string& rspfile,
int cmdLineLimit)
{
// Make sure there is a rule.
@@ -181,12 +182,17 @@ void cmGlobalNinjaGenerator::WriteBuild(std::ostream& os,
// check if a response file rule should be used
std::string buildstr = build.str();
- const std::string assignments = variable_assignments.str();
+ std::string assignments = variable_assignments.str();
const std::string args = arguments.str();
if (cmdLineLimit > 0
&& args.size() + buildstr.size() + assignments.size()
- > (size_t) cmdLineLimit)
- buildstr += "_RSPFILE";
+ > (size_t) cmdLineLimit) {
+ buildstr += "_RSP_FILE";
+ variable_assignments.clear();
+ cmGlobalNinjaGenerator::WriteVariable(variable_assignments,
+ "RSP_FILE", rspfile, "", 1);
+ assignments += variable_assignments.str();
+ }
os << buildstr << args << assignments;
}
diff --git a/Source/cmGlobalNinjaGenerator.h b/Source/cmGlobalNinjaGenerator.h
index b2fe243..24c3916 100644
--- a/Source/cmGlobalNinjaGenerator.h
+++ b/Source/cmGlobalNinjaGenerator.h
@@ -84,6 +84,7 @@ public:
const cmNinjaDeps& implicitDeps,
const cmNinjaDeps& orderOnlyDeps,
const cmNinjaVars& variables,
+ const std::string& rspfile = std::string(),
int cmdLineLimit = -1);
/**
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 2e3b530..bca1754 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -48,7 +48,7 @@ void cmGlobalVisualStudio8Generator
::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.Name = this->GetName();
- entry.Brief = "Generates Visual Studio .NET 2005 project files.";
+ entry.Brief = "Generates Visual Studio 8 2005 project files.";
entry.Full = "";
}
diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx
index 164d116..4cbc275 100644
--- a/Source/cmGlobalVisualStudio8Win64Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx
@@ -27,7 +27,7 @@ void cmGlobalVisualStudio8Win64Generator
::GetDocumentation(cmDocumentationEntry& entry) const
{
entry.Name = this->GetName();
- entry.Brief = "Generates Visual Studio .NET 2005 Win64 project files.";
+ entry.Brief = "Generates Visual Studio 8 2005 Win64 project files.";
entry.Full = "";
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 5fdfcf8..30d8f18 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1647,16 +1647,12 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Add the export symbol definition for shared library objects.
this->AppendDefines(ppDefs, exportMacro);
}
- this->AppendDefines
- (ppDefs, this->CurrentMakefile->GetProperty("COMPILE_DEFINITIONS"));
- this->AppendDefines(ppDefs, target.GetProperty("COMPILE_DEFINITIONS"));
+ cmGeneratorTarget *gtgt = this->GetGeneratorTarget(&target);
+ this->AppendDefines(ppDefs, gtgt->GetCompileDefinitions().c_str());
if(configName)
{
- std::string defVarName = "COMPILE_DEFINITIONS_";
- defVarName += cmSystemTools::UpperCase(configName);
- this->AppendDefines
- (ppDefs, this->CurrentMakefile->GetProperty(defVarName.c_str()));
- this->AppendDefines(ppDefs, target.GetProperty(defVarName.c_str()));
+ this->AppendDefines(ppDefs,
+ gtgt->GetCompileDefinitions(configName).c_str());
}
buildSettings->AddAttribute
("GCC_PREPROCESSOR_DEFINITIONS", ppDefs.CreateList());
@@ -1713,7 +1709,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Set target-specific architectures.
std::vector<std::string> archs;
- target.GetAppleArchs(configName, archs);
+ gtgt->GetAppleArchs(configName, archs);
+
if(!archs.empty())
{
// Enable ARCHS attribute.
@@ -1950,7 +1947,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
BuildObjectListOrString dirs(this, this->XcodeVersion >= 30);
BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
std::vector<std::string> includes;
- this->CurrentLocalGenerator->GetIncludeDirectories(includes, &target);
+ this->CurrentLocalGenerator->GetIncludeDirectories(includes, gtgt,
+ "C", configName);
std::set<cmStdString> emitted;
emitted.insert("/System/Library/Frameworks");
for(std::vector<std::string>::iterator i = includes.begin();
@@ -2625,7 +2623,8 @@ void cmGlobalXCodeGenerator
}
// Compute the link library and directory information.
- cmComputeLinkInformation* pcli = cmtarget->GetLinkInformation(configName);
+ cmGeneratorTarget* gtgt = this->GetGeneratorTarget(cmtarget);
+ cmComputeLinkInformation* pcli = gtgt->GetLinkInformation(configName);
if(!pcli)
{
continue;
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 0a1fe06..f794b78 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -114,7 +114,7 @@ public:
"will be evaluated. Possible expressions are:\n"
" if(<constant>)\n"
"True if the constant is 1, ON, YES, TRUE, Y, or a non-zero number. "
- "False if the constant is 0, OFF, NO, FALSE, N, IGNORE, \"\", "
+ "False if the constant is 0, OFF, NO, FALSE, N, IGNORE, NOTFOUND, '', "
"or ends in the suffix '-NOTFOUND'. "
"Named boolean constants are case-insensitive. "
"If the argument is not one of these constants, "
diff --git a/Source/cmIncludeDirectoryCommand.cxx b/Source/cmIncludeDirectoryCommand.cxx
index 4dd98a1..ba81849 100644
--- a/Source/cmIncludeDirectoryCommand.cxx
+++ b/Source/cmIncludeDirectoryCommand.cxx
@@ -55,6 +55,11 @@ bool cmIncludeDirectoryCommand
return true;
}
+static bool StartsWithGeneratorExpression(const std::string &input)
+{
+ return input[0] == '$' && input[1] == '<';
+}
+
// do a lot of cleanup on the arguments because this is one place where folks
// sometimes take the output of a program and pass it directly into this
// command not thinking that a single argument could be filled with spaces
@@ -105,10 +110,13 @@ void cmIncludeDirectoryCommand::AddDirectory(const char *i,
cmSystemTools::ConvertToUnixSlashes(ret);
if(!cmSystemTools::FileIsFullPath(ret.c_str()))
{
- std::string tmp = this->Makefile->GetStartDirectory();
- tmp += "/";
- tmp += ret;
- ret = tmp;
+ if(!StartsWithGeneratorExpression(ret))
+ {
+ std::string tmp = this->Makefile->GetStartDirectory();
+ tmp += "/";
+ tmp += ret;
+ ret = tmp;
+ }
}
}
this->Makefile->AddIncludeDirectory(ret.c_str(), before);
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 4016734..dcd418b 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -17,6 +17,8 @@
#include "cmInstallTargetGenerator.h"
#include "cmInstallExportGenerator.h"
#include "cmInstallCommandArguments.h"
+#include "cmTargetExport.h"
+#include "cmExportSet.h"
#include <cmsys/Glob.hxx>
@@ -735,11 +737,16 @@ bool cmInstallCommand::HandleTargetsMode(std::vector<std::string> const& args)
// this is not a namelink-only rule.
if(!exports.GetString().empty() && !namelinkOnly)
{
+ cmTargetExport *te = new cmTargetExport;
+ te->Target = &target;
+ te->ArchiveGenerator = archiveGenerator;
+ te->BundleGenerator = bundleGenerator;
+ te->FrameworkGenerator = frameworkGenerator;
+ te->HeaderGenerator = publicHeaderGenerator;
+ te->LibraryGenerator = libraryGenerator;
+ te->RuntimeGenerator = runtimeGenerator;
this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
- ->AddTargetToExports(exports.GetCString(), &target,
- archiveGenerator, runtimeGenerator,
- libraryGenerator, frameworkGenerator,
- bundleGenerator, publicHeaderGenerator);
+ ->GetExportSets()[exports.GetString()]->AddTargetExport(te);
}
}
@@ -1264,7 +1271,9 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
// Create the export install generator.
cmInstallExportGenerator* exportGenerator =
new cmInstallExportGenerator(
- exp.GetCString(), ica.GetDestination().c_str(),
+ this->Makefile->GetLocalGenerator()
+ ->GetGlobalGenerator()->GetExportSets()[exp.GetString()],
+ ica.GetDestination().c_str(),
ica.GetPermissions().c_str(), ica.GetConfigurations(),
ica.GetComponent().c_str(), fname.c_str(),
name_space.GetCString(), this->Makefile);
diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx
index 28a19d7..0a645a8 100644
--- a/Source/cmInstallExportGenerator.cxx
+++ b/Source/cmInstallExportGenerator.cxx
@@ -23,10 +23,11 @@
#include "cmInstallFilesGenerator.h"
#include "cmExportInstallFileGenerator.h"
+#include "cmExportSet.h"
//----------------------------------------------------------------------------
cmInstallExportGenerator::cmInstallExportGenerator(
- const char* name,
+ cmExportSet* exportSet,
const char* destination,
const char* file_permissions,
std::vector<std::string> const& configurations,
@@ -34,13 +35,14 @@ cmInstallExportGenerator::cmInstallExportGenerator(
const char* filename, const char* name_space,
cmMakefile* mf)
:cmInstallGenerator(destination, configurations, component)
- ,Name(name)
+ ,ExportSet(exportSet)
,FilePermissions(file_permissions)
,FileName(filename)
,Namespace(name_space)
,Makefile(mf)
{
this->EFGen = new cmExportInstallFileGenerator(this);
+ exportSet->AddInstallation(this);
}
//----------------------------------------------------------------------------
@@ -113,16 +115,12 @@ void cmInstallExportGenerator::ComputeTempDir()
//----------------------------------------------------------------------------
void cmInstallExportGenerator::GenerateScript(std::ostream& os)
{
- // Get the export set requested.
- ExportSet const* exportSet =
- this->Makefile->GetLocalGenerator()->GetGlobalGenerator()
- ->GetExportSet(this->Name.c_str());
-
// Skip empty sets.
- if(!exportSet)
+ if(ExportSet->GetTargetExports()->empty())
{
cmOStringStream e;
- e << "INSTALL(EXPORT) given unknown export \"" << this->Name << "\"";
+ e << "INSTALL(EXPORT) given unknown export \""
+ << ExportSet->GetName() << "\"";
cmSystemTools::Error(e.str().c_str());
return;
}
@@ -137,8 +135,6 @@ void cmInstallExportGenerator::GenerateScript(std::ostream& os)
this->MainImportFile += this->FileName;
// Generate the import file for this export set.
- this->EFGen->SetName(this->Name.c_str());
- this->EFGen->SetExportSet(exportSet);
this->EFGen->SetExportFile(this->MainImportFile.c_str());
this->EFGen->SetNamespace(this->Namespace.c_str());
if(this->ConfigurationTypes->empty())
diff --git a/Source/cmInstallExportGenerator.h b/Source/cmInstallExportGenerator.h
index 1ff6e38..ee92906 100644
--- a/Source/cmInstallExportGenerator.h
+++ b/Source/cmInstallExportGenerator.h
@@ -17,8 +17,7 @@
class cmExportInstallFileGenerator;
class cmInstallFilesGenerator;
class cmInstallTargetGenerator;
-class cmTarget;
-class cmTargetExport;
+class cmExportSet;
class cmMakefile;
/** \class cmInstallExportGenerator
@@ -27,24 +26,27 @@ class cmMakefile;
class cmInstallExportGenerator: public cmInstallGenerator
{
public:
- cmInstallExportGenerator(const char* name,
+ cmInstallExportGenerator(cmExportSet* exportSet,
const char* dest, const char* file_permissions,
const std::vector<std::string>& configurations,
const char* component,
const char* filename, const char* name_space,
cmMakefile* mf);
~cmInstallExportGenerator();
-protected:
- typedef std::vector<cmTargetExport*> ExportSet;
+ cmExportSet* GetExportSet() {return this->ExportSet;}
+
+ const std::string& GetNamespace() const { return this->Namespace; }
+
+protected:
virtual void GenerateScript(std::ostream& os);
virtual void GenerateScriptConfigs(std::ostream& os, Indent const& indent);
virtual void GenerateScriptActions(std::ostream& os, Indent const& indent);
- void GenerateImportFile(ExportSet const* exportSet);
- void GenerateImportFile(const char* config, ExportSet const* exportSet);
+ void GenerateImportFile(cmExportSet const* exportSet);
+ void GenerateImportFile(const char* config, cmExportSet const* exportSet);
void ComputeTempDir();
- std::string Name;
+ cmExportSet* ExportSet;
std::string FilePermissions;
std::string FileName;
std::string Namespace;
diff --git a/Source/cmInstallTargetGenerator.cxx b/Source/cmInstallTargetGenerator.cxx
index 5f9b658..347ad3e 100644
--- a/Source/cmInstallTargetGenerator.cxx
+++ b/Source/cmInstallTargetGenerator.cxx
@@ -16,6 +16,7 @@
#include "cmLocalGenerator.h"
#include "cmMakefile.h"
#include "cmake.h"
+#include "cmGeneratorTarget.h"
#include <assert.h>
@@ -26,7 +27,8 @@ cmInstallTargetGenerator
std::vector<std::string> const& configurations,
const char* component, bool optional):
cmInstallGenerator(dest, configurations, component), Target(&t),
- ImportLibrary(implib), FilePermissions(file_permissions), Optional(optional)
+ ImportLibrary(implib), FilePermissions(file_permissions),
+ Optional(optional), GeneratorTarget(0)
{
this->ActionsPerConfig = true;
this->NamelinkMode = NamelinkModeNone;
@@ -484,6 +486,17 @@ void cmInstallTargetGenerator::PostReplacementTweaks(std::ostream& os,
this->AddStripRule(os, indent, file);
}
+void cmInstallTargetGenerator::CreateGeneratorTarget()
+{
+ if (!this->GeneratorTarget)
+ {
+ this->GeneratorTarget = this->Target->GetMakefile()
+ ->GetLocalGenerator()
+ ->GetGlobalGenerator()
+ ->GetGeneratorTarget(this->Target);
+ }
+}
+
//----------------------------------------------------------------------------
void
cmInstallTargetGenerator
@@ -507,10 +520,13 @@ cmInstallTargetGenerator
return;
}
+ this->CreateGeneratorTarget();
+
// Build a map of build-tree install_name to install-tree install_name for
// shared libraries linked to this target.
std::map<cmStdString, cmStdString> install_name_remap;
- if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config))
+ if(cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(config))
{
std::set<cmTarget*> const& sharedLibs = cli->GetSharedLibrariesLinked();
for(std::set<cmTarget*>::const_iterator j = sharedLibs.begin();
@@ -608,9 +624,12 @@ cmInstallTargetGenerator
return;
}
+ this->CreateGeneratorTarget();
+
// Get the link information for this target.
// It can provide the RPATH.
- cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
+ cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(config);
if(!cli)
{
return;
@@ -639,9 +658,12 @@ cmInstallTargetGenerator
return;
}
+ this->CreateGeneratorTarget();
+
// Get the link information for this target.
// It can provide the RPATH.
- cmComputeLinkInformation* cli = this->Target->GetLinkInformation(config);
+ cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(config);
if(!cli)
{
return;
diff --git a/Source/cmInstallTargetGenerator.h b/Source/cmInstallTargetGenerator.h
index 5d158b8..cab3e90 100644
--- a/Source/cmInstallTargetGenerator.h
+++ b/Source/cmInstallTargetGenerator.h
@@ -15,6 +15,8 @@
#include "cmInstallGenerator.h"
#include "cmTarget.h"
+class cmGeneratorTarget;
+
/** \class cmInstallTargetGenerator
* \brief Generate target installation rules.
*/
@@ -92,11 +94,14 @@ protected:
void AddRanlibRule(std::ostream& os, Indent const& indent,
const std::string& toDestDirPath);
+ void CreateGeneratorTarget();
+
cmTarget* Target;
bool ImportLibrary;
std::string FilePermissions;
bool Optional;
NamelinkModeType NamelinkMode;
+ cmGeneratorTarget* GeneratorTarget;
};
#endif
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index f2bced4..4952a8c 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -554,9 +554,9 @@ void cmLocalGenerator::GenerateTargetManifest()
}
void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
- const char* lang,
- cmSourceFile& source,
- cmTarget& target)
+ const char* lang,
+ cmSourceFile& source,
+ cmGeneratorTarget& target)
{
std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname));
objectDir = this->Convert(objectDir.c_str(),START_OUTPUT,SHELL);
@@ -635,7 +635,8 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
);
}
-void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
+void cmLocalGenerator::AddBuildTargetRule(const char* llang,
+ cmGeneratorTarget& target)
{
cmStdString objs;
std::vector<std::string> objVector;
@@ -669,15 +670,19 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
std::string createRule = "CMAKE_";
createRule += llang;
createRule += target.GetCreateRuleVariable();
- std::string targetName = target.GetFullName();
+ std::string targetName = target.Target->GetFullName();
// Executable :
// Shared Library:
// Static Library:
// Shared Module:
std::string linkLibs; // should be set
+ std::string frameworkPath;
+ std::string linkPath;
std::string flags; // should be set
std::string linkFlags; // should be set
- this->GetTargetFlags(linkLibs, flags, linkFlags, target);
+ this->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
+ &target);
+ linkLibs = frameworkPath + linkPath + linkLibs;
cmLocalGenerator::RuleVariables vars;
vars.Language = llang;
vars.Objects = objs.c_str();
@@ -714,7 +719,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
// Store this command line.
commandLines.push_back(commandLine);
}
- std::string targetFullPath = target.GetFullPath();
+ std::string targetFullPath = target.Target->GetFullPath();
// Generate a meaningful comment for the command.
std::string comment = "Linking ";
comment += llang;
@@ -728,7 +733,7 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
comment.c_str(),
this->Makefile->GetStartOutputDirectory()
);
- target.AddSourceFile
+ target.Target->AddSourceFile
(this->Makefile->GetSource(targetFullPath.c_str()));
}
@@ -736,11 +741,15 @@ void cmLocalGenerator::AddBuildTargetRule(const char* llang, cmTarget& target)
void cmLocalGenerator
::CreateCustomTargetsAndCommands(std::set<cmStdString> const& lang)
{
- cmTargets &tgts = this->Makefile->GetTargets();
- for(cmTargets::iterator l = tgts.begin();
+ cmGeneratorTargetsType tgts = this->Makefile->GetGeneratorTargets();
+ for(cmGeneratorTargetsType::iterator l = tgts.begin();
l != tgts.end(); l++)
{
- cmTarget& target = l->second;
+ if (l->first->IsImported())
+ {
+ continue;
+ }
+ cmGeneratorTarget& target = *l->second;
switch(target.GetType())
{
case cmTarget::STATIC_LIBRARY:
@@ -748,12 +757,12 @@ void cmLocalGenerator
case cmTarget::MODULE_LIBRARY:
case cmTarget::EXECUTABLE:
{
- const char* llang = target.GetLinkerLanguage();
+ const char* llang = target.Target->GetLinkerLanguage();
if(!llang)
{
cmSystemTools::Error
("CMake can not determine linker language for target:",
- target.GetName());
+ target.Target->GetName());
return;
}
// if the language is not in the set lang then create custom
@@ -1318,8 +1327,9 @@ std::string cmLocalGenerator::GetIncludeFlags(
//----------------------------------------------------------------------------
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
- cmTarget* target,
- const char* lang)
+ cmGeneratorTarget* target,
+ const char* lang,
+ const char *config)
{
// Need to decide whether to automatically include the source and
// binary directories at the beginning of the include path.
@@ -1389,6 +1399,11 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
}
}
+ if(!target)
+ {
+ return;
+ }
+
// Load implicit include directories for this language.
std::string impDirVar = "CMAKE_";
impDirVar += lang;
@@ -1406,10 +1421,8 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// Get the target-specific include directories.
std::vector<std::string> includes;
- if(target)
- {
- includes = target->GetIncludeDirectories();
- }
+
+ includes = target->GetIncludeDirectories(config);
// Support putting all the in-project include directories first if
// it is requested by the project.
@@ -1449,7 +1462,9 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
std::string& flags,
std::string& linkFlags,
- cmTarget& target)
+ std::string& frameworkPath,
+ std::string& linkPath,
+ cmGeneratorTarget* target)
{
std::string buildType =
this->Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
@@ -1457,12 +1472,12 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
const char* libraryLinkVariable =
"CMAKE_SHARED_LINKER_FLAGS"; // default to shared library
- switch(target.GetType())
+ switch(target->GetType())
{
case cmTarget::STATIC_LIBRARY:
{
const char* targetLinkFlags =
- target.GetProperty("STATIC_LIBRARY_FLAGS");
+ target->GetProperty("STATIC_LIBRARY_FLAGS");
if(targetLinkFlags)
{
linkFlags += targetLinkFlags;
@@ -1472,7 +1487,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
{
std::string build = "STATIC_LIBRARY_FLAGS_";
build += buildType;
- targetLinkFlags = target.GetProperty(build.c_str());
+ targetLinkFlags = target->GetProperty(build.c_str());
if(targetLinkFlags)
{
linkFlags += targetLinkFlags;
@@ -1498,7 +1513,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
if(this->Makefile->IsOn("WIN32") &&
!(this->Makefile->IsOn("CYGWIN") || this->Makefile->IsOn("MINGW")))
{
- const std::vector<cmSourceFile*>& sources = target.GetSourceFiles();
+ const std::vector<cmSourceFile*>& sources = target->GetSourceFiles();
for(std::vector<cmSourceFile*>::const_iterator i = sources.begin();
i != sources.end(); ++i)
{
@@ -1513,7 +1528,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
}
}
}
- const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
+ const char* targetLinkFlags = target->GetProperty("LINK_FLAGS");
if(targetLinkFlags)
{
linkFlags += targetLinkFlags;
@@ -1523,16 +1538,15 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
{
std::string configLinkFlags = "LINK_FLAGS_";
configLinkFlags += buildType;
- targetLinkFlags = target.GetProperty(configLinkFlags.c_str());
+ targetLinkFlags = target->GetProperty(configLinkFlags.c_str());
if(targetLinkFlags)
{
linkFlags += targetLinkFlags;
linkFlags += " ";
}
}
- cmOStringStream linklibsStr;
- this->OutputLinkLibraries(linklibsStr, target, false);
- linkLibs = linklibsStr.str();
+ this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
+ *target, false);
}
break;
case cmTarget::EXECUTABLE:
@@ -1547,18 +1561,17 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
linkFlags += this->Makefile->GetSafeDefinition(build.c_str());
linkFlags += " ";
}
- const char* linkLanguage = target.GetLinkerLanguage();
+ const char* linkLanguage = target->Target->GetLinkerLanguage();
if(!linkLanguage)
{
cmSystemTools::Error
("CMake can not determine linker language for target:",
- target.GetName());
+ target->Target->GetName());
return;
}
this->AddLanguageFlags(flags, linkLanguage, buildType.c_str());
- cmOStringStream linklibs;
- this->OutputLinkLibraries(linklibs, target, false);
- linkLibs = linklibs.str();
+ this->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
+ *target, false);
if(cmSystemTools::IsOn
(this->Makefile->GetDefinition("BUILD_SHARED_LIBS")))
{
@@ -1567,7 +1580,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
linkFlags += this->Makefile->GetSafeDefinition(sFlagVar.c_str());
linkFlags += " ";
}
- if ( target.GetPropertyAsBool("WIN32_EXECUTABLE") )
+ if ( target->GetPropertyAsBool("WIN32_EXECUTABLE") )
{
linkFlags +=
this->Makefile->GetSafeDefinition("CMAKE_CREATE_WIN32_EXE");
@@ -1579,7 +1592,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
this->Makefile->GetSafeDefinition("CMAKE_CREATE_CONSOLE_EXE");
linkFlags += " ";
}
- if (target.IsExecutableWithExports())
+ if (target->Target->IsExecutableWithExports())
{
std::string exportFlagVar = "CMAKE_EXE_EXPORTS_";
exportFlagVar += linkLanguage;
@@ -1589,7 +1602,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
this->Makefile->GetSafeDefinition(exportFlagVar.c_str());
linkFlags += " ";
}
- const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
+ const char* targetLinkFlags = target->GetProperty("LINK_FLAGS");
if(targetLinkFlags)
{
linkFlags += targetLinkFlags;
@@ -1599,7 +1612,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
{
std::string configLinkFlags = "LINK_FLAGS_";
configLinkFlags += buildType;
- targetLinkFlags = target.GetProperty(configLinkFlags.c_str());
+ targetLinkFlags = target->GetProperty(configLinkFlags.c_str());
if(targetLinkFlags)
{
linkFlags += targetLinkFlags;
@@ -1650,10 +1663,13 @@ std::string cmLocalGenerator::ConvertToLinkReference(std::string const& lib)
* targetLibrary should be a NULL pointer. For libraries, it should point
* to the name of the library. This will not link a library against itself.
*/
-void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
- cmTarget& tgt,
+void cmLocalGenerator::OutputLinkLibraries(std::string& linkLibraries,
+ std::string& frameworkPath,
+ std::string& linkPath,
+ cmGeneratorTarget &tgt,
bool relink)
{
+ cmOStringStream fout;
const char* config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
cmComputeLinkInformation* pcli = tgt.GetLinkInformation(config);
if(!pcli)
@@ -1687,9 +1703,9 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
for(std::vector<std::string>::const_iterator fdi = fwDirs.begin();
fdi != fwDirs.end(); ++fdi)
{
- linkLibs += "-F";
- linkLibs += this->Convert(fdi->c_str(), NONE, SHELL, false);
- linkLibs += " ";
+ frameworkPath = " -F";
+ frameworkPath += this->Convert(fdi->c_str(), NONE, SHELL, false);
+ frameworkPath += " ";
}
// Append the library search path flags.
@@ -1698,10 +1714,10 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
libDir != libDirs.end(); ++libDir)
{
std::string libpath = this->ConvertToOutputForExisting(libDir->c_str());
- linkLibs += libPathFlag;
- linkLibs += libpath;
- linkLibs += libPathTerminator;
- linkLibs += " ";
+ linkPath += " " + libPathFlag;
+ linkPath += libpath;
+ linkPath += libPathTerminator;
+ linkPath += " ";
}
// Append the link items.
@@ -1773,12 +1789,14 @@ void cmLocalGenerator::OutputLinkLibraries(std::ostream& fout,
{
fout << stdLibs << " ";
}
+
+ linkLibraries = fout.str();
}
//----------------------------------------------------------------------------
void cmLocalGenerator::AddArchitectureFlags(std::string& flags,
- cmTarget* target,
+ cmGeneratorTarget* target,
const char *lang,
const char* config)
{
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index b3396e3..bd58218 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -16,6 +16,7 @@
class cmMakefile;
class cmGlobalGenerator;
+class cmGeneratorTarget;
class cmTarget;
class cmTargetManifest;
class cmSourceFile;
@@ -135,7 +136,7 @@ public:
std::vector<cmLocalGenerator*>& GetChildren() { return this->Children; };
- void AddArchitectureFlags(std::string& flags, cmTarget* target,
+ void AddArchitectureFlags(std::string& flags, cmGeneratorTarget* target,
const char *lang, const char* config);
void AddLanguageFlags(std::string& flags, const char* lang,
@@ -156,6 +157,11 @@ public:
*/
void AppendDefines(std::set<std::string>& defines,
const char* defines_list);
+ void AppendDefines(std::set<std::string>& defines,
+ std::string defines_list)
+ {
+ this->AppendDefines(defines, defines_list.c_str());
+ }
/**
* Join a set of defines into a definesString with a space separator.
*/
@@ -205,8 +211,8 @@ public:
/** Get the include flags for the current makefile and language. */
void GetIncludeDirectories(std::vector<std::string>& dirs,
- cmTarget* target,
- const char* lang = "C");
+ cmGeneratorTarget* target,
+ const char* lang = "C", const char *config = 0);
/** Compute the language used to compile the given source file. */
const char* GetSourceFileLanguage(const cmSourceFile& source);
@@ -334,11 +340,17 @@ public:
void GetTargetFlags(std::string& linkLibs,
std::string& flags,
std::string& linkFlags,
- cmTarget&target);
+ std::string& frameworkPath,
+ std::string& linkPath,
+ cmGeneratorTarget* target);
protected:
///! put all the libraries for a target on into the given stream
- virtual void OutputLinkLibraries(std::ostream&, cmTarget&, bool relink);
+ virtual void OutputLinkLibraries(std::string& linkLibraries,
+ std::string& frameworkPath,
+ std::string& linkPath,
+ cmGeneratorTarget &,
+ bool relink);
// Expand rule variables in CMake of the type found in language rules
void ExpandRuleVariables(std::string& string,
@@ -354,12 +366,12 @@ protected:
/** Convert a target to a utility target for unsupported
* languages of a generator */
- void AddBuildTargetRule(const char* llang, cmTarget& target);
+ void AddBuildTargetRule(const char* llang, cmGeneratorTarget& target);
///! add a custom command to build a .o file that is part of a target
void AddCustomCommandToCreateObject(const char* ofname,
const char* lang,
cmSourceFile& source,
- cmTarget& target);
+ cmGeneratorTarget& target);
// Create Custom Targets and commands for unsupported languages
// The set passed in should contain the languages supported by the
// generator directly. Any targets containing files that are not
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 9f2a863..f15322b 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -853,7 +853,8 @@ inline std::string removeQuotes(const std::string& s)
std::string
-cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target)
+cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target,
+ const char *config)
{
std::string includeOptions;
@@ -862,10 +863,13 @@ cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target)
// the length threatens this problem.
unsigned int maxIncludeLength = 3000;
bool useShortPath = false;
+
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
for(int j=0; j < 2; ++j)
{
std::vector<std::string> includes;
- this->GetIncludeDirectories(includes, &target);
+ this->GetIncludeDirectories(includes, gt, "C", config);
std::vector<std::string>::iterator i;
for(i = includes.begin(); i != includes.end(); ++i)
@@ -1144,7 +1148,15 @@ void cmLocalVisualStudio6Generator
#endif
// Get include options for this target.
- std::string includeOptions = this->GetTargetIncludeOptions(target);
+ std::string includeOptionsDebug = this->GetTargetIncludeOptions(target,
+ "DEBUG");
+ std::string includeOptionsRelease = this->GetTargetIncludeOptions(target,
+ "RELEASE");
+ std::string includeOptionsRelWithDebInfo = this->GetTargetIncludeOptions(
+ target,
+ "RELWITHDEBINFO");
+ std::string includeOptionsMinSizeRel = this->GetTargetIncludeOptions(target,
+ "MINSIZEREL");
// Get extra linker options for this target type.
std::string extraLinkOptions;
@@ -1557,8 +1569,15 @@ void cmLocalVisualStudio6Generator
cmSystemTools::ReplaceString(line, "CM_MULTILINE_OPTIONS_RELWITHDEBINFO",
optionsRelWithDebInfo.c_str());
- cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
- includeOptions.c_str());
+ cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_DEBUG",
+ includeOptionsDebug.c_str());
+ cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_RELEASE",
+ includeOptionsRelease.c_str());
+ cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_MINSIZEREL",
+ includeOptionsMinSizeRel.c_str());
+ cmSystemTools::ReplaceString(line, "BUILD_INCLUDES_RELWITHDEBINFO",
+ includeOptionsRelWithDebInfo.c_str());
+
cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG",
targetVersionFlag.c_str());
cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_DEBUG",
@@ -1676,37 +1695,25 @@ void cmLocalVisualStudio6Generator
std::set<std::string> minsizeDefinesSet;
std::set<std::string> debugrelDefinesSet;
- this->AppendDefines(
- definesSet,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
- this->AppendDefines(
- debugDefinesSet,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_DEBUG"));
- this->AppendDefines(
- releaseDefinesSet,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_RELEASE"));
- this->AppendDefines(
- minsizeDefinesSet,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"));
- this->AppendDefines(
- debugrelDefinesSet,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"));
+
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
this->AppendDefines(
definesSet,
- target.GetProperty("COMPILE_DEFINITIONS"));
+ gt->GetCompileDefinitions());
this->AppendDefines(
debugDefinesSet,
- target.GetProperty("COMPILE_DEFINITIONS_DEBUG"));
+ gt->GetCompileDefinitions("DEBUG"));
this->AppendDefines(
releaseDefinesSet,
- target.GetProperty("COMPILE_DEFINITIONS_RELEASE"));
+ gt->GetCompileDefinitions("RELEASE"));
this->AppendDefines(
minsizeDefinesSet,
- target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"));
+ gt->GetCompileDefinitions("MINSIZEREL"));
this->AppendDefines(
debugrelDefinesSet,
- target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"));
+ gt->GetCompileDefinitions("RELWITHDEBINFO"));
std::string defines = " ";
std::string debugDefines = " ";
@@ -1776,8 +1783,10 @@ void cmLocalVisualStudio6Generator
const std::string extraOptions,
std::string& options)
{
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
// Compute the link information for this configuration.
- cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
+ cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
if(!pcli)
{
return;
diff --git a/Source/cmLocalVisualStudio6Generator.h b/Source/cmLocalVisualStudio6Generator.h
index 9315d97..f45bc17 100644
--- a/Source/cmLocalVisualStudio6Generator.h
+++ b/Source/cmLocalVisualStudio6Generator.h
@@ -90,7 +90,7 @@ private:
std::string& options);
void OutputObjects(cmTarget& target, const char* tool,
std::string& options);
- std::string GetTargetIncludeOptions(cmTarget &target);
+ std::string GetTargetIncludeOptions(cmTarget &target, const char *config);
std::vector<std::string> Configurations;
std::string GetConfigName(std::string const& configuration) const;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 2dfca02..f9a2d32 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -724,10 +724,6 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
flags += targetFlags;
}
- std::string configUpper = cmSystemTools::UpperCase(configName);
- std::string defPropName = "COMPILE_DEFINITIONS_";
- defPropName += configUpper;
-
// Get preprocessor definitions for this directory.
std::string defineFlags = this->Makefile->GetDefineFlags();
Options::Tool t = Options::Compiler;
@@ -744,11 +740,10 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
targetOptions.Parse(flags.c_str());
targetOptions.Parse(defineFlags.c_str());
targetOptions.ParseFinish();
- targetOptions.AddDefines
- (this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
- targetOptions.AddDefines(target.GetProperty("COMPILE_DEFINITIONS"));
- targetOptions.AddDefines(this->Makefile->GetProperty(defPropName.c_str()));
- targetOptions.AddDefines(target.GetProperty(defPropName.c_str()));
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
+ targetOptions.AddDefines(gt->GetCompileDefinitions().c_str());
+ targetOptions.AddDefines(gt->GetCompileDefinitions(configName).c_str());
targetOptions.SetVerboseMakefile(
this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
@@ -819,7 +814,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
targetOptions.OutputAdditionalOptions(fout, "\t\t\t\t", "\n");
fout << "\t\t\t\tAdditionalIncludeDirectories=\"";
std::vector<std::string> includes;
- this->GetIncludeDirectories(includes, &target);
+ this->GetIncludeDirectories(includes, gt, "C", configName);
std::vector<std::string>::iterator i = includes.begin();
for(;i != includes.end(); ++i)
{
@@ -847,7 +842,7 @@ void cmLocalVisualStudio7Generator::WriteConfiguration(std::ostream& fout,
// non-debug configurations because VS still creates .idb files.
fout << "\t\t\t\tProgramDataBaseFileName=\""
<< this->ConvertToXMLOutputPathSingle(
- target.GetDirectory(configName).c_str())
+ target.GetPDBDirectory(configName).c_str())
<< "/"
<< target.GetPDBName(configName) << "\"\n";
}
@@ -1079,7 +1074,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
targetNameImport, targetNamePDB, configName);
// Compute the link library and directory information.
- cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
+ cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
if(!pcli)
{
return;
@@ -1125,7 +1122,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
fout << "\t\t\t\tAdditionalLibraryDirectories=\"";
this->OutputLibraryDirectories(fout, cli.GetDirectories());
fout << "\"\n";
- temp = target.GetDirectory(configName);
+ temp = target.GetPDBDirectory(configName);
temp += "/";
temp += targetNamePDB;
fout << "\t\t\t\tProgramDatabaseFile=\"" <<
@@ -1164,7 +1161,9 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
targetNameImport, targetNamePDB, configName);
// Compute the link library and directory information.
- cmComputeLinkInformation* pcli = target.GetLinkInformation(configName);
+ cmGeneratorTarget* gt =
+ this->GlobalGenerator->GetGeneratorTarget(&target);
+ cmComputeLinkInformation* pcli = gt->GetLinkInformation(configName);
if(!pcli)
{
return;
@@ -1211,7 +1210,7 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(std::ostream& fout,
this->OutputLibraryDirectories(fout, cli.GetDirectories());
fout << "\"\n";
std::string path = this->ConvertToXMLOutputPathSingle(
- target.GetDirectory(configName).c_str());
+ target.GetPDBDirectory(configName).c_str());
fout << "\t\t\t\tProgramDatabaseFile=\""
<< path << "/" << targetNamePDB
<< "\"\n";
diff --git a/Source/cmMakeDepend.cxx b/Source/cmMakeDepend.cxx
index a68b57c..2ae35ef 100644
--- a/Source/cmMakeDepend.cxx
+++ b/Source/cmMakeDepend.cxx
@@ -11,6 +11,7 @@
============================================================================*/
#include "cmMakeDepend.h"
#include "cmSystemTools.h"
+#include "cmGeneratorExpression.h"
#include <cmsys/RegularExpression.hxx>
@@ -58,11 +59,22 @@ void cmMakeDepend::SetMakefile(cmMakefile* makefile)
// Now extract any include paths from the targets
std::set<std::string> uniqueIncludes;
std::vector<std::string> orderedAndUniqueIncludes;
- cmTargets & targets = this->Makefile->GetTargets();
- for (cmTargets::iterator l = targets.begin(); l != targets.end(); ++l)
+ cmTargets &targets = this->Makefile->GetTargets();
+ for (cmTargets::iterator l = targets.begin();
+ l != targets.end(); ++l)
{
- const std::vector<std::string>& includes =
- l->second.GetIncludeDirectories();
+ const char *incDirProp = l->second.GetProperty("INCLUDE_DIRECTORIES");
+ if (!incDirProp)
+ {
+ continue;
+ }
+
+ std::string incDirs = cmGeneratorExpression::Preprocess(incDirProp,
+ cmGeneratorExpression::StripAllGeneratorExpressions);
+
+ std::vector<std::string> includes;
+ cmSystemTools::ExpandListArgument(incDirs.c_str(), includes);
+
for(std::vector<std::string>::const_iterator j = includes.begin();
j != includes.end(); ++j)
{
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 9a9c1c8..f067da4 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -3984,6 +3984,12 @@ cmTarget* cmMakefile::FindTargetToUse(const char* name)
return this->LocalGenerator->GetGlobalGenerator()->FindTarget(0, name);
}
+cmGeneratorTarget* cmMakefile::FindGeneratorTargetToUse(const char* name)
+{
+ cmTarget *t = this->FindTargetToUse(name);
+ return this->LocalGenerator->GetGlobalGenerator()->GetGeneratorTarget(t);
+}
+
//----------------------------------------------------------------------------
bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg,
bool isCustom)
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 74c8039..70cfe54 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -20,6 +20,7 @@
#include "cmSystemTools.h"
#include "cmTarget.h"
#include "cmNewLineStyle.h"
+#include "cmGeneratorTarget.h"
#include "cmake.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
@@ -518,12 +519,27 @@ public:
* Get the list of targets, const version
*/
const cmTargets &GetTargets() const { return this->Targets; }
+ const std::vector<cmTarget*> &GetOwnedImportedTargets() const
+ {
+ return this->ImportedTargetsOwned;
+ }
+
+ const cmGeneratorTargetsType &GetGeneratorTargets() const
+ {
+ return this->GeneratorTargets;
+ }
+
+ void SetGeneratorTargets(const cmGeneratorTargetsType &targets)
+ {
+ this->GeneratorTargets = targets;
+ }
cmTarget* FindTarget(const char* name);
/** Find a target to use in place of the given name. The target
returned may be imported or built within the project. */
cmTarget* FindTargetToUse(const char* name);
+ cmGeneratorTarget* FindGeneratorTargetToUse(const char* name);
/**
* Mark include directories as system directories.
@@ -865,6 +881,7 @@ protected:
// libraries, classes, and executables
cmTargets Targets;
+ cmGeneratorTargetsType GeneratorTargets;
std::vector<cmSourceFile*> SourceFiles;
// Tests
diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx
index ab5150a..b7a454b 100644
--- a/Source/cmMakefileExecutableTargetGenerator.cxx
+++ b/Source/cmMakefileExecutableTargetGenerator.cxx
@@ -131,9 +131,14 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
outpathImp += "/";
}
}
+
+ std::string pdbOutputPath = this->Target->GetPDBDirectory();
+ cmSystemTools::MakeDirectory(pdbOutputPath.c_str());
+ pdbOutputPath += "/";
+
std::string targetFullPath = outpath + targetName;
std::string targetFullPathReal = outpath + targetNameReal;
- std::string targetFullPathPDB = outpath + targetNamePDB;
+ std::string targetFullPathPDB = pdbOutputPath + targetNamePDB;
std::string targetFullPathImport = outpathImp + targetNameImport;
std::string targetOutPathPDB =
this->Convert(targetFullPathPDB.c_str(),
@@ -210,7 +215,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
// Add language feature flags.
this->AddFeatureFlags(flags, linkLanguage);
- this->LocalGenerator->AddArchitectureFlags(flags, this->Target,
+ this->LocalGenerator->AddArchitectureFlags(flags, this->GeneratorTarget,
linkLanguage, this->ConfigName);
// Add target-specific linker flags.
@@ -318,9 +323,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
this->LocalGenerator->SetLinkScriptShell(useLinkScript);
// Collect up flags to link in needed libraries.
- cmOStringStream linklibs;
- this->LocalGenerator->OutputLinkLibraries(linklibs, *this->Target, relink);
-
+ std::string linkLibs;
+ std::string frameworkPath;
+ std::string linkPath;
+ this->LocalGenerator->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
+ *this->GeneratorTarget,
+ relink);
+ linkLibs = frameworkPath + linkPath + linkLibs;
// Construct object file lists that may be needed to expand the
// rule.
std::string buildObjs;
@@ -359,8 +368,7 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink)
vars.TargetVersionMajor = targetVersionMajor.c_str();
vars.TargetVersionMinor = targetVersionMinor.c_str();
- std::string linkString = linklibs.str();
- vars.LinkLibraries = linkString.c_str();
+ vars.LinkLibraries = linkLibs.c_str();
vars.Flags = flags.c_str();
vars.LinkFlags = linkFlags.c_str();
// Expand placeholders in the commands.
diff --git a/Source/cmMakefileLibraryTargetGenerator.cxx b/Source/cmMakefileLibraryTargetGenerator.cxx
index 577e5fd..e7004d6 100644
--- a/Source/cmMakefileLibraryTargetGenerator.cxx
+++ b/Source/cmMakefileLibraryTargetGenerator.cxx
@@ -328,8 +328,12 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
}
}
+ std::string pdbOutputPath = this->Target->GetPDBDirectory();
+ cmSystemTools::MakeDirectory(pdbOutputPath.c_str());
+ pdbOutputPath += "/";
+
std::string targetFullPath = outpath + targetName;
- std::string targetFullPathPDB = outpath + targetNamePDB;
+ std::string targetFullPathPDB = pdbOutputPath + targetNamePDB;
std::string targetFullPathSO = outpath + targetNameSO;
std::string targetFullPathReal = outpath + targetNameReal;
std::string targetFullPathImport = outpathImp + targetNameImport;
@@ -542,11 +546,15 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
this->LocalGenerator->SetLinkScriptShell(useLinkScript);
// Collect up flags to link in needed libraries.
- cmOStringStream linklibs;
+ std::string linkLibs;
if(this->Target->GetType() != cmTarget::STATIC_LIBRARY)
{
+ std::string frameworkPath;
+ std::string linkPath;
this->LocalGenerator
- ->OutputLinkLibraries(linklibs, *this->Target, relink);
+ ->OutputLinkLibraries(linkLibs, frameworkPath, linkPath,
+ *this->GeneratorTarget, relink);
+ linkLibs = frameworkPath + linkPath + linkLibs;
}
// Construct object file lists that may be needed to expand the
@@ -587,8 +595,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
cmLocalGenerator::SHELL);
vars.ObjectDir = objdir.c_str();
vars.Target = targetOutPathReal.c_str();
- std::string linkString = linklibs.str();
- vars.LinkLibraries = linkString.c_str();
+ vars.LinkLibraries = linkLibs.c_str();
vars.ObjectsQuoted = buildObjs.c_str();
if (this->Target->HasSOName(this->ConfigName))
{
@@ -625,7 +632,7 @@ void cmMakefileLibraryTargetGenerator::WriteLibraryRules
std::string langFlags;
this->AddFeatureFlags(langFlags, linkLanguage);
- this->LocalGenerator->AddArchitectureFlags(langFlags, this->Target,
+ this->LocalGenerator->AddArchitectureFlags(langFlags, this->GeneratorTarget,
linkLanguage, this->ConfigName);
// remove any language flags that might not work with the
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 95738c4..3d02d6a 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -259,7 +259,7 @@ std::string cmMakefileTargetGenerator::GetFlags(const std::string &l)
// Add language feature flags.
this->AddFeatureFlags(flags, lang);
- this->LocalGenerator->AddArchitectureFlags(flags, this->Target,
+ this->LocalGenerator->AddArchitectureFlags(flags, this->GeneratorTarget,
lang, this->ConfigName);
// Fortran-specific flags computed for this target.
@@ -302,16 +302,11 @@ std::string cmMakefileTargetGenerator::GetDefines(const std::string &l)
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines
- (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
- this->LocalGenerator->AppendDefines
- (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"));
- std::string defPropName = "COMPILE_DEFINITIONS_";
- defPropName +=
- cmSystemTools::UpperCase(this->LocalGenerator->ConfigurationName);
- this->LocalGenerator->AppendDefines
- (defines, this->Makefile->GetProperty(defPropName.c_str()));
+ (defines, this->GeneratorTarget->GetCompileDefinitions());
+
this->LocalGenerator->AppendDefines
- (defines, this->Target->GetProperty(defPropName.c_str()));
+ (defines, this->GeneratorTarget->GetCompileDefinitions(
+ this->LocalGenerator->ConfigurationName.c_str()));
std::string definesString;
this->LocalGenerator->JoinDefines(defines, definesString, lang);
@@ -652,7 +647,7 @@ cmMakefileTargetGenerator
this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
{
- targetFullPathPDB = this->Target->GetDirectory(this->ConfigName);
+ targetFullPathPDB = this->Target->GetPDBDirectory(this->ConfigName);
targetFullPathPDB += "/";
targetFullPathPDB += this->Target->GetPDBName(this->ConfigName);
}
@@ -1022,7 +1017,8 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
<< "SET(CMAKE_TARGET_LINKED_INFO_FILES\n";
std::set<cmTarget const*> emitted;
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
- if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
+ if(cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(cfg))
{
cmComputeLinkInformation::ItemVector const& items = cli->GetItems();
for(cmComputeLinkInformation::ItemVector::const_iterator
@@ -1061,7 +1057,11 @@ void cmMakefileTargetGenerator::WriteTargetDependRules()
*this->InfoFileStream
<< "SET(CMAKE_C_TARGET_INCLUDE_PATH\n";
std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes, this->Target);
+
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ "C", config);
for(std::vector<std::string>::iterator i = includes.begin();
i != includes.end(); ++i)
{
@@ -1546,7 +1546,11 @@ std::string cmMakefileTargetGenerator::GetFrameworkFlags()
emitted.insert("/System/Library/Frameworks");
#endif
std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes, this->Target);
+
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ "C", config);
std::vector<std::string>::iterator i;
// check all include directories for frameworks as this
// will already have added a -F for the framework
@@ -1590,7 +1594,8 @@ void cmMakefileTargetGenerator
// Loop over all library dependencies.
const char* cfg = this->LocalGenerator->ConfigurationName.c_str();
- if(cmComputeLinkInformation* cli = this->Target->GetLinkInformation(cfg))
+ if(cmComputeLinkInformation* cli =
+ this->GeneratorTarget->GetLinkInformation(cfg))
{
std::vector<std::string> const& libDeps = cli->GetDepends();
for(std::vector<std::string>::const_iterator j = libDeps.begin();
@@ -1850,7 +1855,10 @@ void cmMakefileTargetGenerator::AddIncludeFlags(std::string& flags,
std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes, this->Target, lang);
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ lang, config);
std::string includeFlags =
this->LocalGenerator->GetIncludeFlags(includes, lang, useResponseFile);
@@ -1953,7 +1961,10 @@ void cmMakefileTargetGenerator::AddFortranFlags(std::string& flags)
this->Makefile->GetDefinition("CMAKE_Fortran_MODPATH_FLAG"))
{
std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes, this->Target);
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ "C", config);
for(std::vector<std::string>::const_iterator idi = includes.begin();
idi != includes.end(); ++idi)
{
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index 9dc860e..6c54ced 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -153,7 +153,7 @@ cmNinjaNormalTargetGenerator
cmTarget::TargetType targetType = this->GetTarget()->GetType();
std::string ruleName = this->LanguageLinkerRule();
if (useResponseFile)
- ruleName += "_RSPFILE";
+ ruleName += "_RSP_FILE";
// Select whether to use a response file for objects.
std::string rspfile;
@@ -168,20 +168,29 @@ cmNinjaNormalTargetGenerator
std::string responseFlag;
if (!useResponseFile) {
vars.Objects = "$in";
- vars.LinkLibraries = "$LINK_LIBRARIES";
+ vars.LinkLibraries = "$LINK_PATH $LINK_LIBRARIES";
} else {
- // handle response file
- std::string cmakeLinkVar = std::string("CMAKE_") +
- this->TargetLinkLanguage + "_RESPONSE_FILE_LINK_FLAG";
+ std::string cmakeVarLang = "CMAKE_";
+ cmakeVarLang += this->TargetLinkLanguage;
+
+ // build response file name
+ std::string cmakeLinkVar = cmakeVarLang + "_RESPONSE_FILE_LINK_FLAG";
const char * flag = GetMakefile()->GetDefinition(cmakeLinkVar.c_str());
if(flag) {
responseFlag = flag;
} else {
responseFlag = "@";
}
- rspfile = "$out.rsp";
+ rspfile = "$RSP_FILE";
responseFlag += rspfile;
- rspcontent = "$in $LINK_LIBRARIES";
+
+ // build response file content
+ std::string linkOptionVar = cmakeVarLang;
+ linkOptionVar += "_COMPILER_LINKER_OPTION_FLAG_";
+ linkOptionVar += cmTarget::GetTargetTypeName(targetType);
+ const std::string linkOption =
+ GetMakefile()->GetSafeDefinition(linkOptionVar.c_str());
+ rspcontent = "$in " + linkOption + " $LINK_PATH $LINK_LIBRARIES";
vars.Objects = responseFlag.c_str();
vars.LinkLibraries = "";
}
@@ -420,12 +429,17 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
cmNinjaDeps explicitDeps = this->GetObjects();
cmNinjaDeps implicitDeps = this->ComputeLinkDeps();
+ std::string frameworkPath;
+ std::string linkPath;
this->GetLocalGenerator()->GetTargetFlags(vars["LINK_LIBRARIES"],
vars["FLAGS"],
vars["LINK_FLAGS"],
- *this->GetTarget());
+ frameworkPath,
+ linkPath,
+ this->GetGeneratorTarget());
this->AddModuleDefinitionFlag(vars["LINK_FLAGS"]);
+ vars["LINK_PATH"] = frameworkPath + linkPath;
// Compute architecture specific link flags. Yes, these go into a different
// variable for executables, probably due to a mistake made when duplicating
@@ -434,7 +448,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
? vars["FLAGS"]
: vars["ARCH_FLAGS"]);
this->GetLocalGenerator()->AddArchitectureFlags(flags,
- this->GetTarget(),
+ this->GetGeneratorTarget(),
this->TargetLinkLanguage,
this->GetConfigName());
if (targetType == cmTarget::EXECUTABLE) {
@@ -539,15 +553,24 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
int linkRuleLength = this->GetGlobalGenerator()->
GetRuleCmdLength(this->LanguageLinkerRule());
+
+ int commandLineLengthLimit = 1;
+ const char* forceRspFile = "CMAKE_NINJA_FORCE_RESPONSE_FILE";
+ if (!this->GetMakefile()->IsDefinitionSet(forceRspFile) &&
+ cmSystemTools::GetEnv(forceRspFile) == 0) {
#ifdef _WIN32
- int commandLineLengthLimit = 8000 - linkRuleLength;
+ commandLineLengthLimit = 8000 - linkRuleLength;
#elif defined(__linux) || defined(__APPLE__)
- // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
- int commandLineLengthLimit = ((int)sysconf(_SC_ARG_MAX))
- - linkRuleLength - 1000;
+ // for instance ARG_MAX is 2096152 on Ubuntu or 262144 on Mac
+ commandLineLengthLimit = ((int)sysconf(_SC_ARG_MAX))-linkRuleLength-1000;
#else
- int commandLineLengthLimit = -1;
+ commandLineLengthLimit = -1;
#endif
+ }
+
+ const std::string rspfile = std::string
+ (cmake::GetCMakeFilesDirectoryPostSlash()) +
+ this->GetTarget()->GetName() + ".rsp";
// Write the build statement for this target.
cmGlobalNinjaGenerator::WriteBuild(this->GetBuildFileStream(),
@@ -558,6 +581,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
implicitDeps,
emptyDeps,
vars,
+ rspfile,
commandLineLengthLimit);
if (targetOutput != targetOutputReal) {
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 385b4a0..0f10152 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -134,7 +134,7 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source,
this->AddFeatureFlags(flags, language.c_str());
this->GetLocalGenerator()->AddArchitectureFlags(flags,
- this->GetTarget(),
+ this->GeneratorTarget,
language.c_str(),
this->GetConfigName());
@@ -152,8 +152,10 @@ cmNinjaTargetGenerator::ComputeFlagsForObject(cmSourceFile *source,
// Add include directory flags.
{
std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes, this->Target,
- language.c_str());
+ const char *config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ language.c_str(), config);
std::string includeFlags =
this->LocalGenerator->GetIncludeFlags(includes, language.c_str(),
language == "RC" ? true : false); // full include paths for RC
@@ -225,10 +227,7 @@ ComputeDefines(cmSourceFile *source, const std::string& language)
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines
(defines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
- this->LocalGenerator->AppendDefines
- (defines,
- this->Target->GetProperty("COMPILE_DEFINITIONS"));
+ this->GeneratorTarget->GetCompileDefinitions());
this->LocalGenerator->AppendDefines
(defines,
source->GetProperty("COMPILE_DEFINITIONS"));
@@ -237,10 +236,7 @@ ComputeDefines(cmSourceFile *source, const std::string& language)
defPropName += cmSystemTools::UpperCase(this->GetConfigName());
this->LocalGenerator->AppendDefines
(defines,
- this->Makefile->GetProperty(defPropName.c_str()));
- this->LocalGenerator->AppendDefines
- (defines,
- this->Target->GetProperty(defPropName.c_str()));
+ this->GeneratorTarget->GetCompileDefinitions(this->GetConfigName()));
this->LocalGenerator->AppendDefines
(defines,
source->GetProperty(defPropName.c_str()));
@@ -261,7 +257,7 @@ cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
return cmNinjaDeps();
cmComputeLinkInformation* cli =
- this->Target->GetLinkInformation(this->GetConfigName());
+ this->GeneratorTarget->GetLinkInformation(this->GetConfigName());
if(!cli)
return cmNinjaDeps();
@@ -335,10 +331,10 @@ bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
this->Target->GetType() == cmTarget::MODULE_LIBRARY)
{
- pdbPath = this->Target->GetDirectory(this->GetConfigName());
+ pdbPath = this->Target->GetPDBDirectory(this->GetConfigName());
pdbPath += "/";
pdbPath += this->Target->GetPDBName(this->GetConfigName());
- }
+ }
vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
ConvertToNinjaPath(pdbPath.c_str()).c_str(),
@@ -374,7 +370,7 @@ cmNinjaTargetGenerator
std::string flags = "$FLAGS";
vars.Defines = "$DEFINES";
vars.TargetPDB = "$TARGET_PDB";
-
+ vars.ObjectDir = "$OBJECT_DIR";
cmMakefile* mf = this->GetMakefile();
@@ -514,8 +510,6 @@ void
cmNinjaTargetGenerator
::WriteObjectBuildStatement(cmSourceFile* source)
{
- cmNinjaDeps emptyDeps;
-
std::string comment;
const std::string language = source->GetLanguage();
std::string rule = this->LanguageCompilerRule(language);
@@ -539,11 +533,12 @@ cmNinjaTargetGenerator
cmNinjaDeps orderOnlyDeps;
this->GetLocalGenerator()->AppendTargetDepends(this->Target, orderOnlyDeps);
+ cmNinjaDeps implicitDeps;
if(const char* objectDeps = source->GetProperty("OBJECT_DEPENDS")) {
std::vector<std::string> depList;
cmSystemTools::ExpandListArgument(objectDeps, depList);
std::transform(depList.begin(), depList.end(),
- std::back_inserter(orderOnlyDeps), MapToNinjaPath());
+ std::back_inserter(implicitDeps), MapToNinjaPath());
}
// Add order-only dependencies on custom command outputs.
@@ -554,7 +549,7 @@ cmNinjaTargetGenerator
cmCustomCommand const* cc = (*si)->GetCustomCommand();
const std::vector<std::string>& ccoutputs = cc->GetOutputs();
std::transform(ccoutputs.begin(), ccoutputs.end(),
- std::back_inserter(orderOnlyDeps), MapToNinjaPath());
+ std::back_inserter(implicitDeps), MapToNinjaPath());
}
// If the source file is GENERATED and does not have a custom command
@@ -573,6 +568,13 @@ cmNinjaTargetGenerator
vars["DEP_FILE"] = objectFileName + ".d";;
EnsureParentDirectoryExists(objectFileName);
+ std::string objectDir = cmSystemTools::GetFilenamePath(objectFileName);
+ objectDir = this->GetLocalGenerator()->Convert(objectDir.c_str(),
+ cmLocalGenerator::START_OUTPUT,
+ cmLocalGenerator::SHELL);
+ vars["OBJECT_DIR"] = objectDir;
+
+
this->SetMsvcTargetPdbVariable(vars);
if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))
@@ -597,6 +599,7 @@ cmNinjaTargetGenerator
compileObjectVars.Source = escapedSourceFileName.c_str();
compileObjectVars.Object = objectFileName.c_str();
+ compileObjectVars.ObjectDir = objectDir.c_str();
compileObjectVars.Flags = vars["FLAGS"].c_str();
compileObjectVars.Defines = vars["DEFINES"].c_str();
@@ -625,7 +628,7 @@ cmNinjaTargetGenerator
rule,
outputs,
explicitDeps,
- emptyDeps,
+ implicitDeps,
orderOnlyDeps,
vars);
@@ -669,9 +672,19 @@ cmNinjaTargetGenerator
void
cmNinjaTargetGenerator
-::EnsureDirectoryExists(const std::string& dir) const
+::EnsureDirectoryExists(const std::string& path) const
{
- cmSystemTools::MakeDirectory(dir.c_str());
+ if (cmSystemTools::FileIsFullPath(path.c_str()))
+ {
+ cmSystemTools::MakeDirectory(path.c_str());
+ }
+ else
+ {
+ const std::string fullPath = std::string(this->GetGlobalGenerator()->
+ GetCMakeInstance()->GetHomeOutputDirectory())
+ + "/" + path;
+ cmSystemTools::MakeDirectory(fullPath.c_str());
+ }
}
void
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index cd20694..cf06bfd 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -52,6 +52,9 @@ protected:
cmTarget* GetTarget() const
{ return this->Target; }
+ cmGeneratorTarget* GetGeneratorTarget() const
+ { return this->GeneratorTarget; }
+
cmLocalNinjaGenerator* GetLocalGenerator() const
{ return this->LocalGenerator; }
diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx
index 71feffd..942c7ab 100644
--- a/Source/cmQtAutomoc.cxx
+++ b/Source/cmQtAutomoc.cxx
@@ -111,6 +111,7 @@ cmQtAutomoc::cmQtAutomoc()
void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
{
cmMakefile* makefile = target->GetMakefile();
+ cmLocalGenerator* localGen = makefile->GetLocalGenerator();
const char* targetName = target->GetName();
// don't do anything if there is no Qt4 or Qt5Core (which contains moc):
std::string qtMajorVersion = makefile->GetSafeDefinition("QT_VERSION_MAJOR");
@@ -169,7 +170,8 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
++fileIt)
{
cmSourceFile* sf = *fileIt;
- std::string absFile = sf->GetFullPath();
+ std::string absFile = cmsys::SystemTools::GetRealPath(
+ sf->GetFullPath().c_str());
bool skip = cmSystemTools::IsOn(sf->GetPropertyForUser("SKIP_AUTOMOC"));
bool generated = cmSystemTools::IsOn(sf->GetPropertyForUser("GENERATED"));
@@ -193,12 +195,28 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
}
}
- const char* tmp = makefile->GetProperty("INCLUDE_DIRECTORIES");
- std::string _moc_incs = (tmp!=0 ? tmp : "");
- tmp = makefile->GetProperty("DEFINITIONS");
- std::string _moc_defs = (tmp!=0 ? tmp : "");
- tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
+ std::vector<std::string> includeDirs;
+ cmGeneratorTarget gtgt(target);
+ localGen->GetIncludeDirectories(includeDirs, &gtgt, "CXX");
+ std::string _moc_incs = "";
+ const char* sep = "";
+ for(std::vector<std::string>::const_iterator incDirIt = includeDirs.begin();
+ incDirIt != includeDirs.end();
+ ++incDirIt)
+ {
+ _moc_incs += sep;
+ sep = ";";
+ _moc_incs += *incDirIt;
+ }
+
+ const char* tmp = target->GetProperty("COMPILE_DEFINITIONS");
std::string _moc_compile_defs = (tmp!=0 ? tmp : "");
+ tmp = makefile->GetProperty("COMPILE_DEFINITIONS");
+ if (tmp)
+ {
+ _moc_compile_defs += ";";
+ _moc_compile_defs += tmp;
+ }
tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS");
std::string _moc_options = (tmp!=0 ? tmp : "");
@@ -210,8 +228,6 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target)
cmLocalGenerator::EscapeForCMake(automocTargetName.c_str()).c_str());
makefile->AddDefinition("_moc_incs",
cmLocalGenerator::EscapeForCMake(_moc_incs.c_str()).c_str());
- makefile->AddDefinition("_moc_defs",
- cmLocalGenerator::EscapeForCMake(_moc_defs.c_str()).c_str());
makefile->AddDefinition("_moc_compile_defs",
cmLocalGenerator::EscapeForCMake(_moc_compile_defs.c_str()).c_str());
makefile->AddDefinition("_moc_options",
@@ -314,7 +330,6 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
this->MocExecutable = makefile->GetSafeDefinition("AM_QT_MOC_EXECUTABLE");
this->MocCompileDefinitionsStr = makefile->GetSafeDefinition(
"AM_MOC_COMPILE_DEFINITIONS");
- this->MocDefinitionsStr = makefile->GetSafeDefinition("AM_MOC_DEFINITIONS");
this->MocIncludesStr = makefile->GetSafeDefinition("AM_MOC_INCLUDES");
this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS");
this->ProjectBinaryDir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR");
@@ -332,7 +347,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile,
std::string cmQtAutomoc::MakeCompileSettingsString(cmMakefile* makefile)
{
std::string s;
- s += makefile->GetSafeDefinition("AM_MOC_DEFINITIONS");
+ s += makefile->GetSafeDefinition("AM_MOC_COMPILE_DEFINITIONS");
s += " ~~~ ";
s += makefile->GetSafeDefinition("AM_MOC_INCLUDES");
s += " ~~~ ";
@@ -387,32 +402,11 @@ void cmQtAutomoc::Init()
std::vector<std::string> cdefList;
cmSystemTools::ExpandListArgument(this->MocCompileDefinitionsStr, cdefList);
- if (!cdefList.empty())
- {
- for(std::vector<std::string>::const_iterator it = cdefList.begin();
- it != cdefList.end();
- ++it)
- {
- this->MocDefinitions.push_back("-D" + (*it));
- }
- }
- else
+ for(std::vector<std::string>::const_iterator it = cdefList.begin();
+ it != cdefList.end();
+ ++it)
{
- std::string tmpMocDefs = this->MocDefinitionsStr;
- cmSystemTools::ReplaceString(tmpMocDefs, " ", ";");
-
- std::vector<std::string> defList;
- cmSystemTools::ExpandListArgument(tmpMocDefs, defList);
-
- for(std::vector<std::string>::const_iterator it = defList.begin();
- it != defList.end();
- ++it)
- {
- if (this->StartsWith(*it, "-D"))
- {
- this->MocDefinitions.push_back(*it);
- }
- }
+ this->MocDefinitions.push_back("-D" + (*it));
}
cmSystemTools::ExpandListArgument(this->MocOptionsStr, this->MocOptions);
diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h
index f6d72e2..a737477 100644
--- a/Source/cmQtAutomoc.h
+++ b/Source/cmQtAutomoc.h
@@ -69,7 +69,6 @@ private:
std::string Builddir;
std::string MocExecutable;
std::string MocCompileDefinitionsStr;
- std::string MocDefinitionsStr;
std::string MocIncludesStr;
std::string MocOptionsStr;
std::string ProjectBinaryDir;
diff --git a/Source/cmStringCommand.h b/Source/cmStringCommand.h
index 43a0dbe..728b1bc 100644
--- a/Source/cmStringCommand.h
+++ b/Source/cmStringCommand.h
@@ -133,7 +133,8 @@ public:
" . Matches any single character\n"
" [ ] Matches any character(s) inside the brackets\n"
" [^ ] Matches any character(s) not inside the brackets\n"
- " - Matches any character in range on either side of a dash\n"
+ " - Inside brackets, specifies an inclusive range between\n"
+ " characters on either side e.g. [a-f] is [abcdef]\n"
" * Matches preceding pattern zero or more times\n"
" + Matches preceding pattern one or more times\n"
" ? Matches preceding pattern zero or once only\n"
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 9a3812c..f3eb52b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -15,8 +15,8 @@
#include "cmSourceFile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
-#include "cmComputeLinkInformation.h"
#include "cmDocumentCompileDefinitions.h"
+#include "cmDocumentGeneratorExpressions.h"
#include "cmDocumentLocationUndefined.h"
#include "cmListFileCache.h"
#include "cmGeneratorExpression.h"
@@ -57,6 +57,7 @@ struct cmTarget::OutputInfo
{
std::string OutDir;
std::string ImpDir;
+ std::string PdbDir;
};
//----------------------------------------------------------------------------
@@ -205,6 +206,9 @@ void cmTarget::DefineProperties(cmake *cm)
"are not supported by the native build tool. "
"The VS6 IDE does not support definition values with spaces "
"(but NMake does).\n"
+ "Contents of COMPILE_DEFINITIONS may use \"generator expressions\" with "
+ "the syntax \"$<...>\". "
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS
CM_DOCUMENT_COMPILE_DEFINITIONS_DISCLAIMER);
cm->DefineProperty
@@ -498,8 +502,11 @@ void cmTarget::DefineProperties(cmake *cm)
"to the include_directories command."
"\n"
"The target property values are used by the generators to set "
- "the include paths for the compiler. "
- "See also the include_directories command.");
+ "the include paths for the compiler. "
+ "See also the include_directories command.\n"
+ "Contents of INCLUDE_DIRECTORIES may use \"generator expressions\" with "
+ "the syntax \"$<...>\". "
+ CM_DOCUMENT_COMMAND_GENERATOR_EXPRESSIONS);
cm->DefineProperty
("INSTALL_NAME_DIR", cmProperty::TARGET,
@@ -741,6 +748,22 @@ void cmTarget::DefineProperties(cmake *cm)
"Use OUTPUT_NAME_<CONFIG> instead.");
cm->DefineProperty
+ ("PDB_NAME", cmProperty::TARGET,
+ "Output name for MS debug symbols .pdb file.",
+ "Set the base name for debug symbols file created for an "
+ "executable or library target. "
+ "If not set, the logical target name is used by default. "
+ "\n"
+ "This property is not implemented by the Visual Studio 6 generator.");
+
+ cm->DefineProperty
+ ("PDB_NAME_<CONFIG>", cmProperty::TARGET,
+ "Per-configuration name for MS debug symbols .pdb file. ",
+ "This is the configuration-specific version of PDB_NAME. "
+ "\n"
+ "This property is not implemented by the Visual Studio 6 generator.");
+
+ cm->DefineProperty
("PRE_INSTALL_SCRIPT", cmProperty::TARGET,
"Deprecated install support.",
"The PRE_INSTALL_SCRIPT and POST_INSTALL_SCRIPT properties are the "
@@ -1190,6 +1213,27 @@ void cmTarget::DefineProperties(cmake *cm)
CM_TARGET_OUTDIR_CONFIG_DOC(RUNTIME));
cm->DefineProperty
+ ("PDB_OUTPUT_DIRECTORY", cmProperty::TARGET,
+ "Output directory for MS debug symbols .pdb files.",
+ "This property specifies the directory into which the MS debug symbols "
+ "will be placed. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_PDB_OUTPUT_DIRECTORY if it is set when a target is created."
+ "\n"
+ "This property is not implemented by the Visual Studio 6 generator.");
+ cm->DefineProperty
+ ("PDB_OUTPUT_DIRECTORY_<CONFIG>", cmProperty::TARGET,
+ "Per-configuration output directory for MS debug symbols .pdb files.",
+ "This is a per-configuration version of PDB_OUTPUT_DIRECTORY, "
+ "but multi-configuration generators (VS, Xcode) do NOT append "
+ "a per-configuration subdirectory to the specified directory. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_PDB_OUTPUT_DIRECTORY_<CONFIG> "
+ "if it is set when a target is created."
+ "\n"
+ "This property is not implemented by the Visual Studio 6 generator.");
+
+ cm->DefineProperty
("ARCHIVE_OUTPUT_NAME", cmProperty::TARGET,
"Output name for ARCHIVE target files.",
"This property specifies the base name for archive target files. "
@@ -1263,6 +1307,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
this->SetPropertyDefault("ARCHIVE_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("LIBRARY_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("RUNTIME_OUTPUT_DIRECTORY", 0);
+ this->SetPropertyDefault("PDB_OUTPUT_DIRECTORY", 0);
this->SetPropertyDefault("Fortran_FORMAT", 0);
this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0);
this->SetPropertyDefault("GNUtoMS", 0);
@@ -1282,6 +1327,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
"ARCHIVE_OUTPUT_DIRECTORY_",
"LIBRARY_OUTPUT_DIRECTORY_",
"RUNTIME_OUTPUT_DIRECTORY_",
+ "PDB_OUTPUT_DIRECTORY_",
0};
for(std::vector<std::string>::iterator ci = configNames.begin();
ci != configNames.end(); ++ci)
@@ -2014,9 +2060,8 @@ bool cmTarget::NameResolvesToFramework(const std::string& libname)
}
//----------------------------------------------------------------------------
-bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType llt)
+bool cmTarget::AddFramework(const std::string& libname, LinkLibraryType)
{
- (void)llt; // TODO: What is this?
if(this->NameResolvesToFramework(libname.c_str()))
{
std::string frameworkDir = libname;
@@ -2296,7 +2341,7 @@ void cmTarget::Emit(const LibraryID lib,
// be preserved.
// This variable will keep track of the libraries that were
- // emitted directory from the current node, and not from a
+ // emitted directly from the current node, and not from a
// recursive call. This way, if we come across a library that
// has already been emitted, we repeat it iff it has been
// emitted here.
@@ -2414,7 +2459,7 @@ void cmTarget::AppendProperty(const char* prop, const char* value,
//----------------------------------------------------------------------------
void cmTarget::MaybeInvalidatePropertyCache(const char* prop)
{
- // Wipe wipe out maps caching information affected by this property.
+ // Wipe out maps caching information affected by this property.
if(this->IsImported() && strncmp(prop, "IMPORTED", 8) == 0)
{
this->Internal->ImportInfoMap.clear();
@@ -2539,6 +2584,10 @@ cmTarget::OutputInfo const* cmTarget::GetOutputInfo(const char* config)
OutputInfo info;
this->ComputeOutputDir(config, false, info.OutDir);
this->ComputeOutputDir(config, true, info.ImpDir);
+ if(!this->ComputePDBOutputDir(config, info.PdbDir))
+ {
+ info.PdbDir = info.OutDir;
+ }
OutputInfoMapType::value_type entry(config_upper, info);
i = this->Internal->OutputInfoMap.insert(entry).first;
}
@@ -2564,6 +2613,17 @@ std::string cmTarget::GetDirectory(const char* config, bool implib)
}
//----------------------------------------------------------------------------
+std::string cmTarget::GetPDBDirectory(const char* config)
+{
+ if(OutputInfo const* info = this->GetOutputInfo(config))
+ {
+ // Return the directory in which the target will be built.
+ return info->PdbDir;
+ }
+ return "";
+}
+
+//----------------------------------------------------------------------------
const char* cmTarget::GetLocation(const char* config)
{
if (this->IsImported())
@@ -2954,25 +3014,6 @@ void cmTarget::ComputeLinkClosure(const char* config, LinkClosure& lc)
}
//----------------------------------------------------------------------------
-const char* cmTarget::GetCreateRuleVariable()
-{
- switch(this->GetType())
- {
- case cmTarget::STATIC_LIBRARY:
- return "_CREATE_STATIC_LIBRARY";
- case cmTarget::SHARED_LIBRARY:
- return "_CREATE_SHARED_LIBRARY";
- case cmTarget::MODULE_LIBRARY:
- return "_CREATE_SHARED_MODULE";
- case cmTarget::EXECUTABLE:
- return "_LINK_EXECUTABLE";
- default:
- break;
- }
- return "";
-}
-
-//----------------------------------------------------------------------------
const char* cmTarget::GetSuffixVariableInternal(bool implib)
{
switch(this->GetType())
@@ -3028,6 +3069,28 @@ std::string cmTarget::GetPDBName(const char* config)
std::string base;
std::string suffix;
this->GetFullNameInternal(config, false, prefix, base, suffix);
+
+ std::vector<std::string> props;
+ std::string configUpper =
+ cmSystemTools::UpperCase(config? config : "");
+ if(!configUpper.empty())
+ {
+ // PDB_NAME_<CONFIG>
+ props.push_back("PDB_NAME_" + configUpper);
+ }
+
+ // PDB_NAME
+ props.push_back("PDB_NAME");
+
+ for(std::vector<std::string>::const_iterator i = props.begin();
+ i != props.end(); ++i)
+ {
+ if(const char* outName = this->GetProperty(i->c_str()))
+ {
+ base = outName;
+ break;
+ }
+ }
return prefix+base+".pdb";
}
@@ -3412,7 +3475,7 @@ void cmTarget::GetLibraryNames(std::string& name,
}
// The program database file name.
- pdbName = prefix+base+".pdb";
+ pdbName = this->GetPDBName(config);
}
//----------------------------------------------------------------------------
@@ -3491,7 +3554,7 @@ void cmTarget::GetExecutableNames(std::string& name,
impName = this->GetFullNameInternal(config, true);
// The program database file name.
- pdbName = prefix+base+".pdb";
+ pdbName = this->GetPDBName(config);
}
//----------------------------------------------------------------------------
@@ -3570,7 +3633,7 @@ void cmTarget::GenerateTargetManifest(const char* config)
}
if(!pdbName.empty())
{
- f = dir;
+ f = this->GetPDBDirectory(config);
f += "/";
f += pdbName;
gg->AddToManifest(config? config:"", f);
@@ -3880,6 +3943,65 @@ bool cmTarget::ComputeOutputDir(const char* config,
}
//----------------------------------------------------------------------------
+bool cmTarget::ComputePDBOutputDir(const char* config, std::string& out)
+{
+ // Look for a target property defining the target output directory
+ // based on the target type.
+ std::string targetTypeName = "PDB";
+ const char* propertyName = 0;
+ std::string propertyNameStr = targetTypeName;
+ if(!propertyNameStr.empty())
+ {
+ propertyNameStr += "_OUTPUT_DIRECTORY";
+ propertyName = propertyNameStr.c_str();
+ }
+
+ // Check for a per-configuration output directory target property.
+ std::string configUpper = cmSystemTools::UpperCase(config? config : "");
+ const char* configProp = 0;
+ std::string configPropStr = targetTypeName;
+ if(!configPropStr.empty())
+ {
+ configPropStr += "_OUTPUT_DIRECTORY_";
+ configPropStr += configUpper;
+ configProp = configPropStr.c_str();
+ }
+
+ // Select an output directory.
+ if(const char* config_outdir = this->GetProperty(configProp))
+ {
+ // Use the user-specified per-configuration output directory.
+ out = config_outdir;
+
+ // Skip per-configuration subdirectory.
+ config = 0;
+ }
+ else if(const char* outdir = this->GetProperty(propertyName))
+ {
+ // Use the user-specified output directory.
+ out = outdir;
+ }
+ if(out.empty())
+ {
+ return false;
+ }
+
+ // Convert the output path to a full path in case it is
+ // specified as a relative path. Treat a relative path as
+ // relative to the current output directory for this makefile.
+ out = (cmSystemTools::CollapseFullPath
+ (out.c_str(), this->Makefile->GetStartOutputDirectory()));
+
+ // The generator may add the configuration's subdirectory.
+ if(config && *config)
+ {
+ this->Makefile->GetLocalGenerator()->GetGlobalGenerator()->
+ AppendDirectoryForConfig("/", config, "", out);
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmTarget::UsesDefaultOutputDir(const char* config, bool implib)
{
std::string dir;
@@ -3980,27 +4102,6 @@ void cmTarget::GetLanguages(std::set<cmStdString>& languages) const
}
//----------------------------------------------------------------------------
-void cmTarget::GetAppleArchs(const char* config,
- std::vector<std::string>& archVec)
-{
- const char* archs = 0;
- if(config && *config)
- {
- std::string defVarName = "OSX_ARCHITECTURES_";
- defVarName += cmSystemTools::UpperCase(config);
- archs = this->GetProperty(defVarName.c_str());
- }
- if(!archs)
- {
- archs = this->GetProperty("OSX_ARCHITECTURES");
- }
- if(archs)
- {
- cmSystemTools::ExpandListArgument(std::string(archs), archVec);
- }
-}
-
-//----------------------------------------------------------------------------
bool cmTarget::IsChrpathUsed(const char* config)
{
#if defined(CMAKE_USE_ELF_PARSER)
@@ -4671,56 +4772,6 @@ std::string cmTarget::CheckCMP0004(std::string const& item)
}
//----------------------------------------------------------------------------
-cmComputeLinkInformation*
-cmTarget::GetLinkInformation(const char* config)
-{
- // Lookup any existing information for this configuration.
- std::map<cmStdString, cmComputeLinkInformation*>::iterator
- i = this->LinkInformation.find(config?config:"");
- if(i == this->LinkInformation.end())
- {
- // Compute information for this configuration.
- cmComputeLinkInformation* info =
- new cmComputeLinkInformation(this, config);
- if(!info || !info->Compute())
- {
- delete info;
- info = 0;
- }
-
- // Store the information for this configuration.
- std::map<cmStdString, cmComputeLinkInformation*>::value_type
- entry(config?config:"", info);
- i = this->LinkInformation.insert(entry).first;
- }
- return i->second;
-}
-
-//----------------------------------------------------------------------------
-std::vector<std::string> cmTarget::GetIncludeDirectories()
-{
- std::vector<std::string> includes;
- const char *prop = this->GetProperty("INCLUDE_DIRECTORIES");
- if(prop)
- {
- cmSystemTools::ExpandListArgument(prop, includes);
- }
-
- std::set<std::string> uniqueIncludes;
- std::vector<std::string> orderedAndUniqueIncludes;
- for(std::vector<std::string>::const_iterator
- li = includes.begin(); li != includes.end(); ++li)
- {
- if(uniqueIncludes.insert(*li).second)
- {
- orderedAndUniqueIncludes.push_back(*li);
- }
- }
-
- return orderedAndUniqueIncludes;
-}
-
-//----------------------------------------------------------------------------
std::string cmTarget::GetFrameworkDirectory(const char* config)
{
std::string fpath;
@@ -4778,29 +4829,6 @@ std::string cmTarget::GetMacContentDirectory(const char* config,
}
//----------------------------------------------------------------------------
-cmTargetLinkInformationMap
-::cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r): derived()
-{
- // Ideally cmTarget instances should never be copied. However until
- // we can make a sweep to remove that, this copy constructor avoids
- // allowing the resources (LinkInformation) from getting copied. In
- // the worst case this will lead to extra cmComputeLinkInformation
- // instances. We also enforce in debug mode that the map be emptied
- // when copied.
- static_cast<void>(r);
- assert(r.empty());
-}
-
-//----------------------------------------------------------------------------
-cmTargetLinkInformationMap::~cmTargetLinkInformationMap()
-{
- for(derived::iterator i = this->begin(); i != this->end(); ++i)
- {
- delete i->second;
- }
-}
-
-//----------------------------------------------------------------------------
cmTargetInternalPointer::cmTargetInternalPointer()
{
this->Pointer = new cmTargetInternals;
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index 98eaeec..e442d25 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -22,18 +22,8 @@ class cmake;
class cmMakefile;
class cmSourceFile;
class cmGlobalGenerator;
-class cmComputeLinkInformation;
class cmListFileBacktrace;
-struct cmTargetLinkInformationMap:
- public std::map<cmStdString, cmComputeLinkInformation*>
-{
- typedef std::map<cmStdString, cmComputeLinkInformation*> derived;
- cmTargetLinkInformationMap() {}
- cmTargetLinkInformationMap(cmTargetLinkInformationMap const& r);
- ~cmTargetLinkInformationMap();
-};
-
class cmTargetInternals;
class cmTargetInternalPointer
{
@@ -301,6 +291,12 @@ public:
output directory is given. */
std::string GetDirectory(const char* config = 0, bool implib = false);
+ /** Get the directory in which this targets .pdb files will be placed.
+ If the configuration name is given then the generator will add its
+ subdirectory for that configuration. Otherwise just the canonical
+ pdb output directory is given. */
+ std::string GetPDBDirectory(const char* config = 0);
+
/** Get the location of the target in the build tree for the given
configuration. This location is suitable for use as the LOCATION
target property. */
@@ -330,10 +326,6 @@ public:
///! Return the preferred linker language for this target
const char* GetLinkerLanguage(const char* config = 0);
- ///! Return the rule variable used to create this type of target,
- // need to add CMAKE_(LANG) for full name.
- const char* GetCreateRuleVariable();
-
/** Get the full name of the target according to the settings in its
makefile. */
std::string GetFullName(const char* config=0, bool implib = false);
@@ -400,8 +392,6 @@ public:
std::string GetInstallNameDirForInstallTree(const char* config,
bool for_xcode = false);
- cmComputeLinkInformation* GetLinkInformation(const char* config);
-
// Get the properties
cmPropertyMap &GetProperties() { return this->Properties; };
@@ -419,9 +409,6 @@ public:
// until we have per-target object file properties.
void GetLanguages(std::set<cmStdString>& languages) const;
- /** Get the list of OS X target architectures to be built. */
- void GetAppleArchs(const char* config, std::vector<std::string>& archVec);
-
/** Return whether this target is an executable with symbol exports
enabled. */
bool IsExecutableWithExports();
@@ -459,9 +446,6 @@ public:
directory. */
bool UsesDefaultOutputDir(const char* config, bool implib);
- /** Get the include directories for this target. */
- std::vector<std::string> GetIncludeDirectories();
-
/** Append to @a base the mac content directory and return it. */
std::string BuildMacContentDirectory(const std::string& base,
const char* config = 0,
@@ -593,14 +577,13 @@ private:
struct OutputInfo;
OutputInfo const* GetOutputInfo(const char* config);
bool ComputeOutputDir(const char* config, bool implib, std::string& out);
+ bool ComputePDBOutputDir(const char* config, std::string& out);
// Cache import information from properties for each configuration.
struct ImportInfo;
ImportInfo const* GetImportInfo(const char* config);
void ComputeImportInfo(std::string const& desired_config, ImportInfo& info);
- cmTargetLinkInformationMap LinkInformation;
-
bool ComputeLinkInterface(const char* config, LinkInterface& iface);
void ComputeLinkImplementation(const char* config,
diff --git a/Source/cmTargetExport.h b/Source/cmTargetExport.h
new file mode 100644
index 0000000..c9d87fb
--- /dev/null
+++ b/Source/cmTargetExport.h
@@ -0,0 +1,39 @@
+/*============================================================================
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
+
+ Distributed under the OSI-approved BSD License (the "License");
+ see accompanying file Copyright.txt for details.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+============================================================================*/
+#ifndef cmTargetExport_h
+#define cmTargetExport_h
+
+class cmTarget;
+class cmInstallTargetGenerator;
+class cmInstallFilesGenerator;
+
+/** \brief A member of an ExportSet
+ *
+ * This struct holds pointers to target and all relevant generators.
+ */
+class cmTargetExport
+{
+public:
+ cmTarget* Target; ///< The target
+
+ ///@name Generators
+ ///@{
+ cmInstallTargetGenerator* ArchiveGenerator;
+ cmInstallTargetGenerator* RuntimeGenerator;
+ cmInstallTargetGenerator* LibraryGenerator;
+ cmInstallTargetGenerator* FrameworkGenerator;
+ cmInstallTargetGenerator* BundleGenerator;
+ cmInstallFilesGenerator* HeaderGenerator;
+ ///@}
+};
+
+#endif
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx
index dbea1c3..f42b0f6 100644
--- a/Source/cmTargetLinkLibrariesCommand.cxx
+++ b/Source/cmTargetLinkLibrariesCommand.cxx
@@ -108,8 +108,8 @@ bool cmTargetLinkLibrariesCommand
// specification if the keyword is encountered as the first argument.
this->CurrentProcessingState = ProcessingLinkLibraries;
- // add libraries, nothe that there is an optional prefix
- // of debug and optimized than can be used
+ // add libraries, note that there is an optional prefix
+ // of debug and optimized that can be used
for(unsigned int i=1; i < args.size(); ++i)
{
if(args[i] == "LINK_INTERFACE_LIBRARIES")
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 3d2828d..1e37ca5 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1225,21 +1225,16 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
flags += " ";
flags += targetFlags;
}
- std::string configUpper = cmSystemTools::UpperCase(configName);
- std::string defPropName = "COMPILE_DEFINITIONS_";
- defPropName += configUpper;
-
// Get preprocessor definitions for this directory.
std::string defineFlags = this->Target->GetMakefile()->GetDefineFlags();
clOptions.FixExceptionHandlingDefault();
clOptions.AddFlag("PrecompiledHeader", "NotUsing");
clOptions.Parse(flags.c_str());
clOptions.Parse(defineFlags.c_str());
- clOptions.AddDefines
- (this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
- clOptions.AddDefines(this->Target->GetProperty("COMPILE_DEFINITIONS"));
- clOptions.AddDefines(this->Makefile->GetProperty(defPropName.c_str()));
- clOptions.AddDefines(this->Target->GetProperty(defPropName.c_str()));
+ clOptions.AddDefines(
+ this->GeneratorTarget->GetCompileDefinitions().c_str());
+ clOptions.AddDefines(this->GeneratorTarget->GetCompileDefinitions(
+ configName.c_str()).c_str());
clOptions.SetVerboseMakefile(
this->Makefile->IsOn("CMAKE_VERBOSE_MAKEFILE"));
@@ -1284,9 +1279,8 @@ void cmVisualStudio10TargetGenerator::WriteClOptions(
this->WriteString("<ObjectFileName>$(IntDir)</ObjectFileName>\n", 3);
if(this->Target->GetType() != cmTarget::OBJECT_LIBRARY)
{
- // TODO: PDB for object library?
this->WriteString("<ProgramDataBaseFileName>", 3);
- *this->BuildFileStream << this->Target->GetDirectory(configName.c_str())
+ *this->BuildFileStream << this->Target->GetPDBDirectory(configName.c_str())
<< "/"
<< this->Target->GetPDBName(configName.c_str())
<< "</ProgramDataBaseFileName>\n";
@@ -1452,7 +1446,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
// Replace spaces in libs with ;
cmSystemTools::ReplaceString(libs, " ", ";");
cmComputeLinkInformation* pcli =
- this->Target->GetLinkInformation(config.c_str());
+ this->GeneratorTarget->GetLinkInformation(config.c_str());
if(!pcli)
{
cmSystemTools::Error
@@ -1511,9 +1505,8 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
config.c_str());
}
- std::string dir = this->Target->GetDirectory(config.c_str());
- dir += "/";
- std::string pdb = dir;
+ std::string pdb = this->Target->GetPDBDirectory(config.c_str());
+ pdb += "/";
pdb += targetNamePDB;
std::string imLib = this->Target->GetDirectory(config.c_str(), true);
imLib += "/";
@@ -1593,11 +1586,13 @@ void cmVisualStudio10TargetGenerator::WriteItemDefinitionGroups()
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
- std::vector<std::string> includes;
- this->LocalGenerator->GetIncludeDirectories(includes, this->Target);
for(std::vector<std::string>::iterator i = configs->begin();
i != configs->end(); ++i)
{
+ std::vector<std::string> includes;
+ this->LocalGenerator->GetIncludeDirectories(includes,
+ this->GeneratorTarget,
+ "C", i->c_str());
this->WritePlatformConfigTag("ItemDefinitionGroup", i->c_str(), 1);
*this->BuildFileStream << "\n";
// output cl compile flags <ClCompile></ClCompile>
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 1750daa..0123427 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -628,9 +628,14 @@ bool cmake::FindPackage(const std::vector<std::string>& args)
std::string linkLibs;
+ std::string frameworkPath;
+ std::string linkPath;
std::string flags;
std::string linkFlags;
- lg->GetTargetFlags(linkLibs, flags, linkFlags, *tgt);
+ cmGeneratorTarget gtgt(tgt);
+ lg->GetTargetFlags(linkLibs, frameworkPath, linkPath, flags, linkFlags,
+ &gtgt);
+ linkLibs = frameworkPath + linkPath + linkLibs;
printf("%s\n", linkLibs.c_str() );
@@ -1682,19 +1687,11 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
}
else if (args[1] == "vs_link_exe")
{
- return cmake::VisualStudioLink(args, 1, false);
+ return cmake::VisualStudioLink(args, 1);
}
else if (args[1] == "vs_link_dll")
{
- return cmake::VisualStudioLink(args, 2, false);
- }
- else if (args[1] == "vs_link_exe_no_rsp_expand")
- {
- return cmake::VisualStudioLink(args, 1, true);
- }
- else if (args[1] == "vs_link_dll_no_rsp_expand")
- {
- return cmake::VisualStudioLink(args, 2, true);
+ return cmake::VisualStudioLink(args, 2);
}
#ifdef CMAKE_BUILD_WITH_CMAKE
// Internal CMake color makefile support.
@@ -4020,8 +4017,7 @@ static bool cmakeCheckStampList(const char* stampList)
// For visual studio 2005 and newer manifest files need to be embeded into
// exe and dll's. This code does that in such a way that incremental linking
// still works.
-int cmake::VisualStudioLink(std::vector<std::string>& args, int type,
- bool no_rsp_expand)
+int cmake::VisualStudioLink(std::vector<std::string>& args, int type)
{
if(args.size() < 2)
{
@@ -4036,12 +4032,13 @@ int cmake::VisualStudioLink(std::vector<std::string>& args, int type,
for(std::vector<std::string>::iterator i = args.begin();
i != args.end(); ++i)
{
- // check for nmake temporary files (there are two rsp files)
- if(!no_rsp_expand && (*i)[0] == '@' && i->find("@CMakeFiles") != 0 )
+ // check for nmake temporary files
+ if((*i)[0] == '@' && i->find("@CMakeFiles") != 0 )
{
std::ifstream fin(i->substr(1).c_str());
std::string line;
- while(cmSystemTools::GetLineFromStream(fin, line))
+ while(cmSystemTools::GetLineFromStream(fin,
+ line))
{
cmSystemTools::ParseWindowsCommandLine(line.c_str(), expandedArgs);
}
diff --git a/Source/cmake.h b/Source/cmake.h
index 12e5edf..94c6f12 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -447,8 +447,7 @@ protected:
std::string const& link);
static int ExecuteEchoColor(std::vector<std::string>& args);
static int ExecuteLinkScript(std::vector<std::string>& args);
- static int VisualStudioLink(std::vector<std::string>& args, int type,
- bool no_rsp_expand);
+ static int VisualStudioLink(std::vector<std::string>& args, int type);
static int VisualStudioLinkIncremental(std::vector<std::string>& args,
int type,
bool verbose);
diff --git a/Templates/DLLHeader.dsptemplate b/Templates/DLLHeader.dsptemplate
index c752fdb..d9bccaf 100644
--- a/Templates/DLLHeader.dsptemplate
+++ b/Templates/DLLHeader.dsptemplate
@@ -59,13 +59,13 @@ RSC=rc.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELEASE
BSC32=bscmake.exe
@@ -93,13 +93,13 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "_DEBUG"
+# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_DEBUG
BSC32=bscmake.exe
@@ -129,13 +129,13 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG
# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c OUTPUT_LIBNAME_EXPORTS
# SUBTRACT BASE CPP /YX
# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
BSC32=bscmake.exe
@@ -163,13 +163,13 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" OUTPUT_LIBNAME_EXPORTS /FD /c
# ADD CPP /nologo /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
BSC32=bscmake.exe
diff --git a/Templates/EXEHeader.dsptemplate b/Templates/EXEHeader.dsptemplate
index f48eacc..3a6d2fe 100644
--- a/Templates/EXEHeader.dsptemplate
+++ b/Templates/EXEHeader.dsptemplate
@@ -58,11 +58,11 @@ RSC=rc.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELEASE
BSC32=bscmake.exe
@@ -90,13 +90,13 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE
# PROP Target_Dir ""
# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "_DEBUG"
+# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_DEBUG
BSC32=bscmake.exe
@@ -122,12 +122,12 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG
# PROP Intermediate_Dir "MinSizeRel"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP /nologo /D "WIN32" BUILD_INCLUDES EXTRA_DEFINES /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP /nologo /D "WIN32" BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES /D "NDEBUG" /D "_CONSOLE" /FD /c
+# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
BSC32=bscmake.exe
@@ -155,11 +155,11 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
BSC32=bscmake.exe
diff --git a/Templates/EXEWinHeader.dsptemplate b/Templates/EXEWinHeader.dsptemplate
index e0d2264..350e3ea 100644
--- a/Templates/EXEWinHeader.dsptemplate
+++ b/Templates/EXEWinHeader.dsptemplate
@@ -58,13 +58,13 @@ RSC=rc.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELEASE
BSC32=bscmake.exe
@@ -92,13 +92,13 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE
# PROP Target_Dir ""
# ADD BASE CPP /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "_DEBUG"
+# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_DEBUG
BSC32=bscmake.exe
@@ -125,11 +125,11 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
BSC32=bscmake.exe
@@ -157,13 +157,13 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
# ADD CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
+# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES OUTPUT_LIBNAME_EXPORTS
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
BSC32=bscmake.exe
diff --git a/Templates/staticLibHeader.dsptemplate b/Templates/staticLibHeader.dsptemplate
index 16b784e..a8892e1 100644
--- a/Templates/staticLibHeader.dsptemplate
+++ b/Templates/staticLibHeader.dsptemplate
@@ -55,11 +55,11 @@ RSC=rc.exe
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES
+# ADD CPP BUILD_INCLUDES_RELEASE EXTRA_DEFINES
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELEASE
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELEASE /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELEASE
BSC32=bscmake.exe
@@ -85,11 +85,11 @@ CMAKE_CUSTOM_RULE_CODE_RELEASE
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "_DEBUG" /D "_LIB" /FD /c
# ADD CPP /nologo /D "_DEBUG" /D "WIN32" /D "_LIB" /FD /GZ /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES
+# ADD CPP BUILD_INCLUDES_DEBUG EXTRA_DEFINES
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_DEBUG
# ADD BASE RSC /l 0x409 /d "_DEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "_DEBUG"
+# ADD RSC BUILD_INCLUDES_DEBUG /l 0x409 /d "_DEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_DEBUG
BSC32=bscmake.exe
@@ -116,11 +116,11 @@ CMAKE_CUSTOM_RULE_CODE_DEBUG
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_ATL_DLL" /FD /c
# ADD CPP /nologo /D "NDEBUG" /D "_ATL_DLL" /D "WIN32" /D "_WINDOWS" /D "_USRDLL" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES
+# ADD CPP BUILD_INCLUDES_MINSIZEREL EXTRA_DEFINES
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_MINSIZEREL
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_MINSIZEREL /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_MINSIZEREL
BSC32=bscmake.exe
@@ -146,11 +146,11 @@ CMAKE_CUSTOM_RULE_CODE_MINSIZEREL
# PROP Target_Dir ""
# ADD BASE CPP /nologo /D "WIN32" /D "NDEBUG" /D "_LIB" /FD /c
# ADD CPP /nologo /D "NDEBUG" /D "WIN32" /D "_LIB" /FD /c
-# ADD CPP BUILD_INCLUDES EXTRA_DEFINES
+# ADD CPP BUILD_INCLUDES_RELWITHDEBINFO EXTRA_DEFINES
# ADD CPP CMAKE_CXX_FLAGS
# ADD CPP CMAKE_CXX_FLAGS_RELWITHDEBINFO
# ADD BASE RSC /l 0x409 /d "NDEBUG"
-# ADD RSC BUILD_INCLUDES /l 0x409 /d "NDEBUG"
+# ADD RSC BUILD_INCLUDES_RELWITHDEBINFO /l 0x409 /d "NDEBUG"
# ADD RSC COMPILE_DEFINITIONS
# ADD RSC COMPILE_DEFINITIONS_RELWITHDEBINFO
BSC32=bscmake.exe
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e03b926..bbf804b 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -57,6 +57,8 @@ if(BUILD_TESTING)
add_subdirectory(FindPackageModeMakefileTest)
+ add_subdirectory(CTestTestMemcheck)
+
# Collect a list of all test build directories.
set(TEST_BUILD_DIRS)
@@ -554,6 +556,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--build-generator ${CMAKE_TEST_GENERATOR}
--build-project GeneratorExpression
--build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE}
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression")
@@ -1254,6 +1257,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
if(CMAKE_TEST_MSVC)
ADD_TEST_MACRO(ForceInclude foo)
+ ADD_TEST_MACRO(PDBDirectoryAndName myexe)
ADD_TEST_MACRO(PrecompiledHeader foo)
endif()
if(CMAKE_TEST_MSVC OR
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt
index ba681d8..51a630f 100644
--- a/Tests/CMakeOnly/CMakeLists.txt
+++ b/Tests/CMakeOnly/CMakeLists.txt
@@ -27,6 +27,8 @@ endif()
add_CMakeOnly_test(AllFindModules)
+add_CMakeOnly_test(SelectLibraryConfigurations)
+
add_CMakeOnly_test(TargetScope)
add_CMakeOnly_test(find_library)
diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
new file mode 100644
index 0000000..5bf0f8a
--- /dev/null
+++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt
@@ -0,0 +1,64 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(SelectLibraryConfigurations NONE)
+
+include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
+
+macro(check_slc basename expect)
+ message(STATUS "checking select_library_configurations(${basename})")
+ select_library_configurations(${basename})
+ if (NOT ${basename}_LIBRARY STREQUAL "${expect}")
+ message(SEND_ERROR "select_library_configurations(${basename}) returned '${${basename}_LIBRARY}' but '${expect}' was expected")
+ endif ()
+ if (NOT ${basename}_LIBRARY STREQUAL "${${basename}_LIBRARIES}")
+ message(SEND_ERROR "select_library_configurations(${basename}) LIBRARY: '${${basename}_LIBRARY}' LIBRARIES: '${${basename}_LIBRARIES}'")
+ endif ()
+endmacro(check_slc)
+
+if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
+ set(NOTYPE_RELONLY_LIBRARY_RELEASE "opt")
+ check_slc(NOTYPE_RELONLY "opt")
+
+ set(NOTYPE_DBGONLY_LIBRARY_DEBUG "dbg")
+ check_slc(NOTYPE_DBGONLY "dbg")
+
+ set(NOTYPE_RELDBG_LIBRARY_RELEASE "opt")
+ set(NOTYPE_RELDBG_LIBRARY_DEBUG "dbg")
+ check_slc(NOTYPE_RELDBG "opt")
+
+ set(CMAKE_BUILD_TYPE Debug)
+endif ()
+
+check_slc(empty "")
+
+set(OPTONLY_LIBRARY_RELEASE "opt")
+check_slc(OPTONLY "opt")
+
+set(DBGONLY_LIBRARY_RELEASE "dbg")
+check_slc(DBGONLY "dbg")
+
+set(SAME_LIBRARY_RELEASE "same")
+set(SAME_LIBRARY_DEBUG "same")
+check_slc(SAME "same")
+
+set(OPTONLYLIST_LIBRARY_RELEASE "opt1;opt2")
+check_slc(OPTONLYLIST "opt1;opt2")
+
+set(DBGONLYLIST_LIBRARY_RELEASE "dbg1;dbg2")
+check_slc(DBGONLYLIST "dbg1;dbg2")
+
+set(OPT1DBG1_LIBRARY_RELEASE "opt")
+set(OPT1DBG1_LIBRARY_DEBUG "dbg")
+check_slc(OPT1DBG1 "optimized;opt;debug;dbg")
+
+set(OPT1DBG2_LIBRARY_RELEASE "opt")
+set(OPT1DBG2_LIBRARY_DEBUG "dbg1;dbg2")
+check_slc(OPT1DBG2 "optimized;opt;debug;dbg1;debug;dbg2")
+
+set(OPT2DBG1_LIBRARY_RELEASE "opt1;opt2")
+set(OPT2DBG1_LIBRARY_DEBUG "dbg")
+check_slc(OPT2DBG1 "optimized;opt1;optimized;opt2;debug;dbg")
+
+set(OPT2DBG2_LIBRARY_RELEASE "opt1;opt2")
+set(OPT2DBG2_LIBRARY_DEBUG "dbg1;dbg2")
+check_slc(OPT2DBG2 "optimized;opt1;optimized;opt2;debug;dbg1;debug;dbg2")
diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in
index 3f0ab50..91086c6 100644
--- a/Tests/CMakeTests/FileDownloadTest.cmake.in
+++ b/Tests/CMakeTests/FileDownloadTest.cmake.in
@@ -38,7 +38,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA1 50c614fc28b39c1281d0517bb6d5858b4359c9b7
+ EXPECTED_HASH SHA1=50c614fc28b39c1281d0517bb6d5858b4359c9b7
)
message(STATUS "FileDownload:5")
@@ -47,7 +47,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA224 73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68
+ EXPECTED_HASH SHA224=73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68
)
message(STATUS "FileDownload:6")
@@ -56,7 +56,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA256 2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9
+ EXPECTED_HASH SHA256=2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9
)
message(STATUS "FileDownload:7")
@@ -65,7 +65,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA384 398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35
+ EXPECTED_HASH SHA384=398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35
)
message(STATUS "FileDownload:8")
@@ -74,7 +74,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH SHA512 c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48
+ EXPECTED_HASH SHA512=c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48
)
message(STATUS "FileDownload:9")
file(DOWNLOAD
@@ -82,7 +82,7 @@ file(DOWNLOAD
${dir}/file3.png
TIMEOUT 2
STATUS status
- EXPECTED_HASH MD5 d16778650db435bda3a8c3435c3ff5d1
+ EXPECTED_HASH MD5=d16778650db435bda3a8c3435c3ff5d1
)
message(STATUS "FileDownload:10")
diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt
new file mode 100644
index 0000000..2730a61
--- /dev/null
+++ b/Tests/CTestTestMemcheck/CMakeLists.txt
@@ -0,0 +1,81 @@
+foreach (_retval 0 1)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.c" "int main(){return ${_retval};}\n")
+endforeach ()
+
+# create binaries that we will use as a pseudo memory checker
+add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")
+set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind)
+
+# Xcode 2.x forgets to create the output directory before linking
+# the individual architectures.
+if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]")
+ add_custom_command(TARGET pseudo_valgrind
+ PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}"
+ )
+endif()
+
+add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")
+set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify)
+add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.c")
+set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC)
+
+# binary to be used as pre- and post-memcheck command that fails
+add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.c")
+
+foreach (_test IN ITEMS Unknown UnknownQuoted NotExist
+ DummyValgrind DummyValgrindPrePost
+ DummyValgrindFailPre DummyValgrindFailPost
+ DummyPurify DummyBC
+ DummyValgrindIgnoreMemcheck)
+ configure_file(
+ "${CMAKE_CURRENT_SOURCE_DIR}/${_test}/test.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake"
+ @ONLY ESCAPE_QUOTES)
+ add_test(NAME CTestTestMemcheck${_test}
+ COMMAND ${CMAKE_CTEST_COMMAND}
+ -S "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" -V
+ --output-log "${CMAKE_CURRENT_BINARY_DIR}/${_test}/testOutput.log"
+ -D PSEUDO_BC=$<TARGET_FILE:pseudo_BC>
+ -D PSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify>
+ -D PSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind>
+ -D ERROR_COMMAND=$<TARGET_FILE:memcheck_fail>
+ )
+endforeach ()
+
+string(REPLACE "\\" "\\\\" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND}")
+string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}")
+string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}")
+string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}")
+
+foreach (_unkn Unknown UnknownQuoted)
+ set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES
+ PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n")
+endforeach ()
+
+set_tests_properties(CTestTestMemcheckNotExist PROPERTIES
+ PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.")
+
+set(NORMAL_CTEST_OUTPUT "\n-- Processing memory checking output: \nMemory checking results:\n(BullseyeCoverage[^\n]*\n)?")
+
+# It is a valid result if valgrind does not output any files (can e.g. happen
+# if you have not compiled in debug mode), so these tests will not fail.
+set_tests_properties(CTestTestMemcheckDummyValgrind CTestTestMemcheckDummyValgrindPrePost
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "${NORMAL_CTEST_OUTPUT}")
+
+foreach (_pp Pre Post)
+ string(TOLOWER ${_pp} _pp_lower)
+ set_tests_properties(CTestTestMemcheckDummyValgrindFail${_pp}
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "\nProblem running command: ${CMAKE_CURRENT_BINARY_DIR}[^\n]*fail[^\n]*\n(.*\n)?Problem executing ${_pp_lower}-memcheck command\\(s\\\).\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindFail${_pp}/test.cmake\n")
+endforeach ()
+
+set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck
+ PROPERTIES
+ PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*\n1/1 MemCheck #1: RunCMake .*${NORMAL_CTEST_OUTPUT}")
+
+set_tests_properties(CTestTestMemcheckDummyPurify PROPERTIES
+ PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n")
+
+set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES
+ PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n")
diff --git a/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt
new file mode 100644
index 0000000..aa0e495
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyBC)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake
new file mode 100644
index 0000000..39cdd88
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyBC")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyBC/test.cmake.in b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in
new file mode 100644
index 0000000..5005498
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyBC")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyBC")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyBC")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_BC}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt
new file mode 100644
index 0000000..dfd93fd
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyPurify)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake
new file mode 100644
index 0000000..40b9608
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyPurify")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in
new file mode 100644
index 0000000..0df4f68
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyPurify")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyPurify")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyPurify")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_PURIFY}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt
new file mode 100644
index 0000000..822966a
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrind)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake
new file mode 100644
index 0000000..4ca59a4
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in
new file mode 100644
index 0000000..e341fed
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrind")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrind")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrind")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt
new file mode 100644
index 0000000..8185071
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindFailPost)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake
new file mode 100644
index 0000000..4ca59a4
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in
new file mode 100644
index 0000000..7c1aa66
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPost")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPost")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPost")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+set(CTEST_CUSTOM_POST_MEMCHECK "${ERROR_COMMAND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt
new file mode 100644
index 0000000..3714cd6
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindFailPre)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake
new file mode 100644
index 0000000..4ca59a4
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in
new file mode 100644
index 0000000..b2d7bb1
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in
@@ -0,0 +1,26 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPre")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPre")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPre")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+set(CTEST_CUSTOM_PRE_MEMCHECK "${ERROR_COMMAND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt
new file mode 100644
index 0000000..5d437d1
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt
@@ -0,0 +1,6 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindIgnoreMemcheck)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
+add_test (RunCMakeAgain "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake
new file mode 100644
index 0000000..6eee3e6
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake
@@ -0,0 +1,9 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindIgnoreMemcheck")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
+
+set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in
new file mode 100644
index 0000000..031a232
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in
@@ -0,0 +1,24 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindIgnoreMemcheck")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindIgnoreMemcheck")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindIgnoreMemcheck")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt
new file mode 100644
index 0000000..bc15632
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckDummyValgrindPrePost)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake
new file mode 100644
index 0000000..6e4c2e8
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindPrePost")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in
new file mode 100644
index 0000000..44c416e
--- /dev/null
+++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in
@@ -0,0 +1,27 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindPrePost")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindPrePost")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindPrePost")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+
+set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}")
+
+set(CTEST_CUSTOM_PRE_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}")
+set(CTEST_CUSTOM_POST_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}")
+
+#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY})
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt
new file mode 100644
index 0000000..4d905de
--- /dev/null
+++ b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckNotExist)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake
new file mode 100644
index 0000000..3ed84aa
--- /dev/null
+++ b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/NotExist/test.cmake.in b/Tests/CTestTestMemcheck/NotExist/test.cmake.in
new file mode 100644
index 0000000..78db7e2
--- /dev/null
+++ b/Tests/CTestTestMemcheck/NotExist/test.cmake.in
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckNotExist")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/NotExist")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/NotExist")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_MEMORYCHECK_COMMAND "${CTEST_BINARY_DIRECTORY}/no-memcheck-exe")
+
+CTEST_START(Experimental)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt
new file mode 100644
index 0000000..3fd3103
--- /dev/null
+++ b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckUnknown)
+include(CTest)
+
+add_test (RunCMake "${CMAKE_COMMAND}")
diff --git a/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake
new file mode 100644
index 0000000..3ed84aa
--- /dev/null
+++ b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/Unknown/test.cmake.in b/Tests/CTestTestMemcheck/Unknown/test.cmake.in
new file mode 100644
index 0000000..c0b7839
--- /dev/null
+++ b/Tests/CTestTestMemcheck/Unknown/test.cmake.in
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknown")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/Unknown")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/Unknown")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@")
+
+CTEST_START(Experimental)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt
new file mode 100644
index 0000000..6f49c61
--- /dev/null
+++ b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 2.8.9)
+project(CTestTestMemcheckUnknownQuoted)
+include(CTest)
+
+add_test (RunCMake "\"${CMAKE_COMMAND}\"")
diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake
new file mode 100644
index 0000000..f0233a7
--- /dev/null
+++ b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknownQuoted")
+set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set (CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in
new file mode 100644
index 0000000..e2bfb60
--- /dev/null
+++ b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in
@@ -0,0 +1,18 @@
+cmake_minimum_required(VERSION 2.8.9)
+
+# Settings:
+set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@")
+set(CTEST_SITE "@SITE@")
+set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknownQuoted")
+
+set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/UnknownQuoted")
+set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/UnknownQuoted")
+set(CTEST_CVS_COMMAND "@CVSCOMMAND@")
+set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@")
+set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}")
+set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@")
+set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@")
+
+CTEST_START(Experimental)
+CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp
index 6db6f3f..f18e59e 100644
--- a/Tests/CompileDefinitions/compiletest.cpp
+++ b/Tests/CompileDefinitions/compiletest.cpp
@@ -27,6 +27,24 @@ enum {
#endif
};
+#ifdef TEST_GENERATOR_EXPRESSIONS
+#ifndef CMAKE_IS_DECLARATIVE
+#error Expect declarative definition
+#endif
+#ifdef GE_NOT_DEFINED
+#error Expect not defined generator expression
+#endif
+
+#ifndef ARGUMENT
+#error Expected define expanded from list
+#endif
+#ifndef LIST
+#error Expected define expanded from list
+#endif
+
+// TEST_GENERATOR_EXPRESSIONS
+#endif
+
int main(int argc, char **argv)
{
return 0;
diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
index e2b6ba9..abdf257 100644
--- a/Tests/CompileDefinitions/target_prop/CMakeLists.txt
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -7,3 +7,10 @@ set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAK
set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun" CMAKE_IS=Fun)
set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_FUN CMAKE_IS_="Fun")
+
+set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS
+ TEST_GENERATOR_EXPRESSIONS
+ "$<1:CMAKE_IS_DECLARATIVE>"
+ "$<0:GE_NOT_DEFINED>"
+ "$<1:ARGUMENT;LIST>"
+)
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt
index f118c30..e19ab88 100644
--- a/Tests/ExportImport/Export/CMakeLists.txt
+++ b/Tests/ExportImport/Export/CMakeLists.txt
@@ -87,6 +87,18 @@ target_link_libraries(testLibCycleA testLibCycleB)
target_link_libraries(testLibCycleB testLibCycleA)
set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3)
+# Test exporting dependent libraries into different exports
+add_library(testLibRequired testLibRequired.c)
+add_library(testLibDepends testLibDepends.c)
+target_link_libraries(testLibDepends testLibRequired)
+
+install(TARGETS testLibRequired EXPORT RequiredExp DESTINATION lib )
+install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredConfig.cmake DESTINATION lib/cmake/testLibRequired)
+
+install(TARGETS testLibDepends EXPORT DependsExp DESTINATION lib )
+install(EXPORT DependsExp FILE testLibDependsConfig.cmake DESTINATION lib/cmake/testLibDepends)
+
+
# Install and export from install tree.
install(
TARGETS
diff --git a/Tests/ExportImport/Export/testLibDepends.c b/Tests/ExportImport/Export/testLibDepends.c
new file mode 100644
index 0000000..2849b33
--- /dev/null
+++ b/Tests/ExportImport/Export/testLibDepends.c
@@ -0,0 +1,4 @@
+
+extern int testLibRequired(void);
+
+int testLibDepends(void) { return testLibRequired(); }
diff --git a/Tests/ExportImport/Export/testLibRequired.c b/Tests/ExportImport/Export/testLibRequired.c
new file mode 100644
index 0000000..e126d44
--- /dev/null
+++ b/Tests/ExportImport/Export/testLibRequired.c
@@ -0,0 +1 @@
+int testLibRequired(void) { return 0; }
diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt
index 650af6a..8841792 100644
--- a/Tests/ExportImport/Import/A/CMakeLists.txt
+++ b/Tests/ExportImport/Import/A/CMakeLists.txt
@@ -4,6 +4,10 @@ include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake)
# Import targets from the exported install tree.
include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake)
+# Import two exports, where the Depends one depends on an exported target from the Required one:
+include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibRequired/testLibRequiredConfig.cmake)
+include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibDepends/testLibDependsConfig.cmake)
+
# Try referencing an executable imported from the install tree.
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/exp_generated.c
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
index 2b135dc..bb31476 100644
--- a/Tests/GeneratorExpression/CMakeLists.txt
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -4,7 +4,9 @@ project(GeneratorExpression NONE)
add_custom_target(check ALL
COMMAND ${CMAKE_COMMAND}
-Dtest_0=$<0:nothing>
+ -Dtest_0_with_comma=$<0:-Wl,--no-undefined>
-Dtest_1=$<1:content>
+ -Dtest_1_with_comma=$<1:-Wl,--no-undefined>
-Dconfig=$<CONFIGURATION>
-Dtest_and_0=$<AND:0>
-Dtest_and_0_0=$<AND:0,0>
@@ -14,6 +16,10 @@ add_custom_target(check ALL
-Dtest_and_1_1=$<AND:1,1>
-Dtest_config_0=$<CONFIG:$<CONFIGURATION>x>
-Dtest_config_1=$<CONFIG:$<CONFIGURATION>>
+ -Dtest_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG>
+ -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE>
+ -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo>
+ -Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel>
-Dtest_not_0=$<NOT:0>
-Dtest_not_1=$<NOT:1>
-Dtest_or_0=$<OR:0>
@@ -22,6 +28,52 @@ add_custom_target(check ALL
-Dtest_or_1=$<OR:1>
-Dtest_or_1_0=$<OR:1,0>
-Dtest_or_1_1=$<OR:1,1>
+ -Dtest_bool_notfound=$<BOOL:NOTFOUND>
+ -Dtest_bool_foo_notfound=$<BOOL:Foo-NOTFOUND>
+ -Dtest_bool_true=$<BOOL:True>
+ -Dtest_bool_false=$<BOOL:False>
+ -Dtest_bool_on=$<BOOL:On>
+ -Dtest_bool_off=$<BOOL:Off>
+ -Dtest_bool_no=$<BOOL:No>
+ -Dtest_bool_n=$<BOOL:N>
+ -Dtest_bool_empty=$<BOOL:>
+ -Dtest_strequal_yes_yes=$<STREQUAL:Yes,Yes>
+ -Dtest_strequal_yes_yes_cs=$<STREQUAL:Yes,yes>
+ -Dtest_strequal_yes_no=$<STREQUAL:Yes,No>
+ -Dtest_strequal_no_yes=$<STREQUAL:No,Yes>
+ -Dtest_strequal_angle_r=$<STREQUAL:$<ANGLE-R>,$<ANGLE-R>>
+ -Dtest_strequal_comma=$<STREQUAL:$<COMMA>,$<COMMA>>
+ -Dtest_strequal_angle_r_comma=$<STREQUAL:$<ANGLE-R>,$<COMMA>>
+ -Dtest_strequal_both_empty=$<STREQUAL:,>
+ -Dtest_strequal_one_empty=$<STREQUAL:something,>
+ -Dtest_angle_r=$<ANGLE-R>
+ -Dtest_comma=$<COMMA>
+ -Dtest_colons_1=$<1::>
+ -Dtest_colons_2=$<1:::>
+ -Dtest_colons_3=$<1:Qt5::Core>
+ -Dtest_colons_4=$<1:C:\\CMake>
+ -Dtest_colons_5=$<1:C:/CMake>
+ -Dtest_incomplete_1=$<
+ -Dtest_incomplete_2=$<something
+ -Dtest_incomplete_3=$<something:
+ -Dtest_incomplete_4=$<something:,
+ -Dtest_incomplete_5=$something:,>
+ -Dtest_incomplete_6=<something:,>
+ -Dtest_incomplete_7=$<something::
+ -Dtest_incomplete_8=$<something:,
+ -Dtest_incomplete_9=$<something:,,
+ -Dtest_incomplete_10=$<something:,:
+ -Dtest_incomplete_11=$<something,,
+ -Dtest_incomplete_12=$<,,
+ -Dtest_incomplete_13=$<some$<1:special>thing
+ -Dtest_incomplete_14=$<$<ANGLE-R>
+ -Dtest_incomplete_15=$<some$<thing
+ -Dtest_incomplete_16=$<BOOL:something
+ -Dtest_incomplete_17=$<1:some$thing>
+ -Dtest_incomplete_18=$<1:some,thing
+ -Dtest_incomplete_19=$<1:some,thing$<ANGLE-R>
+ -Dtest_incomplete_20=$<CONFIGURATION$<ANGLE-R>
+ -Dtest_incomplete_21=$<BOOL:something$<ANGLE-R>
-P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake
COMMAND ${CMAKE_COMMAND} -E echo "check done"
VERBATIM
diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake
index e243d85..8745d57 100644
--- a/Tests/GeneratorExpression/check.cmake
+++ b/Tests/GeneratorExpression/check.cmake
@@ -6,7 +6,9 @@ endmacro()
message(STATUS "config=[${config}]")
check(test_0 "")
+check(test_0_with_comma "")
check(test_1 "content")
+check(test_1_with_comma "-Wl,--no-undefined")
check(test_and_0 "0")
check(test_and_0_0 "0")
check(test_and_0_1 "0")
@@ -15,6 +17,11 @@ check(test_and_1_0 "0")
check(test_and_1_1 "1")
check(test_config_0 "0")
check(test_config_1 "1")
+foreach(c debug release relwithdebinfo minsizerel)
+ if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$")
+ message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1")
+ endif()
+endforeach()
check(test_not_0 "1")
check(test_not_1 "0")
check(test_or_0 "0")
@@ -23,3 +30,49 @@ check(test_or_0_1 "1")
check(test_or_1 "1")
check(test_or_1_0 "1")
check(test_or_1_1 "1")
+check(test_bool_notfound "0")
+check(test_bool_foo_notfound "0")
+check(test_bool_true "1")
+check(test_bool_false "0")
+check(test_bool_on "1")
+check(test_bool_off "0")
+check(test_bool_no "0")
+check(test_bool_n "0")
+check(test_bool_empty "0")
+check(test_strequal_yes_yes "1")
+check(test_strequal_yes_yes_cs "0")
+check(test_strequal_yes_no "0")
+check(test_strequal_no_yes "0")
+check(test_strequal_angle_r "1")
+check(test_strequal_comma "1")
+check(test_strequal_angle_r_comma "0")
+check(test_strequal_both_empty "1")
+check(test_strequal_one_empty "0")
+check(test_angle_r ">")
+check(test_comma ",")
+check(test_colons_1 ":")
+check(test_colons_2 "::")
+check(test_colons_3 "Qt5::Core")
+check(test_colons_4 "C:\\\\CMake")
+check(test_colons_5 "C:/CMake")
+check(test_incomplete_1 "$<")
+check(test_incomplete_2 "$<something")
+check(test_incomplete_3 "$<something:")
+check(test_incomplete_4 "$<something:,")
+check(test_incomplete_5 "$something:,>")
+check(test_incomplete_6 "<something:,>")
+check(test_incomplete_7 "$<something::")
+check(test_incomplete_8 "$<something:,")
+check(test_incomplete_9 "$<something:,,")
+check(test_incomplete_10 "$<something:,:")
+check(test_incomplete_11 "$<something,,")
+check(test_incomplete_12 "$<,,")
+check(test_incomplete_13 "$<somespecialthing")
+check(test_incomplete_14 "$<>")
+check(test_incomplete_15 "$<some$<thing")
+check(test_incomplete_16 "$<BOOL:something")
+check(test_incomplete_17 "some$thing")
+check(test_incomplete_18 "$<1:some,thing")
+check(test_incomplete_19 "$<1:some,thing>")
+check(test_incomplete_20 "$<CONFIGURATION>")
+check(test_incomplete_21 "$<BOOL:something>")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
index 334b8be..7cb1b42 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -12,13 +12,36 @@ create_header(bar)
create_header(bat)
create_header(foo)
create_header(baz)
+create_header(bang)
+create_header(bing)
+create_header(bung)
+create_header(arguments)
+create_header(list)
+create_header(target)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar")
+include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bang>")
add_executable(TargetIncludeDirectories main.cpp)
+
set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
+set_property(TARGET TargetIncludeDirectories APPEND PROPERTY
+ INCLUDE_DIRECTORIES "$<1:${CMAKE_CURRENT_BINARY_DIR}/bing>")
include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz")
+include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bung>")
+include_directories("sing$<1:/ting>")
+
+include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/arguments;${CMAKE_CURRENT_BINARY_DIR}/list>")
+
+add_library(somelib::withcolons UNKNOWN IMPORTED)
+set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target")
+set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target")
+
+set_property(TARGET TargetIncludeDirectories
+ APPEND PROPERTY INCLUDE_DIRECTORIES
+ "$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>"
+)
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
index 8aa3532..90909d3 100644
--- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
@@ -3,6 +3,13 @@
#include "bat.h"
#include "foo.h"
#include "baz.h"
+#include "bang.h"
+#include "bing.h"
+#include "bung.h"
+#include "ting.h"
+#include "arguments.h"
+#include "list.h"
+#include "target.h"
int main(int, char**)
{
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h b/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h
new file mode 100644
index 0000000..4fe01dd
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h
@@ -0,0 +1 @@
+//ting.h
diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt
new file mode 100644
index 0000000..bc2f013
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/CMakeLists.txt
@@ -0,0 +1,79 @@
+cmake_minimum_required(VERSION 2.8)
+project(PDBDirectoryAndName C)
+
+# Make sure the proper compiler is in use.
+if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
+ message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel")
+endif()
+
+set(my_targets "")
+
+add_library(mylibA SHARED mylibA.c)
+set_target_properties(mylibA PROPERTIES
+ PDB_NAME "mylibA_Special"
+ PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibA_PDB"
+)
+list(APPEND my_targets mylibA)
+
+add_library(mylibB STATIC mylibB.c)
+set_target_properties(mylibB PROPERTIES
+ PDB_NAME "mylibB_Special"
+ PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB"
+)
+list(APPEND my_targets mylibB)
+
+add_library(mylibC SHARED mylibC.c)
+set_target_properties(mylibC PROPERTIES
+ PDB_NAME "mylibC_Special"
+)
+list(APPEND my_targets mylibC)
+
+add_library(mylibD STATIC mylibD.c)
+set_target_properties(mylibD PROPERTIES
+ PDB_NAME "mylibD_Special"
+)
+list(APPEND my_targets mylibD)
+
+add_executable(myexe myexe.c)
+set_target_properties(myexe PROPERTIES
+ PDB_NAME "myexe_Special"
+ PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/myexe_PDB"
+)
+list(APPEND my_targets myexe)
+
+target_link_libraries(myexe mylibA mylibB mylibC mylibD)
+
+add_executable(myexe2 myexe2.c)
+set_target_properties(myexe2 PROPERTIES
+ PDB_NAME "myexe2_Special"
+)
+list(APPEND my_targets myexe2)
+
+target_link_libraries(myexe2 mylibA mylibD)
+
+#-----------------------------------------------------------------------------
+# Check that PDB files actually appear where expected.
+
+# The PDB_NAME and PDB_OUTPUT_DIRECTORY options do not work in VS 6.
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
+ return()
+endif()
+# PDB output not fully implemented for Intel
+if("${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
+ return()
+endif()
+
+set(pdbs "")
+foreach(t ${my_targets})
+ get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME)
+ get_property(pdb_dir TARGET ${t} PROPERTY PDB_OUTPUT_DIRECTORY)
+ if(NOT pdb_dir)
+ set(pdb_dir ${CMAKE_CURRENT_BINARY_DIR})
+ endif()
+ list(APPEND pdbs ${pdb_dir}/${CMAKE_CFG_INTDIR}/${pdb_name}.pdb)
+endforeach()
+add_custom_target(check_pdbs ALL VERBATIM
+ COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIGURATION> "-Dpdbs=${pdbs}"
+ -P ${CMAKE_CURRENT_SOURCE_DIR}/check_pdbs.cmake
+ )
+add_dependencies(check_pdbs ${my_targets})
diff --git a/Tests/PDBDirectoryAndName/check_pdbs.cmake b/Tests/PDBDirectoryAndName/check_pdbs.cmake
new file mode 100644
index 0000000..89cdb3c
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/check_pdbs.cmake
@@ -0,0 +1,10 @@
+if(NOT "${config}" MATCHES "[Dd][Ee][Bb]")
+ return()
+endif()
+foreach(pdb ${pdbs})
+ if(EXISTS "${pdb}")
+ message(STATUS "PDB Exists: ${pdb}")
+ else()
+ message(SEND_ERROR "PDB MISSING: ${pdb}")
+ endif()
+endforeach()
diff --git a/Tests/PDBDirectoryAndName/myexe.c b/Tests/PDBDirectoryAndName/myexe.c
new file mode 100644
index 0000000..c6d9065
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/myexe.c
@@ -0,0 +1,5 @@
+extern int mylibA();
+extern int mylibB();
+extern int mylibC();
+extern int mylibD();
+int main() { return mylibA() + mylibB() + mylibC() + mylibD(); }
diff --git a/Tests/PDBDirectoryAndName/myexe2.c b/Tests/PDBDirectoryAndName/myexe2.c
new file mode 100644
index 0000000..75b39cd
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/myexe2.c
@@ -0,0 +1,3 @@
+extern int mylibA();
+extern int mylibD();
+int main() { return mylibA() + mylibD(); }
diff --git a/Tests/PDBDirectoryAndName/mylibA.c b/Tests/PDBDirectoryAndName/mylibA.c
new file mode 100644
index 0000000..f4c553f
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/mylibA.c
@@ -0,0 +1 @@
+__declspec(dllexport) int mylibA() { return 1; }
diff --git a/Tests/PDBDirectoryAndName/mylibB.c b/Tests/PDBDirectoryAndName/mylibB.c
new file mode 100644
index 0000000..2040c67
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/mylibB.c
@@ -0,0 +1 @@
+int mylibB() { return -1; }
diff --git a/Tests/PDBDirectoryAndName/mylibC.c b/Tests/PDBDirectoryAndName/mylibC.c
new file mode 100644
index 0000000..adf7c70
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/mylibC.c
@@ -0,0 +1 @@
+__declspec(dllexport) int mylibC() { return 1; }
diff --git a/Tests/PDBDirectoryAndName/mylibD.c b/Tests/PDBDirectoryAndName/mylibD.c
new file mode 100644
index 0000000..efa8a82
--- /dev/null
+++ b/Tests/PDBDirectoryAndName/mylibD.c
@@ -0,0 +1 @@
+int mylibD() { return -1; }
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 3ea54f1..8c67625 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -46,12 +46,14 @@ macro(add_RunCMake_test test)
endmacro()
add_RunCMake_test(GeneratorExpression)
+add_RunCMake_test(TargetPropertyGeneratorExpressions)
add_RunCMake_test(Languages)
add_RunCMake_test(ObjectLibrary)
add_RunCMake_test(build_command)
add_RunCMake_test(find_package)
add_RunCMake_test(include)
+add_RunCMake_test(include_directories)
add_RunCMake_test(list)
if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]")
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
index 32169c5..e5e628c 100644
--- a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
@@ -20,7 +20,7 @@ CMake Error at BadNOT.cmake:1 \(add_custom_target\):
\$<NOT:,>
- \$<NOT> parameter must resolve to exactly one '0' or '1' value.
+ \$<NOT> expression requires exactly one parameter.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt
new file mode 100644
index 0000000..dd0d931
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt
@@ -0,0 +1,38 @@
+CMake Error at BadStrEqual.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<STREQUAL>
+
+ \$<STREQUAL> expression requires 2 comma separated parameters, but got 0
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++CMake Error at BadStrEqual.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<STREQUAL:>
+
+ \$<STREQUAL> expression requires 2 comma separated parameters, but got 1
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadStrEqual.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<STREQUAL:,,>
+
+ \$<STREQUAL> expression requires 2 comma separated parameters, but got 3
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadStrEqual.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<STREQUAL:something,,>
+
+ \$<STREQUAL> expression requires 2 comma separated parameters, but got 3
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake b/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake
new file mode 100644
index 0000000..56eb458
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake
@@ -0,0 +1,6 @@
+add_custom_target(check ALL COMMAND check
+ $<STREQUAL>
+ $<STREQUAL:>
+ $<STREQUAL:,,>
+ $<STREQUAL:something,,>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index ed18f25..18a47ae 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -4,3 +4,4 @@ run_cmake(BadCONFIG)
run_cmake(BadOR)
run_cmake(BadAND)
run_cmake(BadNOT)
+run_cmake(BadStrEqual)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt
new file mode 100644
index 0000000..3287d19
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES>
+
+ Target name not supported.
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake
new file mode 100644
index 0000000..d5f661d
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt
new file mode 100644
index 0000000..e527e22
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty>
+
+ Target name and property name not supported.$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake
new file mode 100644
index 0000000..6e4c1d0
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt
new file mode 100644
index 0000000..517debb
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:Invali/dProperty>
+
+ Property name not supported.$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake
new file mode 100644
index 0000000..3f75aa3
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:Invali/dProperty>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt
new file mode 100644
index 0000000..eab6fb6
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:foo,Invali/dProperty>
+
+ Property name not supported.$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake
new file mode 100644
index 0000000..b616c31
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake
@@ -0,0 +1,9 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(foo "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:foo,Invali/dProperty>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt
new file mode 100644
index 0000000..e2b4fc6
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:,>
+
+ \$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name and
+ property name.
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake
new file mode 100644
index 0000000..11cb6fa
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:,>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt
new file mode 100644
index 0000000..e94f52f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:,ValidProperty>
+
+ \$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name.
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake
new file mode 100644
index 0000000..bf868a5
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:,ValidProperty>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt
new file mode 100644
index 0000000..2548215
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:foo,>
+
+ \$<TARGET_PROPERTY:...> expression requires a non-empty property name.
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake
new file mode 100644
index 0000000..36d1a79
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake
@@ -0,0 +1,9 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(foo "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:foo,>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt
new file mode 100644
index 0000000..2a98f6f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:>
+
+ \$<TARGET_PROPERTY:...> expression requires a non-empty property name.
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake
new file mode 100644
index 0000000..f059288
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt
new file mode 100644
index 0000000..d2ac7a9
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>
+
+ Target "NonExistant" not found.$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake
new file mode 100644
index 0000000..b020c08
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt
new file mode 100644
index 0000000..791c4a9
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>
+
+ Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake
new file mode 100644
index 0000000..a85731e
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake
@@ -0,0 +1,7 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories("$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt
new file mode 100644
index 0000000..791c4a9
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>
+
+ Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake
new file mode 100644
index 0000000..f1459b8
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake
@@ -0,0 +1,9 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY
+ INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt
new file mode 100644
index 0000000..f60d726
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>
+
+ Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake
new file mode 100644
index 0000000..433b730
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake
@@ -0,0 +1,8 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+include_directories(
+ "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>")
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt
new file mode 100644
index 0000000..f60d726
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>
+
+ Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake
new file mode 100644
index 0000000..4b64459
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake
@@ -0,0 +1,10 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY
+INCLUDE_DIRECTORIES
+ "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt
new file mode 100644
index 0000000..2b22d0f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:COMPILE_DEFINITIONS>
+
+ Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake
new file mode 100644
index 0000000..74fff67
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake
@@ -0,0 +1,10 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions
+PROPERTY
+ COMPILE_DEFINITIONS "$<TARGET_PROPERTY:COMPILE_DEFINITIONS>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt
new file mode 100644
index 0000000..fe7caa3
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS>
+
+ Self reference on target "TargetPropertyGeneratorExpressions".$
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake
new file mode 100644
index 0000000..d6650d3
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake
@@ -0,0 +1,10 @@
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp"
+ "int main(int, char **) { return 0; }\n")
+
+add_executable(TargetPropertyGeneratorExpressions
+ "${CMAKE_CURRENT_BINARY_DIR}/main.cpp")
+set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY
+COMPILE_DEFINITIONS
+ "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS>"
+)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
new file mode 100644
index 0000000..22577da
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt
@@ -0,0 +1,8 @@
+
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} CXX)
+
+# MSVC creates extra targets which pollute the stderr unless we set this.
+set(CMAKE_SUPPRESS_REGENERATION TRUE)
+
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
new file mode 100644
index 0000000..0ee3238
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake
@@ -0,0 +1,17 @@
+include(RunCMake)
+
+run_cmake(BadSelfReference1)
+run_cmake(BadSelfReference2)
+run_cmake(BadSelfReference3)
+run_cmake(BadSelfReference4)
+run_cmake(BadSelfReference5)
+run_cmake(BadSelfReference6)
+run_cmake(BadNonTarget)
+run_cmake(BadInvalidName1)
+run_cmake(BadInvalidName2)
+run_cmake(BadInvalidName3)
+run_cmake(BadInvalidName4)
+run_cmake(BadInvalidName5)
+run_cmake(BadInvalidName6)
+run_cmake(BadInvalidName7)
+run_cmake(BadInvalidName8)
diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/include_directories/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/include_directories/NotFoundContent-result.txt b/Tests/RunCMake/include_directories/NotFoundContent-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/include_directories/NotFoundContent-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt b/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt
new file mode 100644
index 0000000..f608d63
--- /dev/null
+++ b/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
+Please set them or make sure they are set and tested correctly in the CMake files:
+NotThere1
+ used as include directory in directory .*
+NotThere2
+ used as include directory in directory .*
diff --git a/Tests/RunCMake/include_directories/NotFoundContent.cmake b/Tests/RunCMake/include_directories/NotFoundContent.cmake
new file mode 100644
index 0000000..9677e0c
--- /dev/null
+++ b/Tests/RunCMake/include_directories/NotFoundContent.cmake
@@ -0,0 +1,9 @@
+
+include_directories(NotThere1-NOTFOUND)
+
+include_directories($<1:There1-NOTFOUND>)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" "int main(int,char**) { return 0; }\n")
+add_executable(dummy "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp")
+set_property(TARGET dummy APPEND PROPERTY INCLUDE_DIRECTORIES "NotThere2-NOTFOUND")
+set_property(TARGET dummy APPEND PROPERTY INCLUDE_DIRECTORIES "$<1:There2-NOTFOUND>")
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
new file mode 100644
index 0000000..aee3f79
--- /dev/null
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -0,0 +1,3 @@
+include(RunCMake)
+
+run_cmake(NotFoundContent)
diff --git a/bootstrap b/bootstrap
index ceddfdc..a4c4aa8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -199,9 +199,12 @@ CMAKE_CXX_SOURCES="\
cmMakefile \
cmExportFileGenerator \
cmExportInstallFileGenerator \
+ cmExportSet \
+ cmExportSetMap \
cmInstallDirectoryGenerator \
cmGeneratedFileStream \
cmGeneratorTarget \
+ cmGeneratorExpressionDAGChecker \
cmGeneratorExpressionEvaluator \
cmGeneratorExpressionLexer \
cmGeneratorExpressionParser \
@@ -354,7 +357,7 @@ Directory and file names:
# Display CMake bootstrap usage
cmake_version_display()
{
- echo "CMake ${cmake_version}, Copyright 2000-2011 Kitware, Inc."
+ echo "CMake ${cmake_version}, Copyright 2000-2012 Kitware, Inc."
}
# Display CMake bootstrap error, display the log file and exit