From 26b6794fd5e570a4262a2adcf0c3c48d2c19e6e5 Mon Sep 17 00:00:00 2001 From: Bernhard Walle Date: Tue, 25 Oct 2011 11:15:21 +0200 Subject: [PATCH 01/39] Source/cmCTest.cxx: Add missing newline (#12538) In the log entry, the newline is missing. The output without the newline character is a bit strange, like SetCTestConfigurationFromCMakeVariable:MemoryCheckCommand:CTEST_MEMORYCHECK_COMMANDSetCTestConfiguration:MemoryCheckCommand:/usr/bin/valgrind Instead of SetCTestConfigurationFromCMakeVariable:MemoryCheckCommand:CTEST_MEMORYCHECK_COMMAND SetCTestConfiguration:MemoryCheckCommand:/usr/bin/valgrind This patch changes this to add a newline. Signed-off-by: Bernhard Walle --- Source/cmCTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 702ba10ad..e2e171a14 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2801,7 +2801,7 @@ bool cmCTest::SetCTestConfigurationFromCMakeVariable(cmMakefile* mf, } cmCTestLog(this, HANDLER_VERBOSE_OUTPUT, "SetCTestConfigurationFromCMakeVariable:" - << dconfig << ":" << cmake_var); + << dconfig << ":" << cmake_var << std::endl); this->SetCTestConfiguration(dconfig, ctvar); return true; } From fe6d9c1a448c511559967a6f8467c84d75d89e64 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 25 Oct 2011 23:03:17 +0200 Subject: [PATCH 02/39] FindLibXslt: also search libexslt and xsltproc merging some changes FindLibXslt.cmake from KDE Alex --- Modules/FindLibXslt.cmake | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index 462835a51..1f49c3bda 100644 --- a/Modules/FindLibXslt.cmake +++ b/Modules/FindLibXslt.cmake @@ -5,6 +5,9 @@ # LIBXSLT_INCLUDE_DIR - the LibXslt include directory # LIBXSLT_LIBRARIES - Link these to LibXslt # LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt +# Additionally, the following two variables are set (but not required for using xslt): +# LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library +# LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -23,7 +26,7 @@ # use pkg-config to get the directories and then use these values # in the FIND_PATH() and FIND_LIBRARY() calls FIND_PACKAGE(PkgConfig) -PKG_CHECK_MODULES(PC_LIBXSLT libxslt) +PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt) SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER}) FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h @@ -38,10 +41,22 @@ FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt ${PC_LIBXSLT_LIBRARY_DIRS} ) -# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if +FIND_LIBRARY(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt + HINTS + ${PC_LIBXSLT_LIBDIR} + ${PC_LIBXSLT_LIBRARY_DIRS} + ) + +SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} ) + +FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc) + +# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if # all listed variables are TRUE INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR) -MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES) - +MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR + LIBXSLT_LIBRARIES + LIBXSLT_EXSLT_LIBRARY + LIBXSLT_XSLTPROC_EXECUTABLE) From 2b0f8c7de0c922c98753a3a13d251306aabc9bdb Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 26 Oct 2011 00:01:05 -0400 Subject: [PATCH 03/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index b452f6df3..591df2420 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 25) +SET(KWSYS_DATE_STAMP_DAY 26) From 499c10457282f44d954c8a7385cbf9f8c82d1b08 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 26 Oct 2011 00:19:46 -0400 Subject: [PATCH 04/39] CTest: Clear custom vectors before populating (#12383) Important when calling ctest commands in a loop from a script. Each time Populate gets called, it uses the current definition of the variable. Without the clear, it was accumulating additional identical values each time through the loop. --- Source/cmCTest.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 702ba10ad..2a2cac9a1 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -2526,6 +2526,8 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def, cmSystemTools::ExpandListArgument(dval, slist); std::vector::iterator it; + vec.clear(); + for ( it = slist.begin(); it != slist.end(); ++it ) { cmCTestLog(this, DEBUG, " -- " << it->c_str() << std::endl); From 76ecdd8d169fd2565466669875b5ed7e7c5c1963 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 26 Oct 2011 22:48:36 -0400 Subject: [PATCH 05/39] CTest: Look for CTestConfig.cmake in build dir first, then source dir Provide the ability to configure CTest with settings different from the ones available in the source tree by checking first if CTestConfig.cmake exists in the build tree. The motivation is to allow build system checking out external project to test and/or package them and submit the associated results to a different dashboard than the one specified (or not) in the source of the external project. For example, the build system of Slicer can checkout, build, test and package what I will call "extensions". These extensions can be developed by third parties who can test and submit to their own dashboard / project. When checked out by Slicer build system, the default dashboard can now be overwritten by adding a custom CTestConfig.cmake to the build directory. And if not overwritten, it would avoid to create CTestConfig.cmake within the source checkout of the extension. --- Source/cmCTest.cxx | 32 +++++++++++++++---- Tests/CMakeLists.txt | 29 +++++++++++++++++ .../CMakeLists.txt | 3 ++ .../CTestConfig.cmake | 7 ++++ .../test1.cmake.in | 17 ++++++++++ .../test2.cmake.in | 17 ++++++++++ 6 files changed, 99 insertions(+), 6 deletions(-) create mode 100644 Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt create mode 100644 Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake create mode 100644 Tests/CTestTestConfigFileInBuildDir/test1.cmake.in create mode 100644 Tests/CTestTestConfigFileInBuildDir/test2.cmake.in diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 702ba10ad..aa75453b6 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -655,10 +655,26 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) } cmMakefile* mf = command->GetMakefile(); - std::string fname = src_dir; - fname += "/CTestConfig.cmake"; - cmSystemTools::ConvertToUnixSlashes(fname); - if ( cmSystemTools::FileExists(fname.c_str()) ) + std::string fname; + + std::string src_dir_fname = src_dir; + src_dir_fname += "/CTestConfig.cmake"; + cmSystemTools::ConvertToUnixSlashes(src_dir_fname); + + std::string bld_dir_fname = bld_dir; + bld_dir_fname += "/CTestConfig.cmake"; + cmSystemTools::ConvertToUnixSlashes(bld_dir_fname); + + if ( cmSystemTools::FileExists(bld_dir_fname.c_str()) ) + { + fname = bld_dir_fname; + } + else if ( cmSystemTools::FileExists(src_dir_fname.c_str()) ) + { + fname = src_dir_fname; + } + + if ( !fname.empty() ) { cmCTestLog(this, OUTPUT, " Reading ctest configuration file: " << fname.c_str() << std::endl); @@ -674,8 +690,12 @@ bool cmCTest::InitializeFromCommand(cmCTestStartCommand* command) } else { - cmCTestLog(this, WARNING, "Cannot locate CTest configuration: " - << fname.c_str() << std::endl); + cmCTestLog(this, WARNING, + "Cannot locate CTest configuration: in BuildDirectory: " + << bld_dir_fname.c_str() << std::endl); + cmCTestLog(this, WARNING, + "Cannot locate CTest configuration: in SourceDirectory: " + << src_dir_fname.c_str() << std::endl); } this->SetCTestConfigurationFromCMakeVariable(mf, "NightlyStartTime", diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 78db39d6f..21d1196c0 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1531,6 +1531,35 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES PASS_REGULAR_EXPRESSION "Upload\\.xml") + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" + @ONLY ESCAPE_QUOTES) + ADD_TEST(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log" + ) + SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild + PASS_REGULAR_EXPRESSION + "Reading ctest configuration file: ${CMake_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake") + + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in" + "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" + @ONLY ESCAPE_QUOTES) + CONFIGURE_FILE( + "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake" + "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake" + @ONLY ESCAPE_QUOTES COPYONLY) + ADD_TEST(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND} + -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V + --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log" + ) + SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild + REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake + PASS_REGULAR_EXPRESSION + "Reading ctest configuration file: ${CMake_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake") + # Use macro, not function so that build can still be driven by CMake 2.4. # After 2.6 is required, this could be a function without the extra 'set' # calls. diff --git a/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt b/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt new file mode 100644 index 000000000..3c53e6623 --- /dev/null +++ b/Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(CTestTestConfigFileInBuildDir) +include(CTest) diff --git a/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake new file mode 100644 index 000000000..d2c28f98c --- /dev/null +++ b/Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake @@ -0,0 +1,7 @@ +set(CTEST_PROJECT_NAME "CTestTestConfigFileInBuildDir") +set(CTEST_NIGHTLY_START_TIME "01:00:00 UTC") +set(CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in new file mode 100644 index 000000000..498cab280 --- /dev/null +++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in @@ -0,0 +1,17 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir1") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir1") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in new file mode 100644 index 000000000..d359f2d36 --- /dev/null +++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in @@ -0,0 +1,17 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.8) + +# Settings: +SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +SET(CTEST_SITE "@SITE@") +SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ConfigFileInBuildDir2") + +SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestConfigFileInBuildDir") +SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestConfigFileInBuildDir2") +SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") +SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) From 9a6257a40b8c915cf61d2d4e7f1f5a2e4b7b310a Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 27 Oct 2011 00:01:09 -0400 Subject: [PATCH 06/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 591df2420..1e7a177c1 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 26) +SET(KWSYS_DATE_STAMP_DAY 27) From 30e4a5204fb067f28ae3bc31955f9b8fbc8a2643 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 26 Oct 2011 20:43:21 +0200 Subject: [PATCH 07/39] Tell people that link_directories() is not what they are searching for Judging from the questions I see on the #cmake IRC channel this is one of the most common pitfalls for people coming from other build systems, especially plain Makefiles. Finally put this into the documentation to stop people getting fooled into using this. Text by Brad King. --- Source/cmLinkDirectoriesCommand.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index e5ff4f0f3..aa13589a3 100644 --- a/Source/cmLinkDirectoriesCommand.h +++ b/Source/cmLinkDirectoriesCommand.h @@ -65,7 +65,12 @@ public: "For historical reasons, relative paths given to this command are " "passed to the linker unchanged " "(unlike many CMake commands which interpret them relative to the " - "current source directory)." + "current source directory).\n" + "Note that this command is rarely necessary. Library locations " + "returned by find_package() and find_library() are absolute paths. " + "Pass these absolute library file paths directly to the " + "target_link_libraries() command. CMake will ensure the linker finds " + "them." ; } From 6a6f21412db4b34fdcc4ad4021ec12fa273b7aad Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 28 Oct 2011 00:01:03 -0400 Subject: [PATCH 08/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1e7a177c1..ed9dfce27 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 27) +SET(KWSYS_DATE_STAMP_DAY 28) From ba5c6493d9a2ae1a24df725136395c36850de6f2 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 29 Oct 2011 00:01:10 -0400 Subject: [PATCH 09/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index ed9dfce27..4b7e3f207 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 28) +SET(KWSYS_DATE_STAMP_DAY 29) From b1e9e55c6c56a07a7d8f4380bc5c16a1722e52ca Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 30 Oct 2011 00:01:13 -0400 Subject: [PATCH 10/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 4b7e3f207..4ee0f0b64 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 29) +SET(KWSYS_DATE_STAMP_DAY 30) From e20c59ae5013affa5f80f5f9b76020bdcbd42f4d Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sun, 30 Oct 2011 20:13:20 +0100 Subject: [PATCH 11/39] CPackRPM support component specific variables for spec files This is a modified version of a user patch Inspired-By: informant --- Modules/CPackRPM.cmake | 39 ++++++++++++++++--- .../MyLibCPackConfig-IgnoreGroup.cmake.in | 1 + .../MyLibCPackConfig-OnePackPerGroup.cmake.in | 1 + 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 51c8eace2..36b86cfac 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -4,7 +4,10 @@ # used by CPack : http://www.cmake.org/Wiki/CMake:CPackConfiguration # # However CPackRPM has specific features which are controlled by -# the specifics CPACK_RPM_XXX variables. +# the specifics CPACK_RPM_XXX variables. CPackRPM is a component aware +# generator so when CPACK_RPM_COMPONENT_INSTALL is ON some more +# CPACK_RPM__XXXX variables may be used in order +# to have component specific values. # Usually those vars correspond to RPM spec file entities, one may find # information about spec files here http://www.rpm.org/wiki/Docs. # You'll find a detailed usage of CPackRPM on the wiki: @@ -388,9 +391,33 @@ if(CPACK_RPM_PACKAGE_RELOCATABLE) endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) endif(CPACK_RPM_PACKAGE_RELOCATABLE) -# check if additional fields for RPM spec header are given +# Check if additional fields for RPM spec header are given +# There may be some COMPONENT specific variables as well FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV) - IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + if(CPACK_RPM_PACKAGE_COMPONENT) + if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}) + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}}) + else() + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined") + message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) + endif() + else() + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}) + endif() + + IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH) MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1") STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL) @@ -398,10 +425,10 @@ FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLIC STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME) SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}") IF(CPACK_RPM_PACKAGE_DEBUG) - MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}") + MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") ENDIF(CPACK_RPM_PACKAGE_DEBUG) - SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}}") - ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}) + SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}") +ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP) ENDFOREACH(_RPM_SPEC_HEADER) # CPACK_RPM_SPEC_INSTALL_POST diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index d82943f83..9444a1473 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -7,6 +7,7 @@ endif(CPACK_GENERATOR MATCHES "ZIP") if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") endif(CPACK_GENERATOR MATCHES "RPM") if(CPACK_GENERATOR MATCHES "DEB") diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in index 1e1a410ab..2d251b363 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in @@ -7,6 +7,7 @@ endif(CPACK_GENERATOR MATCHES "ZIP") if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") + set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime") endif(CPACK_GENERATOR MATCHES "RPM") if(CPACK_GENERATOR MATCHES "DEB") From 83b13a250c33bea555556eadc7a9cf9f3c55546b Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sun, 30 Oct 2011 22:34:18 +0100 Subject: [PATCH 12/39] Fix old reference to CMAKE_MAKE_PROGRAM inside CMAKE_BUILD_TOOL doc. --- Source/cmDocumentVariables.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index f4d4e7c5c..f46e1ce1f 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -126,7 +126,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This variable is set to the program that will be" " needed to build the output of CMake. If the " "generator selected was Visual Studio 6, the " - "CMAKE_MAKE_PROGRAM will be set to msdev, for " + "CMAKE_BUILD_TOOL will be set to msdev, for " "Unix makefiles it will be set to make or gmake, " "and for Visual Studio 7 it set to devenv. For " "Nmake Makefiles the value is nmake. This can be " From 07e88ae4499b632222367eb5b4308cac2a89718f Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 31 Oct 2011 00:01:12 -0400 Subject: [PATCH 13/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 4ee0f0b64..6c5746429 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 10) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 30) +SET(KWSYS_DATE_STAMP_DAY 31) From 8c8305f286dab4e374bb8142ee991e00c57e418b Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Mon, 31 Oct 2011 22:07:12 +0100 Subject: [PATCH 14/39] don't crash in automoc with empty COMPILE_DEFINITIONS property Reported by Laszlo Papp: http://www.cmake.org/pipermail/cmake/2011-October/047089.html Alex --- Source/cmQtAutomoc.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index a839489a9..fdc19e40b 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -124,21 +124,22 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) } } - std::string _moc_incs = makefile->GetProperty("INCLUDE_DIRECTORIES"); - std::string _moc_defs = makefile->GetProperty("DEFINITIONS"); - std::string _moc_compile_defs = makefile->GetProperty("COMPILE_DEFINITIONS"); + const char* _moc_incs = makefile->GetProperty("INCLUDE_DIRECTORIES"); + const char* _moc_defs = makefile->GetProperty("DEFINITIONS"); + const char* _moc_compile_defs = makefile->GetProperty("COMPILE_DEFINITIONS"); // forget the variables added here afterwards again: cmMakefile::ScopePushPop varScope(makefile); static_cast(varScope); makefile->AddDefinition("_moc_target_name", automocTargetName.c_str()); - makefile->AddDefinition("_moc_incs", _moc_incs.c_str()); - makefile->AddDefinition("_moc_defs", _moc_defs.c_str()); - makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str()); + makefile->AddDefinition("_moc_incs", _moc_incs!=0 ? _moc_incs : ""); + makefile->AddDefinition("_moc_defs", _moc_defs!=0 ? _moc_defs : ""); + makefile->AddDefinition("_moc_compile_defs", + _moc_compile_defs!=0 ? _moc_compile_defs : ""); makefile->AddDefinition("_moc_files", _moc_files.c_str()); makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); - const char* cmakeRoot = makefile->GetDefinition("CMAKE_ROOT"); + const char* cmakeRoot = makefile->GetSafeDefinition("CMAKE_ROOT"); std::string inputFile = cmakeRoot; inputFile += "/Modules/AutomocInfo.cmake.in"; std::string outputFile = targetDir; From 057633151a527fc614b56f4ca3fd73f63928ebff Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Mon, 31 Oct 2011 23:37:01 +0100 Subject: [PATCH 15/39] Eclipse: make targets work from any directory Set the working directory for make targets which are associated to virtual folders, otherwise Eclipse simply runs make from the current working directory (where Eclipse has been started), and where probably not the correct makefile is located. Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 785e85a61..eab149ead 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -998,7 +998,11 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const std::string virtDir = "[Targets]/"; virtDir += prefix; virtDir += ti->first; - this->AppendTarget(fout, "Build", make, makeArgs, virtDir, "", + std::string buildArgs = "-C "; + buildArgs += makefile->GetHomeOutputDirectory(); + buildArgs += " "; + buildArgs += makeArgs; + this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "", ti->first.c_str()); std::string cleanArgs = "-E chdir \""; From 5e1c2f81a76943cce994f133fca71966aa35c1b4 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 1 Nov 2011 00:01:04 -0400 Subject: [PATCH 16/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 6c5746429..7ed070090 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 10) +SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 31) +SET(KWSYS_DATE_STAMP_DAY 01) From 1ecc55aa7b95a487996654e81d6493e7b72961c0 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 1 Nov 2011 13:59:14 +0100 Subject: [PATCH 17/39] Automoc: fix the fix, need to use std::string, not just char* pointer We need to take a copy of the property values, since the returned char* pointer is reused by the following GetProperty() calls Alex --- Source/cmQtAutomoc.cxx | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index fdc19e40b..e9cc9d154 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -124,18 +124,21 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) } } - const char* _moc_incs = makefile->GetProperty("INCLUDE_DIRECTORIES"); - const char* _moc_defs = makefile->GetProperty("DEFINITIONS"); - const char* _moc_compile_defs = makefile->GetProperty("COMPILE_DEFINITIONS"); + const char* tmp = makefile->GetProperty("INCLUDE_DIRECTORIES"); + std::string _moc_incs = (tmp!=0 ? tmp : ""); + tmp = makefile->GetProperty("DEFINITIONS"); + std::string _moc_defs = (tmp!=0 ? tmp : ""); + tmp = makefile->GetProperty("COMPILE_DEFINITIONS"); + std::string _moc_compile_defs = (tmp!=0 ? tmp : ""); + // forget the variables added here afterwards again: cmMakefile::ScopePushPop varScope(makefile); static_cast(varScope); makefile->AddDefinition("_moc_target_name", automocTargetName.c_str()); - makefile->AddDefinition("_moc_incs", _moc_incs!=0 ? _moc_incs : ""); - makefile->AddDefinition("_moc_defs", _moc_defs!=0 ? _moc_defs : ""); - makefile->AddDefinition("_moc_compile_defs", - _moc_compile_defs!=0 ? _moc_compile_defs : ""); + makefile->AddDefinition("_moc_incs", _moc_incs.c_str()); + makefile->AddDefinition("_moc_defs", _moc_defs.c_str()); + makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str()); makefile->AddDefinition("_moc_files", _moc_files.c_str()); makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); From 52719a1d66db0bbdb17019bcb2ea5ab0a1258e22 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 1 Nov 2011 14:33:11 +0100 Subject: [PATCH 18/39] automoc: fix #12541, support moc options This commit adds a new target property AUTOMOC_MOC_OPTIONS, which can be set to add extra options for the moc invocations done via automoc. This is equivalent to the OPTIONS parameter in the qt4_wrap_cpp() macro. Alex --- Modules/AutomocInfo.cmake.in | 1 + Source/cmQtAutomoc.cxx | 12 ++++++++++++ Source/cmQtAutomoc.h | 2 ++ Source/cmTarget.cxx | 1 + 4 files changed, 16 insertions(+) diff --git a/Modules/AutomocInfo.cmake.in b/Modules/AutomocInfo.cmake.in index 2dc3aa2b3..9c719524f 100644 --- a/Modules/AutomocInfo.cmake.in +++ b/Modules/AutomocInfo.cmake.in @@ -3,6 +3,7 @@ set(AM_HEADERS "@_moc_headers@" ) set(AM_MOC_COMPILE_DEFINITIONS "@_moc_compile_defs@") set(AM_MOC_DEFINITIONS "@_moc_defs@") set(AM_MOC_INCLUDES "@_moc_incs@") +set(AM_MOC_OPTIONS "@_moc_options@") set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_BINARY_DIR "@CMAKE_BINARY_DIR@/") set(AM_CMAKE_SOURCE_DIR "@CMAKE_SOURCE_DIR@/") diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index e9cc9d154..eb89c9071 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -130,6 +130,8 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) std::string _moc_defs = (tmp!=0 ? tmp : ""); tmp = makefile->GetProperty("COMPILE_DEFINITIONS"); std::string _moc_compile_defs = (tmp!=0 ? tmp : ""); + tmp = target->GetProperty("AUTOMOC_MOC_OPTIONS"); + std::string _moc_options = (tmp!=0 ? tmp : ""); // forget the variables added here afterwards again: cmMakefile::ScopePushPop varScope(makefile); @@ -139,6 +141,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) makefile->AddDefinition("_moc_incs", _moc_incs.c_str()); makefile->AddDefinition("_moc_defs", _moc_defs.c_str()); makefile->AddDefinition("_moc_compile_defs", _moc_compile_defs.c_str()); + makefile->AddDefinition("_moc_options", _moc_options.c_str()); makefile->AddDefinition("_moc_files", _moc_files.c_str()); makefile->AddDefinition("_moc_headers", _moc_headers.c_str()); @@ -230,6 +233,7 @@ bool cmQtAutomoc::ReadAutomocInfoFile(cmMakefile* makefile, "AM_MOC_COMPILE_DEFINITIONS"); this->MocDefinitionsStr = makefile->GetSafeDefinition("AM_MOC_DEFINITIONS"); this->MocIncludesStr = makefile->GetSafeDefinition("AM_MOC_INCLUDES"); + this->MocOptionsStr = makefile->GetSafeDefinition("AM_MOC_OPTIONS"); this->ProjectBinaryDir = makefile->GetSafeDefinition("AM_CMAKE_BINARY_DIR"); this->ProjectSourceDir = makefile->GetSafeDefinition("AM_CMAKE_SOURCE_DIR"); this->TargetName = makefile->GetSafeDefinition("AM_TARGET_NAME"); @@ -306,6 +310,8 @@ void cmQtAutomoc::Init() } } + cmSystemTools::ExpandListArgument(this->MocOptionsStr, this->MocOptions); + std::vector incPaths; cmSystemTools::ExpandListArgument(this->MocIncludesStr, incPaths); @@ -715,6 +721,12 @@ bool cmQtAutomoc::GenerateMoc(const std::string& sourceFile, { command.push_back(*it); } + for(std::vector::const_iterator it=this->MocOptions.begin(); + it != this->MocOptions.end(); + ++it) + { + command.push_back(*it); + } #ifdef _WIN32 command.push_back("-DWIN32"); #endif diff --git a/Source/cmQtAutomoc.h b/Source/cmQtAutomoc.h index c3550a42d..db53b2175 100644 --- a/Source/cmQtAutomoc.h +++ b/Source/cmQtAutomoc.h @@ -62,6 +62,7 @@ private: std::string MocCompileDefinitionsStr; std::string MocDefinitionsStr; std::string MocIncludesStr; + std::string MocOptionsStr; std::string ProjectBinaryDir; std::string ProjectSourceDir; std::string TargetName; @@ -71,6 +72,7 @@ private: std::string OutMocCppFilename; std::list MocIncludes; std::list MocDefinitions; + std::vector MocOptions; bool Verbose; bool ColorOutput; diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f7d3ba961..e8064d031 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1179,6 +1179,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) this->SetPropertyDefault("Fortran_MODULE_DIRECTORY", 0); this->SetPropertyDefault("OSX_ARCHITECTURES", 0); this->SetPropertyDefault("AUTOMOC", 0); + this->SetPropertyDefault("AUTOMOC_MOC_OPTIONS", 0); this->SetPropertyDefault("LINK_INTERFACE_LIBRARIES", 0); // Collect the set of configuration types. From 13d19468d03bfea1b886c5473e8fcafa09cf2e3a Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 1 Nov 2011 10:48:12 -0400 Subject: [PATCH 19/39] KWSys: Address Intel compiler remarks CommandLineArguments.cxx: remark #181: argument is incompatible with corresponding format string conversion SystemInformation.cxx: remark #193: zero used for undefined preprocessing identifier "_WIN32" warning #177: variable "Regebx" was declared but never referenced SystemTools.cxx(375): remark #444: destructor for base class "std::vector" is not virtual class kwsysDeletingCharVector : private kwsys_stl::vector Author: Hans Johnson Change-Id: Ibc899c3ba14990158ef7bbabace4b435b22495c3 --- Source/kwsys/CommandLineArguments.cxx | 2 +- Source/kwsys/SystemInformation.cxx | 45 ++++++++++++--------------- Source/kwsys/SystemTools.cxx | 8 +++++ 3 files changed, 29 insertions(+), 26 deletions(-) diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx index 9f43a47c8..ece88ae89 100644 --- a/Source/kwsys/CommandLineArguments.cxx +++ b/Source/kwsys/CommandLineArguments.cxx @@ -592,7 +592,7 @@ void CommandLineArguments::GenerateHelp() // Create format for that string char format[80]; - sprintf(format, " %%-%ds ", static_cast(maxlen)); + sprintf(format, " %%-%us ", static_cast(maxlen)); maxlen += 4; // For the space before and after the option diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 9bc659e22..d49c0d73c 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -72,7 +72,7 @@ # include // int isdigit(int c); # include // extern int errno; # include -#elif __hpux +#elif defined( __hpux ) # include # include #endif @@ -1454,7 +1454,7 @@ bool SystemInformationImplementation::RetrieveCPUClockSpeed() { bool retrieved = false; -#if _WIN32 +#if defined(_WIN32) // First of all we check to see if the RDTSC (0x0F, 0x31) instruction is // supported. If not, we fallback to trying to read this value from the // registry: @@ -2389,7 +2389,7 @@ int SystemInformationImplementation::QueryMemory() this->AvailablePhysicalMemory = 0; #ifdef __CYGWIN__ return 0; -#elif _WIN32 +#elif defined(_WIN32) #if _MSC_VER < 1300 MEMORYSTATUS ms; unsigned long tv, tp, av, ap; @@ -2415,7 +2415,7 @@ int SystemInformationImplementation::QueryMemory() this->AvailableVirtualMemory = av>>10>>10; this->AvailablePhysicalMemory = ap>>10>>10; return 1; -#elif __linux +#elif defined(__linux) unsigned long tv=0; unsigned long tp=0; unsigned long av=0; @@ -2532,7 +2532,7 @@ int SystemInformationImplementation::QueryMemory() } fclose( fd ); return 1; -#elif __hpux +#elif defined(__hpux) unsigned long tv=0; unsigned long tp=0; unsigned long av=0; @@ -2639,7 +2639,7 @@ LongLong SystemInformationImplementation::GetCyclesDifference (DELAY_FUNC DelayF /** Compute the delay overhead */ void SystemInformationImplementation::DelayOverhead(unsigned int uiMS) { -#if _WIN32 +#if defined(_WIN32) LARGE_INTEGER Frequency, StartCounter, EndCounter; __int64 x; @@ -2664,10 +2664,19 @@ void SystemInformationImplementation::DelayOverhead(unsigned int uiMS) /** Return the number of logical CPU per physical CPUs Works only for windows */ unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void) { +#ifdef __APPLE__ + size_t len = 4; + int cores_per_package = 0; + int err = sysctlbyname("machdep.cpu.cores_per_package", &cores_per_package, &len, NULL, 0); + if (err != 0) + { + return 1; // That name was not found, default to 1 + } + return static_cast(cores_per_package); +#else unsigned int Regebx = 0; - #if USE_ASM_INSTRUCTIONS - if (!this->IsHyperThreadingSupported()) + if (!this->IsHyperThreadingSupported()) { return static_cast(1); // HT not supported } @@ -2678,22 +2687,8 @@ unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void) mov Regebx, ebx } #endif - -#ifdef __APPLE__ - size_t len = 4; - int cores_per_package = 0; - int err = sysctlbyname("machdep.cpu.cores_per_package", &cores_per_package, &len, NULL, 0); - if (err != 0) - { - return 1; // That name was not found, default to 1 - } - else - { - return static_cast(cores_per_package); - } -#endif - return static_cast ((Regebx & NUM_LOGICAL_BITS) >> 16); +#endif } @@ -2769,7 +2764,7 @@ unsigned char SystemInformationImplementation::GetAPICId() /** Count the number of CPUs. Works only on windows. */ int SystemInformationImplementation::CPUCount() { -#if _WIN32 +#if defined(_WIN32) unsigned char StatusFlag = 0; SYSTEM_INFO info; @@ -3359,7 +3354,7 @@ bool SystemInformationImplementation::QueryQNXProcessor() /** Query the operating system information */ bool SystemInformationImplementation::QueryOSInformation() { -#if _WIN32 +#if defined(_WIN32) this->OSName = "Windows"; diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 695949a34..1bf19c057 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -371,6 +371,10 @@ bool SystemTools::GetEnv(const char* key, kwsys_stl::string& result) } } +#ifdef INTEL_COMPILER +#pragma warning disable 444 +#endif + class kwsysDeletingCharVector : public kwsys_stl::vector { public: @@ -399,6 +403,10 @@ bool SystemTools::PutEnv(const char* value) return ret == 0; } +#ifdef INTEL_COMPILER +#pragma warning restore 444 +#endif + const char* SystemTools::GetExecutableExtension() { From b0f0b3e4405cb663fd5757441f556ee6cd3fac8c Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Mon, 31 Oct 2011 19:04:08 -0500 Subject: [PATCH 20/39] VS: Add VS_SCC_AUXPATH target property (#12549) Maps to SccAuxPath tag in VCPROJ files. --- Source/cmLocalVisualStudio7Generator.cxx | 7 +++++++ Source/cmSetTargetPropertiesCommand.h | 3 ++- Source/cmTarget.cxx | 7 ++++++- Source/cmVisualStudio10TargetGenerator.cxx | 10 +++++++++- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index d9b277298..ae7075955 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -1811,11 +1811,18 @@ void cmLocalVisualStudio7Generator::WriteProjectSCC(std::ostream& fout, const char* vsProjectname = target.GetProperty("VS_SCC_PROJECTNAME"); const char* vsLocalpath = target.GetProperty("VS_SCC_LOCALPATH"); const char* vsProvider = target.GetProperty("VS_SCC_PROVIDER"); + if(vsProvider && vsLocalpath && vsProjectname) { fout << "\tSccProjectName=\"" << vsProjectname << "\"\n" << "\tSccLocalPath=\"" << vsLocalpath << "\"\n" << "\tSccProvider=\"" << vsProvider << "\"\n"; + + const char* vsAuxPath = target.GetProperty("VS_SCC_AUXPATH"); + if(vsAuxPath) + { + fout << "\tSccAuxPath=\"" << vsAuxPath << "\"\n"; + } } } diff --git a/Source/cmSetTargetPropertiesCommand.h b/Source/cmSetTargetPropertiesCommand.h index 320378d05..f001a1111 100644 --- a/Source/cmSetTargetPropertiesCommand.h +++ b/Source/cmSetTargetPropertiesCommand.h @@ -140,7 +140,8 @@ public: "the target in an IDE like visual studio. VS_KEYWORD can be set " "to change the visual studio keyword, for example QT integration " "works better if this is set to Qt4VSv1.0.\n" - "VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER can be set " + "VS_SCC_PROJECTNAME, VS_SCC_LOCALPATH, VS_SCC_PROVIDER and " + "VS_SCC_AUXPATH can be set " "to add support for source control bindings in a Visual Studio " "project file.\n" "VS_GLOBAL_ can be set to add a Visual Studio " diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index f7d3ba961..6bf7ec94b 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1011,7 +1011,7 @@ void cmTarget::DefineProperties(cmake *cm) "provider property."); cm->DefineProperty ("VS_SCC_LOCALPATH", cmProperty::TARGET, - "Visual Studio Source Code Control Provider.", + "Visual Studio Source Code Control Local Path.", "Can be set to change the visual studio source code control " "local path property."); cm->DefineProperty @@ -1019,6 +1019,11 @@ void cmTarget::DefineProperties(cmake *cm) "Visual Studio Source Code Control Project.", "Can be set to change the visual studio source code control " "project name property."); + cm->DefineProperty + ("VS_SCC_AUXPATH", cmProperty::TARGET, + "Visual Studio Source Code Control Aux Path.", + "Can be set to change the visual studio source code control " + "auxpath property."); cm->DefineProperty ("VS_GLOBAL_", cmProperty::TARGET, "Visual Studio project-specific global variable.", diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 551b0adef..45a79c81f 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -182,7 +182,7 @@ void cmVisualStudio10TargetGenerator::Generate() const char* vsLocalPath = this->Target->GetProperty("VS_SCC_LOCALPATH"); const char* vsProvider = this->Target->GetProperty("VS_SCC_PROVIDER"); - if ( vsProjectName && vsLocalPath && vsProvider) + if( vsProjectName && vsLocalPath && vsProvider ) { this->WriteString("", 2); (*this->BuildFileStream) << cmVS10EscapeXML(vsProjectName) << @@ -193,6 +193,14 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("", 2); (*this->BuildFileStream) << cmVS10EscapeXML(vsProvider) << "\n"; + + const char* vsAuxPath = this->Target->GetProperty("VS_SCC_AUXPATH"); + if( vsAuxPath ) + { + this->WriteString("", 2); + (*this->BuildFileStream) << cmVS10EscapeXML(vsAuxPath) << + "\n"; + } } this->WriteString("Win32Proj\n", 2); From 9cfc920973b6e479e3ba30e6b89e26ddea4d892f Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 28 Oct 2011 17:31:30 +0100 Subject: [PATCH 21/39] Match fixup_qt4_executable with documentation. --- Modules/DeployQt4.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index bdf83604a..3e20d3457 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -56,7 +56,7 @@ # (or ) relative to and store the result in # . See documentation of INSTALL_QT4_PLUGIN_PATH. # -# INSTALL_QT4_EXECUTABLE( [ ]) +# INSTALL_QT4_EXECUTABLE( [ ]) # Installs Qt plugins, writes a Qt configuration file (if needed) and fixes up # a Qt4 executable using BundleUtilities so it is standalone and can be # drag-and-drop copied to another machine as long as all of the system @@ -106,7 +106,8 @@ function(resolve_qt4_paths paths_var) set(${paths_var} ${paths_resolved} PARENT_SCOPE) endfunction() -function(fixup_qt4_executable executable qtplugins) +function(fixup_qt4_executable executable) + set(qtplugins ${ARGV1}) set(libs ${ARGV2}) set(dirs ${ARGV3}) set(plugins_dir ${ARGV4}) From 4571ea6e4d0ecbf25ac7cfa63715cc931f0f17d0 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 28 Oct 2011 17:32:28 +0100 Subject: [PATCH 22/39] Don't resolve directories; are never relative. --- Modules/DeployQt4.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index 3e20d3457..ef8dd1f1a 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -151,7 +151,6 @@ function(fixup_qt4_executable executable) endforeach() resolve_qt4_paths(libs "${executable_path}") - resolve_qt4_paths(dirs "${executable_path}") if(write_qt_conf) set(qt_conf_contents "[Paths]\nPlugins = ${plugins_dir}") @@ -265,7 +264,6 @@ function(install_qt4_executable executable) endforeach() resolve_qt4_paths(libs) - resolve_qt4_paths(dirs) install(CODE " INCLUDE( \"${DeployQt4_cmake_dir}/DeployQt4.cmake\" ) From 467ee368402b73756ac1b662b86cd0eee95bbe07 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Fri, 28 Oct 2011 17:33:21 +0100 Subject: [PATCH 23/39] Check plugin variables are defined before warning. --- Modules/DeployQt4.cmake | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Modules/DeployQt4.cmake b/Modules/DeployQt4.cmake index ef8dd1f1a..4bf1b6c4b 100644 --- a/Modules/DeployQt4.cmake +++ b/Modules/DeployQt4.cmake @@ -225,9 +225,11 @@ function(install_qt4_plugin plugin executable copy installed_plugin_path_var) else() string(TOUPPER "QT_${plugin}_PLUGIN" plugin_var) endif() - set(plugin_release "${${plugin_var}_RELEASE}") - set(plugin_debug "${${plugin_var}_DEBUG}") - if(NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") + set(plugin_release_var "${plugin_var}_RELEASE") + set(plugin_debug_var "${plugin_var}_DEBUG") + set(plugin_release "${${plugin_release_var}}") + set(plugin_debug "${${plugin_debug_var}}") + if(DEFINED "${plugin_release_var}" AND DEFINED "${plugin_debug_var}" AND NOT EXISTS "${plugin_release}" AND NOT EXISTS "${plugin_debug}") message(WARNING "Qt plugin \"${plugin}\" not recognized or found.") endif() install_qt4_plugin_path("${plugin_release}" "${executable}" "${copy}" "${installed_plugin_path_var}" "${plugins_dir}" "${component}" "Release|RelWithDebInfo|MinSizeRel") From 2c648ab7e204540a8a669b597cc7d3510c84647e Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 1 Nov 2011 19:54:04 +0100 Subject: [PATCH 24/39] add documentation for the AUTOMOC_MOC_OPTIONS property Alex --- Source/cmDocumentVariables.cxx | 9 +++++++++ Source/cmTarget.cxx | 15 ++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index f4d4e7c5c..a759a82e8 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -1102,6 +1102,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm) false, "Variables that Control the Build"); + cm->DefineProperty + ("CMAKE_AUTOMOC_MOC_OPTIONS", cmProperty::VARIABLE, + "Additional options for moc when using automoc (see CMAKE_AUTOMOC).", + "This variable is used to initialize the " + "AUTOMOC_MOC_OPTIONS property on all the targets. " + "See that target property for additional information.", + false, + "Variables that Control the Build"); + cm->DefineProperty ("CMAKE_DEBUG_POSTFIX", cmProperty::VARIABLE, "See variable CMAKE__POSTFIX.", diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index e8064d031..d669a5b60 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -157,7 +157,20 @@ void cmTarget::DefineProperties(cmake *cm) "files are included in a generated _automoc.cpp file, " "which is compiled as part of the target." "This property is initialized by the value of the variable " - "CMAKE_AUTOMOC if it is set when a target is created."); + "CMAKE_AUTOMOC if it is set when a target is created.\n" + "Additional command line options for moc can be set via the " + "AUTOMOC_MOC_OPTIONS property." + ); + + cm->DefineProperty + ("AUTOMOC_MOC_OPTIONS", cmProperty::TARGET, + "Additional options for moc when using automoc (see the AUTOMOC property)", + "This property is only used if the AUTOMOC property is set to TRUE for " + "this target. In this case, it holds additional command line options " + "which will be used when moc is executed during the build, i.e. it is " + "equivalent to the optional OPTIONS argument of the qt4_wrap_cpp() " + "macro.\n" + "By default it is empty."); cm->DefineProperty ("BUILD_WITH_INSTALL_RPATH", cmProperty::TARGET, From 4b930220be0c0b2391a33336a37525154f6b402d Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 1 Nov 2011 10:41:23 +0100 Subject: [PATCH 25/39] Eclipse: warn if CMAKE_BINARY_DIR is subdir of CMAKE_SOURCE_DIR Eclipse doesn't handle this case well. When doing out-of-source builds we create a linked resource which points to CMAKE_SOURCE_DIR, so the user can browse the source dir in Eclipse. This is not possible when the build dir is a subdir of the source dir. Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index 785e85a61..0667da75d 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -87,6 +87,16 @@ void cmExtraEclipseCDT4Generator::Generate() this->GenerateSourceProject = (this->IsOutOfSourceBuild && mf->IsOn("ECLIPSE_CDT4_GENERATE_SOURCE_PROJECT")); + if (cmSystemTools::IsSubDirectory(this->HomeOutputDirectory.c_str(), + this->HomeDirectory.c_str())) + { + mf->IssueMessage(cmake::WARNING, "The build directory is a subdirectory " + "of the source directory.\n" + "This is not supported well by Eclipse. It is strongly " + "recommended to use a build directory which is a " + "sibling of the source directory."); + } + // NOTE: This is not good, since it pollutes the source tree. However, // Eclipse doesn't allow CVS/SVN to work when the .project is not in // the cvs/svn root directory. Hence, this is provided as an option. From d31b1aca3fcf5d8c0e7ab5cbb37045ad87dead79 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 1 Nov 2011 21:23:52 +0100 Subject: [PATCH 26/39] Eclipse: quote the build dir (to make it work with spaces) When creating the targets for Eclipse, quote the directory in which make should change. Otherwise it will fail if the path contains with spaces. Alex --- Source/cmExtraEclipseCDT4Generator.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmExtraEclipseCDT4Generator.cxx b/Source/cmExtraEclipseCDT4Generator.cxx index eab149ead..a338031d8 100644 --- a/Source/cmExtraEclipseCDT4Generator.cxx +++ b/Source/cmExtraEclipseCDT4Generator.cxx @@ -998,9 +998,9 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const std::string virtDir = "[Targets]/"; virtDir += prefix; virtDir += ti->first; - std::string buildArgs = "-C "; + std::string buildArgs = "-C \""; buildArgs += makefile->GetHomeOutputDirectory(); - buildArgs += " "; + buildArgs += "\" "; buildArgs += makeArgs; this->AppendTarget(fout, "Build", make, buildArgs, virtDir, "", ti->first.c_str()); From d4afce1ddd0a5f8c5bdc5b59d24344d61016aa99 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 2 Nov 2011 00:01:05 -0400 Subject: [PATCH 27/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 7ed070090..2598efd5a 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 01) +SET(KWSYS_DATE_STAMP_DAY 02) From e74f3744ae25b5be2bf6e4c33a0420d836a2f37d Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 2 Nov 2011 08:58:41 -0400 Subject: [PATCH 28/39] Fix linking to OS X Frameworks named with spaces (#12550) Teach cmComputeLinkInformation to generate the "-framework" option as a separate link item preceding the actual framework name. Then escape the framework name to pass as an argument through a shell. This fixes the link line for frameworks with spaces in the name. The build system generators that call cli.GetItems() and generate the final list of items on the link line already handle escaping correctly for items that are paths. However, for raw link items like "-lfoo" they just pass through to the command line verbatim. This is incorrect. The generators should escape these items too. Unfortunately we cannot fix that without introducing a new CMake Policy because projects may already be passing raw link flags with their own escapes to work around this bug. Therefore we punt on this bug for now and go with the above fix. --- Source/cmComputeLinkInformation.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx index c87b64d15..f8ab6869a 100644 --- a/Source/cmComputeLinkInformation.cxx +++ b/Source/cmComputeLinkInformation.cxx @@ -1318,8 +1318,9 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item) this->AddFrameworkPath(this->SplitFramework.match(1)); // Add the item using the -framework option. - std::string fw = "-framework "; - fw += this->SplitFramework.match(2); + this->Items.push_back(Item("-framework", false)); + std::string fw = this->SplitFramework.match(2); + fw = this->LocalGenerator->EscapeForShell(fw.c_str()); this->Items.push_back(Item(fw, false)); } From 22bf096474dbd819e4a10cc3b45fa54ba50213d0 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 3 Nov 2011 00:01:05 -0400 Subject: [PATCH 29/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 2598efd5a..dba5d4a5e 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 02) +SET(KWSYS_DATE_STAMP_DAY 03) From 23381d83d8d8399eea372e3f2407beac39e55b98 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 3 Nov 2011 08:59:50 -0400 Subject: [PATCH 30/39] Watcom: Use shortpath to CMake if full path has parens (#12548) The Watcom WMake tool has trouble running commands in paths that have parentheses. We already convert most commands to a shortpath for Watcom if the path contains a space, but the use of $(CMAKE_COMMAND) hides the true path from that conversion. Factor the shortpath conversion code out into a new ConvertShellCommand method. Teach it to convert paths that contain parentheses as well as spaces. Use the new method to convert the value of $(CMAKE_COMMAND) and other helper variables. --- Source/cmLocalUnixMakefileGenerator3.cxx | 42 ++++++++++++++---------- Source/cmLocalUnixMakefileGenerator3.h | 1 + 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index da6a1c643..c8a06aa71 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -607,6 +607,27 @@ cmLocalUnixMakefileGenerator3 } } +//---------------------------------------------------------------------------- +std::string +cmLocalUnixMakefileGenerator3 +::ConvertShellCommand(std::string const& cmd, RelativeRoot root) +{ + if(this->WatcomWMake && + cmSystemTools::FileIsFullPath(cmd.c_str()) && + cmd.find_first_of("( )") != cmd.npos) + { + // On Watcom WMake use the windows short path for the command + // name. This is needed to avoid funny quoting problems on + // lines with shell redirection operators. + std::string scmd; + if(cmSystemTools::GetShortPath(cmd.c_str(), scmd)) + { + return this->Convert(scmd.c_str(), NONE, SHELL); + } + } + return this->Convert(cmd.c_str(), root, SHELL); +} + //---------------------------------------------------------------------------- void cmLocalUnixMakefileGenerator3 @@ -646,13 +667,13 @@ cmLocalUnixMakefileGenerator3 makefileStream << "# The CMake executable.\n" << "CMAKE_COMMAND = " - << this->Convert(cmakecommand.c_str(), FULL, SHELL).c_str() + << this->ConvertShellCommand(cmakecommand, FULL) << "\n" << "\n"; makefileStream << "# The command to remove a file.\n" << "RM = " - << this->Convert(cmakecommand.c_str(),FULL,SHELL).c_str() + << this->ConvertShellCommand(cmakecommand, FULL) << " -E remove -f\n" << "\n"; @@ -662,7 +683,7 @@ cmLocalUnixMakefileGenerator3 makefileStream << "# The program to use to edit the cache.\n" << "CMAKE_EDIT_COMMAND = " - << this->Convert(edit_cmd,FULL,SHELL) << "\n" + << this->ConvertShellCommand(edit_cmd, FULL) << "\n" << "\n"; } @@ -1019,22 +1040,9 @@ cmLocalUnixMakefileGenerator3 // without the current directory being in the search path. cmd = "./" + cmd; } - if(this->WatcomWMake && - cmSystemTools::FileIsFullPath(cmd.c_str()) && - cmd.find(" ") != cmd.npos) - { - // On Watcom WMake use the windows short path for the command - // name. This is needed to avoid funny quoting problems on - // lines with shell redirection operators. - std::string scmd; - if(cmSystemTools::GetShortPath(cmd.c_str(), scmd)) - { - cmd = scmd; - } - } std::string launcher = this->MakeLauncher(cc, target, workingDir? NONE : START_OUTPUT); - cmd = launcher + this->Convert(cmd.c_str(),NONE,SHELL); + cmd = launcher + this->ConvertShellCommand(cmd, NONE); ccg.AppendArguments(c, cmd); if(content) diff --git a/Source/cmLocalUnixMakefileGenerator3.h b/Source/cmLocalUnixMakefileGenerator3.h index fab98da0e..45ac21de3 100644 --- a/Source/cmLocalUnixMakefileGenerator3.h +++ b/Source/cmLocalUnixMakefileGenerator3.h @@ -340,6 +340,7 @@ protected: void CheckMultipleOutputs(bool verbose); private: + std::string ConvertShellCommand(std::string const& cmd, RelativeRoot root); std::string MakeLauncher(const cmCustomCommand& cc, cmTarget* target, RelativeRoot relative); From 83d02ee52b60e541d2f52feff0c0858e7e7595e8 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 3 Nov 2011 22:55:42 +0100 Subject: [PATCH 31/39] make automoc work when using ccmake via PATH (#12551) In ccmake, cmake::GetCMakeCommand() returns "/cmake" when ccmake was started from the PATH, i.e. by simply running "ccmake" Alex --- Source/cmQtAutomoc.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmQtAutomoc.cxx b/Source/cmQtAutomoc.cxx index a839489a9..8750b640e 100644 --- a/Source/cmQtAutomoc.cxx +++ b/Source/cmQtAutomoc.cxx @@ -67,7 +67,7 @@ void cmQtAutomoc::SetupAutomocTarget(cmTarget* target) targetDir += ".dir/"; cmCustomCommandLine currentLine; - currentLine.push_back(makefile->GetCMakeInstance()->GetCMakeCommand()); + currentLine.push_back(makefile->GetSafeDefinition("CMAKE_COMMAND")); currentLine.push_back("-E"); currentLine.push_back("cmake_automoc"); currentLine.push_back(targetDir); From ae09bab3d6c6c00710df9e2539a3129896ee9513 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 4 Nov 2011 00:01:05 -0400 Subject: [PATCH 32/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index dba5d4a5e..36d380c5e 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 03) +SET(KWSYS_DATE_STAMP_DAY 04) From 6d51f5fa3c34d3c8f5b188b3ab9e5d385d1f02a4 Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Fri, 4 Nov 2011 19:49:40 +0100 Subject: [PATCH 33/39] Fix typo. --- Source/cmLocalUnixMakefileGenerator3.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index da6a1c643..64d8e7d13 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -697,7 +697,7 @@ cmLocalUnixMakefileGenerator3 // This should be the first target except for the default_target in // the interface Makefile. this->WriteMakeRule( - makefileStream, "Disable implicit rules so canoncical targets will work.", + makefileStream, "Disable implicit rules so canonical targets will work.", ".SUFFIXES", no_depends, no_commands, false); if(!this->NMake && !this->WatcomWMake && !this->BorlandMakeCurlyHack) From 0727f38f71aa1583fd4724955ebe6001dfabd399 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 5 Nov 2011 00:01:10 -0400 Subject: [PATCH 34/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 36d380c5e..1095e5c09 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 04) +SET(KWSYS_DATE_STAMP_DAY 05) From 9066886f9b88744e49721c8ac9cf0a8bf50e72fe Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sat, 5 Nov 2011 11:40:47 +0100 Subject: [PATCH 35/39] CPackRPM fix #12556 and enhance documentation Inspired-By: Chip Christian --- Modules/CPackRPM.cmake | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 36b86cfac..bb1021b73 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -7,7 +7,9 @@ # the specifics CPACK_RPM_XXX variables. CPackRPM is a component aware # generator so when CPACK_RPM_COMPONENT_INSTALL is ON some more # CPACK_RPM__XXXX variables may be used in order -# to have component specific values. +# to have component specific values. Note however that +# refers to the **grouping name**. This may be either a component name +# or a component GROUP name. # Usually those vars correspond to RPM spec file entities, one may find # information about spec files here http://www.rpm.org/wiki/Docs. # You'll find a detailed usage of CPackRPM on the wiki: @@ -101,9 +103,11 @@ # If CPACK_SET_DESTDIR is set then you will get a warning message # but if there is file installed with absolute path you'll get # unexpected behavior. -# CPACK_RPM_SPEC_INSTALL_POST +# CPACK_RPM_SPEC_INSTALL_POST [deprecated] # Mandatory : NO # Default : - +# This way of specifying post-install script is deprecated use +# CPACK_RPM_POST_INSTALL_SCRIPT_FILE # May be used to set an RPM post-install command inside the spec file. # For example setting it to "/bin/true" may be used to prevent # rpmbuild to strip binaries. @@ -161,7 +165,7 @@ # Mandatory : NO # Default : - # May be used to embed a changelog in the spec file. -# The refered file will be read and directly put after the %changelog +# The refered file will be read and directly put after the %changelog # section. #============================================================================= @@ -462,20 +466,31 @@ else(CPACK_RPM_PACKAGE_COMPONENT) set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE}) endif(CPACK_RPM_PACKAGE_COMPONENT) + +# Handle post-install file if it has been specified if(CPACK_RPM_POST_INSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL) else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE}) +else(CPACK_RPM_POST_INSTALL_READ_FILE) + # reset SPEC var value if no post install file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_POSTINSTALL "") endif(CPACK_RPM_POST_INSTALL_READ_FILE) +# Handle post-uninstall file if it has been specified if(CPACK_RPM_POST_UNINSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL) else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE}) +else(CPACK_RPM_POST_UNINSTALL_READ_FILE) + # reset SPEC var value if no post uninstall file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_POSTUNINSTALL "") endif(CPACK_RPM_POST_UNINSTALL_READ_FILE) # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM__PRE_INSTALL_SCRIPT_FILE) @@ -498,20 +513,31 @@ else(CPACK_RPM_PACKAGE_COMPONENT) set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE}) set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE}) endif(CPACK_RPM_PACKAGE_COMPONENT) + +# Handle pre-install file if it has been specified if(CPACK_RPM_PRE_INSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL) else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE}) +else(CPACK_RPM_PRE_INSTALL_READ_FILE) + # reset SPEC var value if no pre-install file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_PREINSTALL "") endif(CPACK_RPM_PRE_INSTALL_READ_FILE) +# Handle pre-uninstall file if it has been specified if(CPACK_RPM_PRE_UNINSTALL_READ_FILE) if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL) else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring") endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE}) +else(CPACK_RPM_PRE_UNINSTALL_READ_FILE) + # reset SPEC var value if no pre-uninstall file has been specified + # (either globally or component-wise) + set(CPACK_RPM_SPEC_PREUNINSTALL "") endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE) # CPACK_RPM_CHANGELOG_FILE From fce8e81895454c31273921baec2cc6acd9e962a9 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 6 Nov 2011 00:01:04 -0400 Subject: [PATCH 36/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1095e5c09..b4e55d468 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 05) +SET(KWSYS_DATE_STAMP_DAY 06) From 3de9669e1bda83e9960d224aa466d476e58b2ba7 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 7 Nov 2011 00:01:06 -0500 Subject: [PATCH 37/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index b4e55d468..7d3eeb45d 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 06) +SET(KWSYS_DATE_STAMP_DAY 07) From 7fe3484f20652169b57b131d6c51a0a0e7eb0a8c Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 8 Nov 2011 00:01:13 -0500 Subject: [PATCH 38/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 7d3eeb45d..38b971922 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 07) +SET(KWSYS_DATE_STAMP_DAY 08) From 5675ec5e493e01e10d9ad8d8b60eac62033f31c2 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 9 Nov 2011 00:01:05 -0500 Subject: [PATCH 39/39] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 38b971922..c032d828e 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2011) SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 08) +SET(KWSYS_DATE_STAMP_DAY 09)