diff options
-rw-r--r-- | Modules/FindLibXslt.cmake | 23 | ||||
-rw-r--r-- | Source/cmCTest.cxx | 36 | ||||
-rw-r--r-- | Source/cmLinkDirectoriesCommand.h | 7 | ||||
-rw-r--r-- | Source/kwsys/CommandLineArguments.cxx | 2 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 45 | ||||
-rw-r--r-- | Source/kwsys/SystemTools.cxx | 8 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 4 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 29 | ||||
-rw-r--r-- | Tests/CTestTestConfigFileInBuildDir/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/CTestTestConfigFileInBuildDir/CTestConfig.cmake | 7 | ||||
-rw-r--r-- | Tests/CTestTestConfigFileInBuildDir/test1.cmake.in | 17 | ||||
-rw-r--r-- | Tests/CTestTestConfigFileInBuildDir/test2.cmake.in | 17 |
12 files changed, 158 insertions, 40 deletions
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake index 462835a..1f49c3b 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) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index 702ba10..7bb8b27 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", @@ -2526,6 +2546,8 @@ void cmCTest::PopulateCustomVector(cmMakefile* mf, const char* def, cmSystemTools::ExpandListArgument(dval, slist); std::vector<std::string>::iterator it; + vec.clear(); + for ( it = slist.begin(); it != slist.end(); ++it ) { cmCTestLog(this, DEBUG, " -- " << it->c_str() << std::endl); @@ -2801,7 +2823,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; } diff --git a/Source/cmLinkDirectoriesCommand.h b/Source/cmLinkDirectoriesCommand.h index e5ff4f0..aa13589 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." ; } diff --git a/Source/kwsys/CommandLineArguments.cxx b/Source/kwsys/CommandLineArguments.cxx index 9f43a47..ece88ae 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<unsigned int>(maxlen)); + sprintf(format, " %%-%us ", static_cast<unsigned int>(maxlen)); maxlen += 4; // For the space before and after the option diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 9bc659e..d49c0d7 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -72,7 +72,7 @@ # include <ctype.h> // int isdigit(int c); # include <errno.h> // extern int errno; # include <sys/time.h> -#elif __hpux +#elif defined( __hpux ) # include <sys/param.h> # include <sys/pstat.h> #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<unsigned char>(cores_per_package); +#else unsigned int Regebx = 0; - #if USE_ASM_INSTRUCTIONS - if (!this->IsHyperThreadingSupported()) + if (!this->IsHyperThreadingSupported()) { return static_cast<unsigned char>(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<unsigned char>(cores_per_package); - } -#endif - return static_cast<unsigned char> ((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 695949a..1bf19c0 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<char*> { 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() { diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 4b7e3f2..7ed0700 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 29) +SET(KWSYS_DATE_STAMP_DAY 01) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 78db39d..21d1196 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 0000000..3c53e66 --- /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 0000000..d2c28f9 --- /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 0000000..498cab2 --- /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 0000000..d359f2d --- /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) |