summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeCPack.cmake7
-rw-r--r--CMakeLists.txt6
-rw-r--r--Docs/bash-completion/cpack2
-rw-r--r--Modules/CMakeCCompilerId.c.in32
-rw-r--r--Modules/CMakeCXXCompilerId.cpp.in31
-rw-r--r--Modules/CMakeDetermineCCompiler.cmake4
-rw-r--r--Modules/CMakeDetermineCXXCompiler.cmake4
-rw-r--r--Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake5
-rw-r--r--Modules/CMakeFindBinUtils.cmake8
-rw-r--r--Modules/CPackRPM.cmake2
-rw-r--r--Modules/CheckTypeSize.cmake5
-rw-r--r--Modules/Compiler/Clang-ASM.cmake1
-rw-r--r--Modules/Compiler/GNU.cmake2
-rw-r--r--Modules/Compiler/Intel-ASM.cmake2
-rw-r--r--Modules/Compiler/Intel-C.cmake2
-rw-r--r--Modules/Compiler/Intel-CXX.cmake2
-rw-r--r--Modules/Compiler/SunPro-ASM.cmake2
-rw-r--r--Modules/Compiler/SunPro-C.cmake2
-rw-r--r--Modules/Compiler/SunPro-CXX.cmake2
-rw-r--r--Modules/Compiler/SunPro-Fortran.cmake2
-rw-r--r--Modules/Compiler/TinyCC-C.cmake2
-rw-r--r--Modules/Compiler/XL-ASM.cmake2
-rw-r--r--Modules/DeployQt4.cmake4
-rw-r--r--Modules/ExternalProject.cmake128
-rw-r--r--Modules/FindArmadillo.cmake5
-rw-r--r--Modules/FindBoost.cmake3
-rw-r--r--Modules/FindCUDA.cmake64
-rw-r--r--Modules/FindDart.cmake20
-rw-r--r--Modules/FindFLTK.cmake4
-rw-r--r--Modules/FindFLTK2.cmake2
-rw-r--r--Modules/FindFreetype.cmake16
-rw-r--r--Modules/FindGDAL.cmake14
-rw-r--r--Modules/FindGIF.cmake6
-rw-r--r--Modules/FindGTK.cmake6
-rw-r--r--Modules/FindGTK2.cmake29
-rw-r--r--Modules/FindGTest.cmake2
-rw-r--r--Modules/FindHSPELL.cmake3
-rw-r--r--Modules/FindHg.cmake48
-rw-r--r--Modules/FindLibLZMA.cmake3
-rw-r--r--Modules/FindLua50.cmake12
-rw-r--r--Modules/FindLua51.cmake6
-rw-r--r--Modules/FindOpenAL.cmake4
-rw-r--r--Modules/FindOpenSceneGraph.cmake10
-rw-r--r--Modules/FindOpenThreads.cmake60
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake2
-rw-r--r--Modules/FindPhysFS.cmake6
-rw-r--r--Modules/FindPostgreSQL.cmake7
-rw-r--r--Modules/FindProducer.cmake14
-rw-r--r--Modules/FindQt3.cmake118
-rw-r--r--Modules/FindQt4.cmake23
-rw-r--r--Modules/FindQuickTime.cmake30
-rw-r--r--Modules/FindRTI.cmake9
-rw-r--r--Modules/FindSDL.cmake10
-rw-r--r--Modules/FindSDL_image.cmake26
-rw-r--r--Modules/FindSDL_mixer.cmake26
-rw-r--r--Modules/FindSDL_net.cmake26
-rw-r--r--Modules/FindSDL_sound.cmake205
-rw-r--r--Modules/FindSDL_ttf.cmake26
-rw-r--r--Modules/FindSquish.cmake3
-rw-r--r--Modules/FindVTK.cmake2
-rw-r--r--Modules/FindX11.cmake5
-rw-r--r--Modules/Findosg_functions.cmake39
-rw-r--r--Modules/FindwxWidgets.cmake6
-rw-r--r--Modules/FindwxWindows.cmake31
-rw-r--r--Modules/GetPrerequisites.cmake1
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake5
-rw-r--r--Modules/KDE3Macros.cmake35
-rw-r--r--Modules/ProcessorCount.cmake7
-rw-r--r--Modules/Qt4Macros.cmake25
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackDocumentVariables.cxx7
-rw-r--r--Source/cmDepends.cxx63
-rw-r--r--Source/cmDepends.h1
-rw-r--r--Source/cmDependsJava.cxx2
-rw-r--r--Source/cmDependsJava.h3
-rw-r--r--Source/cmDocumentGeneratorExpressions.h11
-rw-r--r--Source/cmDocumentVariables.cxx24
-rw-r--r--Source/cmExtraEclipseCDT4Generator.cxx96
-rw-r--r--Source/cmExtraEclipseCDT4Generator.h5
-rw-r--r--Source/cmGeneratorExpression.cxx55
-rw-r--r--Source/cmGeneratorExpression.h1
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx4
-rw-r--r--Source/cmIfCommand.h7
-rw-r--r--Source/cmInstallCommand.h4
-rw-r--r--Source/cmListCommand.cxx18
-rw-r--r--Source/cmLocalGenerator.cxx61
-rw-r--r--Source/cmLocalGenerator.h10
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx92
-rw-r--r--Source/cmMakefileTargetGenerator.cxx34
-rw-r--r--Source/cmNinjaNormalTargetGenerator.cxx35
-rw-r--r--Source/cmNinjaTargetGenerator.cxx111
-rw-r--r--Source/cmNinjaTargetGenerator.h8
-rw-r--r--Source/cmTarget.cxx7
-rw-r--r--Source/cmTarget.h3
-rw-r--r--Source/cmVS11CLFlagTable.h291
-rw-r--r--Source/cmVS11LibFlagTable.h102
-rw-r--r--Source/cmVS11LinkFlagTable.h343
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx39
-rwxr-xr-xSource/cmparseMSBuildXML.py25
-rw-r--r--Tests/Assembler/CMakeLists.txt5
-rw-r--r--Tests/BuildDepends/CMakeLists.txt12
-rw-r--r--Tests/CMakeLists.txt61
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt2
-rw-r--r--Tests/CMakeTests/ListTest.cmake.in11
-rw-r--r--Tests/CompileDefinitions/CMakeLists.txt16
-rw-r--r--Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt7
-rw-r--r--Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt14
-rw-r--r--Tests/CompileDefinitions/compiletest.cpp33
-rw-r--r--Tests/CompileDefinitions/target_prop/CMakeLists.txt9
-rw-r--r--Tests/ExternalProject/CMakeLists.txt75
-rw-r--r--Tests/ExternalProject/hgrepo.tgzbin0 -> 2011 bytes
-rw-r--r--Tests/GeneratorExpression/CMakeLists.txt28
-rw-r--r--Tests/GeneratorExpression/check.cmake25
-rwxr-xr-xTests/KDE4StableBranchTest/test_kde4.sh.in62
-rw-r--r--Tests/Module/CheckTypeSize/CMakeLists.txt8
-rw-r--r--Tests/Module/CheckTypeSize/CheckTypeSize.c40
-rw-r--r--Tests/Module/CheckTypeSize/config.h.in12
-rw-r--r--Tests/Module/CheckTypeSize/somestruct.h10
-rw-r--r--Tests/ObjectLibrary/A/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/B/CMakeLists.txt2
-rw-r--r--Tests/Properties/CMakeLists.txt6
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadAND-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt17
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadAND.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadCONFIG-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt8
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt26
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadNOT.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadOR-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt17
-rw-r--r--Tests/RunCMake/GeneratorExpression/BadOR.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake6
-rw-r--r--Utilities/CMakeLists.txt3
137 files changed, 2338 insertions, 930 deletions
diff --git a/CMakeCPack.cmake b/CMakeCPack.cmake
index 480fc62..a27d000 100644
--- a/CMakeCPack.cmake
+++ b/CMakeCPack.cmake
@@ -99,13 +99,14 @@ if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
# Create a cygwin version number in case there are changes for cygwin
# that are not reflected upstream in CMake
- set(CPACK_CYGWIN_PATCH_NUMBER 1)
+ set(CPACK_CYGWIN_PATCH_NUMBER 1 CACHE STRING "patch number for CMake cygwin packages")
+ mark_as_advanced(CPACK_CYGWIN_PATCH_NUMBER)
# These files are required by the cmCPackCygwinSourceGenerator and the files
# put into the release tar files.
set(CPACK_CYGWIN_BUILD_SCRIPT
- "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
+ "${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.sh")
set(CPACK_CYGWIN_PATCH_FILE
- "${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
+ "${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.patch")
# include the sub directory cmake file for cygwin that
# configures some files and adds some install targets
# this file uses some of the package file name variables
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f0789a3..ea1c033 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -135,8 +135,7 @@ macro(CMAKE_SETUP_TESTING)
if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
set(CMAKE_TEST_MSVC 1)
- endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
- "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
+ endif()
endif()
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
@@ -561,8 +560,7 @@ if (UNIX)
set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
- endif(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
- OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
+ endif()
endif ()
diff --git a/Docs/bash-completion/cpack b/Docs/bash-completion/cpack
index 84dcfd5..a0c1f83 100644
--- a/Docs/bash-completion/cpack
+++ b/Docs/bash-completion/cpack
@@ -8,7 +8,7 @@ _cpack()
case "$prev" in
-G)
COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
- grep "^ .*=\ .*" 2> /dev/null | grep -v "^ -" 2>/dev/null |
+ grep "^ .*= .*" 2> /dev/null | grep -v "^ -" 2>/dev/null |
cut -d" " -f 3 )' -- "$cur" ) )
return
;;
diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in
index 06aa9bf..c5bde9a 100644
--- a/Modules/CMakeCCompilerId.c.in
+++ b/Modules/CMakeCCompilerId.c.in
@@ -67,6 +67,10 @@
#elif defined(__DECC)
# define COMPILER_ID "Compaq"
+ /* __DECC_VER = VVRRTPPPP */
+# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
+# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
+# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
#elif defined(__IBMC__)
# if defined(__COMPILER_VER__)
@@ -91,14 +95,25 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
-#elif defined(__PATHSCALE__)
+#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)
+# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP"
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
+# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
+# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
+# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__TINYC__)
# define COMPILER_ID "TinyCC"
@@ -132,9 +147,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
+/* Analog VisualDSP++ >= 4.5.6 */
+#elif defined(__VISUALDSPVERSION__)
+# define COMPILER_ID "ADSP"
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
+# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
+# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+
+/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
- SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"
/* IAR Systems compiler for embedded systems.
@@ -147,6 +169,10 @@
http://sdcc.sourceforge.net */
#elif defined(SDCC)
# define COMPILER_ID "SDCC"
+ /* SDCC = VRP */
+# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
+# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
+# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro"
diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in
index 95fc852..2c8dd4b 100644
--- a/Modules/CMakeCXXCompilerId.cpp.in
+++ b/Modules/CMakeCXXCompilerId.cpp.in
@@ -10,6 +10,9 @@
#if defined(__COMO__)
# define COMPILER_ID "Comeau"
+ /* __COMO_VERSION__ = VRR */
+# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
+# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel"
@@ -69,6 +72,10 @@
#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
+ /* __DECCXX_VER = VVRRTPPPP */
+# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
+# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
+# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__)
# if defined(__COMPILER_VER__)
@@ -93,14 +100,25 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
-#elif defined(__PATHSCALE__)
+#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)
+# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP"
+ /* __TI_COMPILER_VERSION__ = VVVRRRPPP */
+# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
+# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
+# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO"
@@ -131,9 +149,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif
+/* Analog VisualDSP++ >= 4.5.6 */
+#elif defined(__VISUALDSPVERSION__)
+# define COMPILER_ID "ADSP"
+ /* __VISUALDSPVERSION__ = 0xVVRRPP00 */
+# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
+# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
+# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
+
+/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
-/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
- SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake
index 01859b6..47d9493 100644
--- a/Modules/CMakeDetermineCCompiler.cmake
+++ b/Modules/CMakeDetermineCCompiler.cmake
@@ -159,9 +159,7 @@ if (CMAKE_CROSSCOMPILING
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
-endif (CMAKE_CROSSCOMPILING
- AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
- AND NOT _CMAKE_TOOLCHAIN_PREFIX)
+endif ()
include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
include(CMakeFindBinUtils)
diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake
index 3f97b40..f8f4a57 100644
--- a/Modules/CMakeDetermineCXXCompiler.cmake
+++ b/Modules/CMakeDetermineCXXCompiler.cmake
@@ -155,9 +155,7 @@ if (CMAKE_CROSSCOMPILING
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
-endif (CMAKE_CROSSCOMPILING
- AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
- AND NOT _CMAKE_TOOLCHAIN_PREFIX)
+endif ()
include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
include(CMakeFindBinUtils)
diff --git a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
index 54a6418..1fa0157 100644
--- a/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
+++ b/Modules/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake
@@ -42,7 +42,10 @@ macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
# split the output into lines and then remove leading and trailing spaces from each of them:
string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
foreach(nextLine ${_includeLines})
- string(STRIP "${nextLine}" _includePath)
+ # on OSX, gcc says things like this: "/System/Library/Frameworks (framework directory)", strip the last part
+ string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${nextLine}")
+ # strip spaces at the beginning and the end
+ string(STRIP "${nextLineNoFramework}" _includePath)
list(APPEND ${_resultIncludeDirs} "${_includePath}")
endforeach()
diff --git a/Modules/CMakeFindBinUtils.cmake b/Modules/CMakeFindBinUtils.cmake
index 362052f..e08c1c6 100644
--- a/Modules/CMakeFindBinUtils.cmake
+++ b/Modules/CMakeFindBinUtils.cmake
@@ -39,9 +39,7 @@ if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
mark_as_advanced(CMAKE_LINKER)
# in all other cases search for ar, ranlib, etc.
-else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+else()
find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
@@ -58,9 +56,7 @@ else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
-endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
- OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+endif()
# on Apple there really should be install_name_tool
diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake
index 066b295..b5826ef 100644
--- a/Modules/CPackRPM.cmake
+++ b/Modules/CPackRPM.cmake
@@ -259,7 +259,7 @@ if(RPMBUILD_EXECUTABLE)
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
- string(REGEX REPLACE "^.*\ " ""
+ string(REGEX REPLACE "^.* " ""
RPMBUILD_EXECUTABLE_VERSION
${_TMP_VERSION})
if(CPACK_RPM_PACKAGE_DEBUG)
diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake
index 1b9dc9f..7285b8a 100644
--- a/Modules/CheckTypeSize.cmake
+++ b/Modules/CheckTypeSize.cmake
@@ -24,6 +24,11 @@
# size check automatically includes the available headers, thus
# supporting checks of types defined in the headers.
#
+# Despite the name of the macro you may use it to check the size of
+# more complex expressions, too. To check e.g. for the size of a struct
+# member you can do something like this:
+# check_type_size("((struct something*)0)->member" SIZEOF_MEMBER)
+#
# The following variables may be set before calling this macro to
# modify the way the check is run:
#
diff --git a/Modules/Compiler/Clang-ASM.cmake b/Modules/Compiler/Clang-ASM.cmake
new file mode 100644
index 0000000..a908b60
--- /dev/null
+++ b/Modules/Compiler/Clang-ASM.cmake
@@ -0,0 +1 @@
+include(Compiler/GNU-ASM)
diff --git a/Modules/Compiler/GNU.cmake b/Modules/Compiler/GNU.cmake
index 0827e43..faad416 100644
--- a/Modules/Compiler/GNU.cmake
+++ b/Modules/Compiler/GNU.cmake
@@ -45,7 +45,7 @@ macro(__compiler_gnu lang)
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "-g")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_${lang}_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
- set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE "<CMAKE_${lang}_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
if(NOT APPLE)
diff --git a/Modules/Compiler/Intel-ASM.cmake b/Modules/Compiler/Intel-ASM.cmake
index 1f064c9..74ceb0a 100644
--- a/Modules/Compiler/Intel-ASM.cmake
+++ b/Modules/Compiler/Intel-ASM.cmake
@@ -4,7 +4,7 @@ set(CMAKE_ASM_FLAGS_INIT "")
set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
if(UNIX)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s;S)
diff --git a/Modules/Compiler/Intel-C.cmake b/Modules/Compiler/Intel-C.cmake
index bca86a0..e23317c 100644
--- a/Modules/Compiler/Intel-C.cmake
+++ b/Modules/Compiler/Intel-C.cmake
@@ -4,7 +4,7 @@ set(CMAKE_C_FLAGS_INIT "")
set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/Intel-CXX.cmake b/Modules/Compiler/Intel-CXX.cmake
index 354bb17..ae6021a 100644
--- a/Modules/Compiler/Intel-CXX.cmake
+++ b/Modules/Compiler/Intel-CXX.cmake
@@ -4,7 +4,7 @@ set(CMAKE_CXX_FLAGS_INIT "")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g -DNDEBUG")
set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
diff --git a/Modules/Compiler/SunPro-ASM.cmake b/Modules/Compiler/SunPro-ASM.cmake
index 97776da..2fa8b99 100644
--- a/Modules/Compiler/SunPro-ASM.cmake
+++ b/Modules/Compiler/SunPro-ASM.cmake
@@ -12,7 +12,7 @@ set(CMAKE_ASM_FLAGS_INIT "")
set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
set(CMAKE_ASM_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
# Initialize ASM link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-C.cmake b/Modules/Compiler/SunPro-C.cmake
index 9e36051..c5b5203 100644
--- a/Modules/Compiler/SunPro-C.cmake
+++ b/Modules/Compiler/SunPro-C.cmake
@@ -12,7 +12,7 @@ set(CMAKE_C_FLAGS_INIT "")
set(CMAKE_C_FLAGS_DEBUG_INIT "-g")
set(CMAKE_C_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
set(CMAKE_C_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-CXX.cmake b/Modules/Compiler/SunPro-CXX.cmake
index af31c7b..5968712 100644
--- a/Modules/Compiler/SunPro-CXX.cmake
+++ b/Modules/Compiler/SunPro-CXX.cmake
@@ -12,7 +12,7 @@ set(CMAKE_CXX_FLAGS_INIT "")
set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g")
set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
# Initialize C link type selection flags. These flags are used when
# building a shared library, shared module, or executable that links
diff --git a/Modules/Compiler/SunPro-Fortran.cmake b/Modules/Compiler/SunPro-Fortran.cmake
index 223a6c6..18e75b9 100644
--- a/Modules/Compiler/SunPro-Fortran.cmake
+++ b/Modules/Compiler/SunPro-Fortran.cmake
@@ -13,6 +13,6 @@ set(CMAKE_Fortran_FLAGS_INIT "")
set(CMAKE_Fortran_FLAGS_DEBUG_INIT "-g")
set(CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-xO2 -xspace -DNDEBUG")
set(CMAKE_Fortran_FLAGS_RELEASE_INIT "-xO3 -DNDEBUG")
-set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2")
+set(CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-g -xO2 -DNDEBUG")
set(CMAKE_Fortran_MODDIR_FLAG "-moddir=")
set(CMAKE_Fortran_MODPATH_FLAG "-M")
diff --git a/Modules/Compiler/TinyCC-C.cmake b/Modules/Compiler/TinyCC-C.cmake
index 178dd0c..f7937ac 100644
--- a/Modules/Compiler/TinyCC-C.cmake
+++ b/Modules/Compiler/TinyCC-C.cmake
@@ -5,4 +5,4 @@ set (CMAKE_C_FLAGS_INIT "")
set (CMAKE_C_FLAGS_DEBUG_INIT "-g")
set (CMAKE_C_FLAGS_MINSIZEREL_INIT "-DNDEBUG")
set (CMAKE_C_FLAGS_RELEASE_INIT "-DNDEBUG")
-set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
+set (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
diff --git a/Modules/Compiler/XL-ASM.cmake b/Modules/Compiler/XL-ASM.cmake
index 95af2ea..07507f9 100644
--- a/Modules/Compiler/XL-ASM.cmake
+++ b/Modules/Compiler/XL-ASM.cmake
@@ -8,6 +8,6 @@ set(CMAKE_ASM_FLAGS_INIT "-qthreaded -qalias=noansi -qhalt=e -qsourcetype=assemb
set(CMAKE_ASM_FLAGS_DEBUG_INIT "-g")
set(CMAKE_ASM_FLAGS_RELEASE_INIT "-O -DNDEBUG")
set(CMAKE_ASM_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
-set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g")
+set(CMAKE_ASM_FLAGS_RELWITHDEBINFO_INIT "-g -DNDEBUG")
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS s )
diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake
index 6190abe..309fce3 100644
--- a/Modules/DeployQt4.cmake
+++ b/Modules/DeployQt4.cmake
@@ -101,7 +101,7 @@ function(resolve_qt4_paths paths_var)
if(${executable_path})
list(APPEND paths_resolved "${executable_path}/${path}")
else()
- list(APPEND paths_resolved "\${CMAKE_INSTALL_PREFIX}/${path}")
+ list(APPEND paths_resolved "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${path}")
endif()
endif()
endforeach()
@@ -295,7 +295,7 @@ function(install_qt4_executable executable)
install(CODE
"include(\"${DeployQt4_cmake_dir}/DeployQt4.cmake\")
set(BU_CHMOD_BUNDLE_ITEMS TRUE)
- FIXUP_QT4_EXECUTABLE(\"\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
+ FIXUP_QT4_EXECUTABLE(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${executable}\" \"\" \"${libs}\" \"${dirs}\" \"${plugins_dir}\" \"${request_qt_conf}\")"
${component}
)
endfunction()
diff --git a/Modules/ExternalProject.cmake b/Modules/ExternalProject.cmake
index f0471ff..cd77ba4 100644
--- a/Modules/ExternalProject.cmake
+++ b/Modules/ExternalProject.cmake
@@ -21,6 +21,8 @@
# [SVN_TRUST_CERT 1 ] # Trust the Subversion server site certificate
# [GIT_REPOSITORY url] # URL of git repo
# [GIT_TAG tag] # Git branch name, commit id or tag
+# [HG_REPOSITORY url] # URL of mercurial repo
+# [HG_TAG tag] # Mercurial branch name, commit id or tag
# [URL /.../src.tgz] # Full path or URL of source
# [URL_MD5 md5] # MD5 checksum of file at URL
# [TIMEOUT seconds] # Time allowed for file download operations
@@ -331,6 +333,67 @@ endif()
endfunction()
+function(_ep_write_hgclone_script script_filename source_dir hg_EXECUTABLE hg_repository hg_tag src_name work_dir hgclone_infofile hgclone_stampfile)
+ file(WRITE ${script_filename}
+"if(\"${hg_tag}\" STREQUAL \"\")
+ message(FATAL_ERROR \"Tag for hg checkout should not be empty.\")
+endif()
+
+set(run 0)
+
+if(\"${hgclone_infofile}\" IS_NEWER_THAN \"${hgclone_stampfile}\")
+ set(run 1)
+endif()
+
+if(NOT run)
+ message(STATUS \"Avoiding repeated hg clone, stamp file is up to date: '${hgclone_stampfile}'\")
+ return()
+endif()
+
+execute_process(
+ COMMAND \${CMAKE_COMMAND} -E remove_directory \"${source_dir}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to remove directory: '${source_dir}'\")
+endif()
+
+execute_process(
+ COMMAND \"${hg_EXECUTABLE}\" clone \"${hg_repository}\" \"${src_name}\"
+ WORKING_DIRECTORY \"${work_dir}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to clone repository: '${hg_repository}'\")
+endif()
+
+execute_process(
+ COMMAND \"${hg_EXECUTABLE}\" update ${hg_tag}
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to checkout tag: '${hg_tag}'\")
+endif()
+
+# Complete success, update the script-last-run stamp file:
+#
+execute_process(
+ COMMAND \${CMAKE_COMMAND} -E copy
+ \"${hgclone_infofile}\"
+ \"${hgclone_stampfile}\"
+ WORKING_DIRECTORY \"${work_dir}/${src_name}\"
+ RESULT_VARIABLE error_code
+ )
+if(error_code)
+ message(FATAL_ERROR \"Failed to copy script-last-run stamp file: '${hgclone_stampfile}'\")
+endif()
+
+"
+)
+
+endfunction()
+
function(_ep_write_downloadfile_script script_filename remote local timeout md5)
if(timeout)
@@ -1027,6 +1090,7 @@ function(_ep_add_download_command name)
get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
+ get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY )
get_property(url TARGET ${name} PROPERTY _EP_URL)
# TODO: Perhaps file:// should be copied to download dir before extraction.
@@ -1148,6 +1212,46 @@ function(_ep_add_download_command name)
set(comment "Performing download step (git clone) for '${name}'")
set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-gitclone.cmake)
list(APPEND depends ${stamp_dir}/${name}-gitinfo.txt)
+ elseif(hg_repository)
+ find_package(Hg)
+ if(NOT HG_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find hg for clone of ${name}")
+ endif()
+
+ get_property(hg_tag TARGET ${name} PROPERTY _EP_HG_TAG)
+ if(NOT hg_tag)
+ set(hg_tag "tip")
+ endif()
+
+ # For the download step, and the hg clone operation, only the repository
+ # should be recorded in a configured RepositoryInfo file. If the repo
+ # changes, the clone script should be run again. But if only the tag
+ # changes, avoid running the clone script again. Let the 'always' running
+ # update step checkout the new tag.
+ #
+ set(repository ${hg_repository})
+ set(module)
+ set(tag)
+ configure_file(
+ "${CMAKE_ROOT}/Modules/RepositoryInfo.txt.in"
+ "${stamp_dir}/${name}-hginfo.txt"
+ @ONLY
+ )
+
+ get_filename_component(src_name "${source_dir}" NAME)
+ get_filename_component(work_dir "${source_dir}" PATH)
+
+ # Since hg clone doesn't succeed if the non-empty source_dir exists,
+ # create a cmake script to invoke as download command.
+ # The script will delete the source directory and then call hg clone.
+ #
+ _ep_write_hgclone_script(${tmp_dir}/${name}-hgclone.cmake ${source_dir}
+ ${HG_EXECUTABLE} ${hg_repository} ${hg_tag} ${src_name} ${work_dir}
+ ${stamp_dir}/${name}-hginfo.txt ${stamp_dir}/${name}-hgclone-lastrun.txt
+ )
+ set(comment "Performing download step (hg clone) for '${name}'")
+ set(cmd ${CMAKE_COMMAND} -P ${tmp_dir}/${name}-hgclone.cmake)
+ list(APPEND depends ${stamp_dir}/${name}-hginfo.txt)
elseif(url)
get_filename_component(work_dir "${source_dir}" PATH)
get_property(md5 TARGET ${name} PROPERTY _EP_URL_MD5)
@@ -1196,7 +1300,7 @@ function(_ep_add_download_command name)
else()
_ep_is_dir_empty("${source_dir}" empty)
if(${empty})
- message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY or DOWNLOAD_COMMAND")
+ message(SEND_ERROR "error: no download info for '${name}' -- please specify existing/non-empty SOURCE_DIR or one of URL, CVS_REPOSITORY and CVS_MODULE, SVN_REPOSITORY, GIT_REPOSITORY, HG_REPOSITORY or DOWNLOAD_COMMAND")
endif()
endif()
@@ -1226,6 +1330,7 @@ function(_ep_add_update_command name)
get_property(cvs_repository TARGET ${name} PROPERTY _EP_CVS_REPOSITORY)
get_property(svn_repository TARGET ${name} PROPERTY _EP_SVN_REPOSITORY)
get_property(git_repository TARGET ${name} PROPERTY _EP_GIT_REPOSITORY)
+ get_property(hg_repository TARGET ${name} PROPERTY _EP_HG_REPOSITORY )
set(work_dir)
set(comment)
@@ -1280,6 +1385,27 @@ function(_ep_add_update_command name)
COMMAND ${GIT_EXECUTABLE} submodule update --recursive
)
set(always 1)
+ elseif(hg_repository)
+ if(NOT HG_EXECUTABLE)
+ message(FATAL_ERROR "error: could not find hg for pull of ${name}")
+ endif()
+ set(work_dir ${source_dir})
+ set(comment "Performing update step (hg pull) for '${name}'")
+ get_property(hg_tag TARGET ${name} PROPERTY _EP_HG_TAG)
+ if(NOT hg_tag)
+ set(hg_tag "tip")
+ endif()
+ if("${HG_VERSION_STRING}" STREQUAL "2.1")
+ message(WARNING "Mercurial 2.1 does not distinguish an empty pull from a failed pull:
+ http://mercurial.selenic.com/wiki/UpgradeNotes#A2.1.1:_revert_pull_return_code_change.2C_compile_issue_on_OS_X
+ http://thread.gmane.org/gmane.comp.version-control.mercurial.devel/47656
+Update to Mercurial >= 2.1.1.
+")
+ endif()
+ set(cmd ${HG_EXECUTABLE} pull
+ COMMAND ${HG_EXECUTABLE} update ${hg_tag}
+ )
+ set(always 1)
endif()
get_property(log TARGET ${name} PROPERTY _EP_LOG_UPDATE)
diff --git a/Modules/FindArmadillo.cmake b/Modules/FindArmadillo.cmake
index aad22d2..bc0357e 100644
--- a/Modules/FindArmadillo.cmake
+++ b/Modules/FindArmadillo.cmake
@@ -58,14 +58,15 @@ if(ARMADILLO_INCLUDE_DIR)
if(EXISTS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp")
# Read and parse armdillo version header file for version number
- file(READ "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS)
+ file(STRINGS "${ARMADILLO_INCLUDE_DIR}/armadillo_bits/arma_version.hpp" _armadillo_HEADER_CONTENTS REGEX "#define ARMA_VERSION_[A-Z]+ ")
string(REGEX REPLACE ".*#define ARMA_VERSION_MAJOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MAJOR "${_armadillo_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define ARMA_VERSION_MINOR ([0-9]+).*" "\\1" ARMADILLO_VERSION_MINOR "${_armadillo_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define ARMA_VERSION_PATCH ([0-9]+).*" "\\1" ARMADILLO_VERSION_PATCH "${_armadillo_HEADER_CONTENTS}")
# WARNING: The number of spaces before the version name is not one.
- string(REGEX REPLACE ".*#define ARMA_VERSION_NAME\ +\"([0-9a-zA-Z\ _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+ string(REGEX REPLACE ".*#define ARMA_VERSION_NAME +\"([0-9a-zA-Z _-]+)\".*" "\\1" ARMADILLO_VERSION_NAME "${_armadillo_HEADER_CONTENTS}")
+ unset(_armadillo_HEADER_CONTENTS)
endif()
set(ARMADILLO_VERSION_STRING "${ARMADILLO_VERSION_MAJOR}.${ARMADILLO_VERSION_MINOR}.${ARMADILLO_VERSION_PATCH}")
diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake
index 607e249..17aba1b 100644
--- a/Modules/FindBoost.cmake
+++ b/Modules/FindBoost.cmake
@@ -729,7 +729,7 @@ set(Boost_ERROR_REASON)
#
set(BOOST_VERSION 0)
set(BOOST_LIB_VERSION "")
- file(READ "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS)
+ file(STRINGS "${Boost_INCLUDE_DIR}/boost/version.hpp" _boost_VERSION_HPP_CONTENTS REGEX "#define BOOST_(LIB_)?VERSION ")
if(Boost_DEBUG)
message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] "
"location of version.hpp: ${Boost_INCLUDE_DIR}/boost/version.hpp")
@@ -737,6 +737,7 @@ set(Boost_ERROR_REASON)
string(REGEX REPLACE ".*#define BOOST_VERSION ([0-9]+).*" "\\1" Boost_VERSION "${_boost_VERSION_HPP_CONTENTS}")
string(REGEX REPLACE ".*#define BOOST_LIB_VERSION \"([0-9_]+)\".*" "\\1" Boost_LIB_VERSION "${_boost_VERSION_HPP_CONTENTS}")
+ unset(_boost_VERSION_HPP_CONTENTS)
set(Boost_LIB_VERSION ${Boost_LIB_VERSION} CACHE INTERNAL "The library version string for boost libraries")
set(Boost_VERSION ${Boost_VERSION} CACHE INTERNAL "The version number for boost libraries")
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index f152437..0a98bf5 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -650,9 +650,11 @@ endif()
# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with
# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory
find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h
+ HINTS
"$ENV{NVSDKCOMPUTE_ROOT}/C"
- "$ENV{NVSDKCUDA_ROOT}"
+ ENV NVSDKCUDA_ROOT
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]"
+ PATHS
"/Developer/GPU\ Computing/C"
)
@@ -898,14 +900,6 @@ endfunction()
macro(CUDA_WRAP_SRCS cuda_target format generated_files)
- if( ${format} MATCHES "PTX" )
- set( compile_to_ptx ON )
- elseif( ${format} MATCHES "OBJ")
- set( compile_to_ptx OFF )
- else()
- message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.")
- endif()
-
# Set up all the command line flags here, so that they can be overridden on a per target basis.
set(nvcc_flags "")
@@ -1002,12 +996,12 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# Only add the CMAKE_{C,CXX}_FLAGS if we are propagating host flags. We
# always need to set the SHARED_FLAGS, though.
if(CUDA_PROPAGATE_HOST_FLAGS)
- set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})")
+ set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CMAKE_${CUDA_C_OR_CXX}_FLAGS} ${CUDA_HOST_SHARED_FLAGS})")
else()
- set(CUDA_HOST_FLAGS "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})")
+ set(_cuda_host_flags "set(CMAKE_HOST_FLAGS ${CUDA_HOST_SHARED_FLAGS})")
endif()
- set(CUDA_NVCC_FLAGS_CONFIG "# Build specific configuration flags")
+ set(_cuda_nvcc_flags_config "# Build specific configuration flags")
# Loop over all the configuration types to generate appropriate flags for run_nvcc.cmake
foreach(config ${CUDA_configuration_types})
string(TOUPPER ${config} config_upper)
@@ -1016,27 +1010,31 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if(CUDA_PROPAGATE_HOST_FLAGS)
# nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
- if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0")
+ set(_cuda_fix_g3 FALSE)
+
+ if(CMAKE_COMPILER_IS_GNUCC)
+ if (CUDA_VERSION VERSION_LESS "3.0" OR
+ CUDA_VERSION VERSION_EQUAL "4.1" OR
+ CUDA_VERSION VERSION_EQUAL "4.2"
+ )
+ set(_cuda_fix_g3 TRUE)
+ endif()
+ endif()
+ if(_cuda_fix_g3)
string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
else()
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
endif()
- set(CUDA_HOST_FLAGS "${CUDA_HOST_FLAGS}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
+ set(_cuda_host_flags "${_cuda_host_flags}\nset(CMAKE_HOST_FLAGS_${config_upper} ${_cuda_C_FLAGS})")
endif()
# Note that if we ever want CUDA_NVCC_FLAGS_<CONFIG> to be string (instead of a list
# like it is currently), we can remove the quotes around the
# ${CUDA_NVCC_FLAGS_${config_upper}} variable like the CMAKE_HOST_FLAGS_<CONFIG> variable.
- set(CUDA_NVCC_FLAGS_CONFIG "${CUDA_NVCC_FLAGS_CONFIG}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})")
+ set(_cuda_nvcc_flags_config "${_cuda_nvcc_flags_config}\nset(CUDA_NVCC_FLAGS_${config_upper} ${CUDA_NVCC_FLAGS_${config_upper}} ;; ${CUDA_WRAP_OPTION_NVCC_FLAGS_${config_upper}})")
endforeach()
- if(compile_to_ptx)
- # Don't use any of the host compilation flags for PTX targets.
- set(CUDA_HOST_FLAGS)
- set(CUDA_NVCC_FLAGS_CONFIG)
- endif()
-
# Get the list of definitions from the directory property
get_directory_property(CUDA_NVCC_DEFINITIONS COMPILE_DEFINITIONS)
if(CUDA_NVCC_DEFINITIONS)
@@ -1059,6 +1057,30 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
get_source_file_property(_is_header ${file} HEADER_FILE_ONLY)
if(${file} MATCHES ".*\\.cu$" AND NOT _is_header)
+ # Allow per source file overrides of the format.
+ get_source_file_property(_cuda_source_format ${file} CUDA_SOURCE_PROPERTY_FORMAT)
+ if(NOT _cuda_source_format)
+ set(_cuda_source_format ${format})
+ endif()
+
+ if( ${_cuda_source_format} MATCHES "PTX" )
+ set( compile_to_ptx ON )
+ elseif( ${_cuda_source_format} MATCHES "OBJ")
+ set( compile_to_ptx OFF )
+ else()
+ message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS for file '${file}': '${_cuda_source_format}'. Use OBJ or PTX.")
+ endif()
+
+
+ if(compile_to_ptx)
+ # Don't use any of the host compilation flags for PTX targets.
+ set(CUDA_HOST_FLAGS)
+ set(CUDA_NVCC_FLAGS_CONFIG)
+ else()
+ set(CUDA_HOST_FLAGS ${_cuda_host_flags})
+ set(CUDA_NVCC_FLAGS_CONFIG ${_cuda_nvcc_flags_config})
+ endif()
+
# Determine output directory
cuda_compute_build_path("${file}" cuda_build_path)
set(cuda_compile_intermediate_directory "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/${cuda_target}.dir/${cuda_build_path}")
diff --git a/Modules/FindDart.cmake b/Modules/FindDart.cmake
index 13e19be..a2b2926 100644
--- a/Modules/FindDart.cmake
+++ b/Modules/FindDart.cmake
@@ -17,14 +17,18 @@
# License text for the above reference.)
find_path(DART_ROOT README.INSTALL
- $ENV{DART_ROOT}
- ${PROJECT_SOURCE_DIR}/Dart
- /usr/share/Dart
- C:/Dart
- "$ENV{ProgramFiles}/Dart"
- "C:/Program Files/Dart"
- ${PROJECT_SOURCE_DIR}/../Dart
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath]
+ HINTS
+ ENV DART_ROOT
+ PATHS
+ ${PROJECT_SOURCE_DIR}
+ /usr/share
+ C:/
+ "C:/Program Files"
+ ${PROJECT_SOURCE_DIR}/..
+ [HKEY_LOCAL_MACHINE\\SOFTWARE\\Dart\\InstallPath]
+ ENV ProgramFiles
+ PATH_SUFFIXES
+ Dart
DOC "If you have Dart installed, where is it located?"
)
diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake
index a02d031..24cfb87 100644
--- a/Modules/FindFLTK.cmake
+++ b/Modules/FindFLTK.cmake
@@ -93,11 +93,13 @@ if(NOT FLTK_DIR)
#
find_path(FLTK_DIR FLTKConfig.cmake
# Look for an environment variable FLTK_DIR.
- $ENV{FLTK_DIR}
+ HINTS
+ ENV FLTK_DIR
# Look in places relative to the system executable search path.
${FLTK_DIR_SEARCH}
+ PATHS
# Look in standard UNIX install locations.
/usr/local/lib/fltk
/usr/lib/fltk
diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake
index 3ea558c..071c318 100644
--- a/Modules/FindFLTK2.cmake
+++ b/Modules/FindFLTK2.cmake
@@ -73,7 +73,7 @@ if(NOT FLTK2_DIR)
#
find_path(FLTK2_DIR FLTK2Config.cmake
# Look for an environment variable FLTK2_DIR.
- $ENV{FLTK2_DIR}
+ ENV FLTK2_DIR
# Look in places relative to the system executable search path.
${FLTK2_DIR_SEARCH}
diff --git a/Modules/FindFreetype.cmake b/Modules/FindFreetype.cmake
index 08b4a0d..c7cf0eb 100644
--- a/Modules/FindFreetype.cmake
+++ b/Modules/FindFreetype.cmake
@@ -44,7 +44,7 @@
# everything still works.
find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
HINTS
- $ENV{FREETYPE_DIR}
+ ENV FREETYPE_DIR
PATHS
/usr/local/X11R6/include
/usr/local/X11/include
@@ -53,19 +53,19 @@ find_path(FREETYPE_INCLUDE_DIR_ft2build ft2build.h
find_path(FREETYPE_INCLUDE_DIR_freetype2 freetype/config/ftheader.h
HINTS
- $ENV{FREETYPE_DIR}/include/freetype2
+ ENV FREETYPE_DIR
PATHS
- /usr/local/X11R6/include
- /usr/local/X11/include
- /usr/freeware/include
- PATH_SUFFIXES freetype2
+ /usr/local/X11R6
+ /usr/local/X11
+ /usr/freeware
+ PATH_SUFFIXES include/freetype2 include
)
find_library(FREETYPE_LIBRARY
NAMES freetype libfreetype freetype219
HINTS
- $ENV{FREETYPE_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV FREETYPE_DIR
+ PATH_SUFFIXES lib
PATHS
/usr/local/X11R6
/usr/local/X11
diff --git a/Modules/FindGDAL.cmake b/Modules/FindGDAL.cmake
index 1e09b82..6e89847 100644
--- a/Modules/FindGDAL.cmake
+++ b/Modules/FindGDAL.cmake
@@ -42,8 +42,8 @@
find_path(GDAL_INCLUDE_DIR gdal.h
HINTS
- $ENV{GDAL_DIR}
- $ENV{GDAL_ROOT}
+ ENV GDAL_DIR
+ ENV GDAL_ROOT
PATH_SUFFIXES
include/gdal
include/GDAL
@@ -64,8 +64,8 @@ if(UNIX)
# libgdal.so...
find_program(GDAL_CONFIG gdal-config
HINTS
- $ENV{GDAL_DIR}
- $ENV{GDAL_ROOT}
+ ENV GDAL_DIR
+ ENV GDAL_ROOT
PATH_SUFFIXES bin
PATHS
/sw # Fink
@@ -88,10 +88,10 @@ endif()
find_library(GDAL_LIBRARY
NAMES ${_gdal_lib} gdal gdal_i gdal1.5.0 gdal1.4.0 gdal1.3.2 GDAL
HINTS
- $ENV{GDAL_DIR}
- $ENV{GDAL_ROOT}
+ ENV GDAL_DIR
+ ENV GDAL_ROOT
${_gdal_libpath}
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
diff --git a/Modules/FindGIF.cmake b/Modules/FindGIF.cmake
index ff1d396..6a665ad 100644
--- a/Modules/FindGIF.cmake
+++ b/Modules/FindGIF.cmake
@@ -28,7 +28,7 @@
find_path(GIF_INCLUDE_DIR gif_lib.h
HINTS
- $ENV{GIF_DIR}
+ ENV GIF_DIR
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
@@ -41,8 +41,8 @@ set(POTENTIAL_GIF_LIBS gif libgif ungif libungif giflib giflib4)
find_library(GIF_LIBRARY
NAMES ${POTENTIAL_GIF_LIBS}
HINTS
- $ENV{GIF_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV GIF_DIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/usr/freeware
diff --git a/Modules/FindGTK.cmake b/Modules/FindGTK.cmake
index 505a051..8a44ade 100644
--- a/Modules/FindGTK.cmake
+++ b/Modules/FindGTK.cmake
@@ -139,11 +139,7 @@ if(UNIX)
)
endif()
- endif(GTK_gtk_INCLUDE_PATH
- AND GTK_glibconfig_INCLUDE_PATH
- AND GTK_glib_INCLUDE_PATH
- AND GTK_gtk_LIBRARY
- AND GTK_glib_LIBRARY)
+ endif()
mark_as_advanced(
GTK_gdk_LIBRARY
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index d10b419..49af0f2 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -114,7 +114,7 @@
# _gtkversion_hdr = Header file to parse
#=============================================================
function(_GTK2_GET_VERSION _OUT_major _OUT_minor _OUT_micro _gtkversion_hdr)
- file(READ ${_gtkversion_hdr} _contents)
+ file(STRINGS ${_gtkversion_hdr} _contents REGEX "#define GTK_M[A-Z]+_VERSION[ \t]+")
if(_contents)
string(REGEX REPLACE ".*#define GTK_MAJOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_major} "${_contents}")
string(REGEX REPLACE ".*#define GTK_MINOR_VERSION[ \t]+\\(([0-9]+)\\).*" "\\1" ${_OUT_minor} "${_contents}")
@@ -172,7 +172,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
sigc++-2.0
)
- set(_suffixes)
+ set(_suffixes include lib)
foreach(_d ${_relatives})
list(APPEND _suffixes ${_d})
list(APPEND _suffixes ${_d}/include) # for /usr/lib/gtk-2.0/include
@@ -186,23 +186,15 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
find_path(${_var} ${_hdr}
PATHS
/usr/local/lib64
- /usr/local/lib
/usr/lib64
- /usr/lib
- /opt/gnome/include
- /opt/gnome/lib
- /opt/openwin/include
- /usr/openwin/lib
- /sw/include
- /sw/lib
- /opt/local/include
- /opt/local/lib
- $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
+ /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]
PATH_SUFFIXES
${_suffixes}
)
@@ -469,6 +461,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_LIBRARY (GTK2_GTKMM_LIBRARY gtkmm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMM_INCLUDE_DIR cairomm/cairomm.h)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_CAIROMMCONFIG_INCLUDE_DIR cairommconfig.h)
_GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true)
_GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h)
diff --git a/Modules/FindGTest.cmake b/Modules/FindGTest.cmake
index 6cffb5c..d531dd1 100644
--- a/Modules/FindGTest.cmake
+++ b/Modules/FindGTest.cmake
@@ -98,7 +98,7 @@ function(_gtest_find_library _name)
find_library(${_name}
NAMES ${ARGN}
HINTS
- $ENV{GTEST_ROOT}
+ ENV GTEST_ROOT
${GTEST_ROOT}
PATH_SUFFIXES ${_gtest_libpath_suffixes}
)
diff --git a/Modules/FindHSPELL.cmake b/Modules/FindHSPELL.cmake
index 05b5505..71e55da 100644
--- a/Modules/FindHSPELL.cmake
+++ b/Modules/FindHSPELL.cmake
@@ -29,10 +29,11 @@ find_path(HSPELL_INCLUDE_DIR hspell.h)
find_library(HSPELL_LIBRARIES NAMES hspell)
if (HSPELL_INCLUDE_DIR)
- file(READ "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H)
+ file(STRINGS "${HSPELL_INCLUDE_DIR}/hspell.h" HSPELL_H REGEX "#define HSPELL_VERSION_M(AJO|INO)R [0-9]+")
string(REGEX REPLACE ".*#define HSPELL_VERSION_MAJOR ([0-9]+).*" "\\1" HSPELL_VERSION_MAJOR "${HSPELL_H}")
string(REGEX REPLACE ".*#define HSPELL_VERSION_MINOR ([0-9]+).*" "\\1" HSPELL_VERSION_MINOR "${HSPELL_H}")
set(HSPELL_VERSION_STRING "${HSPELL_VERSION_MAJOR}.${HSPELL_VERSION_MINOR}")
+ unset(HSPELL_H)
endif()
# handle the QUIETLY and REQUIRED arguments and set HSPELL_FOUND to TRUE if
diff --git a/Modules/FindHg.cmake b/Modules/FindHg.cmake
new file mode 100644
index 0000000..a6a4aef
--- /dev/null
+++ b/Modules/FindHg.cmake
@@ -0,0 +1,48 @@
+# The module defines the following variables:
+# HG_EXECUTABLE - path to mercurial command line client (hg)
+# HG_FOUND - true if the command line client was found
+# HG_VERSION_STRING - the version of mercurial found
+# Example usage:
+# find_package(Hg)
+# if(HG_FOUND)
+# message("hg found: ${HG_EXECUTABLE}")
+# endif()
+
+#=============================================================================
+# Copyright 2010-2012 Kitware, Inc.
+# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
+#
+# 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.)
+
+find_program(HG_EXECUTABLE
+ NAMES hg
+ PATH_SUFFIXES Mercurial
+ DOC "hg command line client"
+ )
+mark_as_advanced(HG_EXECUTABLE)
+
+if(HG_EXECUTABLE)
+ execute_process(COMMAND ${HG_EXECUTABLE} --version
+ OUTPUT_VARIABLE hg_version
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(hg_version MATCHES "^Mercurial Distributed SCM \\(version ([0-9][^)]*)\\)")
+ set(HG_VERSION_STRING "${CMAKE_MATCH_1}")
+ endif()
+ unset(hg_version)
+endif()
+
+# Handle the QUIETLY and REQUIRED arguments and set HG_FOUND to TRUE if
+# all listed variables are TRUE
+include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
+find_package_handle_standard_args(Hg
+ REQUIRED_VARS HG_EXECUTABLE
+ VERSION_VAR HG_VERSION_STRING)
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake
index 37cace8..f8ea18b 100644
--- a/Modules/FindLibLZMA.cmake
+++ b/Modules/FindLibLZMA.cmake
@@ -33,13 +33,14 @@ find_path(LIBLZMA_INCLUDE_DIR lzma.h )
find_library(LIBLZMA_LIBRARY lzma)
if(LIBLZMA_INCLUDE_DIR AND EXISTS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h")
- file(READ "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS)
+ file(STRINGS "${LIBLZMA_INCLUDE_DIR}/lzma/version.h" LIBLZMA_HEADER_CONTENTS REGEX "#define LZMA_VERSION_[A-Z]+ [0-9]+")
string(REGEX REPLACE ".*#define LZMA_VERSION_MAJOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MAJOR "${LIBLZMA_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define LZMA_VERSION_MINOR ([0-9]+).*" "\\1" LIBLZMA_VERSION_MINOR "${LIBLZMA_HEADER_CONTENTS}")
string(REGEX REPLACE ".*#define LZMA_VERSION_PATCH ([0-9]+).*" "\\1" LIBLZMA_VERSION_PATCH "${LIBLZMA_HEADER_CONTENTS}")
set(LIBLZMA_VERSION_STRING "${LIBLZMA_VERSION_MAJOR}.${LIBLZMA_VERSION_MINOR}.${LIBLZMA_VERSION_PATCH}")
+ unset(LIBLZMA_HEADER_CONTENTS)
endif()
# We're using new code known now as XZ, even library still been called LZMA
diff --git a/Modules/FindLua50.cmake b/Modules/FindLua50.cmake
index 2b8ee97..0276a98 100644
--- a/Modules/FindLua50.cmake
+++ b/Modules/FindLua50.cmake
@@ -26,7 +26,7 @@
find_path(LUA_INCLUDE_DIR lua.h
HINTS
- $ENV{LUA_DIR}
+ ENV LUA_DIR
PATH_SUFFIXES include/lua50 include/lua5.0 include/lua5 include/lua include
PATHS
~/Library/Frameworks
@@ -40,8 +40,8 @@ find_path(LUA_INCLUDE_DIR lua.h
find_library(LUA_LIBRARY_lua
NAMES lua50 lua5.0 lua-5.0 lua5 lua
HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -59,9 +59,9 @@ else()
find_library(LUA_LIBRARY_lualib
NAMES lualib50 lualib5.0 lualib5 lualib
HINTS
- $ENV{LUALIB_DIR}
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV LUALIB_DIR
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
diff --git a/Modules/FindLua51.cmake b/Modules/FindLua51.cmake
index b5a5471..eac25f5 100644
--- a/Modules/FindLua51.cmake
+++ b/Modules/FindLua51.cmake
@@ -27,7 +27,7 @@
find_path(LUA_INCLUDE_DIR lua.h
HINTS
- $ENV{LUA_DIR}
+ ENV LUA_DIR
PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include
PATHS
~/Library/Frameworks
@@ -41,8 +41,8 @@ find_path(LUA_INCLUDE_DIR lua.h
find_library(LUA_LIBRARY
NAMES lua51 lua5.1 lua-5.1 lua
HINTS
- $ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ ENV LUA_DIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
diff --git a/Modules/FindOpenAL.cmake b/Modules/FindOpenAL.cmake
index 311a11a..78fd632 100644
--- a/Modules/FindOpenAL.cmake
+++ b/Modules/FindOpenAL.cmake
@@ -63,7 +63,7 @@
find_path(OPENAL_INCLUDE_DIR al.h
HINTS
- $ENV{OPENALDIR}
+ ENV OPENALDIR
PATH_SUFFIXES include/AL include/OpenAL include
PATHS
~/Library/Frameworks
@@ -78,7 +78,7 @@ find_path(OPENAL_INCLUDE_DIR al.h
find_library(OPENAL_LIBRARY
NAMES OpenAL al openal OpenAL32
HINTS
- $ENV{OPENALDIR}
+ ENV OPENALDIR
PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64
PATHS
~/Library/Frameworks
diff --git a/Modules/FindOpenSceneGraph.cmake b/Modules/FindOpenSceneGraph.cmake
index 17ab057..1f30fe3 100644
--- a/Modules/FindOpenSceneGraph.cmake
+++ b/Modules/FindOpenSceneGraph.cmake
@@ -26,6 +26,10 @@
# OSGDIR
# OSG_ROOT
#
+# [CMake 2.8.10]:
+# The CMake variable OSG_DIR can now be used as well to influence detection, instead of needing
+# to specify an environment variable.
+#
# This module defines the following output variables:
#
# OPENSCENEGRAPH_FOUND - Was the OSG and all of the specified components found?
@@ -49,7 +53,7 @@
#=============================================================================
# Copyright 2009 Kitware, Inc.
-# Copyright 2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2009-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -103,7 +107,8 @@ if(OSG_INCLUDE_DIR)
endif()
if(EXISTS "${_osg_Version_file}")
- file(READ "${_osg_Version_file}" _osg_Version_contents)
+ file(STRINGS "${_osg_Version_file}" _osg_Version_contents
+ REGEX "#define (OSG_VERSION_[A-Z]+|OPENSCENEGRAPH_[A-Z]+_VERSION)[ \t]+[0-9]+")
else()
set(_osg_Version_contents "unknown")
endif()
@@ -130,6 +135,7 @@ if(OSG_INCLUDE_DIR)
message(WARNING "[ FindOpenSceneGraph.cmake:${CMAKE_CURRENT_LIST_LINE} ] "
"Failed to parse version number, please report this as a bug")
endif()
+ unset(_osg_Version_contents)
set(OPENSCENEGRAPH_VERSION "${_osg_VERSION_MAJOR}.${_osg_VERSION_MINOR}.${_osg_VERSION_PATCH}"
CACHE INTERNAL "The version of OSG which was detected")
diff --git a/Modules/FindOpenThreads.cmake b/Modules/FindOpenThreads.cmake
index 4f6e920..e059960 100644
--- a/Modules/FindOpenThreads.cmake
+++ b/Modules/FindOpenThreads.cmake
@@ -15,10 +15,15 @@
# correspond to the ./configure --prefix=$OPENTHREADS_DIR
# used in building osg.
#
+# [CMake 2.8.10]:
+# The CMake variables OPENTHREADS_DIR or OSG_DIR can now be used as well to influence
+# detection, instead of needing to specify an environment variable.
+#
# Created by Eric Wing.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
+# Copyright 2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -53,14 +58,15 @@
find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
HINTS
- # enough environment variables?
- $ENV{OPENTHREADS_INCLUDE_DIR}
- $ENV{OPENTHREADS_DIR}
- $ENV{OSG_INCLUDE_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OpenThreads_ROOT}
- $ENV{OSG_ROOT}
+ ENV OPENTHREADS_INCLUDE_DIR
+ ENV OPENTHREADS_DIR
+ ENV OSG_INCLUDE_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OpenThreads_ROOT
+ ENV OSG_ROOT
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -74,40 +80,44 @@ find_path(OPENTHREADS_INCLUDE_DIR OpenThreads/Thread
find_library(OPENTHREADS_LIBRARY
NAMES OpenThreads OpenThreadsWin32
HINTS
- $ENV{OPENTHREADS_LIBRARY_DIR}
- $ENV{OPENTHREADS_DIR}
- $ENV{OSG_LIBRARY_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OpenThreads_ROOT}
- $ENV{OSG_ROOT}
+ ENV OPENTHREADS_LIBRARY_DIR
+ ENV OPENTHREADS_DIR
+ ENV OSG_LIBRARY_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OpenThreads_ROOT
+ ENV OSG_ROOT
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
)
find_library(OPENTHREADS_LIBRARY_DEBUG
NAMES OpenThreadsd OpenThreadsWin32d
HINTS
- $ENV{OPENTHREADS_DEBUG_LIBRARY_DIR}
- $ENV{OPENTHREADS_LIBRARY_DIR}
- $ENV{OPENTHREADS_DIR}
- $ENV{OSG_LIBRARY_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OpenThreads_ROOT}
- $ENV{OSG_ROOT}
+ ENV OPENTHREADS_DEBUG_LIBRARY_DIR
+ ENV OPENTHREADS_LIBRARY_DIR
+ ENV OPENTHREADS_DIR
+ ENV OSG_LIBRARY_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OpenThreads_ROOT
+ ENV OSG_ROOT
+ ${OPENTHREADS_DIR}
+ ${OSG_DIR}
PATHS
/sw
/opt/local
/opt/csw
/opt
/usr/freeware
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
)
if(OPENTHREADS_LIBRARY_DEBUG)
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index 449fd9f..888e109 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -247,7 +247,7 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
set(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
set(VERSION_OK FALSE)
else ()
- set(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+ set(VERSION_MSG "(found suitable version \"${VERSION}\", minimum required is \"${${_NAME}_FIND_VERSION}\")")
endif ()
endif()
diff --git a/Modules/FindPhysFS.cmake b/Modules/FindPhysFS.cmake
index ae78b27..a2d6abf 100644
--- a/Modules/FindPhysFS.cmake
+++ b/Modules/FindPhysFS.cmake
@@ -25,7 +25,7 @@
find_path(PHYSFS_INCLUDE_DIR physfs.h
HINTS
- $ENV{PHYSFSDIR}
+ ENV PHYSFSDIR
PATH_SUFFIXES include/physfs include
PATHS
~/Library/Frameworks
@@ -39,8 +39,8 @@ find_path(PHYSFS_INCLUDE_DIR physfs.h
find_library(PHYSFS_LIBRARY
NAMES physfs
HINTS
- $ENV{PHYSFSDIR}
- PATH_SUFFIXES lib64 lib
+ ENV PHYSFSDIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 699cd41..b9440a8 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -74,11 +74,6 @@ set(PostgreSQL_LIBRARY_DIR_MESSAGE "Set the PostgreSQL_LIBRARY_DIR cmake cache e
set(PostgreSQL_ROOT_DIR_MESSAGE "Set the PostgreSQL_ROOT system variable to where PostgreSQL is found on the machine E.g C:/Program Files/PostgreSQL/8.4")
-set(PostgreSQL_ROOT_DIRECTORIES $ENV{PostgreSQL_ROOT})
-if(PostgreSQL_ROOT_DIRECTORIES)
- file(TO_CMAKE_PATH ${PostgreSQL_ROOT_DIRECTORIES} PostgreSQL_ROOT_DIRECTORIES)
-endif()
-
set(PostgreSQL_KNOWN_VERSIONS ${PostgreSQL_ADDITIONAL_VERSIONS}
"9.1" "9.0" "8.4" "8.3" "8.2" "8.1" "8.0")
@@ -89,7 +84,7 @@ if ( WIN32 )
endforeach()
endif()
set( PostgreSQL_ROOT_DIRECTORIES
- ${PostgreSQL_ROOT_DIRECTORIES}
+ ENV PostgreSQL_ROOT
${PostgreSQL_ROOT}
${PostgreSQL_ADDITIONAL_SEARCH_PATHS}
)
diff --git a/Modules/FindProducer.cmake b/Modules/FindProducer.cmake
index 20266cb..3099062 100644
--- a/Modules/FindProducer.cmake
+++ b/Modules/FindProducer.cmake
@@ -44,9 +44,9 @@
# Try the user's environment request before anything else.
find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
HINTS
- $ENV{PRODUCER_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
+ ENV PRODUCER_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
PATH_SUFFIXES include
PATHS
~/Library/Frameworks
@@ -62,10 +62,10 @@ find_path(PRODUCER_INCLUDE_DIR Producer/CameraGroup
find_library(PRODUCER_LIBRARY
NAMES Producer
HINTS
- $ENV{PRODUCER_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- PATH_SUFFIXES lib64 lib
+ ENV PRODUCER_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
diff --git a/Modules/FindQt3.cmake b/Modules/FindQt3.cmake
index 15fbc0b..0665063 100644
--- a/Modules/FindQt3.cmake
+++ b/Modules/FindQt3.cmake
@@ -74,9 +74,9 @@ endif()
if(QT_INCLUDE_DIR)
#extract the version string from qglobal.h
- file(READ ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H)
- string(REGEX MATCH "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"" QGLOBAL_H "${QGLOBAL_H}")
+ file(STRINGS ${QT_INCLUDE_DIR}/qglobal.h QGLOBAL_H REGEX "#define[\t ]+QT_VERSION_STR[\t ]+\"[0-9]+.[0-9]+.[0-9]+[a-z]*\"")
string(REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+[a-z]*)\".*" "\\1" qt_version_str "${QGLOBAL_H}")
+ unset(QGLOBAL_H)
# Under windows the qt library (MSVC) has the format qt-mtXYZ where XYZ is the
# version X.Y.Z, so we need to remove the dots from version
@@ -91,17 +91,18 @@ if (QT_MT_REQUIRED)
qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
- $ENV{QTDIR}/lib
- ${GLOB_PATHS_LIB}
- /usr/local/qt/lib
- /usr/lib/qt/lib
- /usr/lib/qt3/lib
- /usr/lib/qt3/lib64
- /usr/share/qt3/lib
- C:/Progra~1/qt/lib
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
+ ENV QTDIR
+ ${GLOB_PATHS_LIB}
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ PATH_SUFFIXES
+ lib
)
else ()
@@ -111,17 +112,18 @@ else ()
qt-mt qt-mt${qt_version_str_lib} qt-mtnc${qt_version_str_lib}
qt-mtedu${qt_version_str_lib} qt-mt230nc qt-mtnc321 qt-mt3
PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
- $ENV{QTDIR}/lib
- ${GLOB_PATHS_LIB}
- /usr/local/qt/lib
- /usr/lib/qt/lib
- /usr/lib/qt3/lib
- /usr/lib/qt3/lib64
- /usr/share/qt3/lib
- C:/Progra~1/qt/lib
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
+ ENV QTDIR
+ ${GLOB_PATHS_LIB}
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt/lib
+ PATH_SUFFIXES
+ lib
)
endif ()
@@ -129,35 +131,37 @@ endif ()
find_library(QT_QASSISTANTCLIENT_LIBRARY
NAMES qassistantclient
PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
- $ENV{QTDIR}/lib
- ${GLOB_PATHS_LIB}
- /usr/local/qt/lib
- /usr/lib/qt3/lib
- /usr/lib/qt3/lib64
- /usr/share/qt3/lib
- C:/Progra~1/qt/lib
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
+ ENV QTDIR
+ ${GLOB_PATHS_LIB}
+ /usr/local/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ PATH_SUFFIXES
+ lib
)
# qt 3 should prefer QTDIR over the PATH
find_program(QT_MOC_EXECUTABLE
NAMES moc-qt3 moc
HINTS
- $ENV{QTDIR}/bin
+ ENV QTDIR
PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
- $ENV{QTDIR}/bin
${GLOB_PATHS_BIN}
- /usr/local/qt/bin
- /usr/lib/qt/bin
- /usr/lib/qt3/bin
- /usr/share/qt3/bin
- C:/Progra~1/qt/bin
- /usr/X11R6/bin
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ /usr/X11R6
+ PATH_SUFFIXES
+ bin
)
if(QT_MOC_EXECUTABLE)
@@ -168,18 +172,20 @@ endif()
find_program(QT_UIC_EXECUTABLE
NAMES uic-qt3 uic
HINTS
- $ENV{QTDIR}/bin
+ ENV QTDIR
PATHS
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/include/Qt"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/include/Qt"
${GLOB_PATHS_BIN}
- /usr/local/qt/bin
- /usr/lib/qt/bin
- /usr/lib/qt3/bin
- /usr/share/qt3/bin
- C:/Progra~1/qt/bin
- /usr/X11R6/bin
+ /usr/local/qt
+ /usr/lib/qt
+ /usr/lib/qt3
+ /usr/share/qt3
+ C:/Progra~1/qt
+ /usr/X11R6
+ PATH_SUFFIXES
+ bin
)
if(QT_UIC_EXECUTABLE)
@@ -189,13 +195,15 @@ endif()
if (WIN32)
find_library(QT_QTMAIN_LIBRARY qtmain
HINTS
- $ENV{QTDIR}/lib
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
+ ENV QTDIR
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]"
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]"
PATHS
- "$ENV{ProgramFiles}/qt/lib"
- "C:/Program Files/qt/lib"
+ "$ENV{ProgramFiles}/qt"
+ "C:/Program Files/qt"
+ PATH_SUFFIXES
+ lib
DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
)
endif ()
diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake
index e7d25c9..f133ae9 100644
--- a/Modules/FindQt4.cmake
+++ b/Modules/FindQt4.cmake
@@ -163,6 +163,17 @@
# filenames can be found in qm_files. The ts_files
# must exists and are not updated in any way.
#
+# function QT4_USE_MODULES( target [link_type] modules...)
+# Make <target> use the <modules> from Qt. Using a Qt module means
+# to link to the library, add the relevant include directories for the module,
+# and add the relevant compiler defines for using the module.
+# Modules are roughly equivalent to components of Qt4, so usage would be
+# something like:
+# qt4_use_modules(myexe Core Gui Declarative)
+# to use QtCore, QtGui and QtDeclarative. The optional <link_type> argument can
+# be specified as either LINK_PUBLIC or LINK_PRIVATE to specify the same argument
+# to the target_link_libraries call.
+#
#
# Below is a detailed list of variables that FindQt4.cmake sets.
# QT_FOUND If false, don't try to use Qt.
@@ -486,11 +497,11 @@ get_filename_component(qt_install_version "[HKEY_CURRENT_USER\\Software\\trollte
# check for qmake
# Debian uses qmake-qt4
# macports' Qt uses qmake-mac
-find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac PATHS
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\4.0.0;InstallDir]/bin"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\4.0.0;InstallDir]/bin"
- "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]/bin"
- $ENV{QTDIR}/bin
+find_program(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 qmake-mac
+ PATHS
+ ENV QTDIR
+ "[HKEY_CURRENT_USER\\Software\\Trolltech\\Versions\\${qt_install_version};InstallDir]"
+ PATH_SUFFIXES bin
DOC "The qmake executable for the Qt installation to use"
)
@@ -1149,7 +1160,7 @@ if (QT_QMAKE_EXECUTABLE AND QTVERSION)
# set version variables
string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+.*" "\\1" QT_VERSION_MAJOR "${QTVERSION}")
- string(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
+ string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+.*" "\\1" QT_VERSION_MINOR "${QTVERSION}")
string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" QT_VERSION_PATCH "${QTVERSION}")
endif()
diff --git a/Modules/FindQuickTime.cmake b/Modules/FindQuickTime.cmake
index 57de737..42a0dce 100644
--- a/Modules/FindQuickTime.cmake
+++ b/Modules/FindQuickTime.cmake
@@ -22,24 +22,18 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
-# QuickTime on OS X looks different than QuickTime for Windows,
-# so I am going to case the two.
-
-if(APPLE)
- find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h)
- find_library(QUICKTIME_LIBRARY QuickTime)
-else()
- find_path(QUICKTIME_INCLUDE_DIR QuickTime.h
- HINTS
- $ENV{QUICKTIME_DIR}/include
- $ENV{QUICKTIME_DIR}
- )
- find_library(QUICKTIME_LIBRARY QuickTime
- HINTS
- $ENV{QUICKTIME_DIR}/lib
- $ENV{QUICKTIME_DIR}
- )
-endif()
+find_path(QUICKTIME_INCLUDE_DIR QuickTime/QuickTime.h QuickTime.h
+ HINTS
+ ENV QUICKTIME_DIR
+ PATH_SUFFIXES
+ include
+)
+find_library(QUICKTIME_LIBRARY QuickTime
+ HINTS
+ ENV QUICKTIME_DIR
+ PATH_SUFFIXES
+ lib
+)
# handle the QUIETLY and REQUIRED arguments and set QUICKTIME_FOUND to TRUE if
# all listed variables are TRUE
diff --git a/Modules/FindRTI.cmake b/Modules/FindRTI.cmake
index eef0dae..60990b7 100644
--- a/Modules/FindRTI.cmake
+++ b/Modules/FindRTI.cmake
@@ -35,18 +35,13 @@ macro(RTI_MESSAGE_QUIETLY QUIET TYPE MSG)
endif()
endmacro()
-# Detect the CERTI installation, http://www.cert.fr/CERTI
-if ("$ENV{CERTI_HOME}" STRGREATER "")
- file(TO_CMAKE_PATH "$ENV{CERTI_HOME}" CERTI_HOME)
- RTI_MESSAGE_QUIETLY(RTI_FIND_QUIETLY STATUS "Using environment defined CERTI_HOME: ${CERTI_HOME}")
-endif ()
-
set(RTI_DEFINITIONS "-DRTI_USES_STD_FSTREAM")
+# Detect the CERTI installation, http://www.cert.fr/CERTI
# Detect the MAK Technologies RTI installation, http://www.mak.com/products/rti.php
# note: the following list is ordered to find the most recent version first
set(RTI_POSSIBLE_DIRS
- ${CERTI_HOME}
+ ENV CERTI_HOME
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 3.2 MSVC++ 8.0;Location]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MAK RTI 3.2-win32-msvc++8.0;InstallLocation]"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\MAK Technologies\\MAK RTI 2.2;Location]"
diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake
index 806b659..487c5d3 100644
--- a/Modules/FindSDL.cmake
+++ b/Modules/FindSDL.cmake
@@ -67,7 +67,7 @@
find_path(SDL_INCLUDE_DIR SDL.h
HINTS
- $ENV{SDLDIR}
+ ENV SDLDIR
PATH_SUFFIXES include/SDL include
PATHS
~/Library/Frameworks
@@ -87,8 +87,8 @@ find_path(SDL_INCLUDE_DIR SDL.h
find_library(SDL_LIBRARY_TEMP
NAMES SDL SDL-1.1
HINTS
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
+ ENV SDLDIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
@@ -105,8 +105,8 @@ if(NOT SDL_BUILDING_LIBRARY)
find_library(SDLMAIN_LIBRARY
NAMES SDLmain SDLmain-1.1
HINTS
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
+ ENV SDLDIR
+ PATH_SUFFIXES lib
PATHS
/sw
/opt/local
diff --git a/Modules/FindSDL_image.cmake b/Modules/FindSDL_image.cmake
index 3c1f7a0..8c9e891 100644
--- a/Modules/FindSDL_image.cmake
+++ b/Modules/FindSDL_image.cmake
@@ -27,34 +27,28 @@
find_path(SDLIMAGE_INCLUDE_DIR SDL_image.h
HINTS
- $ENV{SDLIMAGEDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
+ ENV SDLIMAGEDIR
+ ENV SDLDIR
+ PATH_SUFFIXES include include/SDL
PATHS
~/Library/Frameworks
/Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
)
find_library(SDLIMAGE_LIBRARY
NAMES SDL_image
HINTS
- $ENV{SDLIMAGEDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
+ ENV SDLIMAGEDIR
+ ENV SDLDIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
diff --git a/Modules/FindSDL_mixer.cmake b/Modules/FindSDL_mixer.cmake
index ed333ee..97a8330 100644
--- a/Modules/FindSDL_mixer.cmake
+++ b/Modules/FindSDL_mixer.cmake
@@ -27,34 +27,28 @@
find_path(SDLMIXER_INCLUDE_DIR SDL_mixer.h
HINTS
- $ENV{SDLMIXERDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
+ ENV SDLMIXERDIR
+ ENV SDLDIR
+ PATH_SUFFIXES include include/SDL
PATHS
~/Library/Frameworks
/Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
)
find_library(SDLMIXER_LIBRARY
NAMES SDL_mixer
HINTS
- $ENV{SDLMIXERDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
+ ENV SDLMIXERDIR
+ ENV SDLDIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
diff --git a/Modules/FindSDL_net.cmake b/Modules/FindSDL_net.cmake
index dcab3fd..7e90e90 100644
--- a/Modules/FindSDL_net.cmake
+++ b/Modules/FindSDL_net.cmake
@@ -27,33 +27,27 @@
find_path(SDLNET_INCLUDE_DIR SDL_net.h
HINTS
- $ENV{SDLNETDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
+ ENV SDLNETDIR
+ ENV SDLDIR
+ PATH_SUFFIXES include include/SDL
PATHS
~/Library/Frameworks
/Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
)
find_library(SDLNET_LIBRARY
NAMES SDL_net
HINTS
- $ENV{SDLNETDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES lib64 lib
+ ENV SDLNETDIR
+ ENV SDLDIR
+ PATH_SUFFIXES lib
PATHS
~/Library/Frameworks
/Library/Frameworks
diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake
index 3685956..a9153c1 100644
--- a/Modules/FindSDL_sound.cmake
+++ b/Modules/FindSDL_sound.cmake
@@ -75,39 +75,33 @@ mark_as_advanced(SDL_SOUND_EXTRAS)
# Find SDL_sound.h
find_path(SDL_SOUND_INCLUDE_DIR SDL_sound.h
HINTS
- $ENV{SDLSOUNDDIR}/include
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/include
- $ENV{SDLDIR}
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ PATH_SUFFIXES
+ include include/SDL
PATHS
- /usr/local/include/SDL
- /usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
)
find_library(SDL_SOUND_LIBRARY
NAMES SDL_sound
HINTS
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ PATH_SUFFIXES
+ lib
PATHS
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
)
if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
@@ -212,37 +206,35 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(MIKMOD_LIBRARY
NAMES libmikmod-coreaudio mikmod
PATHS
- $ENV{MIKMODDIR}/lib
- $ENV{MIKMODDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV MIKMODDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(MIKMOD_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MIKMOD_LIBRARY})
- endif()
- endif()
+ endif(MIKMOD_LIBRARY)
+ endif("${MY_OUTPUT}" MATCHES "MikMod_")
# Find ModPlug
if("${MY_OUTPUT}" MATCHES "MODPLUG_")
find_library(MODPLUG_LIBRARY
NAMES modplug
PATHS
- $ENV{MODPLUGDIR}/lib
- $ENV{MODPLUGDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV MODPLUGDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(MODPLUG_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${MODPLUG_LIBRARY})
@@ -255,18 +247,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(VORBIS_LIBRARY
NAMES vorbis Vorbis VORBIS
PATHS
- $ENV{VORBISDIR}/lib
- $ENV{VORBISDIR}
- $ENV{OGGDIR}/lib
- $ENV{OGGDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV VORBISDIR
+ ENV OGGDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(VORBIS_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY})
@@ -275,18 +265,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(OGG_LIBRARY
NAMES ogg Ogg OGG
PATHS
- $ENV{OGGDIR}/lib
- $ENV{OGGDIR}
- $ENV{VORBISDIR}/lib
- $ENV{VORBISDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV OGGDIR
+ ENV VORBISDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(OGG_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
@@ -299,16 +287,15 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(SMPEG_LIBRARY
NAMES smpeg SMPEG Smpeg SMpeg
PATHS
- $ENV{SMPEGDIR}/lib
- $ENV{SMPEGDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV SMPEGDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(SMPEG_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SMPEG_LIBRARY})
@@ -321,16 +308,15 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(FLAC_LIBRARY
NAMES flac FLAC
PATHS
- $ENV{FLACDIR}/lib
- $ENV{FLACDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV FLACDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(FLAC_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${FLAC_LIBRARY})
@@ -346,16 +332,15 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(SPEEX_LIBRARY
NAMES speex SPEEX
PATHS
- $ENV{SPEEXDIR}/lib
- $ENV{SPEEXDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV SPEEXDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES
+ lib
)
if(SPEEX_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${SPEEX_LIBRARY})
@@ -367,20 +352,16 @@ if(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
find_library(OGG_LIBRARY
NAMES ogg Ogg OGG
PATHS
- $ENV{OGGDIR}/lib
- $ENV{OGGDIR}
- $ENV{VORBISDIR}/lib
- $ENV{VORBISDIR}
- $ENV{SPEEXDIR}/lib
- $ENV{SPEEXDIR}
- $ENV{SDLSOUNDDIR}/lib
- $ENV{SDLSOUNDDIR}
- $ENV{SDLDIR}/lib
- $ENV{SDLDIR}
- /sw/lib
- /opt/local/lib
- /opt/csw/lib
- /opt/lib
+ ENV OGGDIR
+ ENV VORBISDIR
+ ENV SPEEXDIR
+ ENV SDLSOUNDDIR
+ ENV SDLDIR
+ /sw
+ /opt/local
+ /opt/csw
+ /opt
+ PATH_SUFFIXES lib
)
if(OGG_LIBRARY)
set(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${OGG_LIBRARY})
diff --git a/Modules/FindSDL_ttf.cmake b/Modules/FindSDL_ttf.cmake
index 6f238e6..1e68ccf 100644
--- a/Modules/FindSDL_ttf.cmake
+++ b/Modules/FindSDL_ttf.cmake
@@ -27,33 +27,27 @@
find_path(SDLTTF_INCLUDE_DIR SDL_ttf.h
HINTS
- $ENV{SDLTTFDIR}
- $ENV{SDLDIR}
- PATH_SUFFIXES include
+ ENV SDLTTFDIR
+ ENV SDLDIR
+ PATH_SUFFIXES include include/SDL
PATHS
~/Library/Frameworks
/Library/Frameworks
- /usr/local/include/SDL
- /usr/include/SDL
/usr/local/include/SDL12
/usr/local/include/SDL11 # FreeBSD ports
/usr/include/SDL12
/usr/include/SDL11
- /sw/include/SDL # Fink
- /sw/include
- /opt/local/include/SDL # DarwinPorts
- /opt/local/include
- /opt/csw/include/SDL # Blastwave
- /opt/csw/include
- /opt/include/SDL
- /opt/include
+ /sw # Fink
+ /opt/local # DarwinPorts
+ /opt/csw # Blastwave
+ /opt
)
find_library(SDLTTF_LIBRARY
NAMES SDL_ttf
HINTS
- $ENV{SDLTTFDIR}
- $ENV{SDLDIR}
+ ENV SDLTTFDIR
+ ENV SDLDIR
PATHS
~/Library/Frameworks
/Library/Frameworks
@@ -61,7 +55,7 @@ find_library(SDLTTF_LIBRARY
/opt/local
/opt/csw
/opt
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib
)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake
index b44ba70..a032496 100644
--- a/Modules/FindSquish.cmake
+++ b/Modules/FindSquish.cmake
@@ -54,8 +54,9 @@ if(NOT SQUISH_INSTALL_DIR)
# Look for an installation
find_path(SQUISH_INSTALL_DIR bin/squishrunner
+ HINTS
# Look for an environment variable SQUISH_INSTALL_DIR.
- $ENV{SQUISH_INSTALL_DIR}
+ ENV SQUISH_INSTALL_DIR
# Look in places relative to the system executable search path.
${SQUISH_INSTALL_DIR_SEARCH}
diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake
index b60845d..fa090ff 100644
--- a/Modules/FindVTK.cmake
+++ b/Modules/FindVTK.cmake
@@ -90,7 +90,7 @@ if(_VTK_40_ALLOW AND NOT VTK_DIR)
find_path(VTK_DIR
NAMES UseVTK.cmake
PATH_SUFFIXES vtk-4.0 vtk
- HINTS $ENV{VTK_DIR}
+ HINTS ENV VTK_DIR
PATHS
diff --git a/Modules/FindX11.cmake b/Modules/FindX11.cmake
index 0b63bc9..e12dc0a 100644
--- a/Modules/FindX11.cmake
+++ b/Modules/FindX11.cmake
@@ -324,6 +324,11 @@ if (UNIX)
set(X11_SM_FOUND TRUE)
endif()
+ # Most of the X11 headers will be in the same directories, avoid
+ # creating a huge list of duplicates.
+ if (X11_INCLUDE_DIR)
+ list(REMOVE_DUPLICATES X11_INCLUDE_DIR)
+ endif ()
# Deprecated variable for backwards compatibility with CMake 1.4
if (X11_X11_INCLUDE_PATH AND X11_LIBRARIES)
diff --git a/Modules/Findosg_functions.cmake b/Modules/Findosg_functions.cmake
index 30c0876..2e90837 100644
--- a/Modules/Findosg_functions.cmake
+++ b/Modules/Findosg_functions.cmake
@@ -1,11 +1,12 @@
#
# This CMake file contains two macros to assist with searching for OSG
-# libraries and nodekits.
+# libraries and nodekits. Please see FindOpenSceneGraph.cmake for full
+# documentation.
#
#=============================================================================
# Copyright 2009 Kitware, Inc.
-# Copyright 2009 Philip Lowman <philip@yhbt.com>
+# Copyright 2009-2012 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@@ -26,10 +27,12 @@ function(OSG_FIND_PATH module header)
# Try the user's environment request before anything else.
find_path(${module_uc}_INCLUDE_DIR ${header}
HINTS
- $ENV{${module_uc}_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OSG_ROOT}
+ ENV ${module_uc}_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OSG_ROOT
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
PATH_SUFFIXES include
PATHS
/sw # Fink
@@ -50,11 +53,13 @@ function(OSG_FIND_LIBRARY module library)
find_library(${module_uc}_LIBRARY
NAMES ${library}
HINTS
- $ENV{${module_uc}_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OSG_ROOT}
- PATH_SUFFIXES lib64 lib
+ ENV ${module_uc}_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OSG_ROOT
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ PATH_SUFFIXES lib
PATHS
/sw # Fink
/opt/local # DarwinPorts
@@ -66,11 +71,13 @@ function(OSG_FIND_LIBRARY module library)
find_library(${module_uc}_LIBRARY_DEBUG
NAMES ${library}d
HINTS
- $ENV{${module_uc}_DIR}
- $ENV{OSG_DIR}
- $ENV{OSGDIR}
- $ENV{OSG_ROOT}
- PATH_SUFFIXES lib64 lib
+ ENV ${module_uc}_DIR
+ ENV OSG_DIR
+ ENV OSGDIR
+ ENV OSG_ROOT
+ ${${module_uc}_DIR}
+ ${OSG_DIR}
+ PATH_SUFFIXES lib
PATHS
/sw # Fink
/opt/local # DarwinPorts
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index c186eb5..218d476 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -421,12 +421,12 @@ if(wxWidgets_FIND_STYLE STREQUAL "win32")
find_path(wxWidgets_ROOT_DIR
NAMES include/wx/wx.h
PATHS
- $ENV{wxWidgets_ROOT_DIR}
- $ENV{WXWIN}
+ ENV wxWidgets_ROOT_DIR
+ ENV WXWIN
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" # WX 2.6.x
C:/
D:/
- $ENV{ProgramFiles}
+ ENV ProgramFiles
PATH_SUFFIXES
wxWidgets-2.9.4
wxWidgets-2.9.3
diff --git a/Modules/FindwxWindows.cmake b/Modules/FindwxWindows.cmake
index 06db751..5030bcc 100644
--- a/Modules/FindwxWindows.cmake
+++ b/Modules/FindwxWindows.cmake
@@ -106,18 +106,6 @@ if(WIN32_STYLE_FIND)
## fix the root dir to avoid mixing of headers/libs from different
## versions/builds:
- set (WXWINDOWS_POSSIBLE_ROOT_PATHS
- $ENV{WXWIN}
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" ## WX 2.6.x
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]" ## WX 2.4.x
- C:\\wxWidgets-2.6.2
- D:\\wxWidgets-2.6.2
- C:\\wxWidgets-2.6.1
- D:\\wxWidgets-2.6.1
- C:\\wxWindows-2.4.2
- D:\\wxWindows-2.4.2
- )
-
## WX supports monolithic and multiple smaller libs (since 2.5.x), we prefer monolithic for now.
## monolithic = WX is built as a single big library
## e.g. compile on WIN32 as "nmake -f makefile.vc MONOLITHIC=1 BUILD=debug SHARED=0 USE_OPENGL=1" (JW)
@@ -132,7 +120,18 @@ if(WIN32_STYLE_FIND)
## avoid mixing of headers and libs between multiple installed WX versions,
## select just one tree here:
find_path(WXWINDOWS_ROOT_DIR include/wx/wx.h
- ${WXWINDOWS_POSSIBLE_ROOT_PATHS} )
+ HINTS
+ ENV WXWIN
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWidgets_is1;Inno Setup: App Path]" ## WX 2.6.x
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\wxWindows_is1;Inno Setup: App Path]" ## WX 2.4.x
+ PATHS
+ C:/wxWidgets-2.6.2
+ D:/wxWidgets-2.6.2
+ C:/wxWidgets-2.6.1
+ D:/wxWidgets-2.6.1
+ C:/wxWindows-2.4.2
+ D:/wxWindows-2.4.2
+ )
# message("DBG found WXWINDOWS_ROOT_DIR: ${WXWINDOWS_ROOT_DIR}")
@@ -600,8 +599,10 @@ else()
# wx-config should be in your path anyhow, usually no need to set WXWIN or
# search in ../wx or ../../wx
find_program(CMAKE_WXWINDOWS_WXCONFIG_EXECUTABLE wx-config
- $ENV{WXWIN}
- $ENV{WXWIN}/bin
+ HINTS
+ ENV WXWIN
+ $ENV{WXWIN}/bin
+ PATHS
../wx/bin
../../wx/bin )
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index e51055f..8f2754e 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -168,6 +168,7 @@ function(is_file_executable file result_var)
if(UNIX)
if(NOT file_cmd)
find_program(file_cmd "file")
+ mark_as_advanced(file_cmd)
endif()
if(file_cmd)
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index 19b06d5..bd97501 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -312,13 +312,14 @@ if(MSVC)
set(__install__libs ${__install__libs}
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0chs.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0cht.dll"
- "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
- "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esp.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0deu.dll"
+ "${MSVC${v}_MFCLOC_DIR}/mfc${v}0enu.dll"
+ "${MSVC${v}_MFCLOC_DIR}/mfc${v}0esn.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0fra.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0ita.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0jpn.dll"
"${MSVC${v}_MFCLOC_DIR}/mfc${v}0kor.dll"
+ "${MSVC${v}_MFCLOC_DIR}/mfc${v}0rus.dll"
)
endmacro()
diff --git a/Modules/KDE3Macros.cmake b/Modules/KDE3Macros.cmake
index 6d6cdb0..07864f5 100644
--- a/Modules/KDE3Macros.cmake
+++ b/Modules/KDE3Macros.cmake
@@ -223,31 +223,30 @@ macro(KDE3_AUTOMOC)
if (EXISTS ${_abs_FILE} AND NOT _skip)
- file(READ ${_abs_FILE} _contents)
+ file(STRINGS ${_abs_FILE} _match REGEX "#include +[^ ]+\\.moc[\">]")
get_filename_component(_abs_PATH ${_abs_FILE} PATH)
- string(REGEX MATCHALL "#include +[^ ]+\\.moc[\">]" _match "${_contents}")
- if(_match)
- foreach (_current_MOC_INC ${_match})
- string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
+ foreach (_current_MOC_INC IN LISTS _match)
+ string(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}")
- get_filename_component(_basename ${_current_MOC} NAME_WE)
-# set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
- set(_header ${_abs_PATH}/${_basename}.h)
- set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
+ get_filename_component(_basename ${_current_MOC} NAME_WE)
+# set(_header ${CMAKE_CURRENT_SOURCE_DIR}/${_basename}.h)
+ set(_header ${_abs_PATH}/${_basename}.h)
+ set(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC})
- add_custom_command(OUTPUT ${_moc}
- COMMAND ${QT_MOC_EXECUTABLE}
- ARGS ${_header} -o ${_moc}
- DEPENDS ${_header}
- )
+ add_custom_command(OUTPUT ${_moc}
+ COMMAND ${QT_MOC_EXECUTABLE}
+ ARGS ${_header} -o ${_moc}
+ DEPENDS ${_header}
+ )
- ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
-
- endforeach ()
- endif()
+ ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc})
+ endforeach ()
+ unset(_match)
+ unset(_header)
+ unset(_moc)
endif ()
endforeach ()
endmacro()
diff --git a/Modules/ProcessorCount.cmake b/Modules/ProcessorCount.cmake
index eff4766..0d1dfda 100644
--- a/Modules/ProcessorCount.cmake
+++ b/Modules/ProcessorCount.cmake
@@ -57,6 +57,7 @@ function(ProcessorCount var)
# Mac, FreeBSD, OpenBSD (systems with sysctl):
find_program(ProcessorCount_cmd_sysctl sysctl
PATHS /usr/sbin /sbin)
+ mark_as_advanced(ProcessorCount_cmd_sysctl)
if(ProcessorCount_cmd_sysctl)
execute_process(COMMAND ${ProcessorCount_cmd_sysctl} -n hw.ncpu
ERROR_QUIET
@@ -69,6 +70,7 @@ function(ProcessorCount var)
if(NOT count)
# Linux (systems with getconf):
find_program(ProcessorCount_cmd_getconf getconf)
+ mark_as_advanced(ProcessorCount_cmd_getconf)
if(ProcessorCount_cmd_getconf)
execute_process(COMMAND ${ProcessorCount_cmd_getconf} _NPROCESSORS_ONLN
ERROR_QUIET
@@ -82,6 +84,7 @@ function(ProcessorCount var)
# HPUX (systems with machinfo):
find_program(ProcessorCount_cmd_machinfo machinfo
PATHS /usr/contrib/bin)
+ mark_as_advanced(ProcessorCount_cmd_machinfo)
if(ProcessorCount_cmd_machinfo)
execute_process(COMMAND ${ProcessorCount_cmd_machinfo}
ERROR_QUIET
@@ -97,6 +100,7 @@ function(ProcessorCount var)
# IRIX (systems with hinv):
find_program(ProcessorCount_cmd_hinv hinv
PATHS /sbin)
+ mark_as_advanced(ProcessorCount_cmd_hinv)
if(ProcessorCount_cmd_hinv)
execute_process(COMMAND ${ProcessorCount_cmd_hinv}
ERROR_QUIET
@@ -112,6 +116,7 @@ function(ProcessorCount var)
# AIX (systems with lsconf):
find_program(ProcessorCount_cmd_lsconf lsconf
PATHS /usr/sbin)
+ mark_as_advanced(ProcessorCount_cmd_lsconf)
if(ProcessorCount_cmd_lsconf)
execute_process(COMMAND ${ProcessorCount_cmd_lsconf}
ERROR_QUIET
@@ -126,6 +131,7 @@ function(ProcessorCount var)
if(NOT count)
# QNX (systems with pidin):
find_program(ProcessorCount_cmd_pidin pidin)
+ mark_as_advanced(ProcessorCount_cmd_pidin)
if(ProcessorCount_cmd_pidin)
execute_process(COMMAND ${ProcessorCount_cmd_pidin} info
ERROR_QUIET
@@ -140,6 +146,7 @@ function(ProcessorCount var)
if(NOT count)
# Sun (systems where uname -X emits "NumCPU" in its output):
find_program(ProcessorCount_cmd_uname uname)
+ mark_as_advanced(ProcessorCount_cmd_uname)
if(ProcessorCount_cmd_uname)
execute_process(COMMAND ${ProcessorCount_cmd_uname} -X
ERROR_QUIET
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 4324347..8e8680c 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -187,7 +187,7 @@ macro (QT4_ADD_RESOURCES outfiles )
if(EXISTS "${infile}")
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
- file(READ "${infile}" _RC_FILE_CONTENTS)
+ file(STRINGS "${infile}" _RC_FILE_CONTENTS REGEX "<file[^>]*>[^<]+")
string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
foreach(_RC_FILE ${_RC_FILES})
string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
@@ -196,6 +196,8 @@ macro (QT4_ADD_RESOURCES outfiles )
endif()
set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
endforeach()
+ unset(_RC_FILES)
+ unset(_RC_FILE_CONTENTS)
# Since this cmake macro is doing the dependency scanning for these files,
# let's make a configured file and add it as a dependency so cmake is run
# again when dependencies need to be recomputed.
@@ -439,3 +441,24 @@ macro(QT4_ADD_TRANSLATION _qm_files)
set(${_qm_files} ${${_qm_files}} ${qm})
endforeach ()
endmacro()
+
+function(qt4_use_modules _target _link_type)
+ if ("${_link_type}" STREQUAL "LINK_PUBLIC" OR "${_link_type}" STREQUAL "LINK_PRIVATE")
+ set(modules ${ARGN})
+ set(link_type ${_link_type})
+ else()
+ set(modules ${_link_type} ${ARGN})
+ endif()
+ foreach(_module ${modules})
+ string(TOUPPER ${_module} _ucmodule)
+ if (NOT QT_QT${_ucmodule}_FOUND)
+ message(FATAL_ERROR "Can not use \"${_module}\" module which has not yet been found.")
+ endif()
+ if ("${_ucmodule}" STREQUAL "MAIN")
+ message(FATAL_ERROR "Can not use \"${_module}\" module with qt4_use_modules.")
+ endif()
+ target_link_libraries(${_target} ${link_type} ${QT_QT${_ucmodule}_LIBRARY})
+ set_property(TARGET ${_target} APPEND PROPERTY INCLUDE_DIRECTORIES ${QT_QT${_ucmodule}_INCLUDE_DIR} ${QT_HEADERS_DIR} ${QT_MKSPECS_DIR}/default)
+ set_property(TARGET ${_target} APPEND PROPERTY COMPILE_DEFINITIONS ${QT_QT${_ucmodule}_COMPILE_DEFINITIONS})
+ endforeach()
+endfunction()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 9c00b4c..3bdb60c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 9)
-set(CMake_VERSION_TWEAK 20120815)
+set(CMake_VERSION_TWEAK 20120824)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackDocumentVariables.cxx b/Source/CPack/cmCPackDocumentVariables.cxx
index edbef45..7fa401c 100644
--- a/Source/CPack/cmCPackDocumentVariables.cxx
+++ b/Source/CPack/cmCPackDocumentVariables.cxx
@@ -45,17 +45,18 @@ void cmCPackDocumentVariables::DefineVariables(cmake* cm)
" packaging.", "DESTDIR means DESTination DIRectory."
" It is commonly used by makefile "
"users in order to install software at non-default location. It "
- "is a basic relocation mechanism. "
+ "is a basic relocation mechanism that should not be used on"
+ " Windows (see CMAKE_INSTALL_PREFIX documentation). "
"It is usually invoked like this:\n"
" make DESTDIR=/home/john install\n"
"which will install the concerned software using the"
- " installation prefix, e.g. \"/usr/local\" prepended with "
+ " installation prefix, e.g. \"/usr/local\" pre-pended with "
"the DESTDIR value which finally gives \"/home/john/usr/local\"."
" When preparing a package, CPack first installs the items to be "
"packaged in a local (to the build tree) directory by using the "
"same DESTDIR mechanism. Nevertheless, if "
"CPACK_SET_DESTDIR is set then CPack will set DESTDIR before"
- " doing the local install. The most noticeable difference is"
+ " doing the local install. The most noticeable difference is"
" that without CPACK_SET_DESTDIR, CPack uses "
"CPACK_PACKAGING_INSTALL_PREFIX as a prefix whereas with "
"CPACK_SET_DESTDIR set, CPack will use CMAKE_INSTALL_PREFIX as"
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 545fe97..166a584 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -98,7 +98,7 @@ bool cmDepends::Check(const char *makeFile, const char *internalFile,
// Check whether dependencies must be regenerated.
bool okay = true;
std::ifstream fin(internalFile);
- if(!(fin && this->CheckDependencies(fin, validDeps)))
+ if(!(fin && this->CheckDependencies(fin, internalFile, validDeps)))
{
// Clear all dependencies so they will be regenerated.
this->Clear(makeFile);
@@ -143,6 +143,7 @@ bool cmDepends::WriteDependencies(const char*, const char*,
//----------------------------------------------------------------------------
bool cmDepends::CheckDependencies(std::istream& internalDepends,
+ const char* internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps)
{
// Parse dependencies from the stream. If any dependee is missing
@@ -186,8 +187,11 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
}
*/
- // Dependencies must be regenerated if the dependee does not exist
- // or if the depender exists and is older than the dependee.
+ // Dependencies must be regenerated
+ // * if the dependee does not exist
+ // * if the depender exists and is older than the dependee.
+ // * if the depender does not exist, but the dependee is newer than the
+ // depends file
bool regenerate = false;
const char* dependee = this->Dependee+1;
const char* depender = this->Depender;
@@ -211,24 +215,49 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
cmSystemTools::Stdout(msg.str().c_str());
}
}
- else if(dependerExists)
+ else
{
- // The dependee and depender both exist. Compare file times.
- int result = 0;
- if((!this->FileComparison->FileTimeCompare(depender, dependee,
- &result) || result < 0))
+ if(dependerExists)
{
- // The depender is older than the dependee.
- regenerate = true;
+ // The dependee and depender both exist. Compare file times.
+ int result = 0;
+ if((!this->FileComparison->FileTimeCompare(depender, dependee,
+ &result) || result < 0))
+ {
+ // The depender is older than the dependee.
+ regenerate = true;
- // Print verbose output.
- if(this->Verbose)
+ // Print verbose output.
+ if(this->Verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << dependee
+ << "\" is newer than depender \""
+ << depender << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
+ }
+ }
+ else
+ {
+ // The dependee exists, but the depender doesn't. Regenerate if the
+ // internalDepends file is older than the dependee.
+ int result = 0;
+ if((!this->FileComparison->FileTimeCompare(internalDependsFileName,
+ dependee, &result) || result < 0))
{
- cmOStringStream msg;
- msg << "Dependee \"" << dependee
- << "\" is newer than depender \""
- << depender << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ // The depends-file is older than the dependee.
+ regenerate = true;
+
+ // Print verbose output.
+ if(this->Verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << dependee
+ << "\" is newer than depends file \""
+ << internalDependsFileName << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
}
}
}
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 100e187..f7dc881 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -83,6 +83,7 @@ protected:
// Return false if dependencies must be regenerated and true
// otherwise.
virtual bool CheckDependencies(std::istream& internalDepends,
+ const char* internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps);
// Finalize the dependency information for the target.
diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx
index 1d84914..ba0e8fb 100644
--- a/Source/cmDependsJava.cxx
+++ b/Source/cmDependsJava.cxx
@@ -38,7 +38,7 @@ bool cmDependsJava::WriteDependencies(const char *src, const char *,
return true;
}
-bool cmDependsJava::CheckDependencies(std::istream&,
+bool cmDependsJava::CheckDependencies(std::istream&, const char*,
std::map<std::string, DependencyVector >&)
{
return true;
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index fe6fef5..bf7e234 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -32,7 +32,8 @@ protected:
virtual bool WriteDependencies(const char *src, const char *file,
std::ostream& makeDepends, std::ostream& internalDepends);
virtual bool CheckDependencies(std::istream& internalDepends,
- std::map<std::string, DependencyVector >& validDeps);
+ const char* internalDependsFileName,
+ std::map<std::string, DependencyVector>& validDeps);
private:
cmDependsJava(cmDependsJava const&); // Purposely not implemented.
diff --git a/Source/cmDocumentGeneratorExpressions.h b/Source/cmDocumentGeneratorExpressions.h
index 5359013..74c673a 100644
--- a/Source/cmDocumentGeneratorExpressions.h
+++ b/Source/cmDocumentGeneratorExpressions.h
@@ -16,6 +16,9 @@
"Generator expressions are evaluted during build system generation " \
"to produce information specific to each build configuration. " \
"Valid expressions are:\n" \
+ " $<0:...> = empty string (ignores \"...\")\n" \
+ " $<1:...> = content of \"...\"\n" \
+ " $<CONFIG:cfg> = '1' if config is \"cfg\", else '0'\n" \
" $<CONFIGURATION> = configuration name\n" \
" $<TARGET_FILE:tgt> = main file (.exe, .so.1.2, .a)\n" \
" $<TARGET_LINKER_FILE:tgt> = file used to link (.a, .lib, .so)\n" \
@@ -25,6 +28,12 @@
"versions can produce the directory and file name components:\n" \
" $<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"
+ " $<TARGET_SONAME_FILE_DIR:tgt>/$<TARGET_SONAME_FILE_NAME:tgt>\n" \
+ "Boolean expressions:\n" \
+ " $<AND:?[,?]...> = '1' if all '?' are '1', else '0'\n" \
+ " $<OR:?[,?]...> = '0' if all '?' are '0', else '1'\n" \
+ " $<NOT:?> = '0' if '?' is '1', else '1'\n" \
+ "where '?' is always either '0' or '1'.\n" \
+ ""
#endif
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index ade35e6..3e398ec 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -605,7 +605,21 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"If \"make install\" is invoked or INSTALL is built"
", this directory is pre-pended onto all install "
"directories. This variable defaults to /usr/local"
- " on UNIX and c:/Program Files on Windows.",false,
+ " on UNIX and c:/Program Files on Windows.\n"
+ "On UNIX one can use the DESTDIR mechanism in order"
+ " to relocate the whole installation. "
+ "DESTDIR means DESTination DIRectory. It is "
+ "commonly used by makefile users "
+ "in order to install software at non-default location. "
+ "It is usually invoked like this:\n"
+ " make DESTDIR=/home/john install\n"
+ "which will install the concerned software using the"
+ " installation prefix, e.g. \"/usr/local\" pre-pended with "
+ "the DESTDIR value which finally gives \"/home/john/usr/local\".\n"
+ "WARNING: DESTDIR may not be used on Windows because installation"
+ " prefix usually contains a drive letter like in \"C:/Program Files\""
+ " which cannot be pre-pended with some other prefix."
+ ,false,
"Variables That Change Behavior");
cm->DefineProperty
@@ -837,9 +851,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Tell cmake to use MFC for an executable or dll.",
"This can be set in a CMakeLists.txt file and will "
"enable MFC in the application. It should be set "
- "to 1 for static the static MFC library, and 2 for "
- "the shared MFC library. This is used in visual "
- "studio 6 and 7 project files. The CMakeSetup "
+ "to 1 for the static MFC library, and 2 for "
+ "the shared MFC library. This is used in Visual "
+ "Studio 6 and 7 project files. The CMakeSetup "
"dialog used MFC and the CMakeLists.txt looks like this:\n"
" add_definitions(-D_AFXDLL)\n"
" set(CMAKE_MFC_FLAG 2)\n"
@@ -1361,7 +1375,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
false,
"Variables that Control the Build");
cm->DefineProperty
- ("CMAKE_POSITION_INDEPENDENT_FLAGS", cmProperty::VARIABLE,
+ ("CMAKE_POSITION_INDEPENDENT_CODE", cmProperty::VARIABLE,
"Default value for POSITION_INDEPENDENT_CODE of targets.",
"This variable is used to initialize the "
"POSITION_INDEPENDENT_CODE property on all the targets. "
diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx
index 5c7d400..1f976f7 100644
--- a/Source/cmExtraEclipseCDT4Generator.cxx
+++ b/Source/cmExtraEclipseCDT4Generator.cxx
@@ -462,18 +462,6 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
this->CreateLinksForTargets(fout);
}
- // I'm not sure this makes too much sense. There can be different
- // output directories in different subdirs, so we would need more of them.
-
- // for EXECUTABLE_OUTPUT_PATH when not in binary dir
- this->AppendOutLinkedResource(fout,
- mf->GetSafeDefinition("CMAKE_RUNTIME_OUTPUT_DIRECTORY"),
- mf->GetSafeDefinition("EXECUTABLE_OUTPUT_PATH"));
- // for LIBRARY_OUTPUT_PATH when not in binary dir
- this->AppendOutLinkedResource(fout,
- mf->GetSafeDefinition("CMAKE_LIBRARY_OUTPUT_DIRECTORY"),
- mf->GetSafeDefinition("LIBRARY_OUTPUT_PATH"));
-
fout << "\t</linkedResources>\n";
fout << "</projectDescription>\n";
@@ -610,6 +598,16 @@ void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
if (!inc->empty())
{
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str());
+
+ // handle framework include dirs on OSX, the remainder after the
+ // Frameworks/ part has to be stripped
+ // /System/Library/Frameworks/GLUT.framework/Headers
+ cmsys::RegularExpression frameworkRx("(.+/Frameworks)/.+\\.framework/");
+ if(frameworkRx.find(dir.c_str()))
+ {
+ dir = frameworkRx.match(1);
+ }
+
if(emittedDirs.find(dir) == emittedDirs.end())
{
emittedDirs.insert(dir);
@@ -761,18 +759,6 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
excludeFromOut += "**/CMakeFiles/";
fout << "<pathentry excluding=\"" << excludeFromOut
<< "\" kind=\"out\" path=\"\"/>\n";
- // add output entry for EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH
- // - if it is a subdir of homeOutputDirectory, there is no need to add it
- // - if it is not then create a linked resource and add the linked name
- // but check it doesn't conflict with other linked resources names
- for (std::vector<std::string>::const_iterator
- it = this->OutLinkedResources.begin();
- it != this->OutLinkedResources.end();
- ++it)
- {
- fout << "<pathentry kind=\"out\" path=\"" << this->EscapeForXML(*it)
- << "\"/>\n";
- }
// add pre-processor definitions to allow eclipse to gray out sections
emmited.clear();
@@ -1317,65 +1303,3 @@ void cmExtraEclipseCDT4Generator
"\t\t</link>\n"
;
}
-
-bool cmExtraEclipseCDT4Generator
-::AppendOutLinkedResource(cmGeneratedFileStream& fout,
- const std::string& defname,
- const std::string& altdefname)
-{
- if (defname.empty() && altdefname.empty())
- {
- return false;
- }
-
- std::string outputPath = (defname.empty() ? altdefname : defname);
-
- if (!cmSystemTools::FileIsFullPath(outputPath.c_str()))
- {
- outputPath = this->HomeOutputDirectory + "/" + outputPath;
- }
-
- // in this case it's not necessary:
- if (cmSystemTools::IsSubDirectory(outputPath.c_str(),
- this->HomeOutputDirectory.c_str()))
- {
- return false;
- }
-
- // in these two cases Eclipse would complain:
- if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(),
- outputPath.c_str()))
- {
- return false;
- }
- if (cmSystemTools::GetRealPath(outputPath.c_str())
- == cmSystemTools::GetRealPath(this->HomeOutputDirectory.c_str()))
- {
- return false;
- }
-
- std::string name = this->GetPathBasename(outputPath);
-
- // make sure linked resource name is unique
- while (this->GlobalGenerator->GetProjectMap().find(name)
- != this->GlobalGenerator->GetProjectMap().end())
- {
- name += "_";
- }
-
- if (std::find(this->OutLinkedResources.begin(),
- this->OutLinkedResources.end(),
- name)
- != this->OutLinkedResources.end())
- {
- return false;
- }
- else
- {
- this->AppendLinkedResource(fout, name,
- this->GetEclipsePath(outputPath), LinkToFolder);
- this->OutLinkedResources.push_back(name);
- return true;
- }
-}
-
diff --git a/Source/cmExtraEclipseCDT4Generator.h b/Source/cmExtraEclipseCDT4Generator.h
index ebd8c08..37ce65e 100644
--- a/Source/cmExtraEclipseCDT4Generator.h
+++ b/Source/cmExtraEclipseCDT4Generator.h
@@ -93,10 +93,6 @@ private:
const std::string& path,
LinkType linkType);
- bool AppendOutLinkedResource(cmGeneratedFileStream& fout,
- const std::string& defname,
- const std::string& altdefname);
-
static void AppendIncludeDirectories(cmGeneratedFileStream& fout,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs);
@@ -109,7 +105,6 @@ private:
void CreateLinksForTargets(cmGeneratedFileStream& fout);
std::vector<std::string> SrcLinkedResources;
- std::vector<std::string> OutLinkedResources;
std::string HomeDirectory;
std::string HomeOutputDirectory;
bool IsOutOfSourceBuild;
diff --git a/Source/cmGeneratorExpression.cxx b/Source/cmGeneratorExpression.cxx
index f88ab0b..92bbf1d 100644
--- a/Source/cmGeneratorExpression.cxx
+++ b/Source/cmGeneratorExpression.cxx
@@ -14,6 +14,8 @@
#include "cmMakefile.h"
#include "cmTarget.h"
+#include <cmsys/String.h>
+
//----------------------------------------------------------------------------
cmGeneratorExpression::cmGeneratorExpression(
cmMakefile* mf, const char* config,
@@ -25,6 +27,7 @@ cmGeneratorExpression::cmGeneratorExpression(
"_FILE(|_NAME|_DIR):" // Filename component.
"([A-Za-z0-9_.-]+)" // Target name.
">$");
+ this->TestConfig.compile("^\\$<CONFIG:([A-Za-z0-9_]*)>$");
}
//----------------------------------------------------------------------------
@@ -103,6 +106,26 @@ bool cmGeneratorExpression::Evaluate()
}
//----------------------------------------------------------------------------
+static bool cmGeneratorExpressionBool(const char* c, std::string& result,
+ const char* name,
+ const char* a, const char* b)
+{
+ result = a;
+ while((c[0] == '0' || c[0] == '1') && (c[1] == ',' || c[1] == '>'))
+ {
+ if(c[0] == b[0]) { result = b; }
+ c += 2;
+ }
+ if(c[0])
+ {
+ result = name;
+ result += " requires one or more comma-separated '0' or '1' values.";
+ return false;
+ }
+ return true;
+}
+
+//----------------------------------------------------------------------------
bool cmGeneratorExpression::Evaluate(const char* expr, std::string& result)
{
if(this->TargetInfo.find(expr))
@@ -116,6 +139,38 @@ bool cmGeneratorExpression::Evaluate(const char* expr, std::string& result)
{
result = this->Config? this->Config : "";
}
+ else if(strncmp(expr, "$<0:",4) == 0)
+ {
+ result = "";
+ }
+ else if(strncmp(expr, "$<1:",4) == 0)
+ {
+ result = std::string(expr+4, strlen(expr)-5);
+ }
+ else if(strncmp(expr, "$<NOT:",6) == 0)
+ {
+ const char* c = expr+6;
+ if((c[0] != '0' && c[0] != '1') || c[1] != '>' || c[2])
+ {
+ result = "NOT requires exactly one '0' or '1' value.";
+ return false;
+ }
+ result = c[0] == '1'? "0" : "1";
+ }
+ else if(strncmp(expr, "$<AND:",6) == 0)
+ {
+ return cmGeneratorExpressionBool(expr+6, result, "AND", "1", "0");
+ }
+ else if(strncmp(expr, "$<OR:",5) == 0)
+ {
+ return cmGeneratorExpressionBool(expr+5, result, "OR", "0", "1");
+ }
+ else if(this->TestConfig.find(expr))
+ {
+ result = cmsysString_strcasecmp(this->TestConfig.match(1).c_str(),
+ this->Config? this->Config:"") == 0
+ ? "1":"0";
+ }
else
{
result = "Expression syntax not recognized.";
diff --git a/Source/cmGeneratorExpression.h b/Source/cmGeneratorExpression.h
index 1a9d4c6..a023eb0 100644
--- a/Source/cmGeneratorExpression.h
+++ b/Source/cmGeneratorExpression.h
@@ -51,6 +51,7 @@ private:
std::vector<char> Data;
std::stack<size_t> Barriers;
cmsys::RegularExpression TargetInfo;
+ cmsys::RegularExpression TestConfig;
std::set<cmTarget*> Targets;
bool Evaluate();
bool Evaluate(const char* expr, std::string& result);
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index ae92a0a..e8ab38f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -787,6 +787,10 @@ GetSourcecodeValueFromFileExtension(const std::string& _ext,
{
sourcecode += ".fortran.f90";
}
+ else if(lang == "ASM")
+ {
+ sourcecode += ".asm";
+ }
//else
// {
// // Already specialized above or we leave sourcecode == "sourcecode"
diff --git a/Source/cmIfCommand.h b/Source/cmIfCommand.h
index 4893a17..0a1fe06 100644
--- a/Source/cmIfCommand.h
+++ b/Source/cmIfCommand.h
@@ -149,7 +149,12 @@ public:
" if(file1 IS_NEWER_THAN file2)\n"
"True if file1 is newer than file2 or if one of the two files "
"doesn't exist. "
- "Behavior is well-defined only for full paths.\n"
+ "Behavior is well-defined only for full paths. "
+ "If the file time stamps are exactly the same, an "
+ "IS_NEWER_THAN comparison returns true, so that any dependent "
+ "build operations will occur in the event of a tie. "
+ "This includes the case of passing the same file name for both "
+ "file1 and file2.\n"
" if(IS_DIRECTORY directory-name)\n"
"True if the given name is a directory. "
"Behavior is well-defined only for full paths.\n"
diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h
index 76e622e..7c06009 100644
--- a/Source/cmInstallCommand.h
+++ b/Source/cmInstallCommand.h
@@ -70,7 +70,9 @@ public:
"the directory on disk to which a file will be installed. "
"If a full path (with a leading slash or drive letter) is given it "
"is used directly. If a relative path is given it is interpreted "
- "relative to the value of CMAKE_INSTALL_PREFIX.\n"
+ "relative to the value of CMAKE_INSTALL_PREFIX. The prefix can "
+ "be relocated at install time using DESTDIR mechanism explained in the "
+ "CMAKE_INSTALL_PREFIX variable documentation.\n"
"PERMISSIONS arguments specify permissions for installed files. "
"Valid permissions are "
"OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, "
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx
index 9d4f175..7848424 100644
--- a/Source/cmListCommand.cxx
+++ b/Source/cmListCommand.cxx
@@ -429,6 +429,12 @@ bool cmListCommand
this->SetError("sub-command REVERSE requires a list as an argument.");
return false;
}
+ else if(args.size() > 2)
+ {
+ this->SetError(
+ "sub-command REVERSE only takes one argument.");
+ return false;
+ }
const std::string& listName = args[1];
// expand the variable
@@ -463,6 +469,12 @@ bool cmListCommand
"sub-command REMOVE_DUPLICATES requires a list as an argument.");
return false;
}
+ else if(args.size() > 2)
+ {
+ this->SetError(
+ "sub-command REMOVE_DUPLICATES only takes one argument.");
+ return false;
+ }
const std::string& listName = args[1];
// expand the variable
@@ -506,6 +518,12 @@ bool cmListCommand
this->SetError("sub-command SORT requires a list as an argument.");
return false;
}
+ else if(args.size() > 2)
+ {
+ this->SetError(
+ "sub-command SORT only takes one argument.");
+ return false;
+ }
const std::string& listName = args[1];
// expand the variable
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 0cfb36b..cf2af0a 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2101,9 +2101,8 @@ void cmLocalGenerator::AppendFlags(std::string& flags,
}
//----------------------------------------------------------------------------
-void cmLocalGenerator::AppendDefines(std::string& defines,
- const char* defines_list,
- const char* lang)
+void cmLocalGenerator::AppendDefines(std::set<std::string>& defines,
+ const char* defines_list)
{
// Short-circuit if there are no definitions.
if(!defines_list)
@@ -2115,12 +2114,23 @@ void cmLocalGenerator::AppendDefines(std::string& defines,
std::vector<std::string> defines_vec;
cmSystemTools::ExpandListArgument(defines_list, defines_vec);
- // Short-circuit if there are no definitions.
- if(defines_vec.empty())
+ for(std::vector<std::string>::const_iterator di = defines_vec.begin();
+ di != defines_vec.end(); ++di)
{
- return;
+ // Skip unsupported definitions.
+ if(!this->CheckDefinition(*di))
+ {
+ continue;
+ }
+ defines.insert(*di);
}
+}
+//----------------------------------------------------------------------------
+void cmLocalGenerator::JoinDefines(const std::set<std::string>& defines,
+ std::string &definesString,
+ const char* lang)
+{
// Lookup the define flag for the current language.
std::string dflag = "-D";
if(lang)
@@ -2135,23 +2145,13 @@ void cmLocalGenerator::AppendDefines(std::string& defines,
}
}
- // Add each definition to the command line with appropriate escapes.
- const char* dsep = defines.empty()? "" : " ";
- for(std::vector<std::string>::const_iterator di = defines_vec.begin();
- di != defines_vec.end(); ++di)
+ std::set<std::string>::const_iterator defineIt = defines.begin();
+ const std::set<std::string>::const_iterator defineEnd = defines.end();
+ const char* itemSeparator = definesString.empty() ? "" : " ";
+ for( ; defineIt != defineEnd; ++defineIt)
{
- // Skip unsupported definitions.
- if(!this->CheckDefinition(*di))
- {
- continue;
- }
-
- // Separate from previous definitions.
- defines += dsep;
- dsep = " ";
-
// Append the definition with proper escaping.
- defines += dflag;
+ std::string def = dflag;
if(this->WatcomWMake)
{
// The Watcom compiler does its own command line parsing instead
@@ -2164,27 +2164,30 @@ void cmLocalGenerator::AppendDefines(std::string& defines,
// command line without any escapes. However we still have to
// get the '$' and '#' characters through WMake as '$$' and
// '$#'.
- for(const char* c = di->c_str(); *c; ++c)
+ for(const char* c = defineIt->c_str(); *c; ++c)
{
if(*c == '$' || *c == '#')
{
- defines += '$';
+ def += '$';
}
- defines += *c;
+ def += *c;
}
}
else
{
// Make the definition appear properly on the command line. Use
// -DNAME="value" instead of -D"NAME=value" to help VS6 parser.
- std::string::size_type eq = di->find("=");
- defines += di->substr(0, eq);
- if(eq != di->npos)
+ std::string::size_type eq = defineIt->find("=");
+ def += defineIt->substr(0, eq);
+ if(eq != defineIt->npos)
{
- defines += "=";
- defines += this->EscapeForShell(di->c_str() + eq + 1, true);
+ def += "=";
+ def += this->EscapeForShell(defineIt->c_str() + eq + 1, true);
}
}
+ definesString += itemSeparator;
+ itemSeparator = " ";
+ definesString += def;
}
}
diff --git a/Source/cmLocalGenerator.h b/Source/cmLocalGenerator.h
index 39b493f..b3396e3 100644
--- a/Source/cmLocalGenerator.h
+++ b/Source/cmLocalGenerator.h
@@ -154,8 +154,14 @@ public:
* Encode a list of preprocessor definitions for the compiler
* command line.
*/
- void AppendDefines(std::string& defines, const char* defines_list,
- const char* lang);
+ void AppendDefines(std::set<std::string>& defines,
+ const char* defines_list);
+ /**
+ * Join a set of defines into a definesString with a space separator.
+ */
+ void JoinDefines(const std::set<std::string>& defines,
+ std::string &definesString,
+ const char* lang);
/** Lookup and append options associated with a particular feature. */
void AppendFeatureOptions(std::string& flags, const char* lang,
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 1a7e611..9f2a863 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -418,25 +418,42 @@ void cmLocalVisualStudio6Generator
// Add per-source and per-configuration preprocessor definitions.
std::map<cmStdString, cmStdString> cdmap;
- this->AppendDefines(compileFlags,
- (*sf)->GetProperty("COMPILE_DEFINITIONS"), lang);
+
+ {
+ std::set<std::string> targetCompileDefinitions;
+
+ this->AppendDefines(targetCompileDefinitions,
+ (*sf)->GetProperty("COMPILE_DEFINITIONS"));
+ this->JoinDefines(targetCompileDefinitions, compileFlags, lang);
+ }
+
if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_DEBUG"))
{
- this->AppendDefines(cdmap["DEBUG"], cdefs, lang);
+ std::set<std::string> debugCompileDefinitions;
+ this->AppendDefines(debugCompileDefinitions, cdefs);
+ this->JoinDefines(debugCompileDefinitions, cdmap["DEBUG"], lang);
}
if(const char* cdefs = (*sf)->GetProperty("COMPILE_DEFINITIONS_RELEASE"))
{
- this->AppendDefines(cdmap["RELEASE"], cdefs, lang);
+ std::set<std::string> releaseCompileDefinitions;
+ this->AppendDefines(releaseCompileDefinitions, cdefs);
+ this->JoinDefines(releaseCompileDefinitions, cdmap["RELEASE"], lang);
}
if(const char* cdefs =
(*sf)->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"))
{
- this->AppendDefines(cdmap["MINSIZEREL"], cdefs, lang);
+ std::set<std::string> minsizerelCompileDefinitions;
+ this->AppendDefines(minsizerelCompileDefinitions, cdefs);
+ this->JoinDefines(minsizerelCompileDefinitions, cdmap["MINSIZEREL"],
+ lang);
}
if(const char* cdefs =
(*sf)->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"))
{
- this->AppendDefines(cdmap["RELWITHDEBINFO"], cdefs, lang);
+ std::set<std::string> relwithdebinfoCompileDefinitions;
+ this->AppendDefines(relwithdebinfoCompileDefinitions, cdefs);
+ this->JoinDefines(relwithdebinfoCompileDefinitions,
+ cdmap["RELWITHDEBINFO"], lang);
}
bool excludedFromBuild =
@@ -1653,43 +1670,56 @@ void cmLocalVisualStudio6Generator
}
// Add per-target and per-configuration preprocessor definitions.
- std::string defines = " ";
- std::string debugDefines = " ";
- std::string releaseDefines = " ";
- std::string minsizeDefines = " ";
- std::string debugrelDefines = " ";
+ std::set<std::string> definesSet;
+ std::set<std::string> debugDefinesSet;
+ std::set<std::string> releaseDefinesSet;
+ std::set<std::string> minsizeDefinesSet;
+ std::set<std::string> debugrelDefinesSet;
this->AppendDefines(
- defines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS"), 0);
+ definesSet,
+ this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
this->AppendDefines(
- debugDefines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_DEBUG"),0);
+ debugDefinesSet,
+ this->Makefile->GetProperty("COMPILE_DEFINITIONS_DEBUG"));
this->AppendDefines(
- releaseDefines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_RELEASE"), 0);
+ releaseDefinesSet,
+ this->Makefile->GetProperty("COMPILE_DEFINITIONS_RELEASE"));
this->AppendDefines(
- minsizeDefines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"), 0);
+ minsizeDefinesSet,
+ this->Makefile->GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"));
this->AppendDefines(
- debugrelDefines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"), 0);
+ debugrelDefinesSet,
+ this->Makefile->GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"));
this->AppendDefines(
- defines,
- target.GetProperty("COMPILE_DEFINITIONS"), 0);
+ definesSet,
+ target.GetProperty("COMPILE_DEFINITIONS"));
this->AppendDefines(
- debugDefines,
- target.GetProperty("COMPILE_DEFINITIONS_DEBUG"), 0);
+ debugDefinesSet,
+ target.GetProperty("COMPILE_DEFINITIONS_DEBUG"));
this->AppendDefines(
- releaseDefines,
- target.GetProperty("COMPILE_DEFINITIONS_RELEASE"), 0);
+ releaseDefinesSet,
+ target.GetProperty("COMPILE_DEFINITIONS_RELEASE"));
this->AppendDefines(
- minsizeDefines,
- target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"), 0);
+ minsizeDefinesSet,
+ target.GetProperty("COMPILE_DEFINITIONS_MINSIZEREL"));
this->AppendDefines(
- debugrelDefines,
- target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"), 0);
+ debugrelDefinesSet,
+ target.GetProperty("COMPILE_DEFINITIONS_RELWITHDEBINFO"));
+
+ std::string defines = " ";
+ std::string debugDefines = " ";
+ std::string releaseDefines = " ";
+ std::string minsizeDefines = " ";
+ std::string debugrelDefines = " ";
+
+ this->JoinDefines(definesSet, defines, 0);
+ this->JoinDefines(debugDefinesSet, debugDefines, 0);
+ this->JoinDefines(releaseDefinesSet, releaseDefines, 0);
+ this->JoinDefines(minsizeDefinesSet, minsizeDefines, 0);
+ this->JoinDefines(debugrelDefinesSet, debugrelDefines, 0);
+
flags += defines;
flagsDebug += debugDefines;
flagsRelease += releaseDefines;
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index 0de182e..95738c4 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -292,28 +292,31 @@ std::string cmMakefileTargetGenerator::GetDefines(const std::string &l)
ByLanguageMap::iterator i = this->DefinesByLanguage.find(l);
if (i == this->DefinesByLanguage.end())
{
- std::string defines;
+ std::set<std::string> defines;
const char *lang = l.c_str();
// Add the export symbol definition for shared library objects.
if(const char* exportMacro = this->Target->GetExportMacro())
{
- this->LocalGenerator->AppendDefines(defines, exportMacro, lang);
+ this->LocalGenerator->AppendDefines(defines, exportMacro);
}
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines
- (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"), lang);
+ (defines, this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
this->LocalGenerator->AppendDefines
- (defines, this->Target->GetProperty("COMPILE_DEFINITIONS"), lang);
+ (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()), lang);
+ (defines, this->Makefile->GetProperty(defPropName.c_str()));
this->LocalGenerator->AppendDefines
- (defines, this->Target->GetProperty(defPropName.c_str()), lang);
+ (defines, this->Target->GetProperty(defPropName.c_str()));
- ByLanguageMap::value_type entry(l, defines);
+ std::string definesString;
+ this->LocalGenerator->JoinDefines(defines, definesString, lang);
+
+ ByLanguageMap::value_type entry(l, definesString);
i = this->DefinesByLanguage.insert(entry).first;
}
return i->second;
@@ -587,14 +590,12 @@ cmMakefileTargetGenerator
}
// Add language-specific defines.
- std::string defines = "$(";
- defines += lang;
- defines += "_DEFINES)";
+ std::set<std::string> defines;
// Add source-sepcific preprocessor definitions.
if(const char* compile_defs = source.GetProperty("COMPILE_DEFINITIONS"))
{
- this->LocalGenerator->AppendDefines(defines, compile_defs, lang);
+ this->LocalGenerator->AppendDefines(defines, compile_defs);
*this->FlagFileStream << "# Custom defines: "
<< relativeObj << "_DEFINES = "
<< compile_defs << "\n"
@@ -607,7 +608,7 @@ cmMakefileTargetGenerator
if(const char* config_compile_defs =
source.GetProperty(defPropName.c_str()))
{
- this->LocalGenerator->AppendDefines(defines, config_compile_defs, lang);
+ this->LocalGenerator->AppendDefines(defines, config_compile_defs);
*this->FlagFileStream
<< "# Custom defines: "
<< relativeObj << "_DEFINES_" << configUpper
@@ -676,7 +677,14 @@ cmMakefileTargetGenerator
cmLocalGenerator::SHELL);
vars.ObjectDir = objectDir.c_str();
vars.Flags = flags.c_str();
- vars.Defines = defines.c_str();
+
+ std::string definesString = "$(";
+ definesString += lang;
+ definesString += "_DEFINES)";
+
+ this->LocalGenerator->JoinDefines(defines, definesString, lang);
+
+ vars.Defines = definesString.c_str();
bool lang_is_c_or_cxx = ((strcmp(lang, "C") == 0) ||
(strcmp(lang, "CXX") == 0));
diff --git a/Source/cmNinjaNormalTargetGenerator.cxx b/Source/cmNinjaNormalTargetGenerator.cxx
index a923d60..9dc860e 100644
--- a/Source/cmNinjaNormalTargetGenerator.cxx
+++ b/Source/cmNinjaNormalTargetGenerator.cxx
@@ -459,25 +459,16 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
}
}
- std::string path;
if (!this->TargetNameImport.empty()) {
- path = this->GetLocalGenerator()->ConvertToOutputFormat(
- targetOutputImplib.c_str(), cmLocalGenerator::SHELL);
- vars["TARGET_IMPLIB"] = path;
- EnsureParentDirectoryExists(path);
+ const std::string impLibPath = this->GetLocalGenerator()
+ ->ConvertToOutputFormat(targetOutputImplib.c_str(),
+ cmLocalGenerator::SHELL);
+ vars["TARGET_IMPLIB"] = impLibPath;
+ EnsureParentDirectoryExists(impLibPath);
}
cmMakefile* mf = this->GetMakefile();
- if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
- mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
- {
- path = this->GetTargetPDB();
- vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- ConvertToNinjaPath(path.c_str()).c_str(),
- cmLocalGenerator::SHELL);
- EnsureParentDirectoryExists(path);
- }
- else
+ if (!this->SetMsvcTargetPdbVariable(vars))
{
// It is common to place debug symbols at a specific place,
// so we need a plain target name in the rule available.
@@ -494,9 +485,9 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
if (mf->IsOn("CMAKE_COMPILER_IS_MINGW"))
{
- path = GetTarget()->GetSupportDirectory();
- vars["OBJECT_DIR"] = ConvertToNinjaPath(path.c_str());
- EnsureDirectoryExists(path);
+ const std::string objPath = GetTarget()->GetSupportDirectory();
+ vars["OBJECT_DIR"] = ConvertToNinjaPath(objPath.c_str());
+ EnsureDirectoryExists(objPath);
// ar.exe can't handle backslashes in rsp files (implictly used by gcc)
std::string& linkLibraries = vars["LINK_LIBRARIES"];
std::replace(linkLibraries.begin(), linkLibraries.end(), '\\', '/');
@@ -527,10 +518,10 @@ void cmNinjaNormalTargetGenerator::WriteLinkStatement()
// If we have any PRE_LINK commands, we need to go back to HOME_OUTPUT for
// the link commands.
if (!preLinkCmdLines.empty()) {
- path = this->GetLocalGenerator()->ConvertToOutputFormat(
- this->GetMakefile()->GetHomeOutputDirectory(),
- cmLocalGenerator::SHELL);
- preLinkCmdLines.push_back("cd " + path);
+ const std::string homeOutDir = this->GetLocalGenerator()
+ ->ConvertToOutputFormat(this->GetMakefile()->GetHomeOutputDirectory(),
+ cmLocalGenerator::SHELL);
+ preLinkCmdLines.push_back("cd " + homeOutDir);
}
vars["PRE_LINK"] =
diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx
index 3532c8b..918f582 100644
--- a/Source/cmNinjaTargetGenerator.cxx
+++ b/Source/cmNinjaTargetGenerator.cxx
@@ -184,46 +184,43 @@ std::string
cmNinjaTargetGenerator::
ComputeDefines(cmSourceFile *source, const std::string& language)
{
- std::string defines;
+ std::set<std::string> defines;
// Add the export symbol definition for shared library objects.
if(const char* exportMacro = this->Target->GetExportMacro())
{
- this->LocalGenerator->AppendDefines(defines, exportMacro,
- language.c_str());
+ this->LocalGenerator->AppendDefines(defines, exportMacro);
}
// Add preprocessor definitions for this target and configuration.
this->LocalGenerator->AppendDefines
(defines,
- this->Makefile->GetProperty("COMPILE_DEFINITIONS"),
- language.c_str());
+ this->Makefile->GetProperty("COMPILE_DEFINITIONS"));
this->LocalGenerator->AppendDefines
(defines,
- this->Target->GetProperty("COMPILE_DEFINITIONS"),
- language.c_str());
+ this->Target->GetProperty("COMPILE_DEFINITIONS"));
this->LocalGenerator->AppendDefines
(defines,
- source->GetProperty("COMPILE_DEFINITIONS"),
- language.c_str());
+ source->GetProperty("COMPILE_DEFINITIONS"));
{
std::string defPropName = "COMPILE_DEFINITIONS_";
defPropName += cmSystemTools::UpperCase(this->GetConfigName());
this->LocalGenerator->AppendDefines
(defines,
- this->Makefile->GetProperty(defPropName.c_str()),
- language.c_str());
+ this->Makefile->GetProperty(defPropName.c_str()));
this->LocalGenerator->AppendDefines
(defines,
- this->Target->GetProperty(defPropName.c_str()),
- language.c_str());
+ this->Target->GetProperty(defPropName.c_str()));
this->LocalGenerator->AppendDefines
(defines,
- source->GetProperty(defPropName.c_str()),
- language.c_str());
+ source->GetProperty(defPropName.c_str()));
}
- return defines;
+ std::string definesString;
+ this->LocalGenerator->JoinDefines(defines, definesString,
+ language.c_str());
+
+ return definesString;
}
cmNinjaDeps cmNinjaTargetGenerator::ComputeLinkDeps() const
@@ -295,23 +292,33 @@ std::string cmNinjaTargetGenerator::GetTargetName() const
return this->Target->GetName();
}
-std::string cmNinjaTargetGenerator::GetTargetPDB() const
+
+bool cmNinjaTargetGenerator::SetMsvcTargetPdbVariable(cmNinjaVars& vars) const
{
- std::string targetFullPathPDB;
- if(this->Target->GetType() == cmTarget::EXECUTABLE ||
- this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
- this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
- this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+ cmMakefile* mf = this->GetMakefile();
+ if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
+ mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
{
- targetFullPathPDB = this->Target->GetDirectory(this->GetConfigName());
- targetFullPathPDB += "/";
- targetFullPathPDB += this->Target->GetPDBName(this->GetConfigName());
+ std::string pdbPath;
+ if(this->Target->GetType() == cmTarget::EXECUTABLE ||
+ this->Target->GetType() == cmTarget::STATIC_LIBRARY ||
+ this->Target->GetType() == cmTarget::SHARED_LIBRARY ||
+ this->Target->GetType() == cmTarget::MODULE_LIBRARY)
+ {
+ pdbPath = this->Target->GetDirectory(this->GetConfigName());
+ pdbPath += "/";
+ pdbPath += this->Target->GetPDBName(this->GetConfigName());
}
- return targetFullPathPDB.c_str();
+ vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
+ ConvertToNinjaPath(pdbPath.c_str()).c_str(),
+ cmLocalGenerator::SHELL);
+ EnsureParentDirectoryExists(pdbPath);
+ return true;
+ }
+ return false;
}
-
void
cmNinjaTargetGenerator
::WriteLanguageRules(const std::string& language)
@@ -342,24 +349,26 @@ cmNinjaTargetGenerator
cmMakefile* mf = this->GetMakefile();
bool useClDeps = false;
+ std::string clBinary;
std::string clDepsBinary;
std::string clShowPrefix;
if (lang == "C" || lang == "CXX" || lang == "RC")
{
- const char* depsPtr = mf->GetDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
- const char* showPtr = mf->GetDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
- if (depsPtr && showPtr)
+ clDepsBinary = mf->GetSafeDefinition("CMAKE_CMCLDEPS_EXECUTABLE");
+ if (!clDepsBinary.empty() &&
+ !this->GetGlobalGenerator()->GetCMakeInstance()->GetIsInTryCompile())
{
- // don't wrap for try_compile,
- // TODO but why doesn't it work with cmcldeps?
- const std::string projectName = mf->GetProjectName() ?
- mf->GetProjectName() : "";
- if (projectName != "CMAKE_TRY_COMPILE")
+ clShowPrefix = mf->GetSafeDefinition("CMAKE_CL_SHOWINCLUDE_PREFIX");
+ clBinary = mf->GetDefinition("CMAKE_C_COMPILER") ?
+ mf->GetSafeDefinition("CMAKE_C_COMPILER") :
+ mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
+ if (!clBinary.empty() && !clShowPrefix.empty())
{
useClDeps = true;
- std::string qu = "\"";
- clDepsBinary = qu + depsPtr + qu;
- clShowPrefix = qu + showPtr + qu;
+ const std::string quote = " \"";
+ clBinary = quote + clBinary + "\" ";
+ clDepsBinary = quote + clDepsBinary + "\" ";
+ clShowPrefix = quote + clShowPrefix + "\" ";
vars.DependencyFile = "$DEP_FILE";
}
}
@@ -393,16 +402,14 @@ cmNinjaTargetGenerator
i != compileCmds.end(); ++i)
this->GetLocalGenerator()->ExpandRuleVariables(*i, vars);
- std::string cmdLine =
- this->GetLocalGenerator()->BuildCommandLine(compileCmds);
-
+ std::string cmdLine;
if(useClDeps)
{
- std::string cl = mf->GetDefinition("CMAKE_C_COMPILER");
- cl = "\"" + cl + "\" ";
- cmdLine = clDepsBinary + " " + lang + " $in \"$DEP_FILE\" $out "
- + clShowPrefix + " " + cl + cmdLine;
+ cmdLine = clDepsBinary + lang + " $in \"$DEP_FILE\" $out " +
+ clShowPrefix + clBinary;
}
+ cmdLine += this->GetLocalGenerator()->BuildCommandLine(compileCmds);
+
// Write the rule for compiling file of the given language.
cmOStringStream comment;
@@ -537,15 +544,7 @@ cmNinjaTargetGenerator
vars["DEP_FILE"] = objectFileName + ".d";;
EnsureParentDirectoryExists(objectFileName);
- // TODO move to GetTargetPDB
- cmMakefile* mf = this->GetMakefile();
- if (mf->GetDefinition("MSVC_C_ARCHITECTURE_ID") ||
- mf->GetDefinition("MSVC_CXX_ARCHITECTURE_ID"))
- {
- vars["TARGET_PDB"] = this->GetLocalGenerator()->ConvertToOutputFormat(
- ConvertToNinjaPath(GetTargetPDB().c_str()).c_str(),
- cmLocalGenerator::SHELL);
- }
+ this->SetMsvcTargetPdbVariable(vars);
if(this->Makefile->IsOn("CMAKE_EXPORT_COMPILE_COMMANDS"))
{
@@ -641,14 +640,14 @@ cmNinjaTargetGenerator
void
cmNinjaTargetGenerator
-::EnsureDirectoryExists(const std::string& dir)
+::EnsureDirectoryExists(const std::string& dir) const
{
cmSystemTools::MakeDirectory(dir.c_str());
}
void
cmNinjaTargetGenerator
-::EnsureParentDirectoryExists(const std::string& path)
+::EnsureParentDirectoryExists(const std::string& path) const
{
EnsureDirectoryExists(cmSystemTools::GetParentDirectory(path.c_str()));
}
diff --git a/Source/cmNinjaTargetGenerator.h b/Source/cmNinjaTargetGenerator.h
index 84573ce..cd20694 100644
--- a/Source/cmNinjaTargetGenerator.h
+++ b/Source/cmNinjaTargetGenerator.h
@@ -40,10 +40,12 @@ public:
virtual void Generate() = 0;
- std::string GetTargetPDB() const;
std::string GetTargetName() const;
protected:
+
+ bool SetMsvcTargetPdbVariable(cmNinjaVars&) const;
+
cmGeneratedFileStream& GetBuildFileStream() const;
cmGeneratedFileStream& GetRulesFileStream() const;
@@ -112,8 +114,8 @@ protected:
// Helper to add flag for windows .def file.
void AddModuleDefinitionFlag(std::string& flags);
- void EnsureDirectoryExists(const std::string& dir);
- void EnsureParentDirectoryExists(const std::string& path);
+ void EnsureDirectoryExists(const std::string& dir) const;
+ void EnsureParentDirectoryExists(const std::string& path) const;
// write rules for Mac OS X Application Bundle content.
struct MacOSXContentGeneratorType :
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 775662c..65b586d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -761,7 +761,10 @@ void cmTarget::DefineProperties(cmake *cm)
"The POSITION_INDEPENDENT_CODE property determines whether position "
"independent executables or shared libraries will be created. "
"This property is true by default for SHARED and MODULE library "
- "targets and false otherwise.");
+ "targets and false otherwise. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_POSITION_INDEPENDENT_CODE if it is set when a target is"
+ "created.");
cm->DefineProperty
("POST_INSTALL_SCRIPT", cmProperty::TARGET,
@@ -903,7 +906,7 @@ void cmTarget::DefineProperties(cmake *cm)
"Build an executable with a WinMain entry point on windows.",
"When this property is set to true the executable when linked "
"on Windows will be created with a WinMain() entry point instead "
- "of of just main()."
+ "of just main(). "
"This makes it a GUI executable instead of a console application. "
"See the CMAKE_MFC_FLAG variable documentation to configure use "
"of MFC for WinMain executables. "
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a89c5d9..98eaeec 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -158,9 +158,6 @@ public:
void AddSources(std::vector<std::string> const& srcs);
cmSourceFile* AddSource(const char* src);
- /**
- * Get the list of the source files used by this target
- */
enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
//* how we identify a library, by name and type
diff --git a/Source/cmVS11CLFlagTable.h b/Source/cmVS11CLFlagTable.h
new file mode 100644
index 0000000..5ab8ebb
--- /dev/null
+++ b/Source/cmVS11CLFlagTable.h
@@ -0,0 +1,291 @@
+static cmVS7FlagTable cmVS11CLFlagTable[] =
+{
+
+ //Enum Properties
+ {"DebugInformationFormat", "",
+ "None", "None", 0},
+ {"DebugInformationFormat", "Z7",
+ "C7 compatible", "OldStyle", 0},
+ {"DebugInformationFormat", "Zi",
+ "Program Database", "ProgramDatabase", 0},
+ {"DebugInformationFormat", "ZI",
+ "Program Database for Edit And Continue", "EditAndContinue", 0},
+
+ {"WarningLevel", "W0",
+ "Turn Off All Warnings", "TurnOffAllWarnings", 0},
+ {"WarningLevel", "W1",
+ "Level1", "Level1", 0},
+ {"WarningLevel", "W2",
+ "Level2", "Level2", 0},
+ {"WarningLevel", "W3",
+ "Level3", "Level3", 0},
+ {"WarningLevel", "W4",
+ "Level4", "Level4", 0},
+ {"WarningLevel", "Wall",
+ "EnableAllWarnings", "EnableAllWarnings", 0},
+
+ {"Optimization", "Od",
+ "Disabled", "Disabled", 0},
+ {"Optimization", "O1",
+ "Minimize Size", "MinSpace", 0},
+ {"Optimization", "O2",
+ "Maximize Speed", "MaxSpeed", 0},
+ {"Optimization", "Ox",
+ "Full Optimization", "Full", 0},
+
+ {"InlineFunctionExpansion", "",
+ "Default", "Default", 0},
+ {"InlineFunctionExpansion", "Ob0",
+ "Disabled", "Disabled", 0},
+ {"InlineFunctionExpansion", "Ob1",
+ "Only __inline", "OnlyExplicitInline", 0},
+ {"InlineFunctionExpansion", "Ob2",
+ "Any Suitable", "AnySuitable", 0},
+
+ {"FavorSizeOrSpeed", "Os",
+ "Favor small code", "Size", 0},
+ {"FavorSizeOrSpeed", "Ot",
+ "Favor fast code", "Speed", 0},
+ {"FavorSizeOrSpeed", "",
+ "Neither", "Neither", 0},
+
+ {"ExceptionHandling", "EHa",
+ "Yes with SEH Exceptions", "Async", 0},
+ {"ExceptionHandling", "EHsc",
+ "Yes", "Sync", 0},
+ {"ExceptionHandling", "EHs",
+ "Yes with Extern C functions", "SyncCThrow", 0},
+ {"ExceptionHandling", "",
+ "No", "false", 0},
+
+ {"BasicRuntimeChecks", "RTCs",
+ "Stack Frames", "StackFrameRuntimeCheck", 0},
+ {"BasicRuntimeChecks", "RTCu",
+ "Uninitialized variables", "UninitializedLocalUsageCheck", 0},
+ {"BasicRuntimeChecks", "RTC1",
+ "Both (/RTC1, equiv. to /RTCsu)", "EnableFastChecks", 0},
+ {"BasicRuntimeChecks", "",
+ "Default", "Default", 0},
+
+ {"RuntimeLibrary", "MT",
+ "Multi-threaded", "MultiThreaded", 0},
+ {"RuntimeLibrary", "MTd",
+ "Multi-threaded Debug", "MultiThreadedDebug", 0},
+ {"RuntimeLibrary", "MD",
+ "Multi-threaded DLL", "MultiThreadedDLL", 0},
+ {"RuntimeLibrary", "MDd",
+ "Multi-threaded Debug DLL", "MultiThreadedDebugDLL", 0},
+
+ {"StructMemberAlignment", "Zp1",
+ "1 Byte", "1Byte", 0},
+ {"StructMemberAlignment", "Zp2",
+ "2 Bytes", "2Bytes", 0},
+ {"StructMemberAlignment", "Zp4",
+ "4 Byte", "4Bytes", 0},
+ {"StructMemberAlignment", "Zp8",
+ "8 Bytes", "8Bytes", 0},
+ {"StructMemberAlignment", "Zp16",
+ "16 Bytes", "16Bytes", 0},
+ {"StructMemberAlignment", "",
+ "Default", "Default", 0},
+
+ {"EnableEnhancedInstructionSet", "arch:SSE",
+ "Streaming SIMD Extensions", "StreamingSIMDExtensions", 0},
+ {"EnableEnhancedInstructionSet", "arch:SSE2",
+ "Streaming SIMD Extensions 2", "StreamingSIMDExtensions2", 0},
+ {"EnableEnhancedInstructionSet", "arch:AVX",
+ "Advanced Vector Extensions", "AdvancedVectorExtensions", 0},
+ {"EnableEnhancedInstructionSet", "arch:IA32",
+ "No Enhanced Instructions", "NoExtensions", 0},
+ {"EnableEnhancedInstructionSet", "",
+ "Not Set", "NotSet", 0},
+
+ {"FloatingPointModel", "fp:precise",
+ "Precise", "Precise", 0},
+ {"FloatingPointModel", "fp:strict",
+ "Strict", "Strict", 0},
+ {"FloatingPointModel", "fp:fast",
+ "Fast", "Fast", 0},
+
+ {"PrecompiledHeader", "Yc",
+ "Create", "Create",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"PrecompiledHeader", "Yu",
+ "Use", "Use",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"PrecompiledHeader", "",
+ "Not Using Precompiled Headers", "NotUsing", 0},
+
+ {"AssemblerOutput", "",
+ "No Listing", "NoListing", 0},
+ {"AssemblerOutput", "FA",
+ "Assembly-Only Listing", "AssemblyCode", 0},
+ {"AssemblerOutput", "FAc",
+ "Assembly With Machine Code", "AssemblyAndMachineCode", 0},
+ {"AssemblerOutput", "FAs",
+ "Assembly With Source Code", "AssemblyAndSourceCode", 0},
+ {"AssemblerOutput", "FAcs",
+ "Assembly, Machine Code and Source", "All", 0},
+
+ {"CallingConvention", "Gd",
+ "__cdecl", "Cdecl", 0},
+ {"CallingConvention", "Gr",
+ "__fastcall", "FastCall", 0},
+ {"CallingConvention", "Gz",
+ "__stdcall", "StdCall", 0},
+
+ {"CompileAs", "",
+ "Default", "Default", 0},
+ {"CompileAs", "TC",
+ "Compile as C Code", "CompileAsC", 0},
+ {"CompileAs", "TP",
+ "Compile as C++ Code", "CompileAsCpp", 0},
+
+ {"ErrorReporting", "errorReport:none",
+ "Do Not Send Report", "None", 0},
+ {"ErrorReporting", "errorReport:prompt",
+ "Prompt Immediately", "Prompt", 0},
+ {"ErrorReporting", "errorReport:queue",
+ "Queue For Next Login", "Queue", 0},
+ {"ErrorReporting", "errorReport:send",
+ "Send Automatically", "Send", 0},
+
+ {"CompileAsManaged", "",
+ "No Common Language RunTime Support", "false", 0},
+ {"CompileAsManaged", "clr",
+ "Common Language RunTime Support", "true", 0},
+ {"CompileAsManaged", "clr:pure",
+ "Pure MSIL Common Language RunTime Support", "Pure", 0},
+ {"CompileAsManaged", "clr:safe",
+ "Safe MSIL Common Language RunTime Support", "Safe", 0},
+ {"CompileAsManaged", "clr:oldSyntax",
+ "Common Language RunTime Support, Old Syntax", "OldSyntax", 0},
+
+
+ //Bool Properties
+ {"CompileAsWinRT", "ZW", "", "true", 0},
+ {"WinRTNoStdLib", "ZW:nostdlib", "", "true", 0},
+ {"SuppressStartupBanner", "nologo-", "", "false", 0},
+ {"SuppressStartupBanner", "nologo", "", "true", 0},
+ {"TreatWarningAsError", "WX-", "", "false", 0},
+ {"TreatWarningAsError", "WX", "", "true", 0},
+ {"SDLCheck", "sdl-", "", "false", 0},
+ {"SDLCheck", "sdl", "", "true", 0},
+ {"IntrinsicFunctions", "Oi", "", "true", 0},
+ {"OmitFramePointers", "Oy-", "", "false", 0},
+ {"OmitFramePointers", "Oy", "", "true", 0},
+ {"EnableFiberSafeOptimizations", "GT", "", "true", 0},
+ {"WholeProgramOptimization", "GL", "", "true", 0},
+ {"UndefineAllPreprocessorDefinitions", "u", "", "true", 0},
+ {"IgnoreStandardIncludePath", "X", "", "true", 0},
+ {"PreprocessToFile", "P", "", "true", 0},
+ {"PreprocessSuppressLineNumbers", "EP", "", "true", 0},
+ {"PreprocessKeepComments", "C", "", "true", 0},
+ {"StringPooling", "GF-", "", "false", 0},
+ {"StringPooling", "GF", "", "true", 0},
+ {"MinimalRebuild", "Gm-", "", "false", 0},
+ {"MinimalRebuild", "Gm", "", "true", 0},
+ {"SmallerTypeCheck", "RTCc", "", "true", 0},
+ {"BufferSecurityCheck", "GS-", "", "false", 0},
+ {"BufferSecurityCheck", "GS", "", "true", 0},
+ {"FunctionLevelLinking", "Gy-", "", "false", 0},
+ {"FunctionLevelLinking", "Gy", "", "true", 0},
+ {"EnableParallelCodeGeneration", "Qpar-", "", "false", 0},
+ {"EnableParallelCodeGeneration", "Qpar", "", "true", 0},
+ {"FloatingPointExceptions", "fp:except-", "", "false", 0},
+ {"FloatingPointExceptions", "fp:except", "", "true", 0},
+ {"CreateHotpatchableImage", "hotpatch", "", "true", 0},
+ {"DisableLanguageExtensions", "Za", "", "true", 0},
+ {"TreatWChar_tAsBuiltInType", "Zc:wchar_t-", "", "false", 0},
+ {"TreatWChar_tAsBuiltInType", "Zc:wchar_t", "", "true", 0},
+ {"ForceConformanceInForLoopScope", "Zc:forScope-", "", "false", 0},
+ {"ForceConformanceInForLoopScope", "Zc:forScope", "", "true", 0},
+ {"RuntimeTypeInfo", "GR-", "", "false", 0},
+ {"RuntimeTypeInfo", "GR", "", "true", 0},
+ {"OpenMPSupport", "openmp-", "", "false", 0},
+ {"OpenMPSupport", "openmp", "", "true", 0},
+ {"ExpandAttributedSource", "Fx", "", "true", 0},
+ {"UseUnicodeForAssemblerListing", "FAu", "", "true", 0},
+ {"ShowIncludes", "showIncludes", "", "true", 0},
+ {"EnablePREfast", "analyze-", "", "false", 0},
+ {"EnablePREfast", "analyze", "", "true", 0},
+ {"UseFullPaths", "FC", "", "true", 0},
+ {"OmitDefaultLibName", "Zl", "", "true", 0},
+
+ //Bool Properties With Argument
+ {"MultiProcessorCompilation", "MP", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"ProcessorNumber", "MP", "Multi-processor Compilation", "",
+ cmVS7FlagTable::UserValueRequired},
+ {"GenerateXMLDocumentationFiles", "doc", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"XMLDocumentationFileName", "doc", "Generate XML Documentation Files", "",
+ cmVS7FlagTable::UserValueRequired},
+ {"BrowseInformation", "FR", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"BrowseInformationFile", "FR", "Enable Browse Information", "",
+ cmVS7FlagTable::UserValueRequired},
+
+ //String List Properties
+ {"AdditionalIncludeDirectories", "I",
+ "Additional Include Directories",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"AdditionalUsingDirectories", "AI",
+ "Additional #using Directories",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"PreprocessorDefinitions", "D ",
+ "Preprocessor Definitions",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"UndefinePreprocessorDefinitions", "U",
+ "Undefine Preprocessor Definitions",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"DisableSpecificWarnings", "wd",
+ "Disable Specific Warnings",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"ForcedIncludeFiles", "FI",
+ "Forced Include File",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"ForcedUsingFiles", "FU",
+ "Forced #using File",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"PREfastAdditionalOptions", "analyze:",
+ "Additional Code Analysis Native options",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"PREfastAdditionalPlugins", "analyze:plugin",
+ "Additional Code Analysis Native plugins",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"TreatSpecificWarningsAsErrors", "we",
+ "Treat Specific Warnings As Errors",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+
+ //String Properties
+ // Skip [TrackerLogDirectory] - no command line Switch.
+ {"PreprocessOutputPath", "Fi",
+ "Preprocess Output Path",
+ "", cmVS7FlagTable::UserValue},
+ {"PrecompiledHeaderFile", "Yc",
+ "Precompiled Header Name",
+ "", cmVS7FlagTable::UserValueRequired},
+ {"PrecompiledHeaderFile", "Yu",
+ "Precompiled Header Name",
+ "", cmVS7FlagTable::UserValueRequired},
+ {"PrecompiledHeaderOutputFile", "Fp",
+ "Precompiled Header Output File",
+ "", cmVS7FlagTable::UserValue},
+ {"AssemblerListingLocation", "Fa",
+ "ASM List Location",
+ "", cmVS7FlagTable::UserValue},
+ {"ObjectFileName", "Fo",
+ "Object File Name",
+ "", cmVS7FlagTable::UserValue},
+ {"ProgramDataBaseFileName", "Fd",
+ "Program Database File Name",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [XMLDocumentationFileName] - no command line Switch.
+ // Skip [BrowseInformationFile] - no command line Switch.
+ {"PREfastLog", "analyze:log ",
+ "Code Analysis Log",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [AdditionalOptions] - no command line Switch.
+ {0,0,0,0,0}
+};
diff --git a/Source/cmVS11LibFlagTable.h b/Source/cmVS11LibFlagTable.h
new file mode 100644
index 0000000..9429442
--- /dev/null
+++ b/Source/cmVS11LibFlagTable.h
@@ -0,0 +1,102 @@
+static cmVS7FlagTable cmVS11LibFlagTable[] =
+{
+
+ //Enum Properties
+ {"ErrorReporting", "ERRORREPORT:PROMPT",
+ "PromptImmediately", "PromptImmediately", 0},
+ {"ErrorReporting", "ERRORREPORT:QUEUE",
+ "Queue For Next Login", "QueueForNextLogin", 0},
+ {"ErrorReporting", "ERRORREPORT:SEND",
+ "Send Error Report", "SendErrorReport", 0},
+ {"ErrorReporting", "ERRORREPORT:NONE",
+ "No Error Report", "NoErrorReport", 0},
+
+ {"TargetMachine", "MACHINE:ARM",
+ "MachineARM", "MachineARM", 0},
+ {"TargetMachine", "MACHINE:EBC",
+ "MachineEBC", "MachineEBC", 0},
+ {"TargetMachine", "MACHINE:IA64",
+ "MachineIA64", "MachineIA64", 0},
+ {"TargetMachine", "MACHINE:MIPS",
+ "MachineMIPS", "MachineMIPS", 0},
+ {"TargetMachine", "MACHINE:MIPS16",
+ "MachineMIPS16", "MachineMIPS16", 0},
+ {"TargetMachine", "MACHINE:MIPSFPU",
+ "MachineMIPSFPU", "MachineMIPSFPU", 0},
+ {"TargetMachine", "MACHINE:MIPSFPU16",
+ "MachineMIPSFPU16", "MachineMIPSFPU16", 0},
+ {"TargetMachine", "MACHINE:SH4",
+ "MachineSH4", "MachineSH4", 0},
+ {"TargetMachine", "MACHINE:THUMB",
+ "MachineTHUMB", "MachineTHUMB", 0},
+ {"TargetMachine", "MACHINE:X64",
+ "MachineX64", "MachineX64", 0},
+ {"TargetMachine", "MACHINE:X86",
+ "MachineX86", "MachineX86", 0},
+
+ {"SubSystem", "SUBSYSTEM:CONSOLE",
+ "Console", "Console", 0},
+ {"SubSystem", "SUBSYSTEM:WINDOWS",
+ "Windows", "Windows", 0},
+ {"SubSystem", "SUBSYSTEM:NATIVE",
+ "Native", "Native", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_APPLICATION",
+ "EFI Application", "EFI Application", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "EFI Boot Service Driver", "EFI Boot Service Driver", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_ROM",
+ "EFI ROM", "EFI ROM", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "EFI Runtime", "EFI Runtime", 0},
+ {"SubSystem", "SUBSYSTEM:WINDOWSCE",
+ "WindowsCE", "WindowsCE", 0},
+ {"SubSystem", "SUBSYSTEM:POSIX",
+ "POSIX", "POSIX", 0},
+
+
+ //Bool Properties
+ {"SuppressStartupBanner", "NOLOGO", "", "true", 0},
+ {"IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0},
+ {"TreatLibWarningAsErrors", "WX:NO", "", "false", 0},
+ {"TreatLibWarningAsErrors", "WX", "", "true", 0},
+ {"Verbose", "VERBOSE", "", "true", 0},
+ {"LinkTimeCodeGeneration", "LTCG", "", "true", 0},
+
+ //Bool Properties With Argument
+
+ //String List Properties
+ // Skip [AdditionalDependencies] - no command line Switch.
+ {"AdditionalLibraryDirectories", "LIBPATH:",
+ "Additional Library Directories",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:",
+ "Ignore Specific Default Libraries",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"ExportNamedFunctions", "EXPORT:",
+ "Export Named Functions",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"RemoveObjects", "REMOVE:",
+ "Remove Objects",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+
+ //String Properties
+ {"OutputFile", "OUT:",
+ "Output File",
+ "", cmVS7FlagTable::UserValue},
+ {"ModuleDefinitionFile", "DEF:",
+ "Module Definition File Name",
+ "", cmVS7FlagTable::UserValue},
+ {"ForceSymbolReferences", "INCLUDE:",
+ "Force Symbol References",
+ "", cmVS7FlagTable::UserValue},
+ {"DisplayLibrary", "LIST:",
+ "Display Library to standard output",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [MinimumRequiredVersion] - no command line Switch.
+ {"Name", "NAME:",
+ "Name",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [AdditionalOptions] - no command line Switch.
+ // Skip [TrackerLogDirectory] - no command line Switch.
+ {0,0,0,0,0}
+};
diff --git a/Source/cmVS11LinkFlagTable.h b/Source/cmVS11LinkFlagTable.h
new file mode 100644
index 0000000..ea0d0f0
--- /dev/null
+++ b/Source/cmVS11LinkFlagTable.h
@@ -0,0 +1,343 @@
+static cmVS7FlagTable cmVS11LinkFlagTable[] =
+{
+
+ //Enum Properties
+ {"ShowProgress", "",
+ "Not Set", "NotSet", 0},
+ {"ShowProgress", "VERBOSE",
+ "Display all progress messages", "LinkVerbose", 0},
+ {"ShowProgress", "VERBOSE:Lib",
+ "For Libraries Searched", "LinkVerboseLib", 0},
+ {"ShowProgress", "VERBOSE:ICF",
+ "About COMDAT folding during optimized linking", "LinkVerboseICF", 0},
+ {"ShowProgress", "VERBOSE:REF",
+ "About data removed during optimized linking", "LinkVerboseREF", 0},
+ {"ShowProgress", "VERBOSE:SAFESEH",
+ "About Modules incompatible with SEH", "LinkVerboseSAFESEH", 0},
+ {"ShowProgress", "VERBOSE:CLR",
+ "About linker activity related to managed code", "LinkVerboseCLR", 0},
+
+ {"ForceFileOutput", "FORCE",
+ "Enabled", "Enabled", 0},
+ {"ForceFileOutput", "FORCE:MULTIPLE",
+ "Multiply Defined Symbol Only", "MultiplyDefinedSymbolOnly", 0},
+ {"ForceFileOutput", "FORCE:UNRESOLVED",
+ "Undefined Symbol Only", "UndefinedSymbolOnly", 0},
+
+ {"CreateHotPatchableImage", "FUNCTIONPADMIN",
+ "Enabled", "Enabled", 0},
+ {"CreateHotPatchableImage", "FUNCTIONPADMIN:5",
+ "X86 Image Only", "X86Image", 0},
+ {"CreateHotPatchableImage", "FUNCTIONPADMIN:6",
+ "X64 Image Only", "X64Image", 0},
+ {"CreateHotPatchableImage", "FUNCTIONPADMIN:16",
+ "Itanium Image Only", "ItaniumImage", 0},
+
+ {"UACExecutionLevel", "level='asInvoker'",
+ "asInvoker", "AsInvoker", 0},
+ {"UACExecutionLevel", "level='highestAvailable'",
+ "highestAvailable", "HighestAvailable", 0},
+ {"UACExecutionLevel", "level='requireAdministrator'",
+ "requireAdministrator", "RequireAdministrator", 0},
+
+ {"SubSystem", "",
+ "Not Set", "NotSet", 0},
+ {"SubSystem", "SUBSYSTEM:CONSOLE",
+ "Console", "Console", 0},
+ {"SubSystem", "SUBSYSTEM:WINDOWS",
+ "Windows", "Windows", 0},
+ {"SubSystem", "SUBSYSTEM:NATIVE",
+ "Native", "Native", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_APPLICATION",
+ "EFI Application", "EFI Application", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER",
+ "EFI Boot Service Driver", "EFI Boot Service Driver", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_ROM",
+ "EFI ROM", "EFI ROM", 0},
+ {"SubSystem", "SUBSYSTEM:EFI_RUNTIME_DRIVER",
+ "EFI Runtime", "EFI Runtime", 0},
+ {"SubSystem", "SUBSYSTEM:POSIX",
+ "POSIX", "POSIX", 0},
+
+ {"Driver", "",
+ "Not Set", "NotSet", 0},
+ {"Driver", "Driver",
+ "Driver", "Driver", 0},
+ {"Driver", "DRIVER:UPONLY",
+ "UP Only", "UpOnly", 0},
+ {"Driver", "DRIVER:WDM",
+ "WDM", "WDM", 0},
+
+ {"LinkTimeCodeGeneration", "",
+ "Default", "Default", 0},
+ {"LinkTimeCodeGeneration", "LTCG",
+ "Use Link Time Code Generation", "UseLinkTimeCodeGeneration", 0},
+ {"LinkTimeCodeGeneration", "LTCG:PGInstrument",
+ "Profile Guided Optimization - Instrument", "PGInstrument", 0},
+ {"LinkTimeCodeGeneration", "LTCG:PGOptimize",
+ "Profile Guided Optimization - Optimization", "PGOptimization", 0},
+ {"LinkTimeCodeGeneration", "LTCG:PGUpdate",
+ "Profile Guided Optimization - Update", "PGUpdate", 0},
+
+ {"GenerateWindowsMetadata", "WINMD",
+ "Yes", "true", 0},
+ {"GenerateWindowsMetadata", "WINMD:NO",
+ "No", "false", 0},
+
+ {"WindowsMetadataSignHash", "WINMDSIGNHASH:SHA1",
+ "SHA1", "SHA1", 0},
+ {"WindowsMetadataSignHash", "WINMDSIGNHASH:SHA256",
+ "SHA256", "SHA256", 0},
+ {"WindowsMetadataSignHash", "WINMDSIGNHASH:SHA384",
+ "SHA384", "SHA384", 0},
+ {"WindowsMetadataSignHash", "WINMDSIGNHASH:SHA512",
+ "SHA512", "SHA512", 0},
+
+ {"TargetMachine", "",
+ "Not Set", "NotSet", 0},
+ {"TargetMachine", "MACHINE:ARM",
+ "MachineARM", "MachineARM", 0},
+ {"TargetMachine", "MACHINE:EBC",
+ "MachineEBC", "MachineEBC", 0},
+ {"TargetMachine", "MACHINE:IA64",
+ "MachineIA64", "MachineIA64", 0},
+ {"TargetMachine", "MACHINE:MIPS",
+ "MachineMIPS", "MachineMIPS", 0},
+ {"TargetMachine", "MACHINE:MIPS16",
+ "MachineMIPS16", "MachineMIPS16", 0},
+ {"TargetMachine", "MACHINE:MIPSFPU",
+ "MachineMIPSFPU", "MachineMIPSFPU", 0},
+ {"TargetMachine", "MACHINE:MIPSFPU16",
+ "MachineMIPSFPU16", "MachineMIPSFPU16", 0},
+ {"TargetMachine", "MACHINE:SH4",
+ "MachineSH4", "MachineSH4", 0},
+ {"TargetMachine", "MACHINE:THUMB",
+ "MachineTHUMB", "MachineTHUMB", 0},
+ {"TargetMachine", "MACHINE:X64",
+ "MachineX64", "MachineX64", 0},
+ {"TargetMachine", "MACHINE:X86",
+ "MachineX86", "MachineX86", 0},
+
+ {"CLRThreadAttribute", "CLRTHREADATTRIBUTE:MTA",
+ "MTA threading attribute", "MTAThreadingAttribute", 0},
+ {"CLRThreadAttribute", "CLRTHREADATTRIBUTE:STA",
+ "STA threading attribute", "STAThreadingAttribute", 0},
+ {"CLRThreadAttribute", "CLRTHREADATTRIBUTE:NONE",
+ "Default threading attribute", "DefaultThreadingAttribute", 0},
+
+ {"CLRImageType", "CLRIMAGETYPE:IJW",
+ "Force IJW image", "ForceIJWImage", 0},
+ {"CLRImageType", "CLRIMAGETYPE:PURE",
+ "Force Pure IL Image", "ForcePureILImage", 0},
+ {"CLRImageType", "CLRIMAGETYPE:SAFE",
+ "Force Safe IL Image", "ForceSafeILImage", 0},
+ {"CLRImageType", "",
+ "Default image type", "Default", 0},
+
+ {"SignHash", "CLRSIGNHASH:SHA1",
+ "SHA1", "SHA1", 0},
+ {"SignHash", "CLRSIGNHASH:SHA256",
+ "SHA256", "SHA256", 0},
+ {"SignHash", "CLRSIGNHASH:SHA384",
+ "SHA384", "SHA384", 0},
+ {"SignHash", "CLRSIGNHASH:SHA512",
+ "SHA512", "SHA512", 0},
+
+ {"LinkErrorReporting", "ERRORREPORT:PROMPT",
+ "PromptImmediately", "PromptImmediately", 0},
+ {"LinkErrorReporting", "ERRORREPORT:QUEUE",
+ "Queue For Next Login", "QueueForNextLogin", 0},
+ {"LinkErrorReporting", "ERRORREPORT:SEND",
+ "Send Error Report", "SendErrorReport", 0},
+ {"LinkErrorReporting", "ERRORREPORT:NONE",
+ "No Error Report", "NoErrorReport", 0},
+
+ {"CLRSupportLastError", "CLRSupportLastError",
+ "Enabled", "Enabled", 0},
+ {"CLRSupportLastError", "CLRSupportLastError:NO",
+ "Disabled", "Disabled", 0},
+ {"CLRSupportLastError", "CLRSupportLastError:SYSTEMDLL",
+ "System Dlls Only", "SystemDlls", 0},
+
+
+ //Bool Properties
+ {"LinkIncremental", "INCREMENTAL:NO", "", "false", 0},
+ {"LinkIncremental", "INCREMENTAL", "", "true", 0},
+ {"SuppressStartupBanner", "NOLOGO", "", "true", 0},
+ {"LinkStatus", "LTCG:NOSTATUS", "", "false", 0},
+ {"LinkStatus", "LTCG:STATUS", "", "true", 0},
+ {"PreventDllBinding", "ALLOWBIND:NO", "", "false", 0},
+ {"PreventDllBinding", "ALLOWBIND", "", "true", 0},
+ {"TreatLinkerWarningAsErrors", "WX:NO", "", "false", 0},
+ {"TreatLinkerWarningAsErrors", "WX", "", "true", 0},
+ {"IgnoreAllDefaultLibraries", "NODEFAULTLIB", "", "true", 0},
+ {"GenerateManifest", "MANIFEST:NO", "", "false", 0},
+ {"GenerateManifest", "MANIFEST", "", "true", 0},
+ {"AllowIsolation", "ALLOWISOLATION:NO", "", "false", 0},
+ {"UACUIAccess", "uiAccess='false'", "", "false", 0},
+ {"UACUIAccess", "uiAccess='true'", "", "true", 0},
+ {"ManifestEmbed", "manifest:embed", "", "true", 0},
+ {"GenerateDebugInformation", "DEBUG", "", "true", 0},
+ {"MapExports", "MAPINFO:EXPORTS", "", "true", 0},
+ {"AssemblyDebug", "ASSEMBLYDEBUG:DISABLE", "", "false", 0},
+ {"AssemblyDebug", "ASSEMBLYDEBUG", "", "true", 0},
+ {"LargeAddressAware", "LARGEADDRESSAWARE:NO", "", "false", 0},
+ {"LargeAddressAware", "LARGEADDRESSAWARE", "", "true", 0},
+ {"TerminalServerAware", "TSAWARE:NO", "", "false", 0},
+ {"TerminalServerAware", "TSAWARE", "", "true", 0},
+ {"SwapRunFromCD", "SWAPRUN:CD", "", "true", 0},
+ {"SwapRunFromNET", "SWAPRUN:NET", "", "true", 0},
+ {"OptimizeReferences", "OPT:NOREF", "", "false", 0},
+ {"OptimizeReferences", "OPT:REF", "", "true", 0},
+ {"EnableCOMDATFolding", "OPT:NOICF", "", "false", 0},
+ {"EnableCOMDATFolding", "OPT:ICF", "", "true", 0},
+ {"IgnoreEmbeddedIDL", "IGNOREIDL", "", "true", 0},
+ {"AppContainer", "APPCONTAINER", "", "true", 0},
+ {"WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN:NO", "", "false", 0},
+ {"WindowsMetadataLinkDelaySign", "WINMDDELAYSIGN", "", "true", 0},
+ {"NoEntryPoint", "NOENTRY", "", "true", 0},
+ {"SetChecksum", "RELEASE", "", "true", 0},
+ {"RandomizedBaseAddress", "DYNAMICBASE:NO", "", "false", 0},
+ {"RandomizedBaseAddress", "DYNAMICBASE", "", "true", 0},
+ {"FixedBaseAddress", "FIXED:NO", "", "false", 0},
+ {"FixedBaseAddress", "FIXED", "", "true", 0},
+ {"DataExecutionPrevention", "NXCOMPAT:NO", "", "false", 0},
+ {"DataExecutionPrevention", "NXCOMPAT", "", "true", 0},
+ {"TurnOffAssemblyGeneration", "NOASSEMBLY", "", "true", 0},
+ {"SupportUnloadOfDelayLoadedDLL", "DELAY:UNLOAD", "", "true", 0},
+ {"SupportNobindOfDelayLoadedDLL", "DELAY:NOBIND", "", "true", 0},
+ {"Profile", "PROFILE", "", "true", 0},
+ {"LinkDelaySign", "DELAYSIGN:NO", "", "false", 0},
+ {"LinkDelaySign", "DELAYSIGN", "", "true", 0},
+ {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK:NO", "", "false", 0},
+ {"CLRUnmanagedCodeCheck", "CLRUNMANAGEDCODECHECK", "", "true", 0},
+ {"DetectOneDefinitionRule", "ODR", "", "true", 0},
+ {"ImageHasSafeExceptionHandlers", "SAFESEH:NO", "", "false", 0},
+ {"ImageHasSafeExceptionHandlers", "SAFESEH", "", "true", 0},
+ {"LinkDLL", "DLL", "", "true", 0},
+
+ //Bool Properties With Argument
+ {"EnableUAC", "MANIFESTUAC:NO", "", "false",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"EnableUAC", "MANIFESTUAC:NO", "Enable User Account Control (UAC)", "",
+ cmVS7FlagTable::UserValueRequired},
+ {"EnableUAC", "MANIFESTUAC:", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"UACUIAccess", "MANIFESTUAC:", "Enable User Account Control (UAC)", "",
+ cmVS7FlagTable::UserValueRequired},
+ {"GenerateMapFile", "MAP", "", "true",
+ cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},
+ {"MapFileName", "MAP", "Generate Map File", "",
+ cmVS7FlagTable::UserValueRequired},
+
+ //String List Properties
+ {"AdditionalLibraryDirectories", "LIBPATH:",
+ "Additional Library Directories",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ // Skip [AdditionalDependencies] - no command line Switch.
+ {"IgnoreSpecificDefaultLibraries", "NODEFAULTLIB:",
+ "Ignore Specific Default Libraries",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"AddModuleNamesToAssembly", "ASSEMBLYMODULE:",
+ "Add Module to Assembly",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"EmbedManagedResourceFile", "ASSEMBLYRESOURCE:",
+ "Embed Managed Resource File",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"ForceSymbolReferences", "INCLUDE:",
+ "Force Symbol References",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"DelayLoadDLLs", "DELAYLOAD:",
+ "Delay Loaded Dlls",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"AssemblyLinkResource", "ASSEMBLYLINKRESOURCE:",
+ "Assembly Link Resource",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"AdditionalManifestDependencies", "MANIFESTDEPENDENCY:",
+ "Additional Manifest Dependencies",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+ {"ManifestInput", "manifestinput:",
+ "Manifest Input",
+ "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},
+
+ //String Properties
+ {"OutputFile", "OUT:",
+ "Output File",
+ "", cmVS7FlagTable::UserValue},
+ {"Version", "VERSION:",
+ "Version",
+ "", cmVS7FlagTable::UserValue},
+ {"SpecifySectionAttributes", "SECTION:",
+ "Specify Section Attributes",
+ "", cmVS7FlagTable::UserValue},
+ {"MSDOSStubFileName", "STUB:",
+ "MS-DOS Stub File Name",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [TrackerLogDirectory] - no command line Switch.
+ {"ModuleDefinitionFile", "DEF:",
+ "Module Definition File",
+ "", cmVS7FlagTable::UserValue},
+ {"ManifestFile", "ManifestFile:",
+ "Manifest File",
+ "", cmVS7FlagTable::UserValue},
+ {"ProgramDatabaseFile", "PDB:",
+ "Generate Program Database File",
+ "", cmVS7FlagTable::UserValue},
+ {"StripPrivateSymbols", "PDBSTRIPPED:",
+ "Strip Private Symbols",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [MapFileName] - no command line Switch.
+ // Skip [MinimumRequiredVersion] - no command line Switch.
+ {"HeapReserveSize", "HEAP:",
+ "Heap Reserve Size",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [HeapCommitSize] - no command line Switch.
+ {"StackReserveSize", "STACK:",
+ "Stack Reserve Size",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [StackCommitSize] - no command line Switch.
+ {"FunctionOrder", "ORDER:@",
+ "Function Order",
+ "", cmVS7FlagTable::UserValue},
+ {"ProfileGuidedDatabase", "PGD:",
+ "Profile Guided Database",
+ "", cmVS7FlagTable::UserValue},
+ {"MidlCommandFile", "MIDL:@",
+ "MIDL Commands",
+ "", cmVS7FlagTable::UserValue},
+ {"MergedIDLBaseFileName", "IDLOUT:",
+ "Merged IDL Base File Name",
+ "", cmVS7FlagTable::UserValue},
+ {"TypeLibraryFile", "TLBOUT:",
+ "Type Library",
+ "", cmVS7FlagTable::UserValue},
+ {"WindowsMetadataFile", "WINMDFILE:",
+ "Windows Metadata File",
+ "", cmVS7FlagTable::UserValue},
+ {"WindowsMetadataLinkKeyFile", "WINMDKEYFILE:",
+ "Windows Metadata Key File",
+ "", cmVS7FlagTable::UserValue},
+ {"WindowsMetadataKeyContainer", "WINMDKEYCONTAINER:",
+ "Windows Metadata Key Container",
+ "", cmVS7FlagTable::UserValue},
+ {"EntryPointSymbol", "ENTRY:",
+ "Entry Point",
+ "", cmVS7FlagTable::UserValue},
+ {"BaseAddress", "BASE:",
+ "Base Address",
+ "", cmVS7FlagTable::UserValue},
+ {"ImportLibrary", "IMPLIB:",
+ "Import Library",
+ "", cmVS7FlagTable::UserValue},
+ {"MergeSections", "MERGE:",
+ "Merge Sections",
+ "", cmVS7FlagTable::UserValue},
+ {"LinkKeyFile", "KEYFILE:",
+ "Key File",
+ "", cmVS7FlagTable::UserValue},
+ {"KeyContainer", "KEYCONTAINER:",
+ "Key Container",
+ "", cmVS7FlagTable::UserValue},
+ // Skip [AdditionalOptions] - no command line Switch.
+ {0,0,0,0,0}
+};
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 53b6a9b..3d2828d 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -22,9 +22,36 @@
#include "cmVS10CLFlagTable.h"
#include "cmVS10LinkFlagTable.h"
#include "cmVS10LibFlagTable.h"
+#include "cmVS11CLFlagTable.h"
+#include "cmVS11LinkFlagTable.h"
+#include "cmVS11LibFlagTable.h"
#include <cmsys/auto_ptr.hxx>
+static cmVS7FlagTable const*
+cmVSGetCLFlagTable(cmLocalVisualStudioGenerator* lg)
+{
+ if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS11)
+ { return cmVS11CLFlagTable; }
+ return cmVS10CLFlagTable;
+}
+
+static cmVS7FlagTable const*
+cmVSGetLibFlagTable(cmLocalVisualStudioGenerator* lg)
+{
+ if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS11)
+ { return cmVS11LibFlagTable; }
+ return cmVS10LibFlagTable;
+}
+
+static cmVS7FlagTable const*
+cmVSGetLinkFlagTable(cmLocalVisualStudioGenerator* lg)
+{
+ if(lg->GetVersion() >= cmLocalVisualStudioGenerator::VS11)
+ { return cmVS11LinkFlagTable; }
+ return cmVS10LinkFlagTable;
+}
+
static std::string cmVS10EscapeXML(std::string arg)
{
cmSystemTools::ReplaceString(arg, "&", "&amp;");
@@ -413,7 +440,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
}
if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
{
- this->WriteString("<Immersive>true</Immersive>\n", 2);
+ this->WriteString("<WindowsAppContainer>true"
+ "</WindowsAppContainer>\n", 2);
}
this->WriteString("</PropertyGroup>\n", 1);
}
@@ -957,7 +985,7 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
cmVisualStudioGeneratorOptions
clOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Compiler,
- cmVS10CLFlagTable, 0, this);
+ cmVSGetCLFlagTable(this->LocalGenerator), 0, this);
clOptions.Parse(flags.c_str());
clOptions.AddDefines(configDefines.c_str());
clOptions.SetConfiguration((*config).c_str());
@@ -1151,7 +1179,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
cmsys::auto_ptr<Options> pOptions(
new Options(this->LocalGenerator, Options::Compiler,
- cmVS10CLFlagTable));
+ cmVSGetCLFlagTable(this->LocalGenerator)));
Options& clOptions = *pOptions;
std::string flags;
@@ -1204,6 +1232,7 @@ bool cmVisualStudio10TargetGenerator::ComputeClOptions(
// 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
@@ -1311,7 +1340,7 @@ cmVisualStudio10TargetGenerator::WriteLibOptions(std::string const& config)
cmVisualStudioGeneratorOptions
libOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Linker,
- cmVS10LibFlagTable, 0, this);
+ cmVSGetLibFlagTable(this->LocalGenerator), 0, this);
libOptions.Parse(libflags?libflags:"");
libOptions.Parse(libflagsConfig?libflagsConfig:"");
libOptions.OutputAdditionalOptions(*this->BuildFileStream, " ", "");
@@ -1391,7 +1420,7 @@ void cmVisualStudio10TargetGenerator::WriteLinkOptions(std::string const&
cmVisualStudioGeneratorOptions
linkOptions(this->LocalGenerator,
cmVisualStudioGeneratorOptions::Linker,
- cmVS10LinkFlagTable, 0, this);
+ cmVSGetLinkFlagTable(this->LocalGenerator), 0, this);
if ( this->Target->GetPropertyAsBool("WIN32_EXECUTABLE") )
{
flags += " /SUBSYSTEM:WINDOWS";
diff --git a/Source/cmparseMSBuildXML.py b/Source/cmparseMSBuildXML.py
index a0c7ec4..35b55ca 100755
--- a/Source/cmparseMSBuildXML.py
+++ b/Source/cmparseMSBuildXML.py
@@ -6,6 +6,9 @@
# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/cl.xml"
# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/lib.xml"
# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/1033/link.xml"
+# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V110/1033/cl.xml"
+# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V110/1033/lib.xml"
+# "${PROGRAMFILES}/MSBuild/Microsoft.Cpp/v4.0/V110/1033/link.xml"
#
# BoolProperty <Name>true|false</Name>
# simple example:
@@ -148,7 +151,7 @@ class Property:
self.argumentProperty = child.getAttribute("Property")
self.argumentIsRequired = child.getAttribute("IsRequired")
if child.nodeName == self.prefix_type+"Value":
- va = Property(self.prefix_type,["Name","Switch"])
+ va = Property(self.prefix_type,["Name","DisplayName","Switch"])
va.suffix_type = "Value"
va.populate(child)
self.values.append(va)
@@ -203,11 +206,11 @@ class MSBuildToCMake:
if child.nodeName == "EnumProperty":
self.enumProperties.append(Property("Enum",["Name","Category"],child))
if child.nodeName == "StringProperty":
- self.stringProperties.append(Property("String",["Name","Subtype","Separator","Category","Visible","IncludeInCommandLine","Switch","ReadOnly"],child))
+ self.stringProperties.append(Property("String",["Name","Subtype","Separator","Category","Visible","IncludeInCommandLine","Switch","DisplayName","ReadOnly"],child))
if child.nodeName == "StringListProperty":
- self.stringListProperties.append(Property("StringList",["Name","Category","Switch","Subtype"],child))
+ self.stringListProperties.append(Property("StringList",["Name","Category","Switch","DisplayName","Subtype"],child))
if child.nodeName == "BoolProperty":
- self.boolProperties.append(Property("Bool",["ReverseSwitch","Name","Category","Switch","SwitchPrefix","IncludeInCommandLine"],child))
+ self.boolProperties.append(Property("Bool",["ReverseSwitch","Name","Category","Switch","DisplayName","SwitchPrefix","IncludeInCommandLine"],child))
if child.nodeName == "IntProperty":
self.intProperties.append(Property("Int",["Name","Category","Visible"],child))
self.populate(child,spaces+"----")
@@ -226,15 +229,15 @@ class MSBuildToCMake:
for j in i.values:
#hardcore Brad King's manual fixes for cmVS10CLFlagTable.h
if i.attributes["Name"] == "PrecompiledHeader" and j.attributes["Switch"] != "":
- toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
+ toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.attributes["DisplayName"]+"\", \""+j.attributes["Name"]+"\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
else:
#default (normal, non-hardcoded) case
- toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n"
+ toReturn+=" {\""+i.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.attributes["DisplayName"]+"\", \""+j.attributes["Name"]+"\", 0},\n"
toReturn += "\n"
if lastProp != {}:
for j in lastProp.values:
- toReturn+=" {\""+lastProp.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.DisplayName+"\", \""+j.attributes["Name"]+"\", 0},\n"
+ toReturn+=" {\""+lastProp.attributes["Name"]+"\", \""+j.attributes["Switch"]+"\",\n \""+j.attributes["DisplayName"]+"\", \""+j.attributes["Name"]+"\", 0},\n"
toReturn += "\n"
toReturn += "\n //Bool Properties\n"
@@ -250,17 +253,17 @@ class MSBuildToCMake:
if i.argumentProperty != "":
if i.attributes["ReverseSwitch"] != "":
toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \"\", \"false\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
- toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \""+i.DisplayName+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
+ toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["ReverseSwitch"]+"\", \""+i.attributes["DisplayName"]+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
if i.attributes["Switch"] != "":
toReturn += " {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\", \"\", \"true\",\n cmVS7FlagTable::UserValueIgnored | cmVS7FlagTable::Continue},\n"
- toReturn += " {\""+i.argumentProperty+"\", \""+i.attributes["Switch"]+"\", \""+i.DisplayName+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
+ toReturn += " {\""+i.argumentProperty+"\", \""+i.attributes["Switch"]+"\", \""+i.attributes["DisplayName"]+"\", \"\",\n cmVS7FlagTable::UserValueRequired},\n"
toReturn += "\n //String List Properties\n"
for i in self.stringListProperties:
if i.attributes["Switch"] == "":
toReturn += " // Skip [" + i.attributes["Name"] + "] - no command line Switch.\n";
else:
- toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\",\n \""+i.DisplayName+"\",\n \"\", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},\n"
+ toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+"\",\n \""+i.attributes["DisplayName"]+"\",\n \"\", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable},\n"
toReturn += "\n //String Properties\n"
for i in self.stringProperties:
@@ -276,7 +279,7 @@ class MSBuildToCMake:
else:
toReturn += " // Skip [" + i.attributes["Name"] + "] - no command line Switch.\n";
else:
- toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+i.attributes["Separator"]+"\",\n \""+i.DisplayName+"\",\n \"\", cmVS7FlagTable::UserValue},\n"
+ toReturn +=" {\""+i.attributes["Name"]+"\", \""+i.attributes["Switch"]+i.attributes["Separator"]+"\",\n \""+i.attributes["DisplayName"]+"\",\n \"\", cmVS7FlagTable::UserValue},\n"
toReturn += " {0,0,0,0,0}\n};"
return toReturn
diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt
index 5f71036..94a6325 100644
--- a/Tests/Assembler/CMakeLists.txt
+++ b/Tests/Assembler/CMakeLists.txt
@@ -7,8 +7,9 @@ set(SRCS)
# (at least) the following toolchains can process assembler files directly
# and also generate assembler files from C:
-if("${CMAKE_GENERATOR}" MATCHES "Makefile")
- if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX))
+if("${CMAKE_GENERATOR}" MATCHES "Makefile|Xcode" AND
+ NOT CMAKE_OSX_ARCHITECTURES)
+ if(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|Clang|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX))
set(C_FLAGS "${CMAKE_C_FLAGS}")
separate_arguments(C_FLAGS)
set(SRCS main.s)
diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt
index d3b1f3c..2a70b6e 100644
--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -93,16 +93,14 @@ if(EXISTS
message("found debug")
set(bar
"${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
-endif(EXISTS
- "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+endif()
set(zot ${BuildDepends_BINARY_DIR}/Project/zot${CMAKE_EXECUTABLE_SUFFIX})
if(EXISTS
"${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" )
message("found debug")
set(zot
"${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
-endif(EXISTS
- "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
+endif()
message("Running ${bar} ")
execute_process(COMMAND ${bar} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
@@ -178,13 +176,11 @@ endif()
if(EXISTS
"${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" )
message("found debug")
-endif(EXISTS
- "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}")
+endif()
if(EXISTS
"${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" )
message("found debug")
-endif(EXISTS
- "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}")
+endif()
message("Running ${bar} ")
execute_process(COMMAND ${bar} OUTPUT_VARIABLE out RESULT_VARIABLE runResult)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 9512ea6..e03b926 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -70,11 +70,6 @@ if(BUILD_TESTING)
"Should the tests that run a full sub ctest process be run?"
OFF)
mark_as_advanced(CTEST_TEST_CTEST)
-
- option(TEST_KDE4_STABLE_BRANCH
- "Should the KDE4 stable branch test be run?"
- OFF)
- mark_as_advanced(TEST_KDE4_STABLE_BRANCH)
endif ()
# Should tests that use CVS be run?
@@ -218,6 +213,7 @@ if(BUILD_TESTING)
ADD_TEST_MACRO(Unset Unset)
ADD_TEST_MACRO(PolicyScope PolicyScope)
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
+ ADD_TEST_MACRO(CompileDefinitions CompileDefinitions)
set_tests_properties(EmptyLibrary PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test")
ADD_TEST_MACRO(CrossCompile CrossCompile)
@@ -551,6 +547,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
FAIL_REGULAR_EXPRESSION "Unexpected: ")
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion")
+ add_test(GeneratorExpression ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/GeneratorExpression"
+ "${CMake_BINARY_DIR}/Tests/GeneratorExpression"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project GeneratorExpression
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ )
+ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression")
+
add_test(CustomCommand ${CMAKE_CTEST_COMMAND}
--build-and-test
"${CMake_SOURCE_DIR}/Tests/CustomCommand"
@@ -794,9 +800,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
NOT "$ENV{COVFILE}" STREQUAL "" OR
CMAKE_RUN_LONG_TESTS)
set(CTEST_RUN_CPackTestAllGenerators ${CTEST_TEST_CPACK})
- endif(CMAKE_CXX_FLAGS MATCHES "-ftest-coverage" OR
- NOT "$ENV{COVFILE}" STREQUAL "" OR
- CMAKE_RUN_LONG_TESTS)
+ endif()
endif()
if(CTEST_RUN_CPackTestAllGenerators)
@@ -1217,9 +1221,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
"${CMake_BINARY_DIR}/Tests/SubDirSpaces/testfromsubdir.obj"
)
list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces")
- endif (MAKE_IS_GNU OR
- "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
- "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
+ endif ()
if (WIN32)
add_test(SubDir ${CMAKE_CTEST_COMMAND}
@@ -2106,43 +2108,6 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
endif ()
endif ()
- if (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
- if(UNIX)
- if(NOT QT4_FOUND)
- find_package(Qt4)
- endif()
-
- set(TRY_BUILD_KDE4 TRUE)
- if(QT4_FOUND)
- # check whether it's Qt 4.5 in a cmake 2.4. compatible way:
- if(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache")
- set(TRY_BUILD_KDE4 FALSE)
- endif()
- else()
- set(TRY_BUILD_KDE4 FALSE)
- endif()
-
- find_package(Perl)
- if(NOT PERL_FOUND)
- set(TRY_BUILD_KDE4 FALSE)
- endif()
-
- find_package(ZLIB)
- if(NOT ZLIB_FOUND)
- set(TRY_BUILD_KDE4 FALSE)
- endif()
-
- if(TRY_BUILD_KDE4)
- file(MAKE_DIRECTORY ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
- set(TEST_KDE4_BASE_DIR ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest)
- configure_file(${CMake_SOURCE_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh.in ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh @ONLY)
- execute_process(COMMAND chmod 755 ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh )
- add_test(KDE4StableBranchTest ${CMake_BINARY_DIR}/Tests/KDE4StableBranchTest/test_kde4.sh)
- endif()
-
- endif()
- endif ()
-
if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
set(CMAKE_SKIP_BOOTSTRAP_TEST 1)
endif()
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index fb0bd15..212c758 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -70,7 +70,7 @@ endmacro()
# If any of these modules reported that it was found a version number should have been
# reported.
-foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HSPELL
+foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT HG HSPELL
JASPER LIBLZMA LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL TIFF ZLIB)
check_version_string(${VTEST} ${VTEST}_VERSION_STRING)
endforeach()
diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in
index 07fc7c6..a167503 100644
--- a/Tests/CMakeTests/ListTest.cmake.in
+++ b/Tests/CMakeTests/ListTest.cmake.in
@@ -86,3 +86,14 @@ TEST("REVERSE result" "ken;brad;bill;andy")
set(result bill andy bill brad ken ken ken)
list(REMOVE_DUPLICATES result)
TEST("REMOVE_DUPLICATES result" "bill;andy;brad;ken")
+
+# these commands should just do nothing if the list is already empty
+set(result "")
+list(REMOVE_DUPLICATES result)
+TEST("REMOVE_DUPLICATES empty result" "")
+
+list(REVERSE result)
+TEST("REVERSE empty result" "")
+
+list(SORT result)
+TEST("SORT empty result" "")
diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt
new file mode 100644
index 0000000..e7d91bf
--- /dev/null
+++ b/Tests/CompileDefinitions/CMakeLists.txt
@@ -0,0 +1,16 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(CompileDefinitions)
+
+if ("${CMAKE_GENERATOR}" STREQUAL "Visual Studio 6")
+ add_definitions(-DNO_SPACES_IN_DEFINE_VALUES)
+endif()
+
+add_subdirectory(add_definitions_command)
+add_subdirectory(target_prop)
+add_subdirectory(add_definitions_command_with_target_prop)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummyexecutable.cpp" "int main(int, char **) { return 0; }\n")
+
+add_executable(CompileDefinitions "${CMAKE_CURRENT_BINARY_DIR}/dummyexecutable.cpp")
diff --git a/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt
new file mode 100644
index 0000000..a6372af
--- /dev/null
+++ b/Tests/CompileDefinitions/add_definitions_command/CMakeLists.txt
@@ -0,0 +1,7 @@
+
+project(add_definitions_command)
+
+add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun -DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun")
+add_definitions(-DCMAKE_IS_="Fun" -DCMAKE_IS_REALLY="Very Fun" -DCMAKE_IS_FUN -DCMAKE_IS=Fun)
+
+add_executable(add_definitions_command_executable ../compiletest.cpp)
diff --git a/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt
new file mode 100644
index 0000000..e415390
--- /dev/null
+++ b/Tests/CompileDefinitions/add_definitions_command_with_target_prop/CMakeLists.txt
@@ -0,0 +1,14 @@
+
+project(add_definitions_command_with_target_prop)
+
+add_definitions(-DCMAKE_IS_FUN -DCMAKE_IS=Fun)
+
+add_executable(add_definitions_command_with_target_prop_executable ../compiletest.cpp)
+
+set_target_properties(add_definitions_command_with_target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_="Fun")
+
+set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS_REALLY="Very Fun")
+
+add_definitions(-DCMAKE_IS_FUN)
+
+set_property(TARGET add_definitions_command_with_target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS CMAKE_IS=Fun CMAKE_IS_="Fun")
diff --git a/Tests/CompileDefinitions/compiletest.cpp b/Tests/CompileDefinitions/compiletest.cpp
new file mode 100644
index 0000000..6db6f3f
--- /dev/null
+++ b/Tests/CompileDefinitions/compiletest.cpp
@@ -0,0 +1,33 @@
+
+#ifndef CMAKE_IS_FUN
+#error Expect CMAKE_IS_FUN definition
+#endif
+
+#if CMAKE_IS != Fun
+#error Expect CMAKE_IS=Fun definition
+#endif
+
+
+template<bool test>
+struct CMakeStaticAssert;
+
+template<>
+struct CMakeStaticAssert<true> {};
+
+static const char fun_string[] = CMAKE_IS_;
+#ifndef NO_SPACES_IN_DEFINE_VALUES
+static const char very_fun_string[] = CMAKE_IS_REALLY;
+#endif
+
+enum {
+ StringLiteralTest1 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_) == sizeof("Fun")>)
+#ifndef NO_SPACES_IN_DEFINE_VALUES
+ ,
+ StringLiteralTest2 = sizeof(CMakeStaticAssert<sizeof(CMAKE_IS_REALLY) == sizeof("Very Fun")>)
+#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
new file mode 100644
index 0000000..e2b6ba9
--- /dev/null
+++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt
@@ -0,0 +1,9 @@
+
+project(target_prop)
+
+add_executable(target_prop_executable ../compiletest.cpp)
+
+set_target_properties(target_prop_executable PROPERTIES COMPILE_DEFINITIONS CMAKE_IS_FUN)
+
+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")
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 7a76261..33ffe2e 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -6,6 +6,7 @@ include(ExternalProject)
find_package(CVS)
find_package(Subversion)
find_package(Git)
+find_package(Hg)
option(ExternalProjectTest_USE_FOLDERS "Enable folder grouping in IDEs." ON)
if(ExternalProjectTest_USE_FOLDERS)
@@ -511,6 +512,76 @@ if(do_git_tests)
set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
endif()
+set(do_hg_tests 0)
+
+if(HG_EXECUTABLE)
+ set(do_hg_tests 1)
+endif()
+
+if(do_hg_tests)
+ set(local_hg_repo "../../LocalRepositories/HG")
+
+ # Unzip/untar the hg repository in our source folder so that other
+ # projects below may use it to test hg args of ExternalProject_Add
+ #
+ set(proj SetupLocalHGRepository)
+ ExternalProject_Add(${proj}
+ SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/LocalRepositories/HG
+ URL ${CMAKE_CURRENT_SOURCE_DIR}/hgrepo.tgz
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND "${HG_EXECUTABLE}" --version
+ INSTALL_COMMAND ""
+ )
+ set_property(TARGET ${proj}
+ PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
+
+
+ # hg by commit id:
+ #
+ set(proj TutorialStep1-HG-byhash)
+ ExternalProject_Add(${proj}
+ HG_REPOSITORY "${local_hg_repo}"
+ HG_TAG dd2ce38a6b8a
+ UPDATE_COMMAND ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalHGRepository"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "HG")
+
+ # hg by explicit branch/tag name:
+ #
+ set(proj TutorialStep1-HG-bytag)
+ ExternalProject_Add(${proj}
+ HG_REPOSITORY "${local_hg_repo}"
+ HG_TAG "default"
+ UPDATE_COMMAND ""
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalHGRepository"
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "HG")
+
+ # Live hg / tip (no HG_TAG):
+ #
+ # Mercurial 2.1 does not distinguish an empty pull from a failed pull,
+ # so do not run the test with that version.
+ if(NOT "${HG_VERSION_STRING}" STREQUAL "2.1")
+ set(proj TutorialStep1-HG-tip)
+ ExternalProject_Add(${proj}
+ HG_REPOSITORY "${local_hg_repo}"
+ CMAKE_GENERATOR "${CMAKE_GENERATOR}"
+ CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
+ INSTALL_COMMAND ""
+ DEPENDS "SetupLocalHGRepository"
+ LOG_UPDATE 1
+ )
+ set_property(TARGET ${proj} PROPERTY FOLDER "HG")
+ endif()
+endif()
+
# Test the testable built/installed products:
#
@@ -581,5 +652,5 @@ endif()
message(STATUS "can_build_tutorial_step5='${can_build_tutorial_step5}'")
message(STATUS "do_cvs_tests='${do_cvs_tests}'")
message(STATUS "do_svn_tests='${do_svn_tests}'")
-message(STATUS "do_git_tests='${do_git_tests}'")
-message(STATUS "GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+message(STATUS "do_git_tests='${do_git_tests}' GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+message(STATUS "do_hg_tests='${do_hg_tests}' HG_EXECUTABLE='${HG_EXECUTABLE}'")
diff --git a/Tests/ExternalProject/hgrepo.tgz b/Tests/ExternalProject/hgrepo.tgz
new file mode 100644
index 0000000..0d75ce2
--- /dev/null
+++ b/Tests/ExternalProject/hgrepo.tgz
Binary files differ
diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt
new file mode 100644
index 0000000..2b135dc
--- /dev/null
+++ b/Tests/GeneratorExpression/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required (VERSION 2.8.8)
+project(GeneratorExpression NONE)
+
+add_custom_target(check ALL
+ COMMAND ${CMAKE_COMMAND}
+ -Dtest_0=$<0:nothing>
+ -Dtest_1=$<1:content>
+ -Dconfig=$<CONFIGURATION>
+ -Dtest_and_0=$<AND:0>
+ -Dtest_and_0_0=$<AND:0,0>
+ -Dtest_and_0_1=$<AND:0,1>
+ -Dtest_and_1=$<AND:1>
+ -Dtest_and_1_0=$<AND:1,0>
+ -Dtest_and_1_1=$<AND:1,1>
+ -Dtest_config_0=$<CONFIG:$<CONFIGURATION>x>
+ -Dtest_config_1=$<CONFIG:$<CONFIGURATION>>
+ -Dtest_not_0=$<NOT:0>
+ -Dtest_not_1=$<NOT:1>
+ -Dtest_or_0=$<OR:0>
+ -Dtest_or_0_0=$<OR:0,0>
+ -Dtest_or_0_1=$<OR:0,1>
+ -Dtest_or_1=$<OR:1>
+ -Dtest_or_1_0=$<OR:1,0>
+ -Dtest_or_1_1=$<OR:1,1>
+ -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
new file mode 100644
index 0000000..e243d85
--- /dev/null
+++ b/Tests/GeneratorExpression/check.cmake
@@ -0,0 +1,25 @@
+macro(check var val)
+ if(NOT "${${var}}" STREQUAL "${val}")
+ message(SEND_ERROR "${var} is \"${${var}}\", not \"${val}\"")
+ endif()
+endmacro()
+
+message(STATUS "config=[${config}]")
+check(test_0 "")
+check(test_1 "content")
+check(test_and_0 "0")
+check(test_and_0_0 "0")
+check(test_and_0_1 "0")
+check(test_and_1 "1")
+check(test_and_1_0 "0")
+check(test_and_1_1 "1")
+check(test_config_0 "0")
+check(test_config_1 "1")
+check(test_not_0 "1")
+check(test_not_1 "0")
+check(test_or_0 "0")
+check(test_or_0_0 "0")
+check(test_or_0_1 "1")
+check(test_or_1 "1")
+check(test_or_1_0 "1")
+check(test_or_1_1 "1")
diff --git a/Tests/KDE4StableBranchTest/test_kde4.sh.in b/Tests/KDE4StableBranchTest/test_kde4.sh.in
deleted file mode 100755
index bc90b9d..0000000
--- a/Tests/KDE4StableBranchTest/test_kde4.sh.in
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/bin/sh
-
-# This shell script tests whether cmake is able to build the latest
-# stable KDE4 release, or at least some part of it.
-# It downloads automoc from KDE svn, builds and installs it, then it
-# downloads phonon from KDE svn, builds and installs it, and finally
-# it downloads kdelibs (currently from the 4.3 branch), and builds
-# a (small) part of it, i.e. libkdecore and one unit test depending on it.
-#
-# <neundorf AT kde.org>
-
-CMAKE="@CMAKE_CMAKE_COMMAND@"
-BASEDIR="@TEST_KDE4_BASE_DIR@"
-INSTALLDIR="$BASEDIR/install"
-QMAKE="@QT_QMAKE_EXECUTABLE@"
-
-cd "$BASEDIR" || exit -1
-echo "Removing old install dir " $INSTALLDIR
-
-rm -rf install || exit -1
-rm -rf build-automoc || exit -1
-rm -rf build-phonon || exit -1
-rm -rf build-kdelibs || exit -1
-
-
-
-# build and install automoc
-cd "$BASEDIR" || exit -1
-svn co svn://anonsvn.kde.org/home/kde/tags/kdesupport-for-4.3/kdesupport/automoc || exit -1
-
-mkdir -p build-automoc || exit -1
-
-cd build-automoc || exit -1
-"$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DQT_QMAKE_EXECUTABLE:STRING="$QMAKE" ../automoc || exit -1
-"$CMAKE" --build . || exit -1
-"$CMAKE" -P cmake_install.cmake || exit -1
-
-export CMAKE_PREFIX_PATH="$INSTALLDIR:$CMAKE_PREFIX_PATH"
-
-
-# build and install phonon
-cd "$BASEDIR" || exit -1
-svn co svn://anonsvn.kde.org/home/kde/tags/kdesupport-for-4.3/kdesupport/phonon || exit -1
-
-mkdir -p build-phonon || exit -1
-
-cd build-phonon || exit -1
-"$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DQT_QMAKE_EXECUTABLE:STRING="$QMAKE" -DWITH_GLIB2=FALSE -DWITH_GObject=FALSE -DWITH_GStreamer=FALSE -DWITH_GStreamerPlugins=FALSE -DWITH_OpenGL=FALSE -DWITH_XCB=FALSE -DWITH_Xine=FALSE ../phonon || exit -1
-"$CMAKE" --build . || exit -1
-"$CMAKE" -P cmake_install.cmake || exit -1
-
-
-# finally build kdelibs/kdecore
-cd "$BASEDIR" || exit -1
-
-svn co svn://anonsvn.kde.org/home/kde/branches/KDE/4.3/kdelibs/ || exit -1
-mkdir -p build-kdelibs || exit -1
-cd build-kdelibs || exit -1
-# trick cmake into not searching strigi and not searching sharedmimeinfo
-"$CMAKE" -DCMAKE_INSTALL_PREFIX="$INSTALLDIR" -DQT_QMAKE_EXECUTABLE:STRING="$QMAKE" -DSTRIGI_FOUND=TRUE -DSTRIGI_INCLUDE_DIR=/usr/include -DSTRIGI_STREAMANALYZER_LIBRARY=-lc -DSTRIGI_STREAMS_LIBRARY=-lc -DSTRIGI_STRIGIQTDBUSCLIENT_LIBRARY=-lc -DSTRIGI_NEEDS_SIGNED_CHAR=TRUE -DSTRIGI_NEEDS_CHAR=FALSE -DUPDATE_MIME_DATABASE_EXECUTABLE=/bin/sh ../kdelibs || exit -1
-make -C kdecore/tests kurltest || exit -1
-
diff --git a/Tests/Module/CheckTypeSize/CMakeLists.txt b/Tests/Module/CheckTypeSize/CMakeLists.txt
index 45e9f67..abe617a 100644
--- a/Tests/Module/CheckTypeSize/CMakeLists.txt
+++ b/Tests/Module/CheckTypeSize/CMakeLists.txt
@@ -12,7 +12,13 @@ check_type_size(__int64 SIZEOF___INT64)
check_type_size(size_t SIZEOF_SIZE_T)
check_type_size(ssize_t SIZEOF_SSIZE_T)
+set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}")
+set(CMAKE_EXTRA_INCLUDE_FILES somestruct.h)
+check_type_size("((struct somestruct*)0)->someint" SIZEOF_STRUCTMEMBER_INT)
+check_type_size("((struct somestruct*)0)->someptr" SIZEOF_STRUCTMEMBER_PTR)
+check_type_size("((struct somestruct*)0)->somechar" SIZEOF_STRUCTMEMBER_CHAR)
+
configure_file(config.h.in config.h)
-include_directories(${CheckTypeSize_BINARY_DIR})
+include_directories("${CheckTypeSize_BINARY_DIR}")
add_executable(CheckTypeSize CheckTypeSize.c)
diff --git a/Tests/Module/CheckTypeSize/CheckTypeSize.c b/Tests/Module/CheckTypeSize/CheckTypeSize.c
index 602c834..32e395c 100644
--- a/Tests/Module/CheckTypeSize/CheckTypeSize.c
+++ b/Tests/Module/CheckTypeSize/CheckTypeSize.c
@@ -1,4 +1,5 @@
#include "config.h"
+#include "somestruct.h"
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
@@ -29,6 +30,7 @@
int main()
{
int result = 0;
+ struct somestruct x;
/* void* */
#if !defined(HAVE_SIZEOF_DATA_PTR)
@@ -118,5 +120,41 @@ int main()
NODEF(SIZEOF_SSIZE_T);
#endif
- return result;
+ /* struct somestruct::someint */
+#if defined(SIZEOF_STRUCTMEMBER_INT)
+ CHECK(x.someint, SIZEOF_STRUCTMEMBER_INT);
+ CHECK(x.someint, SIZEOF_INT);
+# if !defined(HAVE_SIZEOF_STRUCTMEMBER_INT)
+ NODEF(HAVE_SIZEOF_STRUCTMEMBER_INT);
+# endif
+#elif defined(HAVE_SIZEOF_STRUCTMEMBER_INT)
+ NODEF(SIZEOF_STRUCTMEMBER_INT);
+#endif
+
+ /* struct somestruct::someptr */
+#if defined(SIZEOF_STRUCTMEMBER_PTR)
+ CHECK(x.someptr, SIZEOF_STRUCTMEMBER_PTR);
+ CHECK(x.someptr, SIZEOF_DATA_PTR);
+# if !defined(HAVE_SIZEOF_STRUCTMEMBER_PTR)
+ NODEF(HAVE_SIZEOF_STRUCTMEMBER_PTR);
+# endif
+#elif defined(HAVE_SIZEOF_STRUCTMEMBER_PTR)
+ NODEF(SIZEOF_STRUCTMEMBER_PTR);
+#endif
+
+ /* struct somestruct::someint */
+#if defined(SIZEOF_STRUCTMEMBER_CHAR)
+ CHECK(x.somechar, SIZEOF_STRUCTMEMBER_CHAR);
+ CHECK(x.somechar, SIZEOF_CHAR);
+# if !defined(HAVE_SIZEOF_STRUCTMEMBER_CHAR)
+ NODEF(HAVE_SIZEOF_STRUCTMEMBER_CHAR);
+# endif
+#elif defined(HAVE_SIZEOF_STRUCTMEMBER_CHAR)
+ NODEF(SIZEOF_STRUCTMEMBER_CHAR);
+#endif
+
+ /* to avoid possible warnings about unused or write-only variable */
+ x.someint = result;
+
+ return x.someint;
}
diff --git a/Tests/Module/CheckTypeSize/config.h.in b/Tests/Module/CheckTypeSize/config.h.in
index b5bfbf6..c601075 100644
--- a/Tests/Module/CheckTypeSize/config.h.in
+++ b/Tests/Module/CheckTypeSize/config.h.in
@@ -37,3 +37,15 @@
/* ssize_t */
#cmakedefine HAVE_SIZEOF_SSIZE_T
@SIZEOF_SSIZE_T_CODE@
+
+/* struct somestruct::someint */
+#cmakedefine HAVE_SIZEOF_STRUCTMEMBER_INT
+@SIZEOF_STRUCTMEMBER_INT_CODE@
+
+/* struct somestruct::someptr */
+#cmakedefine HAVE_SIZEOF_STRUCTMEMBER_PTR
+@SIZEOF_STRUCTMEMBER_PTR_CODE@
+
+/* struct somestruct::somechar */
+#cmakedefine HAVE_SIZEOF_STRUCTMEMBER_CHAR
+@SIZEOF_STRUCTMEMBER_CHAR_CODE@
diff --git a/Tests/Module/CheckTypeSize/somestruct.h b/Tests/Module/CheckTypeSize/somestruct.h
new file mode 100644
index 0000000..e08efc4
--- /dev/null
+++ b/Tests/Module/CheckTypeSize/somestruct.h
@@ -0,0 +1,10 @@
+#ifndef _CMAKE_SOMESTRUCT_H
+#define _CMAKE_SOMESTRUCT_H
+
+struct somestruct {
+ int someint;
+ void *someptr;
+ char somechar;
+};
+
+#endif
diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt
index 04ab02f..36c86e7 100644
--- a/Tests/ObjectLibrary/A/CMakeLists.txt
+++ b/Tests/ObjectLibrary/A/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(ObjectLibraryA)
+project(ObjectLibraryA C)
# Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this.
if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM)
diff --git a/Tests/ObjectLibrary/B/CMakeLists.txt b/Tests/ObjectLibrary/B/CMakeLists.txt
index 4b0b07d..32d8ceb 100644
--- a/Tests/ObjectLibrary/B/CMakeLists.txt
+++ b/Tests/ObjectLibrary/B/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(ObjectLibraryB)
+project(ObjectLibraryB C)
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
# VS 6 generator does not use per-target object locations.
set(vs6 _vs6)
diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt
index 7bf9c2d..285d596 100644
--- a/Tests/Properties/CMakeLists.txt
+++ b/Tests/Properties/CMakeLists.txt
@@ -53,15 +53,13 @@ get_property(SOURCERESULT
if (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND
DIRECTORYRESULT AND SOURCERESULT)
add_executable (Properties SubDir/properties3.cxx properties)
-else (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND
- DIRECTORYRESULT AND SOURCERESULT)
+else ()
message(SEND_ERROR
"Error: test results are RESULT1=${RESULT1} RESULT2=${RESULT2} "
"RESULT3=${RESULT3} GLOBALRESULT=${GLOBALRESULT} "
"DIRECTORYRESULT=${DIRECTORYRESULT} "
"SOURCERESULT=${SOURCERESULT}")
-endif (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND
- DIRECTORYRESULT AND SOURCERESULT)
+endif ()
# test the target property
set_property(TARGET Properties PROPERTY TARGETTEST 1)
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index eca96f9..3ea54f1 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -45,6 +45,7 @@ macro(add_RunCMake_test test)
)
endmacro()
+add_RunCMake_test(GeneratorExpression)
add_RunCMake_test(Languages)
add_RunCMake_test(ObjectLibrary)
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-result.txt b/Tests/RunCMake/GeneratorExpression/BadAND-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadAND-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt
new file mode 100644
index 0000000..ced21d8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at BadAND.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<AND:>
+
+ AND requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadAND.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<AND:,>
+
+ AND requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadAND.cmake b/Tests/RunCMake/GeneratorExpression/BadAND.cmake
new file mode 100644
index 0000000..7926540
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadAND.cmake
@@ -0,0 +1,4 @@
+add_custom_target(check ALL COMMAND check
+ $<AND:>
+ $<AND:,>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-result.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
new file mode 100644
index 0000000..7c86b25
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt
@@ -0,0 +1,8 @@
+CMake Error at BadCONFIG.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<CONFIG:.>
+
+ Expression syntax not recognized.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
new file mode 100644
index 0000000..0c13f89
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake
@@ -0,0 +1,3 @@
+add_custom_target(check ALL COMMAND check
+ $<CONFIG:.>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
new file mode 100644
index 0000000..5721f5f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt
@@ -0,0 +1,26 @@
+CMake Error at BadNOT.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<NOT:>
+
+ NOT requires exactly one '0' or '1' value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadNOT.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<NOT:,>
+
+ NOT requires exactly one '0' or '1' value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadNOT.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<NOT:0,1>
+
+ NOT requires exactly one '0' or '1' value.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT.cmake b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake
new file mode 100644
index 0000000..452293b
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake
@@ -0,0 +1,5 @@
+add_custom_target(check ALL COMMAND check
+ $<NOT:>
+ $<NOT:,>
+ $<NOT:0,1>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-result.txt b/Tests/RunCMake/GeneratorExpression/BadOR-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadOR-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt
new file mode 100644
index 0000000..72ef2dd
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt
@@ -0,0 +1,17 @@
+CMake Error at BadOR.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<OR:>
+
+ OR requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Error at BadOR.cmake:1 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<OR:,>
+
+ OR requires one or more comma-separated '0' or '1' values.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)$
diff --git a/Tests/RunCMake/GeneratorExpression/BadOR.cmake b/Tests/RunCMake/GeneratorExpression/BadOR.cmake
new file mode 100644
index 0000000..f16f56a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/BadOR.cmake
@@ -0,0 +1,4 @@
+add_custom_target(check ALL COMMAND check
+ $<OR:>
+ $<OR:,>
+ VERBATIM)
diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt
new file mode 100644
index 0000000..e8db6b0
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/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/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
new file mode 100644
index 0000000..ed18f25
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -0,0 +1,6 @@
+include(RunCMake)
+
+run_cmake(BadCONFIG)
+run_cmake(BadOR)
+run_cmake(BadAND)
+run_cmake(BadNOT)
diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt
index c39be8b..233d5e2 100644
--- a/Utilities/CMakeLists.txt
+++ b/Utilities/CMakeLists.txt
@@ -81,8 +81,7 @@ if(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
string(REPLACE ";" "\\;" _PATH "PATH=${Qt_BIN_DIR};%PATH%")
set(cmake-gui-PATH COMMAND set "${_PATH}")
endif()
-endif(BUILD_QtDialog AND "${CMAKE_GENERATOR}" MATCHES "${WIN_SHELL_GENS}"
- AND EXISTS "${QT_QMAKE_EXECUTABLE}" AND NOT CMAKE_NO_AUTO_QT_ENV)
+endif()
# add the docs for the executables
ADD_DOCS(ctest ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt)