diff options
author | Anas Nashif <anas.nashif@intel.com> | 2013-02-13 18:21:12 -0800 |
---|---|---|
committer | Anas Nashif <anas.nashif@intel.com> | 2013-02-13 18:21:12 -0800 |
commit | ef8aa19c33e83ff019595fd7f8fdc29c35c336a3 (patch) | |
tree | 6501b44707b5c6a88fa5f817adee1a3ffcb0012d /Tests | |
parent | 035c7fabc3b82cbc9a346c11abe2e9462b4c0379 (diff) | |
download | cmake-upstream/2.8.10.2.tar.gz cmake-upstream/2.8.10.2.tar.bz2 cmake-upstream/2.8.10.2.zip |
Imported Upstream version 2.8.10.2upstream/2.8.10.2
Diffstat (limited to 'Tests')
466 files changed, 7197 insertions, 5489 deletions
diff --git a/Tests/ArgumentExpansion/CMakeLists.txt b/Tests/ArgumentExpansion/CMakeLists.txt index a24636f58..173540067 100644 --- a/Tests/ArgumentExpansion/CMakeLists.txt +++ b/Tests/ArgumentExpansion/CMakeLists.txt @@ -8,7 +8,7 @@ function (argument_tester expected expected_len) if (NOT ${expected_received_len} EQUAL ${expected_len}) message(STATUS "Unexpected: Expanding expected values isn't working") - endif (NOT ${expected_received_len} EQUAL ${expected_len}) + endif () if (${argn_len} EQUAL ${expected_len}) set(i 0) @@ -23,13 +23,13 @@ function (argument_tester expected expected_len) endif () math(EXPR i "${i} + 1") - endwhile (i LESS ${argn_len}) - else (${argn_len} EQUAL ${expected_len}) + endwhile () + else () message(STATUS "Unexpected: Lengths of arguments don't match") message(STATUS " Expected: ${expected_len}") message(STATUS " Received: ${argn_len}") - endif (${argn_len} EQUAL ${expected_len}) -endfunction (argument_tester expected) + endif () +endfunction () set(empty_test) message(STATUS "Test: Empty arguments") diff --git a/Tests/Assembler/CMakeLists.txt b/Tests/Assembler/CMakeLists.txt index 456e4961f..bb4bcccbe 100644 --- a/Tests/Assembler/CMakeLists.txt +++ b/Tests/Assembler/CMakeLists.txt @@ -7,10 +7,14 @@ 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) + if(CMAKE_OSX_SYSROOT AND CMAKE_C_SYSROOT_FLAG AND NOT ";${C_FLAGS};" MATCHES ";${CMAKE_C_SYSROOT_FLAG};") + list(APPEND C_FLAGS ${CMAKE_C_SYSROOT_FLAG} ${CMAKE_OSX_SYSROOT}) + endif() set(SRCS main.s) add_custom_command( OUTPUT main.s @@ -18,16 +22,16 @@ if("${CMAKE_GENERATOR}" MATCHES "Makefile") DEPENDS main.c VERBATIM ) - endif(("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|HP|SunPro|XL)$") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" AND UNIX)) -endif("${CMAKE_GENERATOR}" MATCHES "Makefile") + endif() +endif() if(SRCS) set(CMAKE_ASM_FLAGS "${CMAKE_C_FLAGS}") enable_language(ASM OPTIONAL) -else(SRCS) +else() message(STATUS "No assembler enabled, using C") set(SRCS main.c) -endif(SRCS) +endif() add_executable(HelloAsm ${SRCS}) diff --git a/Tests/BuildDepends/CMakeLists.txt b/Tests/BuildDepends/CMakeLists.txt index 5e36d11b4..2a70b6eae 100644 --- a/Tests/BuildDepends/CMakeLists.txt +++ b/Tests/BuildDepends/CMakeLists.txt @@ -1,9 +1,9 @@ # this test creates a static library and an executable -# the source to the library is then changed +# the source to the library is then changed # and the build is done on the executable and if things # are working the executable should relink with the new # value. The subdir Project contains the CMakelists.txt -# and source files for the test project. +# and source files for the test project. cmake_minimum_required (VERSION 2.6) project(BuildDepends) @@ -15,7 +15,7 @@ set(CMAKE_SUPPRESS_REGENERATION 1) # Xcode needs some help with the fancy dependencies in this test. if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(HELP_XCODE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Xcode") +endif() function(help_xcode_depends) if(HELP_XCODE) file(GLOB_RECURSE MACRO_OBJS @@ -24,9 +24,9 @@ function(help_xcode_depends) if(MACRO_OBJS) message("Helping Xcode by removing objects [${MACRO_OBJS}]") file(REMOVE ${MACRO_OBJS}) - endif(MACRO_OBJS) - endif(HELP_XCODE) -endfunction(help_xcode_depends) + endif() + endif() +endfunction() if("${CMAKE_GENERATOR}" MATCHES "Ninja") set(HELP_NINJA 1) # TODO Why is this needed? @@ -48,7 +48,7 @@ list(APPEND _cmake_options "-DCMAKE_FORCE_DEPFILES=1") file(MAKE_DIRECTORY ${BuildDepends_BINARY_DIR}/Project) message("Creating Project/foo.cxx") -write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx +write_file(${BuildDepends_BINARY_DIR}/Project/foo.cxx "const char* foo() { return \"foo\";}" ) file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot.hxx.in @@ -63,46 +63,44 @@ file(WRITE ${BuildDepends_BINARY_DIR}/Project/zot_macro_tgt.hxx help_xcode_depends() message("Building project first time") -try_compile(RESULT +try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project testRebuild CMAKE_FLAGS ${_cmake_options} OUTPUT_VARIABLE OUTPUT) if(HELP_XCODE) - try_compile(RESULT + try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project testRebuild OUTPUT_VARIABLE OUTPUT) - try_compile(RESULT + try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project testRebuild OUTPUT_VARIABLE OUTPUT) -endif(HELP_XCODE) +endif() message("Output from first build:\n${OUTPUT}") if(NOT RESULT) message(SEND_ERROR "Could not build test project (1)!") -endif(NOT RESULT) +endif() set(bar ${BuildDepends_BINARY_DIR}/Project/bar${CMAKE_EXECUTABLE_SUFFIX}) -if(EXISTS +if(EXISTS "${BuildDepends_BINARY_DIR}/Project/Debug/bar${CMAKE_EXECUTABLE_SUFFIX}" ) message("found debug") - set(bar + 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 +if(EXISTS "${BuildDepends_BINARY_DIR}/Project/Debug/zot${CMAKE_EXECUTABLE_SUFFIX}" ) message("found debug") - set(zot + 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) @@ -111,9 +109,9 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "foo ") message("Worked!") -else("${out}" STREQUAL "foo ") +else() message(SEND_ERROR "Project did not initially build properly: ${out}") -endif("${out}" STREQUAL "foo ") +endif() message("Running ${zot} ") execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -123,9 +121,9 @@ message("Run result: ${runResult} Output: \"${out}\"") set(VALUE_UNCHANGED "[zot] [zot_custom] [zot_macro_dir] [zot_macro_tgt] ") if("${out}" STREQUAL "${VALUE_UNCHANGED}") message("Worked!") -else("${out}" STREQUAL "${VALUE_UNCHANGED}") +else() message(SEND_ERROR "Project did not initially build properly: ${out}") -endif("${out}" STREQUAL "${VALUE_UNCHANGED}") +endif() message("Waiting 3 seconds...") # any additional argument will cause ${bar} to wait forever @@ -150,7 +148,7 @@ endif() help_xcode_depends() message("Building project second time") -try_compile(RESULT +try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project testRebuild @@ -159,12 +157,12 @@ try_compile(RESULT # Xcode is in serious need of help here if(HELP_XCODE OR HELP_NINJA) - try_compile(RESULT + try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project testRebuild OUTPUT_VARIABLE OUTPUT) - try_compile(RESULT + try_compile(RESULT ${BuildDepends_BINARY_DIR}/Project ${BuildDepends_SOURCE_DIR}/Project testRebuild @@ -174,17 +172,15 @@ endif() message("Output from second build:\n${OUTPUT}") if(NOT RESULT) message(SEND_ERROR "Could not build test project (2)!") -endif(NOT RESULT) -if(EXISTS +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}") -if(EXISTS +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) @@ -193,9 +189,9 @@ message("Run result: ${runResult} Output: \"${out}\"") if("${out}" STREQUAL "foo changed ") message("Worked!") -else("${out}" STREQUAL "foo changed ") +else() message(SEND_ERROR "Project did not rebuild properly!") -endif("${out}" STREQUAL "foo changed ") +endif() message("Running ${zot} ") execute_process(COMMAND ${zot} OUTPUT_VARIABLE out RESULT_VARIABLE runResult) @@ -207,9 +203,9 @@ set(VALUE_CHANGED ) if("${out}" STREQUAL "${VALUE_CHANGED}") message("Worked!") -else("${out}" STREQUAL "${VALUE_CHANGED}") +else() message(SEND_ERROR "Project did not rebuild properly!") -endif("${out}" STREQUAL "${VALUE_CHANGED}") +endif() if(TEST_LINK_DEPENDS) set(linkdep ${BuildDepends_BINARY_DIR}/Project/linkdep${CMAKE_EXECUTABLE_SUFFIX}) diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index ed8b8bf5d..01f5f6267 100644 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -27,7 +27,7 @@ if(APPLE) set(CMAKE_OSX_ARCHITECTURES i386 x86_64) endif() endif() -endif(APPLE) +endif() add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx) set_target_properties(foo PROPERTIES OUTPUT_NAME "foolib") @@ -60,16 +60,16 @@ add_executable(bar bar.cxx ) #----------------------------------------------------------------------------- -IF("${CMAKE_GENERATOR}" MATCHES "Make") +if("${CMAKE_GENERATOR}" MATCHES "Make") # Test the IMPLICIT_DEPENDS feature. - SET(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) - SET(ZOT_CUSTOM_DEP + set(ZOT_DEPENDS IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep.cxx) + set(ZOT_CUSTOM_DEP IMPLICIT_DEPENDS CXX ${CMAKE_CURRENT_SOURCE_DIR}/dep_custom.cxx) -ELSE("${CMAKE_GENERATOR}" MATCHES "Make") +else() # No IMPLICIT_DEPENDS...just depend directly. - SET(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) - SET(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Make") + set(ZOT_DEPENDS DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx.in) + set(ZOT_CUSTOM_DEP DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/zot_custom.hxx.in) +endif() add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zot.hxx COMMAND ${CMAKE_COMMAND} -E copy diff --git a/Tests/BundleGeneratorTest/CMakeLists.txt b/Tests/BundleGeneratorTest/CMakeLists.txt index e1fc2c1d4..037df09c1 100644 --- a/Tests/BundleGeneratorTest/CMakeLists.txt +++ b/Tests/BundleGeneratorTest/CMakeLists.txt @@ -1,23 +1,23 @@ -PROJECT(BundleGeneratorTest) +project(BundleGeneratorTest) -CMAKE_MINIMUM_REQUIRED(VERSION 2.7) +cmake_minimum_required(VERSION 2.7) # Build a shared library and install it in lib/ -ADD_LIBRARY(Library SHARED Library.cxx) -INSTALL(TARGETS Library DESTINATION lib) +add_library(Library SHARED Library.cxx) +install(TARGETS Library DESTINATION lib) # Build an executable and install it in bin/ -ADD_EXECUTABLE(Executable Executable.cxx) -TARGET_LINK_LIBRARIES(Executable Library) -INSTALL(TARGETS Executable DESTINATION bin) +add_executable(Executable Executable.cxx) +target_link_libraries(Executable Library) +install(TARGETS Executable DESTINATION bin) # Use the bundle-generator for packaging ... -SET(CPACK_GENERATOR "Bundle") -SET(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns") -SET(CPACK_BUNDLE_NAME "BundleGeneratorTest") -SET(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist") -SET(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand") -SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") +set(CPACK_GENERATOR "Bundle") +set(CPACK_BUNDLE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/BundleIcon.icns") +set(CPACK_BUNDLE_NAME "BundleGeneratorTest") +set(CPACK_BUNDLE_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist") +set(CPACK_BUNDLE_STARTUP_COMMAND "${CMAKE_CURRENT_SOURCE_DIR}/StartupCommand") +set(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") # The custom volume icon is a copy of the normal Mac OSX volume icon, but # on a white background. This is to differentiate it from the normal one @@ -25,9 +25,9 @@ SET(CPACK_PACKAGE_DESCRIPTION "Project for testing OSX bundle generation") # visual inspection of the mounted volume... This was added when fixing # issue #7523... # -SET(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/CustomVolumeIcon.icns") +set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/CustomVolumeIcon.icns") -SET(CPACK_PACKAGE_NAME "BundleGeneratorTest") -SET(CPACK_PACKAGE_VERSION "0.1") +set(CPACK_PACKAGE_NAME "BundleGeneratorTest") +set(CPACK_PACKAGE_VERSION "0.1") -INCLUDE(CPack) +include(CPack) diff --git a/Tests/BundleTest/BundleSubDir/CMakeLists.txt b/Tests/BundleTest/BundleSubDir/CMakeLists.txt index 322b2a7d2..1921ce095 100644 --- a/Tests/BundleTest/BundleSubDir/CMakeLists.txt +++ b/Tests/BundleTest/BundleSubDir/CMakeLists.txt @@ -1,36 +1,36 @@ -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" COMMAND /bin/cp ARGS "${BundleTest_SOURCE_DIR}/randomResourceFile.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist") -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt" "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS ) -ADD_EXECUTABLE(SecondBundle +add_executable(SecondBundle MACOSX_BUNDLE "${BundleTest_SOURCE_DIR}/BundleTest.cxx" "${BundleTest_SOURCE_DIR}/SomeRandomFile.txt" "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" ) -TARGET_LINK_LIBRARIES(SecondBundle BundleTestLib) +target_link_libraries(SecondBundle BundleTestLib) # Test bundle installation. -INSTALL(TARGETS SecondBundle DESTINATION Applications) +install(TARGETS SecondBundle DESTINATION Applications) # Test whether bundles respect the output name. Since the library is # installed into a location that uses this output name this will fail if the # bundle does not respect the name. Also the executable will not be found by # the test driver if this does not work. -SET_TARGET_PROPERTIES(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe) +set_target_properties(SecondBundle PROPERTIES OUTPUT_NAME SecondBundleExe) diff --git a/Tests/BundleTest/CMakeLists.txt b/Tests/BundleTest/CMakeLists.txt index 5342f49bd..de69d7555 100644 --- a/Tests/BundleTest/CMakeLists.txt +++ b/Tests/BundleTest/CMakeLists.txt @@ -1,28 +1,28 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(BundleTest) -SET(MACOSX_BUNDLE_INFO_STRING "bundle_info_string") -SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>") +project(BundleTest) +set(MACOSX_BUNDLE_INFO_STRING "bundle_info_string") +set(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>") -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" COMMAND /bin/cp ARGS "${CMAKE_CURRENT_SOURCE_DIR}/randomResourceFile.plist.in" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist") -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( SomeRandomFile.txt "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" PROPERTIES MACOSX_PACKAGE_LOCATION MacOS ) -SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") +set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") # Test building a bundle linking to a shared library where the # shared library links to CoreFoundation, but the executable does not @@ -31,74 +31,74 @@ SET(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}/foobar") # if CMake's dependency chaining for libraries with "-framework # blah" style dependencies gets broken... # -ADD_LIBRARY(BundleTestLib SHARED BundleLib.cxx) -TARGET_LINK_LIBRARIES(BundleTestLib "-framework CoreFoundation") +add_library(BundleTestLib SHARED BundleLib.cxx) +target_link_libraries(BundleTestLib "-framework CoreFoundation") -ADD_EXECUTABLE(BundleTest +add_executable(BundleTest MACOSX_BUNDLE BundleTest.cxx SomeRandomFile.txt "${BundleTest_SOURCE_DIR}/../../ChangeLog.txt" "${CMAKE_CURRENT_BINARY_DIR}/randomResourceFile.plist" ) -TARGET_LINK_LIBRARIES(BundleTest BundleTestLib) +target_link_libraries(BundleTest BundleTestLib) # -# DO NOT: TARGET_LINK_LIBRARIES(BundleTest "-framework CoreFoundation") +# DO NOT: target_link_libraries(BundleTest "-framework CoreFoundation") # (see above comments about CoreFoundation) # # Test bundle installation. -#INSTALL(TARGETS BundleTestLib DESTINATION Applications/BundleTestExe.app/Contents/Plugins) -INSTALL(TARGETS BundleTestLib DESTINATION Applications/SecondBundleExe.app/Contents/Plugins) -INSTALL(TARGETS BundleTest DESTINATION Applications) +#install(TARGETS BundleTestLib DESTINATION Applications/BundleTestExe.app/Contents/Plugins) +install(TARGETS BundleTestLib DESTINATION Applications/SecondBundleExe.app/Contents/Plugins) +install(TARGETS BundleTest DESTINATION Applications) # Test whether bundles respect the output name. Since the library is # installed into a location that uses this output name this will fail if the # bundle does not respect the name. Also the executable will not be found by # the test driver if this does not work. -SET_TARGET_PROPERTIES(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe) +set_target_properties(BundleTest PROPERTIES OUTPUT_NAME BundleTestExe) # Test executable versioning if it is supported. -IF(NOT XCODE) - SET_TARGET_PROPERTIES(BundleTest PROPERTIES VERSION 1) -ENDIF(NOT XCODE) +if(NOT XCODE) + set_target_properties(BundleTest PROPERTIES VERSION 1) +endif() # Make sure the executable can find its installed library. -SET_TARGET_PROPERTIES(BundleTestLib PROPERTIES +set_target_properties(BundleTestLib PROPERTIES INSTALL_NAME_DIR "@executable_path/../Plugins") -INCLUDE(CPack) +include(CPack) # test the framework find stuff -IF(EXISTS /usr/lib/libtcl.dylib +if(EXISTS /usr/lib/libtcl.dylib AND EXISTS /System/Library/Frameworks/Tcl.framework) - SET(TCL NOTFOUND) - FIND_LIBRARY(TCL tcl) - MESSAGE("frame: ${TCL}") - IF(NOT "${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - ENDIF(NOT "${TCL}" MATCHES .framework) - SET(TCL NOTFOUND) - SET(CMAKE_FIND_FRAMEWORK LAST) - FIND_LIBRARY(TCL tcl) - IF("${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - ENDIF("${TCL}" MATCHES .framework) - SET(TCL NOTFOUND) - SET(CMAKE_FIND_FRAMEWORK NEVER) - FIND_LIBRARY(TCL tcl) - IF("${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Found framework and should have found dylib ${TCL}") - ENDIF("${TCL}" MATCHES .framework) - MESSAGE("not frame: ${TCL}") - SET(TCL NOTFOUND) - SET(CMAKE_FIND_FRAMEWORK FIRST) - FIND_LIBRARY(TCL tcl) - IF(NOT "${TCL}" MATCHES .framework) - MESSAGE(FATAL_ERROR "Could not find tcl framework, found ${TCL}") - ENDIF(NOT "${TCL}" MATCHES .framework) - MESSAGE("frame: ${TCL}") -ENDIF(EXISTS /usr/lib/libtcl.dylib + set(TCL NOTFOUND) + find_library(TCL tcl) + message("frame: ${TCL}") + if(NOT "${TCL}" MATCHES .framework) + message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") + endif() + set(TCL NOTFOUND) + set(CMAKE_FIND_FRAMEWORK LAST) + find_library(TCL tcl) + if("${TCL}" MATCHES .framework) + message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") + endif() + set(TCL NOTFOUND) + set(CMAKE_FIND_FRAMEWORK NEVER) + find_library(TCL tcl) + if("${TCL}" MATCHES .framework) + message(FATAL_ERROR "Found framework and should have found dylib ${TCL}") + endif() + message("not frame: ${TCL}") + set(TCL NOTFOUND) + set(CMAKE_FIND_FRAMEWORK FIRST) + find_library(TCL tcl) + if(NOT "${TCL}" MATCHES .framework) + message(FATAL_ERROR "Could not find tcl framework, found ${TCL}") + endif() + message("frame: ${TCL}") +endif(EXISTS /usr/lib/libtcl.dylib AND EXISTS /System/Library/Frameworks/Tcl.framework) -SUBDIRS(BundleSubDir) +subdirs(BundleSubDir) diff --git a/Tests/BundleUtilities/bundleutils.cmake b/Tests/BundleUtilities/bundleutils.cmake index 46765e733..cc89347ad 100644 --- a/Tests/BundleUtilities/bundleutils.cmake +++ b/Tests/BundleUtilities/bundleutils.cmake @@ -31,7 +31,7 @@ configure_file("${MODULE}" "${OUTPUT_MODULE}" COPYONLY) # this shouldn't be necessary except for the non-bundle case on Mac function(gp_item_default_embedded_path_override item path) set(path "@executable_path" PARENT_SCOPE) -endfunction(gp_item_default_embedded_path_override) +endfunction() include(BundleUtilities) fixup_bundle("${OUTPUT}" "${OUTPUT_MODULE}" "${INPUTDIR}") @@ -42,4 +42,4 @@ execute_process(COMMAND "${OUTPUT}" RESULT_VARIABLE result OUTPUT_VARIABLE out E if(NOT result STREQUAL "0") message(FATAL_ERROR " failed to execute test program\n${out}") -endif(NOT result STREQUAL "0") +endif() diff --git a/Tests/CMakeBuildTest.cmake.in b/Tests/CMakeBuildTest.cmake.in index a8bb75090..195f107a2 100644 --- a/Tests/CMakeBuildTest.cmake.in +++ b/Tests/CMakeBuildTest.cmake.in @@ -7,53 +7,53 @@ make_directory("@CMAKE_BUILD_TEST_BINARY_DIR@") message("Remove: @CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt") file(REMOVE "@CMAKE_BUILD_TEST_SOURCE_DIR@/CMakeCache.txt") -# run cmake in the binary directory +# run cmake in the binary directory message("running: ${CMAKE_COMMAND}") execute_process(COMMAND "${CMAKE_COMMAND}" - "@CMAKE_BUILD_TEST_SOURCE_DIR@" + "@CMAKE_BUILD_TEST_SOURCE_DIR@" "-G@CMAKE_TEST_GENERATOR@" WORKING_DIRECTORY "@CMAKE_BUILD_TEST_BINARY_DIR@" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake command") -endif(RESULT) +endif() # Now use the --build option to build the project message("running: ${CMAKE_COMMAND} --build") -execute_process(COMMAND "${CMAKE_COMMAND}" +execute_process(COMMAND "${CMAKE_COMMAND}" --build "@CMAKE_BUILD_TEST_BINARY_DIR@" --config Debug RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake --build") -endif(RESULT) +endif() # check for configuration types set(CMAKE_CONFIGURATION_TYPES @CMAKE_CONFIGURATION_TYPES@) -# run the executable out of the Debug directory if there +# run the executable out of the Debug directory if there # are configuration types if(CMAKE_CONFIGURATION_TYPES) set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/Debug/@CMAKE_BUILD_TEST_EXE@") -else(CMAKE_CONFIGURATION_TYPES) +else() set(RUN_TEST "@CMAKE_BUILD_TEST_BINARY_DIR@/@CMAKE_BUILD_TEST_EXE@") -endif(CMAKE_CONFIGURATION_TYPES) +endif() # run the test results message("running [${RUN_TEST}]") execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@") -endif(RESULT) +endif() # build it again with clean and only @CMAKE_BUILD_TEST_EXE@ target -execute_process(COMMAND "${CMAKE_COMMAND}" - --build "@CMAKE_BUILD_TEST_BINARY_DIR@" --config Debug +execute_process(COMMAND "${CMAKE_COMMAND}" + --build "@CMAKE_BUILD_TEST_BINARY_DIR@" --config Debug --clean-first --target @CMAKE_BUILD_TEST_EXE@ RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running cmake --build") -endif(RESULT) +endif() -# run it again after clean +# run it again after clean execute_process(COMMAND "${RUN_TEST}" RESULT_VARIABLE RESULT) if(RESULT) message(FATAL_ERROR "Error running test @CMAKE_BUILD_TEST_EXE@ after clean ") -endif(RESULT) +endif() diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 27ae3a072..bbf804bb1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1,9 +1,9 @@ # a macro for tests that have a simple format where the name matches the # directory and project -MACRO(ADD_TEST_MACRO NAME COMMAND) - STRING(REPLACE "." "/" dir "${NAME}") - STRING(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") - ADD_TEST(${NAME} ${CMAKE_CTEST_COMMAND} +macro(ADD_TEST_MACRO NAME COMMAND) + string(REPLACE "." "/" dir "${NAME}") + string(REGEX REPLACE "[^.]*\\." "" proj "${NAME}") + add_test(${NAME} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/${dir}" "${CMake_BINARY_DIR}/Tests/${dir}" @@ -13,69 +13,66 @@ MACRO(ADD_TEST_MACRO NAME COMMAND) --build-project ${proj} ${${NAME}_EXTRA_OPTIONS} --test-command ${COMMAND} ${ARGN}) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") -ENDMACRO(ADD_TEST_MACRO) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${dir}") +endmacro() -MACRO(REGEX_ESCAPE_STRING _OUT _IN) +macro(REGEX_ESCAPE_STRING _OUT _IN) # Escape special regex metacharacters with a backslash string(REGEX REPLACE "([$^.[|*+?()]|])" "\\\\\\1" ${_OUT} "${_IN}") -ENDMACRO(REGEX_ESCAPE_STRING _OUT _IN) +endmacro() -INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) +include(${CMAKE_CURRENT_SOURCE_DIR}/CheckFortran.cmake) # Fake a user home directory to avoid polluting the real one. -IF(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) - SET(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome") - FILE(MAKE_DIRECTORY "${TEST_HOME}") - FILE(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n") - SET(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one. +if(DEFINED ENV{HOME} AND NOT CTEST_NO_TEST_HOME) + set(TEST_HOME "${CMake_BINARY_DIR}/Tests/CMakeFiles/TestHome") + file(MAKE_DIRECTORY "${TEST_HOME}") + file(WRITE "${TEST_HOME}/.cvspass" ":pserver:anoncvs@www.cmake.org:/cvsroot/KWSys A\n") + set(TEST_HOME_ENV_CODE "# Fake a user home directory to avoid polluting the real one. # But provide original ENV{HOME} value in ENV{CTEST_REAL_HOME} for tests that # need access to the real HOME directory. -SET(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\") -SET(ENV{HOME} \"${TEST_HOME}\") +set(ENV{CTEST_REAL_HOME} \"\$ENV{HOME}\") +set(ENV{HOME} \"${TEST_HOME}\") ") -ENDIF() +endif() # Choose a default configuration for CTest tests. -SET(CTestTest_CONFIG Debug) -IF(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE) - SET(CTestTest_CONFIG ${CMAKE_BUILD_TYPE}) -ENDIF() +set(CTestTest_CONFIG Debug) +if(NOT CMAKE_CONFIGURATION_TYPES AND CMAKE_BUILD_TYPE) + set(CTestTest_CONFIG ${CMAKE_BUILD_TYPE}) +endif() -CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in +configure_file(${CMake_SOURCE_DIR}/Tests/EnforceConfig.cmake.in ${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake @ONLY) # Testing -IF(BUILD_TESTING) - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32)) - SET(TEST_CompileCommandOutput 1) - ENDIF() +if(BUILD_TESTING) + if("${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles" OR ("${CMAKE_TEST_GENERATOR}" MATCHES Ninja AND NOT WIN32)) + set(TEST_CompileCommandOutput 1) + endif() + + add_subdirectory(CMakeLib) + add_subdirectory(CMakeOnly) + add_subdirectory(RunCMake) - ADD_SUBDIRECTORY(CMakeLib) - ADD_SUBDIRECTORY(CMakeOnly) - ADD_SUBDIRECTORY(RunCMake) + add_subdirectory(FindPackageModeMakefileTest) - ADD_SUBDIRECTORY(FindPackageModeMakefileTest) + add_subdirectory(CTestTestMemcheck) # Collect a list of all test build directories. - SET(TEST_BUILD_DIRS) + set(TEST_BUILD_DIRS) # Should the long tests be run? - OPTION(CMAKE_RUN_LONG_TESTS + option(CMAKE_RUN_LONG_TESTS "Should the long tests be run (such as Bootstrap)." ON) - MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS) + mark_as_advanced(CMAKE_RUN_LONG_TESTS) - IF (CMAKE_RUN_LONG_TESTS) - OPTION(CTEST_TEST_CTEST + if (CMAKE_RUN_LONG_TESTS) + option(CTEST_TEST_CTEST "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 (CMAKE_RUN_LONG_TESTS) + mark_as_advanced(CTEST_TEST_CTEST) + endif () # Should tests that use CVS be run? # @@ -83,19 +80,19 @@ IF(BUILD_TESTING) if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) find_package(CVS QUIET) - else(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + else() find_program(CVS_EXECUTABLE NAMES cvs) - endif(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + endif() if(CVS_EXECUTABLE) set(do_cvs_tests 1) - endif(CVS_EXECUTABLE) + endif() if(do_cvs_tests AND NOT UNIX) if("${CVS_EXECUTABLE}" MATCHES "cygwin") set(do_cvs_tests 0) - endif("${CVS_EXECUTABLE}" MATCHES "cygwin") - endif(do_cvs_tests AND NOT UNIX) + endif() + endif() # Should CPack tests be run? By default, yes, but... # @@ -108,35 +105,35 @@ IF(BUILD_TESTING) # well-known bug in kwsys process execution that I would love to get # time to fix. # - OPTION(CTEST_TEST_CPACK + option(CTEST_TEST_CPACK "Should the tests that use '--build-target package' be run?" ON) - MARK_AS_ADVANCED(CTEST_TEST_CPACK) - SET(CTEST_TEST_OSX_ARCH 0) - IF(APPLE) - EXECUTE_PROCESS( + mark_as_advanced(CTEST_TEST_CPACK) + set(CTEST_TEST_OSX_ARCH 0) + if(APPLE) + execute_process( COMMAND sw_vers -productVersion OUTPUT_VARIABLE OSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) - IF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - MESSAGE(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") - MESSAGE(STATUS "OSX_VERSION='${OSX_VERSION}'") - SET(CTEST_TEST_CPACK OFF) - ELSE(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - SET(CTEST_TEST_OSX_ARCH 1) - ENDIF(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") - ENDIF(APPLE) + if(OSX_VERSION MATCHES "^10\\.[0123]" OR OSX_VERSION MATCHES "ProductVersion:\t10\\.[0123]") + message(STATUS "Forcing CTEST_TEST_CPACK=OFF on OSX < 10.4") + message(STATUS "OSX_VERSION='${OSX_VERSION}'") + set(CTEST_TEST_CPACK OFF) + else() + set(CTEST_TEST_OSX_ARCH 1) + endif() + endif() # Use 1500 or CTEST_TEST_TIMEOUT for long test timeout value, # whichever is greater. - SET(CMAKE_LONG_TEST_TIMEOUT 1500) - IF(CTEST_TEST_TIMEOUT) - SET(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT}) - ENDIF(CTEST_TEST_TIMEOUT) - IF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) - SET(CMAKE_LONG_TEST_TIMEOUT 1500) - ENDIF(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + set(CMAKE_LONG_TEST_TIMEOUT 1500) + if(CTEST_TEST_TIMEOUT) + set(CMAKE_LONG_TEST_TIMEOUT ${CTEST_TEST_TIMEOUT}) + endif() + if(CMAKE_LONG_TEST_TIMEOUT LESS 1500) + set(CMAKE_LONG_TEST_TIMEOUT 1500) + endif() # add a bunch of standard build-and-test style tests ADD_TEST_MACRO(CommandLineTest CommandLineTest) @@ -148,53 +145,53 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(SystemInformation SystemInformation) ADD_TEST_MACRO(MathTest MathTest) # assume no resources building to test - SET(TEST_RESOURCES FALSE) + set(TEST_RESOURCES FALSE) # for windows and cygwin assume we have resources - IF(WIN32 OR CYGWIN) - SET(TEST_RESOURCES TRUE) - ENDIF() + if(WIN32 OR CYGWIN) + set(TEST_RESOURCES TRUE) + endif() # for borland and watcom there is no resource support - IF("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR + if("${CMAKE_TEST_GENERATOR}" MATCHES "WMake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Borland") - SET(TEST_RESOURCES FALSE) - ENDIF() - IF(TEST_RESOURCES) + set(TEST_RESOURCES FALSE) + endif() + if(TEST_RESOURCES) ADD_TEST_MACRO(VSResource VSResource) - ENDIF() + endif() ADD_TEST_MACRO(Simple Simple) ADD_TEST_MACRO(PreOrder PreOrder) ADD_TEST_MACRO(MissingSourceFile MissingSourceFile) - SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES + set_tests_properties(MissingSourceFile PROPERTIES PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file:[ \r\n]*DoesNotExist/MissingSourceFile.c") - IF(CMAKE_Fortran_COMPILER) + if(CMAKE_Fortran_COMPILER) ADD_TEST_MACRO(FortranOnly FortranOnly) - ENDIF() + endif() # test Visual Studio GNU Fortran mixing with cmake_add_fortran_subdirectory # run this project if we have a working fortran compiler or # the test is enabled with CMAKE_TEST_CMAKE_ADD_FORTRAN cache variable. # If you enable the test, CMake should find the MinGW fortran install, # or in some cases you might need to set the PATH so that cmake can find # the gfortran from mingw. - IF(CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN) - SET(CMAKE_SKIP_VSGNUFortran FALSE) + if(CMAKE_Fortran_COMPILER OR CMAKE_TEST_CMAKE_ADD_FORTRAN) + set(CMAKE_SKIP_VSGNUFortran FALSE) # disable test for apple builds using ifort if they are building # more than one architecture, as ifort does not support that. - IF(APPLE AND (CMAKE_Fortran_COMPILER MATCHES ifort)) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES len) - IF("${len}" GREATER 1) - MESSAGE(STATUS "Skip VSGNUFortran for ifort dual cpu mac build") - SET(CMAKE_SKIP_VSGNUFortran TRUE) - ENDIF() - ENDIF() - IF((CMAKE_C_COMPILER MATCHES lsb) + if(APPLE AND (CMAKE_Fortran_COMPILER MATCHES ifort)) + list(LENGTH CMAKE_OSX_ARCHITECTURES len) + if("${len}" GREATER 1) + message(STATUS "Skip VSGNUFortran for ifort dual cpu mac build") + set(CMAKE_SKIP_VSGNUFortran TRUE) + endif() + endif() + if((CMAKE_C_COMPILER MATCHES lsb) AND (CMAKE_Fortran_COMPILER MATCHES ifort)) - MESSAGE(STATUS "Skip VSGNUFortran for ifort and lsb compilers") - SET(CMAKE_SKIP_VSGNUFortran TRUE) - ENDIF() - IF(NOT CMAKE_SKIP_VSGNUFortran) + message(STATUS "Skip VSGNUFortran for ifort and lsb compilers") + set(CMAKE_SKIP_VSGNUFortran TRUE) + endif() + if(NOT CMAKE_SKIP_VSGNUFortran) ADD_TEST_MACRO(VSGNUFortran ${CMAKE_COMMAND} -P runtest.cmake) - ENDIF() - ENDIF() + endif() + endif() ADD_TEST_MACRO(COnly COnly) ADD_TEST_MACRO(CxxOnly CxxOnly) ADD_TEST_MACRO(IPO COnly/COnly) @@ -218,44 +215,45 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(Unset Unset) ADD_TEST_MACRO(PolicyScope PolicyScope) ADD_TEST_MACRO(EmptyLibrary EmptyLibrary) - SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES + 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) - SET_TESTS_PROPERTIES(CrossCompile PROPERTIES + set_tests_properties(CrossCompile PROPERTIES PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode") - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Make") + if("${CMAKE_TEST_GENERATOR}" MATCHES "Make") ADD_TEST_MACRO(Policy0002 Policy0002) - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Make") - IF(CTEST_TEST_OSX_ARCH) + endif() + if(CTEST_TEST_OSX_ARCH) ADD_TEST_MACRO(Architecture Architecture) - SET_TESTS_PROPERTIES(Architecture PROPERTIES + set_tests_properties(Architecture PROPERTIES PASS_REGULAR_EXPRESSION "(file is not of required architecture|does not match cputype|not the architecture being linked)") - ENDIF(CTEST_TEST_OSX_ARCH) + endif() - LIST(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) + list(APPEND TEST_BUILD_DIRS ${CMake_TEST_INSTALL_PREFIX}) - IF(NOT QT4_FOUND) - FIND_PACKAGE(Qt4) - ENDIF(NOT QT4_FOUND) + if(NOT QT4_FOUND) + find_package(Qt4) + endif() - IF(QT4_FOUND) + if(QT4_FOUND) # test whether the Qt4 which has been found works, on some machines # which run nightly builds there were errors like "wrong file format" # for libQtCore.so. So first check it works, and only if it does add # the automoc test. - INCLUDE(CheckCXXSourceCompiles) - SET(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") - SET(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") + include(CheckCXXSourceCompiles) + set(_save_CMAKE_REQUIRED_INCLUDES "${CMAKE_REQUIRED_INCLUDES}") + set(_save_CMAKE_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}") - SET(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES}) - SET(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES}) + set(CMAKE_REQUIRED_INCLUDES ${QT_INCLUDES}) + set(CMAKE_REQUIRED_LIBRARIES ${QT_QTCORE_LIBRARIES}) CHECK_CXX_SOURCE_COMPILES("#include <QCoreApplication>\n int main() {return (qApp == 0 ? 0 : 1); }\n" QT4_WORKS) - SET(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}") - SET(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") - ENDIF() + set(CMAKE_REQUIRED_INCLUDES "${_save_CMAKE_REQUIRED_INCLUDES}") + set(CMAKE_REQUIRED_LIBRARIES "${_save_CMAKE_REQUIRED_LIBRARIES}") + endif() # run test for BundleUtilities on supported platforms/compilers if(MSVC OR @@ -263,7 +261,7 @@ IF(BUILD_TESTING) CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT "${CMAKE_TEST_GENERATOR}" STREQUAL "Watcom WMake") - ADD_TEST(BundleUtilities ${CMAKE_CTEST_COMMAND} + add_test(BundleUtilities ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleUtilities" "${CMake_BINARY_DIR}/Tests/BundleUtilities" @@ -271,12 +269,12 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project BundleUtilities ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleUtilities") # run test for DeployQt4 on supported platforms/compilers (which depends on BundleUtilities) # this test also depends on the existence of the standard qtiff plugin if(QT4_WORKS AND QT_QTSQL_FOUND) - ADD_TEST(Qt4Deploy ${CMAKE_CTEST_COMMAND} + add_test(Qt4Deploy ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Qt4Deploy" "${CMake_BINARY_DIR}/Tests/Qt4Deploy" @@ -287,29 +285,29 @@ IF(BUILD_TESTING) -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Qt4Deploy") endif() endif() endif() - SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly") - SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly") - SET(CMAKE_BUILD_TEST_EXE COnly) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" + set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/COnly") + set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/CMakeBuildCOnly") + set(CMAKE_BUILD_TEST_EXE COnly) + configure_file("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake" @ONLY) - ADD_TEST(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P + add_test(CMakeBuildTest ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CMakeBuildTest.cmake") - LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) + list(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) # now do it again for a project that has two project commands - SET(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject") - SET(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject") - SET(CMAKE_BUILD_TEST_EXE just_silly) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" + set(CMAKE_BUILD_TEST_SOURCE_DIR "${CMake_SOURCE_DIR}/Tests/DoubleProject") + set(CMAKE_BUILD_TEST_BINARY_DIR "${CMake_BINARY_DIR}/Tests/DoubleProject") + set(CMAKE_BUILD_TEST_EXE just_silly) + configure_file("${CMake_SOURCE_DIR}/Tests/CMakeBuildTest.cmake.in" "${CMake_BINARY_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake" @ONLY) - ADD_TEST(CMakeDoubleProject ${CMAKE_CMAKE_COMMAND} -P + add_test(CMakeDoubleProject ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CMakeBuildDoubleProjectTest.cmake") - LIST(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) + list(APPEND TEST_BUILD_DIRS ${CMAKE_BUILD_TEST_BINARY_DIR}) ADD_TEST_MACRO(Module.CheckTypeSize CheckTypeSize) @@ -333,7 +331,7 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(PositionIndependentTargets PositionIndependentTargets) endif() - ADD_TEST(LinkFlags-prepare + add_test(LinkFlags-prepare ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkFlags" @@ -344,16 +342,16 @@ IF(BUILD_TESTING) --build-target LinkFlags --build-options -DTEST_CONFIG=\${CTEST_CONFIGURATION_TYPE} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkFlags") - MACRO(ADD_LINK_FLAGS_TEST name depends) - ADD_TEST(LinkFlags-${name} + macro(ADD_LINK_FLAGS_TEST name depends) + add_test(LinkFlags-${name} ${CMAKE_CMAKE_COMMAND} --build "${CMake_BINARY_DIR}/Tests/LinkFlags" --target LinkFlags_${name} --config \${CTEST_CONFIGURATION_TYPE} ) - SET_TESTS_PROPERTIES(LinkFlags-${name} PROPERTIES + set_tests_properties(LinkFlags-${name} PROPERTIES PASS_REGULAR_EXPRESSION "BADFLAG" DEPENDS LinkFlags-${depends}) - ENDMACRO() + endmacro() ADD_LINK_FLAGS_TEST(lib prepare) ADD_LINK_FLAGS_TEST(dll lib) ADD_LINK_FLAGS_TEST(exe dll) @@ -365,12 +363,12 @@ IF(BUILD_TESTING) # build the "Simple" test with the ExtraGenerators, if available # This doesn't test whether the generated project files work (unfortunately), # mainly it tests that cmake doesn't crash when generating these project files. - IF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + if(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") # check which generators we have - EXEC_PROGRAM(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) + exec_program(${CMAKE_CMAKE_COMMAND} ARGS --help OUTPUT_VARIABLE cmakeOutput ) # check for the Eclipse generator - IF ("${cmakeOutput}" MATCHES Eclipse) - ADD_TEST(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} + if ("${cmakeOutput}" MATCHES Eclipse) + add_test(Simple_EclipseGenerator ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator" @@ -379,12 +377,12 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") - ENDIF ("${cmakeOutput}" MATCHES Eclipse) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_EclipseGenerator") + endif () # check for the CodeBlocks generator - IF ("${cmakeOutput}" MATCHES CodeBlocks) - ADD_TEST(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND} + if ("${cmakeOutput}" MATCHES CodeBlocks) + add_test(Simple_CodeBlocksGenerator ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator" @@ -393,11 +391,11 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") - ENDIF ("${cmakeOutput}" MATCHES CodeBlocks) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_CodeBlocksGenerator") + endif () # check for the KDevelop3 generator - IF ("${cmakeOutput}" MATCHES KDevelop3) - ADD_TEST(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} + if ("${cmakeOutput}" MATCHES KDevelop3) + add_test(Simple_KDevelop3Generator ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator" @@ -406,17 +404,17 @@ IF(BUILD_TESTING) --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Simple --test-command Simple) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") - ENDIF ("${cmakeOutput}" MATCHES KDevelop3) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_KDevelop3Generator") + endif () - ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles" OR ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop") + endif() # test for correct sub-project generation # not implemented in VS6 or Xcode - IF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) + if(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) # run cmake and configure all of SubProject # but only build the independent executable car - ADD_TEST(SubProject ${CMAKE_CTEST_COMMAND} + add_test(SubProject ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject" "${CMake_BINARY_DIR}/Tests/SubProject" @@ -427,20 +425,20 @@ IF(BUILD_TESTING) --test-command car ) - IF(${CMAKE_TEST_GENERATOR} MATCHES "Ninja") + if(${CMAKE_TEST_GENERATOR} MATCHES "Ninja") # The Ninja generator does not create a recursive build system. Start # from the root directory. - SET(SubProject_SUBDIR) - ELSE() - SET(SubProject_SUBDIR "/foo") - ENDIF() + set(SubProject_SUBDIR) + else() + set(SubProject_SUBDIR "/foo") + endif() # For stage 2, do not run cmake again. # Then build the foo sub project which should build # the bar library which should be referenced because # foo links to the static library bar, but bar is not # directly in the foo sub project - ADD_TEST(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} + add_test(SubProject-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubProject${SubProject_SUBDIR}" "${CMake_BINARY_DIR}/Tests/SubProject${SubProject_SUBDIR}" @@ -452,29 +450,29 @@ IF(BUILD_TESTING) --build-exe-dir "${CMake_BINARY_DIR}/Tests/SubProject/foo" --test-command foo ) - SET_TESTS_PROPERTIES ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject") - ENDIF(NOT MSVC60 AND NOT XCODE AND NOT MSVC70) + set_tests_properties ( SubProject-Stage2 PROPERTIES DEPENDS SubProject) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubProject") + endif() - IF (CMAKE_STRICT) + if (CMAKE_STRICT) ADD_TEST_MACRO(DocTest DocTest) - ENDIF (CMAKE_STRICT) + endif () # macro to add a test that will build a nightly release # of CMake for given platform using the release scripts - MACRO(ADD_NIGHTLY_BUILD_TEST name script) - SET(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}") - FILE(MAKE_DIRECTORY "${_TEST_DIR}") - FILE(WRITE "${_TEST_DIR}/nightly-cmake.sh" + macro(ADD_NIGHTLY_BUILD_TEST name script) + set(_TEST_DIR "${CMake_BINARY_DIR}/Tests/${name}") + file(MAKE_DIRECTORY "${_TEST_DIR}") + file(WRITE "${_TEST_DIR}/nightly-cmake.sh" "cd ${_TEST_DIR} ${CMake_BINARY_DIR}/bin/cmake -DCMAKE_CREATE_VERSION=nightly -P ${CMake_SOURCE_DIR}/Utilities/Release/${script} ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/Release/upload_release.cmake ") - ADD_TEST(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) - IF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) - SET_TESTS_PROPERTIES (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) - ENDMACRO(ADD_NIGHTLY_BUILD_TEST) - IF(CMAKE_BUILD_NIGHTLY_RELEASES) + add_test(${name} /bin/sh ${_TEST_DIR}/nightly-cmake.sh) + if(COMMAND SET_TESTS_PROPERTIES AND COMMAND GET_TEST_PROPERTY) + set_tests_properties (${name} PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) + endif() + endmacro() + if(CMAKE_BUILD_NIGHTLY_RELEASES) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyWindows dash2win64_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyMac @@ -483,10 +481,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ dashmacmini5_release.cmake) ADD_NIGHTLY_BUILD_TEST(CMakeNightlyLinux magrathea_release.cmake) - ENDIF(CMAKE_BUILD_NIGHTLY_RELEASES) + endif() # add tests with more complex invocations - ADD_TEST(Framework ${CMAKE_CTEST_COMMAND} + add_test(Framework ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Framework" "${CMake_BINARY_DIR}/Tests/Framework" @@ -497,9 +495,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/Framework/Install" --test-command bar) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Framework") - ADD_TEST(TargetName ${CMAKE_CTEST_COMMAND} + add_test(TargetName ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TargetName" "${CMake_BINARY_DIR}/Tests/TargetName" @@ -510,9 +508,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName") - ADD_TEST(LibName ${CMAKE_CTEST_COMMAND} + add_test(LibName ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LibName" "${CMake_BINARY_DIR}/Tests/LibName" @@ -523,9 +521,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib" --test-command foobar ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LibName") - ADD_TEST(CustComDepend ${CMAKE_CTEST_COMMAND} + add_test(CustComDepend ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustComDepend" "${CMake_BINARY_DIR}/Tests/CustComDepend" @@ -536,9 +534,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin" --test-command foo bar.c ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustComDepend") - ADD_TEST(ArgumentExpansion ${CMAKE_CTEST_COMMAND} + add_test(ArgumentExpansion ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ArgumentExpansion" "${CMake_BINARY_DIR}/Tests/ArgumentExpansion" @@ -547,11 +545,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-exe-dir "${CMake_BINARY_DIR}/Tests/ArgumentExpansion/bin" ) - SET_TESTS_PROPERTIES(ArgumentExpansion PROPERTIES + set_tests_properties(ArgumentExpansion PROPERTIES FAIL_REGULAR_EXPRESSION "Unexpected: ") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ArgumentExpansion") + 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} + --build-options -DCMAKE_BUILD_TYPE=\${CTEST_CONFIGURATION_TYPE} + ) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/GeneratorExpression") - ADD_TEST(CustomCommand ${CMAKE_CTEST_COMMAND} + add_test(CustomCommand ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustomCommand" "${CMake_BINARY_DIR}/Tests/CustomCommand" @@ -562,9 +571,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" --test-command CustomCommand ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") - ADD_TEST(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND} + add_test(CustomCommandWorkingDirectory ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CustomCommandWorkingDirectory" "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory" @@ -574,9 +583,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command working ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommandWorkingDirectory") - #ADD_TEST(SimpleExclude ${CMAKE_CTEST_COMMAND} + #add_test(SimpleExclude ${CMAKE_CTEST_COMMAND} # --build-and-test # "${CMake_SOURCE_DIR}/Tests/SimpleExclude" # "${CMake_BINARY_DIR}/Tests/SimpleExclude" @@ -590,7 +599,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ #-P "${CMake_BINARY_DIR}/Tests/SimpleExclude/run.cmake" #) -# ADD_TEST(SameName ${CMAKE_CTEST_COMMAND} +# add_test(SameName ${CMAKE_CTEST_COMMAND} # --build-and-test # "${CMake_SOURCE_DIR}/Tests/SameName" # "${CMake_BINARY_DIR}/Tests/SameName" @@ -601,7 +610,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # --test-command # "${CMake_BINARY_DIR}/Tests/SameName/Exe1/mytest2") - ADD_TEST(OutOfSource ${CMAKE_CTEST_COMMAND} + add_test(OutOfSource ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/OutOfSource" "${CMake_BINARY_DIR}/Tests/OutOfSource" @@ -611,11 +620,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config --test-command "${CMake_BINARY_DIR}/Tests/OutOfSource/SubDir/OutOfSourceSubdir/simple") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSource") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfSourceDeep") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/OutOfBinary") - ADD_TEST(BuildDepends ${CMAKE_CTEST_COMMAND} + add_test(BuildDepends ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BuildDepends" "${CMake_BINARY_DIR}/Tests/BuildDepends" @@ -623,11 +632,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project BuildDepends --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends") - SET(SimpleInstallInstallDir + set(SimpleInstallInstallDir "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory") - ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND} + add_test(SimpleInstall ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleInstall" "${CMake_BINARY_DIR}/Tests/SimpleInstall" @@ -639,8 +648,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" "-DCTEST_TEST_CPACK:BOOL=${CTEST_TEST_CPACK}" --test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExe) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall") - ADD_TEST(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND} + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstall") + add_test(SimpleInstall-Stage2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleInstallS2" "${CMake_BINARY_DIR}/Tests/SimpleInstallS2" @@ -652,7 +661,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_INSTALL_PREFIX:PATH=${SimpleInstallInstallDir}" "-DSTAGE2:BOOL=1" --test-command ${SimpleInstallInstallDir}/MyTest/bin/SimpleInstExeS2) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleInstallS2") # By default, run the CPackComponents test if the CTEST_TEST_CPACK # option is ON: @@ -663,11 +672,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if (CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") find_program(RPMBUILD NAMES rpmbuild) - endif(CMAKE_SYSTEM_NAME MATCHES "Linux" AND NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + endif() # Do not try to build RPM if (NOT RPMBUILD) set(CPACK_BINARY_RPM OFF) - endif(NOT RPMBUILD) + endif() find_program(NSIS_MAKENSIS_EXECUTABLE NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] @@ -680,23 +689,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ if(WIN32) if(NSIS_MAKENSIS_EXECUTABLE) set(CTEST_RUN_CPackComponents ON) - else(NSIS_MAKENSIS_EXECUTABLE) + else() set(CTEST_RUN_CPackComponents OFF) set(CTEST_package_X11_TEST OFF) - endif(NSIS_MAKENSIS_EXECUTABLE) - endif(WIN32) + endif() + endif() - IF(CTEST_RUN_CPackComponents) + if(CTEST_RUN_CPackComponents) set(CPackComponents_EXTRA_OPTIONS) if(APPLE) set(CPackComponents_EXTRA_OPTIONS -DCPACK_BINARY_DRAGNDROP:BOOL=ON) - endif(APPLE) + endif() if(NSIS_MAKENSIS_EXECUTABLE) set(CPackComponents_EXTRA_OPTIONS ${CPackComponents_EXTRA_OPTIONS} -DCPACK_BINARY_NSIS:BOOL=ON) - endif(NSIS_MAKENSIS_EXECUTABLE) + endif() - ADD_TEST(CPackComponents ${CMAKE_CTEST_COMMAND} + add_test(CPackComponents ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackComponents" "${CMake_BINARY_DIR}/Tests/CPackComponents" @@ -713,22 +722,22 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command ${CMAKE_CMAKE_COMMAND} "-DCPackComponents_BINARY_DIR:PATH=${CMake_BINARY_DIR}/Tests/CPackComponents" -P "${CMake_SOURCE_DIR}/Tests/CPackComponents/VerifyResult.cmake") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents") - ENDIF(CTEST_RUN_CPackComponents) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponents") + endif() - IF(CTEST_RUN_CPackComponentsForAll) + if(CTEST_RUN_CPackComponentsForAll) # Check whether if rpmbuild command is found # before adding RPM tests find_program(RPMBUILD_EXECUTABLE NAMES rpmbuild) if(RPMBUILD_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS RPM) - endif(RPMBUILD_EXECUTABLE) + endif() # Check whether if dpkg command is found # before adding DEB tests find_program(DPKG_EXECUTABLE NAMES dpkg) if(DPKG_EXECUTABLE) list(APPEND ACTIVE_CPACK_GENERATORS DEB) - endif(DPKG_EXECUTABLE) + endif() # ACTIVE_CPACK_GENERATORS variable # now contains the list of 'active generators' @@ -738,17 +747,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND GENLST "ZIP") if(APPLE) list(APPEND GENLST "DragNDrop") - endif(APPLE) + endif() if (NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") list(FIND ACTIVE_CPACK_GENERATORS "RPM" RPM_ACTIVE) if (NOT ${RPM_ACTIVE} EQUAL -1) list(APPEND GENLST "RPM") - endif(NOT ${RPM_ACTIVE} EQUAL -1) - endif(NOT CMAKE_CURRENT_BINARY_DIR MATCHES ".* .*") + endif() + endif() list(FIND ACTIVE_CPACK_GENERATORS "DEB" DEB_ACTIVE) if (NOT ${DEB_ACTIVE} EQUAL -1) list(APPEND GENLST "DEB") - endif(NOT ${DEB_ACTIVE} EQUAL -1) + endif() # set up list of component packaging ways list(APPEND CWAYLST "default") @@ -759,7 +768,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ set(CPackRun_CPackGen "-DCPackGen=${CPackGen}") foreach(CPackComponentWay ${CWAYLST}) set(CPackRun_CPackComponentWay "-DCPackComponentWay=${CPackComponentWay}") - ADD_TEST(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} + add_test(CPackComponentsForAll-${CPackGen}-${CPackComponentWay} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll" "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}" @@ -777,10 +786,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CPackRun_CPackGen}" "${CPackRun_CPackComponentWay}" -P "${CMake_SOURCE_DIR}/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") - endforeach(CPackComponentWay) - endforeach(CPackGen) - ENDIF(CTEST_RUN_CPackComponentsForAll) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackComponentsForAll/build${CPackGen}-${CPackComponentWay}") + endforeach() + endforeach() + endif() # By default, turn this test off (because it takes a long time...) # @@ -794,13 +803,11 @@ ${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(NOT DEFINED CTEST_RUN_CPackTestAllGenerators) + endif() + endif() - IF(CTEST_RUN_CPackTestAllGenerators) - ADD_TEST(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND} + if(CTEST_RUN_CPackTestAllGenerators) + add_test(CPackTestAllGenerators ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators" "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators" @@ -813,16 +820,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -D cpack=${CMAKE_CPACK_COMMAND} -P ${CMake_SOURCE_DIR}/Tests/CPackTestAllGenerators/RunCPack.cmake ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") - ENDIF(CTEST_RUN_CPackTestAllGenerators) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CPackTestAllGenerators") + endif() - IF(CTEST_package_X11_TEST) - SET(X11_build_target_arg --build-target package) - ELSE(CTEST_package_X11_TEST) - SET(X11_build_target_arg) - ENDIF(CTEST_package_X11_TEST) + if(CTEST_package_X11_TEST) + set(X11_build_target_arg --build-target package) + else() + set(X11_build_target_arg) + endif() - ADD_TEST(X11 ${CMAKE_CTEST_COMMAND} + add_test(X11 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/X11" "${CMake_BINARY_DIR}/Tests/X11" @@ -832,53 +839,53 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config ${X11_build_target_arg} --test-command UseX11) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/X11") if(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) set(CTEST_RUN_CMakeTestAllGenerators ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestAllGenerators) + endif() - IF(CTEST_RUN_CMakeTestAllGenerators) - ADD_TEST(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND} + if(CTEST_RUN_CMakeTestAllGenerators) + add_test(CMakeTestAllGenerators ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestAllGenerators/RunCMake.cmake ) - LIST(APPEND TEST_BUILD_DIRS + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestAllGenerators") - ENDIF(CTEST_RUN_CMakeTestAllGenerators) + endif() if(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) set(CTEST_RUN_CMakeTestBadCommandLines ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestBadCommandLines) + endif() - IF(CTEST_RUN_CMakeTestBadCommandLines) - ADD_TEST(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} + if(CTEST_RUN_CMakeTestBadCommandLines) + add_test(CMakeTestBadCommandLines ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines -D gen=${CMAKE_TEST_GENERATOR} -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestBadCommandLines/RunCMake.cmake ) - LIST(APPEND TEST_BUILD_DIRS + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestBadCommandLines") - ENDIF(CTEST_RUN_CMakeTestBadCommandLines) + endif() if(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) set(CTEST_RUN_CMakeTestMultipleConfigures ON) - endif(NOT DEFINED CTEST_RUN_CMakeTestMultipleConfigures) + endif() - IF(CTEST_RUN_CMakeTestMultipleConfigures) - ADD_TEST(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} + if(CTEST_RUN_CMakeTestMultipleConfigures) + add_test(CMakeTestMultipleConfigures ${CMAKE_CMAKE_COMMAND} -D dir=${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures -D gen=${CMAKE_TEST_GENERATOR} -D CMake_SOURCE_DIR=${CMake_SOURCE_DIR} -P ${CMake_SOURCE_DIR}/Tests/CMakeTestMultipleConfigures/RunCMake.cmake ) - LIST(APPEND TEST_BUILD_DIRS + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CMakeTestMultipleConfigures") - ENDIF(CTEST_RUN_CMakeTestMultipleConfigures) + endif() - ADD_TEST(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} + add_test(LoadedCommandOneConfig ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LoadCommandOneConfig" "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig" @@ -887,9 +894,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command LoadedCommand ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig") - ADD_TEST(complex ${CMAKE_CTEST_COMMAND} + add_test(complex ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Complex" "${CMake_BINARY_DIR}/Tests/Complex" @@ -903,9 +910,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex") - ADD_TEST(complexOneConfig ${CMAKE_CTEST_COMMAND} + add_test(complexOneConfig ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig" "${CMake_BINARY_DIR}/Tests/ComplexOneConfig" @@ -916,11 +923,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} --test-command complex) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig") # because of the registry write these tests depend on each other - SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig) + set_tests_properties ( complex PROPERTIES DEPENDS complexOneConfig) - ADD_TEST(Example ${CMAKE_CTEST_COMMAND} + add_test(Example ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Example" "${CMake_BINARY_DIR}/Example" @@ -930,9 +937,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Example/Demo" --test-command helloDemo ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Example") - ADD_TEST(Environment ${CMAKE_CTEST_COMMAND} + add_test(Environment ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Environment" "${CMake_BINARY_DIR}/Tests/Environment" @@ -943,10 +950,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Environment") - IF(QT4_WORKS AND QT_QTGUI_FOUND) - ADD_TEST(QtAutomoc ${CMAKE_CTEST_COMMAND} + if(QT4_WORKS AND QT_QTGUI_FOUND) + add_test(QtAutomoc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/QtAutomoc" "${CMake_BINARY_DIR}/Tests/QtAutomoc" @@ -958,10 +965,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE} --test-command ${CMAKE_CTEST_COMMAND} -V ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") - ENDIF() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/QtAutomoc") + endif() - ADD_TEST(ExternalProject ${CMAKE_CTEST_COMMAND} + add_test(ExternalProject ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/ExternalProject" "${CMake_BINARY_DIR}/Tests/ExternalProject" @@ -972,13 +979,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") - SET_TESTS_PROPERTIES(ExternalProject PROPERTIES + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ExternalProject") + set_tests_properties(ExternalProject PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) # do each of the tutorial steps - FOREACH(STP RANGE 1 7) - ADD_TEST(TutorialStep${STP} ${CMAKE_CTEST_COMMAND} + foreach(STP RANGE 1 7) + add_test(TutorialStep${STP} ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Tutorial/Step${STP}" "${CMake_BINARY_DIR}/Tests/Tutorial/Step${STP}" @@ -987,10 +994,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-project Tutorial --test-command Tutorial 25.0) - ENDFOREACH(STP) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial") + endforeach() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Tutorial") - ADD_TEST(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} + add_test(testing ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} --build-and-test "${CMake_SOURCE_DIR}/Tests/Testing" "${CMake_BINARY_DIR}/Tests/Testing" @@ -999,10 +1006,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE} ) - SET_TESTS_PROPERTIES(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing") + set_tests_properties(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing") - ADD_TEST(wrapping ${CMAKE_CTEST_COMMAND} + add_test(wrapping ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping" @@ -1012,7 +1019,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --test-command wrapping ) - ADD_TEST(qtwrapping ${CMAKE_CTEST_COMMAND} + add_test(qtwrapping ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Wrapping" "${CMake_BINARY_DIR}/Tests/Wrapping" @@ -1022,9 +1029,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Wrapping/bin" --test-command qtwrapping ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Wrapping") - ADD_TEST(testdriver1 ${CMAKE_CTEST_COMMAND} + add_test(testdriver1 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" @@ -1035,7 +1042,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command TestDriverTest test1 ) - ADD_TEST(testdriver2 ${CMAKE_CTEST_COMMAND} + add_test(testdriver2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" @@ -1046,7 +1053,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command TestDriverTest test2 ) - ADD_TEST(testdriver3 ${CMAKE_CTEST_COMMAND} + add_test(testdriver3 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestDriver" "${CMake_BINARY_DIR}/Tests/TestDriver" @@ -1056,9 +1063,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project TestDriverTest --test-command TestDriverTest subdir/test3 ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestDriver") - ADD_TEST(Dependency ${CMAKE_CTEST_COMMAND} + add_test(Dependency ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Dependency" "${CMake_BINARY_DIR}/Tests/Dependency" @@ -1068,9 +1075,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project Dependency --test-command exec ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Dependency") - IF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + if("${CMAKE_SYSTEM_NAME}" MATCHES syllable) # RPATH isn't supported under Syllable, so the tests don't # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR @@ -1078,17 +1085,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # For now we just require on Syllable that the user adjusts the DLL_PATH # environment variable, so except the two tests below all other tests will succeed. - SET(_DLL_PATH "$ENV{DLL_PATH}") - IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") - MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable") - ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") - IF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") - MESSAGE(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable") - ENDIF(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") + set(_DLL_PATH "$ENV{DLL_PATH}") + if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.(:.*)?$") + message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/.\" to the DLL_PATH environment variable") + endif() + if(NOT "${_DLL_PATH}" MATCHES "^(.*:)?\\@bindir\\@/\\.\\./lib(:.*)?$") + message(FATAL_ERROR "In order to successfully run the CMake test suite on Syllable you need to add \"\\@bindir\\@/../lib\" to the DLL_PATH environment variable") + endif() - ELSE("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + else() - ADD_TEST(JumpWithLibOut ${CMAKE_CTEST_COMMAND} + add_test(JumpWithLibOut ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Jump" "${CMake_BINARY_DIR}/Tests/Jump/WithLibOut" @@ -1101,7 +1108,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command jumpExecutable ) - ADD_TEST(JumpNoLibOut ${CMAKE_CTEST_COMMAND} + add_test(JumpNoLibOut ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Jump" "${CMake_BINARY_DIR}/Tests/Jump/NoLibOut" @@ -1112,9 +1119,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command jumpExecutable ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Jump") - ADD_TEST(Plugin ${CMAKE_CTEST_COMMAND} + add_test(Plugin ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Plugin" "${CMake_BINARY_DIR}/Tests/Plugin" @@ -1123,14 +1130,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command bin/example) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Plugin") - IF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) + if(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) ADD_TEST_MACRO(RuntimePath RuntimePath) - ENDIF(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG) - ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES syllable) + endif() + endif() - ADD_TEST(linkorder1 ${CMAKE_CTEST_COMMAND} + add_test(linkorder1 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder" @@ -1140,7 +1147,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --test-command Exec1 ) - ADD_TEST(linkorder2 ${CMAKE_CTEST_COMMAND} + add_test(linkorder2 ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkLineOrder" "${CMake_BINARY_DIR}/Tests/LinkLineOrder" @@ -1149,19 +1156,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project LinkLineOrder --test-command Exec2 ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder") - SET_TESTS_PROPERTIES ( qtwrapping PROPERTIES DEPENDS wrapping) - SET_TESTS_PROPERTIES ( testdriver1 PROPERTIES DEPENDS qtwrapping) - SET_TESTS_PROPERTIES ( testdriver2 PROPERTIES DEPENDS testdriver1) - SET_TESTS_PROPERTIES ( testdriver3 PROPERTIES DEPENDS testdriver2) - SET_TESTS_PROPERTIES ( linkorder2 PROPERTIES DEPENDS linkorder1) - SET_TESTS_PROPERTIES ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LinkLineOrder") + set_tests_properties ( qtwrapping PROPERTIES DEPENDS wrapping) + set_tests_properties ( testdriver1 PROPERTIES DEPENDS qtwrapping) + set_tests_properties ( testdriver2 PROPERTIES DEPENDS testdriver1) + set_tests_properties ( testdriver3 PROPERTIES DEPENDS testdriver2) + set_tests_properties ( linkorder2 PROPERTIES DEPENDS linkorder1) + set_tests_properties ( SimpleInstall-Stage2 PROPERTIES DEPENDS SimpleInstall) # Test static linking on toolchains known to support it. - IF("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$" + if("${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU)$" AND NOT APPLE AND NOT WIN32 AND NOT CYGWIN AND EXISTS "/usr/lib/libm.a") - ADD_TEST(LinkStatic ${CMAKE_CTEST_COMMAND} + add_test(LinkStatic ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/LinkStatic" "${CMake_BINARY_DIR}/Tests/LinkStatic" @@ -1171,10 +1178,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options -DMATH_LIBRARY:FILEPATH=/usr/lib/libm.a --test-command LinkStatic ) - ENDIF() + endif() - IF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) - ADD_TEST(kwsys ${CMAKE_CTEST_COMMAND} + if(NOT CMAKE_TEST_DIFFERENT_GENERATOR) + add_test(kwsys ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Source/kwsys" "${CMake_BINARY_DIR}/Tests/kwsys" @@ -1183,27 +1190,27 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project kwsys --test-command kwsysTestsCxx testIOS ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") - ENDIF(NOT CMAKE_TEST_DIFFERENT_GENERATOR) - SET(MAKE_IS_GNU ) - IF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) - EXEC_PROGRAM( + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/kwsys") + endif() + set(MAKE_IS_GNU ) + if(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + exec_program( ${CMAKE_TEST_MAKEPROGRAM} ARGS no_such_target --version RETURN_VALUE res OUTPUT_VARIABLE out ) - IF("${res}" EQUAL 0) - IF("${out}" MATCHES "GNU") - SET(MAKE_IS_GNU 1) - ENDIF("${out}" MATCHES "GNU") - ENDIF("${res}" EQUAL 0) - ENDIF(${CMAKE_TEST_MAKEPROGRAM} MATCHES make) + if("${res}" EQUAL 0) + if("${out}" MATCHES "GNU") + set(MAKE_IS_GNU 1) + endif() + endif() + endif() # only add this test on platforms that support it # some old versions of make simply cannot handle spaces in paths - IF (MAKE_IS_GNU OR + if (MAKE_IS_GNU OR "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland") - ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND} + add_test(SubDirSpaces ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDirSpaces" "${CMake_BINARY_DIR}/Tests/SubDirSpaces" @@ -1216,13 +1223,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDirSpaces/ShouldBeHere" "${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") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDirSpaces") + endif () - IF (WIN32) - ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND} + if (WIN32) + add_test(SubDir ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir" @@ -1234,8 +1239,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.obj" ) - ELSE (WIN32) - ADD_TEST(SubDir ${CMAKE_CTEST_COMMAND} + else () + add_test(SubDir ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SubDir" "${CMake_BINARY_DIR}/Tests/SubDir" @@ -1247,22 +1252,23 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "${CMake_BINARY_DIR}/Tests/SubDir/ShouldBeHere" "${CMake_BINARY_DIR}/Tests/SubDir/testfromsubdir.o" ) - ENDIF (WIN32) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") + endif () + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SubDir") - IF(CMAKE_TEST_MSVC) + if(CMAKE_TEST_MSVC) ADD_TEST_MACRO(ForceInclude foo) + ADD_TEST_MACRO(PDBDirectoryAndName myexe) ADD_TEST_MACRO(PrecompiledHeader foo) - ENDIF() - IF(CMAKE_TEST_MSVC OR + endif() + if(CMAKE_TEST_MSVC OR "${CMAKE_TEST_GENERATOR}" MATCHES "(MSYS|MinGW) Makefiles") ADD_TEST_MACRO(ModuleDefinition example_exe) - ENDIF() + endif() ADD_TEST_MACRO(CheckCompilerRelatedVariables CheckCompilerRelatedVariables) - IF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") - ADD_TEST(MakeClean ${CMAKE_CTEST_COMMAND} + if("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + add_test(MakeClean ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/MakeClean" "${CMake_BINARY_DIR}/Tests/MakeClean" @@ -1272,8 +1278,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-exe-dir "${CMake_BINARY_DIR}/MakeClean" --test-command check_clean ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "Makefile") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MakeClean") + endif() if(NOT DEFINED CTEST_RUN_MFC) set(CTEST_RUN_MFC OFF) @@ -1380,12 +1386,12 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/MFC") endif() - IF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") - IF(NOT MSVC60) + if(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + if(NOT MSVC60) ADD_TEST_MACRO(SBCS SBCS) - ENDIF(NOT MSVC60) + endif() - ADD_TEST(VSExternalInclude ${CMAKE_CTEST_COMMAND} + add_test(VSExternalInclude ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSExternalInclude" "${CMake_BINARY_DIR}/Tests/VSExternalInclude" @@ -1394,9 +1400,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project VSExternalInclude --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSExternalInclude) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSExternalInclude") - ADD_TEST(VSMidl ${CMAKE_CTEST_COMMAND} + add_test(VSMidl ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VSMidl" "${CMake_BINARY_DIR}/Tests/VSMidl" @@ -1405,14 +1411,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project VSMidl --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command VSMidl) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") - ENDIF(${CMAKE_TEST_GENERATOR} MATCHES "Visual Studio") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/VSMidl") + endif() - IF (APPLE) + if (APPLE) if (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - SET(BundleTestInstallDir + set(BundleTestInstallDir "${CMake_BINARY_DIR}/Tests/BundleTest/InstallDirectory") - ADD_TEST(BundleTest ${CMAKE_CTEST_COMMAND} + add_test(BundleTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleTest" "${CMake_BINARY_DIR}/Tests/BundleTest" @@ -1426,9 +1432,9 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMake_SOURCE_DIR:PATH=${CMake_SOURCE_DIR}" --test-command ${BundleTestInstallDir}/Applications/SecondBundleExe.app/Contents/MacOS/SecondBundleExe) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleTest") - ADD_TEST(CFBundleTest ${CMAKE_CTEST_COMMAND} + add_test(CFBundleTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/CFBundleTest" "${CMake_BINARY_DIR}/Tests/CFBundleTest" @@ -1441,14 +1447,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ -Ddir=${CMake_BINARY_DIR}/Tests/CFBundleTest -Dgen=${CMAKE_TEST_GENERATOR} -P ${CMake_SOURCE_DIR}/Tests/CFBundleTest/VerifyResult.cmake) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CFBundleTest") ADD_TEST_MACRO(ObjC++ ObjC++) - ENDIF (CMAKE_COMPILER_IS_GNUCXX OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") - ENDIF (APPLE) + endif () + endif () - IF(APPLE AND CTEST_TEST_CPACK) - ADD_TEST(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} + if(APPLE AND CTEST_TEST_CPACK) + add_test(BundleGeneratorTest ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/BundleGeneratorTest" "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest" @@ -1459,10 +1465,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-target package --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") - ENDIF(APPLE AND CTEST_TEST_CPACK) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest") + endif() - ADD_TEST(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedUnusedViaSet ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaSet" "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet" @@ -1471,13 +1477,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedUnusedViaSet --build-options "--warn-unused-vars") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES + set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES PASS_REGULAR_EXPRESSION "unused variable \\(changing definition\\) 'UNUSED_VARIABLE'") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaSet PROPERTIES + set_tests_properties(WarnUnusedUnusedViaSet PROPERTIES FAIL_REGULAR_EXPRESSION "unused variable \\(unsetting\\) 'UNUSED_VARIABLE'") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaSet") - ADD_TEST(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedUnusedViaUnset ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUnusedViaUnset" "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset" @@ -1486,13 +1492,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedUnusedViaUnset --build-options "--warn-unused-vars") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES - PASS_REGULAR_EXPRESSION "CMake Warning .*:7 \\(set\\):") - SET_TESTS_PROPERTIES(WarnUnusedUnusedViaUnset PROPERTIES - FAIL_REGULAR_EXPRESSION "CMake Warning .*:5 \\(set\\):") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") + set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES + PASS_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:7 \\(set\\):") + set_tests_properties(WarnUnusedUnusedViaUnset PROPERTIES + FAIL_REGULAR_EXPRESSION "CMake Warning .*VariableUnusedViaUnset.CMakeLists.txt:5 \\(set\\):") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedUnusedViaUnset") - ADD_TEST(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedCliUnused ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused" @@ -1501,11 +1507,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedCliUnused --build-options "-DUNUSED_CLI_VARIABLE=Unused") - SET_TESTS_PROPERTIES(WarnUnusedCliUnused PROPERTIES + set_tests_properties(WarnUnusedCliUnused PROPERTIES PASS_REGULAR_EXPRESSION "CMake Warning:.*Manually-specified variables were not used by the project:.* UNUSED_CLI_VARIABLE") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUnused") - ADD_TEST(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND} + add_test(WarnUnusedCliUsed ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed" @@ -1514,13 +1520,13 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUnusedCliUsed --build-options "-DUSED_VARIABLE=Usage proven") - SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES + set_tests_properties(WarnUnusedCliUsed PROPERTIES PASS_REGULAR_EXPRESSION "Usage proven") - SET_TESTS_PROPERTIES(WarnUnusedCliUsed PROPERTIES + set_tests_properties(WarnUnusedCliUsed PROPERTIES FAIL_REGULAR_EXPRESSION "CMake Warning: The variable, 'USED_VARIABLE'") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUnusedCliUsed") - ADD_TEST(WarnUninitialized ${CMAKE_CTEST_COMMAND} + add_test(WarnUninitialized ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/VariableUsage" "${CMake_BINARY_DIR}/Tests/WarnUninitialized" @@ -1529,11 +1535,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-noclean --build-project WarnUninitialized --build-options "--warn-uninitialized") - SET_TESTS_PROPERTIES(WarnUninitialized PROPERTIES + set_tests_properties(WarnUninitialized PROPERTIES PASS_REGULAR_EXPRESSION "uninitialized variable 'USED_VARIABLE'") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/WarnUninitialized") - ADD_TEST(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND} + add_test(TestsWorkingDirectory ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/TestsWorkingDirectory" "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory" @@ -1544,200 +1550,200 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --force-new-ctest-process --test-command ${CMAKE_CTEST_COMMAND} -V -C \${CTEST_CONFIGURATION_TYPE} ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TestsWorkingDirectory") # Make sure CTest can handle a test with no newline in output. - ADD_TEST(CTest.NoNewline + add_test(CTest.NoNewline ${CMAKE_CMAKE_COMMAND} -E echo_append "This line has no newline!") # A simple test for ctest in script mode - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in" + configure_file("${CMake_SOURCE_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake" @ONLY) -# ADD_TEST(CTest.ScriptMode ${CMAKE_CTEST_COMMAND} +# add_test(CTest.ScriptMode ${CMAKE_CTEST_COMMAND} # -S "${CMake_BINARY_DIR}/Tests/CTestScriptMode/CTestTestScriptMode.cmake" # ) - SET(CTEST_TEST_UPDATE 1) - IF(CTEST_TEST_UPDATE) + set(CTEST_TEST_UPDATE 1) + if(CTEST_TEST_UPDATE) # Test CTest Update with Subversion - FIND_PACKAGE(Subversion QUIET) - IF(Subversion_FOUND) - GET_FILENAME_COMPONENT(_Subversion_BIN_DIR + find_package(Subversion QUIET) + if(Subversion_FOUND) + get_filename_component(_Subversion_BIN_DIR ${Subversion_SVN_EXECUTABLE} PATH) - FIND_PROGRAM(Subversion_SVNADMIN_EXECUTABLE svnadmin + find_program(Subversion_SVNADMIN_EXECUTABLE svnadmin HINTS ${_Subversion_BIN_DIR} ) - MARK_AS_ADVANCED(Subversion_SVNADMIN_EXECUTABLE) - IF(NOT Subversion_SVNADMIN_EXECUTABLE) - SET(Subversion_FOUND FALSE) - ENDIF(NOT Subversion_SVNADMIN_EXECUTABLE) - ENDIF(Subversion_FOUND) - IF(Subversion_FOUND) - SET(CTestUpdateSVN_DIR "CTest UpdateSVN") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in" + mark_as_advanced(Subversion_SVNADMIN_EXECUTABLE) + if(NOT Subversion_SVNADMIN_EXECUTABLE) + set(Subversion_FOUND FALSE) + endif() + endif() + if(Subversion_FOUND) + set(CTestUpdateSVN_DIR "CTest UpdateSVN") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateSVN.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" @ONLY) - ADD_TEST(CTest.UpdateSVN ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateSVN ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateSVN.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}") - ENDIF(Subversion_FOUND) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateSVN_DIR}") + endif() # Test CTest Update with CVS - IF(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) - FIND_PACKAGE(CVS QUIET) - ELSE(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) - FIND_PROGRAM(CVS_EXECUTABLE NAMES cvs) - SET(CVS_FOUND ${CVS_EXECUTABLE}) - ENDIF(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) - SET(CTEST_TEST_UPDATE_CVS ${CVS_FOUND}) - IF(CTEST_TEST_UPDATE_CVS AND NOT UNIX) - IF("${CVS_EXECUTABLE}" MATCHES "cygwin") - MESSAGE(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!") - SET(CTEST_TEST_UPDATE_CVS 0) - ENDIF("${CVS_EXECUTABLE}" MATCHES "cygwin") - ENDIF(CTEST_TEST_UPDATE_CVS AND NOT UNIX) - IF(CTEST_TEST_UPDATE_CVS) - SET(CTestUpdateCVS_DIR "CTest UpdateCVS") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in" + if(EXISTS ${CMAKE_ROOT}/Modules/FindCVS.cmake) + find_package(CVS QUIET) + else() + find_program(CVS_EXECUTABLE NAMES cvs) + set(CVS_FOUND ${CVS_EXECUTABLE}) + endif() + set(CTEST_TEST_UPDATE_CVS ${CVS_FOUND}) + if(CTEST_TEST_UPDATE_CVS AND NOT UNIX) + if("${CVS_EXECUTABLE}" MATCHES "cygwin") + message(STATUS "No CTest.UpdateCVS test with cygwin cvs.exe outside cygwin!") + set(CTEST_TEST_UPDATE_CVS 0) + endif() + endif() + if(CTEST_TEST_UPDATE_CVS) + set(CTestUpdateCVS_DIR "CTest UpdateCVS") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateCVS.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" @ONLY) - ADD_TEST(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateCVS ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateCVS.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}") - ENDIF(CTEST_TEST_UPDATE_CVS) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateCVS_DIR}") + endif() # Test CTest Update with BZR - FIND_PROGRAM(BZR_EXECUTABLE NAMES bzr) - MARK_AS_ADVANCED(BZR_EXECUTABLE) - SET(CTEST_TEST_UPDATE_BZR 0) - IF(BZR_EXECUTABLE) - IF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - SET(CTEST_TEST_UPDATE_BZR 1) - ENDIF(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - ENDIF(BZR_EXECUTABLE) - IF(CTEST_TEST_UPDATE_BZR) + find_program(BZR_EXECUTABLE NAMES bzr) + mark_as_advanced(BZR_EXECUTABLE) + set(CTEST_TEST_UPDATE_BZR 0) + if(BZR_EXECUTABLE) + if(NOT "${BZR_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + set(CTEST_TEST_UPDATE_BZR 1) + endif() + endif() + if(CTEST_TEST_UPDATE_BZR) # Check if xmloutput plugin is there - EXECUTE_PROCESS(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres + execute_process(COMMAND ${BZR_EXECUTABLE} xmlplugins RESULT_VARIABLE xmlplugres OUTPUT_QUIET ERROR_QUIET) - IF( NOT ${xmlplugres} ) - SET(CTestUpdateBZR_DIR "CTest UpdateBZR") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" + if( NOT ${xmlplugres} ) + set(CTestUpdateBZR_DIR "CTest UpdateBZR") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake" @ONLY) - ADD_TEST(CTest.UpdateBZR ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateBZR ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") - SET(CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") + set(CTestUpdateBZR_DIR "CTest UpdateBZR_CLocale") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateBZR.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR_CLocale.cmake" @ONLY) - ADD_TEST(CTest.UpdateBZR.CLocale ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateBZR.CLocale ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateBZR_CLocale.cmake" ) - SET_TESTS_PROPERTIES(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") - ENDIF( NOT ${xmlplugres} ) - ENDIF(CTEST_TEST_UPDATE_BZR) + set_tests_properties(CTest.UpdateBZR.CLocale PROPERTIES ENVIRONMENT LC_ALL=C) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateBZR_DIR}") + endif() + endif() # Test CTest Update with GIT - FIND_PROGRAM(GIT_EXECUTABLE NAMES git) - MARK_AS_ADVANCED(GIT_EXECUTABLE) - SET(CTEST_TEST_UPDATE_GIT 0) - IF(GIT_EXECUTABLE) - IF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - SET(CTEST_TEST_UPDATE_GIT 1) - ENDIF(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - ENDIF(GIT_EXECUTABLE) - IF(CTEST_TEST_UPDATE_GIT) - SET(CTestUpdateGIT_DIR "CTest UpdateGIT") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in" + find_program(GIT_EXECUTABLE NAMES git) + mark_as_advanced(GIT_EXECUTABLE) + set(CTEST_TEST_UPDATE_GIT 0) + if(GIT_EXECUTABLE) + if(NOT "${GIT_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + set(CTEST_TEST_UPDATE_GIT 1) + endif() + endif() + if(CTEST_TEST_UPDATE_GIT) + set(CTestUpdateGIT_DIR "CTest UpdateGIT") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateGIT.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" @ONLY) - ADD_TEST(CTest.UpdateGIT ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateGIT ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateGIT.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}") - ENDIF(CTEST_TEST_UPDATE_GIT) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateGIT_DIR}") + endif() # Test CTest Update with HG - FIND_PROGRAM(HG_EXECUTABLE NAMES hg) - MARK_AS_ADVANCED(HG_EXECUTABLE) - SET(CTEST_TEST_UPDATE_HG 0) - IF(HG_EXECUTABLE) - IF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - SET(CTEST_TEST_UPDATE_HG 1) - ENDIF(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) - ENDIF(HG_EXECUTABLE) - IF(CTEST_TEST_UPDATE_HG) - SET(CTestUpdateHG_DIR "CTest UpdateHG") - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in" + find_program(HG_EXECUTABLE NAMES hg) + mark_as_advanced(HG_EXECUTABLE) + set(CTEST_TEST_UPDATE_HG 0) + if(HG_EXECUTABLE) + if(NOT "${HG_EXECUTABLE}" MATCHES "cygwin" OR UNIX) + set(CTEST_TEST_UPDATE_HG 1) + endif() + endif() + if(CTEST_TEST_UPDATE_HG) + set(CTestUpdateHG_DIR "CTest UpdateHG") + configure_file("${CMake_SOURCE_DIR}/Tests/CTestUpdateHG.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" @ONLY) - ADD_TEST(CTest.UpdateHG ${CMAKE_CMAKE_COMMAND} + add_test(CTest.UpdateHG ${CMAKE_CMAKE_COMMAND} -P "${CMake_BINARY_DIR}/Tests/CTestUpdateHG.cmake" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}") - ENDIF(CTEST_TEST_UPDATE_HG) - ENDIF(CTEST_TEST_UPDATE) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/${CTestUpdateHG_DIR}") + endif() + endif() - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoBuild.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestNoBuild ${CMAKE_CTEST_COMMAND} + add_test(CTestTestNoBuild ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoBuild.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut1.log" ) - SET_TESTS_PROPERTIES(CTestTestNoBuild PROPERTIES + set_tests_properties(CTestTestNoBuild PROPERTIES FAIL_REGULAR_EXPRESSION "Error" WILL_FAIL true) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestFailure/testNoExe.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestNoExe ${CMAKE_CTEST_COMMAND} + add_test(CTestTestNoExe ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testNoExe.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestFailure/testOut2.log" ) - SET_TESTS_PROPERTIES(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild + set_tests_properties(CTestTestNoExe PROPERTIES DEPENDS CTestTestNoBuild PASS_REGULAR_EXPRESSION "Could not find executable" FAIL_REGULAR_EXPRESSION "SegFault") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestUpload/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestUpload ${CMAKE_CTEST_COMMAND} + add_test(CTestTestUpload ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestUpload/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestUpload/testOut.log" ) - SET_TESTS_PROPERTIES(CTestTestUpload PROPERTIES + set_tests_properties(CTestTestUpload PROPERTIES PASS_REGULAR_EXPRESSION "Upload\\.xml") - CONFIGURE_FILE( + 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} + add_test(CTestTestConfigFileInBuildDir1 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/test1.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir1/testOut1.log" ) REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_SOURCE_DIR "${CMake_SOURCE_DIR}") - SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild + set_tests_properties(CTestTestConfigFileInBuildDir1 PROPERTIES DEPENDS CTestTestNoBuild PASS_REGULAR_EXPRESSION "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_SOURCE_DIR}.Tests.CTestTestConfigFileInBuildDir.CTestConfig.cmake") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" @ONLY ESCAPE_QUOTES) - CONFIGURE_FILE( + 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} + add_test(CTestTestConfigFileInBuildDir2 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/test2.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/testOut2.log" ) REGEX_ESCAPE_STRING(CTEST_TEST_ESCAPED_BINARY_DIR "${CMake_BINARY_DIR}") - SET_TESTS_PROPERTIES(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild + set_tests_properties(CTestTestConfigFileInBuildDir2 PROPERTIES DEPENDS CTestTestNoBuild REQUIRED_FILES ${CMake_BINARY_DIR}/Tests/CTestTestConfigFileInBuildDir2/CTestConfig.cmake PASS_REGULAR_EXPRESSION "Reading ctest configuration file: ${CTEST_TEST_ESCAPED_BINARY_DIR}.Tests.CTestTestConfigFileInBuildDir2.CTestConfig.cmake") @@ -1829,175 +1835,175 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ADD_TEST_MACRO(CMakeCommands.target_link_libraries target_link_libraries) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCrash/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestCrash ${CMAKE_CTEST_COMMAND} + add_test(CTestTestCrash ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestCrash/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCrash/testOutput.log" ) # with watcom the SEGFAULT is not found, it just fails - IF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") - SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES + if(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "Failed") - ELSE(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") - SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES + else() + set_tests_properties(CTestTestCrash PROPERTIES PASS_REGULAR_EXPRESSION "(Illegal|SegFault)") - ENDIF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake") + endif() - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestBadExe ${CMAKE_CTEST_COMMAND} + add_test(CTestTestBadExe ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/testOutput.log" ) - SET(CTestTestBadExe_REGEX "BAD_COMMAND") + set(CTestTestBadExe_REGEX "BAD_COMMAND") # some cygwin can not be made to produce a BAD_COMMAND error # the best we can get from it is a failed test - IF(CYGWIN) - SET(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND") - ENDIF() - SET_TESTS_PROPERTIES(CTestTestBadExe PROPERTIES + if(CYGWIN) + set(CTestTestBadExe_REGEX "(\\*\\*\\*Failed)|BAD_COMMAND") + endif() + set_tests_properties(CTestTestBadExe PROPERTIES PASS_REGULAR_EXPRESSION "${CTestTestBadExe_REGEX}") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestParallel/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestParallel ${CMAKE_CTEST_COMMAND} + add_test(CTestTestParallel ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestParallel/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log" ) - ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) - SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") - SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION + add_test(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) + set_tests_properties(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") + set_tests_properties(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION "All Labels:.* Label1.* Label2") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestResourceLock ${CMAKE_CTEST_COMMAND} + add_test(CTestTestResourceLock ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/output.log" ) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestScheduler/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestScheduler ${CMAKE_CTEST_COMMAND} + add_test(CTestTestScheduler ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestScheduler/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestScheduler PROPERTIES + set_tests_properties(CTestTestScheduler PROPERTIES PASS_REGULAR_EXPRESSION "Start 1.*Start 2.*Start 3.*Start 4.*Start 4.*Start 3.*Start 2.*Start 1" RESOURCE_LOCK "CostData") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCostSerial/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestCostSerial ${CMAKE_CTEST_COMMAND} + add_test(CTestTestCostSerial ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCostSerial/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestCostSerial PROPERTIES + set_tests_properties(CTestTestCostSerial PROPERTIES PASS_REGULAR_EXPRESSION "Start 2.*Start 3.*Start 1.*Start 2.*Start 3.*Start 1" RESOURCE_LOCK "CostData") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake" @ONLY ESCAPE_QUOTES) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestStopTime/GetDate.cmake" "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/GetDate.cmake" COPYONLY) - ADD_TEST(CTestTestStopTime ${CMAKE_CTEST_COMMAND} + add_test(CTestTestStopTime ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestStopTime/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestStopTime PROPERTIES + set_tests_properties(CTestTestStopTime PROPERTIES PASS_REGULAR_EXPRESSION "The stop time has been passed") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestSubdir/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestSubdir ${CMAKE_CTEST_COMMAND} + add_test(CTestTestSubdir ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestSubdir/testOutput.log" ) #make sure all 3 subdirs were added - SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES + set_tests_properties(CTestTestSubdir PROPERTIES PASS_REGULAR_EXPRESSION "0 tests failed out of 3") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestTimeout ${CMAKE_CTEST_COMMAND} + add_test(CTestTestTimeout ${CMAKE_CTEST_COMMAND} -C "\${CTestTest_CONFIG}" -S "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestTimeout PROPERTIES + set_tests_properties(CTestTestTimeout PROPERTIES PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND} + add_test(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/testOutput.log") - SET_TESTS_PROPERTIES(CTestTestZeroTimeout PROPERTIES + set_tests_properties(CTestTestZeroTimeout PROPERTIES FAIL_REGULAR_EXPRESSION "\\*\\*\\*Timeout") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestDepends ${CMAKE_CTEST_COMMAND} + add_test(CTestTestDepends ${CMAKE_CTEST_COMMAND} -C "\${CTestTest_CONFIG}" -S "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestDepends/testOutput.log" ) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestCycle/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestCycle ${CMAKE_CTEST_COMMAND} + add_test(CTestTestCycle ${CMAKE_CTEST_COMMAND} -C "\${CTestTest_CONFIG}" -S "${CMake_BINARY_DIR}/Tests/CTestTestCycle/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestCycle/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestCycle PROPERTIES + set_tests_properties(CTestTestCycle PROPERTIES PASS_REGULAR_EXPRESSION "a cycle exists in the test dependency graph") - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" @ONLY ESCAPE_QUOTES) - CONFIGURE_FILE( + configure_file( "${CMake_SOURCE_DIR}/Tests/CTestTestRunScript/hello.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/hello.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestRunScript ${CMAKE_CTEST_COMMAND} + add_test(CTestTestRunScript ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestRunScript/testOutput.log" ) - ADD_TEST(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N) + add_test(CTestTestShowOnly ${CMAKE_CTEST_COMMAND} -N) - ADD_TEST(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B) + add_test(CTestBatchTest ${CMAKE_CTEST_COMMAND} -B) # 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' @@ -2048,120 +2054,83 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ endforeach() - IF (CMAKE_TESTS_CDASH_SERVER) - SET(regex "^([^:]+)://([^/]+)(/.*)$") + if (CMAKE_TESTS_CDASH_SERVER) + set(regex "^([^:]+)://([^/]+)(/.*)$") - IF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - SET(protocol "${CMAKE_MATCH_1}") - SET(server "${CMAKE_MATCH_2}") - SET(path "${CMAKE_MATCH_3}") - ELSE ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - SET(protocol "http") - SET(server "www.cdash.org") - SET(path "/CDash") - MESSAGE("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") - MESSAGE(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") - ENDIF ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") - ENDIF (CMAKE_TESTS_CDASH_SERVER) + if ("${CMAKE_TESTS_CDASH_SERVER}" MATCHES "${regex}") + set(protocol "${CMAKE_MATCH_1}") + set(server "${CMAKE_MATCH_2}") + set(path "${CMAKE_MATCH_3}") + else () + set(protocol "http") + set(server "www.cdash.org") + set(path "/CDash") + message("warning: CMAKE_TESTS_CDASH_SERVER does not match expected regex...") + message(" ...using default url='${protocol}://${server}${path}' for CTestTest[23]") + endif () + endif () - IF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in" + if (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) + configure_file("${CMake_SOURCE_DIR}/Tests/CTestTest/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTest ${CMAKE_CTEST_COMMAND} + add_test(CTestTest ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest/testOutput.log" ) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in" + configure_file("${CMake_SOURCE_DIR}/Tests/CTestTest2/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTest2 ${CMAKE_CTEST_COMMAND} + add_test(CTestTest2 ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTest2/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTest2/testOutput.log" ) - CONFIGURE_FILE("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in" + configure_file("${CMake_SOURCE_DIR}/Tests/CTestTestChecksum/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" @ONLY ESCAPE_QUOTES) - ADD_TEST(CTestTestChecksum ${CMAKE_CTEST_COMMAND} + add_test(CTestTestChecksum ${CMAKE_CTEST_COMMAND} -S "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/test.cmake" -V --output-log "${CMake_BINARY_DIR}/Tests/CTestTestChecksum/testOutput.log" ) - SET_TESTS_PROPERTIES(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION + set_tests_properties(CTestTestChecksum PROPERTIES PASS_REGULAR_EXPRESSION "Submission failed: Checksum failed for file") # these tests take a long time, make sure they have it # if timeouts have not already been set - GET_TEST_PROPERTY(CTestTest TIMEOUT PREVIOUS_TIMEOUT) - IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES ( CTestTest + get_test_property(CTestTest TIMEOUT PREVIOUS_TIMEOUT) + if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + set_tests_properties ( CTestTest PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + endif () - GET_TEST_PROPERTY(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT) - IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES ( CTestTest2 + get_test_property(CTestTest2 TIMEOUT PREVIOUS_TIMEOUT) + if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + set_tests_properties ( CTestTest2 PROPERTIES TIMEOUT ${CMAKE_LONG_TEST_TIMEOUT}) - ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - ENDIF (CTEST_TEST_CTEST AND CMAKE_RUN_LONG_TESTS AND CMAKE_TESTS_CDASH_SERVER) - - IF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) - IF(UNIX) - IF(NOT QT4_FOUND) - FIND_PACKAGE(Qt4) - ENDIF(NOT QT4_FOUND) - - 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(NOT EXISTS "${QT_QTNETWORK_INCLUDE_DIR}/QAbstractNetworkCache") - ELSE(QT4_FOUND) - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(QT4_FOUND) - - FIND_PACKAGE(Perl) - IF(NOT PERL_FOUND) - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(NOT PERL_FOUND) - - FIND_PACKAGE(ZLIB) - IF(NOT ZLIB_FOUND) - SET(TRY_BUILD_KDE4 FALSE) - ENDIF(NOT ZLIB_FOUND) - - 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(TRY_BUILD_KDE4) - - ENDIF(UNIX) - ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH) - - IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) - SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) - ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) - IF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif () + endif () + + if("${CMAKE_TEST_GENERATOR}" MATCHES Xcode) + set(CMAKE_SKIP_BOOTSTRAP_TEST 1) + endif() + if(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") # If there is CMakeLists.txt in the binary tree, assume in-source build - SET(CMAKE_SKIP_BOOTSTRAP_TEST 1) - ENDIF(EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") - SET(bootstrap "") - IF(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) - IF(UNIX) - SET(bootstrap ${CMake_SOURCE_DIR}/bootstrap) - ELSEIF(MSYS) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in + set(CMAKE_SKIP_BOOTSTRAP_TEST 1) + endif() + set(bootstrap "") + if(CMAKE_RUN_LONG_TESTS AND NOT CMAKE_SKIP_BOOTSTRAP_TEST) + if(UNIX) + set(bootstrap ${CMake_SOURCE_DIR}/bootstrap) + elseif(MSYS) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/bootstrap.bat.in ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat @ONLY) - SET(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat) - ENDIF() - ENDIF() - IF(bootstrap) - ADD_TEST(BootstrapTest ${CMAKE_CTEST_COMMAND} + set(bootstrap ${CMAKE_CURRENT_BINARY_DIR}/bootstrap.bat) + endif() + endif() + if(bootstrap) + add_test(BootstrapTest ${CMAKE_CTEST_COMMAND} --build-and-test ${CMake_SOURCE_DIR} ${CMake_BINARY_DIR}/Tests/BootstrapTest @@ -2171,20 +2140,20 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator "${CMAKE_TEST_GENERATOR}" --test-command ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest") # Make this test run early during parallel execution - SET_TESTS_PROPERTIES(BootstrapTest PROPERTIES COST 5000) + set_tests_properties(BootstrapTest PROPERTIES COST 5000) # provide more time for the bootstrap test - GET_TEST_PROPERTY(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT) - IF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - SET_TESTS_PROPERTIES ( BootstrapTest + get_test_property(BootstrapTest TIMEOUT PREVIOUS_TIMEOUT) + if ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) + set_tests_properties ( BootstrapTest PROPERTIES TIMEOUT 5400) - ENDIF ("${PREVIOUS_TIMEOUT}" MATCHES NOTFOUND) - ENDIF() + endif () + endif() - IF(CMAKE_Fortran_COMPILER) - ADD_TEST(Fortran ${CMAKE_CTEST_COMMAND} + if(CMAKE_Fortran_COMPILER) + add_test(Fortran ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Fortran" "${CMake_BINARY_DIR}/Tests/Fortran" @@ -2193,17 +2162,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command testf) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Fortran") # FortranCInterface tests. - IF(UNIX) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in + if(UNIX) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/FortranC/Flags.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake @ONLY) - ADD_TEST(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P + add_test(FortranC.Flags ${CMAKE_CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/FortranC/Flags.cmake) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags") - ELSE() - ADD_TEST(FortranC ${CMAKE_CTEST_COMMAND} + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC/Flags") + else() + add_test(FortranC ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/FortranC" "${CMake_BINARY_DIR}/Tests/FortranC" @@ -2212,21 +2181,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --build-two-config --test-command CMakeFiles/FortranCInterface/FortranCInterface) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC") - ENDIF() - ENDIF() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/FortranC") + endif() + endif() find_package(Java COMPONENTS Development QUIET) - IF(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW + if(Java_JAVA_EXECUTABLE AND Java_JAVAC_EXECUTABLE AND Java_JAR_EXECUTABLE AND NOT MINGW AND NOT "${CMAKE_TEST_GENERATOR}" MATCHES "Xcode") - GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH) - FIND_FILE(JNI_H jni.h + get_filename_component(JNIPATH ${JAVA_COMPILE} PATH) + find_file(JNI_H jni.h "${JNIPATH}/../include" "${JNIPATH}/../java/include") - IF(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink - FILE(READ "${JNI_H}" JNI_FILE) - IF("${JNI_FILE}" MATCHES "JDK1_2") - ADD_TEST(Java ${CMAKE_CTEST_COMMAND} + if(JNI_H AND EXISTS "${JNI_H}") # in case jni.h is a broken symlink + file(READ "${JNI_H}" JNI_FILE) + if("${JNI_FILE}" MATCHES "JDK1_2") + add_test(Java ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Java" "${CMake_BINARY_DIR}/Tests/Java" @@ -2236,19 +2205,19 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-two-config --build-run-dir "${CMake_BINARY_DIR}/Tests/Java/" --test-command ${JAVA_RUNTIME} -classpath hello.jar HelloWorld) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java") - ENDIF("${JNI_FILE}" MATCHES "JDK1_2") - ENDIF() - ENDIF() + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Java") + endif() + endif() + endif() # add some cross compiler tests, for now only with makefile based generators - IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + if(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") # if sdcc is found, build the SimpleCOnly project with sdcc - FIND_PROGRAM(SDCC_EXECUTABLE sdcc) - MARK_AS_ADVANCED(SDCC_EXECUTABLE) - IF(SDCC_EXECUTABLE) - ADD_TEST(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND} + find_program(SDCC_EXECUTABLE sdcc) + mark_as_advanced(SDCC_EXECUTABLE) + if(SDCC_EXECUTABLE) + add_test(SimpleCOnly_sdcc ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/SimpleCOnly" "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc" @@ -2258,16 +2227,16 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-options "-DCMAKE_SYSTEM_NAME=Generic" "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}") - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") - ENDIF(SDCC_EXECUTABLE) + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc") + endif() # If a Linux -> MinGW cross compiler is found then try it - FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) - FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++) - FIND_PROGRAM(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres) - MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE) - IF(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE) - ADD_TEST(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND} + find_program(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc) + find_program(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++) + find_program(MINGW_RC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-windres) + mark_as_advanced(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE MINGW_RC_LINUX2WIN_EXECUTABLE) + if(MINGW_CC_LINUX2WIN_EXECUTABLE AND MINGW_CXX_LINUX2WIN_EXECUTABLE AND MINGW_RC_LINUX2WIN_EXECUTABLE) + add_test(Simple_Mingw_Linux2Win ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/Simple" "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win" @@ -2280,63 +2249,63 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}" "-DCMAKE_RC_COMPILER=${MINGW_RC_LINUX2WIN_EXECUTABLE}" ) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") - ENDIF() - ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win") + endif() + endif() - IF(UNIX) - STRING(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix" + if(UNIX) + string(COMPARE EQUAL "${CMAKE_INSTALL_PREFIX}" "${CMake_BINARY_DIR}/Tests/TestShellInstall/Prefix" PREFIX_IS_FOR_TEST) - IF(PREFIX_IS_FOR_TEST) - CONFIGURE_FILE( + if(PREFIX_IS_FOR_TEST) + configure_file( ${CMake_SOURCE_DIR}/Tests/TestInstall.sh.in ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestInstall.sh @ONLY IMMEDIATE ) - ADD_TEST(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh) - ENDIF(PREFIX_IS_FOR_TEST) - ENDIF(UNIX) - - IF(CMAKE_TEST_PROJECT_CSE_DIR) - SET(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake") - IF(NOT EXISTS "${script}") - SET(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake") - ENDIF(NOT EXISTS "${script}") - IF(NOT EXISTS "${script}") - MESSAGE("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...") - ENDIF(NOT EXISTS "${script}") - - ADD_TEST(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}") - SET_TESTS_PROPERTIES(BuildCSE PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_PROJECT_CSE_DIR) - - IF(CMAKE_TEST_PLPLOT_DIR) - ADD_TEST(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake ) - SET_TESTS_PROPERTIES ( plplot PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_PLPLOT_DIR) - - IF(CMAKE_TEST_CHICKEN_DIR) - ADD_TEST(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake ) - SET_TESTS_PROPERTIES ( Chicken PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_CHICKEN_DIR) - - IF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) - ADD_TEST(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake ) - SET_TESTS_PROPERTIES ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400) - ENDIF(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) + add_test(ShellInstall /bin/sh ${CMake_BINARY_DIR}/Tests/TestShellInstall/TestShellInstall.sh) + endif() + endif() + + if(CMAKE_TEST_PROJECT_CSE_DIR) + set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/BuildProjectCSE.cmake") + if(NOT EXISTS "${script}") + set(script "${CMAKE_TEST_PROJECT_CSE_DIR}/cse_build.cmake") + endif() + if(NOT EXISTS "${script}") + message("warning: CMAKE_TEST_PROJECT_CSE_DIR set, but no build script found...") + endif() + + add_test(BuildCSE ${CMAKE_CTEST_COMMAND} -V -S "${script}") + set_tests_properties(BuildCSE PROPERTIES TIMEOUT 5400) + endif() + + if(CMAKE_TEST_PLPLOT_DIR) + add_test(plplot ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_PLPLOT_DIR}/../../EasyDashboardScripts/plplot.cmake ) + set_tests_properties ( plplot PROPERTIES TIMEOUT 5400) + endif() + + if(CMAKE_TEST_CHICKEN_DIR) + add_test(Chicken ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_CHICKEN_DIR}/../../EasyDashboardScripts/Chicken.cmake ) + set_tests_properties ( Chicken PROPERTIES TIMEOUT 5400) + endif() + + if(CMAKE_TEST_KDELIBS_ALPHA_1_DIR) + add_test(KDELibsAlpha1 ${CMAKE_CTEST_COMMAND} -V -S ${CMAKE_TEST_KDELIBS_ALPHA_1_DIR}/../../EasyDashboardScripts/kdelibs.cmake ) + set_tests_properties ( KDELibsAlpha1 PROPERTIES TIMEOUT 5400) + endif() # If this is not an in-source build, provide a target to wipe out # all the test build directories. - IF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") - CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in + if(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + configure_file(${CMake_SOURCE_DIR}/Tests/test_clean.cmake.in ${CMake_BINARY_DIR}/Tests/test_clean.cmake @ONLY) - ADD_CUSTOM_TARGET(test_clean + add_custom_target(test_clean COMMAND ${CMAKE_COMMAND} -P ${CMake_BINARY_DIR}/Tests/test_clean.cmake COMMENT "Removing test build directories." ) - ENDIF(NOT EXISTS "${CMake_BINARY_DIR}/CMakeLists.txt") + endif() - ADD_TEST(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} + add_test(CMakeWizardTest ${CMAKE_CMAKE_COMMAND} -D build_dir:STRING=${CMAKE_CURRENT_BINARY_DIR}/CMakeWizardTest -D source_dir:STRING=${CMAKE_CURRENT_SOURCE_DIR}/Tutorial/Step3 -D CMAKE_CTEST_COMMAND:STRING=${CMAKE_CTEST_COMMAND} @@ -2349,33 +2318,33 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ # with at least one CMakeLists.txt file that uses ExternalProject # to download and configure the project. The directory should also # contain a RunTest.cmake file that has a single set of the format: - # SET(project_RUN_TEST testToRun) + # set(project_RUN_TEST testToRun) # The testToRun should be a test executable that can be run to # smoke test the build. - FOREACH(project ${CMAKE_CONTRACT_PROJECTS}) - INCLUDE(Contracts/${project}/RunTest.cmake) + foreach(project ${CMAKE_CONTRACT_PROJECTS}) + include(Contracts/${project}/RunTest.cmake) ADD_TEST_MACRO(Contracts.${project} ${${project}_RUN_TEST}) # Contract test timeout in seconds. # Default to 6 hours. - IF(DEFINED ${project}_TEST_TIMEOUT) - SET(timeout ${${project}_TEST_TIMEOUT}) - ELSEIF(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT) - SET(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT}) - ELSE() - SET(timeout 21600) - ENDIF() - SET_TESTS_PROPERTIES(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) - ENDFOREACH() - - IF(TEST_CompileCommandOutput) - SET(CompileCommandOutput_EXTRA_OPTIONS + if(DEFINED ${project}_TEST_TIMEOUT) + set(timeout ${${project}_TEST_TIMEOUT}) + elseif(CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT) + set(timeout ${CMAKE_CONTRACT_TEST_TIMEOUT_DEFAULT}) + else() + set(timeout 21600) + endif() + set_tests_properties(Contracts.${project} PROPERTIES TIMEOUT ${timeout}) + endforeach() + + if(TEST_CompileCommandOutput) + set(CompileCommandOutput_EXTRA_OPTIONS --build-options -DMAKE_SUPPORTS_SPACES=${MAKE_IS_GNU}) ADD_TEST_MACRO(CompileCommandOutput "${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands") - ENDIF() + endif() - ADD_TEST(IncludeDirectories ${CMAKE_CTEST_COMMAND} + add_test(IncludeDirectories ${CMAKE_CTEST_COMMAND} --build-and-test "${CMake_SOURCE_DIR}/Tests/IncludeDirectories" "${CMake_BINARY_DIR}/Tests/IncludeDirectories" @@ -2384,21 +2353,21 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-project IncludeDirectories --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} --test-command IncludeDirectories) - LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories") + list(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories") - IF(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE) + if(CMAKE_USE_KWSTYLE AND KWSTYLE_EXECUTABLE) # The "make StyleCheck" command line as a test. If the test fails, look # for lines like "Error #0 (624) Line length exceed 88 (max=79)" in the # output to find where the style errors are... - ADD_TEST(KWStyle ${KWSTYLE_EXECUTABLE} + add_test(KWStyle ${KWSTYLE_EXECUTABLE} -xml ${CMake_BINARY_DIR}/CMake.kws.xml -o ${CMake_SOURCE_DIR}/Utilities/KWStyle/CMakeOverwrite.txt -v -D ${CMake_BINARY_DIR}/CMakeKWSFiles.txt ) - SET_TESTS_PROPERTIES(KWStyle PROPERTIES + set_tests_properties(KWStyle PROPERTIES WORKING_DIRECTORY ${CMake_BINARY_DIR}/Utilities/KWStyle) - ENDIF() -ENDIF(BUILD_TESTING) + endif() +endif() -SUBDIRS(CMakeTests) +subdirs(CMakeTests) diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 551cee3bc..212c75899 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -13,7 +13,7 @@ file(GLOB FIND_MODULES "${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/Find*.cmake macro(do_find MODULE_NAME) message(STATUS " Checking Find${MODULE_NAME}") find_package(${MODULE_NAME}) -endmacro(do_find) +endmacro() # It is only possible to use either Qt3 or Qt4 in one project. # Since FindQt will complain if both are found we explicitly request Qt4 here @@ -35,15 +35,15 @@ foreach(FIND_MODULE ${FIND_MODULES}) do_find(${MODULE_NAME}) endif () -endforeach(FIND_MODULE) +endforeach() # Qt4 is not present, so we can check Qt3 if (NOT QT4_FOUND) set(DESIRED_QT_VERSION 3) foreach(FIND_MODULE ${NO_QT4_MODULES} "Qt") do_find(${FIND_MODULE}) - endforeach(FIND_MODULE) -endif (NOT QT4_FOUND) + endforeach() +endif () macro(check_version_string MODULE_NAME VERSION_VAR) if (${MODULE_NAME}_FOUND) @@ -65,20 +65,20 @@ macro(check_version_string MODULE_NAME VERSION_VAR) message(SEND_ERROR "${MODULE_NAME}_FOUND is set but version number variable ${VERSION_VAR} is NOT DEFINED") endif() endif () -endmacro(check_version_string) +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(VTEST) +endforeach() foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH RUBY SWIG) check_version_string(${VTEST} ${VTEST}_VERSION) -endforeach(VTEST) +endforeach() check_version_string(PYTHONINTERP PYTHON_VERSION_STRING) check_version_string(SUBVERSION Subversion_VERSION_SVN) diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index a1551ca03..51a630fe5 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -19,10 +19,20 @@ add_CMakeOnly_test(CheckCXXCompilerFlag) add_CMakeOnly_test(CheckLanguage) +add_CMakeOnly_test(CompilerIdC) +add_CMakeOnly_test(CompilerIdCXX) +if(CMAKE_Fortran_COMPILER) + add_CMakeOnly_test(CompilerIdFortran) +endif() + add_CMakeOnly_test(AllFindModules) +add_CMakeOnly_test(SelectLibraryConfigurations) + add_CMakeOnly_test(TargetScope) +add_CMakeOnly_test(find_library) + add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND} -DTEST=ProjectInclude -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectInclude/include.cmake diff --git a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt index 1c978c181..9528aa357 100644 --- a/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt @@ -7,56 +7,56 @@ # If you change this test do not forget to change the CheckSymbolExists # test, too. -PROJECT(CheckCXXSymbolExists CXX) +project(CheckCXXSymbolExists CXX) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists") +set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists") -INCLUDE(CheckCXXSymbolExists) +include(CheckCXXSymbolExists) foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSE_RESULT_${_config_type} CACHE) - MESSAGE(STATUS "Testing configuration ${_config_type}") + message(STATUS "Testing configuration ${_config_type}") check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type}) - IF (CSE_RESULT_${_config_type}) - MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - ENDIF (CSE_RESULT_${_config_type}) + if (CSE_RESULT_${_config_type}) + message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") + endif () endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) unset(CSE_RESULT_ERRNO_CERRNO CACHE) -MESSAGE(STATUS "Checking <cerrno>") +message(STATUS "Checking <cerrno>") check_cxx_symbol_exists(errno "cerrno" CSE_RESULT_ERRNO_CERRNO) -IF (NOT CSE_RESULT_ERRNO_CERRNO) +if (NOT CSE_RESULT_ERRNO_CERRNO) unset(CSE_RESULT_ERRNO_ERRNOH CACHE) - MESSAGE(STATUS "Checking <errno.h>") + message(STATUS "Checking <errno.h>") check_cxx_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO_ERRNOH) - IF (NOT CSE_RESULT_ERRNO_ERRNOH) - MESSAGE(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>") - ELSE (NOT CSE_RESULT_ERRNO_ERRNOH) - MESSAGE(STATUS "errno found in <errno.h>") - ENDIF (NOT CSE_RESULT_ERRNO_ERRNOH) -ELSE (NOT CSE_RESULT_ERRNO_CERRNO) - MESSAGE(STATUS "errno found in <cerrno>") -ENDIF (NOT CSE_RESULT_ERRNO_CERRNO) + if (NOT CSE_RESULT_ERRNO_ERRNOH) + message(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>") + else () + message(STATUS "errno found in <errno.h>") + endif () +else () + message(STATUS "errno found in <cerrno>") +endif () -IF (CMAKE_COMPILER_IS_GNUCXX) +if (CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3") unset(CSE_RESULT_O3 CACHE) - MESSAGE(STATUS "Testing with optimization -O3") + message(STATUS "Testing with optimization -O3") check_cxx_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3) - IF (CSE_RESULT_O3) - MESSAGE(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") - ENDIF (CSE_RESULT_O3) -ENDIF (CMAKE_COMPILER_IS_GNUCXX) + if (CSE_RESULT_O3) + message(SEND_ERROR "CheckCXXSymbolExists reported a nonexistent symbol as existing with optimization -O3") + endif () +endif () diff --git a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt index 7c969d3be..765657712 100644 --- a/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt +++ b/Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt @@ -7,24 +7,24 @@ # If you change this test do not forget to change the CheckCXXSymbolExists # test, too. -PROJECT(CheckSymbolExists C) +project(CheckSymbolExists C) -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8 FATAL_ERROR) -SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}") +set(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}") -INCLUDE(CheckSymbolExists) +include(CheckSymbolExists) foreach(_config_type Release RelWithDebInfo MinSizeRel Debug) set(CMAKE_TRY_COMPILE_CONFIGURATION ${_config_type}) unset(CSE_RESULT_${_config_type} CACHE) - MESSAGE(STATUS "Testing configuration ${_config_type}") + message(STATUS "Testing configuration ${_config_type}") check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_${_config_type}) - IF (CSE_RESULT_${_config_type}) - MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") - ENDIF (CSE_RESULT_${_config_type}) + if (CSE_RESULT_${_config_type}) + message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing in configuration ${_config_type}") + endif () endforeach() set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE}) @@ -32,20 +32,20 @@ unset(CSE_RESULT_ERRNO CACHE) check_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO) -IF (NOT CSE_RESULT_ERRNO) - MESSAGE(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>") -ELSE (NOT CSE_RESULT_ERRNO) - MESSAGE(STATUS "errno found as expected") -ENDIF (NOT CSE_RESULT_ERRNO) +if (NOT CSE_RESULT_ERRNO) + message(SEND_ERROR "CheckSymbolExists did not find errno in <errno.h>") +else () + message(STATUS "errno found as expected") +endif () -IF (CMAKE_COMPILER_IS_GNUCC) +if (CMAKE_COMPILER_IS_GNUCC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3") unset(CSE_RESULT_O3 CACHE) - MESSAGE(STATUS "Testing with optimization -O3") + message(STATUS "Testing with optimization -O3") check_symbol_exists(non_existent_function_for_symbol_test "cm_cse.h" CSE_RESULT_O3) - IF (CSE_RESULT_O3) - MESSAGE(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3") - ENDIF (CSE_RESULT_O3) -ENDIF (CMAKE_COMPILER_IS_GNUCC) + if (CSE_RESULT_O3) + message(SEND_ERROR "CheckSymbolExists reported a nonexistent symbol as existing with optimization -O3") + endif () +endif () diff --git a/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt new file mode 100644 index 000000000..848ffdd36 --- /dev/null +++ b/Tests/CMakeOnly/CompilerIdC/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CompilerIdC C) + +foreach(v + CMAKE_C_COMPILER + CMAKE_C_COMPILER_ID + CMAKE_C_COMPILER_VERSION + ) + if(${v}) + message(STATUS "${v}=[${${v}}]") + else() + message(SEND_ERROR "${v} not set!") + endif() +endforeach() diff --git a/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt new file mode 100644 index 000000000..94ac31e4c --- /dev/null +++ b/Tests/CMakeOnly/CompilerIdCXX/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CompilerIdCXX CXX) + +foreach(v + CMAKE_CXX_COMPILER + CMAKE_CXX_COMPILER_ID + CMAKE_CXX_COMPILER_VERSION + ) + if(${v}) + message(STATUS "${v}=[${${v}}]") + else() + message(SEND_ERROR "${v} not set!") + endif() +endforeach() diff --git a/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt new file mode 100644 index 000000000..3a2bdebd6 --- /dev/null +++ b/Tests/CMakeOnly/CompilerIdFortran/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CompilerIdFortran Fortran) + +foreach(v + CMAKE_Fortran_COMPILER + CMAKE_Fortran_COMPILER_ID + ) + if(${v}) + message(STATUS "${v}=[${${v}}]") + else() + message(SEND_ERROR "${v} not set!") + endif() +endforeach() +foreach(v + CMAKE_Fortran_COMPILER_VERSION + ) + if(${v}) + message(STATUS "${v}=[${${v}}]") + else() + message(WARNING "${v} not set!") + endif() +endforeach() diff --git a/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt new file mode 100644 index 000000000..5bf0f8abc --- /dev/null +++ b/Tests/CMakeOnly/SelectLibraryConfigurations/CMakeLists.txt @@ -0,0 +1,64 @@ +cmake_minimum_required(VERSION 2.8) + +project(SelectLibraryConfigurations NONE) + +include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) + +macro(check_slc basename expect) + message(STATUS "checking select_library_configurations(${basename})") + select_library_configurations(${basename}) + if (NOT ${basename}_LIBRARY STREQUAL "${expect}") + message(SEND_ERROR "select_library_configurations(${basename}) returned '${${basename}_LIBRARY}' but '${expect}' was expected") + endif () + if (NOT ${basename}_LIBRARY STREQUAL "${${basename}_LIBRARIES}") + message(SEND_ERROR "select_library_configurations(${basename}) LIBRARY: '${${basename}_LIBRARY}' LIBRARIES: '${${basename}_LIBRARIES}'") + endif () +endmacro(check_slc) + +if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set(NOTYPE_RELONLY_LIBRARY_RELEASE "opt") + check_slc(NOTYPE_RELONLY "opt") + + set(NOTYPE_DBGONLY_LIBRARY_DEBUG "dbg") + check_slc(NOTYPE_DBGONLY "dbg") + + set(NOTYPE_RELDBG_LIBRARY_RELEASE "opt") + set(NOTYPE_RELDBG_LIBRARY_DEBUG "dbg") + check_slc(NOTYPE_RELDBG "opt") + + set(CMAKE_BUILD_TYPE Debug) +endif () + +check_slc(empty "") + +set(OPTONLY_LIBRARY_RELEASE "opt") +check_slc(OPTONLY "opt") + +set(DBGONLY_LIBRARY_RELEASE "dbg") +check_slc(DBGONLY "dbg") + +set(SAME_LIBRARY_RELEASE "same") +set(SAME_LIBRARY_DEBUG "same") +check_slc(SAME "same") + +set(OPTONLYLIST_LIBRARY_RELEASE "opt1;opt2") +check_slc(OPTONLYLIST "opt1;opt2") + +set(DBGONLYLIST_LIBRARY_RELEASE "dbg1;dbg2") +check_slc(DBGONLYLIST "dbg1;dbg2") + +set(OPT1DBG1_LIBRARY_RELEASE "opt") +set(OPT1DBG1_LIBRARY_DEBUG "dbg") +check_slc(OPT1DBG1 "optimized;opt;debug;dbg") + +set(OPT1DBG2_LIBRARY_RELEASE "opt") +set(OPT1DBG2_LIBRARY_DEBUG "dbg1;dbg2") +check_slc(OPT1DBG2 "optimized;opt;debug;dbg1;debug;dbg2") + +set(OPT2DBG1_LIBRARY_RELEASE "opt1;opt2") +set(OPT2DBG1_LIBRARY_DEBUG "dbg") +check_slc(OPT2DBG1 "optimized;opt1;optimized;opt2;debug;dbg") + +set(OPT2DBG2_LIBRARY_RELEASE "opt1;opt2") +set(OPT2DBG2_LIBRARY_DEBUG "dbg1;dbg2") +check_slc(OPT2DBG2 "optimized;opt1;optimized;opt2;debug;dbg1;debug;dbg2") diff --git a/Tests/CMakeOnly/find_library/CMakeLists.txt b/Tests/CMakeOnly/find_library/CMakeLists.txt new file mode 100644 index 000000000..08f9331e1 --- /dev/null +++ b/Tests/CMakeOnly/find_library/CMakeLists.txt @@ -0,0 +1,61 @@ +cmake_minimum_required(VERSION 2.8) +project(FindLibraryTest NONE) + +set(CMAKE_FIND_DEBUG_MODE 1) + +macro(test_find_library expected) + get_filename_component(dir ${expected} PATH) + get_filename_component(name ${expected} NAME) + string(REGEX REPLACE "lib/?64" "lib" dir "${dir}") + unset(LIB CACHE) + find_library(LIB + NAMES ${name} + PATHS ${CMAKE_CURRENT_SOURCE_DIR}/${dir} + NO_DEFAULT_PATH + ) + if(LIB) + # Convert to relative path for comparison to expected location. + file(RELATIVE_PATH REL_LIB "${CMAKE_CURRENT_SOURCE_DIR}" "${LIB}") + + # Debugging output. + if(CMAKE_FIND_DEBUG_MODE) + message(STATUS "Library ${expected} searched as ${dir}, found as [${REL_LIB}].") + endif() + + # Check and report failure. + if(NOT "${REL_LIB}" STREQUAL "${expected}") + message(SEND_ERROR "Library ${l} should have been [${expected}] but was [${REL_LIB}]") + endif() + else() + message(SEND_ERROR "Library ${expected} searched as ${dir}, NOT FOUND!") + endif() +endmacro() + +set(CMAKE_FIND_LIBRARY_PREFIXES "lib") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") +set_property(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) + +set(CMAKE_SIZEOF_VOID_P 4) +foreach(lib + lib/A/lib/libtest1.a + lib/A/libtest1.a + lib/libtest1.a + lib/libtest2.a + lib/libtest3.a + lib/libtest3.a + ) + test_find_library(${lib}) +endforeach() + +set(CMAKE_SIZEOF_VOID_P 8) +foreach(lib64 + lib/64/libtest2.a + lib/A/lib64/libtest3.a + lib/libtest3.a + lib64/A/lib/libtest2.a + lib64/A/lib64/libtest1.a + lib64/A/libtest1.a + lib64/libtest1.a + ) + test_find_library(${lib64}) +endforeach() diff --git a/Tests/CMakeOnly/find_library/lib/64/libtest2.a b/Tests/CMakeOnly/find_library/lib/64/libtest2.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/64/libtest2.a diff --git a/Tests/CMakeOnly/find_library/lib/A/lib/libtest1.a b/Tests/CMakeOnly/find_library/lib/A/lib/libtest1.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/A/lib/libtest1.a diff --git a/Tests/CMakeOnly/find_library/lib/A/lib64/libtest3.a b/Tests/CMakeOnly/find_library/lib/A/lib64/libtest3.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/A/lib64/libtest3.a diff --git a/Tests/CMakeOnly/find_library/lib/A/libtest1.a b/Tests/CMakeOnly/find_library/lib/A/libtest1.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/A/libtest1.a diff --git a/Tests/CMakeOnly/find_library/lib/libtest1.a b/Tests/CMakeOnly/find_library/lib/libtest1.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/libtest1.a diff --git a/Tests/CMakeOnly/find_library/lib/libtest2.a b/Tests/CMakeOnly/find_library/lib/libtest2.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/libtest2.a diff --git a/Tests/CMakeOnly/find_library/lib/libtest3.a b/Tests/CMakeOnly/find_library/lib/libtest3.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib/libtest3.a diff --git a/Tests/CMakeOnly/find_library/lib64/A/lib/libtest2.a b/Tests/CMakeOnly/find_library/lib64/A/lib/libtest2.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib64/A/lib/libtest2.a diff --git a/Tests/CMakeOnly/find_library/lib64/A/lib64/libtest1.a b/Tests/CMakeOnly/find_library/lib64/A/lib64/libtest1.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib64/A/lib64/libtest1.a diff --git a/Tests/CMakeOnly/find_library/lib64/A/libtest1.a b/Tests/CMakeOnly/find_library/lib64/A/libtest1.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib64/A/libtest1.a diff --git a/Tests/CMakeOnly/find_library/lib64/libtest1.a b/Tests/CMakeOnly/find_library/lib64/libtest1.a new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/Tests/CMakeOnly/find_library/lib64/libtest1.a diff --git a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake index 19391d7f1..96326646b 100644 --- a/Tests/CMakeTestMultipleConfigures/RunCMake.cmake +++ b/Tests/CMakeTestMultipleConfigures/RunCMake.cmake @@ -143,7 +143,7 @@ function(analyze_directory_diffs d1 d2 diff_count_var) endif() set(${diff_count_var} ${diffs} PARENT_SCOPE) -endfunction(analyze_directory_diffs) +endfunction() # Analyze diffs between b1:b2, b2:b3, b3:b4, b4:b5 ... bN-1:bN. diff --git a/Tests/CMakeTests/CMakeLists.txt b/Tests/CMakeTests/CMakeLists.txt index c42c490b0..d34d4a618 100644 --- a/Tests/CMakeTests/CMakeLists.txt +++ b/Tests/CMakeTests/CMakeLists.txt @@ -1,12 +1,12 @@ -SET(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") +set(CMAKE_EXECUTABLE "${CMake_BIN_DIR}/cmake") -MACRO(AddCMakeTest TestName PreArgs) - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in" +macro(AddCMakeTest TestName PreArgs) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${TestName}Test.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" @ONLY IMMEDIATE) - ADD_TEST(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} + add_test(CMake.${TestName} ${CMAKE_EXECUTABLE} ${PreArgs} -P "${CMAKE_CURRENT_BINARY_DIR}/${TestName}Test.cmake" ${ARGN}) -ENDMACRO(AddCMakeTest) +endmacro() AddCMakeTest(List "") @@ -43,12 +43,12 @@ if(HAVE_ELF_H) AddCMakeTest(ELF "") endif() -SET(EndStuff_PreArgs +set(EndStuff_PreArgs "-Ddir:STRING=${CMAKE_CURRENT_BINARY_DIR}/EndStuffTest" ) AddCMakeTest(EndStuff "${EndStuff_PreArgs}") -SET(GetPrerequisites_PreArgs +set(GetPrerequisites_PreArgs "-DCTEST_CONFIGURATION_TYPE:STRING=\\\${CTEST_CONFIGURATION_TYPE}" ) AddCMakeTest(GetPrerequisites "${GetPrerequisites_PreArgs}") diff --git a/Tests/CMakeTests/FileDownloadTest.cmake.in b/Tests/CMakeTests/FileDownloadTest.cmake.in index 9dc2ebb27..91086c6d7 100644 --- a/Tests/CMakeTests/FileDownloadTest.cmake.in +++ b/Tests/CMakeTests/FileDownloadTest.cmake.in @@ -38,6 +38,59 @@ file(DOWNLOAD ${dir}/file3.png TIMEOUT 2 STATUS status + EXPECTED_HASH SHA1=50c614fc28b39c1281d0517bb6d5858b4359c9b7 + ) + +message(STATUS "FileDownload:5") +file(DOWNLOAD + ${url} + ${dir}/file3.png + TIMEOUT 2 + STATUS status + EXPECTED_HASH SHA224=73cd5f442b04e8320e4f907f8e1b21d4befff98b5bd77bc32526ea68 + ) + +message(STATUS "FileDownload:6") +file(DOWNLOAD + ${url} + ${dir}/file3.png + TIMEOUT 2 + STATUS status + EXPECTED_HASH SHA256=2e067f6c09cbc7cd619c8fbcc44eb64cd6b45a95e4cddb3a585eee1f731c4da9 + ) + +message(STATUS "FileDownload:7") +file(DOWNLOAD + ${url} + ${dir}/file3.png + TIMEOUT 2 + STATUS status + EXPECTED_HASH SHA384=398bf41902a7251c30e522b307e3e41e3fb617c765b3feaa99b2f7d063894708ad399267ccc25d877437a10e5e890d35 + ) + +message(STATUS "FileDownload:8") +file(DOWNLOAD + ${url} + ${dir}/file3.png + TIMEOUT 2 + STATUS status + EXPECTED_HASH SHA512=c51854d21052713968b849c2b4263cf54be03bc3a7e9847a6c71c6c8d1d13cd805fe1b9fa95f9ba1d0a5631513974f6fae21e34ab5b171d94bad48df5f073e48 + ) +message(STATUS "FileDownload:9") +file(DOWNLOAD + ${url} + ${dir}/file3.png + TIMEOUT 2 + STATUS status + EXPECTED_HASH MD5=d16778650db435bda3a8c3435c3ff5d1 + ) + +message(STATUS "FileDownload:10") +file(DOWNLOAD + ${url} + ${dir}/file3.png + TIMEOUT 2 + STATUS status EXPECTED_MD5 d16778650db435bda3a8c3435c3ff5d1 ) message(STATUS "${status}") diff --git a/Tests/CMakeTests/FindBaseTest.cmake.in b/Tests/CMakeTests/FindBaseTest.cmake.in index 47c1692db..658b35022 100644 --- a/Tests/CMakeTests/FindBaseTest.cmake.in +++ b/Tests/CMakeTests/FindBaseTest.cmake.in @@ -12,7 +12,7 @@ set(_HEADER_FULL_A "${MY_SOURCE_DIR}/A/include/${_HEADER}") find_file(FOO_H_1 ${_HEADER}) if(FOO_H_1) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_1}, it should not exist !") -endif(FOO_H_1) +endif() # The HINTS option should override the system but the PATHS option # should not. @@ -21,10 +21,10 @@ find_file(TEST_H_1 ${_HEADER} HINTS ${MY_SOURCE_DIR}/A/include) find_file(TEST_H_2 ${_HEADER} PATHS ${MY_SOURCE_DIR}/A/include) if(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL_A}\"\ngot \"${TEST_H_1}\" instead!") -endif(NOT "${TEST_H_1}" STREQUAL "${_HEADER_FULL_A}") +endif() if(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot \"${TEST_H_2}\" instead!") -endif(NOT "${TEST_H_2}" STREQUAL "${_HEADER_FULL}") +endif() set(CMAKE_SYSTEM_PREFIX_PATH) # with this it still should not be found, since the include/ subdir is still missing @@ -32,20 +32,20 @@ set(CMAKE_INCLUDE_PATH "${MY_SOURCE_DIR}") find_file(FOO_H_2 ${_HEADER}) if(FOO_H_2) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_2}, it should not exist !") -endif(FOO_H_2) +endif() # now with the PATH_SUFFIX it should be found find_file(FOO_H_3 NAMES ${_HEADER} PATH_SUFFIXES include ) if(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_3} instead !") -endif(NOT "${FOO_H_3}" STREQUAL "${_HEADER_FULL}") +endif() # without PATH_SUFFIX, but with a CMAKE_INCLUDE_PATH it should not be found set(CMAKE_INCLUDE_PATH /include) find_file(FOO_H_4 ${_HEADER}) if(FOO_H_4) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_4}, it should not exist !") -endif(FOO_H_4) +endif() # when setting CMAKE_FIND_ROOT_PATH to the current source dir, # together with the CMAKE_INCLUDE_PATH it should be found @@ -53,10 +53,10 @@ set(CMAKE_FIND_ROOT_PATH blub "${MY_SOURCE_DIR}") find_file(FOO_H_5 ${_HEADER}) if(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") message(FATAL_ERROR "Did not find \"${_HEADER_FULL}\"\ngot ${FOO_H_5} instead !") -endif(NOT "${FOO_H_5}" STREQUAL "${_HEADER_FULL}") +endif() # by explicitly disabling CMAKE_FIND_ROOT_PATH again it shouldn't be found find_file(FOO_H_6 ${_HEADER} NO_CMAKE_FIND_ROOT_PATH) if(FOO_H_6) message(FATAL_ERROR "${_HEADER} found: ${FOO_H_6}, it should not exist !") -endif(FOO_H_6) +endif() diff --git a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in index 7adc240f0..22f6afd3b 100644 --- a/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in +++ b/Tests/CMakeTests/GetFilenameComponentRealpathTest.cmake.in @@ -66,7 +66,7 @@ if(UNIX) if(EXISTS file1 OR EXISTS file2) message(FATAL_ERROR "removal of file1 or file2 failed") endif() - endif(LN) + endif() file(REMOVE ${bindir}/file3) endif() diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in index daf467bcc..89ca735d3 100644 --- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in +++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in @@ -58,7 +58,7 @@ function(stresstest_list_prerequisites file) message(STATUS "=============================================================================") message(STATUS "") -endfunction(stresstest_list_prerequisites) +endfunction() function(test_cmake_executables) @@ -68,7 +68,7 @@ function(test_cmake_executables) get_filename_component(cmake_bin_dir "${CMAKE_COMMAND}" PATH) list_prerequisites_by_glob(GLOB "${cmake_bin_dir}/*" 0 0 1) -endfunction(test_cmake_executables) +endfunction() message(STATUS "=============================================================================") @@ -93,7 +93,7 @@ if(do_testdefaults) message(STATUS "") list_prerequisites("${CMAKE_COMMAND}") message(STATUS "") -endif(do_testdefaults) +endif() set(do_stresstest 0) @@ -103,7 +103,7 @@ if(do_stresstest) message(STATUS "") stresstest_list_prerequisites("${CMAKE_COMMAND}") message(STATUS "") -endif(do_stresstest) +endif() test_cmake_executables() @@ -141,7 +141,7 @@ message(STATUS "") get_cmake_property(vs VARIABLES) foreach(v ${vs}) message(STATUS "${v}='${${v}}'") -endforeach(v) +endforeach() message(STATUS "") message(STATUS "=============================================================================") diff --git a/Tests/CMakeTests/IncludeTest.cmake.in b/Tests/CMakeTests/IncludeTest.cmake.in index eca679b4a..985333c4b 100644 --- a/Tests/CMakeTests/IncludeTest.cmake.in +++ b/Tests/CMakeTests/IncludeTest.cmake.in @@ -9,18 +9,18 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # this one must return NOTFOUND in _includedFile include(I_do_not_exist OPTIONAL RESULT_VARIABLE _includedFile) if(_includedFile) message(FATAL_ERROR "File \"I_do_not_exist\" was included, although it shouldn't exist,\nIncluded file is \"${_includedFile}\"") -endif(_includedFile) +endif() # and this one must succeed too include(CMake OPTIONAL RESULT_VARIABLE _includedFile) @@ -29,11 +29,11 @@ set(fileTwo "${CMAKE_ROOT}/Modules/CMake.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong CMake.cmake was included: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # Check that CMAKE_CURRENT_LIST_DIR is working: # Needs to be a file in the build tree, which is correct cmake script diff --git a/Tests/CMakeTests/ListTest.cmake.in b/Tests/CMakeTests/ListTest.cmake.in index cf6f91a70..a16750354 100644 --- a/Tests/CMakeTests/ListTest.cmake.in +++ b/Tests/CMakeTests/ListTest.cmake.in @@ -1,88 +1,99 @@ -MACRO(TEST command expected) - IF("x${result}" STREQUAL "x${expected}") - #MESSAGE("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") - ELSE("x${result}" STREQUAL "x${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF("x${result}" STREQUAL "x${expected}") -ENDMACRO(TEST command expected) +macro(TEST command expected) + if("x${result}" STREQUAL "x${expected}") + #message("TEST \"${command}\" success: \"${result}\" expected: \"${expected}\"") + else() + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif() +endmacro() -SET(mylist andy bill ken brad) +set(mylist andy bill ken brad) -LIST(LENGTH mylist result) +list(LENGTH mylist result) TEST("LENGTH mylist result" "4") -LIST(LENGTH "mylist" result) +list(LENGTH "mylist" result) TEST("LENGTH \"mylist\" result" "4") -LIST(LENGTH "nonexiting_list1" result) +list(LENGTH "nonexiting_list1" result) TEST("LENGTH \"nonexiting_list1\" result" "0") -LIST(GET mylist 3 2 1 0 result) +list(GET mylist 3 2 1 0 result) TEST("GET mylist 3 2 1 0 result" "brad;ken;bill;andy") -LIST(GET mylist 0 item0) -LIST(GET mylist 1 item1) -LIST(GET mylist 2 item2) -LIST(GET mylist 3 item3) -SET(result "${item3}" "${item0}" "${item1}" "${item2}") +list(GET mylist 0 item0) +list(GET mylist 1 item1) +list(GET mylist 2 item2) +list(GET mylist 3 item3) +set(result "${item3}" "${item0}" "${item1}" "${item2}") TEST("GET individual 3 2 1 0 result" "brad;andy;bill;ken") -LIST(GET mylist -1 -2 -3 -4 result) +list(GET mylist -1 -2 -3 -4 result) TEST("GET mylist -1 -2 -3 -4 result" "brad;ken;bill;andy") -LIST(GET mylist -1 2 -3 0 result) +list(GET mylist -1 2 -3 0 result) TEST("GET mylist -1 2 -3 0 ${result}" "brad;ken;bill;andy") -LIST(GET "nonexiting_list2" 1 result) +list(GET "nonexiting_list2" 1 result) TEST("GET \"nonexiting_list2\" 1 result" "NOTFOUND") -SET(result andy) -LIST(APPEND result brad) +set(result andy) +list(APPEND result brad) TEST("APPEND result brad" "andy;brad") -LIST(APPEND "nonexiting_list3" brad) -SET(result "${nonexiting_list3}") +list(APPEND "nonexiting_list3" brad) +set(result "${nonexiting_list3}") TEST("APPEND \"nonexiting_list3\" brad" "brad") -LIST(INSERT "nonexiting_list4" 0 andy bill brad ken) -SET(result "${nonexiting_list4}") +list(INSERT "nonexiting_list4" 0 andy bill brad ken) +set(result "${nonexiting_list4}") TEST("APPEND \"nonexiting_list4\" andy bill brad ken" "andy;bill;brad;ken") -SET(result andy brad) -LIST(INSERT result -1 bill ken) +set(result andy brad) +list(INSERT result -1 bill ken) TEST("INSERT result -1 bill ken" "andy;bill;ken;brad") -SET(result andy bill brad ken bob) -LIST(REMOVE_ITEM result bob) +set(result andy bill brad ken bob) +list(REMOVE_ITEM result bob) TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken") -SET(result andy bill bob brad ken peter) -LIST(REMOVE_ITEM result peter bob) +set(result andy bill bob brad ken peter) +list(REMOVE_ITEM result peter bob) TEST("REMOVE_ITEM result peter bob" "andy;bill;brad;ken") -SET(result bob andy bill bob brad ken bob) -LIST(REMOVE_ITEM result bob) +set(result bob andy bill bob brad ken bob) +list(REMOVE_ITEM result bob) TEST("REMOVE_ITEM result bob" "andy;bill;brad;ken") -SET(result andy bill bob brad ken peter) -LIST(REMOVE_AT result 2 -1) +set(result andy bill bob brad ken peter) +list(REMOVE_AT result 2 -1) TEST("REMOVE_AT result 2 -1" "andy;bill;brad;ken") # ken is at index 2, nobody is not in the list so -1 should be returned -SET(mylist andy bill ken brad) -LIST(FIND mylist ken result) +set(mylist andy bill ken brad) +list(FIND mylist ken result) TEST("FIND mylist ken result" "2") -LIST(FIND mylist nobody result) +list(FIND mylist nobody result) TEST("FIND mylist nobody result" "-1") -SET(result ken bill andy brad) -LIST(SORT result) +set(result ken bill andy brad) +list(SORT result) TEST("SORT result" "andy;bill;brad;ken") -SET(result andy bill brad ken) -LIST(REVERSE result) +set(result andy bill brad ken) +list(REVERSE result) TEST("REVERSE result" "ken;brad;bill;andy") -SET(result bill andy bill brad ken ken ken) -LIST(REMOVE_DUPLICATES result) +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/CMakeTests/StringTestScript.cmake b/Tests/CMakeTests/StringTestScript.cmake index 7a264a0e2..a562e71d3 100644 --- a/Tests/CMakeTests/StringTestScript.cmake +++ b/Tests/CMakeTests/StringTestScript.cmake @@ -236,42 +236,42 @@ elseif(testname STREQUAL string_find_with_no_possible_result) # pass message(STATUS "v='${v}'") if(NOT(-1 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return -1 but returned ${v}.") - endif(NOT(-1 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_with_no_possible_result) # pass string(FIND "CMake is a great application." "z" v REVERSE) message(STATUS "v='${v}'") if(NOT(-1 EQUAL ${v})) message(SEND_ERROR "FIND REVERSE sub-command should return -1 but returned ${v}.") - endif(NOT(-1 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_with_required_result) # pass string(FIND "CMake is a great application." "g" v) message(STATUS "v='${v}'") if(NOT(11 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 11 but returned ${v}.") - endif(NOT(11 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_with_required_result) # pass string(FIND "CMake is a great application." "e" v REVERSE) message(STATUS "v='${v}'") if(NOT(13 EQUAL ${v})) message(SEND_ERROR "FIND REVERSE sub-command should return 13 but returned ${v}.") - endif(NOT(13 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_word_reverse_with_required_result) # pass string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v) message(STATUS "v='${v}'") if(NOT(24 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 24 but returned ${v}.") - endif(NOT(24 EQUAL ${v})) + endif() elseif(testname STREQUAL string_find_reverse_word_reverse_with_required_result) # pass string(FIND "The command should find REVERSE in this string. Or maybe this REVERSE?!" "REVERSE" v REVERSE) message(STATUS "v='${v}'") if(NOT(62 EQUAL ${v})) message(SEND_ERROR "FIND sub-command should return 62 but returned ${v}.") - endif(NOT(62 EQUAL ${v})) + endif() else() # fail message(FATAL_ERROR "testname='${testname}' - error: no such test in '${CMAKE_CURRENT_LIST_FILE}'") diff --git a/Tests/CMakeTests/ToolchainTest.cmake.in b/Tests/CMakeTests/ToolchainTest.cmake.in index e4a2e4813..96e7196a5 100644 --- a/Tests/CMakeTests/ToolchainTest.cmake.in +++ b/Tests/CMakeTests/ToolchainTest.cmake.in @@ -1,12 +1,12 @@ ############################################################ # some preparations so that the CMakeDetermineXXX.cmake files will work in scripted mode -# overwrite MARK_AS_ADVANCED(), since this is used in CMakeDetermineCCompiler.cmake +# overwrite mark_as_advanced(), since this is used in CMakeDetermineCCompiler.cmake # which will complain that it can"t be used in script mode macro(MARK_AS_ADVANCED) -endmacro(MARK_AS_ADVANCED) +endmacro() # set this to a place where we are allowed to write -set(CMAKE_PLATFORM_ROOT_BIN "${CMAKE_CURRENT_BINARY_DIR}") +set(CMAKE_PLATFORM_INFO_DIR "${CMAKE_CURRENT_BINARY_DIR}") # don't run the compiler detection set(CMAKE_C_COMPILER_ID_RUN 1) @@ -21,19 +21,19 @@ include(CMakeDetermineSystem) # check that CMAKE_SYSTEM_XXX and CMAKE_HOST_SYSTEM_xxx are identical if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}") message(FATAL_ERROR "CMAKE_SYSTEM_NAME and CMAKE_HOST_SYSTEM_NAME not identical: \"${CMAKE_SYSTEM_NAME}\" vs. \"${CMAKE_HOST_SYSTEM_NAME}\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_HOST_SYSTEM_NAME}") +endif() if(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}") message(FATAL_ERROR "CMAKE_SYSTEM and CMAKE_HOST_SYSTEM not identical: \"${CMAKE_SYSTEM}\" vs. \"${CMAKE_HOST_SYSTEM}\"") -endif(NOT "${CMAKE_SYSTEM}" STREQUAL "${CMAKE_HOST_SYSTEM}") +endif() if(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}") message(FATAL_ERROR "CMAKE_SYSTEM_VERSION and CMAKE_HOST_SYSTEM_VERSION not identical: \"${CMAKE_SYSTEM_VERSION}\" vs. \"${CMAKE_HOST_SYSTEM_VERSION}\"") -endif(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "${CMAKE_HOST_SYSTEM_VERSION}") +endif() if(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") message(FATAL_ERROR "CMAKE_SYSTEM_PROCESSOR and CMAKE_HOST_SYSTEM_PROCESSOR not identical: \"${CMAKE_SYSTEM_PROCESSOR}\" vs. \"${CMAKE_HOST_SYSTEM_PROCESSOR}\"") -endif(NOT "${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "${CMAKE_HOST_SYSTEM_PROCESSOR}") +endif() # save the values so we can compare them to CMAKE_HOST_SYSTEM_XXX in the toolchain case @@ -55,7 +55,7 @@ set(CMAKE_HOST_SYSTEM_PROCESSOR) ############################################################ -# now define a toolchain file and check that everything is +# now define a toolchain file and check that everything is # detected correctly and nothing predefined is overwritten set(CMAKE_TOOLCHAIN_FILE "${MY_SOURCE_DIR}/DummyToolchain.cmake") @@ -73,35 +73,35 @@ include(CMakeDetermineCXXCompiler) if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum") message(FATAL_ERROR "CMAKE_SYSTEM_NAME overwritten: \"${CMAKE_SYSTEM_NAME}\", was: \"Dumdidum\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Dumdidum") +endif() if(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0") message(FATAL_ERROR "CMAKE_SYSTEM wrong: \"${CMAKE_SYSTEM}\", expected: \"Dumdidum-1.0\"") -endif(NOT "${CMAKE_SYSTEM}" STREQUAL "Dumdidum-1.0") +endif() set(fileOne "${_INCLUDED_TOOLCHAIN_FILE}") set(fileTwo "${MY_SOURCE_DIR}/DummyToolchain.cmake") if(WIN32) string(TOLOWER "${fileOne}" fileOne) string(TOLOWER "${fileTwo}" fileTwo) -endif(WIN32) +endif() if(NOT "${fileOne}" STREQUAL "${fileTwo}") message(FATAL_ERROR "Wrong toolchain was loaded: \"${fileOne}\" expected \"${fileTwo}\"") -endif(NOT "${fileOne}" STREQUAL "${fileTwo}") +endif() # check that CMAKE_HOST_SYSTEM_XXX and _SYSTEM_xxx detected above are identical if(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_NAME and NATIVE_SYSTEM_NAME not identical: \"${CMAKE_HOST_SYSTEM_NAME}\" vs. \"${NATIVE_SYSTEM_NAME}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_NAME}" STREQUAL "${NATIVE_SYSTEM_NAME}") +endif() if(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM and NATIVE_SYSTEM not identical: \"${CMAKE_HOST_SYSTEM}\" vs. \"${NATIVE_SYSTEM}\"") -endif(NOT "${CMAKE_HOST_SYSTEM}" STREQUAL "${NATIVE_SYSTEM}") +endif() if(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_VERSION and NATIVE_SYSTEM_VERSION not identical: \"${CMAKE_HOST_SYSTEM_VERSION}\" vs. \"${NATIVE_SYSTEM_VERSION}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_VERSION}" STREQUAL "${NATIVE_SYSTEM_VERSION}") +endif() if(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}") message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR and NATIVE_SYSTEM_PROCESSOR not identical: \"${CMAKE_HOST_SYSTEM_PROCESSOR}\" vs. \"${NATIVE_SYSTEM_PROCESSOR}\"") -endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}") +endif() ############################################################# @@ -109,15 +109,15 @@ endif(NOT "${CMAKE_HOST_SYSTEM_PROCESSOR}" STREQUAL "${NATIVE_SYSTEM_PROCESSOR}" if(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-") message(FATAL_ERROR "wrong toolchain prefix detected: \"${_CMAKE_TOOLCHAIN_PREFIX}\", expected: \"arm-elf-\"") -endif(NOT "${_CMAKE_TOOLCHAIN_PREFIX}" STREQUAL "arm-elf-") +endif() if(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin") message(FATAL_ERROR "wrong C compiler location detected: \"${_CMAKE_USER_C_COMPILER_PATH}\", expected: \"/opt/foo/bin\"") -endif(NOT "${_CMAKE_USER_C_COMPILER_PATH}" STREQUAL "/opt/foo/bin") +endif() if(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_C_OUTPUT_EXTENSION}\", was: \".foo\"") -endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") +endif() ############################################################# @@ -125,11 +125,11 @@ endif(NOT "${CMAKE_C_OUTPUT_EXTENSION}" STREQUAL ".foo") if(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin") message(FATAL_ERROR "wrong CXX compiler location detected: \"${_CMAKE_USER_CXX_COMPILER_PATH}\", expected: \"/opt/bar/bin\"") -endif(NOT "${_CMAKE_USER_CXX_COMPILER_PATH}" STREQUAL "/opt/bar/bin") +endif() if(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar") message(FATAL_ERROR "C output extension overwritten: \"${CMAKE_CXX_OUTPUT_EXTENSION}\", was: \".bar\"") -endif(NOT "${CMAKE_CXX_OUTPUT_EXTENSION}" STREQUAL ".bar") +endif() message(STATUS "CMAKE_SYSTEM: \"${CMAKE_SYSTEM}\"") message(STATUS "_CMAKE_TOOLCHAIN_PREFIX: \"${_CMAKE_TOOLCHAIN_PREFIX}\"") diff --git a/Tests/CMakeTests/VariableWatchTest.cmake.in b/Tests/CMakeTests/VariableWatchTest.cmake.in index bdb4f7ec4..0c084fde8 100644 --- a/Tests/CMakeTests/VariableWatchTest.cmake.in +++ b/Tests/CMakeTests/VariableWatchTest.cmake.in @@ -1,15 +1,15 @@ -MESSAGE("Start") +message("Start") -VARIABLE_WATCH(TESTVAR MESSAGE) -VARIABLE_WATCH(TESTVAR1) +variable_watch(TESTVAR MESSAGE) +variable_watch(TESTVAR1) macro(testwatch var access file stack) - MESSAGE("There was a ${access} access done on the variable: ${var} in file ${file}") - MESSAGE("List file stack is: ${stack}") + message("There was a ${access} access done on the variable: ${var} in file ${file}") + message("List file stack is: ${stack}") set(${var}_watched 1) -endmacro(testwatch) +endmacro() -VARIABLE_WATCH(somevar testwatch) +variable_watch(somevar testwatch) set(TESTVAR1 "1") set(TESTVAR "1") diff --git a/Tests/CMakeTests/VersionTest.cmake.in b/Tests/CMakeTests/VersionTest.cmake.in index 215bb2b96..9e31cb431 100644 --- a/Tests/CMakeTests/VersionTest.cmake.in +++ b/Tests/CMakeTests/VersionTest.cmake.in @@ -7,3 +7,10 @@ if("${CMAKE_VERSION}" VERSION_LESS "${min_ver}") else() message("CMAKE_VERSION=[${CMAKE_VERSION}] is not less than [${min_ver}]") endif() + +set(v 1.2.3.4.5.6.7) +if("${v}.8" VERSION_LESS "${v}.9") + message(STATUS "${v}.8 is less than ${v}.9") +else() + message(FATAL_ERROR "${v}.8 is not less than ${v}.9?") +endif() diff --git a/Tests/CMakeTests/WhileTest.cmake.in b/Tests/CMakeTests/WhileTest.cmake.in index 4693f2d8f..4cec291a0 100644 --- a/Tests/CMakeTests/WhileTest.cmake.in +++ b/Tests/CMakeTests/WhileTest.cmake.in @@ -10,7 +10,7 @@ while(COUNT LESS 200) set(NUMBERS "${NUMBERS} ${NCOUNT}") set(NCOUNT "${NCOUNT}0") endwhile() -endwhile(COUNT LESS 200) +endwhile() if(NOT NUMBERS STREQUAL " 0 3 30 20 3 30") message(SEND_ERROR "while loop nesting error, result: '${NUMBERS}'") diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt index 5ef0f1eea..b3cc43813 100644 --- a/Tests/COnly/CMakeLists.txt +++ b/Tests/COnly/CMakeLists.txt @@ -10,14 +10,14 @@ target_link_libraries(COnly testc1 testc2) if(MSVC_VERSION) set_target_properties(COnly PROPERTIES LINK_FLAGS " /NODEFAULTLIB:\"libcdg.lib\" /NODEFAULTLIB:\"libcmtg.lib\" /NODEFAULTLIB:\"foomsvcrt.lib\" /NODEFAULTLIB:\"libbar.lib\" /NODEFAULTLIB:\"libfooba.lib\"") -endif(MSVC_VERSION) +endif() string(ASCII 35 32 67 77 97 107 101 ASCII_STRING) message(STATUS "String: ${ASCII_STRING}") get_source_file_property(LANG conly.c LANGUAGE) if("${LANG}" STREQUAL "C") message("Language is C") -else("${LANG}" STREQUAL "C") +else() message(FATAL_ERROR "Bad language for file conly.c") -endif("${LANG}" STREQUAL "C") +endif() add_library(testCModule MODULE testCModule.c) diff --git a/Tests/COnly/libc2.h b/Tests/COnly/libc2.h index a99d8984e..2713d71ae 100644 --- a/Tests/COnly/libc2.h +++ b/Tests/COnly/libc2.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float LibC2Func(); diff --git a/Tests/CPackComponents/CMakeLists.txt b/Tests/CPackComponents/CMakeLists.txt index 58f5bdffe..1cb86696a 100644 --- a/Tests/CPackComponents/CMakeLists.txt +++ b/Tests/CPackComponents/CMakeLists.txt @@ -36,7 +36,7 @@ endif() # Create installation targets. Note that we put each kind of file # into a different component via COMPONENT. These components will # be used to create the installation components. -install(TARGETS mylib +install(TARGETS mylib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/Tests/CPackComponents/VerifyResult.cmake b/Tests/CPackComponents/VerifyResult.cmake index 850ec0022..c7c24fde1 100644 --- a/Tests/CPackComponents/VerifyResult.cmake +++ b/Tests/CPackComponents/VerifyResult.cmake @@ -4,7 +4,7 @@ message(STATUS "") if(NOT CPackComponents_BINARY_DIR) message(FATAL_ERROR "CPackComponents_BINARY_DIR not set") -endif(NOT CPackComponents_BINARY_DIR) +endif() set(expected_file_mask "") @@ -18,15 +18,15 @@ if(WIN32) ) if(NSIS_MAKENSIS_EXECUTABLE) set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.exe") - endif(NSIS_MAKENSIS_EXECUTABLE) -endif(WIN32) + endif() +endif() if(APPLE) # Always expect the *.dmg installer - PackageMaker should always # be installed on a development Mac: # set(expected_file_mask "${CPackComponents_BINARY_DIR}/MyLib-*.dmg") -endif(APPLE) +endif() if(expected_file_mask) set(expected_count 1) @@ -38,11 +38,11 @@ if(expected_file_mask) if(NOT expected_file) message(FATAL_ERROR "error: expected_file does not exist: CPackComponents test fails.") - endif(NOT expected_file) + endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count does not match actual_count: CPackComponents test fails.") - endif(NOT actual_count EQUAL expected_count) -endif(expected_file_mask) + endif() +endif() diff --git a/Tests/CPackComponentsForAll/CMakeLists.txt b/Tests/CPackComponentsForAll/CMakeLists.txt index 5449d09dc..8162f0c2a 100644 --- a/Tests/CPackComponentsForAll/CMakeLists.txt +++ b/Tests/CPackComponentsForAll/CMakeLists.txt @@ -118,6 +118,6 @@ if (NOT ("${CPackComponentWay}" STREQUAL "default")) ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake @ONLY) set(CPACK_PROJECT_CONFIG_FILE ${CPackComponentsForAll_BINARY_DIR}/MyLibCPackConfig-${CPackComponentWay}.cmake) -endif (NOT ("${CPackComponentWay}" STREQUAL "default")) +endif () # Include CPack to introduce the appropriate targets include(CPack)
\ No newline at end of file diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in index 1d203c8d8..0bfbf1467 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-AllInOne.cmake.in @@ -3,15 +3,15 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in index 9444a1473..450c2047e 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-IgnoreGroup.cmake.in @@ -3,16 +3,16 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_applications_PACKAGE_REQUIRES "mylib-libraries") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in index 2d251b363..60bdd06be 100644 --- a/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in +++ b/Tests/CPackComponentsForAll/MyLibCPackConfig-OnePackPerGroup.cmake.in @@ -3,20 +3,20 @@ # if(CPACK_GENERATOR MATCHES "ZIP") set(CPACK_ARCHIVE_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "ZIP") +endif() if(CPACK_GENERATOR MATCHES "RPM") set(CPACK_RPM_COMPONENT_INSTALL "ON") set(CPACK_RPM_Development_PACKAGE_REQUIRES "mylib-Runtime") -endif(CPACK_GENERATOR MATCHES "RPM") +endif() if(CPACK_GENERATOR MATCHES "DEB") set(CPACK_DEB_COMPONENT_INSTALL "ON") -endif(CPACK_GENERATOR MATCHES "DEB") +endif() if(CPACK_GENERATOR MATCHES "DragNDrop") set(CPACK_COMPONENTS_GROUPING "ONE_PER_GROUP") -endif(CPACK_GENERATOR MATCHES "DragNDrop") +endif() # # Choose grouping way diff --git a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake index e2d343d9f..9a022c580 100644 --- a/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake +++ b/Tests/CPackComponentsForAll/RunCPackVerifyResult.cmake @@ -4,21 +4,21 @@ message(STATUS "") if(NOT CPackComponentsForAll_BINARY_DIR) message(FATAL_ERROR "CPackComponentsForAll_BINARY_DIR not set") -endif(NOT CPackComponentsForAll_BINARY_DIR) +endif() if(NOT CPackGen) message(FATAL_ERROR "CPackGen not set") -endif(NOT CPackGen) +endif() get_filename_component(CPACK_LOCATION ${CMAKE_COMMAND} PATH) set(CPackCommand "${CPACK_LOCATION}/cpack") message("cpack = ${CPackCommand}") if(NOT CPackCommand) message(FATAL_ERROR "CPackCommand not set") -endif(NOT CPackCommand) +endif() if(NOT CPackComponentWay) message(FATAL_ERROR "CPackComponentWay not set") -endif(NOT CPackComponentWay) +endif() set(expected_file_mask "") # The usual default behavior is to expect a single file @@ -30,7 +30,7 @@ set(config_type $ENV{CMAKE_CONFIG_TYPE}) set(config_args ) if(config_type) set(config_args -C ${config_type}) -endif(config_type) +endif() set(config_verbose ) if(CPackGen MATCHES "ZIP") @@ -80,15 +80,15 @@ if(CPackGen MATCHES "DragNDrop") elseif (${CPackComponentWay} STREQUAL "AllInOne") set(expected_count 1) endif () -endif(CPackGen MATCHES "DragNDrop") +endif() # clean-up previously CPack generated files if(expected_file_mask) file(GLOB expected_file "${expected_file_mask}") if (expected_file) file(REMOVE ${expected_file}) - endif(expected_file) -endif(expected_file_mask) + endif() +endif() message("config_args = ${config_args}") message("config_verbose = ${config_verbose}") @@ -100,9 +100,9 @@ execute_process(COMMAND ${CPackCommand} ${config_verbose} -G ${CPackGen} ${confi if (CPack_result) message(FATAL_ERROR "error: CPack execution went wrong!, CPack_output=${CPack_output}, CPack_error=${CPack_error}") -else (CPack_result) +else () message(STATUS "CPack_output=${CPack_output}") -endif(CPack_result) +endif() # Now verify if the number of expected file is OK # - using expected_file_mask and @@ -116,11 +116,11 @@ if(expected_file_mask) if(NOT expected_file) message(FATAL_ERROR "error: expected_file=${expected_file} does not exist: CPackComponentsForAll test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error}") - endif(NOT expected_file) + endif() list(LENGTH expected_file actual_count) message(STATUS "actual_count='${actual_count}'") if(NOT actual_count EQUAL expected_count) message(FATAL_ERROR "error: expected_count=${expected_count} does not match actual_count=${actual_count}: CPackComponents test fails. (CPack_output=${CPack_output}, CPack_error=${CPack_error})") - endif(NOT actual_count EQUAL expected_count) -endif(expected_file_mask) + endif() +endif() diff --git a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in index 0c4394faa..45f0e3710 100644 --- a/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in +++ b/Tests/CTestScriptMode/CTestTestScriptMode.cmake.in @@ -5,9 +5,9 @@ set(CMAKE_CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") if (NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}") message(FATAL_ERROR "Error: CMAKE_SYSTEM_NAME is \"${CMAKE_SYSTEM_NAME}\", but should be \"@CMAKE_SYSTEM_NAME@\"") -endif(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "${CMAKE_CMAKE_SYSTEM_NAME}") +endif() -# this seems to be necessary, otherwise ctest complains that these +# this seems to be necessary, otherwise ctest complains that these # variables are not set: set(CTEST_COMMAND "\"@CMAKE_CTEST_COMMAND@\"") set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestScriptMode/") diff --git a/Tests/CTestTest/test.cmake.in b/Tests/CTestTest/test.cmake.in index eac5eab20..d21dafa43 100644 --- a/Tests/CTestTest/test.cmake.in +++ b/Tests/CTestTest/test.cmake.in @@ -4,25 +4,25 @@ ################################################################### # this is the cvs module name that should be checked out -SET (CTEST_MODULE_NAME SmallAndFast) +set (CTEST_MODULE_NAME SmallAndFast) -# these are the the name of the source and binary directory on disk. +# these are the the name of the source and binary directory on disk. # They will be appended to DASHBOARD_ROOT -SET (CTEST_SOURCE_NAME SmallAndFast) -SET (CTEST_BINARY_NAME SmallAndFastBuild) +set (CTEST_SOURCE_NAME SmallAndFast) +set (CTEST_BINARY_NAME SmallAndFastBuild) # which ctest command to use for running the dashboard -SET (CTEST_COMMAND +set (CTEST_COMMAND "\"${CTEST_EXECUTABLE_NAME}\" --version" "\"${CTEST_EXECUTABLE_NAME}\" -D Experimental -A \"${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}\"" ) # what cmake command to use for configuring this dashboard -GET_FILENAME_COMPONENT(CTEST_EXECUTABLE_PATH "${CTEST_EXECUTABLE_NAME}" PATH) -SET(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"") +get_filename_component(CTEST_EXECUTABLE_PATH "${CTEST_EXECUTABLE_NAME}" PATH) +set(CTEST_CMAKE_COMMAND "\"${CTEST_EXECUTABLE_PATH}/cmake\"") -MESSAGE("CTest executable: ${CTEST_EXECUTABLE_NAME}") -MESSAGE("CMake executable: ${CTEST_CMAKE_COMMAND}") +message("CTest executable: ${CTEST_EXECUTABLE_NAME}") +message("CMake executable: ${CTEST_CMAKE_COMMAND}") CTEST_SLEEP(1) CTEST_SLEEP(1 1 1) @@ -33,11 +33,11 @@ CTEST_SLEEP(1 1 1) #################################################################### # should ctest wipe the binary tree before running -SET (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) +set (CTEST_START_WITH_EMPTY_BINARY_DIRECTORY TRUE) # this is the initial cache to use for the binary tree, be careful to escape # any quotes inside of this string if you use it -SET (CTEST_INITIAL_CACHE " +set (CTEST_INITIAL_CACHE " SITE:STRING=@SITE@ BUILDNAME:STRING=SmallAndFast-@BUILDNAME@ CMAKE_GENERATOR:INTERNAL=@CMAKE_GENERATOR@ @@ -54,15 +54,15 @@ MEMORYCHECK_COMMAND_OPTIONS:STRING=@MEMORYCHECK_COMMAND_OPTIONS@ COVERAGE_COMMAND:FILEPATH=@COVERAGE_COMMAND@ ") -# if you do not want to use the default location for a +# if you do not want to use the default location for a # dashboard then set this variable to the directory # the dashboard should be in -SET (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest") +set (CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@/Tests/CTestTest") # set any extra envionment varibles here -SET (CTEST_ENVIRONMENT +set (CTEST_ENVIRONMENT ) -SET (CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") -SET (CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest/${CTEST_BINARY_NAME}") +set (CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTest/SmallAndFast") +set (CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest/${CTEST_BINARY_NAME}") diff --git a/Tests/CTestTest2/test.cmake.in b/Tests/CTestTest2/test.cmake.in index b58b6397e..ec756ddc4 100644 --- a/Tests/CTestTest2/test.cmake.in +++ b/Tests/CTestTest2/test.cmake.in @@ -1,31 +1,31 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest2") - -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Source/kwsys") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") -SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") -SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "KWSys-@BUILDNAME@-CTest2") + +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Source/kwsys") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTest2/kwsysBin") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_MEMORYCHECK_COMMAND "@MEMORYCHECK_COMMAND@") +set(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@") +set(CTEST_MEMORYCHECK_COMMAND_OPTIONS "@MEMORYCHECK_COMMAND_OPTIONS@") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") # By default, CTESTTEST2_USE_PURIFY is not defined. If you want to run purify # on CTestTest2, set CTESTTEST2_USE_PURIFY to ON in CMake's cache. -SET(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@) -IF("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY) - SET(CTEST_MEMORYCHECK_COMMAND) -ENDIF() +set(CTESTTEST2_USE_PURIFY @CTESTTEST2_USE_PURIFY@) +if("${CTEST_MEMORYCHECK_COMMAND}" MATCHES purify AND NOT CTESTTEST2_USE_PURIFY) + set(CTEST_MEMORYCHECK_COMMAND) +endif() #CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " +file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " CMAKE_CXX_FLAGS:STRING=@CMAKE_CXX_FLAGS@ CMAKE_C_FLAGS:STRING=@CMAKE_C_FLAGS@ CMAKE_C_COMPILER:STRING=@CMAKE_C_COMPILER@ @@ -55,6 +55,6 @@ set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") CTEST_SUBMIT(RETURN_VALUE res) # Test submission of a subset of parts. -SET(CTEST_EXTRA_SUBMIT_FILES ${CTEST_NOTES_FILES}) +set(CTEST_EXTRA_SUBMIT_FILES ${CTEST_NOTES_FILES}) CTEST_SUBMIT(RETURN_VALUE res PARTS ExtraFiles) -SET(CTEST_EXTRA_SUBMIT_FILES) +set(CTEST_EXTRA_SUBMIT_FILES) diff --git a/Tests/CTestTestBadExe/CMakeLists.txt b/Tests/CTestTestBadExe/CMakeLists.txt index 8a925b62f..c71c21516 100644 --- a/Tests/CTestTestBadExe/CMakeLists.txt +++ b/Tests/CTestTestBadExe/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestBadExe) -INCLUDE(CTest) +project(CTestTestBadExe) +include(CTest) -CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY) +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/notAnExe.txt" "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt" COPYONLY) -ADD_TEST (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt") +add_test (TestBadExe "${CMAKE_CURRENT_BINARY_DIR}/notAnExe.txt") diff --git a/Tests/CTestTestBadExe/test.cmake.in b/Tests/CTestTestBadExe/test.cmake.in index 5d22d3587..2421b136d 100644 --- a/Tests/CTestTestBadExe/test.cmake.in +++ b/Tests/CTestTestBadExe/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-BadExe") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-BadExe") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadExe") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestBadExe") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestBadExe") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestChecksum/test.cmake.in b/Tests/CTestTestChecksum/test.cmake.in index 84135446f..6317500d6 100644 --- a/Tests/CTestTestChecksum/test.cmake.in +++ b/Tests/CTestTestChecksum/test.cmake.in @@ -1,25 +1,25 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Checksum") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") +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) CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res PARALLEL_LEVEL 4) -SET(CTEST_DROP_METHOD "@protocol@") -SET(CTEST_DROP_SITE "@server@") -SET(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") +set(CTEST_DROP_METHOD "@protocol@") +set(CTEST_DROP_SITE "@server@") +set(CTEST_DROP_LOCATION "@path@/submit.php?project=PublicDashboard") CTEST_SUBMIT(RETRY_DELAY 3 RETRY_COUNT 2 INTERNAL_TEST_CHECKSUM RETURN_VALUE res) diff --git a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in index 498cab280..feaa5c385 100644 --- a/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in +++ b/Tests/CTestTestConfigFileInBuildDir/test1.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +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_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}") +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 index d359f2d36..f489114cd 100644 --- a/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in +++ b/Tests/CTestTestConfigFileInBuildDir/test2.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +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_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}") +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) diff --git a/Tests/CTestTestCostSerial/CMakeLists.txt b/Tests/CTestTestCostSerial/CMakeLists.txt index a9a5c2594..d3344cfab 100644 --- a/Tests/CTestTestCostSerial/CMakeLists.txt +++ b/Tests/CTestTestCostSerial/CMakeLists.txt @@ -1,13 +1,13 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.6) -PROJECT (CTestTestCostSerial) -INCLUDE (CTest) +cmake_minimum_required (VERSION 2.6) +project (CTestTestCostSerial) +include (CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -FOREACH (index RANGE 1 3) - ADD_TEST (TestSleep${index} Sleep) -ENDFOREACH (index RANGE 1 3) +foreach (index RANGE 1 3) + add_test (TestSleep${index} Sleep) +endforeach () -SET_TESTS_PROPERTIES(TestSleep1 PROPERTIES COST -500) -SET_TESTS_PROPERTIES(TestSleep2 PROPERTIES COST 12) -SET_TESTS_PROPERTIES(TestSleep3 PROPERTIES COST 0) +set_tests_properties(TestSleep1 PROPERTIES COST -500) +set_tests_properties(TestSleep2 PROPERTIES COST 12) +set_tests_properties(TestSleep3 PROPERTIES COST 0) diff --git a/Tests/CTestTestCostSerial/test.cmake.in b/Tests/CTestTestCostSerial/test.cmake.in index ca216e3fc..8661767d6 100644 --- a/Tests/CTestTestCostSerial/test.cmake.in +++ b/Tests/CTestTestCostSerial/test.cmake.in @@ -1,24 +1,24 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-CostSerial") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-CostSerial") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCostSerial") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCostSerial") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) # Remove old cost data file if it exists -IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") - FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") + file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif() CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestCrash/CMakeLists.txt b/Tests/CTestTestCrash/CMakeLists.txt index 0ac6ba03c..77986df34 100644 --- a/Tests/CTestTestCrash/CMakeLists.txt +++ b/Tests/CTestTestCrash/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestCrash) -INCLUDE(CTest) +project(CTestTestCrash) +include(CTest) -ADD_EXECUTABLE (Crash crash.cxx) +add_executable (Crash crash.cxx) -ADD_TEST (TestCrash Crash) +add_test (TestCrash Crash) diff --git a/Tests/CTestTestCrash/test.cmake.in b/Tests/CTestTestCrash/test.cmake.in index 5cec594cd..4e27bc2bc 100644 --- a/Tests/CTestTestCrash/test.cmake.in +++ b/Tests/CTestTestCrash/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Crash") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Crash") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCrash") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCrash") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCrash") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestCycle/test.cmake.in b/Tests/CTestTestCycle/test.cmake.in index 201f6044e..22f33770e 100644 --- a/Tests/CTestTestCycle/test.cmake.in +++ b/Tests/CTestTestCycle/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Cycle") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestCycle") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestCycle") +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/CTestTestDepends/test.cmake.in b/Tests/CTestTestDepends/test.cmake.in index 36a1ebf87..49fc443dd 100644 --- a/Tests/CTestTestDepends/test.cmake.in +++ b/Tests/CTestTestDepends/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Depends") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestDepends") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestDepends") +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/CTestTestFailedSubmits/test.cmake.in b/Tests/CTestTestFailedSubmits/test.cmake.in index b0e16322d..394400630 100644 --- a/Tests/CTestTestFailedSubmits/test.cmake.in +++ b/Tests/CTestTestFailedSubmits/test.cmake.in @@ -1,4 +1,4 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +cmake_minimum_required(VERSION 2.8) # CTestConfig.cmake settings: set(CTEST_PROJECT_NAME "SmallAndFast") @@ -9,21 +9,21 @@ set(CTEST_PROJECT_NAME "SmallAndFast") set(CTEST_DROP_METHOD "@drop_method@") # Settings: -SET(CTEST_USE_LAUNCHERS 1) +set(CTEST_USE_LAUNCHERS 1) # Emit these compiler warnings: set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -Wall") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTestLaunchers-@drop_method@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTestLaunchers-@drop_method@") -SET(CTEST_SOURCE_DIRECTORY "@source@") -SET(CTEST_BINARY_DIRECTORY "@build@") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@source@") +set(CTEST_BINARY_DIRECTORY "@build@") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestFailure/CMakeLists.txt b/Tests/CTestTestFailure/CMakeLists.txt index 690fbfc5c..01fbb2c4f 100644 --- a/Tests/CTestTestFailure/CMakeLists.txt +++ b/Tests/CTestTestFailure/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestFailure) -INCLUDE(CTest) +project(CTestTestFailure) +include(CTest) -ADD_EXECUTABLE (NoBuild badCode.cxx) -TARGET_LINK_LIBRARIES (NoBuild ${EXTRA_LIBS}) +add_executable (NoBuild badCode.cxx) +target_link_libraries (NoBuild ${EXTRA_LIBS}) -ADD_TEST (TestNoExe NoBuild) +add_test (TestNoExe NoBuild) diff --git a/Tests/CTestTestFailure/testNoBuild.cmake.in b/Tests/CTestTestFailure/testNoBuild.cmake.in index 7bc921a31..6edd9dd95 100644 --- a/Tests/CTestTestFailure/testNoBuild.cmake.in +++ b/Tests/CTestTestFailure/testNoBuild.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoBuild") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoBuild") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestFailure/testNoExe.cmake.in b/Tests/CTestTestFailure/testNoExe.cmake.in index 59c18d752..f09594c2b 100644 --- a/Tests/CTestTestFailure/testNoExe.cmake.in +++ b/Tests/CTestTestFailure/testNoExe.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoExe") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-NoExe") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestFailure") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestFailure") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/CMakeLists.txt new file mode 100644 index 000000000..2730a6140 --- /dev/null +++ b/Tests/CTestTestMemcheck/CMakeLists.txt @@ -0,0 +1,81 @@ +foreach (_retval 0 1) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/ret${_retval}.c" "int main(){return ${_retval};}\n") +endforeach () + +# create binaries that we will use as a pseudo memory checker +add_executable(pseudo_valgrind "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +set_target_properties(pseudo_valgrind PROPERTIES OUTPUT_NAME valgrind) + +# Xcode 2.x forgets to create the output directory before linking +# the individual architectures. +if(CMAKE_OSX_ARCHITECTURES AND XCODE AND NOT "${XCODE_VERSION}" MATCHES "^[^12]") + add_custom_command(TARGET pseudo_valgrind + PRE_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CFG_INTDIR}" + ) +endif() + +add_executable(pseudo_purify "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +set_target_properties(pseudo_purify PROPERTIES OUTPUT_NAME purify) +add_executable(pseudo_BC "${CMAKE_CURRENT_BINARY_DIR}/ret0.c") +set_target_properties(pseudo_BC PROPERTIES OUTPUT_NAME BC) + +# binary to be used as pre- and post-memcheck command that fails +add_executable(memcheck_fail "${CMAKE_CURRENT_BINARY_DIR}/ret1.c") + +foreach (_test IN ITEMS Unknown UnknownQuoted NotExist + DummyValgrind DummyValgrindPrePost + DummyValgrindFailPre DummyValgrindFailPost + DummyPurify DummyBC + DummyValgrindIgnoreMemcheck) + configure_file( + "${CMAKE_CURRENT_SOURCE_DIR}/${_test}/test.cmake.in" + "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" + @ONLY ESCAPE_QUOTES) + add_test(NAME CTestTestMemcheck${_test} + COMMAND ${CMAKE_CTEST_COMMAND} + -S "${CMAKE_CURRENT_BINARY_DIR}/${_test}/test.cmake" -V + --output-log "${CMAKE_CURRENT_BINARY_DIR}/${_test}/testOutput.log" + -D PSEUDO_BC=$<TARGET_FILE:pseudo_BC> + -D PSEUDO_PURIFY=$<TARGET_FILE:pseudo_purify> + -D PSEUDO_VALGRIND=$<TARGET_FILE:pseudo_valgrind> + -D ERROR_COMMAND=$<TARGET_FILE:memcheck_fail> + ) +endforeach () + +string(REPLACE "\\" "\\\\" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND}") +string(REPLACE "(" "\\(" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") +string(REPLACE ")" "\\)" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") +string(REPLACE "+" "\\+" CMAKE_COMMAND_ESCAPED "${CMAKE_COMMAND_ESCAPED}") + +foreach (_unkn Unknown UnknownQuoted) + set_tests_properties(CTestTestMemcheck${_unkn} PROPERTIES + PASS_REGULAR_EXPRESSION "Do not understand memory checker: ${CMAKE_COMMAND_ESCAPED}\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/${_unkn}/test.cmake\n") +endforeach () + +set_tests_properties(CTestTestMemcheckNotExist PROPERTIES + PASS_REGULAR_EXPRESSION "Memory checker \\(MemoryCheckCommand\\) not set, or cannot find the specified program.") + +set(NORMAL_CTEST_OUTPUT "\n-- Processing memory checking output: \nMemory checking results:\n(BullseyeCoverage[^\n]*\n)?") + +# It is a valid result if valgrind does not output any files (can e.g. happen +# if you have not compiled in debug mode), so these tests will not fail. +set_tests_properties(CTestTestMemcheckDummyValgrind CTestTestMemcheckDummyValgrindPrePost + PROPERTIES + PASS_REGULAR_EXPRESSION "${NORMAL_CTEST_OUTPUT}") + +foreach (_pp Pre Post) + string(TOLOWER ${_pp} _pp_lower) + set_tests_properties(CTestTestMemcheckDummyValgrindFail${_pp} + PROPERTIES + PASS_REGULAR_EXPRESSION "\nProblem running command: ${CMAKE_CURRENT_BINARY_DIR}[^\n]*fail[^\n]*\n(.*\n)?Problem executing ${_pp_lower}-memcheck command\\(s\\\).\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyValgrindFail${_pp}/test.cmake\n") +endforeach () + +set_tests_properties(CTestTestMemcheckDummyValgrindIgnoreMemcheck + PROPERTIES + PASS_REGULAR_EXPRESSION "\n2/2 Test #2: RunCMakeAgain .*\n1/1 MemCheck #1: RunCMake .*${NORMAL_CTEST_OUTPUT}") + +set_tests_properties(CTestTestMemcheckDummyPurify PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyPurify/test.cmake\n") + +set_tests_properties(CTestTestMemcheckDummyBC PROPERTIES + PASS_REGULAR_EXPRESSION "\nCannot find memory tester output file: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/Testing/Temporary/MemoryChecker.log\n(.*\n)?Error parsing XML in stream at line 1: no element found\n(.*\n)?Error in read script: ${CMAKE_CURRENT_BINARY_DIR}/DummyBC/test.cmake\n") diff --git a/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt new file mode 100644 index 000000000..aa0e495da --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyBC/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyBC) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake new file mode 100644 index 000000000..39cdd88cc --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyBC/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyBC") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyBC/test.cmake.in b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in new file mode 100644 index 000000000..500549878 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyBC/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyBC") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyBC") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyBC") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_BC}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt new file mode 100644 index 000000000..dfd93fde4 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyPurify/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyPurify) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake new file mode 100644 index 000000000..40b960867 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyPurify/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyPurify") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in new file mode 100644 index 000000000..0df4f68b8 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyPurify/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyPurify") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyPurify") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyPurify") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_PURIFY}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt new file mode 100644 index 000000000..822966ade --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrind/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrind) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake new file mode 100644 index 000000000..4ca59a42e --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrind/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in new file mode 100644 index 000000000..e341fed1e --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrind/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrind") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrind") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrind") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt new file mode 100644 index 000000000..8185071af --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindFailPost) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake new file mode 100644 index 000000000..4ca59a42e --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in new file mode 100644 index 000000000..7c1aa66e6 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPost/test.cmake.in @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPost") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPost") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPost") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +set(CTEST_CUSTOM_POST_MEMCHECK "${ERROR_COMMAND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt new file mode 100644 index 000000000..3714cd6a3 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindFailPre) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake new file mode 100644 index 000000000..4ca59a42e --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrind") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in new file mode 100644 index 000000000..b2d7bb170 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindFailPre/test.cmake.in @@ -0,0 +1,26 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindFailPre") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindFailPre") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindFailPre") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +set(CTEST_CUSTOM_PRE_MEMCHECK "${ERROR_COMMAND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt new file mode 100644 index 000000000..5d437d1b7 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindIgnoreMemcheck) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") +add_test (RunCMakeAgain "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake new file mode 100644 index 000000000..6eee3e602 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/CTestConfig.cmake @@ -0,0 +1,9 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindIgnoreMemcheck") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) + +set(CTEST_CUSTOM_MEMCHECK_IGNORE RunCMakeAgain) diff --git a/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in new file mode 100644 index 000000000..031a232c2 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindIgnoreMemcheck/test.cmake.in @@ -0,0 +1,24 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindIgnoreMemcheck") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindIgnoreMemcheck") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindIgnoreMemcheck") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt new file mode 100644 index 000000000..bc1563212 --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckDummyValgrindPrePost) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake new file mode 100644 index 000000000..6e4c2e86c --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckDummyValgrindPrePost") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in new file mode 100644 index 000000000..44c416e6b --- /dev/null +++ b/Tests/CTestTestMemcheck/DummyValgrindPrePost/test.cmake.in @@ -0,0 +1,27 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckDummyValgrindPrePost") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/DummyValgrindPrePost") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/DummyValgrindPrePost") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") + +set(CTEST_MEMORYCHECK_COMMAND "${PSEUDO_VALGRIND}") + +set(CTEST_CUSTOM_PRE_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}") +set(CTEST_CUSTOM_POST_MEMCHECK "${CTEST_MEMORYCHECK_COMMAND}") + +#CTEST_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) + +CTEST_START(Experimental) +CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +#CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt new file mode 100644 index 000000000..4d905de9e --- /dev/null +++ b/Tests/CTestTestMemcheck/NotExist/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckNotExist) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake new file mode 100644 index 000000000..3ed84aab9 --- /dev/null +++ b/Tests/CTestTestMemcheck/NotExist/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/NotExist/test.cmake.in b/Tests/CTestTestMemcheck/NotExist/test.cmake.in new file mode 100644 index 000000000..78db7e23d --- /dev/null +++ b/Tests/CTestTestMemcheck/NotExist/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckNotExist") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/NotExist") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/NotExist") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "${CTEST_BINARY_DIRECTORY}/no-memcheck-exe") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt new file mode 100644 index 000000000..3fd3103ba --- /dev/null +++ b/Tests/CTestTestMemcheck/Unknown/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckUnknown) +include(CTest) + +add_test (RunCMake "${CMAKE_COMMAND}") diff --git a/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake new file mode 100644 index 000000000..3ed84aab9 --- /dev/null +++ b/Tests/CTestTestMemcheck/Unknown/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknown") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/Unknown/test.cmake.in b/Tests/CTestTestMemcheck/Unknown/test.cmake.in new file mode 100644 index 000000000..c0b783948 --- /dev/null +++ b/Tests/CTestTestMemcheck/Unknown/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknown") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/Unknown") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/Unknown") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt new file mode 100644 index 000000000..6f49c6144 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 2.8.9) +project(CTestTestMemcheckUnknownQuoted) +include(CTest) + +add_test (RunCMake "\"${CMAKE_COMMAND}\"") diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake new file mode 100644 index 000000000..f0233a7a4 --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/CTestConfig.cmake @@ -0,0 +1,7 @@ +set (CTEST_PROJECT_NAME "CTestTestMemcheckUnknownQuoted") +set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") +set (CTEST_DART_SERVER_VERSION "2") +set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_SITE "www.cdash.org") +set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard") +set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in new file mode 100644 index 000000000..e2bfb601a --- /dev/null +++ b/Tests/CTestTestMemcheck/UnknownQuoted/test.cmake.in @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8.9) + +# Settings: +set(CTEST_DASHBOARD_ROOT "@CMAKE_CURRENT_BINARY_DIR@") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-MemcheckUnknownQuoted") + +set(CTEST_SOURCE_DIRECTORY "@CMAKE_CURRENT_SOURCE_DIR@/UnknownQuoted") +set(CTEST_BINARY_DIRECTORY "@CMAKE_CURRENT_BINARY_DIR@/UnknownQuoted") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_MEMORYCHECK_COMMAND "@CMAKE_COMMAND@") + +CTEST_START(Experimental) +CTEST_MEMCHECK(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestParallel/CMakeLists.txt b/Tests/CTestTestParallel/CMakeLists.txt index fc53f6874..e47085a09 100644 --- a/Tests/CTestTestParallel/CMakeLists.txt +++ b/Tests/CTestTestParallel/CMakeLists.txt @@ -1,15 +1,15 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestParallel) -INCLUDE(CTest) +project(CTestTestParallel) +include(CTest) -ADD_EXECUTABLE (LockFile lockFile.c) +add_executable (LockFile lockFile.c) -ADD_TEST (TestRunSerial1 LockFile) -ADD_TEST (TestRunSerial2 LockFile) -SET_TESTS_PROPERTIES(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true) +add_test (TestRunSerial1 LockFile) +add_test (TestRunSerial2 LockFile) +set_tests_properties(TestRunSerial1 TestRunSerial2 PROPERTIES RUN_SERIAL true) -ADD_TEST (TestProcessorsGreaterThanMPL1 LockFile) -ADD_TEST (TestProcessorsGreaterThanMPL2 LockFile) -SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10) -SET_TESTS_PROPERTIES(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS +add_test (TestProcessorsGreaterThanMPL1 LockFile) +add_test (TestProcessorsGreaterThanMPL2 LockFile) +set_tests_properties(TestProcessorsGreaterThanMPL1 PROPERTIES PROCESSORS 10) +set_tests_properties(TestProcessorsGreaterThanMPL1 PROPERTIES DEPENDS TestProcessorsGreaterThanMPL2) diff --git a/Tests/CTestTestParallel/test.cmake.in b/Tests/CTestTestParallel/test.cmake.in index 83845dee4..0418755cf 100644 --- a/Tests/CTestTestParallel/test.cmake.in +++ b/Tests/CTestTestParallel/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Parallel") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Parallel") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestParallel") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestParallel") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestResourceLock/CMakeLists.txt b/Tests/CTestTestResourceLock/CMakeLists.txt index 1041ef149..4001643fd 100644 --- a/Tests/CTestTestResourceLock/CMakeLists.txt +++ b/Tests/CTestTestResourceLock/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestResourceLock) -INCLUDE(CTest) +project(CTestTestResourceLock) +include(CTest) -ADD_EXECUTABLE (LockFile lockFile.c) +add_executable (LockFile lockFile.c) -ADD_TEST (TestLockedFile1.1 LockFile locked1.txt) -ADD_TEST (TestLockedFile1.2 LockFile locked1.txt) -SET_TESTS_PROPERTIES(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt") +add_test (TestLockedFile1.1 LockFile locked1.txt) +add_test (TestLockedFile1.2 LockFile locked1.txt) +set_tests_properties(TestLockedFile1.1 TestLockedFile1.2 PROPERTIES RESOURCE_LOCK "locked1.txt") -ADD_TEST (TestLockedFile2.1 LockFile locked2.txt) -ADD_TEST (TestLockedFile2.2 LockFile locked2.txt) -SET_TESTS_PROPERTIES(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt") +add_test (TestLockedFile2.1 LockFile locked2.txt) +add_test (TestLockedFile2.2 LockFile locked2.txt) +set_tests_properties(TestLockedFile2.1 TestLockedFile2.2 PROPERTIES RESOURCE_LOCK "locked2.txt") diff --git a/Tests/CTestTestResourceLock/test.cmake.in b/Tests/CTestTestResourceLock/test.cmake.in index 98c5901c4..571cc5050 100644 --- a/Tests/CTestTestResourceLock/test.cmake.in +++ b/Tests/CTestTestResourceLock/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ResourceLock") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ResourceLock") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestResourceLock") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestResourceLock") +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/CTestTestRunScript/hello.cmake.in b/Tests/CTestTestRunScript/hello.cmake.in index 140df1e02..37905e3c4 100644 --- a/Tests/CTestTestRunScript/hello.cmake.in +++ b/Tests/CTestTestRunScript/hello.cmake.in @@ -1,2 +1,2 @@ -SET(CTEST_RUN_CURRENT_SCRIPT 0) -MESSAGE("hello world") +set(CTEST_RUN_CURRENT_SCRIPT 0) +message("hello world") diff --git a/Tests/CTestTestRunScript/test.cmake.in b/Tests/CTestTestRunScript/test.cmake.in index 8301a56d3..3074a5156 100644 --- a/Tests/CTestTestRunScript/test.cmake.in +++ b/Tests/CTestTestRunScript/test.cmake.in @@ -1,2 +1,2 @@ -SET(CTEST_RUN_CURRENT_SCRIPT 0) +set(CTEST_RUN_CURRENT_SCRIPT 0) CTEST_RUN_SCRIPT("CTestTestRunScript/hello.cmake" RETURN_VALUE res RETURN_VALUE) diff --git a/Tests/CTestTestScheduler/CMakeLists.txt b/Tests/CTestTestScheduler/CMakeLists.txt index 882988fd4..ccd7b2cbb 100644 --- a/Tests/CTestTestScheduler/CMakeLists.txt +++ b/Tests/CTestTestScheduler/CMakeLists.txt @@ -1,9 +1,9 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.6) -PROJECT (CTestTestScheduler) -INCLUDE (CTest) +cmake_minimum_required (VERSION 2.6) +project (CTestTestScheduler) +include (CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -FOREACH (time RANGE 1 4) - ADD_TEST (TestSleep${time} Sleep ${time}) -ENDFOREACH (time RANGE 1 4) +foreach (time RANGE 1 4) + add_test (TestSleep${time} Sleep ${time}) +endforeach () diff --git a/Tests/CTestTestScheduler/test.cmake.in b/Tests/CTestTestScheduler/test.cmake.in index 505bd7c5b..9115a6193 100644 --- a/Tests/CTestTestScheduler/test.cmake.in +++ b/Tests/CTestTestScheduler/test.cmake.in @@ -1,24 +1,24 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Scheduler") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Scheduler") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestScheduler") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestScheduler") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestScheduler") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) # Remove old cost data file if it exists -IF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") - FILE(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") -ENDIF(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +if(EXISTS "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") + file(REMOVE "${CTEST_BINARY_DIRECTORY}/Testing/Temporary/CTestCostData.txt") +endif() CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestStopTime/CMakeLists.txt b/Tests/CTestTestStopTime/CMakeLists.txt index 5fe30d352..bd8bebdda 100644 --- a/Tests/CTestTestStopTime/CMakeLists.txt +++ b/Tests/CTestTestStopTime/CMakeLists.txt @@ -1,11 +1,11 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestStopTime) -INCLUDE(CTest) +project(CTestTestStopTime) +include(CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -ADD_TEST (TestSleep Sleep 30) -ADD_TEST (ShouldNotRun Sleep 30) +add_test (TestSleep Sleep 30) +add_test (ShouldNotRun Sleep 30) -SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES DEPENDS TestSleep) -SET_TESTS_PROPERTIES(ShouldNotRun PROPERTIES WILL_FAIL ON) +set_tests_properties(ShouldNotRun PROPERTIES DEPENDS TestSleep) +set_tests_properties(ShouldNotRun PROPERTIES WILL_FAIL ON) diff --git a/Tests/CTestTestStopTime/GetDate.cmake b/Tests/CTestTestStopTime/GetDate.cmake index b79330691..60f1e0c74 100644 --- a/Tests/CTestTestStopTime/GetDate.cmake +++ b/Tests/CTestTestStopTime/GetDate.cmake @@ -1,6 +1,6 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.2) +cmake_minimum_required(VERSION 2.2) -MACRO(GET_DATE) +macro(GET_DATE) # # All macro arguments are optional. # If there's an ARGV0, use it as GD_PREFIX. Default = 'GD_' @@ -34,20 +34,20 @@ MACRO(GET_DATE) # If there's an ARGV0, use it as GD_PREFIX: # - SET(GD_PREFIX "GD_") - IF(NOT "${ARGV0}" STREQUAL "") - SET(GD_PREFIX "${ARGV0}") - ENDIF(NOT "${ARGV0}" STREQUAL "") - IF(NOT "${GD_PREFIX}" STREQUAL "GD_") - SET(${GD_PREFIX}PREFIX "${GD_PREFIX}") - ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_") + set(GD_PREFIX "GD_") + if(NOT "${ARGV0}" STREQUAL "") + set(GD_PREFIX "${ARGV0}") + endif() + if(NOT "${GD_PREFIX}" STREQUAL "GD_") + set(${GD_PREFIX}PREFIX "${GD_PREFIX}") + endif() # If there's an ARGV1, use it as ${GD_PREFIX}VERBOSE: # - SET(${GD_PREFIX}VERBOSE "0") - IF(NOT "${ARGV1}" STREQUAL "") - SET(${GD_PREFIX}VERBOSE "${ARGV1}") - ENDIF(NOT "${ARGV1}" STREQUAL "") + set(${GD_PREFIX}VERBOSE "0") + if(NOT "${ARGV1}" STREQUAL "") + set(${GD_PREFIX}VERBOSE "${ARGV1}") + endif() # Retrieve the current date and time in the format: # @@ -57,58 +57,58 @@ MACRO(GET_DATE) # Use "echo %DATE% %TIME%" on Windows. # Otherwise, try "date" as implemented on most Unix flavors. # - IF(WIN32) + if(WIN32) # # Use "cmd" shell with %DATE% and %TIME% support... # May need adjustment in different locales or for custom date/time formats # set in the Windows Control Panel. # - SET(${GD_PREFIX}CMD "cmd") - SET(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%") - ELSE(WIN32) + set(${GD_PREFIX}CMD "cmd") + set(${GD_PREFIX}ARGS "/c echo %DATE% %TIME%") + else() # # Match the format returned by default in US English Windows: # - SET(${GD_PREFIX}CMD "date") - SET(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"") - ENDIF(WIN32) + set(${GD_PREFIX}CMD "date") + set(${GD_PREFIX}ARGS "\"+%a %m/%d/%Y %H:%M:%S.00\"") + endif() - EXEC_PROGRAM("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}" + exec_program("${${GD_PREFIX}CMD}" "." ARGS "${${GD_PREFIX}ARGS}" OUTPUT_VARIABLE ${GD_PREFIX}OV RETURN_VALUE ${GD_PREFIX}RV ) - IF(${GD_PREFIX}VERBOSE) - MESSAGE(STATUS "") - MESSAGE(STATUS "<GET_DATE>") - MESSAGE(STATUS "") - MESSAGE(STATUS "GD_PREFIX='${GD_PREFIX}'") - IF(NOT "${GD_PREFIX}" STREQUAL "GD_") - MESSAGE(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'") - ENDIF(NOT "${GD_PREFIX}" STREQUAL "GD_") - MESSAGE(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'") - MESSAGE(STATUS "") - MESSAGE(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'") - MESSAGE(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'") - MESSAGE(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'") - MESSAGE(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'") - MESSAGE(STATUS "") - ENDIF(${GD_PREFIX}VERBOSE) - - IF("${${GD_PREFIX}RV}" STREQUAL "0") + if(${GD_PREFIX}VERBOSE) + message(STATUS "") + message(STATUS "<GET_DATE>") + message(STATUS "") + message(STATUS "GD_PREFIX='${GD_PREFIX}'") + if(NOT "${GD_PREFIX}" STREQUAL "GD_") + message(STATUS "${GD_PREFIX}PREFIX='${${GD_PREFIX}PREFIX}'") + endif() + message(STATUS "${GD_PREFIX}VERBOSE='${${GD_PREFIX}VERBOSE}'") + message(STATUS "") + message(STATUS "${GD_PREFIX}CMD='${${GD_PREFIX}CMD}'") + message(STATUS "${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}'") + message(STATUS "${GD_PREFIX}OV='${${GD_PREFIX}OV}'") + message(STATUS "${GD_PREFIX}RV='${${GD_PREFIX}RV}'") + message(STATUS "") + endif() + + if("${${GD_PREFIX}RV}" STREQUAL "0") # # Extract eight individual components by matching a regex with paren groupings. # Use the replace functionality and \\1 thru \\8 to extract components. # - SET(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)") + set(${GD_PREFIX}REGEX "([^ ]+) +([^/]+)/([^/]+)/([^ ]+) +([^:]+):([^:]+):([^\\.]+)\\.(.*)") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}") - STRING(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\1" ${GD_PREFIX}DAY_OF_WEEK "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\2" ${GD_PREFIX}MONTH "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\3" ${GD_PREFIX}DAY "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\4" ${GD_PREFIX}YEAR "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\5" ${GD_PREFIX}HOUR "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\6" ${GD_PREFIX}MINUTE "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\7" ${GD_PREFIX}SECOND "${${GD_PREFIX}OV}") + string(REGEX REPLACE "${${GD_PREFIX}REGEX}" "\\8" ${GD_PREFIX}FRACTIONAL_SECOND "${${GD_PREFIX}OV}") # # Verify that extracted components don't have anything obviously @@ -117,93 +117,93 @@ MACRO(GET_DATE) # Expecting a four digit year: # - IF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...") - ENDIF(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") + if(NOT "${${GD_PREFIX}YEAR}" MATCHES "^[0-9][0-9][0-9][0-9]$") + message(STATUS "WARNING: Extracted ${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}' is not a four digit number...") + endif() # Expecting month to be <= 12: # - IF(${${GD_PREFIX}MONTH} GREATER 12) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!") - ENDIF(${${GD_PREFIX}MONTH} GREATER 12) + if(${${GD_PREFIX}MONTH} GREATER 12) + message(STATUS "WARNING: Extracted ${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}' is greater than 12!") + endif() # Expecting day to be <= 31: # - IF(${${GD_PREFIX}DAY} GREATER 31) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!") - ENDIF(${${GD_PREFIX}DAY} GREATER 31) + if(${${GD_PREFIX}DAY} GREATER 31) + message(STATUS "WARNING: Extracted ${GD_PREFIX}DAY='${${GD_PREFIX}DAY}' is greater than 31!") + endif() # Expecting hour to be <= 23: # - IF(${${GD_PREFIX}HOUR} GREATER 23) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!") - ENDIF(${${GD_PREFIX}HOUR} GREATER 23) + if(${${GD_PREFIX}HOUR} GREATER 23) + message(STATUS "WARNING: Extracted ${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}' is greater than 23!") + endif() # Expecting minute to be <= 59: # - IF(${${GD_PREFIX}MINUTE} GREATER 59) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!") - ENDIF(${${GD_PREFIX}MINUTE} GREATER 59) + if(${${GD_PREFIX}MINUTE} GREATER 59) + message(STATUS "WARNING: Extracted ${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}' is greater than 59!") + endif() # Expecting second to be <= 59: # - IF(${${GD_PREFIX}SECOND} GREATER 59) - MESSAGE(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!") - ENDIF(${${GD_PREFIX}SECOND} GREATER 59) + if(${${GD_PREFIX}SECOND} GREATER 59) + message(STATUS "WARNING: Extracted ${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}' is greater than 59!") + endif() # If individual components are single digit, # prepend a leading zero: # - IF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}") - ENDIF("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}") - ENDIF("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}") - ENDIF("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}") - ENDIF("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}") - ENDIF("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") - IF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") - SET(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}") - ENDIF("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") - - IF(${GD_PREFIX}VERBOSE) - MESSAGE(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'") - MESSAGE(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'") - MESSAGE(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'") - MESSAGE(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'") - MESSAGE(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'") - MESSAGE(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'") - MESSAGE(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'") - MESSAGE(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'") - MESSAGE(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'") - MESSAGE(STATUS "") - MESSAGE(STATUS "Counters that change...") - MESSAGE(STATUS "") - MESSAGE(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}") - MESSAGE(STATUS " every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}") - MESSAGE(STATUS " daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}") - MESSAGE(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}") - MESSAGE(STATUS " annually : ${${GD_PREFIX}YEAR}") - MESSAGE(STATUS "") - ENDIF(${GD_PREFIX}VERBOSE) - ELSE("${${GD_PREFIX}RV}" STREQUAL "0") - MESSAGE(SEND_ERROR "ERROR: MACRO(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'") - ENDIF("${${GD_PREFIX}RV}" STREQUAL "0") - - IF(${GD_PREFIX}VERBOSE) - MESSAGE(STATUS "</GET_DATE>") - MESSAGE(STATUS "") - ENDIF(${GD_PREFIX}VERBOSE) -ENDMACRO(GET_DATE) - -MACRO(ADD_SECONDS sec) + if("${${GD_PREFIX}YEAR}" MATCHES "^[0-9]$") + set(${GD_PREFIX}YEAR "0${${GD_PREFIX}YEAR}") + endif() + if("${${GD_PREFIX}MONTH}" MATCHES "^[0-9]$") + set(${GD_PREFIX}MONTH "0${${GD_PREFIX}MONTH}") + endif() + if("${${GD_PREFIX}DAY}" MATCHES "^[0-9]$") + set(${GD_PREFIX}DAY "0${${GD_PREFIX}DAY}") + endif() + if("${${GD_PREFIX}HOUR}" MATCHES "^[0-9]$") + set(${GD_PREFIX}HOUR "0${${GD_PREFIX}HOUR}") + endif() + if("${${GD_PREFIX}MINUTE}" MATCHES "^[0-9]$") + set(${GD_PREFIX}MINUTE "0${${GD_PREFIX}MINUTE}") + endif() + if("${${GD_PREFIX}SECOND}" MATCHES "^[0-9]$") + set(${GD_PREFIX}SECOND "0${${GD_PREFIX}SECOND}") + endif() + + if(${GD_PREFIX}VERBOSE) + message(STATUS "${GD_PREFIX}REGEX='${${GD_PREFIX}REGEX}'") + message(STATUS "${GD_PREFIX}YEAR='${${GD_PREFIX}YEAR}'") + message(STATUS "${GD_PREFIX}MONTH='${${GD_PREFIX}MONTH}'") + message(STATUS "${GD_PREFIX}DAY='${${GD_PREFIX}DAY}'") + message(STATUS "${GD_PREFIX}HOUR='${${GD_PREFIX}HOUR}'") + message(STATUS "${GD_PREFIX}MINUTE='${${GD_PREFIX}MINUTE}'") + message(STATUS "${GD_PREFIX}SECOND='${${GD_PREFIX}SECOND}'") + message(STATUS "${GD_PREFIX}FRACTIONAL_SECOND='${${GD_PREFIX}FRACTIONAL_SECOND}'") + message(STATUS "${GD_PREFIX}DAY_OF_WEEK='${${GD_PREFIX}DAY_OF_WEEK}'") + message(STATUS "") + message(STATUS "Counters that change...") + message(STATUS "") + message(STATUS "...very very quickly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}${${GD_PREFIX}FRACTIONAL_SECOND}") + message(STATUS " every second : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}${${GD_PREFIX}HOUR}${${GD_PREFIX}MINUTE}${${GD_PREFIX}SECOND}") + message(STATUS " daily : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}${${GD_PREFIX}DAY}") + message(STATUS " monthly : ${${GD_PREFIX}YEAR}${${GD_PREFIX}MONTH}") + message(STATUS " annually : ${${GD_PREFIX}YEAR}") + message(STATUS "") + endif() + else() + message(SEND_ERROR "ERROR: macro(GET_DATE) failed. ${GD_PREFIX}CMD='${${GD_PREFIX}CMD}' ${GD_PREFIX}ARGS='${${GD_PREFIX}ARGS}' ${GD_PREFIX}OV='${${GD_PREFIX}OV}' ${GD_PREFIX}RV='${${GD_PREFIX}RV}'") + endif() + + if(${GD_PREFIX}VERBOSE) + message(STATUS "</GET_DATE>") + message(STATUS "") + endif() +endmacro() + +macro(ADD_SECONDS sec) set(new_min ${${GD_PREFIX}MINUTE}) set(new_hr ${${GD_PREFIX}HOUR}) math(EXPR new_sec "${sec} + ${${GD_PREFIX}SECOND}") @@ -230,4 +230,4 @@ MACRO(ADD_SECONDS sec) if(${hr_len} EQUAL 1) set(new_hr "0${new_hr}") endif() -ENDMACRO(ADD_SECONDS) +endmacro() diff --git a/Tests/CTestTestStopTime/test.cmake.in b/Tests/CTestTestStopTime/test.cmake.in index 2d03686e6..c3920a414 100644 --- a/Tests/CTestTestStopTime/test.cmake.in +++ b/Tests/CTestTestStopTime/test.cmake.in @@ -1,21 +1,21 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-StopTime") - -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopTime") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-StopTime") + +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestStopTime") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestStopTime") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -INCLUDE("${CTEST_BINARY_DIRECTORY}/GetDate.cmake") +include("${CTEST_BINARY_DIRECTORY}/GetDate.cmake") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestSubdir/CMakeLists.txt b/Tests/CTestTestSubdir/CMakeLists.txt index 5400ee8c5..b7cc7e2f1 100644 --- a/Tests/CTestTestSubdir/CMakeLists.txt +++ b/Tests/CTestTestSubdir/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestSubdir) -INCLUDE(CTest) +project(CTestTestSubdir) +include(CTest) -ADD_SUBDIRECTORY(subdir) -SUBDIRS(subdir2) -SUBDIRS("${CTestTestSubdir_SOURCE_DIR}/subdir3") +add_subdirectory(subdir) +subdirs(subdir2) +subdirs("${CTestTestSubdir_SOURCE_DIR}/subdir3") diff --git a/Tests/CTestTestSubdir/subdir/CMakeLists.txt b/Tests/CTestTestSubdir/subdir/CMakeLists.txt index b40d316d6..ee555354e 100644 --- a/Tests/CTestTestSubdir/subdir/CMakeLists.txt +++ b/Tests/CTestTestSubdir/subdir/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_EXECUTABLE (main main.c) -ADD_TEST (TestMain1 main) +add_executable (main main.c) +add_test (TestMain1 main) diff --git a/Tests/CTestTestSubdir/subdir2/CMakeLists.txt b/Tests/CTestTestSubdir/subdir2/CMakeLists.txt index 23f8e07c2..a8d0a779b 100644 --- a/Tests/CTestTestSubdir/subdir2/CMakeLists.txt +++ b/Tests/CTestTestSubdir/subdir2/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_EXECUTABLE (main2 main.c) -ADD_TEST (TestMain2 main2) +add_executable (main2 main.c) +add_test (TestMain2 main2) diff --git a/Tests/CTestTestSubdir/subdir3/CMakeLists.txt b/Tests/CTestTestSubdir/subdir3/CMakeLists.txt index 9a44b12b8..fbc41d5e6 100644 --- a/Tests/CTestTestSubdir/subdir3/CMakeLists.txt +++ b/Tests/CTestTestSubdir/subdir3/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_EXECUTABLE (main3 main.c) -ADD_TEST (TestMain3 main3) +add_executable (main3 main.c) +add_test (TestMain3 main3) diff --git a/Tests/CTestTestSubdir/test.cmake.in b/Tests/CTestTestSubdir/test.cmake.in index f240473ee..d1d87adc4 100644 --- a/Tests/CTestTestSubdir/test.cmake.in +++ b/Tests/CTestTestSubdir/test.cmake.in @@ -1,17 +1,17 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Subdir") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Subdir") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdir") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestSubdir") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestSubdir") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) diff --git a/Tests/CTestTestTimeout/CMakeLists.txt b/Tests/CTestTestTimeout/CMakeLists.txt index 0fd1cebb3..476d0a5e0 100644 --- a/Tests/CTestTestTimeout/CMakeLists.txt +++ b/Tests/CTestTestTimeout/CMakeLists.txt @@ -1,28 +1,28 @@ cmake_minimum_required (VERSION 2.8) -PROJECT(CTestTestTimeout) -INCLUDE(CTest) +project(CTestTestTimeout) +include(CTest) -IF(NOT TIMEOUT) - IF(CYGWIN) - SET(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load! - ELSE() - SET(TIMEOUT 1) - ENDIF() -ENDIF() +if(NOT TIMEOUT) + if(CYGWIN) + set(TIMEOUT 4) # Cygwin CMake sometimes takes > 1 second to load! + else() + set(TIMEOUT 1) + endif() +endif() -ADD_DEFINITIONS(-DTIMEOUT=${TIMEOUT}) -ADD_EXECUTABLE (Timeout timeout.c) +add_definitions(-DTIMEOUT=${TIMEOUT}) +add_executable (Timeout timeout.c) -ADD_TEST(NAME TestTimeout +add_test(NAME TestTimeout COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout> -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log -P ${CMAKE_CURRENT_SOURCE_DIR}/timeout.cmake ) -SET_TESTS_PROPERTIES(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT}) +set_tests_properties(TestTimeout PROPERTIES TIMEOUT ${TIMEOUT}) -ADD_TEST(NAME CheckChild +add_test(NAME CheckChild COMMAND ${CMAKE_COMMAND} -D Timeout=$<TARGET_FILE:Timeout> -D Log=${CMAKE_CURRENT_BINARY_DIR}/timeout.log -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake ) -SET_TESTS_PROPERTIES(CheckChild PROPERTIES DEPENDS TestTimeout) +set_tests_properties(CheckChild PROPERTIES DEPENDS TestTimeout) diff --git a/Tests/CTestTestTimeout/test.cmake.in b/Tests/CTestTestTimeout/test.cmake.in index 8a8dc24e5..e34dc07b5 100644 --- a/Tests/CTestTestTimeout/test.cmake.in +++ b/Tests/CTestTestTimeout/test.cmake.in @@ -1,21 +1,21 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Timeout") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestTimeout") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestTimeout") +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_EMPTY_BINARY_DIRECTORY(${CTEST_BINARY_DIRECTORY}) -FILE(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " +file(WRITE "${CTEST_BINARY_DIRECTORY}/CMakeCache.txt" " TIMEOUT:STRING=@CTestTestTimeout_TIME@ ") diff --git a/Tests/CTestTestUpload/CMakeLists.txt b/Tests/CTestTestUpload/CMakeLists.txt index bc164b10c..90d811cd9 100644 --- a/Tests/CTestTestUpload/CMakeLists.txt +++ b/Tests/CTestTestUpload/CMakeLists.txt @@ -1,4 +1,4 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CTestTestUpload) +project(CTestTestUpload) add_executable (Sleep sleep.c) diff --git a/Tests/CTestTestUpload/test.cmake.in b/Tests/CTestTestUpload/test.cmake.in index acfa233bc..2c0fc3812 100644 --- a/Tests/CTestTestUpload/test.cmake.in +++ b/Tests/CTestTestUpload/test.cmake.in @@ -1,14 +1,14 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Upload") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-Upload") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestUpload") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestUpload") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestUpload") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestUpload") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestTestZeroTimeout/CMakeLists.txt b/Tests/CTestTestZeroTimeout/CMakeLists.txt index 8a5246db1..4d2b79dc2 100644 --- a/Tests/CTestTestZeroTimeout/CMakeLists.txt +++ b/Tests/CTestTestZeroTimeout/CMakeLists.txt @@ -1,8 +1,8 @@ -CMAKE_MINIMUM_REQUIRED (VERSION 2.6) -PROJECT (CTestTestZeroTimeout) -INCLUDE (CTest) +cmake_minimum_required (VERSION 2.6) +project (CTestTestZeroTimeout) +include (CTest) -ADD_EXECUTABLE (Sleep sleep.c) +add_executable (Sleep sleep.c) -ADD_TEST (TestExplicitZeroTimeout Sleep) -SET_TESTS_PROPERTIES(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0) +add_test (TestExplicitZeroTimeout Sleep) +set_tests_properties(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0) diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in index 56bae9d17..285a19150 100644 --- a/Tests/CTestTestZeroTimeout/test.cmake.in +++ b/Tests/CTestTestZeroTimeout/test.cmake.in @@ -1,18 +1,18 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.1) +cmake_minimum_required(VERSION 2.1) # Settings: -SET(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") -SET(CTEST_SITE "@SITE@") -SET(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ZeroTimeout") +set(CTEST_DASHBOARD_ROOT "@CMake_BINARY_DIR@/Tests/CTestTest") +set(CTEST_SITE "@SITE@") +set(CTEST_BUILD_NAME "CTestTest-@BUILDNAME@-ZeroTimeout") -SET(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout") -SET(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout") -SET(CTEST_CVS_COMMAND "@CVSCOMMAND@") -SET(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") -SET(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") -SET(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") -SET(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") -SET(CTEST_TEST_TIMEOUT 2) +set(CTEST_SOURCE_DIRECTORY "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout") +set(CTEST_BINARY_DIRECTORY "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout") +set(CTEST_CVS_COMMAND "@CVSCOMMAND@") +set(CTEST_CMAKE_GENERATOR "@CMAKE_TEST_GENERATOR@") +set(CTEST_BUILD_CONFIGURATION "$ENV{CMAKE_CONFIG_TYPE}") +set(CTEST_COVERAGE_COMMAND "@COVERAGE_COMMAND@") +set(CTEST_NOTES_FILES "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}") +set(CTEST_TEST_TIMEOUT 2) CTEST_START(Experimental) CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res) diff --git a/Tests/CTestUpdateBZR.cmake.in b/Tests/CTestUpdateBZR.cmake.in index c654f477a..8fb1d3483 100644 --- a/Tests/CTestUpdateBZR.cmake.in +++ b/Tests/CTestUpdateBZR.cmake.in @@ -74,7 +74,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${BZR} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${BZR} add ${files_added} diff --git a/Tests/CTestUpdateCVS.cmake.in b/Tests/CTestUpdateCVS.cmake.in index f7f5db65d..1699c3f1f 100644 --- a/Tests/CTestUpdateCVS.cmake.in +++ b/Tests/CTestUpdateCVS.cmake.in @@ -91,7 +91,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${CVSCMD} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${CVSCMD} add ${files_added} diff --git a/Tests/CTestUpdateCommon.cmake b/Tests/CTestUpdateCommon.cmake index 335d09e7e..aaf88a8d1 100644 --- a/Tests/CTestUpdateCommon.cmake +++ b/Tests/CTestUpdateCommon.cmake @@ -12,8 +12,8 @@ function(run_child) string(REGEX REPLACE "\n" "\n " OUTPUT "${OUTPUT}") message(FATAL_ERROR "Child failed (${FAILED}), output is\n ${OUTPUT}\n" "Command = [${ARGN}]\n") - endif(FAILED) -endfunction(run_child) + endif() +endfunction() #----------------------------------------------------------------------------- # Function to find the Update.xml file and check for expected entries. @@ -26,7 +26,7 @@ function(check_updates build) ) if(NOT UPDATE_XML_FILE) message(FATAL_ERROR "Cannot find Update.xml with pattern\n ${PATTERN}") - endif(NOT UPDATE_XML_FILE) + endif() message(" found ${UPDATE_XML_FILE}") set(max_update_xml_size 16384) @@ -73,11 +73,11 @@ function(check_updates build) set(MSG "${MSG}Update.xml is missing expected entries:\n") foreach(f ${MISSING}) set(MSG "${MSG} ${f}\n") - endforeach(f) - else(MISSING) + endforeach() + else() # Success message(" no entries missing from Update.xml") - endif(MISSING) + endif() # Report the result if(EXTRA) @@ -85,11 +85,11 @@ function(check_updates build) set(MSG "${MSG}Update.xml has extra unexpected entries:\n") foreach(f ${EXTRA}) set(MSG "${MSG} ${f}\n") - endforeach(f) - else(EXTRA) + endforeach() + else() # Success message(" no extra entries in Update.xml") - endif(EXTRA) + endif() if(MSG) # Provide the log file @@ -99,14 +99,14 @@ function(check_updates build) file(READ ${UPDATE_LOG_FILE} UPDATE_LOG LIMIT ${max_update_xml_size}) string(REGEX REPLACE "\n" "\n " UPDATE_LOG "${UPDATE_LOG}") set(MSG "${MSG}Update log:\n ${UPDATE_LOG}") - else(UPDATE_LOG_FILE) + else() set(MSG "${MSG}No update log found!") - endif(UPDATE_LOG_FILE) + endif() # Display the error message message(FATAL_ERROR "${MSG}") - endif(MSG) -endfunction(check_updates) + endif() +endfunction() #----------------------------------------------------------------------------- # Function to create initial content. @@ -123,7 +123,7 @@ set(CTEST_NIGHTLY_START_TIME \"21:00:00 EDT\") # Some other files. file(WRITE ${TOP}/${dir}/foo.txt "foo\n") file(WRITE ${TOP}/${dir}/bar.txt "bar\n") -endfunction(create_content) +endfunction() #----------------------------------------------------------------------------- # Function to update content. @@ -137,20 +137,20 @@ function(update_content dir added_var removed_var dirs_var) set(${dirs_var} subdir PARENT_SCOPE) set(${added_var} zot.txt subdir/foo.txt subdir/bar.txt PARENT_SCOPE) set(${removed_var} bar.txt PARENT_SCOPE) -endfunction(update_content) +endfunction() #----------------------------------------------------------------------------- # Function to change existing files function(change_content dir) file(APPEND ${TOP}/${dir}/foo.txt "foo line 3\n") file(APPEND ${TOP}/${dir}/subdir/foo.txt "foo line 2\n") -endfunction(change_content) +endfunction() #----------------------------------------------------------------------------- # Function to create local modifications before update function(modify_content dir) file(APPEND ${TOP}/${dir}/CTestConfig.cmake "# local modification\n") -endfunction(modify_content) +endfunction() #----------------------------------------------------------------------------- # Function to write CTestConfiguration.ini content. @@ -163,7 +163,7 @@ BuildDirectory: ${TOP}/${bin_dir} Site: test.site BuildName: user-test ") -endfunction(create_build_tree) +endfunction() #----------------------------------------------------------------------------- # Function to write the dashboard test script. @@ -181,7 +181,7 @@ ${custom_text} ctest_start(Experimental) ctest_update(SOURCE \${CTEST_SOURCE_DIRECTORY}) ") -endfunction(create_dashboard_script) +endfunction() #----------------------------------------------------------------------------- # Function to run the dashboard through the command line @@ -205,7 +205,7 @@ function(run_dashboard_command_line bin_dir) Updated{subdir/bar.txt} ${_modified} ) -endfunction(run_dashboard_command_line) +endfunction() #----------------------------------------------------------------------------- # Function to run the dashboard through a script @@ -224,11 +224,11 @@ function(run_dashboard_script bin_dir) Updated{subdir/foo.txt} Updated{subdir/bar.txt} ) -endfunction(run_dashboard_script) +endfunction() #----------------------------------------------------------------------------- # Function to initialize the testing directory. function(init_testing) file(REMOVE_RECURSE ${TOP}) file(MAKE_DIRECTORY ${TOP}) -endfunction(init_testing) +endfunction() diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index eb9f987c6..0c01291e7 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -159,7 +159,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${GIT} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${GIT} add ${files_added} @@ -221,7 +221,7 @@ macro(rewind_source src_dir) WORKING_DIRECTORY ${TOP}/${src_dir} COMMAND ${GIT} submodule update ) -endmacro(rewind_source) +endmacro() rewind_source(user-source) # Make sure pull does not try to rebase (which does not work with diff --git a/Tests/CTestUpdateHG.cmake.in b/Tests/CTestUpdateHG.cmake.in index 640d2c6f3..c5440f954 100644 --- a/Tests/CTestUpdateHG.cmake.in +++ b/Tests/CTestUpdateHG.cmake.in @@ -70,7 +70,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${HG} add ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${HG} add ${files_added} diff --git a/Tests/CTestUpdateSVN.cmake.in b/Tests/CTestUpdateSVN.cmake.in index 15b833b10..b5728fd67 100644 --- a/Tests/CTestUpdateSVN.cmake.in +++ b/Tests/CTestUpdateSVN.cmake.in @@ -74,7 +74,7 @@ if(dirs_added) WORKING_DIRECTORY ${TOP}/user-source COMMAND ${SVNCMD} add ${depth_empty} ${dirs_added} ) -endif(dirs_added) +endif() run_child( WORKING_DIRECTORY ${TOP}/user-source COMMAND ${SVNCMD} add ${files_added} diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt index 8b279a5c4..20001e6ed 100644 --- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt +++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt @@ -46,6 +46,7 @@ echo_var(MSVC80) echo_var(MSVC90) echo_var(MSVC10) echo_var(MSVC11) +echo_var(MSVC_IDE) if(MSVC) # @@ -60,6 +61,13 @@ if(MSVC) else() message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 1 expected") endif() + if(NOT DEFINED MSVC_IDE) + message(FATAL_ERROR "MSVC_IDE not defined but should be!") + elseif("${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND NOT MSVC_IDE) + message(FATAL_ERROR "MSVC_IDE is not true but should be (${CMAKE_GENERATOR})!") + elseif(NOT "${CMAKE_GENERATOR}" MATCHES "Visual Studio" AND MSVC_IDE) + message(FATAL_ERROR "MSVC_IDE is true but should not be (${CMAKE_GENERATOR})!") + endif() else() # # The compiler is something other than cl... None of the MSVC** variables @@ -70,6 +78,9 @@ else() else() message(FATAL_ERROR "error: ${msvc_total} MSVC** variables are defined -- exactly 0 expected") endif() + if(DEFINED MSVC_IDE) + message(FATAL_ERROR "MSVC_IDE is defined but should not be!") + endif() endif() diff --git a/Tests/CommandLineTest/CMakeLists.txt b/Tests/CommandLineTest/CMakeLists.txt index 0493a0c4b..96aac104c 100644 --- a/Tests/CommandLineTest/CMakeLists.txt +++ b/Tests/CommandLineTest/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CommandLineTest) +project(CommandLineTest) -GET_FILENAME_COMPONENT(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) -MACRO(EXEC_CMAKE_COMMAND CMAKE_ARGS) - EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CMAKE_COMMAND) +get_filename_component(CMAKE_BIN_DIR ${CMAKE_COMMAND} PATH) +macro(EXEC_CMAKE_COMMAND CMAKE_ARGS) + exec_program("${CMAKE_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CMake command failed with arguments \"${CMAKE_ARGS}\"") + endif() +endmacro() EXEC_CMAKE_COMMAND("-E chdir \"${CMAKE_CURRENT_SOURCE_DIR}\" \"${CMAKE_COMMAND}\" -E echo \"Hello World\"") EXEC_CMAKE_COMMAND("-E time \"${CMAKE_COMMAND} -N -L ${CommandLineTest_SOURCE_DIR}\"") @@ -24,22 +24,22 @@ EXEC_CMAKE_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/cmake.html\"") EXEC_CMAKE_COMMAND("--copyright \"${CMAKE_CURRENT_BINARY_DIR}/Copyright.txt\"") EXEC_CMAKE_COMMAND("--version \"${CMAKE_CURRENT_BINARY_DIR}/version.txt\"") -ADD_EXECUTABLE(CommandLineTest CommandLineTest.cxx) +add_executable(CommandLineTest CommandLineTest.cxx) -GET_FILENAME_COMPONENT(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) -SET(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") -MACRO(EXEC_CTEST_COMMAND CMAKE_ARGS) - EXEC_PROGRAM("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CTEST_COMMAND) -MACRO(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) - EXEC_PROGRAM("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_CTEST_COMMAND_WITH_DIR) +get_filename_component(CMAKE_COMMAND_PATH "${CMAKE_COMMAND}" PATH) +set(CTEST_COMMAND "${CMAKE_COMMAND_PATH}/ctest") +macro(EXEC_CTEST_COMMAND CMAKE_ARGS) + exec_program("${CTEST_COMMAND}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") + endif() +endmacro() +macro(EXEC_CTEST_COMMAND_WITH_DIR DIR CMAKE_ARGS) + exec_program("${CTEST_COMMAND}" "${DIR}" ARGS "${CMAKE_ARGS}" RETURN_VALUE RET) + if(${RET}) + message(SEND_ERROR "CTest command failed with arguments \"${CMAKE_ARGS}\"") + endif() +endmacro() EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-N") EXEC_CTEST_COMMAND_WITH_DIR("${CMAKE_CURRENT_BINARY_DIR}/../.." "-R complex -N") @@ -55,25 +55,25 @@ EXEC_CTEST_COMMAND("--help-man \"${CMAKE_CURRENT_BINARY_DIR}/ctest.man\"") EXEC_CTEST_COMMAND("--help-html \"${CMAKE_CURRENT_BINARY_DIR}/ctest.html\"") EXEC_CTEST_COMMAND("--version") -IF(THIS_SHOULD_BE_SET) - MESSAGE(STATUS "***************************") - MESSAGE(STATUS "PreLoad.cmake works fine.") - MESSAGE(STATUS "***************************") -ELSE(THIS_SHOULD_BE_SET) - MESSAGE("***************************") - MESSAGE(FATAL_ERROR "PreLoad.cmake does not work.") -ENDIF(THIS_SHOULD_BE_SET) +if(THIS_SHOULD_BE_SET) + message(STATUS "***************************") + message(STATUS "PreLoad.cmake works fine.") + message(STATUS "***************************") +else() + message("***************************") + message(FATAL_ERROR "PreLoad.cmake does not work.") +endif() -IF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) - MESSAGE(SEND_ERROR "Environment variable definition test broken!") -ENDIF(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) +if(DEFINED ENV{TEST_ENVIRONMENT_VARIABLE_NOTSET}) + message(SEND_ERROR "Environment variable definition test broken!") +endif() -SET(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") -IF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") - MESSAGE(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") - IF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) - MESSAGE(SEND_ERROR "Environment variable definition test failed!") - ENDIF(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) -ELSE("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") - MESSAGE(SEND_ERROR "Environment variable setting is broken") -ENDIF("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") +set(ENV{TEST_ENVIRONMENT_VARIABLE} "Environment variable set") +if("$ENV{TEST_ENVIRONMENT_VARIABLE}" STREQUAL "Environment variable set") + message(STATUS "Environment variable set to: $ENV{TEST_ENVIRONMENT_VARIABLE}") + if(NOT DEFINED ENV{TEST_ENVIRONMENT_VARIABLE}) + message(SEND_ERROR "Environment variable definition test failed!") + endif() +else() + message(SEND_ERROR "Environment variable setting is broken") +endif() diff --git a/Tests/CommandLineTest/PreLoad.cmake b/Tests/CommandLineTest/PreLoad.cmake index 87284aff0..f059bcea6 100644 --- a/Tests/CommandLineTest/PreLoad.cmake +++ b/Tests/CommandLineTest/PreLoad.cmake @@ -1 +1 @@ -SET(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable") +set(THIS_SHOULD_BE_SET ON CACHE BOOL "Some variable") diff --git a/Tests/CompileCommandOutput/CMakeLists.txt b/Tests/CompileCommandOutput/CMakeLists.txt index bd8e305c2..6f9468dca 100644 --- a/Tests/CompileCommandOutput/CMakeLists.txt +++ b/Tests/CompileCommandOutput/CMakeLists.txt @@ -2,15 +2,15 @@ cmake_minimum_required (VERSION 2.6) project (CompileCommandOutput CXX) -SET(CMAKE_EXPORT_COMPILE_COMMANDS ON) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -IF(MAKE_SUPPORTS_SPACES) - SET(test1_srcs "file with spaces.cxx") -ELSE() - SET(test1_srcs "file_with_underscores.cxx") -ENDIF() -ADD_LIBRARY(test1 STATIC ${test1_srcs}) -ADD_LIBRARY(test2 SHARED "../CompileCommandOutput/relative.cxx") -INCLUDE_DIRECTORIES(${CompileCommandOutput_SOURCE_DIR}/../../Source) -ADD_EXECUTABLE(CompileCommandOutput compile_command_output.cxx) -TARGET_LINK_LIBRARIES(CompileCommandOutput test1 test2) +if(MAKE_SUPPORTS_SPACES) + set(test1_srcs "file with spaces.cxx") +else() + set(test1_srcs "file_with_underscores.cxx") +endif() +add_library(test1 STATIC ${test1_srcs}) +add_library(test2 SHARED "../CompileCommandOutput/relative.cxx") +include_directories(${CompileCommandOutput_SOURCE_DIR}/../../Source) +add_executable(CompileCommandOutput compile_command_output.cxx) +target_link_libraries(CompileCommandOutput test1 test2) diff --git a/Tests/CompileDefinitions/CMakeLists.txt b/Tests/CompileDefinitions/CMakeLists.txt new file mode 100644 index 000000000..e7d91bf94 --- /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 000000000..a6372af74 --- /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 000000000..e415390c0 --- /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 000000000..f18e59e67 --- /dev/null +++ b/Tests/CompileDefinitions/compiletest.cpp @@ -0,0 +1,51 @@ + +#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 +}; + +#ifdef TEST_GENERATOR_EXPRESSIONS +#ifndef CMAKE_IS_DECLARATIVE +#error Expect declarative definition +#endif +#ifdef GE_NOT_DEFINED +#error Expect not defined generator expression +#endif + +#ifndef ARGUMENT +#error Expected define expanded from list +#endif +#ifndef LIST +#error Expected define expanded from list +#endif + +// TEST_GENERATOR_EXPRESSIONS +#endif + +int main(int argc, char **argv) +{ + return 0; +} diff --git a/Tests/CompileDefinitions/target_prop/CMakeLists.txt b/Tests/CompileDefinitions/target_prop/CMakeLists.txt new file mode 100644 index 000000000..abdf257ec --- /dev/null +++ b/Tests/CompileDefinitions/target_prop/CMakeLists.txt @@ -0,0 +1,16 @@ + +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") + +set_property(TARGET target_prop_executable APPEND PROPERTY COMPILE_DEFINITIONS + TEST_GENERATOR_EXPRESSIONS + "$<1:CMAKE_IS_DECLARATIVE>" + "$<0:GE_NOT_DEFINED>" + "$<1:ARGUMENT;LIST>" +) diff --git a/Tests/Complex/CMakeLists.txt b/Tests/Complex/CMakeLists.txt index ec3ad3985..048f966f6 100644 --- a/Tests/Complex/CMakeLists.txt +++ b/Tests/Complex/CMakeLists.txt @@ -1,219 +1,219 @@ # # A more complex test case # -SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4) -PROJECT (Complex) +set(CMAKE_BACKWARDS_COMPATIBILITY 1.4) +project (Complex) # Try setting a new policy. The IF test is for coverage. -IF(POLICY CMP0003) - CMAKE_POLICY(SET CMP0003 NEW) +if(POLICY CMP0003) + cmake_policy(SET CMP0003 NEW) - CMAKE_POLICY(GET CMP0003 P3) - IF(NOT "${P3}" STREQUAL "NEW") - MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!") - ENDIF(NOT "${P3}" STREQUAL "NEW") -ENDIF(POLICY CMP0003) + cmake_policy(GET CMP0003 P3) + if(NOT "${P3}" STREQUAL "NEW") + message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") + endif() +endif() # Test building without per-rule echo lines in Makefiles. -SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) +set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) -SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") +set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") # # Define a macro # -MACRO(ASSERT value msg) - IF (NOT ${value}) - MESSAGE ("Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(ASSERT) - +macro(ASSERT value msg) + if (NOT ${value}) + message ("Assertion failure:" ${msg} ) + endif () +endmacro() + # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") # # Define a var args macro, it must take two or four args # -MACRO(TEST_ARGC value1 value2) - ADD_DEFINITIONS(${value1} ${value2}) - IF (${ARGC} MATCHES 4) - ADD_DEFINITIONS(${ARGV2} ${ARGV3}) - ENDIF (${ARGC} MATCHES 4) -ENDMACRO(TEST_ARGC) - +macro(TEST_ARGC value1 value2) + add_definitions(${value1} ${value2}) + if (${ARGC} MATCHES 4) + add_definitions(${ARGV2} ${ARGV3}) + endif () +endmacro() + # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) -MACRO(TEST_VAR_ARG fa) - IF("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(STATUS "ARGV works") - ELSE("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - ENDIF("${ARGV}" MATCHES "^1;2;3$") - IF("${ARGN}" MATCHES "^2;3$") - MESSAGE(STATUS "ARGN works") - ELSE("${ARGN}" MATCHES "^2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - ENDIF("${ARGN}" MATCHES "^2;3$") -ENDMACRO(TEST_VAR_ARG) +macro(TEST_VAR_ARG fa) + if("${ARGV}" MATCHES "^1;2;3$") + message(STATUS "ARGV works") + else() + message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") + endif() + if("${ARGN}" MATCHES "^2;3$") + message(STATUS "ARGN works") + else() + message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") + endif() +endmacro() TEST_VAR_ARG(1 2 3) # Floating-point comparison test. -IF(2.4 LESS 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4") -ENDIF(2.4 LESS 2.4) -IF(2.4 GREATER 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -ENDIF(2.4 GREATER 2.4) -IF(NOT 2.4 EQUAL 2.4) - MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -ENDIF(NOT 2.4 EQUAL 2.4) - -IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - - -ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) -SET_PROPERTY(DIRECTORY +if(2.4 LESS 2.4) + message(FATAL_ERROR "Failed: 2.4 LESS 2.4") +endif() +if(2.4 GREATER 2.4) + message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") +endif() +if(NOT 2.4 EQUAL 2.4) + message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") +endif() + +if(CMAKE_SYSTEM MATCHES "OSF1-V.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") + endif() +endif() + + +add_definitions(-DCMAKE_IS_FUN) +add_definitions(-DCMAKE_IS_REALLY_FUN) +set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) -SET(TEST_SEP "a b c") -SEPARATE_ARGUMENTS(TEST_SEP) +set(TEST_SEP "a b c") +separate_arguments(TEST_SEP) # # Include vars from a file and from a cache # -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -INCLUDE(fileshouldnotbehere OPTIONAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + include(${Complex_SOURCE_DIR}/VarTests.cmake) +endif () +include(fileshouldnotbehere OPTIONAL) +load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE CACHE_TEST_VAR_EXCLUDED INCLUDE_INTERNALS CACHE_TEST_VAR_INTERNAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) -IF(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}") -ELSE(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) +load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) +if(${fooCACHE_TEST_VAR2} MATCHES bar) + message("Load cache worked: ${fooCACHE_TEST_VAR2}") +else() + message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") +endif() # -# Specify include and lib dirs +# Specify include and lib dirs # (BEFORE is for coverage) # -INCLUDE_DIRECTORIES( +include_directories( Library ) -INCLUDE_DIRECTORIES(BEFORE +include_directories(BEFORE ${Complex_BINARY_DIR} ) -INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir) +include_directories(SYSTEM Library/SystemDir) -INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing") +include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing") -LINK_DIRECTORIES( +link_directories( ${Complex_BINARY_DIR}/Library ) # # check for SET CACHE FORCE # -SET(FORCE_TEST 1 CACHE STRING "a test") -SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) +set(FORCE_TEST 1 CACHE STRING "a test") +set(FORCE_TEST 0 CACHE STRING "a test" FORCE) # # Lib and exe path # -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") -MESSAGE (Test " " escape " " semi-colon " " \; \;) +message (Test " " escape " " semi-colon " " \; \;) # # Exec program (TODO: test a result) # Increase coverage. # -MESSAGE("\nIgnore this message") -OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) -IF (NOT NO_EXEC_PROGRAM) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -ELSE (NOT NO_EXEC_PROGRAM) - MESSAGE("Set this option ON") -ENDIF (NOT NO_EXEC_PROGRAM) +message("\nIgnore this message") +option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) +if (NOT NO_EXEC_PROGRAM) + exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") +else () + message("Set this option ON") +endif () -MARK_AS_ADVANCED(NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM) +mark_as_advanced(NO_EXEC_PROGRAM) +mark_as_advanced(CLEAR NO_EXEC_PROGRAM) # Execute a process. Add coverage for this command. -EXECUTE_PROCESS( +execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else() + message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +endif() # This test has some problems on UNIX systems. Disabling for now. # -# EXECUTE_PROCESS( +# execute_process( # COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" # COMMAND /process/does/not/exist # OUTPUT_QUIET # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# IF("${RESULT}" MATCHES "^0$") -# MESSAGE(SEND_ERROR +# if("${RESULT}" MATCHES "^0$") +# message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# ELSE("${RESULT}" MATCHES "^0$") -# MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# ENDIF("${RESULT}" MATCHES "^0$") +# else() +# message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") +# endif() # # Create directory. # The 'complex' executable will then test if this dir exists, # sadly it won't be able to remove it. # -MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir") +make_directory("${Complex_BINARY_DIR}/make_dir") # # Test FIND_LIBARY # Create a dummy empty lib # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/dummylib.lib COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl +foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl ${CMAKE_SHARED_LIBRARY_SUFFIX}.2 ${CMAKE_STATIC_LIBRARY_SUFFIX}.2) - CONFIGURE_FILE( + configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -ENDFOREACH (ext) +endforeach () -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB dummylib PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB NAMES dummylib dummylib2 PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") @@ -221,106 +221,106 @@ FIND_LIBRARY(FIND_DUMMY_LIB # This doesn't work for platforms that have a shared library and an import # library, like Windows with .dll and .lib. Limit is to ".so" now because it's # known to work there. -IF(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so") - FIND_LIBRARY(FIND_DUMMY_SHLIB_VERSIONED +if(CMAKE_SHARED_LIBRARY_SUFFIX STREQUAL ".so") + find_library(FIND_DUMMY_SHLIB_VERSIONED NAMES libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2 PATHS ${Complex_BINARY_DIR}/Library DOC "find versioned dummy shared lib" NO_DEFAULT_PATH) - IF(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2") - MESSAGE(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: " + if(NOT FIND_DUMMY_SHLIB_VERSIONED MATCHES "/libdummylib${CMAKE_SHARED_LIBRARY_SUFFIX}.2") + message(SEND_ERROR "FIND_DUMMY_SHLIB_VERSIONED is not set correctly: " "${FIND_DUMMY_SHLIB_VERSIONED}") - ENDIF() -ENDIF() + endif() +endif() # Static library, should work everywhere -FIND_LIBRARY(FIND_DUMMY_STLIB_VERSIONED +find_library(FIND_DUMMY_STLIB_VERSIONED NAMES libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2 PATHS ${Complex_BINARY_DIR}/Library DOC "find versioned dummy static lib" NO_DEFAULT_PATH) -IF(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2") - MESSAGE(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: " +if(NOT FIND_DUMMY_STLIB_VERSIONED MATCHES "/libdummylib${CMAKE_STATIC_LIBRARY_SUFFIX}.2") + message(SEND_ERROR "FIND_DUMMY_STLIB_VERSIONED is not set correctly: " "${FIND_DUMMY_STLIB_VERSIONED}") -ENDIF() +endif() # -# Test SET_SOURCE_FILES_PROPERTIES +# Test SET_SOURCE_FILES_PROPERTIES # -SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 - GENERATED - ABSTRACT - WRAP_EXCLUDE +set_source_files_properties(nonexisting_file2 + GENERATED + ABSTRACT + WRAP_EXCLUDE COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) -SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES +set_source_files_properties(nonexisting_file3 PROPERTIES GENERATED 1 ABSTRACT 1 WRAP_EXCLUDE 1 COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) # # Test registry (win32) # Create a file, put its path in a registry key, try to find the file in that # path using that registry key, then remove the file and the key # -IF (WIN32) - IF (NOT UNIX) - SET(dir "${Complex_BINARY_DIR}/registry_dir") - SET(file "registry_test_dummy") - SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") - CONFIGURE_FILE( +if (WIN32) + if (NOT UNIX) + set(dir "${Complex_BINARY_DIR}/registry_dir") + set(file "registry_test_dummy") + set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") + configure_file( ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY IMMEDIATE) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") - FIND_PATH(REGISTRY_TEST_PATH + exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - ENDIF (NOT UNIX) -ENDIF (WIN32) + exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") + exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") + endif () +endif () # # Test a set and a remove # -SET(REMOVE_STRING a b c d e f) -SET(removeVar1 c e) -REMOVE(REMOVE_STRING ${removeVar1} f) +set(REMOVE_STRING a b c d e f) +set(removeVar1 c e) +remove(REMOVE_STRING ${removeVar1} f) # # Test an IF inside a FOREACH. # -FOREACH(x "a") - IF(${x} MATCHES "a") +foreach(x "a") + if(${x} MATCHES "a") # Should always execute. - SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - ELSE(${x} MATCHES "a") + set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) + else() # Should never execute. - SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - ENDIF(${x} MATCHES "a") -ENDFOREACH(x) + set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) + endif() +endforeach() # test WHILE command -SET (while_var 1) -WHILE (while_var LESS 1000) - SET(while_var ${while_var}0) -ENDWHILE(while_var LESS 1000) +set (while_var 1) +while (while_var LESS 1000) + set(while_var ${while_var}0) +endwhile() -SET(SHOULD_BE_ZERO ) -SET(SHOULD_BE_ONE 1) +set(SHOULD_BE_ZERO ) +set(SHOULD_BE_ONE 1) -# test elseif functionality, the mess below tries to catch problem +# test elseif functionality, the mess below tries to catch problem # of clauses being executed early or late etc set (RESULT 3) if (RESULT EQUAL 1) @@ -328,7 +328,7 @@ if (RESULT EQUAL 1) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) + endif () elseif (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) @@ -337,25 +337,25 @@ elseif (RESULT EQUAL 3) elseif (RESULT EQUAL 3) if (NOT ELSEIF_RESULT EQUAL 1) set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) + endif () + endif () elseif (RESULT EQUAL 4) if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) + endif () +else () if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) + endif () +endif () if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) +endif () # test handling of parenthetical groups in conditionals if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) @@ -364,43 +364,43 @@ endif() # -# Configure file +# Configure file # (plug vars to #define so that they can be tested) # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) -SET(STRING_WITH_QUOTES "\"hello world\"") +set(STRING_WITH_QUOTES "\"hello world\"") # test CONFIGURE_FILE with ESCAPE_QUOTES on -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) # Test regular expression commands. -STRING(REGEX MATCH "b" RESULT "abc") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX MATCHALL "b" RESULT "abcb") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") -IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR - "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -ENDIF(NOT STRING_REGEX_PASSED) +string(REGEX MATCH "b" RESULT "abc") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") +endif() +string(REGEX MATCHALL "b" RESULT "abcb") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") +endif() +string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") + set(STRING_REGEX_PASSED 1) +endif() +if(NOT STRING_REGEX_PASSED) + message(SEND_ERROR + "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") +endif() # # Create the libs and the main exe # -ADD_SUBDIRECTORY(Library) -ADD_SUBDIRECTORY(Executable) -SUBDIR_DEPENDS(Executable Library) -EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) -INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) +add_subdirectory(Library) +add_subdirectory(Executable) +subdir_depends(Executable Library) +export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) +include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) diff --git a/Tests/Complex/Executable/CMakeLists.txt b/Tests/Complex/Executable/CMakeLists.txt index 345836257..432dbf890 100644 --- a/Tests/Complex/Executable/CMakeLists.txt +++ b/Tests/Complex/Executable/CMakeLists.txt @@ -1,116 +1,116 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) +cmake_minimum_required(VERSION 1.3) # -# Create exe. +# Create exe. # -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") # Create an imported target for if(TARGET) test below. -ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) +add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. -IF(NOT TARGET CMakeTestLibrary) - MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!") -ENDIF(NOT TARGET CMakeTestLibrary) -IF(NOT TARGET ExeImportedTarget) - MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!") -ENDIF(NOT TARGET ExeImportedTarget) -IF(TARGET LibImportedTarget) - MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!") -ENDIF(TARGET LibImportedTarget) -IF(TARGET NotATarget) - MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!") -ENDIF(TARGET NotATarget) - - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to -SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) -LINK_LIBRARIES(${COMPLEX_LIBS}) +if(NOT TARGET CMakeTestLibrary) + message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") +endif() +if(NOT TARGET ExeImportedTarget) + message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") +endif() +if(TARGET LibImportedTarget) + message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") +endif() +if(TARGET NotATarget) + message(FATAL_ERROR "if(TARGET NotATarget) returned true!") +endif() + + # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to +set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) +link_libraries(${COMPLEX_LIBS}) # Test forcing a .cxx file to not build. -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES +set_source_files_properties(complex_nobuild.cxx PROPERTIES HEADER_FILE_ONLY 1) # Test forcing a .c file to not build. # This makes sure a mixed language library is created # with header file only sources -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES +set_source_files_properties(complex_nobuild.c PROPERTIES HEADER_FILE_ONLY 1) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) -ADD_EXECUTABLE(complex complex testcflags.c Aout.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_executable(A A.cxx A.hh A.h A.txt) +add_custom_command(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) +add_executable(complex complex testcflags.c Aout.h) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx +add_executable(complex.file complex.file.cxx complex_nobuild.cxx complex_nobuild.c) -IF (UNIX) - TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) -ELSE(UNIX) - IF (NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(complex rpcrt4.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) -ENDIF (UNIX) +if (UNIX) + target_link_libraries(complex ${CMAKE_DL_LIBS}) +else() + if (NOT BORLAND) + if(NOT MINGW) + target_link_libraries(complex rpcrt4.lib) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC) - TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_definitions(-DCOMPLEX_TEST_LINK_STATIC) + target_link_libraries(complex CMakeTestLinkStatic) +endif() # can we get the path to a source file -GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION) -IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") - ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX) -ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +get_source_file_property(A_LOCATION A.cxx LOCATION) +if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") + add_definitions(-DCMAKE_FOUND_ACXX) +endif () # get the directory parent -GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY) -IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") - ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT) -ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +get_directory_property(P_VALUE PARENT_DIRECTORY) +if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") + add_definitions(-DCMAKE_FOUND_PARENT) +endif () # get the stack of listfiles -INCLUDE(Included.cmake) -IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") - ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK) -ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +include(Included.cmake) +if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") + add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) +endif () # Test add/remove definitions. -ADD_DEFINITIONS( +add_definitions( -DCOMPLEX_DEFINED_PRE -DCOMPLEX_DEFINED -DCOMPLEX_DEFINED_POST -DCOMPLEX_DEFINED ) -REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED) +remove_definitions(-DCOMPLEX_DEFINED) # Test pre-build/pre-link/post-build rules for an executable. -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Executable/postbuild.txt" "${Complex_BINARY_DIR}/Executable/postbuild2.txt") -SET_SOURCE_FILES_PROPERTIES(complex +set_source_files_properties(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS" #" -DFILE_DEFINE_STRING=\\\"hello\\\"" OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h ) -SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") -ADD_CUSTOM_COMMAND( +set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") +add_custom_command( TARGET complex SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in COMMAND ${CMAKE_COMMAND} @@ -121,18 +121,18 @@ ADD_CUSTOM_COMMAND( ) # Test creating an executable that is not built by default. -ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) -TARGET_LINK_LIBRARIES(notInAllExe notInAllLib) +add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) +target_link_libraries(notInAllExe notInAllLib) # Test user-value flag mapping for the VS IDE. -IF(MSVC) - SET_TARGET_PROPERTIES(notInAllExe PROPERTIES +if(MSVC) + set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -ENDIF(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. -ADD_CUSTOM_TARGET(notInAllCustom) -ADD_DEPENDENCIES(notInAllCustom notInAllExe) +add_custom_target(notInAllCustom) +add_dependencies(notInAllCustom notInAllExe) # # Output the files required by 'complex' to a file. @@ -141,30 +141,30 @@ ADD_DEPENDENCIES(notInAllCustom notInAllExe) # has no side-effects on the current Makefile (duplicated source file # due to source list expansion done twice). # -ADD_SUBDIRECTORY(Temp) +add_subdirectory(Temp) -IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) - ADD_EXECUTABLE(testSystemDir testSystemDir.cxx) - SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) + add_executable(testSystemDir testSystemDir.cxx) + set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") +endif() # # Extra coverage.Not used. # -INSTALL_TARGETS(/tmp complex) -INSTALL_PROGRAMS(/tmp complex) +install_targets(/tmp complex) +install_programs(/tmp complex) -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in ${Complex_BINARY_DIR}/cmVersion.h) -SOURCE_GROUP(A_GROUP ".cxx") -SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx") -SOURCE_GROUP(C_GROUP FILES complex.cxx) +source_group(A_GROUP ".cxx") +source_group(B_GROUP REGULAR_EXPRESSION "cxx") +source_group(C_GROUP FILES complex.cxx) -FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") diff --git a/Tests/Complex/Executable/Included.cmake b/Tests/Complex/Executable/Included.cmake index 2d1ea3e8c..520a68be1 100644 --- a/Tests/Complex/Executable/Included.cmake +++ b/Tests/Complex/Executable/Included.cmake @@ -1,2 +1,2 @@ -GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK) +get_directory_property(LF_VALUE LISTFILE_STACK) diff --git a/Tests/Complex/Executable/Temp/CMakeLists.txt b/Tests/Complex/Executable/Temp/CMakeLists.txt index f00955029..041fcff20 100644 --- a/Tests/Complex/Executable/Temp/CMakeLists.txt +++ b/Tests/Complex/Executable/Temp/CMakeLists.txt @@ -3,6 +3,6 @@ # The 'complex' executable will then test if this file exists and remove it. # The contents of this file is not tested (absolute paths). # -OUTPUT_REQUIRED_FILES( - ${Complex_SOURCE_DIR}/Executable/complex.cxx - ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) +output_required_files( + ${Complex_SOURCE_DIR}/Executable/complex.cxx + ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 1901d9914..27d70adc8 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -33,7 +33,7 @@ int cm_failed = 0; void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") { - std::cout << "FAILED: " << Message << m2 << m3 << "\n"; + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; cm_failed++; } @@ -41,7 +41,7 @@ void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") void cmPassed(const char* Message, const char* m2="") { - std::cout << "Passed: " << Message << m2 << "\n"; + std::cout << "Passed: " << Message << m2 << "\n"; cm_passed++; } @@ -67,7 +67,7 @@ void cmPassed(const char* Message, const char* m2="") // ====================================================================== -void TestAndRemoveFile(const char* filename) +void TestAndRemoveFile(const char* filename) { struct stat st; if(stat(filename, &st) < 0) @@ -89,7 +89,7 @@ void TestAndRemoveFile(const char* filename) // ====================================================================== -void TestDir(const char* filename) +void TestDir(const char* filename) { struct stat st; if(stat(filename, &st) < 0 || !S_ISDIR(st.st_mode)) @@ -113,7 +113,7 @@ void ForceStringUse() std::string cachetest = CACHE_TEST_VAR_INTERNAL; v.push_back(cachetest); v2 = v; - std::string x(5,'x'); + std::string x(5,'x'); char buff[5]; x.copy(buff, 1, 0); x[0] = 'a'; @@ -165,7 +165,7 @@ int main() #else cmPassed("COMPILE_FLAGS did work with SET_TARGET_PROPERTIES"); #endif - + #ifdef ELSEIF_RESULT cmPassed("ELSEIF did work"); #else @@ -228,8 +228,8 @@ int main() #else cmPassed("CMAKE_IS_FUN is defined."); #endif - -#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) + +#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) cmPassed("Variable args for MACROs are working."); #else cmFailed("Variable args for MACROs are failing."); @@ -250,7 +250,7 @@ int main() #else cmPassed("CMake found the parent directory properly"); #endif - + // ---------------------------------------------------------------------- // Test GET_DIRECTORY_PROPERTY for listfiles #ifndef CMAKE_FOUND_LISTFILE_STACK @@ -258,7 +258,7 @@ int main() #else cmPassed("CMake found the listfile stack properly"); #endif - + // ---------------------------------------------------------------------- // Test SET, VARIABLE_REQUIRES @@ -267,38 +267,38 @@ int main() #else cmPassed("SHOULD_NOT_BE_DEFINED is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED cmFailed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED is defined."); #endif - + #ifndef ONE_VAR cmFailed("cmakedefine is broken, ONE_VAR is not defined."); #else cmPassed("ONE_VAR is defined."); #endif - + #ifndef ONE_VAR_IS_DEFINED cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, " "ONE_VAR_IS_DEFINED is not defined."); #else cmPassed("ONE_VAR_IS_DEFINED is defined."); #endif - + #ifdef ZERO_VAR cmFailed("cmakedefine is broken, ZERO_VAR is defined."); #else cmPassed("ZERO_VAR is not defined."); #endif - + #ifndef STRING_VAR cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined."); #else if(strcmp(STRING_VAR, "CMake is great") != 0) { - cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", + cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", STRING_VAR); } else @@ -315,145 +315,145 @@ int main() #else cmPassed("SHOULD_NOT_BE_DEFINED_NOT is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_NOT cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_NOT is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_NOT2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_NOT2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_NOT2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_NOT2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_AND cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_AND is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_AND cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_AND is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_AND2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_AND2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_AND2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_AND2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_OR cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_OR is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_OR cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_OR is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_OR2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_OR2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_OR2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_OR2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_MATCHES cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_MATCHES cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_MATCHES is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_MATCHES2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_MATCHES2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_MATCHES2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_COMMAND cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_COMMAND cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_COMMAND is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_COMMAND2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_COMMAND2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_COMMAND2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_EXISTS cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_EXISTS cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_EXISTS is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_EXISTS2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_EXISTS2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_EXISTS2 is defined."); #endif - + #ifndef SHOULD_BE_DEFINED_IS_DIRECTORY cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_IS_DIRECTORY is not defined.\n"); #else @@ -471,31 +471,31 @@ int main() #else cmPassed("SHOULD_NOT_BE_DEFINED_LESS is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_LESS cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_LESS is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_LESS2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_LESS2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_LESS2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_LESS2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_LESS2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_GREATER cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_EQUAL cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined."); #else @@ -513,67 +513,67 @@ int main() #else cmPassed("SHOULD_BE_DEFINED_GREATER is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_GREATER2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_GREATER2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_GREATER2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRLESS cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRLESS cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRLESS is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRLESS2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRLESS2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRLESS2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRGREATER cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRGREATER is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRGREATER2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRGREATER2 is defined."); #endif - + // ---------------------------------------------------------------------- // Test FOREACH @@ -624,7 +624,7 @@ int main() // ---------------------------------------------------------------------- // Test WHILE - + if(WHILE_VALUE != 1000) { cmFailed("WHILE command is not working"); @@ -814,7 +814,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); - + // ---------------------------------------------------------------------- // A directory has been created. @@ -890,7 +890,7 @@ int main() #else if(strcmp(FILE_COMPILE_FLAGS, "-foo -bar") != 0) { - cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", + cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", FILE_COMPILE_FLAGS); } else @@ -908,7 +908,7 @@ int main() std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n"; if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) { - cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", + cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir"); } else @@ -937,7 +937,7 @@ int main() { cmFailed("REMOVE is not working"); } - + // ---------------------------------------------------------------------- // Test SEPARATE_ARGUMENTS if(strcmp("a;b;c", TEST_SEP) == 0) @@ -948,7 +948,7 @@ int main() { cmFailed("SEPARATE_ARGUMENTS is not working"); } - + // ---------------------------------------------------------------------- // Test Escape Quotes if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0) @@ -959,8 +959,8 @@ int main() { cmFailed("ESCAPE_QUOTES is not working"); } - - + + // ---------------------------------------------------------------------- // Test if IF command inside a FOREACH works. #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) @@ -981,7 +981,7 @@ int main() else { cmFailed("cmakedefine01 is not working for 0"); - } + } if(SHOULD_BE_ONE == 1) { cmPassed("cmakedefine01 is working for 1"); @@ -989,7 +989,7 @@ int main() else { cmFailed("cmakedefine01 is not working for 1"); - } + } #ifdef FORCE_TEST cmFailed("CMake SET CACHE FORCE"); #else diff --git a/Tests/Complex/Executable/testcflags.c b/Tests/Complex/Executable/testcflags.c index f4d584844..6c2dd5db3 100644 --- a/Tests/Complex/Executable/testcflags.c +++ b/Tests/Complex/Executable/testcflags.c @@ -18,7 +18,7 @@ int TestCFlags(char* m) return 0; #endif /* TEST_C_FLAGS should be defined in a c file */ -#ifndef TEST_C_FLAGS +#ifndef TEST_C_FLAGS strcpy(m, "CMake CMAKE_C_FLAGS (TEST_C_FLAGS) not found in c file."); return 0; #endif diff --git a/Tests/Complex/Library/CMakeLists.txt b/Tests/Complex/Library/CMakeLists.txt index c8efc3022..5c430523e 100644 --- a/Tests/Complex/Library/CMakeLists.txt +++ b/Tests/Complex/Library/CMakeLists.txt @@ -1,90 +1,90 @@ -REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) +remove_definitions(-DCMAKE_IS_REALLY_FUN) # # Small utility used to create file # UTILITY_SOURCE is used for coverage and for getting the exact name # of the executable. # -UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx) -ADD_EXECUTABLE(create_file create_file.cxx) -SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") +utility_source(CREATE_FILE_EXE create_file "." create_file.cxx) +add_executable(create_file create_file.cxx) +set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") # # Create static library # SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage # -AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources) -SET(LibrarySources ${LibrarySources} - file2 - empty - create_file.cxx - GENERATED +aux_source_directory(ExtraSources LibrarySources) +set(LibrarySources ${LibrarySources} + file2 + empty + create_file.cxx + GENERATED nonexisting_file) -REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) -ADD_LIBRARY(CMakeTestLibrary ${LibrarySources}) +remove(LibrarySources create_file.cxx GENERATED nonexisting_file) +add_library(CMakeTestLibrary ${LibrarySources}) -IF(WIN32) - IF(NOT CYGWIN) - IF(NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(CMakeTestLibrary - debug +if(WIN32) + if(NOT CYGWIN) + if(NOT BORLAND) + if(NOT MINGW) + target_link_libraries(CMakeTestLibrary + debug user32.lib) - TARGET_LINK_LIBRARIES(CMakeTestLibrary - optimized + target_link_libraries(CMakeTestLibrary + optimized kernel32.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) - ENDIF(NOT CYGWIN) -ENDIF(WIN32) + endif() + endif() + endif() +endif() # # Create shared library # -SET(SharedLibrarySources sharedFile) -ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) -DEFINE_PROPERTY( +set(SharedLibrarySources sharedFile) +add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +add_library(CMakeTestCLibraryShared SHARED testConly.c) +define_property( TARGET PROPERTY FOO BRIEF_DOCS "a test property" FULL_DOCS "A simple etst proerty that means nothign and is used for nothing" ) -SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR) -IF(NOT BEOS AND NOT WIN32) # No libm on BeOS. - SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -ENDIF(NOT BEOS AND NOT WIN32) -GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO) -IF(${FOO_BAR_VAR} MATCHES "BAR") -ELSE(${FOO_BAR_VAR} MATCHES "BAR") - MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -ENDIF(${FOO_BAR_VAR} MATCHES "BAR") +set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) +if(NOT BEOS AND NOT WIN32) # No libm on BeOS. + set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") +endif() +get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) +if(${FOO_BAR_VAR} MATCHES "BAR") +else() + message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") +endif() # Create static and shared lib of same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c) - ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c) - SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_library(CMakeTestLinkStatic STATIC TestLink.c) + add_library(CMakeTestLinkShared SHARED TestLink.c) + set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # # Attach pre-build/pre-link/post-build custom-commands to the lib. # Each runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_DEPENDENCIES(CMakeTestLibraryShared create_file) -MESSAGE("complex bin dir is ${Complex_BINARY_DIR}") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_dependencies(CMakeTestLibraryShared create_file) +message("complex bin dir is ${Complex_BINARY_DIR}") +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Library/postbuild.txt" @@ -95,46 +95,46 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD # It runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_CUSTOM_TARGET(custom_target1 +add_custom_target(custom_target1 ALL - ${CREATE_FILE_EXE} + ${CREATE_FILE_EXE} "${Complex_BINARY_DIR}/Library/custom_target1.txt") -ADD_DEPENDENCIES(custom_target1 create_file) +add_dependencies(custom_target1 create_file) # # Extra coverage # -SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1) +set_source_files_properties(file2 PROPERTIES ABSTRACT 1) -INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) -INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) # Test creating a library that is not built by default. -ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) +add_library(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) # Create an imported target for if(TARGET) test in Executable dir. # That test should not see this target. -ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED) +add_library(LibImportedTarget UNKNOWN IMPORTED) # Test generation of preprocessed sources. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) - IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) +if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + if(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) # Skip running this part of the test on certain platforms # until they are fixed. - SET(MAYBE_ALL ALL) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) - IF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL ALL) + list(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) + if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. - SET(MAYBE_ALL) - ENDIF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL) + endif() # Custom target to try preprocessing invocation. - ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL} + add_custom_target(test_preprocess ${MAYBE_ALL} COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif() +endif() diff --git a/Tests/Complex/Library/create_file.cxx b/Tests/Complex/Library/create_file.cxx index d41551980..050ed0bac 100644 --- a/Tests/Complex/Library/create_file.cxx +++ b/Tests/Complex/Library/create_file.cxx @@ -8,7 +8,7 @@ int main (int argc, char *argv[]) fprintf(stderr, "Missing name of file to create.\n"); return EXIT_FAILURE; } - + FILE *stream = fopen(argv[1], "w"); if(stream == NULL) { @@ -23,6 +23,6 @@ int main (int argc, char *argv[]) } fprintf(stdout, ">> Creating %s!\n", argv[1]); - + return EXIT_SUCCESS; } diff --git a/Tests/Complex/Library/testConly.c b/Tests/Complex/Library/testConly.c index 2d83f778e..a7d20b0b5 100644 --- a/Tests/Complex/Library/testConly.c +++ b/Tests/Complex/Library/testConly.c @@ -7,7 +7,7 @@ int CsharedFunction() printf("TEST_C_FLAGS failed\n"); return 0; #else - printf("Passed: TEST_C_FLAGS passed\n"); -#endif + printf("Passed: TEST_C_FLAGS passed\n"); +#endif return 1; } diff --git a/Tests/Complex/Library/testConly.h b/Tests/Complex/Library/testConly.h index f1470a8d7..ba8458923 100644 --- a/Tests/Complex/Library/testConly.h +++ b/Tests/Complex/Library/testConly.h @@ -10,4 +10,4 @@ #endif CMakeTest_EXPORT int CsharedFunction(); - + diff --git a/Tests/Complex/Library/test_preprocess.cmake b/Tests/Complex/Library/test_preprocess.cmake index d2d9fc652..4c8ec2174 100644 --- a/Tests/Complex/Library/test_preprocess.cmake +++ b/Tests/Complex/Library/test_preprocess.cmake @@ -1,7 +1,7 @@ -SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i) -FILE(READ ${TEST_FILE} CONTENTS) -IF("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(STATUS "${TEST_FILE} created successfully!") -ELSE("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!") -ENDIF("${CONTENTS}" MATCHES "Unable to close") +set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) +file(READ ${TEST_FILE} CONTENTS) +if("${CONTENTS}" MATCHES "Unable to close") + message(STATUS "${TEST_FILE} created successfully!") +else() + message(FATAL_ERROR "${TEST_FILE} creation failed!") +endif() diff --git a/Tests/Complex/VarTests.cmake b/Tests/Complex/VarTests.cmake index c146d1be0..52ec1fc8e 100644 --- a/Tests/Complex/VarTests.cmake +++ b/Tests/Complex/VarTests.cmake @@ -1,198 +1,198 @@ # # Test SET # -SET (ZERO_VAR 0) -SET (ZERO_VAR2 0) +set (ZERO_VAR 0) +set (ZERO_VAR2 0) -IF(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED) -ELSE(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED) -ENDIF(ZERO_VAR) +if(ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED) +else() + add_definitions(-DSHOULD_BE_DEFINED) +endif() -SET(ONE_VAR 1) -SET(ONE_VAR2 1) -SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") +set(ONE_VAR 1) +set(ONE_VAR2 1) +set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") # # Test VARIABLE_REQUIRES # -VARIABLE_REQUIRES(ONE_VAR +variable_requires(ONE_VAR ONE_VAR_IS_DEFINED ONE_VAR) # # Test various IF/ELSE combinations # -IF(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT) -ELSE(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT) -ENDIF(NOT ZERO_VAR) - -IF(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2) -ELSE(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2) -ENDIF(NOT ONE_VAR) - -IF(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND) -ELSE(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND) -ENDIF(ONE_VAR AND ONE_VAR2) - -IF(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2) -ELSE(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2) -ENDIF(ONE_VAR AND ZERO_VAR) - -IF(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR) -ELSE(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR) -ENDIF(ZERO_VAR OR ONE_VAR2) - -IF(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2) -ELSE(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2) -ENDIF(ZERO_VAR OR ZERO_VAR2) - -IF(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES) -ELSE(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES) -ENDIF(STRING_VAR MATCHES "^CMake") - -IF(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -ELSE(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2) -ENDIF(STRING_VAR MATCHES "^foo") - -IF(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND) -ELSE(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND) -ENDIF(COMMAND "IF") - -IF(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -ELSE(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2) -ENDIF(COMMAND "ROQUEFORT") - -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS) -ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - -IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - -IF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - -IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - -SET (SNUM1_VAR "1") -SET (SNUM2_VAR "2") -SET (SNUM3_VAR "1") - - -IF (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS) -ELSE (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS) -ENDIF (SNUM1_VAR LESS SNUM2_VAR) - -IF (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2) -ELSE (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2) -ENDIF (SNUM2_VAR LESS SNUM1_VAR) - -IF (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER) -ELSE (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER) -ENDIF (SNUM2_VAR GREATER SNUM1_VAR) - -IF (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ELSE (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ENDIF (SNUM2_VAR EQUAL SNUM1_VAR) - -IF (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ELSE (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ENDIF (SNUM3_VAR EQUAL SNUM1_VAR) - -IF (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2) -ELSE (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2) -ENDIF (SNUM1_VAR GREATER SNUM2_VAR) - -SET (SSTR1_VAR "abc") -SET (SSTR2_VAR "bcd") - -IF (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS) -ELSE (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS) -ENDIF (SSTR1_VAR STRLESS SSTR2_VAR) - -IF (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -ELSE (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2) -ENDIF (SSTR2_VAR STRLESS SSTR1_VAR) - -IF (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER) -ELSE (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR) - -IF (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -ELSE (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2) -ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR) +if(NOT ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED_NOT) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) +endif() + +if(NOT ONE_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) +else() + add_definitions(-DSHOULD_BE_DEFINED_NOT2) +endif() + +if(ONE_VAR AND ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_AND) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) +endif() + +if(ONE_VAR AND ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) +else() + add_definitions(-DSHOULD_BE_DEFINED_AND2) +endif() + +if(ZERO_VAR OR ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_OR) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) +endif() + +if(ZERO_VAR OR ZERO_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) +else() + add_definitions(-DSHOULD_BE_DEFINED_OR2) +endif() + +if(STRING_VAR MATCHES "^CMake") + add_definitions(-DSHOULD_BE_DEFINED_MATCHES) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) +endif() + +if(STRING_VAR MATCHES "^foo") + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) +else() + add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) +endif() + +if(COMMAND "IF") + add_definitions(-DSHOULD_BE_DEFINED_COMMAND) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) +endif() + +if(COMMAND "ROQUEFORT") + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) +else() + add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) +endif() + +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_EXISTS) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) +endif () + +if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) +else() + add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) +endif () + +if (IS_DIRECTORY ${Complex_SOURCE_DIR}) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) +endif () + +if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) +endif () + +set (SNUM1_VAR "1") +set (SNUM2_VAR "2") +set (SNUM3_VAR "1") + + +if (SNUM1_VAR LESS SNUM2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_LESS) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) +endif () + +if (SNUM2_VAR LESS SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) +else () + add_definitions(-DSHOULD_BE_DEFINED_LESS2) +endif () + +if (SNUM2_VAR GREATER SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_GREATER) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) +endif () + +if (SNUM2_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +else () + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +endif () + +if (SNUM3_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +endif () + +if (SNUM1_VAR GREATER SNUM2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) +else () + add_definitions(-DSHOULD_BE_DEFINED_GREATER2) +endif () + +set (SSTR1_VAR "abc") +set (SSTR2_VAR "bcd") + +if (SSTR1_VAR STRLESS SSTR2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRLESS) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) +endif () + +if (SSTR2_VAR STRLESS SSTR1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) +else () + add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) +endif () + +if (SSTR2_VAR STRGREATER SSTR1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) +endif () + +if (SSTR1_VAR STRGREATER SSTR2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) +else () + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) +endif () # # Test FOREACH # -FOREACH (INDEX 1 2) - SET(FOREACH_VAR${INDEX} "VALUE${INDEX}") -ENDFOREACH(INDEX) +foreach (INDEX 1 2) + set(FOREACH_VAR${INDEX} "VALUE${INDEX}") +endforeach() -SET(FOREACH_CONCAT "") -FOREACH (INDEX a;b;c;d;e;f;g) - SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -ENDFOREACH(INDEX) +set(FOREACH_CONCAT "") +foreach (INDEX a;b;c;d;e;f;g) + set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") +endforeach() # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations # -FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) +find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) +get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) +get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) +get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) +get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) +get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) -FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME) +find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) +get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/ComplexOneConfig/CMakeLists.txt b/Tests/ComplexOneConfig/CMakeLists.txt index b50501905..b0748fe3d 100644 --- a/Tests/ComplexOneConfig/CMakeLists.txt +++ b/Tests/ComplexOneConfig/CMakeLists.txt @@ -1,296 +1,296 @@ # # A more complex test case # -SET(CMAKE_BACKWARDS_COMPATIBILITY 1.4) -PROJECT (Complex) +set(CMAKE_BACKWARDS_COMPATIBILITY 1.4) +project (Complex) # Try setting a new policy. The IF test is for coverage. -IF(POLICY CMP0003) - CMAKE_POLICY(SET CMP0003 NEW) +if(POLICY CMP0003) + cmake_policy(SET CMP0003 NEW) - CMAKE_POLICY(GET CMP0003 P3) - IF(NOT "${P3}" STREQUAL "NEW") - MESSAGE(FATAL_ERROR "CMAKE_POLICY(GET) did not report NEW!") - ENDIF(NOT "${P3}" STREQUAL "NEW") -ENDIF(POLICY CMP0003) + cmake_policy(GET CMP0003 P3) + if(NOT "${P3}" STREQUAL "NEW") + message(FATAL_ERROR "cmake_policy(GET) did not report NEW!") + endif() +endif() # Test building without per-rule echo lines in Makefiles. -SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES OFF) +set_property(GLOBAL PROPERTY RULE_MESSAGES OFF) -SET(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") +set(CPACK_SOURCE_IGNORE_FILES "~$;\\.cvsignore$;^C:/hoffman/My Builds/testcase.*/CVS/;^C:/hoffman/My Builds/testcase.*/\\.svn/;^C:/hoffman/My Builds/testcase.*/sweigart/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/eos2001/;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_tables_new/;^C:/hoffman/My Builds/testcase/COPYING$;^C:/hoffman/My Builds/testcase/INSTALL$;^C:/hoffman/My Builds/testcase/Makefile$;^C:/hoffman/My Builds/testcase/Makefile\\.in$;^C:/hoffman/My Builds/testcase/.*\\.lo$;^C:/hoffman/My Builds/testcase/.*\\.la$;^C:/hoffman/My Builds/testcase/mkinstalldirs$;^C:/hoffman/My Builds/testcase/missing$;^C:/hoffman/My Builds/testcase/ltmain\\.sh$;^C:/hoffman/My Builds/testcase/libtool$;^C:/hoffman/My Builds/testcase/install-sh$;^C:/hoffman/My Builds/testcase/configure$;^C:/hoffman/My Builds/testcase/config\\.sub$;^C:/hoffman/My Builds/testcase/config\\.status$;^C:/hoffman/My Builds/testcase/config\\.log$;^C:/hoffman/My Builds/testcase/config\\.guess$;^C:/hoffman/My Builds/testcase/autom4te\\.cache$;^C:/hoffman/My Builds/testcase/aclocal\\.m4$;^C:/hoffman/My Builds/testcase/depcomp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.075\\.model_cassisi_eos1_10_corr$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model_cassisi_scvh$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.rgbtip\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.zahb\\.modelc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/0\\.085\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.mem$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange\\.tex\\.bak$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j16\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j26\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/j36\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k10\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k12\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k20\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k22\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k30\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/k32\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/1_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/2_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/linear_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/noexchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/nr_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dgamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/series_exchange_dlnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_JNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Jseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_KNR_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_Kseries_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check34_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check35_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check36_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check43_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check44_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check45_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check46_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check47_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check48_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/Makefile$;^C:/hoffman/My Builds/testcase/www/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/.*\\.flc$;^C:/hoffman/My Builds/testcase/src/Makefile$;^C:/hoffman/My Builds/testcase/src/Makefile\\.in$;^C:/hoffman/My Builds/testcase/src/\\.deps$;^C:/hoffman/My Builds/testcase/src/\\.libs$;^C:/hoffman/My Builds/testcase/src/.*\\.la$;^C:/hoffman/My Builds/testcase/src/.*\\.lo$;^C:/hoffman/My Builds/testcase/src/make\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/statef.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.1\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/0\\.3\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_15$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/1\\.0\\.model_rel$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/hot_post_agb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgb_tip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/rgbtip\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/start_shellflash\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/white_dwarf\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_13$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.1\\.0\\.model_23$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/model-loci/zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/15lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23gamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fermi_dirac_approx/23lnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/thermodynamic_consistency/.*\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_fit\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/3order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/5order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/8order_data\\.tex$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check8_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check5_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/effoo_check3_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda15lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23gamma1\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/fda23lnp\\.yplot$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/thermodynamic_consistency/tc\\.results$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_compare_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/opal_solar_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/opal_solar/statef_opal_model_1995\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/include/Makefile\\.in$;^C:/hoffman/My Builds/testcase/include/Makefile$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/0\\.1\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_eos1a-eos1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/1\\.0\\.model_pteh$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_0\\.1\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_eos1a-eos1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/model-loci/statef_model_1\\.0\\.model_pteh\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/fort\\.91$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/thermodynamic_consistency/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/oldversion_grid$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2005Ap&SS\\.298\\.\\.135S\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/2007Ap&SS\\.307\\.\\.263C\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/astro-ph\\.9909168_eprint_submitted_to_High_Press\\.Res\\.16,331\\.pdf$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/convergence\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/statef_grid-newversion$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/purehe_context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/old$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/make\\.out.*$;^C:/hoffman/My Builds/testcase/utils/.*\\.flc$;^C:/hoffman/My Builds/testcase/utils/Makefile$;^C:/hoffman/My Builds/testcase/utils/Makefile\\.in$;^C:/hoffman/My Builds/testcase/utils/\\.deps$;^C:/hoffman/My Builds/testcase/utils/\\.libs$;^C:/hoffman/My Builds/testcase/utils/.*\\.la$;^C:/hoffman/My Builds/testcase/utils/.*\\.lo$;^C:/hoffman/My Builds/testcase/utils/free_eos_test$;^C:/hoffman/My Builds/testcase/utils/test_rosenbrock$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check1\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check5\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_check8\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/eff_checknr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/eff_check/effoo_check3\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence_20070613$;^C:/hoffman/My Builds/testcase/www/eospaper/text$;^C:/hoffman/My Builds/testcase/www/eospaper/cassisi_book_fig$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.1\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/2\\.0\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.2\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.3\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.4\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.5\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/1\\.6\\.0$;^C:/hoffman/My Builds/testcase/www/eospaper/figures$;^C:/hoffman/My Builds/testcase/www/eospaper/old$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.ps.*$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/context\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/nocoulomb_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dgamma1_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/pteh_dlnp_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/make\\.out.*$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_JNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Jseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_KNR\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_Kseries\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check34\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check35\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check36\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check44\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check45\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/exchange_check46\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_1_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_2_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_linear_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_nr_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/statef_compare_series_exchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/series_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/nr_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/linear_exchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/noexchange_dgamma1\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/1_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/exchange_check/2_exchange_dlnp\\.gnuplot$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/convergence/pureh_newversion_grid/.*\\.err$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dgamma1$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/dlnp$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/dhtau/statef_compare\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.1\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_0\\.3\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_linear\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_noexchange\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.model_nr\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.rgbtip\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/statef_model_1\\.0\\.zahb\\.model\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.zahb\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.rgbtip\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_linear$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_noexchange$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model_nr$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.1\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/1\\.0\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/model-loci/0\\.3\\.model$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/contour\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/eos_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/exchange/context/statef_grid\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/delta\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos1gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/eff_fit/rho-T-loci/gong/m0085eos2gong\\.ascii$;^C:/hoffman/My Builds/testcase/www/eospaper/coulomb/coulomb_adjust/coulomb_adjust\\.out$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.ps$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/.*\\.pyc$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/head\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/body\\.tmp$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/prior-dvi\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.aux$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.log$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/solution\\.dvi$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/rtc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/tc_yplot\\.in$;^C:/hoffman/My Builds/testcase/www/eospaper/solution/make\\.out.*$") # # Define a macro # -MACRO(ASSERT value msg) - IF (NOT ${value}) - MESSAGE ("Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(ASSERT) - +macro(ASSERT value msg) + if (NOT ${value}) + message ("Assertion failure:" ${msg} ) + endif () +endmacro() + # invoke the macro ASSERT(Complex_BINARY_DIR "The PROJECT command is broken") # # Define a var args macro, it must take two or four args # -MACRO(TEST_ARGC value1 value2) - ADD_DEFINITIONS(${value1} ${value2}) - IF (${ARGC} MATCHES 4) - ADD_DEFINITIONS(${ARGV2} ${ARGV3}) - ENDIF (${ARGC} MATCHES 4) -ENDMACRO(TEST_ARGC) - +macro(TEST_ARGC value1 value2) + add_definitions(${value1} ${value2}) + if (${ARGC} MATCHES 4) + add_definitions(${ARGV2} ${ARGV3}) + endif () +endmacro() + # invoke the macro TEST_ARGC(-DCMAKE_ARGV1 -DCMAKE_ARGV2 -DCMAKE_ARGV3 -DCMAKE_ARGV4) -MACRO(TEST_VAR_ARG fa) - IF("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(STATUS "ARGV works") - ELSE("${ARGV}" MATCHES "^1;2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") - ENDIF("${ARGV}" MATCHES "^1;2;3$") - IF("${ARGN}" MATCHES "^2;3$") - MESSAGE(STATUS "ARGN works") - ELSE("${ARGN}" MATCHES "^2;3$") - MESSAGE(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") - ENDIF("${ARGN}" MATCHES "^2;3$") -ENDMACRO(TEST_VAR_ARG) +macro(TEST_VAR_ARG fa) + if("${ARGV}" MATCHES "^1;2;3$") + message(STATUS "ARGV works") + else() + message(FATAL_ERROR "ARGV does not work; got \"${ARGV}\" instead of \"1;2;3\"") + endif() + if("${ARGN}" MATCHES "^2;3$") + message(STATUS "ARGN works") + else() + message(FATAL_ERROR "ARGV does not work; got \"${ARGN}\" instead of \"2;3\"") + endif() +endmacro() TEST_VAR_ARG(1 2 3) # Floating-point comparison test. -IF(2.4 LESS 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 LESS 2.4") -ENDIF(2.4 LESS 2.4) -IF(2.4 GREATER 2.4) - MESSAGE(FATAL_ERROR "Failed: 2.4 GREATER 2.4") -ENDIF(2.4 GREATER 2.4) -IF(NOT 2.4 EQUAL 2.4) - MESSAGE(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") -ENDIF(NOT 2.4 EQUAL 2.4) - -IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") - ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) -ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") - - -ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ADD_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) -SET_PROPERTY(DIRECTORY +if(2.4 LESS 2.4) + message(FATAL_ERROR "Failed: 2.4 LESS 2.4") +endif() +if(2.4 GREATER 2.4) + message(FATAL_ERROR "Failed: 2.4 GREATER 2.4") +endif() +if(NOT 2.4 EQUAL 2.4) + message(FATAL_ERROR "Failed: NOT 2.4 EQUAL 2.4") +endif() + +if(CMAKE_SYSTEM MATCHES "OSF1-V.*") + if(NOT CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") + endif() +endif() + + +add_definitions(-DCMAKE_IS_FUN) +add_definitions(-DCMAKE_IS_REALLY_FUN) +set_property(DIRECTORY PROPERTY COMPILE_DEFINITIONS_RELEASE CMAKE_IS_FUN_IN_RELEASE_MODE ) -SET(TEST_SEP "a b c") -SEPARATE_ARGUMENTS(TEST_SEP) +set(TEST_SEP "a b c") +separate_arguments(TEST_SEP) # # Include vars from a file and from a cache # -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - INCLUDE(${Complex_SOURCE_DIR}/VarTests.cmake) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) -INCLUDE(fileshouldnotbehere OPTIONAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + include(${Complex_SOURCE_DIR}/VarTests.cmake) +endif () +include(fileshouldnotbehere OPTIONAL) +load_cache(${Complex_SOURCE_DIR}/Cache EXCLUDE CACHE_TEST_VAR_EXCLUDED INCLUDE_INTERNALS CACHE_TEST_VAR_INTERNAL) -LOAD_CACHE(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) -IF(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE("Load cache worked: ${fooCACHE_TEST_VAR2}") -ELSE(${fooCACHE_TEST_VAR2} MATCHES bar) - MESSAGE(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") -ENDIF(${fooCACHE_TEST_VAR2} MATCHES bar) +load_cache(${Complex_SOURCE_DIR}/Cache READ_WITH_PREFIX foo CACHE_TEST_VAR2) +if(${fooCACHE_TEST_VAR2} MATCHES bar) + message("Load cache worked: ${fooCACHE_TEST_VAR2}") +else() + message(FATAL_ERROR "Load cache with prefix failed: ${fooCACHE_TEST_VAR2}") +endif() # -# Specify include and lib dirs +# Specify include and lib dirs # (BEFORE is for coverage) # -INCLUDE_DIRECTORIES( +include_directories( Library ) -INCLUDE_DIRECTORIES(BEFORE +include_directories(BEFORE ${Complex_BINARY_DIR} ) -INCLUDE_DIRECTORIES(SYSTEM Library/SystemDir) +include_directories(SYSTEM Library/SystemDir) -INCLUDE_REGULAR_EXPRESSION("^(cmTest|file|sharedFile|test).*$" "^cmMissing") +include_regular_expression("^(cmTest|file|sharedFile|test).*$" "^cmMissing") -LINK_DIRECTORIES( +link_directories( ${Complex_BINARY_DIR}/Library ) # # check for SET CACHE FORCE # -SET(FORCE_TEST 1 CACHE STRING "a test") -SET(FORCE_TEST 0 CACHE STRING "a test" FORCE) +set(FORCE_TEST 1 CACHE STRING "a test") +set(FORCE_TEST 0 CACHE STRING "a test" FORCE) # # Lib and exe path # -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib/static") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${Complex_BINARY_DIR}/bin") -MESSAGE (Test " " escape " " semi-colon " " \; \;) +message (Test " " escape " " semi-colon " " \; \;) # # Exec program (TODO: test a result) # Increase coverage. # -MESSAGE("\nIgnore this message") -OPTION(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) -IF (NOT NO_EXEC_PROGRAM) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") -ELSE (NOT NO_EXEC_PROGRAM) - MESSAGE("Set this option ON") -ENDIF (NOT NO_EXEC_PROGRAM) +message("\nIgnore this message") +option(NO_EXEC_PROGRAM "Do not test EXEC_PROGRAM" 0) +if (NOT NO_EXEC_PROGRAM) + exec_program(${CMAKE_COMMAND} ARGS -E echo NO_EXEC_PROGRAM "${Complex_BINARY_DIR}") +else () + message("Set this option ON") +endif () -MARK_AS_ADVANCED(NO_EXEC_PROGRAM) -MARK_AS_ADVANCED(CLEAR NO_EXEC_PROGRAM) +mark_as_advanced(NO_EXEC_PROGRAM) +mark_as_advanced(CLEAR NO_EXEC_PROGRAM) # Execute a process. Add coverage for this command. -EXECUTE_PROCESS( +execute_process( COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" OUTPUT_VARIABLE TEST_OUT ) -IF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") -ELSE("${TEST_OUT}" MATCHES "^ABCDEFG\n$") - MESSAGE(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") -ENDIF("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +if("${TEST_OUT}" MATCHES "^ABCDEFG\n$") +else() + message(SEND_ERROR "EXECUTE_PROCESS output test failed: [${TEST_OUT}]") +endif() # This test has some problems on UNIX systems. Disabling for now. # -# EXECUTE_PROCESS( +# execute_process( # COMMAND ${CMAKE_COMMAND} -E echo "ABCDEFG" # COMMAND /process/does/not/exist # OUTPUT_QUIET # ERROR_QUIET # RESULT_VARIABLE RESULT # ) -# IF("${RESULT}" MATCHES "^0$") -# MESSAGE(SEND_ERROR +# if("${RESULT}" MATCHES "^0$") +# message(SEND_ERROR # "EXECUTE_PROCESS result test failed with RESULT=[${RESULT}]") -# ELSE("${RESULT}" MATCHES "^0$") -# MESSAGE(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") -# ENDIF("${RESULT}" MATCHES "^0$") +# else() +# message(STATUS "EXECUTE_PROCESS result test passed with RESULT=[${RESULT}]") +# endif() # # Create directory. # The 'complex' executable will then test if this dir exists, # sadly it won't be able to remove it. # -MAKE_DIRECTORY("${Complex_BINARY_DIR}/make_dir") +make_directory("${Complex_BINARY_DIR}/make_dir") # # Test FIND_LIBARY # Create a dummy empty lib # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/dummylib.lib COPYONLY IMMEDIATE) -FOREACH (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) - CONFIGURE_FILE( +foreach (ext ${CMAKE_SHLIB_SUFFIX};.so;.a;.sl) + configure_file( ${Complex_SOURCE_DIR}/Library/dummy ${Complex_BINARY_DIR}/Library/libdummylib${ext} COPYONLY IMMEDIATE) -ENDFOREACH (ext) +endforeach () -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB dummylib PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") -FIND_LIBRARY(FIND_DUMMY_LIB +find_library(FIND_DUMMY_LIB NAMES dummylib dummylib2 PATHS ${Complex_BINARY_DIR}/Library DOC "find dummy lib") # -# Test SET_SOURCE_FILES_PROPERTIES +# Test SET_SOURCE_FILES_PROPERTIES # -SET_SOURCE_FILES_PROPERTIES(nonexisting_file2 - GENERATED - ABSTRACT - WRAP_EXCLUDE +set_source_files_properties(nonexisting_file2 + GENERATED + ABSTRACT + WRAP_EXCLUDE COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file2 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file2 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file2 COMPILE_FLAGS) -SET_SOURCE_FILES_PROPERTIES(nonexisting_file3 PROPERTIES +set_source_files_properties(nonexisting_file3 PROPERTIES GENERATED 1 ABSTRACT 1 WRAP_EXCLUDE 1 COMPILE_FLAGS "-foo -bar") -GET_SOURCE_FILE_PROPERTY(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) -GET_SOURCE_FILE_PROPERTY(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) -GET_SOURCE_FILE_PROPERTY(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) +get_source_file_property(FILE_HAS_ABSTRACT nonexisting_file3 ABSTRACT) +get_source_file_property(FILE_HAS_WRAP_EXCLUDE nonexisting_file3 WRAP_EXCLUDE) +get_source_file_property(FILE_COMPILE_FLAGS nonexisting_file3 COMPILE_FLAGS) # # Test registry (win32) # Create a file, put its path in a registry key, try to find the file in that # path using that registry key, then remove the file and the key # -IF (WIN32) - IF (NOT UNIX) - SET(dir "${Complex_BINARY_DIR}/registry_dir") - SET(file "registry_test_dummy") - SET(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") - CONFIGURE_FILE( +if (WIN32) + if (NOT UNIX) + set(dir "${Complex_BINARY_DIR}/registry_dir") + set(file "registry_test_dummy") + set(hkey "HKEY_CURRENT_USER\\Software\\Kitware\\CMake\\Tests\\Complex;registry_test") + configure_file( ${Complex_SOURCE_DIR}/Library/dummy "${dir}/${file}" COPYONLY IMMEDIATE) - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") - FIND_PATH(REGISTRY_TEST_PATH + exec_program(${CMAKE_COMMAND} ARGS "-E write_regv \"${hkey}\" \"${dir}\"") + find_path(REGISTRY_TEST_PATH ${file} "[${hkey}]" DOC "Registry_Test_Path") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") - EXEC_PROGRAM(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") - ENDIF (NOT UNIX) -ENDIF (WIN32) + exec_program(${CMAKE_COMMAND} ARGS "-E delete_regv \"${hkey}\"") + exec_program(${CMAKE_COMMAND} ARGS "-E remove \"${dir}/${file}\"") + endif () +endif () # # Test a set and a remove # -SET(REMOVE_STRING a b c d e f) -SET(removeVar1 c e) -REMOVE(REMOVE_STRING ${removeVar1} f) +set(REMOVE_STRING a b c d e f) +set(removeVar1 c e) +remove(REMOVE_STRING ${removeVar1} f) # # Test an IF inside a FOREACH. # -FOREACH(x "a") - IF(${x} MATCHES "a") +foreach(x "a") + if(${x} MATCHES "a") # Should always execute. - SET(IF_INSIDE_FOREACH_THEN_EXECUTED 1) - ELSE(${x} MATCHES "a") + set(IF_INSIDE_FOREACH_THEN_EXECUTED 1) + else() # Should never execute. - SET(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) - ENDIF(${x} MATCHES "a") -ENDFOREACH(x) + set(IF_INSIDE_FOREACH_ELSE_EXECUTED 1) + endif() +endforeach() # test WHILE command -SET (while_var 1) -WHILE (while_var LESS 1000) - SET(while_var ${while_var}0) -ENDWHILE(while_var LESS 1000) +set (while_var 1) +while (while_var LESS 1000) + set(while_var ${while_var}0) +endwhile() -SET(SHOULD_BE_ZERO ) -SET(SHOULD_BE_ONE 1) +set(SHOULD_BE_ZERO ) +set(SHOULD_BE_ONE 1) -# test elseif functionality, the mess below tries to catch problem +# test elseif functionality, the mess below tries to catch problem # of clauses being executed early or late etc set (RESULT 3) if (RESULT EQUAL 1) @@ -298,7 +298,7 @@ if (RESULT EQUAL 1) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) + endif () elseif (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) @@ -307,25 +307,25 @@ elseif (RESULT EQUAL 3) elseif (RESULT EQUAL 3) if (NOT ELSEIF_RESULT EQUAL 1) set (ELSEIF_RESULT 2) - endif (NOT ELSEIF_RESULT EQUAL 1) - endif (RESULT EQUAL 2) + endif () + endif () elseif (RESULT EQUAL 4) if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -else (RESULT EQUAL 1) + endif () +else () if (RESULT EQUAL 2) set (ELSEIF_RESULT 1) elseif (RESULT EQUAL 3) set (ELSEIF_RESULT 1) - endif (RESULT EQUAL 2) -endif (RESULT EQUAL 1) + endif () +endif () if (NOT ELSEIF_RESULT EQUAL 2) set (ELSEIF_RESULT 0) -endif (NOT ELSEIF_RESULT EQUAL 2) +endif () # test handling of parenthetical groups in conditionals if (2 GREATER 1 AND (4 LESS 3 OR 5 LESS 6) AND NOT (7 GREATER 8)) @@ -334,43 +334,43 @@ endif() # -# Configure file +# Configure file # (plug vars to #define so that they can be tested) # -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigure.h.in ${Complex_BINARY_DIR}/cmTestConfigure.h) -SET(STRING_WITH_QUOTES "\"hello world\"") +set(STRING_WITH_QUOTES "\"hello world\"") # test CONFIGURE_FILE with ESCAPE_QUOTES on -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/cmTestConfigureEscape.h.in ${Complex_BINARY_DIR}/cmTestConfigureEscape.h ESCAPE_QUOTES) # Test regular expression commands. -STRING(REGEX MATCH "b" RESULT "abc") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCH ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX MATCHALL "b" RESULT "abcb") -IF(NOT RESULT) - MESSAGE(SEND_ERROR "STRING(REGEX MATCHALL ... ) test failed.") -ENDIF(NOT RESULT) -STRING(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") -IF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") - SET(STRING_REGEX_PASSED 1) -ENDIF("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") -IF(NOT STRING_REGEX_PASSED) - MESSAGE(SEND_ERROR - "STRING(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") -ENDIF(NOT STRING_REGEX_PASSED) +string(REGEX MATCH "b" RESULT "abc") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCH ... ) test failed.") +endif() +string(REGEX MATCHALL "b" RESULT "abcb") +if(NOT RESULT) + message(SEND_ERROR "string(REGEX MATCHALL ... ) test failed.") +endif() +string(REGEX REPLACE ".([bd])." "[\\1]" RESULT "a(b)c(d)e") +if("x${RESULT}" MATCHES "^xa\\[b\\]c\\[d\\]e$") + set(STRING_REGEX_PASSED 1) +endif() +if(NOT STRING_REGEX_PASSED) + message(SEND_ERROR + "string(REGEX REPLACE ... ) test failed (\"${RESULT}\" v. \"a[b]c[d]e\")") +endif() # # Create the libs and the main exe # -ADD_SUBDIRECTORY(Library) -ADD_SUBDIRECTORY(Executable) -SUBDIR_DEPENDS(Executable Library) -EXPORT_LIBRARY_DEPENDENCIES(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) -INCLUDE(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) +add_subdirectory(Library) +add_subdirectory(Executable) +subdir_depends(Executable Library) +export_library_dependencies(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake) +include(${Complex_BINARY_DIR}/ComplexLibraryDepends.cmake OPTIONAL) diff --git a/Tests/ComplexOneConfig/Executable/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/CMakeLists.txt index 345836257..432dbf890 100644 --- a/Tests/ComplexOneConfig/Executable/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/CMakeLists.txt @@ -1,116 +1,116 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 1.3) +cmake_minimum_required(VERSION 1.3) # -# Create exe. +# Create exe. # -SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DTEST_CXX_FLAGS") +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") # Create an imported target for if(TARGET) test below. -ADD_LIBRARY(ExeImportedTarget UNKNOWN IMPORTED) +add_library(ExeImportedTarget UNKNOWN IMPORTED) # Test if(TARGET) command. -IF(NOT TARGET CMakeTestLibrary) - MESSAGE(FATAL_ERROR "IF(NOT TARGET CMakeTestLibrary) returned true!") -ENDIF(NOT TARGET CMakeTestLibrary) -IF(NOT TARGET ExeImportedTarget) - MESSAGE(FATAL_ERROR "IF(NOT TARGET ExeImportedTarget) returned true!") -ENDIF(NOT TARGET ExeImportedTarget) -IF(TARGET LibImportedTarget) - MESSAGE(FATAL_ERROR "IF(TARGET LibImportedTarget) returned true!") -ENDIF(TARGET LibImportedTarget) -IF(TARGET NotATarget) - MESSAGE(FATAL_ERROR "IF(TARGET NotATarget) returned true!") -ENDIF(TARGET NotATarget) - - # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to -SET(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) -LINK_LIBRARIES(${COMPLEX_LIBS}) +if(NOT TARGET CMakeTestLibrary) + message(FATAL_ERROR "if(NOT TARGET CMakeTestLibrary) returned true!") +endif() +if(NOT TARGET ExeImportedTarget) + message(FATAL_ERROR "if(NOT TARGET ExeImportedTarget) returned true!") +endif() +if(TARGET LibImportedTarget) + message(FATAL_ERROR "if(TARGET LibImportedTarget) returned true!") +endif() +if(TARGET NotATarget) + message(FATAL_ERROR "if(TARGET NotATarget) returned true!") +endif() + + # Use LINK_LIBRARIES instead of TARGET_LINK_LIBRARIES to +set(COMPLEX_LIBS CMakeTestLibrary;CMakeTestLibraryShared;CMakeTestCLibraryShared) +link_libraries(${COMPLEX_LIBS}) # Test forcing a .cxx file to not build. -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.cxx PROPERTIES +set_source_files_properties(complex_nobuild.cxx PROPERTIES HEADER_FILE_ONLY 1) # Test forcing a .c file to not build. # This makes sure a mixed language library is created # with header file only sources -SET_SOURCE_FILES_PROPERTIES(complex_nobuild.c PROPERTIES +set_source_files_properties(complex_nobuild.c PROPERTIES HEADER_FILE_ONLY 1) -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_EXECUTABLE(A A.cxx A.hh A.h A.txt) -ADD_CUSTOM_COMMAND(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) -ADD_EXECUTABLE(complex complex testcflags.c Aout.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_executable(A A.cxx A.hh A.h A.txt) +add_custom_command(OUTPUT Aout.h COMMAND A > Aout.h VERBATIM) +add_executable(complex complex testcflags.c Aout.h) # Sub1/NameConflictTest.c Sub2/NameConflictTest.c) -ADD_EXECUTABLE(complex.file complex.file.cxx complex_nobuild.cxx +add_executable(complex.file complex.file.cxx complex_nobuild.cxx complex_nobuild.c) -IF (UNIX) - TARGET_LINK_LIBRARIES(complex ${CMAKE_DL_LIBS}) -ELSE(UNIX) - IF (NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(complex rpcrt4.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) -ENDIF (UNIX) +if (UNIX) + target_link_libraries(complex ${CMAKE_DL_LIBS}) +else() + if (NOT BORLAND) + if(NOT MINGW) + target_link_libraries(complex rpcrt4.lib) + endif() + endif() +endif () # Test linking to static lib when a shared lib has the same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_DEFINITIONS(-DCOMPLEX_TEST_LINK_STATIC) - TARGET_LINK_LIBRARIES(complex CMakeTestLinkStatic) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_definitions(-DCOMPLEX_TEST_LINK_STATIC) + target_link_libraries(complex CMakeTestLinkStatic) +endif() # can we get the path to a source file -GET_SOURCE_FILE_PROPERTY(A_LOCATION A.cxx LOCATION) -IF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") - ADD_DEFINITIONS(-DCMAKE_FOUND_ACXX) -ENDIF ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") +get_source_file_property(A_LOCATION A.cxx LOCATION) +if ("${A_LOCATION}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/A.cxx") + add_definitions(-DCMAKE_FOUND_ACXX) +endif () # get the directory parent -GET_DIRECTORY_PROPERTY(P_VALUE PARENT_DIRECTORY) -IF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") - ADD_DEFINITIONS(-DCMAKE_FOUND_PARENT) -ENDIF ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") +get_directory_property(P_VALUE PARENT_DIRECTORY) +if ("${P_VALUE}" STREQUAL "${CMAKE_SOURCE_DIR}") + add_definitions(-DCMAKE_FOUND_PARENT) +endif () # get the stack of listfiles -INCLUDE(Included.cmake) -IF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") - ADD_DEFINITIONS(-DCMAKE_FOUND_LISTFILE_STACK) -ENDIF ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") +include(Included.cmake) +if ("${LF_VALUE}" STREQUAL "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt;${CMAKE_CURRENT_SOURCE_DIR}/Included.cmake") + add_definitions(-DCMAKE_FOUND_LISTFILE_STACK) +endif () # Test add/remove definitions. -ADD_DEFINITIONS( +add_definitions( -DCOMPLEX_DEFINED_PRE -DCOMPLEX_DEFINED -DCOMPLEX_DEFINED_POST -DCOMPLEX_DEFINED ) -REMOVE_DEFINITIONS(-DCOMPLEX_DEFINED) +remove_definitions(-DCOMPLEX_DEFINED) # Test pre-build/pre-link/post-build rules for an executable. -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex PRE_BUILD +add_custom_command(TARGET complex PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Executable/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET complex POST_BUILD +add_custom_command(TARGET complex POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Executable/postbuild.txt" "${Complex_BINARY_DIR}/Executable/postbuild2.txt") -SET_SOURCE_FILES_PROPERTIES(complex +set_source_files_properties(complex COMPILE_FLAGS "-DFILE_HAS_EXTRA_COMPILE_FLAGS" #" -DFILE_DEFINE_STRING=\\\"hello\\\"" OBJECT_DEPENDS ${Complex_BINARY_DIR}/cmTestGeneratedHeader.h ) -SET_TARGET_PROPERTIES(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") -ADD_CUSTOM_COMMAND( +set_target_properties(complex PROPERTIES COMPILE_FLAGS "-DCOMPLEX_TARGET_FLAG") +add_custom_command( TARGET complex SOURCE ${Complex_SOURCE_DIR}/cmTestGeneratedHeader.h.in COMMAND ${CMAKE_COMMAND} @@ -121,18 +121,18 @@ ADD_CUSTOM_COMMAND( ) # Test creating an executable that is not built by default. -ADD_EXECUTABLE(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) -TARGET_LINK_LIBRARIES(notInAllExe notInAllLib) +add_executable(notInAllExe EXCLUDE_FROM_ALL notInAllExe.cxx) +target_link_libraries(notInAllExe notInAllLib) # Test user-value flag mapping for the VS IDE. -IF(MSVC) - SET_TARGET_PROPERTIES(notInAllExe PROPERTIES +if(MSVC) + set_target_properties(notInAllExe PROPERTIES LINK_FLAGS "/NODEFAULTLIB:LIBC;LIBCMT;MSVCRT") -ENDIF(MSVC) +endif() # Test creating a custom target that builds not-in-all targets. -ADD_CUSTOM_TARGET(notInAllCustom) -ADD_DEPENDENCIES(notInAllCustom notInAllExe) +add_custom_target(notInAllCustom) +add_dependencies(notInAllCustom notInAllExe) # # Output the files required by 'complex' to a file. @@ -141,30 +141,30 @@ ADD_DEPENDENCIES(notInAllCustom notInAllExe) # has no side-effects on the current Makefile (duplicated source file # due to source list expansion done twice). # -ADD_SUBDIRECTORY(Temp) +add_subdirectory(Temp) -IF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) - ADD_EXECUTABLE(testSystemDir testSystemDir.cxx) - SET_TARGET_PROPERTIES(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") -ENDIF(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) +if(CMAKE_COMPILER_IS_GNUCXX AND CMAKE_INCLUDE_SYSTEM_FLAG_CXX) + add_executable(testSystemDir testSystemDir.cxx) + set_target_properties(testSystemDir PROPERTIES COMPILE_FLAGS "-Werror") +endif() # # Extra coverage.Not used. # -INSTALL_TARGETS(/tmp complex) -INSTALL_PROGRAMS(/tmp complex) +install_targets(/tmp complex) +install_programs(/tmp complex) -CONFIGURE_FILE( +configure_file( ${Complex_SOURCE_DIR}/Executable/cmVersion.h.in ${Complex_BINARY_DIR}/cmVersion.h) -SOURCE_GROUP(A_GROUP ".cxx") -SOURCE_GROUP(B_GROUP REGULAR_EXPRESSION "cxx") -SOURCE_GROUP(C_GROUP FILES complex.cxx) +source_group(A_GROUP ".cxx") +source_group(B_GROUP REGULAR_EXPRESSION "cxx") +source_group(C_GROUP FILES complex.cxx) -FILE(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") -FILE(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/A/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libB.a "test") +file(WRITE ${Complex_BINARY_DIR}/B/libA.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libC.a "test") +file(WRITE ${Complex_BINARY_DIR}/C/libB.a "test") diff --git a/Tests/ComplexOneConfig/Executable/Included.cmake b/Tests/ComplexOneConfig/Executable/Included.cmake index 2d1ea3e8c..520a68be1 100644 --- a/Tests/ComplexOneConfig/Executable/Included.cmake +++ b/Tests/ComplexOneConfig/Executable/Included.cmake @@ -1,2 +1,2 @@ -GET_DIRECTORY_PROPERTY(LF_VALUE LISTFILE_STACK) +get_directory_property(LF_VALUE LISTFILE_STACK) diff --git a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt index f00955029..041fcff20 100644 --- a/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Executable/Temp/CMakeLists.txt @@ -3,6 +3,6 @@ # The 'complex' executable will then test if this file exists and remove it. # The contents of this file is not tested (absolute paths). # -OUTPUT_REQUIRED_FILES( - ${Complex_SOURCE_DIR}/Executable/complex.cxx - ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) +output_required_files( + ${Complex_SOURCE_DIR}/Executable/complex.cxx + ${Complex_BINARY_DIR}/Executable/Temp/complex-required.txt) diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 1901d9914..27d70adc8 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -33,7 +33,7 @@ int cm_failed = 0; void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") { - std::cout << "FAILED: " << Message << m2 << m3 << "\n"; + std::cout << "FAILED: " << Message << m2 << m3 << "\n"; cm_failed++; } @@ -41,7 +41,7 @@ void cmFailed(const char* Message, const char* m2= "", const char* m3 = "") void cmPassed(const char* Message, const char* m2="") { - std::cout << "Passed: " << Message << m2 << "\n"; + std::cout << "Passed: " << Message << m2 << "\n"; cm_passed++; } @@ -67,7 +67,7 @@ void cmPassed(const char* Message, const char* m2="") // ====================================================================== -void TestAndRemoveFile(const char* filename) +void TestAndRemoveFile(const char* filename) { struct stat st; if(stat(filename, &st) < 0) @@ -89,7 +89,7 @@ void TestAndRemoveFile(const char* filename) // ====================================================================== -void TestDir(const char* filename) +void TestDir(const char* filename) { struct stat st; if(stat(filename, &st) < 0 || !S_ISDIR(st.st_mode)) @@ -113,7 +113,7 @@ void ForceStringUse() std::string cachetest = CACHE_TEST_VAR_INTERNAL; v.push_back(cachetest); v2 = v; - std::string x(5,'x'); + std::string x(5,'x'); char buff[5]; x.copy(buff, 1, 0); x[0] = 'a'; @@ -165,7 +165,7 @@ int main() #else cmPassed("COMPILE_FLAGS did work with SET_TARGET_PROPERTIES"); #endif - + #ifdef ELSEIF_RESULT cmPassed("ELSEIF did work"); #else @@ -228,8 +228,8 @@ int main() #else cmPassed("CMAKE_IS_FUN is defined."); #endif - -#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) + +#if defined(CMAKE_ARGV1) && defined(CMAKE_ARGV2) && defined(CMAKE_ARGV3) && defined(CMAKE_ARGV4) cmPassed("Variable args for MACROs are working."); #else cmFailed("Variable args for MACROs are failing."); @@ -250,7 +250,7 @@ int main() #else cmPassed("CMake found the parent directory properly"); #endif - + // ---------------------------------------------------------------------- // Test GET_DIRECTORY_PROPERTY for listfiles #ifndef CMAKE_FOUND_LISTFILE_STACK @@ -258,7 +258,7 @@ int main() #else cmPassed("CMake found the listfile stack properly"); #endif - + // ---------------------------------------------------------------------- // Test SET, VARIABLE_REQUIRES @@ -267,38 +267,38 @@ int main() #else cmPassed("SHOULD_NOT_BE_DEFINED is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED cmFailed("IF or SET is broken, SHOULD_BE_DEFINED is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED is defined."); #endif - + #ifndef ONE_VAR cmFailed("cmakedefine is broken, ONE_VAR is not defined."); #else cmPassed("ONE_VAR is defined."); #endif - + #ifndef ONE_VAR_IS_DEFINED cmFailed("cmakedefine, SET or VARIABLE_REQUIRES is broken, " "ONE_VAR_IS_DEFINED is not defined."); #else cmPassed("ONE_VAR_IS_DEFINED is defined."); #endif - + #ifdef ZERO_VAR cmFailed("cmakedefine is broken, ZERO_VAR is defined."); #else cmPassed("ZERO_VAR is not defined."); #endif - + #ifndef STRING_VAR cmFailed("the CONFIGURE_FILE command is broken, STRING_VAR is not defined."); #else if(strcmp(STRING_VAR, "CMake is great") != 0) { - cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", + cmFailed("the SET or CONFIGURE_FILE command is broken. STRING_VAR == ", STRING_VAR); } else @@ -315,145 +315,145 @@ int main() #else cmPassed("SHOULD_NOT_BE_DEFINED_NOT is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_NOT cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_NOT is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_NOT2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_NOT2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_NOT2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_NOT2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_NOT2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_NOT2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_AND cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_AND is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_AND cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_AND is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_AND2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_AND2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_AND2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_AND2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_AND2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_AND2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_OR cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_OR is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_OR cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_OR is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_OR2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_OR2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_OR2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_OR2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_OR2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_OR2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_MATCHES cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_MATCHES cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_MATCHES is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_MATCHES2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_MATCHES2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_MATCHES2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_MATCHES2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_MATCHES2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_MATCHES2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_COMMAND cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_COMMAND cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_COMMAND is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_COMMAND2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_COMMAND2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_COMMAND2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_COMMAND2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_COMMAND2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_COMMAND2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_EXISTS cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_EXISTS cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_EXISTS is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_EXISTS2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EXISTS2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_EXISTS2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_EXISTS2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_EXISTS2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_EXISTS2 is defined."); #endif - + #ifndef SHOULD_BE_DEFINED_IS_DIRECTORY cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_IS_DIRECTORY is not defined.\n"); #else @@ -471,31 +471,31 @@ int main() #else cmPassed("SHOULD_NOT_BE_DEFINED_LESS is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_LESS cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_LESS is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_LESS2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_LESS2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_LESS2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_LESS2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_LESS2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_LESS2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_GREATER cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_GREATER is not defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_EQUAL cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_EQUAL is defined."); #else @@ -513,67 +513,67 @@ int main() #else cmPassed("SHOULD_BE_DEFINED_GREATER is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_GREATER2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_GREATER2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_GREATER2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_GREATER2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_GREATER2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_GREATER2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRLESS cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRLESS cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRLESS is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRLESS2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRLESS2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRLESS2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRLESS2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRLESS2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRLESS2 is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRGREATER cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRGREATER is defined."); #endif - + #ifdef SHOULD_NOT_BE_DEFINED_STRGREATER2 cmFailed("IF or SET is broken, SHOULD_NOT_BE_DEFINED_STRGREATER2 is defined."); #else cmPassed("SHOULD_NOT_BE_DEFINED_STRGREATER2 is not defined."); #endif - + #ifndef SHOULD_BE_DEFINED_STRGREATER2 cmFailed("IF or SET is broken, SHOULD_BE_DEFINED_STRGREATER2 is not defined.\n"); #else cmPassed("SHOULD_BE_DEFINED_STRGREATER2 is defined."); #endif - + // ---------------------------------------------------------------------- // Test FOREACH @@ -624,7 +624,7 @@ int main() // ---------------------------------------------------------------------- // Test WHILE - + if(WHILE_VALUE != 1000) { cmFailed("WHILE command is not working"); @@ -814,7 +814,7 @@ int main() // only created during a build. TestAndRemoveFile(BINARY_DIR "/Library/custom_target1.txt"); - + // ---------------------------------------------------------------------- // A directory has been created. @@ -890,7 +890,7 @@ int main() #else if(strcmp(FILE_COMPILE_FLAGS, "-foo -bar") != 0) { - cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", + cmFailed("the SET_SOURCE_FILES_PROPERTIES or CONFIGURE_FILE command is broken. FILE_COMPILE_FLAGS == ", FILE_COMPILE_FLAGS); } else @@ -908,7 +908,7 @@ int main() std::cout << "REGISTRY_TEST_PATH == " << REGISTRY_TEST_PATH << "\n"; if(stricmp(REGISTRY_TEST_PATH, BINARY_DIR "/registry_dir") != 0) { - cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", + cmFailed("the 'read registry value' function or CONFIGURE_FILE command is broken. REGISTRY_TEST_PATH == ", REGISTRY_TEST_PATH, " is not " BINARY_DIR "/registry_dir"); } else @@ -937,7 +937,7 @@ int main() { cmFailed("REMOVE is not working"); } - + // ---------------------------------------------------------------------- // Test SEPARATE_ARGUMENTS if(strcmp("a;b;c", TEST_SEP) == 0) @@ -948,7 +948,7 @@ int main() { cmFailed("SEPARATE_ARGUMENTS is not working"); } - + // ---------------------------------------------------------------------- // Test Escape Quotes if(strcmp("\"hello world\"", STRING_WITH_QUOTES) == 0) @@ -959,8 +959,8 @@ int main() { cmFailed("ESCAPE_QUOTES is not working"); } - - + + // ---------------------------------------------------------------------- // Test if IF command inside a FOREACH works. #if defined(IF_INSIDE_FOREACH_THEN_EXECUTED) && !defined(IF_INSIDE_FOREACH_ELSE_EXECUTED) @@ -981,7 +981,7 @@ int main() else { cmFailed("cmakedefine01 is not working for 0"); - } + } if(SHOULD_BE_ONE == 1) { cmPassed("cmakedefine01 is working for 1"); @@ -989,7 +989,7 @@ int main() else { cmFailed("cmakedefine01 is not working for 1"); - } + } #ifdef FORCE_TEST cmFailed("CMake SET CACHE FORCE"); #else diff --git a/Tests/ComplexOneConfig/Executable/testcflags.c b/Tests/ComplexOneConfig/Executable/testcflags.c index f4d584844..6c2dd5db3 100644 --- a/Tests/ComplexOneConfig/Executable/testcflags.c +++ b/Tests/ComplexOneConfig/Executable/testcflags.c @@ -18,7 +18,7 @@ int TestCFlags(char* m) return 0; #endif /* TEST_C_FLAGS should be defined in a c file */ -#ifndef TEST_C_FLAGS +#ifndef TEST_C_FLAGS strcpy(m, "CMake CMAKE_C_FLAGS (TEST_C_FLAGS) not found in c file."); return 0; #endif diff --git a/Tests/ComplexOneConfig/Library/CMakeLists.txt b/Tests/ComplexOneConfig/Library/CMakeLists.txt index c8efc3022..5c430523e 100644 --- a/Tests/ComplexOneConfig/Library/CMakeLists.txt +++ b/Tests/ComplexOneConfig/Library/CMakeLists.txt @@ -1,90 +1,90 @@ -REMOVE_DEFINITIONS(-DCMAKE_IS_REALLY_FUN) +remove_definitions(-DCMAKE_IS_REALLY_FUN) # # Small utility used to create file # UTILITY_SOURCE is used for coverage and for getting the exact name # of the executable. # -UTILITY_SOURCE(CREATE_FILE_EXE create_file "." create_file.cxx) -ADD_EXECUTABLE(create_file create_file.cxx) -SET_TARGET_PROPERTIES(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") +utility_source(CREATE_FILE_EXE create_file "." create_file.cxx) +add_executable(create_file create_file.cxx) +set_target_properties(create_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY ".") # # Create static library # SOURCE_FILES_REMOVE is used for Coverage. empty.h is included for coverage # -AUX_SOURCE_DIRECTORY(ExtraSources LibrarySources) -SET(LibrarySources ${LibrarySources} - file2 - empty - create_file.cxx - GENERATED +aux_source_directory(ExtraSources LibrarySources) +set(LibrarySources ${LibrarySources} + file2 + empty + create_file.cxx + GENERATED nonexisting_file) -REMOVE(LibrarySources create_file.cxx GENERATED nonexisting_file) -ADD_LIBRARY(CMakeTestLibrary ${LibrarySources}) +remove(LibrarySources create_file.cxx GENERATED nonexisting_file) +add_library(CMakeTestLibrary ${LibrarySources}) -IF(WIN32) - IF(NOT CYGWIN) - IF(NOT BORLAND) - IF(NOT MINGW) - TARGET_LINK_LIBRARIES(CMakeTestLibrary - debug +if(WIN32) + if(NOT CYGWIN) + if(NOT BORLAND) + if(NOT MINGW) + target_link_libraries(CMakeTestLibrary + debug user32.lib) - TARGET_LINK_LIBRARIES(CMakeTestLibrary - optimized + target_link_libraries(CMakeTestLibrary + optimized kernel32.lib) - ENDIF(NOT MINGW) - ENDIF(NOT BORLAND) - ENDIF(NOT CYGWIN) -ENDIF(WIN32) + endif() + endif() + endif() +endif() # # Create shared library # -SET(SharedLibrarySources sharedFile) -ADD_LIBRARY(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) -SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") -ADD_LIBRARY(CMakeTestCLibraryShared SHARED testConly.c) -DEFINE_PROPERTY( +set(SharedLibrarySources sharedFile) +add_library(CMakeTestLibraryShared SHARED ${SharedLibrarySources}) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTEST_C_FLAGS") +add_library(CMakeTestCLibraryShared SHARED testConly.c) +define_property( TARGET PROPERTY FOO BRIEF_DOCS "a test property" FULL_DOCS "A simple etst proerty that means nothign and is used for nothing" ) -SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES FOO BAR) -IF(NOT BEOS AND NOT WIN32) # No libm on BeOS. - SET_TARGET_PROPERTIES(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") -ENDIF(NOT BEOS AND NOT WIN32) -GET_TARGET_PROPERTY(FOO_BAR_VAR CMakeTestCLibraryShared FOO) -IF(${FOO_BAR_VAR} MATCHES "BAR") -ELSE(${FOO_BAR_VAR} MATCHES "BAR") - MESSAGE(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") -ENDIF(${FOO_BAR_VAR} MATCHES "BAR") +set_target_properties(CMakeTestCLibraryShared PROPERTIES FOO BAR) +if(NOT BEOS AND NOT WIN32) # No libm on BeOS. + set_target_properties(CMakeTestCLibraryShared PROPERTIES LINK_FLAGS "-lm") +endif() +get_target_property(FOO_BAR_VAR CMakeTestCLibraryShared FOO) +if(${FOO_BAR_VAR} MATCHES "BAR") +else() + message(SEND_ERROR "SET_TARGET_PROPERTIES or GET_TARGET_PROPERTY failed, FOO_BAR_VAR should be BAR, but is ${FOO_BAR_VAR}") +endif() # Create static and shared lib of same name. -IF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) - ADD_LIBRARY(CMakeTestLinkStatic STATIC TestLink.c) - ADD_LIBRARY(CMakeTestLinkShared SHARED TestLink.c) - SET_TARGET_PROPERTIES(CMakeTestLinkStatic CMakeTestLinkShared +if(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) + add_library(CMakeTestLinkStatic STATIC TestLink.c) + add_library(CMakeTestLinkShared SHARED TestLink.c) + set_target_properties(CMakeTestLinkStatic CMakeTestLinkShared PROPERTIES OUTPUT_NAME CMakeTestLink) -ENDIF(CMAKE_EXE_LINK_STATIC_CXX_FLAGS) +endif() # # Attach pre-build/pre-link/post-build custom-commands to the lib. # Each runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_DEPENDENCIES(CMakeTestLibraryShared create_file) -MESSAGE("complex bin dir is ${Complex_BINARY_DIR}") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_dependencies(CMakeTestLibraryShared create_file) +message("complex bin dir is ${Complex_BINARY_DIR}") +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prebuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared PRE_BUILD +add_custom_command(TARGET CMakeTestLibraryShared PRE_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/prelink.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CREATE_FILE_EXE} ARGS "${Complex_BINARY_DIR}/Library/postbuild.txt") -ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD +add_custom_command(TARGET CMakeTestLibraryShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy "${Complex_BINARY_DIR}/Library/postbuild.txt" @@ -95,46 +95,46 @@ ADD_CUSTOM_COMMAND(TARGET CMakeTestLibraryShared POST_BUILD # It runs ${CREATE_FILE_EXE} which will create a file. # The 'complex' executable will then test if this file exists and remove it. # -ADD_CUSTOM_TARGET(custom_target1 +add_custom_target(custom_target1 ALL - ${CREATE_FILE_EXE} + ${CREATE_FILE_EXE} "${Complex_BINARY_DIR}/Library/custom_target1.txt") -ADD_DEPENDENCIES(custom_target1 create_file) +add_dependencies(custom_target1 create_file) # # Extra coverage # -SET_SOURCE_FILES_PROPERTIES(file2 PROPERTIES ABSTRACT 1) +set_source_files_properties(file2 PROPERTIES ABSTRACT 1) -INSTALL_FILES(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) -INSTALL_FILES(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .h ${Complex_BINARY_DIR}/cmTestConfigure.h) +install_files(/tmp .cxx ${Complex_BINARY_DIR}/cmTestConfigure.h) # Test creating a library that is not built by default. -ADD_LIBRARY(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) +add_library(notInAllLib EXCLUDE_FROM_ALL notInAllLib.cxx) # Create an imported target for if(TARGET) test in Executable dir. # That test should not see this target. -ADD_LIBRARY(LibImportedTarget UNKNOWN IMPORTED) +add_library(LibImportedTarget UNKNOWN IMPORTED) # Test generation of preprocessed sources. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) - IF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) +if("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + if(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) # Skip running this part of the test on certain platforms # until they are fixed. - SET(MAYBE_ALL ALL) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) - IF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL ALL) + list(LENGTH CMAKE_OSX_ARCHITECTURES ARCH_COUNT) + if(ARCH_COUNT GREATER 1) # OSX does not support preprocessing more than one architecture. - SET(MAYBE_ALL) - ENDIF(ARCH_COUNT GREATER 1) + set(MAYBE_ALL) + endif() # Custom target to try preprocessing invocation. - ADD_CUSTOM_TARGET(test_preprocess ${MAYBE_ALL} + add_custom_target(test_preprocess ${MAYBE_ALL} COMMAND ${CMAKE_COMMAND} -E remove CMakeFiles/create_file.dir/create_file.i COMMAND ${CMAKE_MAKE_PROGRAM} create_file.i COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/test_preprocess.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} ) - ENDIF(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE) -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile" AND CMAKE_MAKE_PROGRAM) + endif() +endif() diff --git a/Tests/ComplexOneConfig/Library/create_file.cxx b/Tests/ComplexOneConfig/Library/create_file.cxx index d41551980..050ed0bac 100644 --- a/Tests/ComplexOneConfig/Library/create_file.cxx +++ b/Tests/ComplexOneConfig/Library/create_file.cxx @@ -8,7 +8,7 @@ int main (int argc, char *argv[]) fprintf(stderr, "Missing name of file to create.\n"); return EXIT_FAILURE; } - + FILE *stream = fopen(argv[1], "w"); if(stream == NULL) { @@ -23,6 +23,6 @@ int main (int argc, char *argv[]) } fprintf(stdout, ">> Creating %s!\n", argv[1]); - + return EXIT_SUCCESS; } diff --git a/Tests/ComplexOneConfig/Library/testConly.c b/Tests/ComplexOneConfig/Library/testConly.c index 2d83f778e..a7d20b0b5 100644 --- a/Tests/ComplexOneConfig/Library/testConly.c +++ b/Tests/ComplexOneConfig/Library/testConly.c @@ -7,7 +7,7 @@ int CsharedFunction() printf("TEST_C_FLAGS failed\n"); return 0; #else - printf("Passed: TEST_C_FLAGS passed\n"); -#endif + printf("Passed: TEST_C_FLAGS passed\n"); +#endif return 1; } diff --git a/Tests/ComplexOneConfig/Library/testConly.h b/Tests/ComplexOneConfig/Library/testConly.h index f1470a8d7..ba8458923 100644 --- a/Tests/ComplexOneConfig/Library/testConly.h +++ b/Tests/ComplexOneConfig/Library/testConly.h @@ -10,4 +10,4 @@ #endif CMakeTest_EXPORT int CsharedFunction(); - + diff --git a/Tests/ComplexOneConfig/Library/test_preprocess.cmake b/Tests/ComplexOneConfig/Library/test_preprocess.cmake index d2d9fc652..4c8ec2174 100644 --- a/Tests/ComplexOneConfig/Library/test_preprocess.cmake +++ b/Tests/ComplexOneConfig/Library/test_preprocess.cmake @@ -1,7 +1,7 @@ -SET(TEST_FILE CMakeFiles/create_file.dir/create_file.i) -FILE(READ ${TEST_FILE} CONTENTS) -IF("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(STATUS "${TEST_FILE} created successfully!") -ELSE("${CONTENTS}" MATCHES "Unable to close") - MESSAGE(FATAL_ERROR "${TEST_FILE} creation failed!") -ENDIF("${CONTENTS}" MATCHES "Unable to close") +set(TEST_FILE CMakeFiles/create_file.dir/create_file.i) +file(READ ${TEST_FILE} CONTENTS) +if("${CONTENTS}" MATCHES "Unable to close") + message(STATUS "${TEST_FILE} created successfully!") +else() + message(FATAL_ERROR "${TEST_FILE} creation failed!") +endif() diff --git a/Tests/ComplexOneConfig/VarTests.cmake b/Tests/ComplexOneConfig/VarTests.cmake index c146d1be0..52ec1fc8e 100644 --- a/Tests/ComplexOneConfig/VarTests.cmake +++ b/Tests/ComplexOneConfig/VarTests.cmake @@ -1,198 +1,198 @@ # # Test SET # -SET (ZERO_VAR 0) -SET (ZERO_VAR2 0) +set (ZERO_VAR 0) +set (ZERO_VAR2 0) -IF(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED) -ELSE(ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED) -ENDIF(ZERO_VAR) +if(ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED) +else() + add_definitions(-DSHOULD_BE_DEFINED) +endif() -SET(ONE_VAR 1) -SET(ONE_VAR2 1) -SET(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") +set(ONE_VAR 1) +set(ONE_VAR2 1) +set(STRING_VAR "CMake is great" CACHE STRING "test a cache variable") # # Test VARIABLE_REQUIRES # -VARIABLE_REQUIRES(ONE_VAR +variable_requires(ONE_VAR ONE_VAR_IS_DEFINED ONE_VAR) # # Test various IF/ELSE combinations # -IF(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT) -ELSE(NOT ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT) -ENDIF(NOT ZERO_VAR) - -IF(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_NOT2) -ELSE(NOT ONE_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_NOT2) -ENDIF(NOT ONE_VAR) - -IF(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND) -ELSE(ONE_VAR AND ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND) -ENDIF(ONE_VAR AND ONE_VAR2) - -IF(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_AND2) -ELSE(ONE_VAR AND ZERO_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_AND2) -ENDIF(ONE_VAR AND ZERO_VAR) - -IF(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR) -ELSE(ZERO_VAR OR ONE_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR) -ENDIF(ZERO_VAR OR ONE_VAR2) - -IF(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_OR2) -ELSE(ZERO_VAR OR ZERO_VAR2) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_OR2) -ENDIF(ZERO_VAR OR ZERO_VAR2) - -IF(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES) -ELSE(STRING_VAR MATCHES "^CMake") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES) -ENDIF(STRING_VAR MATCHES "^CMake") - -IF(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_MATCHES2) -ELSE(STRING_VAR MATCHES "^foo") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_MATCHES2) -ENDIF(STRING_VAR MATCHES "^foo") - -IF(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND) -ELSE(COMMAND "IF") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND) -ENDIF(COMMAND "IF") - -IF(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_COMMAND2) -ELSE(COMMAND "ROQUEFORT") - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_COMMAND2) -ENDIF(COMMAND "ROQUEFORT") - -IF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS) -ELSE(EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) - -IF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EXISTS2) -ELSE(EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EXISTS2) -ENDIF (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) - -IF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY) -ENDIF (IS_DIRECTORY ${Complex_SOURCE_DIR}) - -IF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) -ENDIF (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) - -SET (SNUM1_VAR "1") -SET (SNUM2_VAR "2") -SET (SNUM3_VAR "1") - - -IF (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS) -ELSE (SNUM1_VAR LESS SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS) -ENDIF (SNUM1_VAR LESS SNUM2_VAR) - -IF (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_LESS2) -ELSE (SNUM2_VAR LESS SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_LESS2) -ENDIF (SNUM2_VAR LESS SNUM1_VAR) - -IF (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER) -ELSE (SNUM2_VAR GREATER SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER) -ENDIF (SNUM2_VAR GREATER SNUM1_VAR) - -IF (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ELSE (SNUM2_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ENDIF (SNUM2_VAR EQUAL SNUM1_VAR) - -IF (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_EQUAL) -ELSE (SNUM3_VAR EQUAL SNUM1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_EQUAL) -ENDIF (SNUM3_VAR EQUAL SNUM1_VAR) - -IF (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_GREATER2) -ELSE (SNUM1_VAR GREATER SNUM2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_GREATER2) -ENDIF (SNUM1_VAR GREATER SNUM2_VAR) - -SET (SSTR1_VAR "abc") -SET (SSTR2_VAR "bcd") - -IF (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS) -ELSE (SSTR1_VAR STRLESS SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS) -ENDIF (SSTR1_VAR STRLESS SSTR2_VAR) - -IF (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRLESS2) -ELSE (SSTR2_VAR STRLESS SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRLESS2) -ENDIF (SSTR2_VAR STRLESS SSTR1_VAR) - -IF (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER) -ELSE (SSTR2_VAR STRGREATER SSTR1_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER) -ENDIF (SSTR2_VAR STRGREATER SSTR1_VAR) - -IF (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) -ELSE (SSTR1_VAR STRGREATER SSTR2_VAR) - ADD_DEFINITIONS(-DSHOULD_BE_DEFINED_STRGREATER2) -ENDIF (SSTR1_VAR STRGREATER SSTR2_VAR) +if(NOT ZERO_VAR) + add_definitions(-DSHOULD_BE_DEFINED_NOT) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT) +endif() + +if(NOT ONE_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_NOT2) +else() + add_definitions(-DSHOULD_BE_DEFINED_NOT2) +endif() + +if(ONE_VAR AND ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_AND) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND) +endif() + +if(ONE_VAR AND ZERO_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_AND2) +else() + add_definitions(-DSHOULD_BE_DEFINED_AND2) +endif() + +if(ZERO_VAR OR ONE_VAR2) + add_definitions(-DSHOULD_BE_DEFINED_OR) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR) +endif() + +if(ZERO_VAR OR ZERO_VAR2) + add_definitions(-DSHOULD_NOT_BE_DEFINED_OR2) +else() + add_definitions(-DSHOULD_BE_DEFINED_OR2) +endif() + +if(STRING_VAR MATCHES "^CMake") + add_definitions(-DSHOULD_BE_DEFINED_MATCHES) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES) +endif() + +if(STRING_VAR MATCHES "^foo") + add_definitions(-DSHOULD_NOT_BE_DEFINED_MATCHES2) +else() + add_definitions(-DSHOULD_BE_DEFINED_MATCHES2) +endif() + +if(COMMAND "IF") + add_definitions(-DSHOULD_BE_DEFINED_COMMAND) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND) +endif() + +if(COMMAND "ROQUEFORT") + add_definitions(-DSHOULD_NOT_BE_DEFINED_COMMAND2) +else() + add_definitions(-DSHOULD_BE_DEFINED_COMMAND2) +endif() + +if (EXISTS ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_EXISTS) +else() + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS) +endif () + +if (EXISTS ${Complex_SOURCE_DIR}/roquefort.txt) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EXISTS2) +else() + add_definitions(-DSHOULD_BE_DEFINED_EXISTS2) +endif () + +if (IS_DIRECTORY ${Complex_SOURCE_DIR}) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY) +endif () + +if (NOT IS_DIRECTORY ${Complex_SOURCE_DIR}/VarTests.cmake) + add_definitions(-DSHOULD_BE_DEFINED_IS_DIRECTORY2) +endif () + +set (SNUM1_VAR "1") +set (SNUM2_VAR "2") +set (SNUM3_VAR "1") + + +if (SNUM1_VAR LESS SNUM2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_LESS) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS) +endif () + +if (SNUM2_VAR LESS SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_LESS2) +else () + add_definitions(-DSHOULD_BE_DEFINED_LESS2) +endif () + +if (SNUM2_VAR GREATER SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_GREATER) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER) +endif () + +if (SNUM2_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +else () + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +endif () + +if (SNUM3_VAR EQUAL SNUM1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_EQUAL) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_EQUAL) +endif () + +if (SNUM1_VAR GREATER SNUM2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_GREATER2) +else () + add_definitions(-DSHOULD_BE_DEFINED_GREATER2) +endif () + +set (SSTR1_VAR "abc") +set (SSTR2_VAR "bcd") + +if (SSTR1_VAR STRLESS SSTR2_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRLESS) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS) +endif () + +if (SSTR2_VAR STRLESS SSTR1_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRLESS2) +else () + add_definitions(-DSHOULD_BE_DEFINED_STRLESS2) +endif () + +if (SSTR2_VAR STRGREATER SSTR1_VAR) + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER) +else () + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER) +endif () + +if (SSTR1_VAR STRGREATER SSTR2_VAR) + add_definitions(-DSHOULD_NOT_BE_DEFINED_STRGREATER2) +else () + add_definitions(-DSHOULD_BE_DEFINED_STRGREATER2) +endif () # # Test FOREACH # -FOREACH (INDEX 1 2) - SET(FOREACH_VAR${INDEX} "VALUE${INDEX}") -ENDFOREACH(INDEX) +foreach (INDEX 1 2) + set(FOREACH_VAR${INDEX} "VALUE${INDEX}") +endforeach() -SET(FOREACH_CONCAT "") -FOREACH (INDEX a;b;c;d;e;f;g) - SET(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") -ENDFOREACH(INDEX) +set(FOREACH_CONCAT "") +foreach (INDEX a;b;c;d;e;f;g) + set(FOREACH_CONCAT "${FOREACH_CONCAT}${INDEX}") +endforeach() # # Test FIND_FILE, FIND_PATH and various GET_FILENAME_COMPONENT combinations # -FIND_FILE(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) +find_file(FILENAME_VAR "VarTests.cmake" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) -GET_FILENAME_COMPONENT(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) -GET_FILENAME_COMPONENT(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) -GET_FILENAME_COMPONENT(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) +get_filename_component(FILENAME_VAR_PATH ${FILENAME_VAR} PATH) +get_filename_component(FILENAME_VAR_PATH_NAME ${FILENAME_VAR_PATH} NAME) +get_filename_component(FILENAME_VAR_NAME ${FILENAME_VAR} NAME) +get_filename_component(FILENAME_VAR_EXT ${FILENAME_VAR} EXT) +get_filename_component(FILENAME_VAR_NAME_WE ${FILENAME_VAR} NAME_WE CACHE) -FIND_PATH(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) -GET_FILENAME_COMPONENT(PATH_VAR_NAME ${PATH_VAR} NAME) +find_path(PATH_VAR "cmTestConfigure.h.in" ${Complex_SOURCE_DIR}) +get_filename_component(PATH_VAR_NAME ${PATH_VAR} NAME) diff --git a/Tests/Contracts/Trilinos-10-6/Patch.cmake b/Tests/Contracts/Trilinos-10-6/Patch.cmake index 76051eb98..6c619ac4f 100644 --- a/Tests/Contracts/Trilinos-10-6/Patch.cmake +++ b/Tests/Contracts/Trilinos-10-6/Patch.cmake @@ -14,8 +14,8 @@ set(text " # options to avoid CMake warnings about unused variables # -MESSAGE(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\") -MESSAGE(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\") +message(\"Trilinos_ALLOW_NO_PACKAGES='\${Trilinos_ALLOW_NO_PACKAGES}'\") +message(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAGS}'\") ") file(APPEND "${source_dir}/CMakeLists.txt" "${text}") @@ -31,8 +31,8 @@ set(text " # Use newer than 10.6.1 CTestConfig settings from the Trilinos project. # Send the Trilinos dashboards to the new Trilinos CDash server instance. # -SET(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST -SET(CTEST_DROP_SITE \"testing.sandia.gov\") +set(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST +set(CTEST_DROP_SITE \"testing.sandia.gov\") ") file(APPEND "${source_dir}/CTestConfig.cmake" "${text}") diff --git a/Tests/Contracts/vtk542/RunTest.cmake b/Tests/Contracts/vtk542/RunTest.cmake index 4f48e5cd2..b4bd5b087 100644 --- a/Tests/Contracts/vtk542/RunTest.cmake +++ b/Tests/Contracts/vtk542/RunTest.cmake @@ -1 +1 @@ -SET(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays) +set(vtk542_RUN_TEST VTK-build/bin/CommonCxxTests otherArrays) diff --git a/Tests/CrossCompile/CMakeLists.txt b/Tests/CrossCompile/CMakeLists.txt index 96a57a051..121cb815e 100644 --- a/Tests/CrossCompile/CMakeLists.txt +++ b/Tests/CrossCompile/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CrossCompile) +project(CrossCompile) -UNSET(run_result CACHE) +unset(run_result CACHE) #Simulate the cross compile condition -SET(CMAKE_CROSSCOMPILING ON) +set(CMAKE_CROSSCOMPILING ON) -ADD_EXECUTABLE(CrossCompile main.c) +add_executable(CrossCompile main.c) -TRY_RUN(run_result compile_result - ${CrossCompile_BINARY_DIR} +try_run(run_result compile_result + ${CrossCompile_BINARY_DIR} ${CrossCompile_SOURCE_DIR}/main.c) diff --git a/Tests/CustComDepend/CMakeLists.txt b/Tests/CustComDepend/CMakeLists.txt index d5266842d..46276b2ef 100644 --- a/Tests/CustComDepend/CMakeLists.txt +++ b/Tests/CustComDepend/CMakeLists.txt @@ -10,5 +10,5 @@ add_custom_command( ${CustComDepend_BINARY_DIR}/bar.c DEPENDS ${CustComDepend_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/foo ) - + add_library(bar SHARED ${CustComDepend_BINARY_DIR}/bar.c) diff --git a/Tests/CustComDepend/bar.h b/Tests/CustComDepend/bar.h index d462c9b5b..d17946428 100644 --- a/Tests/CustComDepend/bar.h +++ b/Tests/CustComDepend/bar.h @@ -5,5 +5,5 @@ # define BAR_EXPORT __declspec( dllimport ) # endif #else -# define BAR_EXPORT +# define BAR_EXPORT #endif diff --git a/Tests/CustComDepend/foo.cxx b/Tests/CustComDepend/foo.cxx index 3c204f8a2..19dfcb143 100644 --- a/Tests/CustComDepend/foo.cxx +++ b/Tests/CustComDepend/foo.cxx @@ -12,4 +12,4 @@ int main(int ac, char** av) fclose(fout); return 0; } - + diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index b7c9ea268..d3ced3ff9 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -2,22 +2,22 @@ # Wrapping # cmake_minimum_required (VERSION 2.6) -PROJECT (CustomCommand) +project (CustomCommand) -ADD_SUBDIRECTORY(GeneratedHeader) +add_subdirectory(GeneratedHeader) # # Lib and exe path # -IF(NOT DEFINED bin_dir) - SET(bin_dir "bin") -ENDIF() +if(NOT DEFINED bin_dir) + set(bin_dir "bin") +endif() -SET (LIBRARY_OUTPUT_PATH +set (LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH +set (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL "Single output directory for building all executables.") @@ -27,10 +27,10 @@ SET (EXECUTABLE_OUTPUT_PATH # ################################################################ # add the executable that will generate the file -ADD_EXECUTABLE(generator generator.cxx) +add_executable(generator generator.cxx) -GET_TARGET_PROPERTY(generator_PATH generator LOCATION) -MESSAGE("Location ${generator_PATH}") +get_target_property(generator_PATH generator LOCATION) +message("Location ${generator_PATH}") ################################################################ # @@ -38,9 +38,9 @@ MESSAGE("Location ${generator_PATH}") # ################################################################ # add the executable that will generate the file -ADD_EXECUTABLE(wrapper wrapper.cxx) +add_executable(wrapper wrapper.cxx) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/wrapped.c ${PROJECT_BINARY_DIR}/wrapped_help.c DEPENDS wrapper MAIN_DEPENDENCY ${PROJECT_SOURCE_DIR}/wrapped.h @@ -55,19 +55,19 @@ ADD_CUSTOM_COMMAND( # Test creating files from a custom target # ################################################################ -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes - DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}//doc1.dvi # test 2 slashes + DEPENDS ${PROJECT_SOURCE_DIR}/doc1.tex + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${PROJECT_SOURCE_DIR}/doc1.tex ${PROJECT_BINARY_DIR}/doc1.dvi ) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.dvi to doc1temp.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.dvi ${PROJECT_BINARY_DIR}/doc1temp.h ) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND DEPENDS ${PROJECT_BINARY_DIR}/doc1.dvi COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1temp.h to doc1.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1temp.h @@ -77,7 +77,7 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/doc1.h APPEND ) # Add custom command to generate foo.h. -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.h DEPENDS ${PROJECT_SOURCE_DIR}/foo.h.in COMMAND ${CMAKE_COMMAND} -E echo " Copying foo.h.in to foo.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/foo.h.in @@ -85,12 +85,12 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.h ) # Add the location of foo.h to the include path. -INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}) +include_directories(${PROJECT_BINARY_DIR}) # Test generation of a file to the build tree without full path. As # of CMake 2.6 custom command outputs specified by relative path go in # the build tree. -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT doc1.txt COMMAND ${CMAKE_COMMAND} -E echo "Example Document Target" > doc1.txt DEPENDS doc1.tex @@ -98,7 +98,7 @@ ADD_CUSTOM_COMMAND( ) # Add a custom target to drive generation of doc1.h. -ADD_CUSTOM_TARGET(TDocument ALL +add_custom_target(TDocument ALL COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1.h to doc2.h." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1.h ${PROJECT_BINARY_DIR}/doc2.h @@ -109,13 +109,13 @@ ADD_CUSTOM_TARGET(TDocument ALL # Setup a pre- and post-build pair that will fail if not run in the # proper order. -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET TDocument PRE_BUILD COMMAND ${CMAKE_COMMAND} -E echo " Writing doc1pre.txt." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/doc1.tex ${PROJECT_BINARY_DIR}/doc1pre.txt COMMENT "Running TDocument pre-build commands" ) -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET TDocument POST_BUILD COMMAND ${CMAKE_COMMAND} -E echo " Copying doc1pre.txt to doc2post.txt." COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_BINARY_DIR}/doc1pre.txt @@ -128,16 +128,16 @@ ADD_CUSTOM_COMMAND( # Test using a multistep generated file # ################################################################ -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.pre DEPENDS ${PROJECT_SOURCE_DIR}/foo.in TDocument # Ensure doc1.h generates before this target - COMMAND ${CMAKE_COMMAND} - ARGS -E copy ${PROJECT_SOURCE_DIR}/foo.in + COMMAND ${CMAKE_COMMAND} + ARGS -E copy ${PROJECT_SOURCE_DIR}/foo.in ${PROJECT_BINARY_DIR}/foo.pre ) -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c - DEPENDS ${PROJECT_BINARY_DIR}/foo.pre +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/foo.c + DEPENDS ${PROJECT_BINARY_DIR}/foo.pre COMMAND ${CMAKE_COMMAND} ARGS -E copy ${PROJECT_BINARY_DIR}/foo.pre ${PROJECT_BINARY_DIR}/foo.c @@ -147,21 +147,21 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/foo.c # file that is not included by any source in this project. This will # test whether all custom command outputs explicitly listed as sources # get generated even if they are not needed by an object file. -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/not_included.h DEPENDS ${PROJECT_SOURCE_DIR}/foo.h.in COMMAND ${CMAKE_COMMAND} -E copy ${PROJECT_SOURCE_DIR}/foo.h.in ${PROJECT_BINARY_DIR}/not_included.h ) # Tell the executable where to find not_included.h. -CONFIGURE_FILE( +configure_file( ${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h @ONLY IMMEDIATE ) # add the executable -ADD_EXECUTABLE(CustomCommand +add_executable(CustomCommand ${PROJECT_BINARY_DIR}/foo.h ${PROJECT_BINARY_DIR}/foo.c ${PROJECT_BINARY_DIR}/wrapped.c @@ -174,44 +174,44 @@ ADD_EXECUTABLE(CustomCommand # Add the rule to create generated.c at build time. This is placed # here to test adding the generation rule after referencing the # generated source in a target. -ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_BINARY_DIR}/generated.c +add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/generated.c DEPENDS generator COMMAND ${generator_PATH} ARGS ${PROJECT_BINARY_DIR}/generated.c ) -TARGET_LINK_LIBRARIES(CustomCommand GeneratedHeader) +target_link_libraries(CustomCommand GeneratedHeader) ############################################################################## # Test for using just the target name as executable in the COMMAND # section. Has to be recognized and replaced by CMake with the output # actual location of the executable. -# Additionally the generator is created in an extra subdir after the -# ADD_CUSTOM_COMMAND() is used. +# Additionally the generator is created in an extra subdir after the +# add_custom_command() is used. # -# Test the same for ADD_CUSTOM_TARGET() +# Test the same for add_custom_target() -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx ) -ADD_EXECUTABLE(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx ) +add_executable(CustomCommandUsingTargetTest main.cxx ${CMAKE_CURRENT_BINARY_DIR}/generated_extern.cxx ) -ADD_CUSTOM_TARGET(RunTarget +add_custom_target(RunTarget COMMAND generator_extern ${CMAKE_CURRENT_BINARY_DIR}/run_target.cxx ) -ADD_CUSTOM_COMMAND(TARGET CustomCommandUsingTargetTest POST_BUILD +add_custom_command(TARGET CustomCommandUsingTargetTest POST_BUILD COMMAND dummy_generator ${CMAKE_CURRENT_BINARY_DIR}/generated_dummy.cxx) -ADD_SUBDIRECTORY(GeneratorInExtraDir) +add_subdirectory(GeneratorInExtraDir) ############################################################################## # Test shell operators in custom commands. -ADD_EXECUTABLE(tcat tcat.cxx) +add_executable(tcat tcat.cxx) -ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c +add_custom_command(OUTPUT gen_redirect.c DEPENDS tcat gen_redirect_in.c COMMAND tcat < ${CMAKE_CURRENT_SOURCE_DIR}/gen_redirect_in.c > gen_redirect.c COMMAND ${CMAKE_COMMAND} -E echo "#endif" >> gen_redirect.c @@ -220,12 +220,12 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c ############################################################################## # Test non-trivial command line arguments in custom commands. -SET(EXPECTED_ARGUMENTS) -SET(CHECK_ARGS) -IF(NOT MSVC71) - SET(CHECK_ARGS -DPATH=c:/posix/path) -ENDIF() -SET(CHECK_ARGS +set(EXPECTED_ARGUMENTS) +set(CHECK_ARGS) +if(NOT MSVC71) + set(CHECK_ARGS -DPATH=c:/posix/path) +endif() +set(CHECK_ARGS ${CHECK_ARGS} c:/posix/path c:\\windows\\path @@ -333,11 +333,11 @@ SET(CHECK_ARGS "one#pound w s" ~ ` ! @ \# $ % ^ & _ - + = : "\;" \" ' , . ? "(" ")" { } [] ) -IF(NOT MINGW) +if(NOT MINGW) # * # MinGW programs on windows always expands the wildcard! # / # MSys make converts a leading slash to the mingw home directory - LIST(APPEND CHECK_ARGS * /) -ENDIF(NOT MINGW) + list(APPEND CHECK_ARGS * /) +endif() # The windows command shell does not support a double quote by itself: # double\"quote @@ -352,25 +352,25 @@ ENDIF(NOT MINGW) # | < > << >> &> 2>&1 1>&2 # to allow custom commands to perform redirection. -FOREACH(arg ${CHECK_ARGS} "") - SET(ARG "${arg}") - STRING(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}") - STRING(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}") - SET(EXPECTED_ARGUMENTS +foreach(arg ${CHECK_ARGS} "") + set(ARG "${arg}") + string(REGEX REPLACE "\\\\" "\\\\\\\\" ARG "${ARG}") + string(REGEX REPLACE "\"" "\\\\\"" ARG "${ARG}") + set(EXPECTED_ARGUMENTS "${EXPECTED_ARGUMENTS} \"${ARG}\", ") -ENDFOREACH(arg) -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in +endforeach() +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c @ONLY IMMEDIATE) -ADD_EXECUTABLE(check_command_line +add_executable(check_command_line ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c) -SET(output_name "check_command_line") -SET_PROPERTY(TARGET check_command_line +set(output_name "check_command_line") +set_property(TARGET check_command_line PROPERTY OUTPUT_NAME ${output_name}) -# SET_TARGET_PROPERTIES(check_command_line PROPERTIES +# set_target_properties(check_command_line PROPERTIES # COMPILE_FLAGS -DCHECK_COMMAND_LINE_VERBOSE) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake @@ -379,9 +379,9 @@ ADD_CUSTOM_COMMAND( VERBATIM COMMENT "Checking custom command line escapes (single'quote)" ) -SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/command_line_check +set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/command_line_check PROPERTIES SYMBOLIC 1) -ADD_CUSTOM_TARGET(do_check_command_line ALL +add_custom_target(do_check_command_line ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes" COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name} @@ -389,12 +389,12 @@ ADD_CUSTOM_TARGET(do_check_command_line ALL VERBATIM COMMENT "Checking custom target command line escapes ($dollar-signs$)" ) -ADD_DEPENDENCIES(do_check_command_line check_command_line) +add_dependencies(do_check_command_line check_command_line) -ADD_CUSTOM_TARGET(pre_check_command_line +add_custom_target(pre_check_command_line COMMAND ${CMAKE_COMMAND} -E remove ${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt ) -ADD_DEPENDENCIES(do_check_command_line pre_check_command_line) +add_dependencies(do_check_command_line pre_check_command_line) # <SameNameTest> # @@ -405,34 +405,34 @@ ADD_DEPENDENCIES(do_check_command_line pre_check_command_line) # At first, this reproduces a bug reported by a customer. After fixing it, # having this test here makes sure it stays fixed moving forward. # -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT SameName1.txt COMMAND ${CMAKE_COMMAND} -E touch SameName1.txt ) -ADD_CUSTOM_TARGET(SameName ALL +add_custom_target(SameName ALL DEPENDS SameName1.txt ) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/subdir COMMAND ${CMAKE_COMMAND} -E touch ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName ) -ADD_CUSTOM_TARGET(DifferentName ALL +add_custom_target(DifferentName ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/subdir/SameName ) # # </SameNameTest> # Per-config target name and generator expressions. -ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) -ADD_CUSTOM_COMMAND( +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) +add_custom_command( OUTPUT perconfig.out COMMAND ${PerConfig_COMMAND} DEPENDS ${PerConfig_DEPENDS} VERBATIM ) -SET_PROPERTY(SOURCE perconfig.out PROPERTY SYMBOLIC 1) -ADD_CUSTOM_TARGET(perconfig_target ALL +set_property(SOURCE perconfig.out PROPERTY SYMBOLIC 1) +add_custom_target(perconfig_target ALL COMMAND ${CMAKE_COMMAND} -E echo "perconfig=$<TARGET_FILE:perconfig>" "config=$<CONFIGURATION>" DEPENDS perconfig.out) diff --git a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt index 2d47d8749..f7308e890 100644 --- a/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt +++ b/Tests/CustomCommand/GeneratedHeader/CMakeLists.txt @@ -1,13 +1,13 @@ # Simulate in-source build include-file behavior for out-of-source # builds. -SET(CMAKE_INCLUDE_CURRENT_DIR 1) +set(CMAKE_INCLUDE_CURRENT_DIR 1) -ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h - COMMAND +add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h + COMMAND ${CMAKE_COMMAND} ARGS -E - copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in - ${CMAKE_CURRENT_BINARY_DIR}/generated.h + copy ${CMAKE_CURRENT_SOURCE_DIR}/generated.h.in + ${CMAKE_CURRENT_BINARY_DIR}/generated.h ) -ADD_LIBRARY(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h) - +add_library(GeneratedHeader main.cpp ${CMAKE_CURRENT_BINARY_DIR}/generated.h) + diff --git a/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt b/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt index 195a47792..04506db3b 100644 --- a/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt +++ b/Tests/CustomCommand/GeneratorInExtraDir/CMakeLists.txt @@ -1,8 +1,8 @@ -ADD_DEFINITIONS(-DGENERATOR_EXTERN) +add_definitions(-DGENERATOR_EXTERN) # add the executable which will be used for generating files -ADD_EXECUTABLE(generator_extern ../generator.cxx) -SET_TARGET_PROPERTIES(generator_extern PROPERTIES OUTPUT_NAME the_external_generator) +add_executable(generator_extern ../generator.cxx) +set_target_properties(generator_extern PROPERTIES OUTPUT_NAME the_external_generator) -# add an executable which will be called from ADD_CUSTOM_COMMAND( ... POST_BUILD) -ADD_EXECUTABLE(dummy_generator ../generator.cxx) +# add an executable which will be called from add_custom_command( ... POST_BUILD) +add_executable(dummy_generator ../generator.cxx) diff --git a/Tests/CustomCommand/check_mark.cmake b/Tests/CustomCommand/check_mark.cmake index 8b0551f83..1f47fd0bd 100644 --- a/Tests/CustomCommand/check_mark.cmake +++ b/Tests/CustomCommand/check_mark.cmake @@ -1,5 +1,5 @@ -IF(EXISTS "${MARK_FILE}") - MESSAGE(FATAL_ERROR "Custom command run more than once!") -ELSE(EXISTS "${MARK_FILE}") - FILE(WRITE "${MARK_FILE}" "check for running custom command twice\n") -ENDIF(EXISTS "${MARK_FILE}") +if(EXISTS "${MARK_FILE}") + message(FATAL_ERROR "Custom command run more than once!") +else() + file(WRITE "${MARK_FILE}" "check for running custom command twice\n") +endif() diff --git a/Tests/CustomCommand/foo.in b/Tests/CustomCommand/foo.in index 08c559df4..0c5021caa 100644 --- a/Tests/CustomCommand/foo.in +++ b/Tests/CustomCommand/foo.in @@ -22,7 +22,7 @@ int main () return -2; } } - + return -1; } diff --git a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt index 36d32e4a0..f917cd7f3 100644 --- a/Tests/CustomCommandWorkingDirectory/CMakeLists.txt +++ b/Tests/CustomCommandWorkingDirectory/CMakeLists.txt @@ -1,28 +1,28 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TestWorkingDir) +project(TestWorkingDir) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT "${TestWorkingDir_BINARY_DIR}/working.c" COMMAND "${CMAKE_COMMAND}" -E copy ./working.c.in "${TestWorkingDir_BINARY_DIR}/working.c" WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}" COMMENT "custom command" ) -SET_SOURCE_FILES_PROPERTIES( +set_source_files_properties( "${TestWorkingDir_BINARY_DIR}/customTarget.c" "${TestWorkingDir_BINARY_DIR}/customTarget2.c" PROPERTIES GENERATED 1) -ADD_EXECUTABLE(working "${TestWorkingDir_BINARY_DIR}/working.c" +add_executable(working "${TestWorkingDir_BINARY_DIR}/working.c" "${TestWorkingDir_BINARY_DIR}/customTarget.c") -ADD_CUSTOM_TARGET( +add_custom_target( Custom ALL COMMAND "${CMAKE_COMMAND}" -E copy_if_different ./customTarget.c "${TestWorkingDir_BINARY_DIR}/customTarget.c" WORKING_DIRECTORY "${TestWorkingDir_SOURCE_DIR}" ) -ADD_DEPENDENCIES(working Custom) +add_dependencies(working Custom) file(MAKE_DIRECTORY ${TestWorkingDir_BINARY_DIR}/work) add_custom_command( diff --git a/Tests/Dependency/1/CMakeLists.txt b/Tests/Dependency/1/CMakeLists.txt index b50b2e9c5..a8e74e40b 100644 --- a/Tests/Dependency/1/CMakeLists.txt +++ b/Tests/Dependency/1/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( One OneSrc.c ) +add_library( One OneSrc.c ) # This library has no dependencies -TARGET_LINK_LIBRARIES( One "" ) +target_link_libraries( One "" ) diff --git a/Tests/Dependency/CMakeLists.txt b/Tests/Dependency/CMakeLists.txt index 86e128f58..ef4204803 100644 --- a/Tests/Dependency/CMakeLists.txt +++ b/Tests/Dependency/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required (VERSION 2.6) -PROJECT( Dependency ) +project( Dependency ) # to test directories with only one character One was changed to 1 # There is one executable that depends on eight libraries. The @@ -29,25 +29,25 @@ PROJECT( Dependency ) # Although SixB does not depend on Two, there is a dependency listed # in the corresponding CMakeLists.txt just because of commands used. -ADD_SUBDIRECTORY(NoDepA) -ADD_SUBDIRECTORY(NoDepB) -ADD_SUBDIRECTORY(NoDepC) -ADD_SUBDIRECTORY(1) -ADD_SUBDIRECTORY(Two) -ADD_SUBDIRECTORY(Three) -ADD_SUBDIRECTORY(Four) -ADD_SUBDIRECTORY(Five) -ADD_SUBDIRECTORY(Six) -ADD_SUBDIRECTORY(Seven) -ADD_SUBDIRECTORY(Eight) -ADD_SUBDIRECTORY(Exec) -ADD_SUBDIRECTORY(Exec2) -ADD_SUBDIRECTORY(Exec3) -ADD_SUBDIRECTORY(Exec4) +add_subdirectory(NoDepA) +add_subdirectory(NoDepB) +add_subdirectory(NoDepC) +add_subdirectory(1) +add_subdirectory(Two) +add_subdirectory(Three) +add_subdirectory(Four) +add_subdirectory(Five) +add_subdirectory(Six) +add_subdirectory(Seven) +add_subdirectory(Eight) +add_subdirectory(Exec) +add_subdirectory(Exec2) +add_subdirectory(Exec3) +add_subdirectory(Exec4) # Specific cases added to test fixes to problems found in real # projects. -ADD_SUBDIRECTORY(Case1) -ADD_SUBDIRECTORY(Case2) -ADD_SUBDIRECTORY(Case3) -ADD_SUBDIRECTORY(Case4) +add_subdirectory(Case1) +add_subdirectory(Case2) +add_subdirectory(Case3) +add_subdirectory(Case4) diff --git a/Tests/Dependency/Eight/CMakeLists.txt b/Tests/Dependency/Eight/CMakeLists.txt index 5d8e7564e..db5e2dfb5 100644 --- a/Tests/Dependency/Eight/CMakeLists.txt +++ b/Tests/Dependency/Eight/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Eight EightSrc.c ) -TARGET_LINK_LIBRARIES( Eight Seven ) +add_library( Eight EightSrc.c ) +target_link_libraries( Eight Seven ) diff --git a/Tests/Dependency/Exec/CMakeLists.txt b/Tests/Dependency/Exec/CMakeLists.txt index 97fffe706..a9206857f 100644 --- a/Tests/Dependency/Exec/CMakeLists.txt +++ b/Tests/Dependency/Exec/CMakeLists.txt @@ -1,7 +1,7 @@ # This executable directly depends on NoDepB, NoDepC, SixA and SixB. However, # since NoDepB and NoDepC do not have explicit dependency information, # and they depend on NoDepA, we have to manually specify that dependency. -LINK_LIBRARIES( NoDepB NoDepC NoDepA SixB SixA ) +link_libraries( NoDepB NoDepC NoDepA SixB SixA ) -ADD_EXECUTABLE( exec ExecMain.c ) +add_executable( exec ExecMain.c ) diff --git a/Tests/Dependency/Exec2/CMakeLists.txt b/Tests/Dependency/Exec2/CMakeLists.txt index ee0c74d13..04d6fe810 100644 --- a/Tests/Dependency/Exec2/CMakeLists.txt +++ b/Tests/Dependency/Exec2/CMakeLists.txt @@ -2,11 +2,11 @@ # If the dependencies of Five are emitted, and then we attempt to emit the # dependencies of Seven, then we find that they have already been done. So: # Original line: Eight Five -# Add deps of Five: Eight Five Two ... NoDepA +# Add deps of Five: Eight Five Two ... NoDepA # Now, we must make sure that Seven gets inserted between Five and Two, and # not at the end. Unfortunately, if we get it wrong, the test will only # fail on a platform where the link order makes a difference. -LINK_LIBRARIES( Eight Five ) +link_libraries( Eight Five ) -ADD_EXECUTABLE( exec2 ExecMain.c ) +add_executable( exec2 ExecMain.c ) diff --git a/Tests/Dependency/Exec3/CMakeLists.txt b/Tests/Dependency/Exec3/CMakeLists.txt index b33e732a2..605fbc9f1 100644 --- a/Tests/Dependency/Exec3/CMakeLists.txt +++ b/Tests/Dependency/Exec3/CMakeLists.txt @@ -1,6 +1,6 @@ # Here, Five already has it's immediate dependency, Two satisfied. We must # make sure Two gets output anyway, because Eight indirectly depends on it. -LINK_LIBRARIES( Five Two Eight Five ) +link_libraries( Five Two Eight Five ) -ADD_EXECUTABLE( exec3 ExecMain.c ) +add_executable( exec3 ExecMain.c ) diff --git a/Tests/Dependency/Exec4/CMakeLists.txt b/Tests/Dependency/Exec4/CMakeLists.txt index 6fcb15383..94c6bf588 100644 --- a/Tests/Dependency/Exec4/CMakeLists.txt +++ b/Tests/Dependency/Exec4/CMakeLists.txt @@ -1,6 +1,6 @@ # Even though Five's dependency on Two is explicitly satisfied, Two # must be emitted again in order to satisfy a cyclic dependency on Three. -LINK_LIBRARIES( Five Two Five ) +link_libraries( Five Two Five ) -ADD_EXECUTABLE( exec4 ExecMain.c ) +add_executable( exec4 ExecMain.c ) diff --git a/Tests/Dependency/Five/CMakeLists.txt b/Tests/Dependency/Five/CMakeLists.txt index 27f6a1f5b..19c1c77d3 100644 --- a/Tests/Dependency/Five/CMakeLists.txt +++ b/Tests/Dependency/Five/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Five FiveSrc.c ) -TARGET_LINK_LIBRARIES( Five Two ) +add_library( Five FiveSrc.c ) +target_link_libraries( Five Two ) diff --git a/Tests/Dependency/Four/CMakeLists.txt b/Tests/Dependency/Four/CMakeLists.txt index df0f1624e..71c531fe9 100644 --- a/Tests/Dependency/Four/CMakeLists.txt +++ b/Tests/Dependency/Four/CMakeLists.txt @@ -1,6 +1,6 @@ -INCLUDE_DIRECTORIES(${Dependency_BINARY_DIR}/Two) -ADD_LIBRARY( Four FourSrc.c ) -TARGET_LINK_LIBRARIES( Four One Two NoDepA ) +include_directories(${Dependency_BINARY_DIR}/Two) +add_library( Four FourSrc.c ) +target_link_libraries( Four One Two NoDepA ) # TwoCustom must build before Four. -ADD_DEPENDENCIES(Four TwoCustom) +add_dependencies(Four TwoCustom) diff --git a/Tests/Dependency/NoDepA/CMakeLists.txt b/Tests/Dependency/NoDepA/CMakeLists.txt index cedf185fa..543402d9d 100644 --- a/Tests/Dependency/NoDepA/CMakeLists.txt +++ b/Tests/Dependency/NoDepA/CMakeLists.txt @@ -1 +1 @@ -ADD_LIBRARY( NoDepA NoDepASrc.c ) +add_library( NoDepA NoDepASrc.c ) diff --git a/Tests/Dependency/NoDepB/CMakeLists.txt b/Tests/Dependency/NoDepB/CMakeLists.txt index 0d69f6841..1c70f375c 100644 --- a/Tests/Dependency/NoDepB/CMakeLists.txt +++ b/Tests/Dependency/NoDepB/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( NoDepB NoDepBSrc.c ) +add_library( NoDepB NoDepBSrc.c ) # This library depends on NoDepA, but the # dependency is not explicitly specified. diff --git a/Tests/Dependency/NoDepC/CMakeLists.txt b/Tests/Dependency/NoDepC/CMakeLists.txt index 88b29ba6f..dd41cebb6 100644 --- a/Tests/Dependency/NoDepC/CMakeLists.txt +++ b/Tests/Dependency/NoDepC/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( NoDepC NoDepCSrc.c ) +add_library( NoDepC NoDepCSrc.c ) # This library depends on NoDepA, but the # dependency is not explicitly specified. diff --git a/Tests/Dependency/Seven/CMakeLists.txt b/Tests/Dependency/Seven/CMakeLists.txt index 51a38d8ed..7fba55cb9 100644 --- a/Tests/Dependency/Seven/CMakeLists.txt +++ b/Tests/Dependency/Seven/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Seven SevenSrc.c ) -TARGET_LINK_LIBRARIES( Seven Two ) +add_library( Seven SevenSrc.c ) +target_link_libraries( Seven Two ) diff --git a/Tests/Dependency/Six/CMakeLists.txt b/Tests/Dependency/Six/CMakeLists.txt index d0abdd695..db12051e2 100644 --- a/Tests/Dependency/Six/CMakeLists.txt +++ b/Tests/Dependency/Six/CMakeLists.txt @@ -2,11 +2,11 @@ # use an all-encompassing LINK_LIBRARIES. And sometimes they don't # specify them in the correct order. -LINK_LIBRARIES( Two ) -LINK_LIBRARIES( Five ) +link_libraries( Two ) +link_libraries( Five ) -ADD_LIBRARY( SixA SixASrc.c ) +add_library( SixA SixASrc.c ) -ADD_LIBRARY( SixB SixBSrc.c ) -TARGET_LINK_LIBRARIES( SixB Four ) +add_library( SixB SixBSrc.c ) +target_link_libraries( SixB Four ) diff --git a/Tests/Dependency/Three/CMakeLists.txt b/Tests/Dependency/Three/CMakeLists.txt index 6b20dcb81..3897f0cdd 100644 --- a/Tests/Dependency/Three/CMakeLists.txt +++ b/Tests/Dependency/Three/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_LIBRARY( Three ThreeSrc.c ) -TARGET_LINK_LIBRARIES( Three One Four ) +add_library( Three ThreeSrc.c ) +target_link_libraries( Three One Four ) diff --git a/Tests/Dependency/Two/CMakeLists.txt b/Tests/Dependency/Two/CMakeLists.txt index 587c848f7..19a070328 100644 --- a/Tests/Dependency/Two/CMakeLists.txt +++ b/Tests/Dependency/Two/CMakeLists.txt @@ -1,20 +1,20 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) -ADD_LIBRARY( Two TwoSrc.c ) -TARGET_LINK_LIBRARIES( Two Three ) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) +add_library( Two TwoSrc.c ) +target_link_libraries( Two Three ) # Setup a target to cause failure if Two does not depend on it or if # Two actually links to it. This will test that a utility dependency # on a library target works properly. -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/two-test.h COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in ${CMAKE_CURRENT_BINARY_DIR}/two-test.h DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/two-test.h.in ) -ADD_LIBRARY( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h) -SET_TARGET_PROPERTIES(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1) -TARGET_LINK_LIBRARIES(TwoCustom Three) +add_library( TwoCustom TwoCustomSrc.c ${CMAKE_CURRENT_BINARY_DIR}/two-test.h) +set_target_properties(TwoCustom PROPERTIES EXCLUDE_FROM_ALL 1) +target_link_libraries(TwoCustom Three) # Add a utility dependency to make sure it works without linking. -ADD_DEPENDENCIES(Two TwoCustom) +add_dependencies(Two TwoCustom) diff --git a/Tests/DocTest/DocTest.cxx b/Tests/DocTest/DocTest.cxx index 2263cbd73..a8a62ab6c 100644 --- a/Tests/DocTest/DocTest.cxx +++ b/Tests/DocTest/DocTest.cxx @@ -13,7 +13,7 @@ int main () fprintf(stderr,"failed to find undefined properties file"); return 1; } - + char buffer[1024]; while ( fin ) { @@ -28,6 +28,6 @@ int main () } } fin.close(); - + return result; } diff --git a/Tests/EnforceConfig.cmake.in b/Tests/EnforceConfig.cmake.in index c9028a391..8c0817cd6 100644 --- a/Tests/EnforceConfig.cmake.in +++ b/Tests/EnforceConfig.cmake.in @@ -1,26 +1,26 @@ # Choose a configuration with which to drive CTest tests. -IF(CTEST_CONFIGURATION_TYPE) - SET(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}") -ELSE(CTEST_CONFIGURATION_TYPE) - SET(CTestTest_CONFIG "@CTestTest_CONFIG@") -ENDIF(CTEST_CONFIGURATION_TYPE) +if(CTEST_CONFIGURATION_TYPE) + set(CTestTest_CONFIG "${CTEST_CONFIGURATION_TYPE}") +else() + set(CTestTest_CONFIG "@CTestTest_CONFIG@") +endif() # Choose a configuration that was built if none is given. -IF(NOT CTEST_CONFIGURATION_TYPE) - SET(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@") - GET_FILENAME_COMPONENT(CTEST_DIR "${CTEST_CMD}" PATH) - GET_FILENAME_COMPONENT(CTEST_EXE "${CTEST_CMD}" NAME) - FOREACH(cfg Release Debug MinSizeRel RelWithDebInfo) - IF(NOT CTEST_CONFIGURATION_TYPE) - IF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") - SET(CTEST_CONFIGURATION_TYPE ${cfg}) - ENDIF(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") - ENDIF(NOT CTEST_CONFIGURATION_TYPE) - ENDFOREACH(cfg) - IF(NOT CTEST_CONFIGURATION_TYPE) - SET(CTEST_CONFIGURATION_TYPE NoConfig) - ENDIF(NOT CTEST_CONFIGURATION_TYPE) - MESSAGE("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") -ENDIF(NOT CTEST_CONFIGURATION_TYPE) +if(NOT CTEST_CONFIGURATION_TYPE) + set(CTEST_CMD "@CMAKE_CTEST_COMMAND@@CMAKE_EXECUTABLE_SUFFIX@") + get_filename_component(CTEST_DIR "${CTEST_CMD}" PATH) + get_filename_component(CTEST_EXE "${CTEST_CMD}" NAME) + foreach(cfg Release Debug MinSizeRel RelWithDebInfo) + if(NOT CTEST_CONFIGURATION_TYPE) + if(EXISTS "${CTEST_DIR}/${cfg}/${CTEST_EXE}") + set(CTEST_CONFIGURATION_TYPE ${cfg}) + endif() + endif() + endforeach() + if(NOT CTEST_CONFIGURATION_TYPE) + set(CTEST_CONFIGURATION_TYPE NoConfig) + endif() + message("Guessing configuration ${CTEST_CONFIGURATION_TYPE}") +endif() @TEST_HOME_ENV_CODE@ diff --git a/Tests/ExportImport/CMakeLists.txt b/Tests/ExportImport/CMakeLists.txt index ccfb8940c..d6593e824 100644 --- a/Tests/ExportImport/CMakeLists.txt +++ b/Tests/ExportImport/CMakeLists.txt @@ -14,13 +14,13 @@ set_property( if(CMAKE_CONFIGURATION_TYPES) set(NESTED_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") -else(CMAKE_CONFIGURATION_TYPES) +else() if(CMAKE_BUILD_TYPE) set(NESTED_CONFIG_TYPE -C "${CMAKE_BUILD_TYPE}") - else(CMAKE_BUILD_TYPE) + else() set(NESTED_CONFIG_TYPE) - endif(CMAKE_BUILD_TYPE) -endif(CMAKE_CONFIGURATION_TYPES) + endif() +endif() if(MINGW OR MSYS) # Test CMAKE_GNUtoMS whether we have VS or not. diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index f06a4659f..e19ab88de 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -56,7 +56,7 @@ add_library(testLib6 STATIC testLib6.cxx testLib6c.c) set(VS6) if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(VS6 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() # Test using the target_link_libraries command to set the # LINK_INTERFACE_LIBRARIES* properties. We construct two libraries @@ -87,6 +87,18 @@ target_link_libraries(testLibCycleA testLibCycleB) target_link_libraries(testLibCycleB testLibCycleA) set_property(TARGET testLibCycleA PROPERTY LINK_INTERFACE_MULTIPLICITY 3) +# Test exporting dependent libraries into different exports +add_library(testLibRequired testLibRequired.c) +add_library(testLibDepends testLibDepends.c) +target_link_libraries(testLibDepends testLibRequired) + +install(TARGETS testLibRequired EXPORT RequiredExp DESTINATION lib ) +install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredConfig.cmake DESTINATION lib/cmake/testLibRequired) + +install(TARGETS testLibDepends EXPORT DependsExp DESTINATION lib ) +install(EXPORT DependsExp FILE testLibDependsConfig.cmake DESTINATION lib/cmake/testLibDepends) + + # Install and export from install tree. install( TARGETS @@ -129,7 +141,7 @@ install(EXPORT exp NAMESPACE exp_ DESTINATION lib/exp) # Install testLib5.dll outside the export. if(WIN32) install(TARGETS testLib5 RUNTIME DESTINATION bin) -endif(WIN32) +endif() # Export from build tree. export(TARGETS testExe1 testLib1 testLib2 testLib3 diff --git a/Tests/ExportImport/Export/testLibDepends.c b/Tests/ExportImport/Export/testLibDepends.c new file mode 100644 index 000000000..2849b336d --- /dev/null +++ b/Tests/ExportImport/Export/testLibDepends.c @@ -0,0 +1,4 @@ + +extern int testLibRequired(void); + +int testLibDepends(void) { return testLibRequired(); } diff --git a/Tests/ExportImport/Export/testLibRequired.c b/Tests/ExportImport/Export/testLibRequired.c new file mode 100644 index 000000000..e126d44e7 --- /dev/null +++ b/Tests/ExportImport/Export/testLibRequired.c @@ -0,0 +1 @@ +int testLibRequired(void) { return 0; } diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index a21e1b0f8..884179225 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -4,6 +4,10 @@ include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake) # Import targets from the exported install tree. include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake) +# Import two exports, where the Depends one depends on an exported target from the Required one: +include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibRequired/testLibRequiredConfig.cmake) +include(${CMAKE_INSTALL_PREFIX}/lib/cmake/testLibDepends/testLibDependsConfig.cmake) + # Try referencing an executable imported from the install tree. add_custom_command( OUTPUT ${Import_BINARY_DIR}/exp_generated.c @@ -73,7 +77,7 @@ target_link_libraries(imp_mod1b bld_testExe2) foreach(c DEBUG RELWITHDEBINFO) set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG) set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG) -endforeach(c) +endforeach() #----------------------------------------------------------------------------- # Create a custom target to generate a header for the libraries below. diff --git a/Tests/ExportImport/InitialCache.cmake.in b/Tests/ExportImport/InitialCache.cmake.in index 4893f7020..98d355f8f 100644 --- a/Tests/ExportImport/InitialCache.cmake.in +++ b/Tests/ExportImport/InitialCache.cmake.in @@ -1,15 +1,15 @@ -SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") -SET(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags") -SET(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags") -SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler") -SET(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags") -SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags") -SET(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix") -SET(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH") -SET(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS") +set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@" CACHE STRING "C Compiler") +set(CMAKE_C_FLAGS "@CMAKE_C_FLAGS@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_DEBUG "@CMAKE_C_FLAGS_DEBUG@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_RELEASE "@CMAKE_C_FLAGS_RELEASE@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_MINSIZEREL "@CMAKE_C_FLAGS_MINSIZEREL@" CACHE STRING "C Flags") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "@CMAKE_C_FLAGS_RELWITHDEBINFO@" CACHE STRING "C Flags") +set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@" CACHE STRING "C++ Compiler") +set(CMAKE_CXX_FLAGS "@CMAKE_CXX_FLAGS@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_DEBUG "@CMAKE_CXX_FLAGS_DEBUG@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_RELEASE "@CMAKE_CXX_FLAGS_RELEASE@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_MINSIZEREL "@CMAKE_CXX_FLAGS_MINSIZEREL@" CACHE STRING "C++ Flags") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@" CACHE STRING "C++ Flags") +set(CMAKE_INSTALL_PREFIX "@ExportImport_BINARY_DIR@/Root" CACHE STRING "Installation Prefix") +set(CMAKE_SKIP_RPATH ON CACHE BOOL "No RPATH") +set(CMAKE_GNUtoMS "@ExportImport_GNUtoMS@" CACHE BOOL "CMAKE_GNUtoMS") diff --git a/Tests/ExternalOBJ/CMakeLists.txt b/Tests/ExternalOBJ/CMakeLists.txt index 683e7997c..458c88bfd 100644 --- a/Tests/ExternalOBJ/CMakeLists.txt +++ b/Tests/ExternalOBJ/CMakeLists.txt @@ -1,51 +1,51 @@ cmake_minimum_required (VERSION 2.6) -PROJECT (ExternalOBJ) +project (ExternalOBJ) -IF(APPLE) +if(APPLE) # set _CMAKE_OSX_MACHINE to umame -m - EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) + exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) # check for Power PC and change to ppc - IF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(_CMAKE_OSX_MACHINE ppc) - ENDIF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -ENDIF(APPLE) + if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + set(_CMAKE_OSX_MACHINE ppc) + endif() + set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) +endif() # Build the external object file. -TRY_COMPILE(EXTERNAL_OBJECT_BUILT +try_compile(EXTERNAL_OBJECT_BUILT ${ExternalOBJ_BINARY_DIR}/Object ${ExternalOBJ_SOURCE_DIR}/Object Object external OUTPUT_VARIABLE OUTPUT ) -IF(EXTERNAL_OBJECT_BUILT) - MESSAGE( +if(EXTERNAL_OBJECT_BUILT) + message( "Building external_object.cxx succeeded with the following output:\n" "[${OUTPUT}]" ) -ELSE(EXTERNAL_OBJECT_BUILT) - MESSAGE(FATAL_ERROR +else() + message(FATAL_ERROR "Building external_object.cxx failed with the following output:\n" "[${OUTPUT}]" ) -ENDIF(EXTERNAL_OBJECT_BUILT) +endif() # Find the external object file. -SET(DIR ${ExternalOBJ_BINARY_DIR}/Object) -FILE(GLOB_RECURSE EXTERNAL_OBJECT +set(DIR ${ExternalOBJ_BINARY_DIR}/Object) +file(GLOB_RECURSE EXTERNAL_OBJECT "${DIR}/external_object*${CMAKE_CXX_OUTPUT_EXTENSION}") -IF(EXTERNAL_OBJECT) - LIST (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT) - MESSAGE("Found \"${EXTERNAL_OBJECT}\".") -ELSE(EXTERNAL_OBJECT) - MESSAGE(FATAL_ERROR "Could not find external object.") -ENDIF(EXTERNAL_OBJECT) +if(EXTERNAL_OBJECT) + list (GET EXTERNAL_OBJECT 0 EXTERNAL_OBJECT) + message("Found \"${EXTERNAL_OBJECT}\".") +else() + message(FATAL_ERROR "Could not find external object.") +endif() # Test creation of external objects by custom commands. -SET(CUSTOM_OBJECT +set(CUSTOM_OBJECT ${CMAKE_CURRENT_BINARY_DIR}/custom_object${CMAKE_C_OUTPUT_EXTENSION}) -ADD_CUSTOM_COMMAND( +add_custom_command( OUTPUT ${CUSTOM_OBJECT} COMMAND ${CMAKE_COMMAND} -E copy ${EXTERNAL_OBJECT} ${CUSTOM_OBJECT} DEPENDS ${EXTERNAL_OBJECT} @@ -53,11 +53,11 @@ ADD_CUSTOM_COMMAND( message("${EXTERNAL_OBJECT}") # Build an executable using the external object file. -ADD_EXECUTABLE(ExternalOBJ executable.cxx ${CUSTOM_OBJECT}) +add_executable(ExternalOBJ executable.cxx ${CUSTOM_OBJECT}) # A bug showed up in VS2010 where an object file that was # part of a custom commad output worked, but ones that were # not didn't work. So, repeat the executable using the object # directly and not from the output of the copy. -ADD_EXECUTABLE(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT}) +add_executable(ExternalOBJ2 executable.cxx ${EXTERNAL_OBJECT}) -ADD_SUBDIRECTORY(Sub) +add_subdirectory(Sub) diff --git a/Tests/ExternalOBJ/Object/CMakeLists.txt b/Tests/ExternalOBJ/Object/CMakeLists.txt index 6f1d7e3fb..dbfe09ee6 100644 --- a/Tests/ExternalOBJ/Object/CMakeLists.txt +++ b/Tests/ExternalOBJ/Object/CMakeLists.txt @@ -1,13 +1,13 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Object) -IF(APPLE) +project(Object) +if(APPLE) # set _CMAKE_OSX_MACHINE to umame -m - EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) + exec_program(uname ARGS -m OUTPUT_VARIABLE _CMAKE_OSX_MACHINE) # check for Power PC and change to ppc - IF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(_CMAKE_OSX_MACHINE ppc) - ENDIF("${_CMAKE_OSX_MACHINE}" MATCHES "Power") - SET(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) -ENDIF(APPLE) + if("${_CMAKE_OSX_MACHINE}" MATCHES "Power") + set(_CMAKE_OSX_MACHINE ppc) + endif() + set(CMAKE_OSX_ARCHITECTURES ${_CMAKE_OSX_MACHINE}) +endif() -ADD_EXECUTABLE(external external_object.cxx external_main.cxx) +add_executable(external external_object.cxx external_main.cxx) diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 7a7626199..3f8e8273d 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) @@ -188,7 +189,7 @@ set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") set(proj TutorialStep1-LocalNoDirTGZ) ExternalProject_Add(${proj} URL "${CMAKE_CURRENT_SOURCE_DIR}/Step1NoDir.tgz" - URL_MD5 0b8182edcecdf40bf1c9d71d7d259f78 + URL_HASH SHA256=496229e2a5ed620a37c385ad9406004a18026beab8b55dd2c4565d4b7f1d5383 CMAKE_GENERATOR "${CMAKE_GENERATOR}" CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> INSTALL_COMMAND "" @@ -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/TryCheckout.cmake b/Tests/ExternalProject/TryCheckout.cmake index de069ebe4..6a396c339 100644 --- a/Tests/ExternalProject/TryCheckout.cmake +++ b/Tests/ExternalProject/TryCheckout.cmake @@ -25,7 +25,7 @@ function(try_cvs_checkout repository module dir result_var) message(STATUS "try_cvs_checkout -- done") endif() -endfunction(try_cvs_checkout) +endfunction() function(try_svn_checkout repository dir result_var) @@ -51,4 +51,4 @@ function(try_svn_checkout repository dir result_var) message(STATUS "try_svn_checkout -- done") endif() -endfunction(try_svn_checkout) +endfunction() diff --git a/Tests/ExternalProject/hgrepo.tgz b/Tests/ExternalProject/hgrepo.tgz Binary files differnew file mode 100644 index 000000000..0d75ce22f --- /dev/null +++ b/Tests/ExternalProject/hgrepo.tgz diff --git a/Tests/FindModulesExecuteAll/CMakeLists.txt b/Tests/FindModulesExecuteAll/CMakeLists.txt index df5162652..21b9d3897 100644 --- a/Tests/FindModulesExecuteAll/CMakeLists.txt +++ b/Tests/FindModulesExecuteAll/CMakeLists.txt @@ -23,8 +23,8 @@ foreach(module ${all_modules}) # disabled for now, since too many modules break: # if(NOT DEFINED ${packageNameUpper}_FOUND) # message(SEND_ERROR "${packageNameUpper}_FOUND not defined !") -# endif(NOT DEFINED ${packageNameUpper}_FOUND) +# endif() -endforeach(module ${all_modules}) +endforeach() add_executable(FindModulesExecuteAll main.c) diff --git a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake index 321fa118e..979bbdf18 100644 --- a/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.1/BazConfigVersion.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 1.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake index 4576809f5..17caaa728 100644 --- a/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake +++ b/Tests/FindPackageTest/Baz 1.2/CMake/BazConfigVersion.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 1.2) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/CMakeLists.txt b/Tests/FindPackageTest/CMakeLists.txt index e85fb4dd2..bca149bea 100644 --- a/Tests/FindPackageTest/CMakeLists.txt +++ b/Tests/FindPackageTest/CMakeLists.txt @@ -1,86 +1,86 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(FindPackageTest) +project(FindPackageTest) -LIST(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) # Look for a package which uses FindPackageHandleStandardArgs.cmake with the # new (as of cmake 2.8.3) syntax. This works only if CMP0017 is set to NEW, # because otherwise FindPackageHandleStandardArgs.cmake from the current # directory is included (via CMAKE_MODULE_PATH). -CMAKE_POLICY(SET CMP0017 NEW) -FIND_PACKAGE(ZLIB QUIET) +cmake_policy(SET CMP0017 NEW) +find_package(ZLIB QUIET) # Look for a package that has a find module and may be found. -FIND_PACKAGE(OpenGL QUIET) +find_package(OpenGL QUIET) # Look for a package that has no find module and will not be found. -FIND_PACKAGE(NotAPackage QUIET) +find_package(NotAPackage QUIET) # Look for a package that has an advanced find module. -FIND_PACKAGE(VTK QUIET) +find_package(VTK QUIET) -ADD_EXECUTABLE(FindPackageTest FindPackageTest.cxx) +add_executable(FindPackageTest FindPackageTest.cxx) # test behaviour of cmFindBase wrt. the CMAKE_PREFIX_PATH variable # foo.h should be found in ${CMAKE_CURRENT_SOURCE_DIR}/include: -SET(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}") -FIND_PATH(FOO_DIR foo.h) +set(CMAKE_PREFIX_PATH /blub /blah "${CMAKE_CURRENT_SOURCE_DIR}") +find_path(FOO_DIR foo.h) -IF(NOT FOO_DIR) - MESSAGE(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include +if(NOT FOO_DIR) + message(FATAL_ERROR "Did not find foo.h which is in ${CMAKE_CURRENT_SOURCE_DIR}/include CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}") -ENDIF(NOT FOO_DIR) +endif() -FIND_PACKAGE(VersionTestA 1) -FIND_PACKAGE(VersionTestB 1.2) -FIND_PACKAGE(VersionTestC 1.2.3) -FIND_PACKAGE(VersionTestD 1.2.3.4) +find_package(VersionTestA 1) +find_package(VersionTestB 1.2) +find_package(VersionTestC 1.2.3) +find_package(VersionTestD 1.2.3.4) -FIND_PACKAGE(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) -IF(NOT LOTSOFCOMPONENTS_FOUND) - MESSAGE(SEND_ERROR "LotsOfComponents not found !") -ENDIF() +find_package(LotsOfComponents COMPONENTS AComp OPTIONAL_COMPONENTS BComp CComp) +if(NOT LOTSOFCOMPONENTS_FOUND) + message(SEND_ERROR "LotsOfComponents not found !") +endif() #----------------------------------------------------------------------------- # Test system package registry if possible. -SET(CMakeTestSystemPackage "") -IF(WIN32 AND NOT CYGWIN) +set(CMakeTestSystemPackage "") +if(WIN32 AND NOT CYGWIN) # Try writing a value to the system package registry. - SET(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage") - SET(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage") - SET(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data") - FILE(WRITE ${_file} "${_data}\n") - EXECUTE_PROCESS( + set(_data "${FindPackageTest_SOURCE_DIR}/SystemPackage") + set(_key "HKLM\\Software\\Kitware\\CMake\\Packages\\CMakeTestSystemPackage") + set(_file "${FindPackageTest_BINARY_DIR}/CMakeTestSystemPackage.data") + file(WRITE ${_file} "${_data}\n") + execute_process( COMMAND ${CMAKE_COMMAND} -E md5sum ${_file} OUTPUT_VARIABLE _output ERROR_VARIABLE _error RESULT_VARIABLE _failed OUTPUT_STRIP_TRAILING_WHITESPACE ) - STRING(REGEX REPLACE " .*" "" _value "${_output}") - IF(NOT _failed AND _value) - EXECUTE_PROCESS( + string(REGEX REPLACE " .*" "" _value "${_output}") + if(NOT _failed AND _value) + execute_process( COMMAND reg add "${_key}" /v "${_value}" /t REG_SZ /d "${_data}" /f OUTPUT_VARIABLE _output ERROR_VARIABLE _output RESULT_VARIABLE _failed ) - ENDIF() + endif() # If the above worked, add the rest of the test and a rule to # cleanup the value. - IF(NOT _failed) - MESSAGE(STATUS "HKLM is writable: enabling CMakeTestSystemPackage") - SET(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f) - SET(CMakeTestSystemPackage CMakeTestSystemPackage) - ELSE() - MESSAGE(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage") - ENDIF() -ENDIF() + if(NOT _failed) + message(STATUS "HKLM is writable: enabling CMakeTestSystemPackage") + set(CMakeTestSystemPackage_CLEANUP reg delete "${_key}" /v "${_value}" /f) + set(CMakeTestSystemPackage CMakeTestSystemPackage) + else() + message(STATUS "HKLM is readonly: disabling CMakeTestSystemPackage") + endif() +endif() #----------------------------------------------------------------------------- -#SET(CMAKE_FIND_DEBUG_MODE 1) +#set(CMAKE_FIND_DEBUG_MODE 1) # For purposes of the test wipe out previous find results. -SET(PACKAGES +set(PACKAGES foo Foo Bar Blub TFramework Tframework TApp Tapp Special VersionedA VersionedB VersionedC VersionedD VersionedE WrongA WrongB WrongC WrongD @@ -91,14 +91,14 @@ SET(PACKAGES SetFoundTRUE SetFoundFALSE ${CMakeTestSystemPackage} ) -FOREACH(p ${PACKAGES}) - SET(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -ENDFOREACH(p) +foreach(p ${PACKAGES}) + set(${p}_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) +endforeach() # Enable framework and bundle searching. Make sure bundles are found # before unix-syle packages. -SET(CMAKE_FIND_FRAMEWORK LAST) -SET(CMAKE_FIND_APPBUNDLE FIRST) +set(CMAKE_FIND_FRAMEWORK LAST) +set(CMAKE_FIND_APPBUNDLE FIRST) # Set the wrong answer for a find to make sure it re-finds. set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) @@ -108,219 +108,219 @@ set(VersionedA_DIR ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-4.0) set(CMAKE_IGNORE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/lib/cmake/zot-3.1) # Look for packages with new-style signatures. -FIND_PACKAGE(foo NO_MODULE) -FIND_PACKAGE(Foo CONFIGS FooConfig.cmake) -FIND_PACKAGE(Bar) -SET(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE) -FIND_PACKAGE(Blub NO_MODULE) -FIND_PACKAGE(TFramework CONFIGS TFrameworkConfig.cmake) -FIND_PACKAGE(Tframework) -FIND_PACKAGE(TApp) -FIND_PACKAGE(Tapp CONFIGS tapp-config.cmake) -FIND_PACKAGE(Special NAMES Suffix SuffixTest PATH_SUFFIXES test) -FIND_PACKAGE(VersionedA 2 NAMES zot) -FIND_PACKAGE(VersionedB 3.1 EXACT NAMES zot) -FIND_PACKAGE(VersionedC 4.0 EXACT NAMES zot) -FIND_PACKAGE(VersionedD 1.1 EXACT NAMES Baz) -FIND_PACKAGE(VersionedE 1.2 EXACT NAMES Baz) +find_package(foo NO_MODULE) +find_package(Foo CONFIGS FooConfig.cmake) +find_package(Bar) +set(CMAKE_DISABLE_FIND_PACKAGE_Blub TRUE) +find_package(Blub NO_MODULE) +find_package(TFramework CONFIGS TFrameworkConfig.cmake) +find_package(Tframework) +find_package(TApp) +find_package(Tapp CONFIGS tapp-config.cmake) +find_package(Special NAMES Suffix SuffixTest PATH_SUFFIXES test) +find_package(VersionedA 2 NAMES zot) +find_package(VersionedB 3.1 EXACT NAMES zot) +find_package(VersionedC 4.0 EXACT NAMES zot) +find_package(VersionedD 1.1 EXACT NAMES Baz) +find_package(VersionedE 1.2 EXACT NAMES Baz) # Test Config files which set Xyz_FOUND themselves: -FIND_PACKAGE(SetFoundTRUE NO_MODULE) -FIND_PACKAGE(SetFoundFALSE NO_MODULE) +find_package(SetFoundTRUE NO_MODULE) +find_package(SetFoundFALSE NO_MODULE) # Test wrong initial path when result is present. -SET(WrongA_DIR "${VersionedD_DIR}") -FIND_PACKAGE(WrongA 1.2 EXACT NAMES Baz) +set(WrongA_DIR "${VersionedD_DIR}") +find_package(WrongA 1.2 EXACT NAMES Baz) # Test wrong initial cache entry of UNINITIALIZED type when result is present. -SET(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) -GET_PROPERTY(type CACHE WrongB_DIR PROPERTY TYPE) -FIND_PACKAGE(WrongB 1.2 EXACT NAMES Baz) +set(WrongB_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) +get_property(type CACHE WrongB_DIR PROPERTY TYPE) +find_package(WrongB 1.2 EXACT NAMES Baz) # Test wrong initial path when result is missing. -SET(WrongC_DIR "${VersionedD_DIR}") -FIND_PACKAGE(WrongC 1.3 EXACT QUIET NAMES Baz) +set(WrongC_DIR "${VersionedD_DIR}") +find_package(WrongC 1.3 EXACT QUIET NAMES Baz) # Test wrong initial cache entry of UNINITIALIZED type when result is missing. -SET(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) -GET_PROPERTY(type CACHE WrongD_DIR PROPERTY TYPE) -FIND_PACKAGE(WrongD 1.3 EXACT QUIET NAMES Baz) +set(WrongD_DIR "${VersionedD_DIR}" CACHE UNINITIALIZED "Wrong Value" FORCE) +get_property(type CACHE WrongD_DIR PROPERTY TYPE) +find_package(WrongD 1.3 EXACT QUIET NAMES Baz) # HINTS should override the system but PATHS should not -LIST(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A") -FIND_PACKAGE(wibbleA NAMES wibble PATHS B) -FIND_PACKAGE(wibbleB NAMES wibble HINTS B) +list(INSERT CMAKE_SYSTEM_PREFIX_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/A") +find_package(wibbleA NAMES wibble PATHS B) +find_package(wibbleB NAMES wibble HINTS B) # Look for package with recursive find-modules. -FIND_PACKAGE(RecursiveA COMPONENTS A) -FIND_PACKAGE(RecursiveB 2) -FIND_PACKAGE(RecursiveC 3.1 EXACT) +find_package(RecursiveA COMPONENTS A) +find_package(RecursiveB 2) +find_package(RecursiveC 3.1 EXACT) # Test architecture-specific search directories. -SET(CMAKE_LIBRARY_ARCHITECTURE arch) -FIND_PACKAGE(ArchA NAMES Bar) -FIND_PACKAGE(ArchB NAMES Foo CONFIGS FooConfig.cmake) -FIND_PACKAGE(ArchC 3.1 EXACT NAMES zot) -FIND_PACKAGE(ArchD 4.0 EXACT NAMES zot) -UNSET(CMAKE_LIBRARY_ARCHITECTURE) +set(CMAKE_LIBRARY_ARCHITECTURE arch) +find_package(ArchA NAMES Bar) +find_package(ArchB NAMES Foo CONFIGS FooConfig.cmake) +find_package(ArchC 3.1 EXACT NAMES zot) +find_package(ArchD 4.0 EXACT NAMES zot) +unset(CMAKE_LIBRARY_ARCHITECTURE) # Test <Package>_DIR environment variable. # We erase the main prefix path to ensure the env var is used. -SET(CMAKE_PREFIX_PATH) -SET(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") -FIND_PACKAGE(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work -FIND_PACKAGE(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail +set(CMAKE_PREFIX_PATH) +set(ENV{EnvA_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/lib/zot-3.1") +find_package(EnvA 3.1 EXACT QUIET NAMES zot) # Should Work +find_package(EnvB 3.1 EXACT QUIET NAMES zot) # Should Fail # Test system package registry if available. -IF(CMakeTestSystemPackage) - FIND_PACKAGE(CMakeTestSystemPackage) - EXECUTE_PROCESS(COMMAND ${CMakeTestSystemPackage_CLEANUP} +if(CMakeTestSystemPackage) + find_package(CMakeTestSystemPackage) + execute_process(COMMAND ${CMakeTestSystemPackage_CLEANUP} OUTPUT_VARIABLE _output ERROR_VARIABLE _error) -ENDIF() +endif() # Expected locations at which packages should be found. -SET(foo_EXPECTED "lib/foo-1.2/foo-config.cmake") -SET(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake") -SET(Bar_EXPECTED "lib/Bar/BarConfig.cmake") -SET(Blub_MISSING "") -SET(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake") -SET(TFramework_EXPECTED +set(foo_EXPECTED "lib/foo-1.2/foo-config.cmake") +set(Foo_EXPECTED "lib/foo-1.2/CMake/FooConfig.cmake") +set(Bar_EXPECTED "lib/Bar/BarConfig.cmake") +set(Blub_MISSING "") +set(Special_EXPECTED "lib/suffix/test/SuffixTestConfig.cmake") +set(TFramework_EXPECTED "TFramework.framework/Versions/A/Resources/CMake/TFrameworkConfig.cmake") -SET(Tframework_EXPECTED +set(Tframework_EXPECTED "TFramework.framework/Versions/A/Resources/tframework-config.cmake") -SET(TApp_EXPECTED +set(TApp_EXPECTED "TApp.app/Contents/Resources/TAppConfig.cmake") -SET(Tapp_EXPECTED +set(Tapp_EXPECTED "TApp.app/Contents/Resources/cmake/tapp-config.cmake") -SET(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake") -SET(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake") -SET(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake") -SET(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake") -SET(WrongA_EXPECTED "${VersionedE_EXPECTED}") -SET(WrongB_EXPECTED "${VersionedE_EXPECTED}") -SET(WrongC_MISSING "WrongC_DIR-NOTFOUND") -SET(WrongD_MISSING "WrongD_DIR-NOTFOUND") -SET(wibbleA_EXPECTED "A/wibble-config.cmake") -SET(wibbleB_EXPECTED "B/wibble-config.cmake") -SET(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake") -SET(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake") -SET(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake") -SET(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake") -SET(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake") -SET(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake") -SET(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake") -SET(EnvB_MISSING "EnvB_DIR-NOTFOUND") -SET(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake") -SET(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -SET(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") +set(VersionedA_EXPECTED "lib/zot-2.0/zot-config.cmake") +set(VersionedB_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(VersionedC_EXPECTED "lib/cmake/zot-4.0/zot-config.cmake") +set(VersionedD_EXPECTED "Baz 1.1/BazConfig.cmake") +set(VersionedE_EXPECTED "Baz 1.2/CMake/BazConfig.cmake") +set(WrongA_EXPECTED "${VersionedE_EXPECTED}") +set(WrongB_EXPECTED "${VersionedE_EXPECTED}") +set(WrongC_MISSING "WrongC_DIR-NOTFOUND") +set(WrongD_MISSING "WrongD_DIR-NOTFOUND") +set(wibbleA_EXPECTED "A/wibble-config.cmake") +set(wibbleB_EXPECTED "B/wibble-config.cmake") +set(RecursiveA_EXPECTED "lib/RecursiveA/recursivea-config.cmake") +set(RecursiveB_EXPECTED "lib/zot-2.0/zot-config.cmake") +set(RecursiveC_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(ArchA_EXPECTED "lib/arch/Bar/BarConfig.cmake") +set(ArchB_EXPECTED "lib/arch/foo-1.2/CMake/FooConfig.cmake") +set(ArchC_EXPECTED "lib/arch/zot-3.1/zot-config.cmake") +set(ArchD_EXPECTED "lib/arch/cmake/zot-4.0/zot-config.cmake") +set(EnvA_EXPECTED "lib/zot-3.1/zot-config.cmake") +set(EnvB_MISSING "EnvB_DIR-NOTFOUND") +set(SetFoundTRUE_EXPECTED "cmake/SetFoundTRUEConfig.cmake") +set(SetFoundFALSE_MISSING "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +set(CMakeTestSystemPackage_EXPECTED "SystemPackage/CMakeTestSystemPackageConfig.cmake") # Check the results. -FOREACH(p ${PACKAGES}) - IF(DEFINED ${p}_MISSING) +foreach(p ${PACKAGES}) + if(DEFINED ${p}_MISSING) # Check and report failure. - IF(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}") - MESSAGE(SEND_ERROR + if(NOT "${${p}_DIR}" STREQUAL "${${p}_MISSING}") + message(SEND_ERROR "Package ${p} should have been [${${p}_MISSING}] but " "was [${${p}_DIR}]") - ENDIF() - IF(${p}_FOUND) - MESSAGE(SEND_ERROR + endif() + if(${p}_FOUND) + message(SEND_ERROR "Package ${p} should not have been found, but ${p}_FOUND is set to " "\"${${p}_FOUND}\"") - ENDIF() - ELSEIF(${p}_FOUND) + endif() + elseif(${p}_FOUND) # Convert to relative path for comparison to expected location. - FILE(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}" + file(RELATIVE_PATH REL_${p}_CONFIG "${CMAKE_CURRENT_SOURCE_DIR}" "${${p}_CONFIG}") # Debugging output. - IF(CMAKE_FIND_DEBUG_MODE) - MESSAGE("Package ${p} found [${REL_${p}_CONFIG}]") - ENDIF(CMAKE_FIND_DEBUG_MODE) + if(CMAKE_FIND_DEBUG_MODE) + message("Package ${p} found [${REL_${p}_CONFIG}]") + endif() # Check and report failure. - IF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") - MESSAGE(SEND_ERROR + if(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") + message(SEND_ERROR "Package ${p} should have been [${${p}_EXPECTED}] but " "was [${REL_${p}_CONFIG}]") - ENDIF(NOT "${REL_${p}_CONFIG}" STREQUAL "${${p}_EXPECTED}") - ELSE() - MESSAGE(SEND_ERROR "Package ${p} not found!") - ENDIF() -ENDFOREACH(p) + endif() + else() + message(SEND_ERROR "Package ${p} not found!") + endif() +endforeach() # Check that version information was extracted. -IF(NOT "${VersionedA_VERSION}" STREQUAL "2.0") - MESSAGE(SEND_ERROR +if(NOT "${VersionedA_VERSION}" STREQUAL "2.0") + message(SEND_ERROR "Package VersionedA is version [${VersionedA_VERSION}], not [2.0]") -ENDIF(NOT "${VersionedA_VERSION}" STREQUAL "2.0") -IF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") - MESSAGE(SEND_ERROR +endif() +if(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") + message(SEND_ERROR "Package VersionedA is major version [${VersionedA_VERSION_MAJOR}], not [2]") -ENDIF(NOT "${VersionedA_VERSION_MAJOR}" STREQUAL "2") -IF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") - MESSAGE(SEND_ERROR +endif() +if(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") + message(SEND_ERROR "Package VersionedA is minor version [${VersionedA_VERSION_MINOR}], not [0]") -ENDIF(NOT "${VersionedA_VERSION_MINOR}" STREQUAL "0") +endif() -IF(NOT "${VersionedB_VERSION}" STREQUAL "3.1") - MESSAGE(SEND_ERROR +if(NOT "${VersionedB_VERSION}" STREQUAL "3.1") + message(SEND_ERROR "Package VersionedB is version [${VersionedB_VERSION}], not [3.1]") -ENDIF(NOT "${VersionedB_VERSION}" STREQUAL "3.1") -IF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") - MESSAGE(SEND_ERROR +endif() +if(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") + message(SEND_ERROR "Package VersionedB is major version [${VersionedB_VERSION_MAJOR}], not [3]") -ENDIF(NOT "${VersionedB_VERSION_MAJOR}" STREQUAL "3") -IF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") - MESSAGE(SEND_ERROR +endif() +if(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") + message(SEND_ERROR "Package VersionedB is minor version [${VersionedB_VERSION_MINOR}], not [1]") -ENDIF(NOT "${VersionedB_VERSION_MINOR}" STREQUAL "1") +endif() -IF(NOT "${Special_VERSION}" STREQUAL "1.2") - MESSAGE(SEND_ERROR +if(NOT "${Special_VERSION}" STREQUAL "1.2") + message(SEND_ERROR "Package Special is version [${Special_VERSION}], not [1.2]") -ENDIF(NOT "${Special_VERSION}" STREQUAL "1.2") -IF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR +endif() +if(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "Package Special is major version [${Special_VERSION_MAJOR}], not [1]") -ENDIF(NOT "${Special_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR +endif() +if(NOT "${Special_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "Package Special is minor version [${Special_VERSION_MINOR}], not [2]") -ENDIF(NOT "${Special_VERSION_MINOR}" STREQUAL "2") +endif() # Test version number comparison. -IF(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") - MESSAGE(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") -ENDIF() -IF(NOT "1.2" VERSION_LESS "1.10") - MESSAGE(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") -ENDIF() -IF(NOT "1.02" VERSION_GREATER "1.1") - MESSAGE(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") -ENDIF() -IF("1.2.3" VERSION_GREATER "1.2.3.4") - MESSAGE(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") -ENDIF() -IF(NOT "1.2" VERSION_EQUAL "1.2.0.0") - MESSAGE(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") -ENDIF() +if(NOT "1.2.3.4" VERSION_LESS "1.2.3.5") + message(SEND_ERROR "1.2.3.4 VERSION_LESS 1.2.3.5 is not true!") +endif() +if(NOT "1.2" VERSION_LESS "1.10") + message(SEND_ERROR "1.2 VERSION_LESS 1.10 is not true!") +endif() +if(NOT "1.02" VERSION_GREATER "1.1") + message(SEND_ERROR "1.02 VERSION_GREATER 1.1 is not true!") +endif() +if("1.2.3" VERSION_GREATER "1.2.3.4") + message(SEND_ERROR "1.2.3 VERSION_GREATER 1.2.3.4 is not false!") +endif() +if(NOT "1.2" VERSION_EQUAL "1.2.0.0") + message(SEND_ERROR "1.2 VERSION_EQUAL 1.2.0.0 is not true!") +endif() #----------------------------------------------------------------------------- # Test export(PACKAGE) with find_package. -MESSAGE(STATUS "Preparing export(PACKAGE) test project") -TRY_COMPILE(EXPORTER_COMPILED +message(STATUS "Preparing export(PACKAGE) test project") +try_compile(EXPORTER_COMPILED ${FindPackageTest_BINARY_DIR}/Exporter ${FindPackageTest_SOURCE_DIR}/Exporter CMakeTestExportPackage dummy OUTPUT_VARIABLE output) -MESSAGE(STATUS "Searching for export(PACKAGE) test project") -SET(CMakeTestExportPackage_DIR "" CACHE FILEPATH +message(STATUS "Searching for export(PACKAGE) test project") +set(CMakeTestExportPackage_DIR "" CACHE FILEPATH "Wipe out find results for testing." FORCE) -STRING(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) -FIND_PACKAGE(CMakeTestExportPackage 1.${version} EXACT REQUIRED) +string(REGEX REPLACE "-.*$" "" version ${CMAKE_VERSION}) +find_package(CMakeTestExportPackage 1.${version} EXACT REQUIRED) #----------------------------------------------------------------------------- # Test configure_package_config_file(). diff --git a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in index ff450a145..42bd84ea8 100644 --- a/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in +++ b/Tests/FindPackageTest/Exporter/CMakeTestExportPackageConfigVersion.cmake.in @@ -1,6 +1,6 @@ # Test config file. -SET(PACKAGE_VERSION "1.@CMAKE_VERSION@") -IF("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") - SET(PACKAGE_VERSION_COMPATIBLE 1) - SET(PACKAGE_VERSION_EXACT 1) -ENDIF() +set(PACKAGE_VERSION "1.@CMAKE_VERSION@") +if("${PACKAGE_FIND_VERSION}" VERSION_EQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_COMPATIBLE 1) + set(PACKAGE_VERSION_EXACT 1) +endif() diff --git a/Tests/FindPackageTest/FindRecursiveA.cmake b/Tests/FindPackageTest/FindRecursiveA.cmake index 3af7e99a3..a6d25dc4b 100644 --- a/Tests/FindPackageTest/FindRecursiveA.cmake +++ b/Tests/FindPackageTest/FindRecursiveA.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveA NO_MODULE) +find_package(RecursiveA NO_MODULE) diff --git a/Tests/FindPackageTest/FindRecursiveB.cmake b/Tests/FindPackageTest/FindRecursiveB.cmake index c609ab127..9e28f2ce9 100644 --- a/Tests/FindPackageTest/FindRecursiveB.cmake +++ b/Tests/FindPackageTest/FindRecursiveB.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveB NAMES zot) +find_package(RecursiveB NAMES zot) diff --git a/Tests/FindPackageTest/FindRecursiveC.cmake b/Tests/FindPackageTest/FindRecursiveC.cmake index 018cc7302..cd4400ca0 100644 --- a/Tests/FindPackageTest/FindRecursiveC.cmake +++ b/Tests/FindPackageTest/FindRecursiveC.cmake @@ -1 +1 @@ -FIND_PACKAGE(RecursiveC NAMES zot) +find_package(RecursiveC NAMES zot) diff --git a/Tests/FindPackageTest/FindVersionTestA.cmake b/Tests/FindPackageTest/FindVersionTestA.cmake index 55c67e257..982859382 100644 --- a/Tests/FindPackageTest/FindVersionTestA.cmake +++ b/Tests/FindPackageTest/FindVersionTestA.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") -IF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") -ENDIF(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") +if(NOT "${VersionTestA_FIND_VERSION}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION=${VersionTestA_FIND_VERSION} is not 1") +endif() +if(NOT "${VersionTestA_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION_MAJOR=${VersionTestA_FIND_VERSION_MAJOR} is not 1") +endif() +if(NOT "${VersionTestA_FIND_VERSION_MINOR}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_MINOR=${VersionTestA_FIND_VERSION_MINOR} is not 0") +endif() +if(NOT "${VersionTestA_FIND_VERSION_PATCH}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_PATCH=${VersionTestA_FIND_VERSION_PATCH} is not 0") +endif() +if(NOT "${VersionTestA_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestA_FIND_VERSION_TWEAK=${VersionTestA_FIND_VERSION_TWEAK} is not 0") +endif() +if(NOT "${VersionTestA_FIND_VERSION_COUNT}" STREQUAL "1") + message(SEND_ERROR "VersionTestA_FIND_VERSION_COUNT=${VersionTestA_FIND_VERSION_COUNT} is not 1") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestB.cmake b/Tests/FindPackageTest/FindVersionTestB.cmake index 03173c65a..1ebb82302 100644 --- a/Tests/FindPackageTest/FindVersionTestB.cmake +++ b/Tests/FindPackageTest/FindVersionTestB.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") -ENDIF(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") -IF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") -ENDIF(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") -IF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") -ENDIF(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") +if(NOT "${VersionTestB_FIND_VERSION}" STREQUAL "1.2") + message(SEND_ERROR "VersionTestB_FIND_VERSION=${VersionTestB_FIND_VERSION} is not 1.2") +endif() +if(NOT "${VersionTestB_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestB_FIND_VERSION_MAJOR=${VersionTestB_FIND_VERSION_MAJOR} is not 1") +endif() +if(NOT "${VersionTestB_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestB_FIND_VERSION_MINOR=${VersionTestB_FIND_VERSION_MINOR} is not 2") +endif() +if(NOT "${VersionTestB_FIND_VERSION_PATCH}" STREQUAL "0") + message(SEND_ERROR "VersionTestB_FIND_VERSION_PATCH=${VersionTestB_FIND_VERSION_PATCH} is not 0") +endif() +if(NOT "${VersionTestB_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestB_FIND_VERSION_TWEAK=${VersionTestB_FIND_VERSION_TWEAK} is not 0") +endif() +if(NOT "${VersionTestB_FIND_VERSION_COUNT}" STREQUAL "2") + message(SEND_ERROR "VersionTestB_FIND_VERSION_COUNT=${VersionTestB_FIND_VERSION_COUNT} is not 2") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestC.cmake b/Tests/FindPackageTest/FindVersionTestC.cmake index 1344cbc22..450c2e914 100644 --- a/Tests/FindPackageTest/FindVersionTestC.cmake +++ b/Tests/FindPackageTest/FindVersionTestC.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") -ENDIF(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") -IF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") -ENDIF(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") -IF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") -ENDIF(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") -IF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") -ENDIF(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") +if(NOT "${VersionTestC_FIND_VERSION}" STREQUAL "1.2.3") + message(SEND_ERROR "VersionTestC_FIND_VERSION=${VersionTestC_FIND_VERSION} is not 1.2.3") +endif() +if(NOT "${VersionTestC_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestC_FIND_VERSION_MAJOR=${VersionTestC_FIND_VERSION_MAJOR} is not 1") +endif() +if(NOT "${VersionTestC_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestC_FIND_VERSION_MINOR=${VersionTestC_FIND_VERSION_MINOR} is not 2") +endif() +if(NOT "${VersionTestC_FIND_VERSION_PATCH}" STREQUAL "3") + message(SEND_ERROR "VersionTestC_FIND_VERSION_PATCH=${VersionTestC_FIND_VERSION_PATCH} is not 3") +endif() +if(NOT "${VersionTestC_FIND_VERSION_TWEAK}" STREQUAL "0") + message(SEND_ERROR "VersionTestC_FIND_VERSION_TWEAK=${VersionTestC_FIND_VERSION_TWEAK} is not 0") +endif() +if(NOT "${VersionTestC_FIND_VERSION_COUNT}" STREQUAL "3") + message(SEND_ERROR "VersionTestC_FIND_VERSION_COUNT=${VersionTestC_FIND_VERSION_COUNT} is not 3") +endif() diff --git a/Tests/FindPackageTest/FindVersionTestD.cmake b/Tests/FindPackageTest/FindVersionTestD.cmake index d3e3f509e..9f2db72e4 100644 --- a/Tests/FindPackageTest/FindVersionTestD.cmake +++ b/Tests/FindPackageTest/FindVersionTestD.cmake @@ -1,18 +1,18 @@ -IF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") -ENDIF(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") -IF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") -ENDIF(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") -IF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") -ENDIF(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") -IF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") -ENDIF(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") -IF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") -ENDIF(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") -IF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") - MESSAGE(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") -ENDIF(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") +if(NOT "${VersionTestD_FIND_VERSION}" STREQUAL "1.2.3.4") + message(SEND_ERROR "VersionTestD_FIND_VERSION=${VersionTestD_FIND_VERSION} is not 1.2.3.4") +endif() +if(NOT "${VersionTestD_FIND_VERSION_MAJOR}" STREQUAL "1") + message(SEND_ERROR "VersionTestD_FIND_VERSION_MAJOR=${VersionTestD_FIND_VERSION_MAJOR} is not 1") +endif() +if(NOT "${VersionTestD_FIND_VERSION_MINOR}" STREQUAL "2") + message(SEND_ERROR "VersionTestD_FIND_VERSION_MINOR=${VersionTestD_FIND_VERSION_MINOR} is not 2") +endif() +if(NOT "${VersionTestD_FIND_VERSION_PATCH}" STREQUAL "3") + message(SEND_ERROR "VersionTestD_FIND_VERSION_PATCH=${VersionTestD_FIND_VERSION_PATCH} is not 3") +endif() +if(NOT "${VersionTestD_FIND_VERSION_TWEAK}" STREQUAL "4") + message(SEND_ERROR "VersionTestD_FIND_VERSION_TWEAK=${VersionTestD_FIND_VERSION_TWEAK} is not 4") +endif() +if(NOT "${VersionTestD_FIND_VERSION_COUNT}" STREQUAL "4") + message(SEND_ERROR "VersionTestD_FIND_VERSION_COUNT=${VersionTestD_FIND_VERSION_COUNT} is not 4") +endif() diff --git a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake index cbf06036e..5ba8d5585 100644 --- a/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake +++ b/Tests/FindPackageTest/lib/TApp/TAppConfig.cmake @@ -1,2 +1,2 @@ # Test config file that should not be found. -MESSAGE("Package TApp found non-bundle first!") +message("Package TApp found non-bundle first!") diff --git a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake index 2f768e8f5..822b44966 100644 --- a/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/cmake/zot-4.0/zot-config-version.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 4.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) +set(PACKAGE_VERSION 4.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake index 13763adf1..31573b90a 100644 --- a/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/arch/zot-3.1/zot-config-version.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake index bee2f0eea..e3e17de7c 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-3.1/zot-config-version.cmake @@ -1,4 +1,4 @@ # Claim to be any version to test that CMAKE_IGNORE_PATH hides us. -SET(PACKAGE_VERSION 3.1) -SET(PACKAGE_VERSION_COMPATIBLE 1) -SET(PACKAGE_VERSION_EXACT 1) +set(PACKAGE_VERSION 3.1) +set(PACKAGE_VERSION_COMPATIBLE 1) +set(PACKAGE_VERSION_EXACT 1) diff --git a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake index 606945f2d..bcefcd746 100644 --- a/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/cmake/zot-4.0/zot-config-version.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 4.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) +set(PACKAGE_VERSION 4.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 4) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 0) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake index 5c3bddece..b37bc8e22 100644 --- a/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake +++ b/Tests/FindPackageTest/lib/suffix/test/SuffixTestConfigVersion.cmake @@ -1,7 +1,7 @@ -SET(PACKAGE_VERSION 1.2) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) +set(PACKAGE_VERSION 1.2) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 1) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 2) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake index 10ac53d19..db3a8a40c 100644 --- a/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-2.0/zot-config-version.cmake @@ -1,5 +1,5 @@ -SET(PACKAGE_VERSION 2.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) - SET(PACKAGE_VERSION_COMPATIBLE 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) +set(PACKAGE_VERSION 2.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 2) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif() diff --git a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake index af57cfa5c..dd9c939c5 100644 --- a/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.0/zot-config-version.cmake @@ -1,5 +1,5 @@ -SET(PACKAGE_VERSION 3.0) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.0) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) +endif() diff --git a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake index b54d94ce6..8fa767ea1 100644 --- a/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot-3.1/zot-config-version.cmake @@ -1,8 +1,8 @@ -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake index 2a6be8640..430f009e1 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config-version.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config-version.cmake @@ -1,10 +1,10 @@ # This version should never, ever be used. -SET(PACKAGE_VERSION_UNSUITABLE 1) -SET(PACKAGE_VERSION 3.1) -IF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) - SET(PACKAGE_VERSION_COMPATIBLE 1) - IF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) - SET(PACKAGE_VERSION_EXACT 1) - ENDIF("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) -ENDIF("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) +set(PACKAGE_VERSION_UNSUITABLE 1) +set(PACKAGE_VERSION 3.1) +if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL 3) + set(PACKAGE_VERSION_COMPATIBLE 1) + if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL 1) + set(PACKAGE_VERSION_EXACT 1) + endif() +endif() diff --git a/Tests/FindPackageTest/lib/zot/zot-config.cmake b/Tests/FindPackageTest/lib/zot/zot-config.cmake index 442b8a4ec..916818360 100644 --- a/Tests/FindPackageTest/lib/zot/zot-config.cmake +++ b/Tests/FindPackageTest/lib/zot/zot-config.cmake @@ -1,2 +1,2 @@ # Test config file that is unsuitable. -MESSAGE(FATAL_ERROR "Unsuitable version of zot was found") +message(FATAL_ERROR "Unsuitable version of zot was found") diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index a995f68dd..6e78f4228 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -121,7 +121,7 @@ else() message("Fortran does not match c compiler") message("Fortran = ${CMAKE_Fortran_COMPILER_ID}") message("C = ${CMAKE_C_COMPILER_ID}") - # hack to make g77 work after CL has been enabled + # hack to make g77 work after CL has been enabled # as a languge, cmake needs language specific versions # of these variables.... if(WIN32 AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") @@ -154,11 +154,11 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) add_executable(test_use_in_comment_fixedform test_use_in_comment_fixedform.f) set_property(SOURCE test_use_in_comment_fixedform.f PROPERTY Fortran_FORMAT FIXED) - add_executable(test_use_in_comment_freeform + add_executable(test_use_in_comment_freeform test_use_in_comment_freeform.f90) set_property(SOURCE test_use_in_comment_freeform.f90 PROPERTY Fortran_FORMAT FREE) - add_executable(test_in_interface + add_executable(test_in_interface in_interface/main.f90 in_interface/module.f90) @@ -167,7 +167,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90) add_executable(test_preprocess test_preprocess.F90) set(TEST_MODULE_DEPENDS 1) -endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90) +endif() if(TEST_MODULE_DEPENDS) # Build the external project separately using a custom target. @@ -175,10 +175,10 @@ if(TEST_MODULE_DEPENDS) if(CMAKE_CONFIGURATION_TYPES) set(External_CONFIG_TYPE -C "${CMAKE_CFG_INTDIR}") set(External_BUILD_TYPE) - else(CMAKE_CONFIGURATION_TYPES) + else() set(External_CONFIG_TYPE) set(External_BUILD_TYPE -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) - endif(CMAKE_CONFIGURATION_TYPES) + endif() set(External_SOURCE_DIR "${testf_SOURCE_DIR}/External") set(External_BINARY_DIR "${testf_BINARY_DIR}/External") if("${testf_BINARY_DIR}" MATCHES " ") @@ -211,10 +211,10 @@ if(TEST_MODULE_DEPENDS) # Test module output directory if available. if(CMAKE_Fortran_MODDIR_FLAG) set(Library_MODDIR "${testf_BINARY_DIR}/Library/modules") - else(CMAKE_Fortran_MODDIR_FLAG) + else() set(Library_MODDIR "${testf_BINARY_DIR}/Library") - endif(CMAKE_Fortran_MODDIR_FLAG) + endif() add_subdirectory(Library) add_subdirectory(Executable) -endif(TEST_MODULE_DEPENDS) +endif() diff --git a/Tests/Fortran/Library/CMakeLists.txt b/Tests/Fortran/Library/CMakeLists.txt index fe1368a07..17438cafb 100644 --- a/Tests/Fortran/Library/CMakeLists.txt +++ b/Tests/Fortran/Library/CMakeLists.txt @@ -1,11 +1,11 @@ -INCLUDE_DIRECTORIES(${Library_MODDIR}) -ADD_LIBRARY(subdir_mods a.f90 b.f90) -ADD_EXECUTABLE(subdir_exe main.f90) -TARGET_LINK_LIBRARIES(subdir_exe subdir_mods) +include_directories(${Library_MODDIR}) +add_library(subdir_mods a.f90 b.f90) +add_executable(subdir_exe main.f90) +target_link_libraries(subdir_exe subdir_mods) # Test module output directory if available. -IF(CMAKE_Fortran_MODDIR_FLAG) - SET_TARGET_PROPERTIES(subdir_mods PROPERTIES +if(CMAKE_Fortran_MODDIR_FLAG) + set_target_properties(subdir_mods PROPERTIES Fortran_MODULE_DIRECTORY modules ) -ENDIF(CMAKE_Fortran_MODDIR_FLAG) +endif() diff --git a/Tests/Fortran/foo.f b/Tests/Fortran/foo.f index dbbb3a4e9..ece0df44c 100644 --- a/Tests/Fortran/foo.f +++ b/Tests/Fortran/foo.f @@ -5,5 +5,5 @@ contains subroutine sub end subroutine - + end module test_mod diff --git a/Tests/Fortran/test_use_in_comment_freeform.f90 b/Tests/Fortran/test_use_in_comment_freeform.f90 index c992a041b..48bcd5a21 100644 --- a/Tests/Fortran/test_use_in_comment_freeform.f90 +++ b/Tests/Fortran/test_use_in_comment_freeform.f90 @@ -1,7 +1,7 @@ PROGRAM foo -! USE bar -! use bar -! Use bar +! USE bar +! use bar +! Use bar WRITE(*,*) 'Hello, Fortran world.' END PROGRAM diff --git a/Tests/Framework/foo.cxx b/Tests/Framework/foo.cxx index b249ce348..e5c19738c 100644 --- a/Tests/Framework/foo.cxx +++ b/Tests/Framework/foo.cxx @@ -1,7 +1,7 @@ #include <stdio.h> #if defined(_WIN32) && defined(foo_EXPORTS) # define CM_TEST_LIB_EXPORT __declspec( dllexport ) -#else +#else # define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT void foo() diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index 5d4f42d4a..d1fada495 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -1,66 +1,66 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (FunctionTest) +project (FunctionTest) -FUNCTION(FAILED testname) - MESSAGE(SEND_ERROR "${testname} failed ${ARGN}") -ENDFUNCTION(FAILED) +function(FAILED testname) + message(SEND_ERROR "${testname} failed ${ARGN}") +endfunction() -FUNCTION(PASS testname) - MESSAGE("${testname} passed ${ARGN}") -ENDFUNCTION(PASS) +function(PASS testname) + message("${testname} passed ${ARGN}") +endfunction() # test scope -SET(COUNT 3) -FUNCTION(scope_test) - SET(COUNT 4) -ENDFUNCTION(scope_test) +set(COUNT 3) +function(scope_test) + set(COUNT 4) +endfunction() scope_test() -IF(COUNT EQUAL "3") +if(COUNT EQUAL "3") PASS("scope") -ELSE(COUNT EQUAL "3") +else() FAILED("COUNT Got: ${COUNT}") -ENDIF(COUNT EQUAL "3") +endif() # test ARGC -FUNCTION(weird_name) - IF("${ARGC}" EQUAL "3") +function(weird_name) + if("${ARGC}" EQUAL "3") PASS("ARGC") - ELSE("${ARGC}" EQUAL "3") + else() FAILED("ARGC" "Got: ${ARGC}") - ENDIF("${ARGC}" EQUAL "3") -ENDFUNCTION(weird_name) + endif() +endfunction() WeIrD_nAmE(a1 a2 a3) # test ARGN -FUNCTION(test_argn_function argument) - IF("${ARGN}" EQUAL "3") +function(test_argn_function argument) + if("${ARGN}" EQUAL "3") PASS("ARGN") - ELSE("${ARGN}" EQUAL "3") + else() FAILED("ARGN" "Got: ${ARGN}") - ENDIF("${ARGN}" EQUAL "3") -ENDFUNCTION(test_argn_function) + endif() +endfunction() Test_Argn_Function(ignored 3) # test argument naming and raise scope function(track_find_variable cache_variable is_changed) set("${is_changed}" changed PARENT_SCOPE) -endfunction(track_find_variable) +endfunction() track_find_variable(testvar is_changed) if ("${is_changed}" STREQUAL changed) pass("same argument name test") -else ("${is_changed}" STREQUAL changed) +else () pass("same argument name test") -endif ("${is_changed}" STREQUAL changed) +endif () include("Util.cmake") tester() if (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") pass("CMAKE_CURRENT_LIST_FILE test") -else (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +else () pass("CMAKE_CURRENT_LIST_FILE test") -endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif () @@ -68,109 +68,109 @@ endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") function (factorial argument result) if (argument LESS 2) set (lresult 1) - else (argument LESS 2) + else () math (EXPR temp "${argument} - 1") factorial (${temp} tresult) math (EXPR lresult "${argument}*${tresult}") - endif (argument LESS 2) + endif () set ("${result}" "${lresult}" PARENT_SCOPE) -endfunction (factorial) +endfunction () factorial (5 fresult) if (fresult EQUAL 120) pass("factorial") -else (fresult EQUAL 120) +else () failed ("factorial, computed ${fresult} instead of 120") -endif (fresult EQUAL 120) +endif () # case test -FUNCTION(strange_function m) - SET("${m}" strange_function PARENT_SCOPE) -ENDFUNCTION(strange_function m) +function(strange_function m) + set("${m}" strange_function PARENT_SCOPE) +endfunction() STRANGE_FUNCTION(var) set(second_var "second_var") -IF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +if("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -ELSE("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +else() FAILED("Case test" "(${var} ${second_var})") -ENDIF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") +endif() # test backing up command -FUNCTION(ADD_EXECUTABLE exec) +function(ADD_EXECUTABLE exec) _ADD_EXECUTABLE(mini${exec} ${ARGN}) -ENDFUNCTION(ADD_EXECUTABLE) +endfunction() # var undef case -FUNCTION(undef_var m) - SET("${m}" PARENT_SCOPE) -ENDFUNCTION(undef_var) +function(undef_var m) + set("${m}" PARENT_SCOPE) +endfunction() -SET(FUNCTION_UNDEFINED 1) +set(FUNCTION_UNDEFINED 1) undef_var(FUNCTION_UNDEFINED) -IF(DEFINED FUNCTION_UNDEFINED) +if(DEFINED FUNCTION_UNDEFINED) FAILED("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -ELSE(DEFINED FUNCTION_UNDEFINED) +else() PASS("Function Undefine Test" "(${FUNCTION_UNDEFINED})") -ENDIF(DEFINED FUNCTION_UNDEFINED) +endif() # Subdirectory scope raise. -SET(SUBDIR_UNDEFINED 1) -ADD_SUBDIRECTORY(SubDirScope) -IF(DEFINED SUBDIR_UNDEFINED) +set(SUBDIR_UNDEFINED 1) +add_subdirectory(SubDirScope) +if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else() PASS("Subdir Undefine Test" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif() +if(DEFINED SUBDIR_DEFINED) PASS("Subdir Define Test" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else() FAILED("Subdir Define Test" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif() # Test function-scoped directory. -FUNCTION(ADD_SUBDIR2 dir) - ADD_SUBDIRECTORY("${dir}" "${dir}2") +function(ADD_SUBDIR2 dir) + add_subdirectory("${dir}" "${dir}2") # The parent scope sets in the subdir should be visible here. - IF(DEFINED SUBDIR_UNDEFINED) + if(DEFINED SUBDIR_UNDEFINED) FAILED("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - ELSE(DEFINED SUBDIR_UNDEFINED) + else() PASS("Subdir Function Undefine Test 1" "(${SUBDIR_UNDEFINED})") - ENDIF(DEFINED SUBDIR_UNDEFINED) - IF(DEFINED SUBDIR_DEFINED) + endif() + if(DEFINED SUBDIR_DEFINED) PASS("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - ELSE(DEFINED SUBDIR_DEFINED) + else() FAILED("Subdir Function Define Test 1" "(${SUBDIR_DEFINED})") - ENDIF(DEFINED SUBDIR_DEFINED) -ENDFUNCTION(ADD_SUBDIR2) + endif() +endfunction() # Reset test variables. -SET(SUBDIR_UNDEFINED 1) -SET(SUBDIR_DEFINED) +set(SUBDIR_UNDEFINED 1) +set(SUBDIR_DEFINED) # Run test function. ADD_SUBDIR2(SubDirScope) # The parent scope sets in the subdir should not be visible here. -IF(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_UNDEFINED) PASS("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else() FAILED("Subdir Function Undefine Test 2" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif() +if(DEFINED SUBDIR_DEFINED) FAILED("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else() PASS("Subdir Function Define Test 2" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif() -ADD_EXECUTABLE(FunctionTest functionTest.c) +add_executable(FunctionTest functionTest.c) # Use the PROJECT_LABEL property: in IDEs, the project label should appear # in the UI rather than the target name. If this were a good test of the # property rather than just a smoke test, it would verify that the label # actually appears in the UI of the IDE... Or at least that the text appears # somewhere in the generated project files. -SET_PROPERTY(TARGET miniFunctionTest +set_property(TARGET miniFunctionTest PROPERTY PROJECT_LABEL "Test de Fonctionnement") diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index 4a53d2c0a..c1a3cfb37 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -1,14 +1,14 @@ -SET(SUBDIR_DEFINED 1 PARENT_SCOPE) -SET(SUBDIR_UNDEFINED PARENT_SCOPE) +set(SUBDIR_DEFINED 1 PARENT_SCOPE) +set(SUBDIR_UNDEFINED PARENT_SCOPE) # The above sets should not affect the current scope. -IF(DEFINED SUBDIR_UNDEFINED) +if(DEFINED SUBDIR_UNDEFINED) PASS("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -ELSE(DEFINED SUBDIR_UNDEFINED) +else() FAILED("SubdirScope Undefine Test" "(${SUBDIR_UNDEFINED})") -ENDIF(DEFINED SUBDIR_UNDEFINED) -IF(DEFINED SUBDIR_DEFINED) +endif() +if(DEFINED SUBDIR_DEFINED) FAILED("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -ELSE(DEFINED SUBDIR_DEFINED) +else() PASS("SubdirScope Define Test" "(${SUBDIR_DEFINED})") -ENDIF(DEFINED SUBDIR_DEFINED) +endif() diff --git a/Tests/FunctionTest/Util.cmake b/Tests/FunctionTest/Util.cmake index f0c73b5da..846abd78a 100644 --- a/Tests/FunctionTest/Util.cmake +++ b/Tests/FunctionTest/Util.cmake @@ -1,3 +1,3 @@ function(tester) set (tester_res "${CMAKE_CURRENT_LIST_FILE}" PARENT_SCOPE) -endfunction(tester) +endfunction() diff --git a/Tests/GeneratorExpression/CMakeLists.txt b/Tests/GeneratorExpression/CMakeLists.txt new file mode 100644 index 000000000..bb3147674 --- /dev/null +++ b/Tests/GeneratorExpression/CMakeLists.txt @@ -0,0 +1,80 @@ +cmake_minimum_required (VERSION 2.8.8) +project(GeneratorExpression NONE) + +add_custom_target(check ALL + COMMAND ${CMAKE_COMMAND} + -Dtest_0=$<0:nothing> + -Dtest_0_with_comma=$<0:-Wl,--no-undefined> + -Dtest_1=$<1:content> + -Dtest_1_with_comma=$<1:-Wl,--no-undefined> + -Dconfig=$<CONFIGURATION> + -Dtest_and_0=$<AND:0> + -Dtest_and_0_0=$<AND:0,0> + -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_config_debug=$<CONFIG:Debug>$<CONFIG:DEBUG>$<CONFIG:DeBuG> + -Dtest_config_release=$<CONFIG:Release>$<CONFIG:RELEASE>$<CONFIG:ReLeAsE> + -Dtest_config_relwithdebinfo=$<CONFIG:RelWithDebInfo>$<CONFIG:RELWITHDEBINFO>$<CONFIG:relwithdebinfo> + -Dtest_config_minsizerel=$<CONFIG:MinSizeRel>$<CONFIG:MINSIZEREL>$<CONFIG:minsizerel> + -Dtest_not_0=$<NOT:0> + -Dtest_not_1=$<NOT:1> + -Dtest_or_0=$<OR:0> + -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> + -Dtest_bool_notfound=$<BOOL:NOTFOUND> + -Dtest_bool_foo_notfound=$<BOOL:Foo-NOTFOUND> + -Dtest_bool_true=$<BOOL:True> + -Dtest_bool_false=$<BOOL:False> + -Dtest_bool_on=$<BOOL:On> + -Dtest_bool_off=$<BOOL:Off> + -Dtest_bool_no=$<BOOL:No> + -Dtest_bool_n=$<BOOL:N> + -Dtest_bool_empty=$<BOOL:> + -Dtest_strequal_yes_yes=$<STREQUAL:Yes,Yes> + -Dtest_strequal_yes_yes_cs=$<STREQUAL:Yes,yes> + -Dtest_strequal_yes_no=$<STREQUAL:Yes,No> + -Dtest_strequal_no_yes=$<STREQUAL:No,Yes> + -Dtest_strequal_angle_r=$<STREQUAL:$<ANGLE-R>,$<ANGLE-R>> + -Dtest_strequal_comma=$<STREQUAL:$<COMMA>,$<COMMA>> + -Dtest_strequal_angle_r_comma=$<STREQUAL:$<ANGLE-R>,$<COMMA>> + -Dtest_strequal_both_empty=$<STREQUAL:,> + -Dtest_strequal_one_empty=$<STREQUAL:something,> + -Dtest_angle_r=$<ANGLE-R> + -Dtest_comma=$<COMMA> + -Dtest_colons_1=$<1::> + -Dtest_colons_2=$<1:::> + -Dtest_colons_3=$<1:Qt5::Core> + -Dtest_colons_4=$<1:C:\\CMake> + -Dtest_colons_5=$<1:C:/CMake> + -Dtest_incomplete_1=$< + -Dtest_incomplete_2=$<something + -Dtest_incomplete_3=$<something: + -Dtest_incomplete_4=$<something:, + -Dtest_incomplete_5=$something:,> + -Dtest_incomplete_6=<something:,> + -Dtest_incomplete_7=$<something:: + -Dtest_incomplete_8=$<something:, + -Dtest_incomplete_9=$<something:,, + -Dtest_incomplete_10=$<something:,: + -Dtest_incomplete_11=$<something,, + -Dtest_incomplete_12=$<,, + -Dtest_incomplete_13=$<some$<1:special>thing + -Dtest_incomplete_14=$<$<ANGLE-R> + -Dtest_incomplete_15=$<some$<thing + -Dtest_incomplete_16=$<BOOL:something + -Dtest_incomplete_17=$<1:some$thing> + -Dtest_incomplete_18=$<1:some,thing + -Dtest_incomplete_19=$<1:some,thing$<ANGLE-R> + -Dtest_incomplete_20=$<CONFIGURATION$<ANGLE-R> + -Dtest_incomplete_21=$<BOOL:something$<ANGLE-R> + -P ${CMAKE_CURRENT_SOURCE_DIR}/check.cmake + COMMAND ${CMAKE_COMMAND} -E echo "check done" + VERBATIM + ) diff --git a/Tests/GeneratorExpression/check.cmake b/Tests/GeneratorExpression/check.cmake new file mode 100644 index 000000000..8745d57b6 --- /dev/null +++ b/Tests/GeneratorExpression/check.cmake @@ -0,0 +1,78 @@ +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_0_with_comma "") +check(test_1 "content") +check(test_1_with_comma "-Wl,--no-undefined") +check(test_and_0 "0") +check(test_and_0_0 "0") +check(test_and_0_1 "0") +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") +foreach(c debug release relwithdebinfo minsizerel) + if(NOT "${test_config_${c}}" MATCHES "^(0+|1+)$") + message(SEND_ERROR "test_config_${c} is \"${test_config_${c}}\", not all 0 or all 1") + endif() +endforeach() +check(test_not_0 "1") +check(test_not_1 "0") +check(test_or_0 "0") +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") +check(test_bool_notfound "0") +check(test_bool_foo_notfound "0") +check(test_bool_true "1") +check(test_bool_false "0") +check(test_bool_on "1") +check(test_bool_off "0") +check(test_bool_no "0") +check(test_bool_n "0") +check(test_bool_empty "0") +check(test_strequal_yes_yes "1") +check(test_strequal_yes_yes_cs "0") +check(test_strequal_yes_no "0") +check(test_strequal_no_yes "0") +check(test_strequal_angle_r "1") +check(test_strequal_comma "1") +check(test_strequal_angle_r_comma "0") +check(test_strequal_both_empty "1") +check(test_strequal_one_empty "0") +check(test_angle_r ">") +check(test_comma ",") +check(test_colons_1 ":") +check(test_colons_2 "::") +check(test_colons_3 "Qt5::Core") +check(test_colons_4 "C:\\\\CMake") +check(test_colons_5 "C:/CMake") +check(test_incomplete_1 "$<") +check(test_incomplete_2 "$<something") +check(test_incomplete_3 "$<something:") +check(test_incomplete_4 "$<something:,") +check(test_incomplete_5 "$something:,>") +check(test_incomplete_6 "<something:,>") +check(test_incomplete_7 "$<something::") +check(test_incomplete_8 "$<something:,") +check(test_incomplete_9 "$<something:,,") +check(test_incomplete_10 "$<something:,:") +check(test_incomplete_11 "$<something,,") +check(test_incomplete_12 "$<,,") +check(test_incomplete_13 "$<somespecialthing") +check(test_incomplete_14 "$<>") +check(test_incomplete_15 "$<some$<thing") +check(test_incomplete_16 "$<BOOL:something") +check(test_incomplete_17 "some$thing") +check(test_incomplete_18 "$<1:some,thing") +check(test_incomplete_19 "$<1:some,thing>") +check(test_incomplete_20 "$<CONFIGURATION>") +check(test_incomplete_21 "$<BOOL:something>") diff --git a/Tests/IPO/CMakeLists.txt b/Tests/IPO/CMakeLists.txt index 595e4f50d..6dabf86bb 100644 --- a/Tests/IPO/CMakeLists.txt +++ b/Tests/IPO/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.8) project(IPO NONE) -SET_PROPERTY(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1) +set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION 1) add_subdirectory(../COnly COnly) add_subdirectory(../CxxOnly CxxOnly) diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt index 334b8be62..7cb1b42e0 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt @@ -12,13 +12,36 @@ create_header(bar) create_header(bat) create_header(foo) create_header(baz) +create_header(bang) +create_header(bing) +create_header(bung) +create_header(arguments) +create_header(list) +create_header(target) set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar") +include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bang>") add_executable(TargetIncludeDirectories main.cpp) + set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat") set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo") +set_property(TARGET TargetIncludeDirectories APPEND PROPERTY + INCLUDE_DIRECTORIES "$<1:${CMAKE_CURRENT_BINARY_DIR}/bing>") include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz") +include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/bung>") +include_directories("sing$<1:/ting>") + +include_directories("$<1:${CMAKE_CURRENT_BINARY_DIR}/arguments;${CMAKE_CURRENT_BINARY_DIR}/list>") + +add_library(somelib::withcolons UNKNOWN IMPORTED) +set_property(TARGET somelib::withcolons PROPERTY IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/target") +set_property(TARGET somelib::withcolons PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/target") + +set_property(TARGET TargetIncludeDirectories + APPEND PROPERTY INCLUDE_DIRECTORIES + "$<TARGET_PROPERTY:somelib::withcolons,INTERFACE_INCLUDE_DIRECTORIES>" +) diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp index 8aa35320f..90909d334 100644 --- a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp @@ -3,6 +3,13 @@ #include "bat.h" #include "foo.h" #include "baz.h" +#include "bang.h" +#include "bing.h" +#include "bung.h" +#include "ting.h" +#include "arguments.h" +#include "list.h" +#include "target.h" int main(int, char**) { diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h b/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h new file mode 100644 index 000000000..4fe01dd3e --- /dev/null +++ b/Tests/IncludeDirectories/TargetIncludeDirectories/sing/ting/ting.h @@ -0,0 +1 @@ +//ting.h diff --git a/Tests/JCTest/CMakeLists.txt b/Tests/JCTest/CMakeLists.txt index a0f590e57..31dcc3abf 100644 --- a/Tests/JCTest/CMakeLists.txt +++ b/Tests/JCTest/CMakeLists.txt @@ -3,7 +3,7 @@ project(TestTime) enable_testing() add_executable(TestTime TestTime.cxx) -foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19 +foreach(f 1 2 3 4 5 6 7 8 9 10 11 12 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30) add_test(TestTime${f} TestTime 50000000) -endforeach(f) +endforeach() diff --git a/Tests/Java/A.java b/Tests/Java/A.java index e34b7046a..403a7f889 100644 --- a/Tests/Java/A.java +++ b/Tests/Java/A.java @@ -1,11 +1,11 @@ class A { - public A() + public A() { } - + public void printName() - { + { System.out.println("A"); } } diff --git a/Tests/Java/HelloWorld.java b/Tests/Java/HelloWorld.java index 54246ec26..378e37193 100644 --- a/Tests/Java/HelloWorld.java +++ b/Tests/Java/HelloWorld.java @@ -1,5 +1,5 @@ class HelloWorld -{ +{ public static void main(String args[]) { A a; diff --git a/Tests/Jump/CMakeLists.txt b/Tests/Jump/CMakeLists.txt index 4bdafd09b..4c5ad303f 100644 --- a/Tests/Jump/CMakeLists.txt +++ b/Tests/Jump/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Jump) +project(Jump) -SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) -ADD_SUBDIRECTORY(Executable) -ADD_SUBDIRECTORY(Library) +set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) +add_subdirectory(Executable) +add_subdirectory(Library) diff --git a/Tests/Jump/Executable/CMakeLists.txt b/Tests/Jump/Executable/CMakeLists.txt index 7658b7e31..bc6731ff1 100644 --- a/Tests/Jump/Executable/CMakeLists.txt +++ b/Tests/Jump/Executable/CMakeLists.txt @@ -1,6 +1,6 @@ -IF(NOT LIBRARY_OUTPUT_PATH) - LINK_DIRECTORIES(${Jump_BINARY_DIR}/Library/Static +if(NOT LIBRARY_OUTPUT_PATH) + link_directories(${Jump_BINARY_DIR}/Library/Static ${Jump_BINARY_DIR}/Library/Shared) -ENDIF(NOT LIBRARY_OUTPUT_PATH) -ADD_EXECUTABLE(jumpExecutable jumpExecutable.cxx) -TARGET_LINK_LIBRARIES(jumpExecutable jumpStatic jumpShared) +endif() +add_executable(jumpExecutable jumpExecutable.cxx) +target_link_libraries(jumpExecutable jumpStatic jumpShared) diff --git a/Tests/Jump/Library/CMakeLists.txt b/Tests/Jump/Library/CMakeLists.txt index 2f78c501c..1d9fed934 100644 --- a/Tests/Jump/Library/CMakeLists.txt +++ b/Tests/Jump/Library/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_SUBDIRECTORY(Static) -ADD_SUBDIRECTORY(Shared) +add_subdirectory(Static) +add_subdirectory(Shared) diff --git a/Tests/Jump/Library/Shared/CMakeLists.txt b/Tests/Jump/Library/Shared/CMakeLists.txt index 44405770f..a37299a79 100644 --- a/Tests/Jump/Library/Shared/CMakeLists.txt +++ b/Tests/Jump/Library/Shared/CMakeLists.txt @@ -1,26 +1,26 @@ -ADD_LIBRARY(jumpShared SHARED jumpShared.cxx) +add_library(jumpShared SHARED jumpShared.cxx) -IF(WIN32 OR CYGWIN) - SET(SHARED_MUST_BE_IN_EXE_DIR 1) -ENDIF() +if(WIN32 OR CYGWIN) + set(SHARED_MUST_BE_IN_EXE_DIR 1) +endif() -IF(APPLE) - SET(SHARED_MUST_BE_IN_EXE_DIR 1) -ENDIF(APPLE) +if(APPLE) + set(SHARED_MUST_BE_IN_EXE_DIR 1) +endif() -IF(SHARED_MUST_BE_IN_EXE_DIR) - SET(LIB_NAME +if(SHARED_MUST_BE_IN_EXE_DIR) + set(LIB_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}jumpShared${CMAKE_SHARED_LIBRARY_SUFFIX}) - SET(EXE_DIR ${Jump_BINARY_DIR}/Executable) - IF(EXECUTABLE_OUTPUT_PATH) - SET(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) - ENDIF(EXECUTABLE_OUTPUT_PATH) - SET(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared) - IF(LIBRARY_OUTPUT_PATH) - SET(LIB_DIR ${LIBRARY_OUTPUT_PATH}) - ENDIF(LIBRARY_OUTPUT_PATH) - ADD_CUSTOM_COMMAND(TARGET jumpShared + set(EXE_DIR ${Jump_BINARY_DIR}/Executable) + if(EXECUTABLE_OUTPUT_PATH) + set(EXE_DIR ${EXECUTABLE_OUTPUT_PATH}) + endif() + set(LIB_DIR ${Jump_BINARY_DIR}/Library/Shared) + if(LIBRARY_OUTPUT_PATH) + set(LIB_DIR ${LIBRARY_OUTPUT_PATH}) + endif() + add_custom_command(TARGET jumpShared POST_BUILD COMMAND ${CMAKE_COMMAND} ARGS -E copy ${LIB_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME} ${EXE_DIR}/${CMAKE_CFG_INTDIR}/${LIB_NAME}) -ENDIF(SHARED_MUST_BE_IN_EXE_DIR) +endif() diff --git a/Tests/Jump/Library/Static/CMakeLists.txt b/Tests/Jump/Library/Static/CMakeLists.txt index 23e70c0b1..4ee39545a 100644 --- a/Tests/Jump/Library/Static/CMakeLists.txt +++ b/Tests/Jump/Library/Static/CMakeLists.txt @@ -1 +1 @@ -ADD_LIBRARY(jumpStatic STATIC jumpStatic.cxx) +add_library(jumpStatic STATIC jumpStatic.cxx) diff --git a/Tests/KDE4StableBranchTest/test_kde4.sh.in b/Tests/KDE4StableBranchTest/test_kde4.sh.in deleted file mode 100755 index 81badcd79..000000000 --- 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/LibName/CMakeLists.txt b/Tests/LibName/CMakeLists.txt index 07499a14d..3ac125fb9 100644 --- a/Tests/LibName/CMakeLists.txt +++ b/Tests/LibName/CMakeLists.txt @@ -1,5 +1,5 @@ project(LibName) -# this is a test to make sure that relative path +# this is a test to make sure that relative path # LIBRARY_OUTPUT_PATH and EXECUTABLE_OUTPUT_PATH work set(LIBRARY_OUTPUT_PATH lib) set(EXECUTABLE_OUTPUT_PATH lib) @@ -11,9 +11,9 @@ target_link_libraries(foo bar) add_executable(foobar foobar.c) target_link_libraries(foobar foo) -IF(UNIX) +if(UNIX) target_link_libraries(foobar -L/usr/local/lib) -ENDIF(UNIX) +endif() # check with lib version diff --git a/Tests/LibName/bar.c b/Tests/LibName/bar.c index 960718038..f82aa28e8 100644 --- a/Tests/LibName/bar.c +++ b/Tests/LibName/bar.c @@ -1,7 +1,7 @@ #ifdef _WIN32 -__declspec(dllexport) +__declspec(dllexport) #endif - + extern void foo() { } diff --git a/Tests/LibName/foo.c b/Tests/LibName/foo.c index a68970405..6d258e0e9 100644 --- a/Tests/LibName/foo.c +++ b/Tests/LibName/foo.c @@ -1,9 +1,9 @@ #ifdef _WIN32 -__declspec(dllimport) +__declspec(dllimport) #endif extern void foo(); #ifdef _WIN32 -__declspec(dllexport) +__declspec(dllexport) #endif void bar() { diff --git a/Tests/LibName/foobar.c b/Tests/LibName/foobar.c index 73b4b4156..2f8a3ff08 100644 --- a/Tests/LibName/foobar.c +++ b/Tests/LibName/foobar.c @@ -1,5 +1,5 @@ #ifdef _WIN32 -__declspec(dllimport) +__declspec(dllimport) #endif extern void bar(); diff --git a/Tests/LinkLine/CMakeLists.txt b/Tests/LinkLine/CMakeLists.txt index c8f0ecf63..6154dd469 100644 --- a/Tests/LinkLine/CMakeLists.txt +++ b/Tests/LinkLine/CMakeLists.txt @@ -1,12 +1,12 @@ -PROJECT( LinkLine ) +project( LinkLine ) # Makes sure that the library order as specified by the user are # unchanged by dependency analysis, etc. libOne and libTwo are # dependent on each other. The link line should be -lOne -lTwo -lOne. -ADD_LIBRARY( One One.c ) -ADD_LIBRARY( Two Two.c ) +add_library( One One.c ) +add_library( Two Two.c ) -LINK_LIBRARIES( One Two ) -ADD_EXECUTABLE( LinkLine Exec.c ) -LINK_LIBRARIES( One ) +link_libraries( One Two ) +add_executable( LinkLine Exec.c ) +link_libraries( One ) diff --git a/Tests/LinkLineOrder/CMakeLists.txt b/Tests/LinkLineOrder/CMakeLists.txt index 21a502217..78455e971 100644 --- a/Tests/LinkLineOrder/CMakeLists.txt +++ b/Tests/LinkLineOrder/CMakeLists.txt @@ -1,4 +1,4 @@ -PROJECT( LinkLineOrder ) +project( LinkLineOrder ) # This tests ensures that the order of libraries are preserved when # they don't have dependency information, even if they are deep in the @@ -9,28 +9,28 @@ PROJECT( LinkLineOrder ) # has no information about these libraries except for the order they # are specified in One. We must make sure we don't lose that. -ADD_LIBRARY( NoDepA NoDepA.c ) -ADD_LIBRARY( NoDepB NoDepB.c ) -ADD_LIBRARY( NoDepC NoDepC.c ) -ADD_LIBRARY( NoDepE NoDepE.c ) -ADD_LIBRARY( NoDepF NoDepF.c ) +add_library( NoDepA NoDepA.c ) +add_library( NoDepB NoDepB.c ) +add_library( NoDepC NoDepC.c ) +add_library( NoDepE NoDepE.c ) +add_library( NoDepF NoDepF.c ) -ADD_LIBRARY( One One.c ) -TARGET_LINK_LIBRARIES( One NoDepC NoDepA NoDepB NoDepE NoDepF NoDepE ) +add_library( One One.c ) +target_link_libraries( One NoDepC NoDepA NoDepB NoDepE NoDepF NoDepE ) -ADD_EXECUTABLE( Exec1 Exec1.c ) -TARGET_LINK_LIBRARIES( Exec1 One ) +add_executable( Exec1 Exec1.c ) +target_link_libraries( Exec1 One ) # Similar situation as One, except at a different level of the # dependency tree. This makes sure that the order is presevered # everywhere in the graph. -ADD_LIBRARY( NoDepX NoDepX.c ) -ADD_LIBRARY( NoDepY NoDepY.c ) -ADD_LIBRARY( NoDepZ NoDepZ.c ) +add_library( NoDepX NoDepX.c ) +add_library( NoDepY NoDepY.c ) +add_library( NoDepZ NoDepZ.c ) -ADD_LIBRARY( Two Two.c ) -TARGET_LINK_LIBRARIES( Two One NoDepZ NoDepX NoDepY ) +add_library( Two Two.c ) +target_link_libraries( Two One NoDepZ NoDepX NoDepY ) -ADD_EXECUTABLE( Exec2 Exec2.c ) -TARGET_LINK_LIBRARIES( Exec2 Two ) +add_executable( Exec2 Exec2.c ) +target_link_libraries( Exec2 Two ) diff --git a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt index 5cdbc59bf..99b1aba82 100644 --- a/Tests/LoadCommand/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeCommands/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CMAKE_LOADED_COMMANDS) +project(CMAKE_LOADED_COMMANDS) -IF (MUDSLIDE_TYPE MATCHES MUCHO) - ADD_DEFINITIONS(-DMUCHO_MUDSLIDE) -ENDIF (MUDSLIDE_TYPE MATCHES MUCHO) +if (MUDSLIDE_TYPE MATCHES MUCHO) + add_definitions(-DMUCHO_MUDSLIDE) +endif () -INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) +include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) -ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) +add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) -IF(WATCOM) - TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib) -ENDIF(WATCOM) +if(WATCOM) + target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) +endif() diff --git a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c index 6b4f48f7b..fc04934dd 100644 --- a/Tests/LoadCommand/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommand/CMakeCommands/cmTestCommand.c @@ -3,7 +3,7 @@ #include <stdlib.h> #include <stdio.h> -typedef struct +typedef struct { char *LibraryName; int Argc; @@ -24,8 +24,8 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) char *ccDep[1]; char *ccOut[1]; cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; - - cmVTKWrapTclData *cdata = + + cmVTKWrapTclData *cdata = (cmVTKWrapTclData *)malloc(sizeof(cmVTKWrapTclData)); cdata->LibraryName = "BOO"; cdata->Argc = argc; @@ -36,33 +36,33 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) /* already, if so use that value and don't look for the program */ if(!info->CAPI->IsOn(mf,"TEST_COMMAND_TEST1")) { - info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); + info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); return 1; } - - info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); + + info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); cdata->LibraryName = "HOO"; - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON", "Test cache variable", CM_CACHE_BOOL); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "", "Test cache variable 1", CM_CACHE_PATH); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "", "Test cache variable 2", CM_CACHE_FILEPATH); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "", "Test cache variable 3", CM_CACHE_STRING); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "", "Test cache variable 4", CM_CACHE_INTERNAL); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "", "Test cache variable 5", CM_CACHE_STATIC); - + file = info->CAPI->ExpandVariablesInString(mf, "${CMAKE_COMMAND}", 0, 0); str = info->CAPI->GetFilenameWithoutExtension(file); @@ -140,7 +140,7 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) 1, ccDep, 1, ccOut, "LoadedCommand"); - + ccArgs[2] = argv[1]; ccArgs[3] = argv[2]; @@ -171,22 +171,22 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) return 0; } info->CAPI->ExecuteCommand(mf,"SET",2,args); - + /* make sure we can find the source file */ if (!info->CAPI->GetSource(mf,argv[1])) { info->CAPI->SetError(mf, "Source file could not be found!"); - return 0; + return 0; } return 1; } -static void CCONV FinalPass(void *inf, void *mf) +static void CCONV FinalPass(void *inf, void *mf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ - cmVTKWrapTclData *cdata = + cmVTKWrapTclData *cdata = (cmVTKWrapTclData *)info->CAPI->GetClientData(info); if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"),"HOO") || strcmp(cdata->LibraryName,"HOO")) @@ -194,11 +194,11 @@ static void CCONV FinalPass(void *inf, void *mf) fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n"); } } -static void CCONV Destructor(void *inf) +static void CCONV Destructor(void *inf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ - cmVTKWrapTclData *cdata = + cmVTKWrapTclData *cdata = (cmVTKWrapTclData *)info->CAPI->GetClientData(info); free(cdata); } diff --git a/Tests/LoadCommand/CMakeLists.txt b/Tests/LoadCommand/CMakeLists.txt index 846cbb084..c9337987a 100644 --- a/Tests/LoadCommand/CMakeLists.txt +++ b/Tests/LoadCommand/CMakeLists.txt @@ -1,63 +1,63 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(LoadCommand) +project(LoadCommand) # set a definition -SET (TEST_COMMAND_TEST1 1) +set (TEST_COMMAND_TEST1 1) -INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(short SIZEOF_SHORT) -INCLUDE (CheckFunctionExists) +include (CheckFunctionExists) CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF) CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA) -CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in +configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in ${LoadCommand_BINARY_DIR}/LoadedCommand.h) -INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR}) +include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded -IF(COMMAND CMAKE_TEST_COMMAND) -ELSE(COMMAND CMAKE_TEST_COMMAND) - TRY_COMPILE(COMPILE_OK - ${LoadCommand_BINARY_DIR}/CMakeCommands - ${LoadCommand_SOURCE_DIR}/CMakeCommands +if(COMMAND CMAKE_TEST_COMMAND) +else() + try_compile(COMPILE_OK + ${LoadCommand_BINARY_DIR}/CMakeCommands + ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) # do another TRY_COMPILE to get around make # problem on hp - TRY_COMPILE(COMPILE_OK - ${LoadCommand_BINARY_DIR}/CMakeCommands - ${LoadCommand_SOURCE_DIR}/CMakeCommands + try_compile(COMPILE_OK + ${LoadCommand_BINARY_DIR}/CMakeCommands + ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -ENDIF(COMMAND CMAKE_TEST_COMMAND) +endif() -MESSAGE("Output from try compile: ${OUTPUT}") +message("Output from try compile: ${OUTPUT}") # if the compile was OK, try loading the command -IF (COMPILE_OK) - LOAD_COMMAND(CMAKE_TEST_COMMAND - ${LoadCommand_BINARY_DIR}/CMakeCommands +if (COMPILE_OK) + load_command(CMAKE_TEST_COMMAND + ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug ${LoadCommand_BINARY_DIR}/CMakeCommands/Development ) # if the command loaded, execute the command - IF (COMMAND CMAKE_TEST_COMMAND) + if (COMMAND CMAKE_TEST_COMMAND) CMAKE_TEST_COMMAND( "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - ENDIF (COMMAND CMAKE_TEST_COMMAND) -ELSE (COMPILE_OK) - MESSAGE("failed to compile CMAKE_LOADED_COMMANDS") -ENDIF (COMPILE_OK) + endif () +else () + message("failed to compile CMAKE_LOADED_COMMANDS") +endif () # TEST_DEF is set by the loaded command cmTestCommand.c -IF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) - ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ENDIF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) + add_definitions(-DCMAKE_IS_FUN) +endif () diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt index 953d05c99..5ee2ed0f1 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeCommands/CMakeLists.txt @@ -1,17 +1,17 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(CMAKE_LOADED_COMMANDS) +project(CMAKE_LOADED_COMMANDS) -IF (MUDSLIDE_TYPE MATCHES MUCHO) - ADD_DEFINITIONS(-DMUCHO_MUDSLIDE) -ENDIF (MUDSLIDE_TYPE MATCHES MUCHO) +if (MUDSLIDE_TYPE MATCHES MUCHO) + add_definitions(-DMUCHO_MUDSLIDE) +endif () -IF(WATCOM) - SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") -ENDIF(WATCOM) -INCLUDE_DIRECTORIES(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) +if(WATCOM) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") +endif() +include_directories(${CMAKE_ROOT}/include ${CMAKE_ROOT}/Source) -ADD_LIBRARY(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) +add_library(cmCMAKE_TEST_COMMAND MODULE cmTestCommand.c) -IF(WATCOM) - TARGET_LINK_LIBRARIES(cmCMAKE_TEST_COMMAND clbsdll.lib) -ENDIF(WATCOM) +if(WATCOM) + target_link_libraries(cmCMAKE_TEST_COMMAND clbsdll.lib) +endif() diff --git a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c index 6b4f48f7b..fc04934dd 100644 --- a/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c +++ b/Tests/LoadCommandOneConfig/CMakeCommands/cmTestCommand.c @@ -3,7 +3,7 @@ #include <stdlib.h> #include <stdio.h> -typedef struct +typedef struct { char *LibraryName; int Argc; @@ -24,8 +24,8 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) char *ccDep[1]; char *ccOut[1]; cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; - - cmVTKWrapTclData *cdata = + + cmVTKWrapTclData *cdata = (cmVTKWrapTclData *)malloc(sizeof(cmVTKWrapTclData)); cdata->LibraryName = "BOO"; cdata->Argc = argc; @@ -36,33 +36,33 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) /* already, if so use that value and don't look for the program */ if(!info->CAPI->IsOn(mf,"TEST_COMMAND_TEST1")) { - info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); + info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); return 1; } - - info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); + + info->CAPI->AddDefinition(mf, "TEST_DEF", "HOO"); cdata->LibraryName = "HOO"; - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE", "ON", "Test cache variable", CM_CACHE_BOOL); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE1", "", "Test cache variable 1", CM_CACHE_PATH); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE2", "", "Test cache variable 2", CM_CACHE_FILEPATH); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE3", "", "Test cache variable 3", CM_CACHE_STRING); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE4", "", "Test cache variable 4", CM_CACHE_INTERNAL); - info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "", + info->CAPI->AddCacheDefinition(mf, "SOME_CACHE_VARIABLE5", "", "Test cache variable 5", CM_CACHE_STATIC); - + file = info->CAPI->ExpandVariablesInString(mf, "${CMAKE_COMMAND}", 0, 0); str = info->CAPI->GetFilenameWithoutExtension(file); @@ -140,7 +140,7 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) 1, ccDep, 1, ccOut, "LoadedCommand"); - + ccArgs[2] = argv[1]; ccArgs[3] = argv[2]; @@ -171,22 +171,22 @@ static int CCONV InitialPass(void *inf, void *mf, int argc, char *argv[]) return 0; } info->CAPI->ExecuteCommand(mf,"SET",2,args); - + /* make sure we can find the source file */ if (!info->CAPI->GetSource(mf,argv[1])) { info->CAPI->SetError(mf, "Source file could not be found!"); - return 0; + return 0; } return 1; } -static void CCONV FinalPass(void *inf, void *mf) +static void CCONV FinalPass(void *inf, void *mf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ - cmVTKWrapTclData *cdata = + cmVTKWrapTclData *cdata = (cmVTKWrapTclData *)info->CAPI->GetClientData(info); if (strcmp(info->CAPI->GetDefinition(mf, "TEST_DEF"),"HOO") || strcmp(cdata->LibraryName,"HOO")) @@ -194,11 +194,11 @@ static void CCONV FinalPass(void *inf, void *mf) fprintf(stderr,"*** Failed LOADED COMMAND Final Pass\n"); } } -static void CCONV Destructor(void *inf) +static void CCONV Destructor(void *inf) { cmLoadedCommandInfo *info = (cmLoadedCommandInfo *)inf; /* get our client data from initial pass */ - cmVTKWrapTclData *cdata = + cmVTKWrapTclData *cdata = (cmVTKWrapTclData *)info->CAPI->GetClientData(info); free(cdata); } diff --git a/Tests/LoadCommandOneConfig/CMakeLists.txt b/Tests/LoadCommandOneConfig/CMakeLists.txt index e99105a74..a75ad5aa5 100644 --- a/Tests/LoadCommandOneConfig/CMakeLists.txt +++ b/Tests/LoadCommandOneConfig/CMakeLists.txt @@ -1,69 +1,69 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(LoadCommand) +project(LoadCommand) # set a definition -SET (TEST_COMMAND_TEST1 1) +set (TEST_COMMAND_TEST1 1) -INCLUDE (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) +include (${CMAKE_ROOT}/Modules/CheckTypeSize.cmake) CHECK_TYPE_SIZE(char SIZEOF_CHAR) CHECK_TYPE_SIZE(short SIZEOF_SHORT) -INCLUDE (CheckFunctionExists) +include (CheckFunctionExists) CHECK_FUNCTION_EXISTS(printf HAVE_PRINTF) CHECK_FUNCTION_EXISTS(vsblabla HAVE_VSBLABLA) -INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) +include (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake) CHECK_INCLUDE_FILE("sys/prctl.h" HAVE_SYS_PRCTL_H) -INCLUDE (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) +include (${CMAKE_ROOT}/Modules/CheckLibraryExists.cmake) CHECK_LIBRARY_EXISTS(m ceil "" HAVE_LIBM) -CONFIGURE_FILE(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in +configure_file(${LoadCommand_SOURCE_DIR}/LoadedCommand.h.in ${LoadCommand_BINARY_DIR}/LoadedCommand.h) -INCLUDE_DIRECTORIES(${LoadCommand_BINARY_DIR}) +include_directories(${LoadCommand_BINARY_DIR}) # try to compile the command # make sure it is not already loaded -IF(COMMAND CMAKE_TEST_COMMAND) -ELSE(COMMAND CMAKE_TEST_COMMAND) - TRY_COMPILE(COMPILE_OK - ${LoadCommand_BINARY_DIR}/CMakeCommands - ${LoadCommand_SOURCE_DIR}/CMakeCommands +if(COMMAND CMAKE_TEST_COMMAND) +else() + try_compile(COMPILE_OK + ${LoadCommand_BINARY_DIR}/CMakeCommands + ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) # do another TRY_COMPILE to get around make # problem on hp - TRY_COMPILE(COMPILE_OK - ${LoadCommand_BINARY_DIR}/CMakeCommands - ${LoadCommand_SOURCE_DIR}/CMakeCommands + try_compile(COMPILE_OK + ${LoadCommand_BINARY_DIR}/CMakeCommands + ${LoadCommand_SOURCE_DIR}/CMakeCommands CMAKE_LOADED_COMMANDS CMAKE_FLAGS -DMUDSLIDE_TYPE:STRING=MUCHO OUTPUT_VARIABLE OUTPUT ) -ENDIF(COMMAND CMAKE_TEST_COMMAND) +endif() -MESSAGE("Output from try compile: ${OUTPUT}") +message("Output from try compile: ${OUTPUT}") # if the compile was OK, try loading the command -IF (COMPILE_OK) - LOAD_COMMAND(CMAKE_TEST_COMMAND - ${LoadCommand_BINARY_DIR}/CMakeCommands +if (COMPILE_OK) + load_command(CMAKE_TEST_COMMAND + ${LoadCommand_BINARY_DIR}/CMakeCommands ${LoadCommand_BINARY_DIR}/CMakeCommands/Debug ${LoadCommand_BINARY_DIR}/CMakeCommands/Development ) # if the command loaded, execute the command - IF (COMMAND CMAKE_TEST_COMMAND) + if (COMMAND CMAKE_TEST_COMMAND) CMAKE_TEST_COMMAND( "${LoadCommand_SOURCE_DIR}/LoadedCommand.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand2.cxx.in" "${LoadCommand_BINARY_DIR}/LoadedCommand3.cxx" ) - ENDIF (COMMAND CMAKE_TEST_COMMAND) -ELSE (COMPILE_OK) - MESSAGE("failed to compile CMAKE_LOADED_COMMANDS") -ENDIF (COMPILE_OK) + endif () +else () + message("failed to compile CMAKE_LOADED_COMMANDS") +endif () # TEST_DEF is set by the loaded command cmTestCommand.c -IF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) - ADD_DEFINITIONS(-DCMAKE_IS_FUN) -ENDIF (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) +if (TEST_DEF AND SOME_CACHE_VARIABLE AND TEST_EXEC) + add_definitions(-DCMAKE_IS_FUN) +endif () diff --git a/Tests/MacroTest/CMakeLists.txt b/Tests/MacroTest/CMakeLists.txt index ef673fd85..02bb31f20 100644 --- a/Tests/MacroTest/CMakeLists.txt +++ b/Tests/MacroTest/CMakeLists.txt @@ -1,53 +1,53 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (MacroTest) +project (MacroTest) -MACRO(FAILED testname) - MESSAGE(SEND_ERROR "${testname} failed ${ARGN}") -ENDMACRO(FAILED) +macro(FAILED testname) + message(SEND_ERROR "${testname} failed ${ARGN}") +endmacro() -MACRO(PASS testname) - MESSAGE("${testname} passed ${ARGN}") -ENDMACRO(PASS) +macro(PASS testname) + message("${testname} passed ${ARGN}") +endmacro() # test ARGC -MACRO(weird_name) - IF("${ARGC}" EQUAL "3") +macro(weird_name) + if("${ARGC}" EQUAL "3") PASS("ARGC") - ELSE("${ARGC}" EQUAL "3") + else() FAILED("ARGC" "Got: ${ARGC}") - ENDIF("${ARGC}" EQUAL "3") -ENDMACRO(weird_name) + endif() +endmacro() WeIrD_nAmE(a1 a2 a3) # test ARGN -MACRO(test_argn_macro argument) - IF("${ARGN}" EQUAL "3") +macro(test_argn_macro argument) + if("${ARGN}" EQUAL "3") PASS("ARGN") - ELSE("${ARGN}" EQUAL "3") + else() FAILED("ARGN" "Got: ${ARGN}") - ENDIF("${ARGN}" EQUAL "3") -ENDMACRO(test_argn_macro) + endif() +endmacro() Test_Argn_Macro(ignored 3) # case test -MACRO(strange_macro m) - SET("${m}" strange_macro) -ENDMACRO(strange_macro m) +macro(strange_macro m) + set("${m}" strange_macro) +endmacro() STRANGE_MACRO(var) set(second_var "second_var") -IF("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +if("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") PASS("Case Test" "(${var} ${second_var})") -ELSE("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +else() FAILED("Case test" "(${var} ${second_var})") -ENDIF("${var}" STREQUAL "strange_macro" AND "${second_var}" STREQUAL "second_var") +endif() # test backing up command -MACRO(ADD_EXECUTABLE exec) +macro(ADD_EXECUTABLE exec) _ADD_EXECUTABLE("mini${exec}" ${ARGN}) -ENDMACRO(ADD_EXECUTABLE) +endmacro() -INCLUDE(CheckCSourceCompiles) +include(CheckCSourceCompiles) Check_C_Source_Compiles( " #include <stdio.h> @@ -62,13 +62,13 @@ int main(int ac, char*av[]){ return 0; }" SOME_CHECK) -IF(SOME_CHECK) - MESSAGE("CheckCSourceCompiles works") -ELSE(SOME_CHECK) - MESSAGE(FATAL_ERROR "CheckCSourceCompiles does not work") -ENDIF(SOME_CHECK) +if(SOME_CHECK) + message("CheckCSourceCompiles works") +else() + message(FATAL_ERROR "CheckCSourceCompiles does not work") +endif() -INCLUDE(CheckCXXSourceCompiles) +include(CheckCXXSourceCompiles) Check_CXX_Source_Compiles( " #include <stdio.h> @@ -77,15 +77,15 @@ int main(int ac, char*av[]){ return 0; }" SOME_CHECK) -IF(SOME_CHECK) - MESSAGE("CheckCXXSourceCompiles works") -ELSE(SOME_CHECK) - MESSAGE(FATAL_ERROR "CheckCXXSourceCompiles does not work") -ENDIF(SOME_CHECK) +if(SOME_CHECK) + message("CheckCXXSourceCompiles works") +else() + message(FATAL_ERROR "CheckCXXSourceCompiles does not work") +endif() -ADD_EXECUTABLE(MacroTest macroTest.c) +add_executable(MacroTest macroTest.c) -MACRO(GET_CURRENT_FILE var) - SET(${var} ${CMAKE_CURRENT_LIST_FILE}) -ENDMACRO(GET_CURRENT_FILE) -INCLUDE(context.cmake) +macro(GET_CURRENT_FILE var) + set(${var} ${CMAKE_CURRENT_LIST_FILE}) +endmacro() +include(context.cmake) diff --git a/Tests/MacroTest/context.cmake b/Tests/MacroTest/context.cmake index f4d7035fb..f7350d771 100644 --- a/Tests/MacroTest/context.cmake +++ b/Tests/MacroTest/context.cmake @@ -1,10 +1,10 @@ GET_CURRENT_FILE(current_file) -IF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") - MESSAGE(FATAL_ERROR +if(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") + message(FATAL_ERROR "Macro file context is broken. Expected:\n" " ${CMAKE_CURRENT_LIST_FILE}\n" "but got:\n" " ${current_file}\n" "from the macro." ) -ENDIF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}") +endif() diff --git a/Tests/MakeClean/CMakeLists.txt b/Tests/MakeClean/CMakeLists.txt index 97d3554bd..13348a28b 100644 --- a/Tests/MakeClean/CMakeLists.txt +++ b/Tests/MakeClean/CMakeLists.txt @@ -1,47 +1,47 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(MakeClean) +project(MakeClean) # Build the to-clean project. -TRY_COMPILE(TOCLEAN_BUILT +try_compile(TOCLEAN_BUILT ${MakeClean_BINARY_DIR}/ToClean ${MakeClean_SOURCE_DIR}/ToClean ToClean OUTPUT_VARIABLE OUTPUT ) -IF(TOCLEAN_BUILT) - MESSAGE( +if(TOCLEAN_BUILT) + message( "Building ToClean succeeded with the following output:\n" "[${OUTPUT}]" ) -ELSE(TOCLEAN_BUILT) - MESSAGE(FATAL_ERROR +else() + message(FATAL_ERROR "Building ToClean failed with the following output:\n" "[${OUTPUT}]" ) -ENDIF(TOCLEAN_BUILT) +endif() # Get the set of files to check from the ToClean project. -INCLUDE(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) +include(${MakeClean_BINARY_DIR}/ToClean/ToCleanFiles.cmake) # Check for the existence of the files. -FOREACH(f ${TOCLEAN_FILES}) - IF(EXISTS "${f}") - ELSE(EXISTS "${f}") - MESSAGE(FATAL_ERROR "File \"${f}\" does not exist!") - ENDIF(EXISTS "${f}") -ENDFOREACH(f) +foreach(f ${TOCLEAN_FILES}) + if(EXISTS "${f}") + else() + message(FATAL_ERROR "File \"${f}\" does not exist!") + endif() +endforeach() # Configure an executable to check that all the files are missing. -SET(CHECK_FILES) -FOREACH(f ${TOCLEAN_FILES}) - SET(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") -ENDFOREACH(f) -CONFIGURE_FILE(${MakeClean_SOURCE_DIR}/check_clean.c.in +set(CHECK_FILES) +foreach(f ${TOCLEAN_FILES}) + set(CHECK_FILES "${CHECK_FILES} \"${f}\",\n") +endforeach() +configure_file(${MakeClean_SOURCE_DIR}/check_clean.c.in ${MakeClean_BINARY_DIR}/check_clean.c @ONLY IMMEDIATE) -ADD_EXECUTABLE(check_clean ${MakeClean_BINARY_DIR}/check_clean.c) +add_executable(check_clean ${MakeClean_BINARY_DIR}/check_clean.c) # After the executable builds, clean the files. -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET check_clean POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/MakeClean/ToClean/CMakeLists.txt b/Tests/MakeClean/ToClean/CMakeLists.txt index 50facadb7..28569dd1d 100644 --- a/Tests/MakeClean/ToClean/CMakeLists.txt +++ b/Tests/MakeClean/ToClean/CMakeLists.txt @@ -1,31 +1,31 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.6) -PROJECT(ToClean) +cmake_minimum_required(VERSION 2.6) +project(ToClean) # Build a simple project. -ADD_EXECUTABLE(toclean toclean.cxx) +add_executable(toclean toclean.cxx) # List some build-time-generated files. -GET_TARGET_PROPERTY(TOCLEAN_FILES toclean LOCATION) -SET(TOCLEAN_FILES ${TOCLEAN_FILES} +get_target_property(TOCLEAN_FILES toclean LOCATION) +set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/toclean.dir/toclean.cxx${CMAKE_CXX_OUTPUT_EXTENSION}") # Create a file that must be registered for cleaning. -FILE(WRITE "${ToClean_BINARY_DIR}/Registered.txt" +file(WRITE "${ToClean_BINARY_DIR}/Registered.txt" "File registered for cleaning.\n") -SET_DIRECTORY_PROPERTIES(PROPERTIES +set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${ToClean_BINARY_DIR}/Registered.txt") -SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt") +set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/Registered.txt") # Create a custom command whose output should be cleaned. -ADD_CUSTOM_COMMAND(OUTPUT ${ToClean_BINARY_DIR}/generated.txt +add_custom_command(OUTPUT ${ToClean_BINARY_DIR}/generated.txt DEPENDS ${ToClean_SOURCE_DIR}/toclean.cxx COMMAND ${CMAKE_COMMAND} ARGS -E copy ${ToClean_SOURCE_DIR}/toclean.cxx ${ToClean_BINARY_DIR}/generated.txt ) -ADD_CUSTOM_TARGET(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt) -SET(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt") +add_custom_target(generate ALL DEPENDS ${ToClean_BINARY_DIR}/generated.txt) +set(TOCLEAN_FILES ${TOCLEAN_FILES} "${ToClean_BINARY_DIR}/generated.txt") # Configure a file listing these build-time-generated files. -CONFIGURE_FILE(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in +configure_file(${ToClean_SOURCE_DIR}/ToCleanFiles.cmake.in ${ToClean_BINARY_DIR}/ToCleanFiles.cmake @ONLY IMMEDIATE) diff --git a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in index 10d11c37a..e7d99470c 100644 --- a/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in +++ b/Tests/MakeClean/ToClean/ToCleanFiles.cmake.in @@ -1 +1 @@ -SET(TOCLEAN_FILES "@TOCLEAN_FILES@") +set(TOCLEAN_FILES "@TOCLEAN_FILES@") diff --git a/Tests/MathTest/CMakeLists.txt b/Tests/MathTest/CMakeLists.txt index d1e5b1acd..34beaa0aa 100644 --- a/Tests/MathTest/CMakeLists.txt +++ b/Tests/MathTest/CMakeLists.txt @@ -1,10 +1,10 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(MathTest) +project(MathTest) # Expression test -SET(expressions +set(expressions "5 * ( 3 + 4)" "(1 | 2 | 4 | 8) & 16" "1 +(3*4) + 10 >> 2" @@ -12,18 +12,18 @@ SET(expressions "10000 / (20 / 4)" ) -SET(FILE_EXPRESSIONS "") -FOREACH(expression +set(FILE_EXPRESSIONS "") +foreach(expression ${expressions}) - MATH(EXPR expr "${expression}") - SET(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") -ENDFOREACH(expression) + math(EXPR expr "${expression}") + set(FILE_EXPRESSIONS "${FILE_EXPRESSIONS}TEST_EXPRESSION(${expression}, ${expr})\n") +endforeach() -CONFIGURE_FILE( +configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/MathTestTests.h.in" "${CMAKE_CURRENT_BINARY_DIR}/MathTestTests.h" @ONLY) -INCLUDE_DIRECTORIES("${CMAKE_CURRENT_BINARY_DIR}") -ADD_EXECUTABLE(MathTest MathTestExec.cxx) +include_directories("${CMAKE_CURRENT_BINARY_DIR}") +add_executable(MathTest MathTestExec.cxx) diff --git a/Tests/Module/CheckTypeSize/CMakeLists.txt b/Tests/Module/CheckTypeSize/CMakeLists.txt index 45e9f6757..abe617a16 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 602c83494..32e395cca 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 b5bfbf6e5..c60107588 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 000000000..e08efc4ca --- /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/NewlineArgs/CMakeLists.txt b/Tests/NewlineArgs/CMakeLists.txt index a18230488..755160102 100644 --- a/Tests/NewlineArgs/CMakeLists.txt +++ b/Tests/NewlineArgs/CMakeLists.txt @@ -5,10 +5,10 @@ project (NewlineArgs CXX) add_definitions("-DTEST_FLAG_1 -DTEST_FLAG_2") -include_directories(" ${NewlineArgs_BINARY_DIR} +include_directories(" ${NewlineArgs_BINARY_DIR} ${NewlineArgs_SOURCE_DIR} ") -configure_file("${NewlineArgs_SOURCE_DIR}/libcxx2.h.in" +configure_file("${NewlineArgs_SOURCE_DIR}/libcxx2.h.in" "${NewlineArgs_BINARY_DIR}/libcxx2.h") add_library(testcxx1 libcxx1.cxx) diff --git a/Tests/ObjC++/CMakeLists.txt b/Tests/ObjC++/CMakeLists.txt index c892bd0a1..8b1563ed8 100644 --- a/Tests/ObjC++/CMakeLists.txt +++ b/Tests/ObjC++/CMakeLists.txt @@ -1,6 +1,6 @@ # a simple objc++ test case that uses Cocoa framework -PROJECT (ObjC++) +project (ObjC++) -ADD_EXECUTABLE (ObjC++ objc++.mm) -TARGET_LINK_LIBRARIES(ObjC++ "-framework Cocoa") +add_executable (ObjC++ objc++.mm) +target_link_libraries(ObjC++ "-framework Cocoa") diff --git a/Tests/ObjC++/objc++.mm b/Tests/ObjC++/objc++.mm index f0be25682..258ebaa52 100644 --- a/Tests/ObjC++/objc++.mm +++ b/Tests/ObjC++/objc++.mm @@ -5,7 +5,7 @@ using namespace std; int main() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - + NSMutableSet *mySet = [NSMutableSet set]; cout<<"Adding values to the set."<<endl; [mySet addObject:[NSNumber numberWithInt:356]]; diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt index 121a8acba..36c86e7e9 100644 --- a/Tests/ObjectLibrary/A/CMakeLists.txt +++ b/Tests/ObjectLibrary/A/CMakeLists.txt @@ -1,3 +1,4 @@ +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 67172d132..32d8cebf6 100644 --- a/Tests/ObjectLibrary/B/CMakeLists.txt +++ b/Tests/ObjectLibrary/B/CMakeLists.txt @@ -1,3 +1,4 @@ +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/OutOfBinary/CMakeLists.txt b/Tests/OutOfBinary/CMakeLists.txt index fcf90bd0d..e32754143 100644 --- a/Tests/OutOfBinary/CMakeLists.txt +++ b/Tests/OutOfBinary/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_LIBRARY(outlib outlib.c) +add_library(outlib outlib.c) diff --git a/Tests/OutOfSource/CMakeLists.txt b/Tests/OutOfSource/CMakeLists.txt index e250f4177..de1603a55 100644 --- a/Tests/OutOfSource/CMakeLists.txt +++ b/Tests/OutOfSource/CMakeLists.txt @@ -6,9 +6,9 @@ add_subdirectory(SubDir) get_directory_property(ANIMAL DIRECTORY OutOfSourceSubdir DEFINITION WEASELS) get_directory_property(ANIMALREL DIRECTORY SubDir/../OutOfSourceSubdir DEFINITION WEASELS) -IF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") - MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.") -ENDIF(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") +if(NOT "${ANIMAL}" STREQUAL "${ANIMALREL}") + message(FATAL_ERROR "GET_DIRECTORY_PROPERTY does not seem to collapse paths.") +endif() configure_file( ${OutOfSource_SOURCE_DIR}/testdp.h.in diff --git a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt index c362e79ba..10a2f59d1 100644 --- a/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt +++ b/Tests/OutOfSource/OutOfSourceSubdir/CMakeLists.txt @@ -1,62 +1,62 @@ -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) -IF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") - SET(BUILD_SHARED_LIBS 1) +if ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") + set(BUILD_SHARED_LIBS 1) # Construct a source file outside the tree whose full path is close to # the path length limit. This will cause the full path to the object # file in the build tree to exceed the maximum path length which will # test cmLocalGenerator::CreateSafeUniqueObjectFileName. - GET_FILENAME_COMPONENT(DEEPDIR + get_filename_component(DEEPDIR ${OutOfSource_BINARY_DIR}/../OutOfSourceDeep/deeper ABSOLUTE) # Test giving the generator a custom limit. - SET(CMAKE_OBJECT_PATH_MAX 220) + set(CMAKE_OBJECT_PATH_MAX 220) # Use a separate variable for computation. - SET(MAXPATH "${CMAKE_OBJECT_PATH_MAX}") + set(MAXPATH "${CMAKE_OBJECT_PATH_MAX}") # VS8 adds "OutOfSource/SubDir/OutOfSourceSubdir/../../../" to the # path of the source file for no good reason. Reduce the length # limit by 46 characters to account for it. It should still be long # enough to require special object file name conversion. - IF(${CMAKE_GENERATOR} MATCHES "Visual Studio (8|10)") - MATH(EXPR MAXPATH "${MAXPATH} - 46") - ENDIF() + if(${CMAKE_GENERATOR} MATCHES "Visual Studio (8|10)") + math(EXPR MAXPATH "${MAXPATH} - 46") + endif() # Ninja imposes a maximum path component count of 30. Permit more # path components in the source path. - IF(${CMAKE_GENERATOR} MATCHES "Ninja") - MATH(EXPR MAXPATH "${MAXPATH} - 44") - ENDIF() + if(${CMAKE_GENERATOR} MATCHES "Ninja") + math(EXPR MAXPATH "${MAXPATH} - 44") + endif() # MAXPATH less 25 for last /and/deeper/simple.cxx part and small safety - MATH(EXPR MAXPATH "${MAXPATH} - 25") - STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN) - WHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}") - SET(DEEPDIR ${DEEPDIR}/and/deeper) - STRING(LENGTH "${DEEPDIR}" DEEPDIR_LEN) - ENDWHILE("${DEEPDIR_LEN}" LESS "${MAXPATH}") - SET(DEEPSRC ${DEEPDIR}/simple.cxx) - STRING(LENGTH "${DEEPSRC}" DEEPSRC_LEN) - CONFIGURE_FILE(simple.cxx.in ${DEEPSRC} COPYONLY) + math(EXPR MAXPATH "${MAXPATH} - 25") + string(LENGTH "${DEEPDIR}" DEEPDIR_LEN) + while("${DEEPDIR_LEN}" LESS "${MAXPATH}") + set(DEEPDIR ${DEEPDIR}/and/deeper) + string(LENGTH "${DEEPDIR}" DEEPDIR_LEN) + endwhile() + set(DEEPSRC ${DEEPDIR}/simple.cxx) + string(LENGTH "${DEEPSRC}" DEEPSRC_LEN) + configure_file(simple.cxx.in ${DEEPSRC} COPYONLY) # Watcom WMake seems to have problems with long command lines. Just # disable this part of the test until it is resolved. - IF(${CMAKE_GENERATOR} MATCHES "Watcom WMake") - SET(DEEPSRC "") - ADD_DEFINITIONS(-DNO_DEEPSRC) - ENDIF(${CMAKE_GENERATOR} MATCHES "Watcom WMake") + if(${CMAKE_GENERATOR} MATCHES "Watcom WMake") + set(DEEPSRC "") + add_definitions(-DNO_DEEPSRC) + endif() - ADD_LIBRARY(testlib testlib.cxx) - ADD_EXECUTABLE (simple simple.cxx ../simple.cxx ${DEEPSRC}) - TARGET_LINK_LIBRARIES(simple testlib outlib) -ENDIF ("${PROJECT_SOURCE_DIR}" STREQUAL "${ANOTHER_PROJ_SOURCE_DIR}") + add_library(testlib testlib.cxx) + add_executable (simple simple.cxx ../simple.cxx ${DEEPSRC}) + target_link_libraries(simple testlib outlib) +endif () # test getting a definition from a subdir -SET (WEASELS SIZZLING) +set (WEASELS SIZZLING) -GET_DIRECTORY_PROPERTY(incDirs INCLUDE_DIRECTORIES) -IF(NOT incDirs) - MESSAGE(FATAL_ERROR "GET_DIRECTORY_PROPERTY(INCLUDE_DIRECTORIES) returned empty list") -ENDIF(NOT incDirs) +get_directory_property(incDirs INCLUDE_DIRECTORIES) +if(NOT incDirs) + message(FATAL_ERROR "get_directory_property(INCLUDE_DIRECTORIES) returned empty list") +endif() diff --git a/Tests/OutOfSource/OutOfSourceSubdir/testlib.h b/Tests/OutOfSource/OutOfSourceSubdir/testlib.h index 289b67361..75c2d84fd 100644 --- a/Tests/OutOfSource/OutOfSourceSubdir/testlib.h +++ b/Tests/OutOfSource/OutOfSourceSubdir/testlib.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float TestLib(); diff --git a/Tests/OutOfSource/SubDir/CMakeLists.txt b/Tests/OutOfSource/SubDir/CMakeLists.txt index 4fc48e13d..c5df36e1b 100644 --- a/Tests/OutOfSource/SubDir/CMakeLists.txt +++ b/Tests/OutOfSource/SubDir/CMakeLists.txt @@ -1,8 +1,8 @@ -PROJECT(ANOTHER_PROJ) +project(ANOTHER_PROJ) # subdir to an out of source and out of binary directory -ADD_SUBDIRECTORY(${OutOfSource_SOURCE_DIR}/../OutOfBinary +add_subdirectory(${OutOfSource_SOURCE_DIR}/../OutOfBinary ${OutOfSource_BINARY_DIR}/../OutOfBinary) # subdir to a sibling dir -ADD_SUBDIRECTORY(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir ) +add_subdirectory(${OutOfSource_SOURCE_DIR}/${KEN}OutOfSourceSubdir OutOfSourceSubdir ) diff --git a/Tests/PDBDirectoryAndName/CMakeLists.txt b/Tests/PDBDirectoryAndName/CMakeLists.txt new file mode 100644 index 000000000..bc2f01317 --- /dev/null +++ b/Tests/PDBDirectoryAndName/CMakeLists.txt @@ -0,0 +1,79 @@ +cmake_minimum_required(VERSION 2.8) +project(PDBDirectoryAndName C) + +# Make sure the proper compiler is in use. +if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + message(FATAL_ERROR "The PDBDirectoryAndName test works only with MSVC or Intel") +endif() + +set(my_targets "") + +add_library(mylibA SHARED mylibA.c) +set_target_properties(mylibA PROPERTIES + PDB_NAME "mylibA_Special" + PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibA_PDB" +) +list(APPEND my_targets mylibA) + +add_library(mylibB STATIC mylibB.c) +set_target_properties(mylibB PROPERTIES + PDB_NAME "mylibB_Special" + PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mylibB_PDB" +) +list(APPEND my_targets mylibB) + +add_library(mylibC SHARED mylibC.c) +set_target_properties(mylibC PROPERTIES + PDB_NAME "mylibC_Special" +) +list(APPEND my_targets mylibC) + +add_library(mylibD STATIC mylibD.c) +set_target_properties(mylibD PROPERTIES + PDB_NAME "mylibD_Special" +) +list(APPEND my_targets mylibD) + +add_executable(myexe myexe.c) +set_target_properties(myexe PROPERTIES + PDB_NAME "myexe_Special" + PDB_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/myexe_PDB" +) +list(APPEND my_targets myexe) + +target_link_libraries(myexe mylibA mylibB mylibC mylibD) + +add_executable(myexe2 myexe2.c) +set_target_properties(myexe2 PROPERTIES + PDB_NAME "myexe2_Special" +) +list(APPEND my_targets myexe2) + +target_link_libraries(myexe2 mylibA mylibD) + +#----------------------------------------------------------------------------- +# Check that PDB files actually appear where expected. + +# The PDB_NAME and PDB_OUTPUT_DIRECTORY options do not work in VS 6. +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") + return() +endif() +# PDB output not fully implemented for Intel +if("${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + return() +endif() + +set(pdbs "") +foreach(t ${my_targets}) + get_property(pdb_name TARGET ${t} PROPERTY PDB_NAME) + get_property(pdb_dir TARGET ${t} PROPERTY PDB_OUTPUT_DIRECTORY) + if(NOT pdb_dir) + set(pdb_dir ${CMAKE_CURRENT_BINARY_DIR}) + endif() + list(APPEND pdbs ${pdb_dir}/${CMAKE_CFG_INTDIR}/${pdb_name}.pdb) +endforeach() +add_custom_target(check_pdbs ALL VERBATIM + COMMAND ${CMAKE_COMMAND} -Dconfig=$<CONFIGURATION> "-Dpdbs=${pdbs}" + -P ${CMAKE_CURRENT_SOURCE_DIR}/check_pdbs.cmake + ) +add_dependencies(check_pdbs ${my_targets}) diff --git a/Tests/PDBDirectoryAndName/check_pdbs.cmake b/Tests/PDBDirectoryAndName/check_pdbs.cmake new file mode 100644 index 000000000..89cdb3c72 --- /dev/null +++ b/Tests/PDBDirectoryAndName/check_pdbs.cmake @@ -0,0 +1,10 @@ +if(NOT "${config}" MATCHES "[Dd][Ee][Bb]") + return() +endif() +foreach(pdb ${pdbs}) + if(EXISTS "${pdb}") + message(STATUS "PDB Exists: ${pdb}") + else() + message(SEND_ERROR "PDB MISSING: ${pdb}") + endif() +endforeach() diff --git a/Tests/PDBDirectoryAndName/myexe.c b/Tests/PDBDirectoryAndName/myexe.c new file mode 100644 index 000000000..c6d9065fe --- /dev/null +++ b/Tests/PDBDirectoryAndName/myexe.c @@ -0,0 +1,5 @@ +extern int mylibA(); +extern int mylibB(); +extern int mylibC(); +extern int mylibD(); +int main() { return mylibA() + mylibB() + mylibC() + mylibD(); } diff --git a/Tests/PDBDirectoryAndName/myexe2.c b/Tests/PDBDirectoryAndName/myexe2.c new file mode 100644 index 000000000..75b39cd28 --- /dev/null +++ b/Tests/PDBDirectoryAndName/myexe2.c @@ -0,0 +1,3 @@ +extern int mylibA(); +extern int mylibD(); +int main() { return mylibA() + mylibD(); } diff --git a/Tests/PDBDirectoryAndName/mylibA.c b/Tests/PDBDirectoryAndName/mylibA.c new file mode 100644 index 000000000..f4c553f42 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibA.c @@ -0,0 +1 @@ +__declspec(dllexport) int mylibA() { return 1; } diff --git a/Tests/PDBDirectoryAndName/mylibB.c b/Tests/PDBDirectoryAndName/mylibB.c new file mode 100644 index 000000000..2040c6795 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibB.c @@ -0,0 +1 @@ +int mylibB() { return -1; } diff --git a/Tests/PDBDirectoryAndName/mylibC.c b/Tests/PDBDirectoryAndName/mylibC.c new file mode 100644 index 000000000..adf7c7098 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibC.c @@ -0,0 +1 @@ +__declspec(dllexport) int mylibC() { return 1; } diff --git a/Tests/PDBDirectoryAndName/mylibD.c b/Tests/PDBDirectoryAndName/mylibD.c new file mode 100644 index 000000000..efa8a8234 --- /dev/null +++ b/Tests/PDBDirectoryAndName/mylibD.c @@ -0,0 +1 @@ +int mylibD() { return -1; } diff --git a/Tests/PerConfig/CMakeLists.txt b/Tests/PerConfig/CMakeLists.txt index 3a473b883..7f461b0ec 100644 --- a/Tests/PerConfig/CMakeLists.txt +++ b/Tests/PerConfig/CMakeLists.txt @@ -1,23 +1,23 @@ project(PerConfig C) # Targets with per-configuration names. -ADD_LIBRARY(pcStatic STATIC pcStatic.c) -SET_PROPERTY(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt) -SET_PROPERTY(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg) -ADD_LIBRARY(pcShared SHARED pcShared.c) -SET_PROPERTY(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt) -SET_PROPERTY(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg) -SET_PROPERTY(TARGET pcShared PROPERTY VERSION 1.2) -SET_PROPERTY(TARGET pcShared PROPERTY SOVERSION 3) -IF(UNIX AND NOT CYGWIN) - SET(soname_file -DpcShared_soname_file=$<TARGET_SONAME_FILE:pcShared>) -ENDIF() -ADD_EXECUTABLE(perconfig perconfig.c) -TARGET_LINK_LIBRARIES(perconfig pcStatic pcShared) -SET_PROPERTY(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt) -SET_PROPERTY(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg) +add_library(pcStatic STATIC pcStatic.c) +set_property(TARGET pcStatic PROPERTY RELEASE_POSTFIX -opt) +set_property(TARGET pcStatic PROPERTY DEBUG_POSTFIX -dbg) +add_library(pcShared SHARED pcShared.c) +set_property(TARGET pcShared PROPERTY RELEASE_POSTFIX -opt) +set_property(TARGET pcShared PROPERTY DEBUG_POSTFIX -dbg) +set_property(TARGET pcShared PROPERTY VERSION 1.2) +set_property(TARGET pcShared PROPERTY SOVERSION 3) +if(UNIX AND NOT CYGWIN) + set(soname_file -DpcShared_soname_file=$<TARGET_SONAME_FILE:pcShared>) +endif() +add_executable(perconfig perconfig.c) +target_link_libraries(perconfig pcStatic pcShared) +set_property(TARGET perconfig PROPERTY RELEASE_POSTFIX -opt) +set_property(TARGET perconfig PROPERTY DEBUG_POSTFIX -dbg) -SET(PerConfig_COMMAND +set(PerConfig_COMMAND ${CMAKE_COMMAND} -Dconfiguration=$<CONFIGURATION> -Dperconfig_file_dir=$<TARGET_FILE_DIR:perconfig> @@ -30,5 +30,5 @@ SET(PerConfig_COMMAND ${soname_file} -P ${PerConfig_SOURCE_DIR}/perconfig.cmake ) -SET(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE) -SET(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared) +set(PerConfig_COMMAND "${PerConfig_COMMAND}" PARENT_SCOPE) +set(PerConfig_DEPENDS ${PerConfig_SOURCE_DIR}/perconfig.cmake perconfig pcStatic pcShared) diff --git a/Tests/Plugin/CMakeLists.txt b/Tests/Plugin/CMakeLists.txt index 31ca59c13..d1b8334a9 100644 --- a/Tests/Plugin/CMakeLists.txt +++ b/Tests/Plugin/CMakeLists.txt @@ -1,87 +1,87 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Plugin) +project(Plugin) # Test per-target output directory properties. -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/bin) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/plugin) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Plugin_BINARY_DIR}/lib/static) # We need the dynamic loader support from KWSys to load the plugin in # the executable. -SET(KWSYS_NAMESPACE kwsys) -SET(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include) -SET(KWSYS_USE_DynamicLoader 1) -ADD_SUBDIRECTORY(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys) +set(KWSYS_NAMESPACE kwsys) +set(KWSYS_HEADER_ROOT ${Plugin_BINARY_DIR}/include) +set(KWSYS_USE_DynamicLoader 1) +add_subdirectory(${Plugin_SOURCE_DIR}/../../Source/kwsys src/kwsys) # Configure the location of plugins. -CONFIGURE_FILE(${Plugin_SOURCE_DIR}/src/example_exe.h.in +configure_file(${Plugin_SOURCE_DIR}/src/example_exe.h.in ${Plugin_BINARY_DIR}/include/example_exe.h @ONLY) # We need to include headers from the source tree and configured # headers in the build tree. -INCLUDE_DIRECTORIES( +include_directories( ${Plugin_BINARY_DIR}/include ${Plugin_SOURCE_DIR}/include ) # Create an executable that exports an API for use by plugins. -ADD_EXECUTABLE(example_exe src/example_exe.cxx) -SET_TARGET_PROPERTIES(example_exe PROPERTIES +add_executable(example_exe src/example_exe.cxx) +set_target_properties(example_exe PROPERTIES ENABLE_EXPORTS 1 OUTPUT_NAME example # Test placing exe import library in unique directory. ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/exe ) -TARGET_LINK_LIBRARIES(example_exe kwsys) +target_link_libraries(example_exe kwsys) # Create a plugin that uses the API provided by the executable. # This module "links" to the executable to use the symbols. -ADD_LIBRARY(example_mod_1 MODULE src/example_mod_1.c) -TARGET_LINK_LIBRARIES(example_mod_1 example_exe) +add_library(example_mod_1 MODULE src/example_mod_1.c) +target_link_libraries(example_mod_1 example_exe) -IF(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND +if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG AND "${CMAKE_C_CREATE_SHARED_MODULE}" MATCHES "SONAME_FLAG") # Add a second plugin that should not have any soname. - ADD_LIBRARY(example_mod_2 MODULE src/example_mod_1.c) - TARGET_LINK_LIBRARIES(example_mod_2 example_exe) - SET_PROPERTY(TARGET example_mod_2 PROPERTY NO_SONAME 1) + add_library(example_mod_2 MODULE src/example_mod_1.c) + target_link_libraries(example_mod_2 example_exe) + set_property(TARGET example_mod_2 PROPERTY NO_SONAME 1) # Verify that targets export with proper IMPORTED SONAME properties. - EXPORT(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_ + export(TARGETS example_mod_1 example_mod_2 NAMESPACE exp_ FILE ${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) - INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) - GET_PROPERTY(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS) - FOREACH(c ${configs}) - STRING(TOUPPER "${c}" CONFIG) - GET_PROPERTY(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG}) - GET_PROPERTY(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) - IF(soname1) - MESSAGE(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}") - ELSE() - MESSAGE(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should") - ENDIF() - IF(soname2) - MESSAGE(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}") - ELSE() - MESSAGE(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should") - ENDIF() - ENDFOREACH() + include(${CMAKE_CURRENT_BINARY_DIR}/mods.cmake) + get_property(configs TARGET exp_example_mod_1 PROPERTY IMPORTED_CONFIGURATIONS) + foreach(c ${configs}) + string(TOUPPER "${c}" CONFIG) + get_property(soname1 TARGET exp_example_mod_1 PROPERTY IMPORTED_SONAME_${CONFIG}) + get_property(soname2 TARGET exp_example_mod_2 PROPERTY IMPORTED_NO_SONAME_${CONFIG}) + if(soname1) + message(STATUS "exp_example_mod_1 has IMPORTED_SONAME_${CONFIG} as expected: ${soname1}") + else() + message(SEND_ERROR "exp_example_mod_1 does not have IMPORTED_SONAME_${CONFIG} but should") + endif() + if(soname2) + message(STATUS "exp_example_mod_2 has IMPORTED_NO_SONAME_${CONFIG} as expected: ${soname2}") + else() + message(SEND_ERROR "exp_example_mod_2 does not have IMPORTED_NO_SONAME_${CONFIG} but should") + endif() + endforeach() # Parse the binary to check for SONAME if possible. - IF("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") - FIND_PROGRAM(READELF_EXE readelf) - IF(READELF_EXE) - ADD_CUSTOM_TARGET(check_mod_soname ALL COMMAND + if("${CMAKE_EXECUTABLE_FORMAT}" MATCHES "ELF") + find_program(READELF_EXE readelf) + if(READELF_EXE) + add_custom_target(check_mod_soname ALL COMMAND ${CMAKE_COMMAND} -Dreadelf=${READELF_EXE} -Dmod1=$<TARGET_FILE:example_mod_1> -Dmod2=$<TARGET_FILE:example_mod_2> -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mod_soname.cmake ) - ADD_DEPENDENCIES(check_mod_soname example_mod_1 example_mod_2) - ENDIF() - ENDIF() -ENDIF() + add_dependencies(check_mod_soname example_mod_1 example_mod_2) + endif() + endif() +endif() # TODO: # - create a plugin that links to a static lib diff --git a/Tests/Plugin/src/example_exe.cxx b/Tests/Plugin/src/example_exe.cxx index d2c52052c..309302e58 100644 --- a/Tests/Plugin/src/example_exe.cxx +++ b/Tests/Plugin/src/example_exe.cxx @@ -54,7 +54,7 @@ int main() kwsys_ios::cerr << "Incorrect return value from plugin!" << kwsys_ios::endl; return 1; - } + } kwsys::DynamicLoader::CloseLibrary(handle); return 0; } diff --git a/Tests/PolicyScope/CMakeLists.txt b/Tests/PolicyScope/CMakeLists.txt index e6f2edc07..413195a5c 100644 --- a/Tests/PolicyScope/CMakeLists.txt +++ b/Tests/PolicyScope/CMakeLists.txt @@ -7,7 +7,7 @@ function(check msg lhs rhs) if(NOT "${lhs}" STREQUAL "${rhs}") message(FATAL_ERROR "${msg}: expected [${lhs}], got [${rhs}]") endif() -endfunction(check) +endfunction() #----------------------------------------------------------------------------- # Test using a development framework that sets policies for us. @@ -52,7 +52,7 @@ if(1) # CMP0002 should be changed when this function is invoked cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") - endfunction(func1) + endfunction() # Unset CMP0002 cmake_policy(VERSION 2.4) @@ -65,8 +65,8 @@ if(1) cmake_policy(SET CMP0002 OLD) cmake_policy(GET CMP0002 cmp) check(CMP0002 "OLD" "${cmp}") - endmacro(macro1) -endif(1) + endmacro() +endif() cmake_policy(POP) # CMP0002 should still be NEW in this context. diff --git a/Tests/PreOrder/CMakeLists.txt b/Tests/PreOrder/CMakeLists.txt index 29720e4c1..8b4c43954 100644 --- a/Tests/PreOrder/CMakeLists.txt +++ b/Tests/PreOrder/CMakeLists.txt @@ -1,6 +1,6 @@ # a simple test case -PROJECT (PreOrder) -SET(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) -ADD_SUBDIRECTORY(Library) -ADD_EXECUTABLE (PreOrder simple.cxx) -TARGET_LINK_LIBRARIES(PreOrder simpleLib) +project (PreOrder) +set(CMAKE_IGNORE_DEPENDENCIES_ORDERING 1) +add_subdirectory(Library) +add_executable (PreOrder simple.cxx) +target_link_libraries(PreOrder simpleLib) diff --git a/Tests/PreOrder/Library/CMakeLists.txt b/Tests/PreOrder/Library/CMakeLists.txt index 6c011eca9..018ffa5e2 100644 --- a/Tests/PreOrder/Library/CMakeLists.txt +++ b/Tests/PreOrder/Library/CMakeLists.txt @@ -1,2 +1,2 @@ -ADD_LIBRARY(simpleLib simpleLib.cxx ) +add_library(simpleLib simpleLib.cxx ) diff --git a/Tests/PrecompiledHeader/CMakeLists.txt b/Tests/PrecompiledHeader/CMakeLists.txt index 3374e325f..6958131bf 100644 --- a/Tests/PrecompiledHeader/CMakeLists.txt +++ b/Tests/PrecompiledHeader/CMakeLists.txt @@ -1,59 +1,59 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(PrecompiledHeader C) +project(PrecompiledHeader C) # Make sure the proper compiler is in use. -IF(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") - MESSAGE(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel") -ENDIF() +if(NOT MSVC AND NOT "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") + message(FATAL_ERROR "The PrecompiledHeader test works only with MSVC or Intel") +endif() # Compute a custom name for the precompiled header. -IF(CMAKE_CONFIGURATION_TYPES) - SET(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH/${CMAKE_CFG_INTDIR}") - FOREACH(cfg ${CMAKE_CONFIGURATION_TYPES}) - FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg}) - ENDFOREACH() -ELSE(CMAKE_CONFIGURATION_TYPES) - SET(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH") - FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) -ENDIF(CMAKE_CONFIGURATION_TYPES) +if(CMAKE_CONFIGURATION_TYPES) + set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH/${CMAKE_CFG_INTDIR}") + foreach(cfg ${CMAKE_CONFIGURATION_TYPES}) + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH/${cfg}) + endforeach() +else() + set(PCH_DIR "${CMAKE_CURRENT_BINARY_DIR}/PCH") + file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/PCH) +endif() # The VS6 IDE does not support renaming .pch files with /Fp. -IF("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - SET(PCH_USE_INCLUDE_DIR 1) - SET(PCH_FILE) -ELSE("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") - SET(PCH_USE_INCLUDE_DIR 0) - SET(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") -ENDIF("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") + set(PCH_USE_INCLUDE_DIR 1) + set(PCH_FILE) +else() + set(PCH_USE_INCLUDE_DIR 0) + set(PCH_FILE "\"/Fp${PCH_DIR}/foo_precompiled.pch\"") +endif() # Choose between an explicit include path and using /I during # precompilation. The /I form is used to test that the PCH is # actually used. In practice the include path form would be used. -IF(PCH_USE_INCLUDE_DIR) - INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include) -ELSE(PCH_USE_INCLUDE_DIR) - SET(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"") -ENDIF(PCH_USE_INCLUDE_DIR) +if(PCH_USE_INCLUDE_DIR) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) +else() + set(PCH_INCLUDE_DIR "\"/I${CMAKE_CURRENT_SOURCE_DIR}/include\"") +endif() # Create a target that will use a precompiled header. -SET(foo_SRCS foo1.c foo2.c) -ADD_EXECUTABLE(foo foo_precompile.c ${foo_SRCS}) +set(foo_SRCS foo1.c foo2.c) +add_executable(foo foo_precompile.c ${foo_SRCS}) # Setup flags on the target to create and use the precompiled header. -SET_TARGET_PROPERTIES(foo PROPERTIES +set_target_properties(foo PROPERTIES COMPILE_FLAGS "/Yufoo_precompiled.h /FIfoo_precompiled.h ${PCH_FILE}") -SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES +set_source_files_properties(foo_precompile.c PROPERTIES COMPILE_FLAGS "/Ycfoo_precompiled.h ${PCH_INCLUDE_DIR}") # Setup dependencies for precompiled header creation and use. The VS # IDE takes care of this automatically. -IF("${CMAKE_GENERATOR}" MATCHES "Makefile" OR +if("${CMAKE_GENERATOR}" MATCHES "Makefile" OR "${CMAKE_GENERATOR}" MATCHES "Ninja") # This source file creates the precompiled header as a side-effect. - SET_SOURCE_FILES_PROPERTIES(foo_precompile.c PROPERTIES + set_source_files_properties(foo_precompile.c PROPERTIES OBJECT_OUTPUTS "${PCH_DIR}/foo_precompiled.pch") # These source files use the precompiled header. - SET_SOURCE_FILES_PROPERTIES(${foo_SRCS} PROPERTIES + set_source_files_properties(${foo_SRCS} PROPERTIES OBJECT_DEPENDS "${PCH_DIR}/foo_precompiled.pch") -ENDIF("${CMAKE_GENERATOR}" MATCHES "Makefile") +endif() diff --git a/Tests/Preprocess/CMakeLists.txt b/Tests/Preprocess/CMakeLists.txt index 1ed7b83ac..78746e7b8 100644 --- a/Tests/Preprocess/CMakeLists.txt +++ b/Tests/Preprocess/CMakeLists.txt @@ -9,37 +9,37 @@ project(Preprocess) # to work with each tool and documents those known to not work. if("${CMAKE_GENERATOR}" MATCHES "Xcode") set(PP_XCODE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Xcode") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") set(PP_VS6 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6") +endif() if("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") set(PP_UMAKE 1) -endif("${CMAKE_GENERATOR}" MATCHES "Unix Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") set(PP_NMAKE 1) -endif("${CMAKE_GENERATOR}" MATCHES "NMake Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") set(PP_MINGW 1) -endif("${CMAKE_GENERATOR}" MATCHES "MinGW Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles") set(PP_BORLAND 1) -endif("${CMAKE_GENERATOR}" MATCHES "Borland Makefiles") +endif() if("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") set(PP_WATCOM 1) -endif("${CMAKE_GENERATOR}" MATCHES "Watcom WMake") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") set(PP_VS70 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 7$") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio") set(PP_VS 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") set(PP_VS100 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 10") +endif() if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") set(PP_VS110 1) -endif("${CMAKE_GENERATOR}" MATCHES "Visual Studio 11") +endif() # Some tests below check the PP_* variables set above. They are meant # to test the case that the build tool is at fault. Other tests below @@ -80,8 +80,8 @@ if(NOT PP_VS6) # trouble passing to other tools, and the compiler may be directly # invoked from the command line. set(STRING_EXTRA "${STRING_EXTRA} ") - endif(NOT PP_BORLAND AND NOT PP_WATCOM) -endif(NOT PP_VS6) + endif() +endif() if(NOT PP_VS) # VS: , @@ -89,21 +89,21 @@ if(NOT PP_VS) # The comma-separated list of PreprocessorDefinitions in the project # file seems to be parsed before the content of entries is examined. set(STRING_EXTRA "${STRING_EXTRA},") -endif(NOT PP_VS) +endif() if(NOT PP_MINGW) # MinGW: & # When inside -D"FOO=\"a & b\"" MinGW make wants -D"FOO=\"a "&" b\"" # but it does not like quoted ampersand elsewhere. set(STRING_EXTRA "${STRING_EXTRA}&") -endif(NOT PP_MINGW) +endif() if(NOT PP_MINGW) # MinGW: | # When inside -D"FOO=\"a | b\"" MinGW make wants -D"FOO=\"a "|" b\"" # but it does not like quoted pipe elsewhere. set(STRING_EXTRA "${STRING_EXTRA}|") -endif(NOT PP_MINGW) +endif() if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # Borland, NMake, MinGW: ^ @@ -111,13 +111,13 @@ if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # but do not like quoted carrot elsewhere. In NMake the non-quoted # syntax works when the flags are not in a make variable. set(STRING_EXTRA "${STRING_EXTRA}^") -endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) +endif() if(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) # Borland, MinGW: < > # Angle-brackets have funny behavior that is hard to escape. set(STRING_EXTRA "${STRING_EXTRA}<>") -endif(NOT PP_BORLAND AND NOT PP_MINGW AND NOT PP_NMAKE) +endif() set(EXPR_OP1 "/") if((NOT MSVC OR PP_NMAKE) AND @@ -150,7 +150,7 @@ endif() # - NMake is okay with just \\\" if(PP_NMAKE OR PP_UMAKE) set(STRING_EXTRA "${STRING_EXTRA}\\\"") -endif(PP_NMAKE OR PP_UMAKE) +endif() # General: # # MSVC will not accept a # in the value of a string definition on the @@ -187,7 +187,7 @@ set(EXPR "x*y+!(x==(y+1*2))*f(x${EXPR_OP1}2)") if(NOT WATCOM) # Watcom does not support - or / because it parses them as options. set(EXPR "${EXPR} + y/x-x") -endif(NOT WATCOM) +endif() #----------------------------------------------------------------------------- @@ -199,11 +199,11 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DPREPROCESS_DEBUG") # Inform the test if it built from Xcode or VS6 IDE. if(PP_XCODE) set(PREPROCESS_XCODE 1) -endif(PP_XCODE) +endif() if(PP_VS6) set(PREPROCESS_VS6 1) set(VS6 _vs6) -endif(PP_VS6) +endif() # Test old-style definitions. add_definitions(-DOLD_DEF -DOLD_EXPR=2) @@ -213,7 +213,7 @@ set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2") get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS) if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") message(SEND_ERROR "add_definitions not converted to directory property!") -endif(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") +endif() add_executable(Preprocess preprocess.c preprocess${VS6}.cxx) @@ -234,14 +234,14 @@ foreach(c "" "_DEBUG" "_RELEASE") SOURCE preprocess.c preprocess${VS6}.cxx PROPERTY COMPILE_DEFINITIONS${c} "FILE_DEF${c}" ) -endforeach(c) +endforeach() # Add definitions with values. if(NOT PREPROCESS_VS6) # The path might have spaces, which VS6 does not support. set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"") set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"") -endif(NOT PREPROCESS_VS6) +endif() set_property( TARGET Preprocess APPEND PROPERTY COMPILE_DEFINITIONS @@ -263,7 +263,7 @@ add_custom_target(drive COMMAND Preprocess) # Configure the header file with the desired string value. if(SEMICOLON) set(STRING_VALUE "${STRING_VALUE};") -endif(SEMICOLON) +endif() configure_file(${Preprocess_SOURCE_DIR}/preprocess.h.in ${Preprocess_BINARY_DIR}/preprocess.h) include_directories(${Preprocess_BINARY_DIR}) diff --git a/Tests/Properties/CMakeLists.txt b/Tests/Properties/CMakeLists.txt index c1bc3b9e3..285d5965e 100644 --- a/Tests/Properties/CMakeLists.txt +++ b/Tests/Properties/CMakeLists.txt @@ -2,15 +2,15 @@ cmake_minimum_required (VERSION 2.6) project (Properties) -# these first three tests really test both properties and the management of -# cmSourceFile objects by CMake. +# these first three tests really test both properties and the management of +# cmSourceFile objects by CMake. # test properties on a build tree file that is relative (yuck) configure_file(properties.h.in "${Properties_BINARY_DIR}/properties.h") set_source_files_properties(properties.h PROPERTIES TEST1 1) get_source_file_property(RESULT1 properties.h TEST1) -# test properties on a headerfile in the source tree +# test properties on a headerfile in the source tree # accessed without an extenion (also yuck) set_source_files_properties(properties2 PROPERTIES TEST2 1) get_source_file_property(RESULT2 properties2 TEST2) @@ -27,7 +27,7 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED) if (GLOBALRESULT) message(SEND_ERROR "Error: global prop defined when it should not be, " "result is GLOBALRESULT=${GLOBALRESULT}") -endif (GLOBALRESULT) +endif () define_property(GLOBAL PROPERTY GLOBALTEST BRIEF_DOCS "A test property" @@ -38,8 +38,8 @@ get_property(GLOBALRESULT GLOBAL PROPERTY GLOBALTEST DEFINED) if (NOT GLOBALRESULT) message(SEND_ERROR "Error: global prop not defined " "result is GLOBALRESULT=${GLOBALRESULT}") -endif (NOT GLOBALRESULT) - +endif () + set_property(GLOBAL PROPERTY GLOBALTEST 1) set_property(DIRECTORY PROPERTY DIRECTORYTEST 1) set_property(SOURCE SubDir/properties3.cxx PROPERTY SOURCETEST 1) @@ -50,26 +50,24 @@ get_property(SOURCERESULT PROPERTY SOURCETEST ) -if (RESULT1 AND RESULT2 AND RESULT3 AND GLOBALRESULT AND +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) - message(SEND_ERROR +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) get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST) if (NOT TARGETRESULT) - message(SEND_ERROR + message(SEND_ERROR "Error: target result is TARGETRESULT=${TARGETRESULT}") -endif (NOT TARGETRESULT) +endif () # test APPEND and APPEND_STRING set_property() set_property(TARGET Properties PROPERTY FOO foo) @@ -92,9 +90,9 @@ endif () # test get_property SET get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET) if (NOT TARGETRESULT) - message(SEND_ERROR + message(SEND_ERROR "Error: target prop not set, result is TARGETRESULT=${TARGETRESULT}") -endif (NOT TARGETRESULT) +endif () # test unsetting a property set_property(TARGET Properties PROPERTY TARGETTEST) @@ -102,7 +100,7 @@ get_property(TARGETRESULT TARGET Properties PROPERTY TARGETTEST SET) if (TARGETRESULT) message(SEND_ERROR "Error: target prop not unset, " "result is TARGETRESULT=${TARGETRESULT}") -endif (TARGETRESULT) +endif () @@ -114,7 +112,7 @@ if(NOT RESULT4) message(SEND_ERROR "Error: target result is" " RESULT4=${RESULT4}" " Properties_SOURCES=[${Properties_SOURCES}]") -endif(NOT RESULT4) +endif() # test CACHE properties macro(check_cache_props) @@ -123,8 +121,8 @@ macro(check_cache_props) if(NOT "x${result}" STREQUAL "x${expect_${prop}}") message(SEND_ERROR "CACHE property ${prop} is [${result}], not [${expect_${prop}}]") endif() - endforeach(prop) -endmacro(check_cache_props) + endforeach() +endmacro() set(expect_VALUE "ON") set(expect_TYPE "BOOL") set(expect_HELPSTRING "sample cache entry") diff --git a/Tests/ReturnTest/CMakeLists.txt b/Tests/ReturnTest/CMakeLists.txt index a08855ec1..3bd7ce099 100644 --- a/Tests/ReturnTest/CMakeLists.txt +++ b/Tests/ReturnTest/CMakeLists.txt @@ -4,24 +4,24 @@ project (ReturnTest) function (FAILED testname) message (SEND_ERROR "${testname} failed ${ARGN}") -endfunction (FAILED) +endfunction () function (PASS testname) message ("${testname} passed ${ARGN}") -endfunction (PASS) +endfunction () # test simple return function (simple) set(simpleResult 1 PARENT_SCOPE) return() set(simpleResult 0 PARENT_SCOPE) -endfunction (simple) +endfunction () simple() if ("${simpleResult}") pass ("simple") -else ("${simpleResult}") +else () failed ("simple got: ${simpleResult}") -endif ("${simpleResult}") +endif () #test return in an if statement set (simple2IF 1) @@ -29,15 +29,15 @@ function (simple2) set(simple2Result 1 PARENT_SCOPE) if (simple2IF) return() - endif (simple2IF) + endif () set(simple2Result 0 PARENT_SCOPE) -endfunction (simple2) +endfunction () simple2() if ("${simple2Result}") pass ("simple2") -else ("${simple2Result}") +else () failed ("simple2 got: ${simple2Result}") -endif ("${simple2Result}") +endif () #test return in a foreach loop function (looptest) @@ -45,15 +45,15 @@ function (looptest) set (looptestResult "${iter}" PARENT_SCOPE) if ("${iter}" EQUAL 3) return () - endif ("${iter}" EQUAL 3) - endforeach (iter) -endfunction (looptest) + endif () + endforeach () +endfunction () looptest() if ("${looptestResult}" EQUAL 3) pass ("looptest") -else ("${looptestResult}" EQUAL 3) +else () failed ("looptest got: ${looptestResult}") -endif ("${looptestResult}" EQUAL 3) +endif () #test return in a while loop function (whiletest) @@ -62,58 +62,58 @@ function (whiletest) set (whiletestResult "${iter}" PARENT_SCOPE) if ("${iter}" STREQUAL "aaa") return () - endif ("${iter}" STREQUAL "aaa") + endif () set (iter "${iter}a") - endwhile(NOT "${iter}" STREQUAL "aaaaa") -endfunction (whiletest) + endwhile() +endfunction () whiletest() if ("${whiletestResult}" STREQUAL "aaa") pass ("whiletest") -else ("${whiletestResult}" STREQUAL "aaa") +else () failed ("whiletest got: ${whiletestResult}") -endif ("${whiletestResult}" STREQUAL "aaa") +endif () # check subdir return add_subdirectory(subdir) get_directory_property(subdirResult DIRECTORY subdir DEFINITION subdirreturn) if ("${subdirResult}" EQUAL 1) pass ("subdir") -else ("${subdirResult}" EQUAL 1) +else () failed ("subdir got: ${subdirResult}") -endif ("${subdirResult}" EQUAL 1) +endif () # check return from a file include(include_return.cmake) if ("${include_returnResult}" EQUAL 1) pass ("include_return") -else ("${include_returnResult}" EQUAL 1) +else () failed ("include_return got: ${include_returnResult}") -endif ("${include_returnResult}" EQUAL 1) +endif () # check return from within a macro macro (mymacro) set (foo 1) if (foo) return() - endif (foo) -endmacro(mymacro) + endif () +endmacro() # test simple return function (simple3) set (bar 0) set(simple3Result 1 PARENT_SCOPE) if (bar) - else (bar) + else () mymacro() - endif(bar) + endif() set(simple3Result 0 PARENT_SCOPE) -endfunction (simple3) +endfunction () simple3() if ("${simple3Result}") pass ("macrotest") -else ("${simple3Result}") +else () failed ("macrotest got: ${simple3Result}") -endif ("${simple3Result}") +endif () # test break command now in a foreach @@ -121,27 +121,27 @@ foreach (iter RANGE 1 5) set (break1 "${iter}") if ("${iter}" EQUAL 3) break () - endif ("${iter}" EQUAL 3) -endforeach (iter) + endif () +endforeach () if ("${break1}" EQUAL 3) pass ("break in foreach") -else ("${break1}" EQUAL 3) +else () failed ("break in foreach got: ${break1}") -endif ("${break1}" EQUAL 3) +endif () # test break in a while loop set (iter "a") while(NOT "${iter}" STREQUAL "aaaaa") if ("${iter}" STREQUAL "aaa") break () - endif ("${iter}" STREQUAL "aaa") + endif () set (iter "${iter}a") -endwhile(NOT "${iter}" STREQUAL "aaaaa") +endwhile() if ("${iter}" STREQUAL "aaa") pass ("break in a while") -else ("${iter}" STREQUAL "aaa") +else () failed ("break in a whi;e got: ${whiletestResult}") -endif ("${iter}" STREQUAL "aaa") +endif () add_executable (ReturnTest returnTest.c) diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index eca96f907..8c67625ff 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -45,12 +45,15 @@ macro(add_RunCMake_test test) ) endmacro() +add_RunCMake_test(GeneratorExpression) +add_RunCMake_test(TargetPropertyGeneratorExpressions) add_RunCMake_test(Languages) add_RunCMake_test(ObjectLibrary) add_RunCMake_test(build_command) add_RunCMake_test(find_package) add_RunCMake_test(include) +add_RunCMake_test(include_directories) add_RunCMake_test(list) if("${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio [^6]") diff --git a/Tests/RunCMake/GeneratorExpression/BadAND-result.txt b/Tests/RunCMake/GeneratorExpression/BadAND-result.txt new file mode 100644 index 000000000..d00491fd7 --- /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 000000000..36302db9b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadAND-stderr.txt @@ -0,0 +1,44 @@ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND> + + \$<AND> expression requires at least one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:> + + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:,> + + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:01> + + Parameters to \$<AND> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadAND.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<AND:nothing> + + Parameters to \$<AND> must resolve to either '0' or '1'. +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 000000000..265e4149b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadAND.cmake @@ -0,0 +1,7 @@ +add_custom_target(check ALL COMMAND check + $<AND> + $<AND:> + $<AND:,> + $<AND:01> + $<AND:nothing> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadCONFIG-result.txt b/Tests/RunCMake/GeneratorExpression/BadCONFIG-result.txt new file mode 100644 index 000000000..d00491fd7 --- /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 000000000..1cfbf404e --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG-stderr.txt @@ -0,0 +1,44 @@ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG> + + \$<CONFIG> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +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\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo,Bar> + + \$<CONFIG> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo-Bar> + + Expression syntax not recognized. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadCONFIG.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<CONFIG:Foo-Nested> + + 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 000000000..c27ea5f73 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadCONFIG.cmake @@ -0,0 +1,7 @@ +add_custom_target(check ALL COMMAND check + $<CONFIG> + $<CONFIG:.> + $<CONFIG:Foo,Bar> + $<CONFIG:Foo-Bar> + $<$<CONFIG:Foo-Nested>:foo> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt b/Tests/RunCMake/GeneratorExpression/BadNOT-result.txt new file mode 100644 index 000000000..d00491fd7 --- /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 000000000..e5e628c30 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadNOT-stderr.txt @@ -0,0 +1,52 @@ +CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<NOT> + + \$<NOT> expression requires exactly one parameter. +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> parameter must resolve to 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> expression requires exactly one parameter. +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> expression requires exactly one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadNOT.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<NOT:01> + + \$<NOT> parameter must resolve to 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:nothing> + + \$<NOT> parameter must resolve to 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 000000000..c2dada3c2 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadNOT.cmake @@ -0,0 +1,8 @@ +add_custom_target(check ALL COMMAND check + $<NOT> + $<NOT:> + $<NOT:,> + $<NOT:0,1> + $<NOT:01> + $<NOT:nothing> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadOR-result.txt b/Tests/RunCMake/GeneratorExpression/BadOR-result.txt new file mode 100644 index 000000000..d00491fd7 --- /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 000000000..d4ccab74c --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadOR-stderr.txt @@ -0,0 +1,44 @@ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR> + + \$<OR> expression requires at least one parameter. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:> + + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:,> + + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:01> + + Parameters to \$<OR> must resolve to either '0' or '1'. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadOR.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<OR:nothing> + + Parameters to \$<OR> must resolve to either '0' or '1'. +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 000000000..0813400d6 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadOR.cmake @@ -0,0 +1,7 @@ +add_custom_target(check ALL COMMAND check + $<OR> + $<OR:> + $<OR:,> + $<OR:01> + $<OR:nothing> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt new file mode 100644 index 000000000..dd0d931be --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual-stderr.txt @@ -0,0 +1,38 @@ +CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 0 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL:> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 1 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL:,,> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 3 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at BadStrEqual.cmake:1 \(add_custom_target\): + Error evaluating generator expression: + + \$<STREQUAL:something,,> + + \$<STREQUAL> expression requires 2 comma separated parameters, but got 3 + instead. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake b/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake new file mode 100644 index 000000000..56eb45853 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/BadStrEqual.cmake @@ -0,0 +1,6 @@ +add_custom_target(check ALL COMMAND check + $<STREQUAL> + $<STREQUAL:> + $<STREQUAL:,,> + $<STREQUAL:something,,> + VERBATIM) diff --git a/Tests/RunCMake/GeneratorExpression/CMakeLists.txt b/Tests/RunCMake/GeneratorExpression/CMakeLists.txt new file mode 100644 index 000000000..e8db6b05b --- /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 000000000..18a47ae00 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -0,0 +1,7 @@ +include(RunCMake) + +run_cmake(BadCONFIG) +run_cmake(BadOR) +run_cmake(BadAND) +run_cmake(BadNOT) +run_cmake(BadStrEqual) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt new file mode 100644 index 000000000..3287d19ac --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES> + + Target name not supported. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake new file mode 100644 index 000000000..d5f661d60 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName1.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:Invali/dTarget,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt new file mode 100644 index 000000000..e527e2275 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty> + + Target name and property name not supported.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake new file mode 100644 index 000000000..6e4c1d0d3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName2.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:Invali/dTarget,Invali/dProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt new file mode 100644 index 000000000..517debbca --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:Invali/dProperty> + + Property name not supported.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake new file mode 100644 index 000000000..3f75aa382 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName3.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:Invali/dProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt new file mode 100644 index 000000000..eab6fb690 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:foo,Invali/dProperty> + + Property name not supported.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake new file mode 100644 index 000000000..b616c3106 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName4.cmake @@ -0,0 +1,9 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(foo "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:foo,Invali/dProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt new file mode 100644 index 000000000..e2b4fc6fa --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:,> + + \$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name and + property name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake new file mode 100644 index 000000000..11cb6fa52 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName5.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:,>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt new file mode 100644 index 000000000..e94f52fa2 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:,ValidProperty> + + \$<TARGET_PROPERTY:tgt,prop> expression requires a non-empty target name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake new file mode 100644 index 000000000..bf868a501 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName6.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:,ValidProperty>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt new file mode 100644 index 000000000..2548215f4 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:foo,> + + \$<TARGET_PROPERTY:...> expression requires a non-empty property name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake new file mode 100644 index 000000000..36d1a7903 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName7.cmake @@ -0,0 +1,9 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(foo "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:foo,>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt new file mode 100644 index 000000000..2a98f6f06 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:> + + \$<TARGET_PROPERTY:...> expression requires a non-empty property name. diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake new file mode 100644 index 000000000..f059288c6 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadInvalidName8.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt new file mode 100644 index 000000000..d2ac7a963 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES> + + Target "NonExistant" not found.$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake new file mode 100644 index 000000000..b020c0821 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadNonTarget.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:NonExistant,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt new file mode 100644 index 000000000..791c4a9b3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake new file mode 100644 index 000000000..a85731ecf --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference1.cmake @@ -0,0 +1,7 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories("$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt new file mode 100644 index 000000000..791c4a9b3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake new file mode 100644 index 000000000..f1459b8cb --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference2.cmake @@ -0,0 +1,9 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY + INCLUDE_DIRECTORIES "$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt new file mode 100644 index 000000000..f60d72632 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake new file mode 100644 index 000000000..433b73011 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference3.cmake @@ -0,0 +1,8 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +include_directories( + "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>") diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt new file mode 100644 index 000000000..f60d72632 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake new file mode 100644 index 000000000..4b6445916 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference4.cmake @@ -0,0 +1,10 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY +INCLUDE_DIRECTORIES + "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,INCLUDE_DIRECTORIES>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt new file mode 100644 index 000000000..2b22d0fc3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:COMPILE_DEFINITIONS> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake new file mode 100644 index 000000000..74fff674d --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference5.cmake @@ -0,0 +1,10 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions +PROPERTY + COMPILE_DEFINITIONS "$<TARGET_PROPERTY:COMPILE_DEFINITIONS>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt new file mode 100644 index 000000000..fe7caa3c3 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS> + + Self reference on target "TargetPropertyGeneratorExpressions".$ diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake new file mode 100644 index 000000000..d6650d3a5 --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/BadSelfReference6.cmake @@ -0,0 +1,10 @@ + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cpp" + "int main(int, char **) { return 0; }\n") + +add_executable(TargetPropertyGeneratorExpressions + "${CMAKE_CURRENT_BINARY_DIR}/main.cpp") +set_property(TARGET TargetPropertyGeneratorExpressions PROPERTY +COMPILE_DEFINITIONS + "$<TARGET_PROPERTY:TargetPropertyGeneratorExpressions,COMPILE_DEFINITIONS>" +) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt new file mode 100644 index 000000000..22577da4a --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/CMakeLists.txt @@ -0,0 +1,8 @@ + +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} CXX) + +# MSVC creates extra targets which pollute the stderr unless we set this. +set(CMAKE_SUPPRESS_REGENERATION TRUE) + +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake new file mode 100644 index 000000000..0ee32387d --- /dev/null +++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/RunCMakeTest.cmake @@ -0,0 +1,17 @@ +include(RunCMake) + +run_cmake(BadSelfReference1) +run_cmake(BadSelfReference2) +run_cmake(BadSelfReference3) +run_cmake(BadSelfReference4) +run_cmake(BadSelfReference5) +run_cmake(BadSelfReference6) +run_cmake(BadNonTarget) +run_cmake(BadInvalidName1) +run_cmake(BadInvalidName2) +run_cmake(BadInvalidName3) +run_cmake(BadInvalidName4) +run_cmake(BadInvalidName5) +run_cmake(BadInvalidName6) +run_cmake(BadInvalidName7) +run_cmake(BadInvalidName8) diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt new file mode 100644 index 000000000..e8db6b05b --- /dev/null +++ b/Tests/RunCMake/include_directories/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_directories/NotFoundContent-result.txt b/Tests/RunCMake/include_directories/NotFoundContent-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/include_directories/NotFoundContent-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt b/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt new file mode 100644 index 000000000..f608d633f --- /dev/null +++ b/Tests/RunCMake/include_directories/NotFoundContent-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: The following variables are used in this project, but they are set to NOTFOUND. +Please set them or make sure they are set and tested correctly in the CMake files: +NotThere1 + used as include directory in directory .* +NotThere2 + used as include directory in directory .* diff --git a/Tests/RunCMake/include_directories/NotFoundContent.cmake b/Tests/RunCMake/include_directories/NotFoundContent.cmake new file mode 100644 index 000000000..9677e0c43 --- /dev/null +++ b/Tests/RunCMake/include_directories/NotFoundContent.cmake @@ -0,0 +1,9 @@ + +include_directories(NotThere1-NOTFOUND) + +include_directories($<1:There1-NOTFOUND>) + +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp" "int main(int,char**) { return 0; }\n") +add_executable(dummy "${CMAKE_CURRENT_BINARY_DIR}/dummy.cpp") +set_property(TARGET dummy APPEND PROPERTY INCLUDE_DIRECTORIES "NotThere2-NOTFOUND") +set_property(TARGET dummy APPEND PROPERTY INCLUDE_DIRECTORIES "$<1:There2-NOTFOUND>") diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake new file mode 100644 index 000000000..aee3f799b --- /dev/null +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(NotFoundContent) diff --git a/Tests/RunCMake/include_external_msproject/check_utils.cmake b/Tests/RunCMake/include_external_msproject/check_utils.cmake index 7d6b8f8ea..7f5ef5394 100644 --- a/Tests/RunCMake/include_external_msproject/check_utils.cmake +++ b/Tests/RunCMake/include_external_msproject/check_utils.cmake @@ -8,8 +8,8 @@ macro(check_line_exists TARGET_FILE REG_EXP_REF) if(_VAR_LEN GREATER 0) set(IS_FOUND "TRUE") - endif(_VAR_LEN GREATER 0) -endmacro(check_line_exists TARGET_FILE REG_EXP_REF) + endif() +endmacro() # Search and parse project section line by project name. # If search was successful stores found type and guid into FOUND_TYPE and FOUND_GUID variables respectively. @@ -20,13 +20,13 @@ macro(parse_project_section TARGET_FILE PROJECT_NAME) check_line_exists(${TARGET_FILE} REG_EXP) if(NOT IS_FOUND) return() - endif(NOT IS_FOUND) + endif() string(REGEX REPLACE "${REG_EXP}" "\\1;\\2" _GUIDS "${FOUND_LINE}") list(GET _GUIDS 0 FOUND_TYPE) list(GET _GUIDS 1 FOUND_GUID) -endmacro(parse_project_section TARGET_FILE PROJECT_NAME) +endmacro() # Search project section line by project name and type. # Returns TRUE if found and FALSE otherwise @@ -36,8 +36,8 @@ function(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE) set(${RESULT} "TRUE" PARENT_SCOPE) - endif(IS_FOUND AND FOUND_TYPE STREQUAL PROJECT_TYPE) -endfunction(check_project_type TARGET_FILE PROJECT_NAME PROJECT_TYPE RESULT) + endif() +endfunction() # Search project section line by project name and id. @@ -48,8 +48,8 @@ function(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID) set(${RESULT} "TRUE" PARENT_SCOPE) - endif(IS_FOUND AND FOUND_GUID STREQUAL PROJECT_GUID) -endfunction(check_project_guid TARGET_FILE PROJECT_NAME PROJECT_GUID RESULT) + endif() +endfunction() # Search project's build configuration line by project name and target platform name. @@ -61,7 +61,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) parse_project_section(${TARGET_FILE} ${PROJECT_NAME}) if(NOT IS_FOUND) return() - endif(NOT IS_FOUND) + endif() # probably whould be better to use configuration name # extracted from CMAKE_CONFIGURATION_TYPES than just hardcoded "Debug" instead @@ -69,7 +69,7 @@ function(check_custom_platform TARGET_FILE PROJECT_NAME PLATFORM_NAME RESULT) check_line_exists(${TARGET_FILE} REG_EXP) set(${RESULT} ${IS_FOUND} PARENT_SCOPE) -endfunction(check_custom_platform TARGET_FILE PLATFORM_NAME RESULT) +endfunction() # RunCMake test check helper function(check_project test name guid type platform) diff --git a/Tests/RuntimePath/CMakeLists.txt b/Tests/RuntimePath/CMakeLists.txt index 2164cdb8d..6583a8712 100644 --- a/Tests/RuntimePath/CMakeLists.txt +++ b/Tests/RuntimePath/CMakeLists.txt @@ -30,4 +30,4 @@ if(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) set_property(TARGET bar2 PROPERTY OUTPUT_NAME bar) set_property(TARGET bar2 PROPERTY LIBRARY_OUTPUT_DIRECTORY A) target_link_libraries(bar2 foo2) -endif(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG) +endif() diff --git a/Tests/SameName/CMakeLists.txt b/Tests/SameName/CMakeLists.txt index a4b993cfd..d78879dd9 100644 --- a/Tests/SameName/CMakeLists.txt +++ b/Tests/SameName/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SameName C) +project(SameName C) -ADD_SUBDIRECTORY(Lib1) +add_subdirectory(Lib1) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/Lib1) -ADD_SUBDIRECTORY(Exe1) +include_directories(${PROJECT_SOURCE_DIR}/Lib1) +add_subdirectory(Exe1) diff --git a/Tests/SameName/Exe1/CMakeLists.txt b/Tests/SameName/Exe1/CMakeLists.txt index 3917a2f6b..b9182f209 100644 --- a/Tests/SameName/Exe1/CMakeLists.txt +++ b/Tests/SameName/Exe1/CMakeLists.txt @@ -1,11 +1,11 @@ # a target with the same name as a target in a different dir -ADD_EXECUTABLE(mytest_exe conly.c) -SET_TARGET_PROPERTIES(mytest_exe PROPERTIES OUTPUT_NAME mytest) -TARGET_LINK_LIBRARIES(mytest_exe mytest) +add_executable(mytest_exe conly.c) +set_target_properties(mytest_exe PROPERTIES OUTPUT_NAME mytest) +target_link_libraries(mytest_exe mytest) # and two targets in the same dir with the same name -ADD_LIBRARY(mytest2 ../Lib1/libc1.c) +add_library(mytest2 ../Lib1/libc1.c) -ADD_EXECUTABLE(mytest2_exe conly.c) -SET_TARGET_PROPERTIES(mytest2_exe PROPERTIES OUTPUT_NAME mytest2) -TARGET_LINK_LIBRARIES(mytest2_exe mytest2) +add_executable(mytest2_exe conly.c) +set_target_properties(mytest2_exe PROPERTIES OUTPUT_NAME mytest2) +target_link_libraries(mytest2_exe mytest2) diff --git a/Tests/SameName/Lib1/CMakeLists.txt b/Tests/SameName/Lib1/CMakeLists.txt index 67e7f6843..40fa15422 100644 --- a/Tests/SameName/Lib1/CMakeLists.txt +++ b/Tests/SameName/Lib1/CMakeLists.txt @@ -1 +1 @@ -ADD_LIBRARY(mytest libc1.c) +add_library(mytest libc1.c) diff --git a/Tests/SetLang/CMakeLists.txt b/Tests/SetLang/CMakeLists.txt index ab6570c33..f24e5cb5d 100644 --- a/Tests/SetLang/CMakeLists.txt +++ b/Tests/SetLang/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6) project(SetLang) # force this to be verbose so I can debug a dashboard entry -SET(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_VERBOSE_MAKEFILE 1) add_library(foo foo.c) add_executable(SetLang bar.c) set_source_files_properties(foo.c bar.c PROPERTIES LANGUAGE CXX) diff --git a/Tests/Simple/CMakeLists.txt b/Tests/Simple/CMakeLists.txt index dc965a733..a951c2da2 100644 --- a/Tests/Simple/CMakeLists.txt +++ b/Tests/Simple/CMakeLists.txt @@ -3,9 +3,9 @@ project (Simple) add_executable (Simple simple.cxx) -add_library (simpleLib STATIC - simpleLib.cxx - simpleCLib.c +add_library (simpleLib STATIC + simpleLib.cxx + simpleCLib.c simpleWe.cpp ) @@ -14,4 +14,4 @@ target_link_libraries (Simple simpleLib) # make sure optimized libs are not used by debug builds if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(Simple optimized c:/not/here.lib ) -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif() diff --git a/Tests/Simple/simpleWe.cpp b/Tests/Simple/simpleWe.cpp index 859e07c06..e0f22ef8d 100644 --- a/Tests/Simple/simpleWe.cpp +++ b/Tests/Simple/simpleWe.cpp @@ -1,6 +1,6 @@ #include <stdio.h> -class Foo +class Foo { public: Foo() diff --git a/Tests/SimpleCOnly/CMakeLists.txt b/Tests/SimpleCOnly/CMakeLists.txt index d0ed651b1..fb247790f 100644 --- a/Tests/SimpleCOnly/CMakeLists.txt +++ b/Tests/SimpleCOnly/CMakeLists.txt @@ -14,4 +14,4 @@ message(STATUS "sizeof(float): ${SIZE_FLOAT}") # make sure optimized libs are not used by debug builds if(CMAKE_BUILD_TYPE MATCHES Debug) target_link_libraries(Simple optimized c:/not/here.lib ) -endif(CMAKE_BUILD_TYPE MATCHES Debug) +endif() diff --git a/Tests/SimpleCOnly/main.c b/Tests/SimpleCOnly/main.c index e4df685cb..022a8e88d 100644 --- a/Tests/SimpleCOnly/main.c +++ b/Tests/SimpleCOnly/main.c @@ -3,7 +3,7 @@ extern int foo(); extern int bar(); -int main() +int main() { int i=foo(); int k=bar(); diff --git a/Tests/SimpleExclude/run.cmake.in b/Tests/SimpleExclude/run.cmake.in index 8f83380c8..d31d2e51b 100644 --- a/Tests/SimpleExclude/run.cmake.in +++ b/Tests/SimpleExclude/run.cmake.in @@ -8,6 +8,6 @@ message("T9 ${t9_name} resulted ${t9_var}") if ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) message("Everything is good, Yoshimi won...") -else ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) +else () message(FATAL_ERROR "Yoshimi lost... The evil pink robots will take over the world") -endif ( "${t4_var}" EQUAL "0" AND "${t9_var}" EQUAL "0" ) +endif () diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index 378b5292b..479d6ec36 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -1,216 +1,216 @@ cmake_minimum_required (VERSION 2.6) -PROJECT (TestSimpleInstall) -SET(CMAKE_VERBOSE_MAKEFILE 1) -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY +project (TestSimpleInstall) +set(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/bin") -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib") # Skip generating the rpath pointing at the build tree to make sure # the executable is installed with the proper rpath in the install # tree. -SET(CMAKE_SKIP_BUILD_RPATH 1) +set(CMAKE_SKIP_BUILD_RPATH 1) # Make sure the executable can run from the install tree. -SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) +set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Skip the dependency that causes a build when installing. This # avoids infinite loops when the post-build rule below installs. -SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) -SET(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) -SET(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") +set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -SET(EXTRA_INSTALL_FLAGS) -MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}") +set(EXTRA_INSTALL_FLAGS) +message("Extra install: ${EXTRA_INSTALL_FLAGS}") -IF(STAGE2) - SET(LIBPATHS +if(STAGE2) + set(LIBPATHS ${CMAKE_INSTALL_PREFIX}/MyTest/lib/static ${CMAKE_INSTALL_PREFIX}/MyTest/lib ) - SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) - SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) - SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) + set(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) + set(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) + set(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) # Make sure the install script ran. - SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0) - INCLUDE(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) - IF(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(STATUS "Stage 1 did run install script 2.") - ELSE(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(SEND_ERROR "Stage 1 did not run install script 2.") - ENDIF(CMAKE_INSTALL_SCRIPT_DID_RUN) - - IF(CYGWIN OR MINGW) - SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - ENDIF(CYGWIN OR MINGW) - MESSAGE("Search for library in: ${LIBPATHS}") - - SET(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - - FIND_LIBRARY(TEST1_LIBRARY + set(CMAKE_INSTALL_SCRIPT_DID_RUN 0) + include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) + if(CMAKE_INSTALL_SCRIPT_DID_RUN) + message(STATUS "Stage 1 did run install script 2.") + else() + message(SEND_ERROR "Stage 1 did not run install script 2.") + endif() + + if(CYGWIN OR MINGW) + set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") + endif() + message("Search for library in: ${LIBPATHS}") + + set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + + find_library(TEST1_LIBRARY NAMES ${t1NAMES} PATHS ${LIBPATHS} DOC "First library") - FIND_LIBRARY(TEST2_LIBRARY + find_library(TEST2_LIBRARY NAMES ${t2NAMES} PATHS ${LIBPATHS} DOC "Second library") - FIND_LIBRARY(TEST4_LIBRARY + find_library(TEST4_LIBRARY NAMES ${t4NAMES} PATHS ${LIBPATHS} DOC "Fourth library") # Test importing a library found on disk. - ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED) - SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) + add_library(lib_test4 UNKNOWN IMPORTED) + set_property(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) - INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include) - ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) - SET(install_target SimpleInstExeS2) + include_directories(${CMAKE_INSTALL_PREFIX}/MyTest/include) + add_executable (SimpleInstExeS2 inst2.cxx foo.c foo.h) + target_link_libraries(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) + set(install_target SimpleInstExeS2) - IF("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(STATUS "test1 correctly found in lib/static") - ELSE("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(SEND_ERROR "test1 not found in lib/static!") - ENDIF("${TEST1_LIBRARY}" MATCHES "static") + if("${TEST1_LIBRARY}" MATCHES "static") + message(STATUS "test1 correctly found in lib/static") + else() + message(SEND_ERROR "test1 not found in lib/static!") + endif() # Check for failure of configuration-specific installation. - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") - MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + message(FATAL_ERROR "Debug-configuration file installed for Release!") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + message(FATAL_ERROR "Release-configuration file installed for Debug!") + endif() # Check for failure of directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - MESSAGE(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install alternate TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") - MESSAGE(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install TSD.h") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") + endif() + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install alternate TSD.h") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") + endif() # Check that scripts properly installed. - IF(WIN32 AND NOT CYGWIN) - SET(BAT .bat) - ELSE(WIN32 AND NOT CYGWIN) - SET(BAT) - ENDIF(WIN32 AND NOT CYGWIN) - FOREACH(loc share share/old1 share/old2 share/old3 share/alt) - SET(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") - EXECUTE_PROCESS( + if(WIN32 AND NOT CYGWIN) + set(BAT .bat) + else() + set(BAT) + endif() + foreach(loc share share/old1 share/old2 share/old3 share/alt) + set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") + execute_process( COMMAND ${CUR_SCRIPT} RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - MESSAGE(FATAL_ERROR + if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - MESSAGE(FATAL_ERROR + endif() + if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - ENDFOREACH(loc) + endif() + endforeach() # Check for failure of empty directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - MESSAGE(FATAL_ERROR "Empty directory installation did not install.") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - FILE(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") - IF(EMPTY_FILES) - MESSAGE(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - ENDIF(EMPTY_FILES) + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + message(FATAL_ERROR "Empty directory installation did not install.") + endif() + file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") + if(EMPTY_FILES) + message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") + endif() # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstExeS2 PROPERTIES + set_target_properties(SimpleInstExeS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - INSTALL_TARGETS(/MyTest/bin SimpleInstExeS2) + install_targets(/MyTest/bin SimpleInstExeS2) # try to import the exported targets again - SET(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - FIND_PACKAGE(SimpleInstallS1 REQUIRED) - GET_TARGET_PROPERTY(simpleInstallImported S1_SimpleInstall IMPORTED) - IF(NOT simpleInstallImported) - MESSAGE(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - ENDIF(NOT simpleInstallImported) - -ELSE(STAGE2) + set(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) + find_package(SimpleInstallS1 REQUIRED) + get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) + if(NOT simpleInstallImported) + message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") + endif() + +else() # Wipe out the install directory to do a fresh test. - FILE(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) + file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) # this is stage 1, so create libraries and modules and install everything - ADD_LIBRARY(test1 STATIC lib1.cxx) - ADD_LIBRARY(test2 SHARED lib2.cxx) - ADD_LIBRARY(test3 MODULE lib3.cxx) - ADD_LIBRARY(test4 SHARED lib4.cxx) + add_library(test1 STATIC lib1.cxx) + add_library(test2 SHARED lib2.cxx) + add_library(test3 MODULE lib3.cxx) + add_library(test4 SHARED lib4.cxx) # Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME properties. - SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) - SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) - ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4) - SET(install_target SimpleInstall) + add_executable (SimpleInstall inst.cxx foo.c foo.h) + target_link_libraries(SimpleInstall test1 test2 test4) + set(install_target SimpleInstall) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) + set_target_properties(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) # Disable VERSION test until it is implemented in the Xcode generator. - IF(NOT XCODE) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2) - ENDIF(NOT XCODE) + if(NOT XCODE) + set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) + endif() # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES + set_target_properties(SimpleInstall PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Test per-configuration output name. - SET_TARGET_PROPERTIES(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) - SET_TARGET_PROPERTIES(test2 PROPERTIES PUBLIC_HEADER foo.h) + set_target_properties(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) + set_target_properties(test2 PROPERTIES PUBLIC_HEADER foo.h) - IF(CMAKE_GENERATOR MATCHES "Makefiles") - ADD_SUBDIRECTORY(TestSubDir) - ADD_DEPENDENCIES(SimpleInstall TSD) - ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + if(CMAKE_GENERATOR MATCHES "Makefiles") + add_subdirectory(TestSubDir) + add_dependencies(SimpleInstall TSD) + endif() - ADD_DEPENDENCIES(SimpleInstall test3) - ADD_DEPENDENCIES(test2 test3) - ADD_DEPENDENCIES(test4 test2) + add_dependencies(SimpleInstall test3) + add_dependencies(test2 test3) + add_dependencies(test4 test2) - INSTALL(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 + install(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 RUNTIME DESTINATION MyTest/bin COMPONENT Runtime # .exe, .dll LIBRARY DESTINATION MyTest/lib COMPONENT Runtime # .so, mod.dll ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib - PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development + PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development ) - INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + install(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE RUNTIME DESTINATION MyTest/bin LIBRARY DESTINATION MyTest/lib ARCHIVE DESTINATION MyTest/lib/static OPTIONAL # for coverage...target should always exist ) - INSTALL(FILES lib1.h DESTINATION MyTest/include/foo) - INSTALL(FILES lib2.h + install(FILES lib1.h DESTINATION MyTest/include/foo) + install(FILES lib2.h DESTINATION MyTest/include/foo COMPONENT Development PERMISSIONS OWNER_READ OWNER_WRITE @@ -218,40 +218,40 @@ ELSE(STAGE2) ) # Test old-style install commands. - INSTALL_FILES(/MyTest/include FILES lib3.h) - INSTALL_FILES(/MyTest/include/old .h lib3) - INSTALL_FILES(/MyTest/include/old "^lib2.h$") - INSTALL_PROGRAMS(/MyTest/share/old1 FILES + install_files(/MyTest/include FILES lib3.h) + install_files(/MyTest/include/old .h lib3) + install_files(/MyTest/include/old "^lib2.h$") + install_programs(/MyTest/share/old1 FILES scripts/sample_script scripts/sample_script.bat) - INSTALL_PROGRAMS(/MyTest/share/old2 + install_programs(/MyTest/share/old2 scripts/sample_script scripts/sample_script.bat) # "export" the targets collected in "SimpleInstallS1" - INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake - DESTINATION MyTest/lib + install(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake + DESTINATION MyTest/lib NAMESPACE S1_ ) - EXPORT(TARGETS SimpleInstall test1 test2 test3 + export(TARGETS SimpleInstall test1 test2 test3 FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake" NAMESPACE S2_ ) - ADD_SUBDIRECTORY(scripts) + add_subdirectory(scripts) # Test optional installation. - INSTALL(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) + install(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) # Test configuration-specific installation. - INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release + install(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release DESTINATION MyTest/include/Release ) - INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug + install(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug DESTINATION MyTest/include/Debug ) # Test directory installation. - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - INSTALL( + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + install( DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -262,14 +262,14 @@ ELSE(STAGE2) ) # Alternate directory installation for coverage. - INSTALL( + install( DIRECTORY scripts/ DESTINATION MyTest/share/alt COMPONENT Development USE_SOURCE_PERMISSIONS PATTERN "CVS" EXCLUDE REGEX "\\.txt$" EXCLUDE ) - INSTALL( + install( DIRECTORY TestSubDir DESTINATION MyTest/share/alt FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -278,109 +278,109 @@ ELSE(STAGE2) ) # Test empty directory installation. - INSTALL(DIRECTORY DESTINATION MyTest/share/empty) + install(DIRECTORY DESTINATION MyTest/share/empty) # Test optional directory installation. - INSTALL(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) + install(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) # Test user-specified install scripts, with and without COMPONENT. - INSTALL( + install( SCRIPT InstallScript1.cmake - CODE "SET(INSTALL_CODE_DID_RUN 1)" + CODE "set(INSTALL_CODE_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake ) - INSTALL( + install( SCRIPT InstallScript3.cmake - CODE "SET(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" + CODE "set(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript4.cmake COMPONENT Development ) - SET_DIRECTORY_PROPERTIES(PROPERTIES + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake") - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) - SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3 + set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -ENDIF(STAGE2) +endif() -IF(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -ELSE(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG) -ENDIF(CMAKE_CONFIGURATION_TYPES) +if(CMAKE_CONFIGURATION_TYPES) + set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) +else() + set(SI_CONFIG) +endif() # Dummy test of CPack -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") -SET(CPACK_PACKAGE_VENDOR "Kitware") -SET(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") +set(CPACK_PACKAGE_VENDOR "Kitware") +set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") -IF(WIN32 AND NOT UNIX) - FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis +if(WIN32 AND NOT UNIX) + find_program(NSIS_MAKENSIS NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] DOC "Where is makensis.exe located" ) - IF(NOT NSIS_MAKENSIS) - SET(CPACK_GENERATOR TGZ) - ENDIF(NOT NSIS_MAKENSIS) -ENDIF(WIN32 AND NOT UNIX) -IF(UNIX AND NOT APPLE) - SET(CPACK_GENERATOR "TGZ;STGZ;TZ") - # FIND_PROGRAM(found_compress + if(NOT NSIS_MAKENSIS) + set(CPACK_GENERATOR TGZ) + endif() +endif() +if(UNIX AND NOT APPLE) + set(CPACK_GENERATOR "TGZ;STGZ;TZ") + # find_program(found_compress # NAMES compress) - # IF(found_compress) - # FIND_PROGRAM(file_command NAMES file) - # IF(NOT file_command) + # if(found_compress) + # find_program(file_command NAMES file) + # if(NOT file_command) # set(file_command file) - # ENDIF(NOT file_command) - # EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress} + # endif() + # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "script") + # endif() # if("${output}" MATCHES "dummy.sh") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "dummy.sh") + # endif() # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") - # SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") - # else(NOT SKIP_TZ) + # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") + # else() # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") - # endif(NOT SKIP_TZ) - # ENDIF(found_compress) - FIND_PROGRAM(found_bz2 + # endif() + # endif() + find_program(found_bz2 NAMES bzip2) - IF(found_bz2) - SET(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - ENDIF(found_bz2) -ENDIF(UNIX AND NOT APPLE) + if(found_bz2) + set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") + endif() +endif() -SET(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") -SET(CMAKE_INSTALL_MFC_LIBRARIES 1) -SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1) -INCLUDE(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") +set(CMAKE_INSTALL_MFC_LIBRARIES 1) +set(CMAKE_INSTALL_DEBUG_LIBRARIES 1) +include(InstallRequiredSystemLibraries) -IF(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET --build-target package) +if(CTEST_TEST_CPACK) + set(PACKAGE_TARGET --build-target package) # Avoid settings that require the .zip file command line tools... # (just build an NSIS installer without component support) # - SET(CPACK_BINARY_ZIP OFF) - SET(CPACK_MONOLITHIC_INSTALL ON) -ELSE(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET) -ENDIF(CTEST_TEST_CPACK) + set(CPACK_BINARY_ZIP OFF) + set(CPACK_MONOLITHIC_INSTALL ON) +else() + set(PACKAGE_TARGET) +endif() -INCLUDE(CPack) +include(CPack) -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET ${install_target} POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/SimpleInstall/InstallScript1.cmake b/Tests/SimpleInstall/InstallScript1.cmake index 27b7725f8..ef9da5761 100644 --- a/Tests/SimpleInstall/InstallScript1.cmake +++ b/Tests/SimpleInstall/InstallScript1.cmake @@ -1,5 +1,5 @@ -MESSAGE("This is install script 1.") -SET(INSTALL_SCRIPT_1_DID_RUN 1) -IF(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.") -ENDIF(INSTALL_CODE_DID_RUN) +message("This is install script 1.") +set(INSTALL_SCRIPT_1_DID_RUN 1) +if(INSTALL_CODE_DID_RUN) + message(FATAL_ERROR "Install script 1 did not run before install code.") +endif() diff --git a/Tests/SimpleInstall/InstallScript2.cmake b/Tests/SimpleInstall/InstallScript2.cmake index 927cae8b6..c1d20a3a6 100644 --- a/Tests/SimpleInstall/InstallScript2.cmake +++ b/Tests/SimpleInstall/InstallScript2.cmake @@ -1,14 +1,14 @@ -MESSAGE("This is install script 2.") -IF(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.") -ENDIF(INSTALL_SCRIPT_1_DID_RUN) -IF(INSTALL_CODE_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.") -ENDIF(INSTALL_CODE_DID_RUN) -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" - "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" +message("This is install script 2.") +if(INSTALL_SCRIPT_1_DID_RUN) + message("Install script ordering works.") +else() + message(FATAL_ERROR "Install script 1 did not run before install script 2.") +endif() +if(INSTALL_CODE_DID_RUN) + message("Install code ordering works.") +else() + message(FATAL_ERROR "Install script 2 did not run after install code.") +endif() +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" + "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstall/InstallScript3.cmake b/Tests/SimpleInstall/InstallScript3.cmake index b1aecd4c2..64851564d 100644 --- a/Tests/SimpleInstall/InstallScript3.cmake +++ b/Tests/SimpleInstall/InstallScript3.cmake @@ -1,12 +1,12 @@ -MESSAGE("This is install script 3.") -SET(INSTALL_SCRIPT_3_DID_RUN 1) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install code with component.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 3.") +set(INSTALL_SCRIPT_3_DID_RUN 1) +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message(FATAL_ERROR "Install script 3 did not run before install code with component.") +endif() -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") +endif() +endif() diff --git a/Tests/SimpleInstall/InstallScript4.cmake b/Tests/SimpleInstall/InstallScript4.cmake index 0ffea4bc8..34d0a73bb 100644 --- a/Tests/SimpleInstall/InstallScript4.cmake +++ b/Tests/SimpleInstall/InstallScript4.cmake @@ -1,22 +1,22 @@ -MESSAGE("This is install script 4.") -IF(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install script 4.") -ENDIF(INSTALL_SCRIPT_3_DID_RUN) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 4 did not run after install with component code.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 4.") +if(INSTALL_SCRIPT_3_DID_RUN) + message("Install script ordering works.") +else() + message(FATAL_ERROR "Install script 3 did not run before install script 4.") +endif() +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message("Install code ordering works.") +else() + message(FATAL_ERROR "Install script 4 did not run after install with component code.") +endif() -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") +endif() +endif() -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" - "SET(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" + "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstall/PackageScript.cmake b/Tests/SimpleInstall/PackageScript.cmake index 3567a2f43..53b790932 100644 --- a/Tests/SimpleInstall/PackageScript.cmake +++ b/Tests/SimpleInstall/PackageScript.cmake @@ -1,10 +1,10 @@ -MESSAGE("This is packaging script") -MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") +message("This is packaging script") +message("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") -FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") -GET_CMAKE_PROPERTY(res VARIABLES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt +file(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") +get_cmake_property(res VARIABLES) +foreach(var ${res}) + file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -ENDFOREACH(var ${res}) +endforeach() diff --git a/Tests/SimpleInstall/PostInstall.cmake b/Tests/SimpleInstall/PostInstall.cmake index 52ea140a5..d616221ef 100644 --- a/Tests/SimpleInstall/PostInstall.cmake +++ b/Tests/SimpleInstall/PostInstall.cmake @@ -1,6 +1,6 @@ -MESSAGE("In post install") -IF(PRE_INSTALL_DID_RUN) - MESSAGE("Pre and post install work fine") -ELSE(PRE_INSTALL_DID_RUN) - MESSAGE(FATAL_ERROR "Pre install did not run before post install") -ENDIF(PRE_INSTALL_DID_RUN) +message("In post install") +if(PRE_INSTALL_DID_RUN) + message("Pre and post install work fine") +else() + message(FATAL_ERROR "Pre install did not run before post install") +endif() diff --git a/Tests/SimpleInstall/PreInstall.cmake b/Tests/SimpleInstall/PreInstall.cmake index 2ea2f7716..7a9851e1d 100644 --- a/Tests/SimpleInstall/PreInstall.cmake +++ b/Tests/SimpleInstall/PreInstall.cmake @@ -1,2 +1,2 @@ -MESSAGE("This is in pre install") -SET(PRE_INSTALL_DID_RUN 1) +message("This is in pre install") +set(PRE_INSTALL_DID_RUN 1) diff --git a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt index 4f6295300..860e10425 100644 --- a/Tests/SimpleInstall/TestSubDir/CMakeLists.txt +++ b/Tests/SimpleInstall/TestSubDir/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx) -INSTALL_FILES(/MyTest/include FILES TSD.h) -INSTALL_TARGETS(/MyTest/bin TSD) +add_executable(TSD TSD.cxx TSD_utils.cxx) +install_files(/MyTest/include FILES TSD.h) +install_targets(/MyTest/bin TSD) diff --git a/Tests/SimpleInstall/lib2.h b/Tests/SimpleInstall/lib2.h index ea5a6f7ea..d69b78613 100644 --- a/Tests/SimpleInstall/lib2.h +++ b/Tests/SimpleInstall/lib2.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float Lib2Func(); diff --git a/Tests/SimpleInstall/lib3.h b/Tests/SimpleInstall/lib3.h index c250ed769..66bc52a7f 100644 --- a/Tests/SimpleInstall/lib3.h +++ b/Tests/SimpleInstall/lib3.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float Lib3Func(); diff --git a/Tests/SimpleInstall/lib4.h b/Tests/SimpleInstall/lib4.h index 4b94ea207..11c127247 100644 --- a/Tests/SimpleInstall/lib4.h +++ b/Tests/SimpleInstall/lib4.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float Lib4Func(); diff --git a/Tests/SimpleInstall/scripts/CMakeLists.txt b/Tests/SimpleInstall/scripts/CMakeLists.txt index d46c1652e..ec34e8c50 100644 --- a/Tests/SimpleInstall/scripts/CMakeLists.txt +++ b/Tests/SimpleInstall/scripts/CMakeLists.txt @@ -1 +1 @@ -INSTALL_PROGRAMS(/MyTest/share/old3 "^sample_script(\\.bat)?$") +install_programs(/MyTest/share/old3 "^sample_script(\\.bat)?$") diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index 378b5292b..479d6ec36 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -1,216 +1,216 @@ cmake_minimum_required (VERSION 2.6) -PROJECT (TestSimpleInstall) -SET(CMAKE_VERBOSE_MAKEFILE 1) -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY +project (TestSimpleInstall) +set(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/bin") -SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib/static") -SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${TestSimpleInstall_BINARY_DIR}/lib") # Skip generating the rpath pointing at the build tree to make sure # the executable is installed with the proper rpath in the install # tree. -SET(CMAKE_SKIP_BUILD_RPATH 1) +set(CMAKE_SKIP_BUILD_RPATH 1) # Make sure the executable can run from the install tree. -SET(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) +set(CMAKE_INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Skip the dependency that causes a build when installing. This # avoids infinite loops when the post-build rule below installs. -SET(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) -SET(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_INSTALL_ALL_DEPENDENCY 1) +set(CMAKE_SKIP_PACKAGE_ALL_DEPENDENCY 1) -SET(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") +set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -SET(EXTRA_INSTALL_FLAGS) -MESSAGE("Extra install: ${EXTRA_INSTALL_FLAGS}") +set(EXTRA_INSTALL_FLAGS) +message("Extra install: ${EXTRA_INSTALL_FLAGS}") -IF(STAGE2) - SET(LIBPATHS +if(STAGE2) + set(LIBPATHS ${CMAKE_INSTALL_PREFIX}/MyTest/lib/static ${CMAKE_INSTALL_PREFIX}/MyTest/lib ) - SET(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) - SET(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) - SET(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) + set(t1NAMES test1 test1${CMAKE_DEBUG_POSTFIX} test1rel) + set(t2NAMES test2 test2${CMAKE_DEBUG_POSTFIX}) + set(t4NAMES test4out test4out${CMAKE_DEBUG_POSTFIX}) # Make sure the install script ran. - SET(CMAKE_INSTALL_SCRIPT_DID_RUN 0) - INCLUDE(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) - IF(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(STATUS "Stage 1 did run install script 2.") - ELSE(CMAKE_INSTALL_SCRIPT_DID_RUN) - MESSAGE(SEND_ERROR "Stage 1 did not run install script 2.") - ENDIF(CMAKE_INSTALL_SCRIPT_DID_RUN) - - IF(CYGWIN OR MINGW) - SET(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") - ENDIF(CYGWIN OR MINGW) - MESSAGE("Search for library in: ${LIBPATHS}") - - SET(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - SET(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) - - FIND_LIBRARY(TEST1_LIBRARY + set(CMAKE_INSTALL_SCRIPT_DID_RUN 0) + include(${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake OPTIONAL) + if(CMAKE_INSTALL_SCRIPT_DID_RUN) + message(STATUS "Stage 1 did run install script 2.") + else() + message(SEND_ERROR "Stage 1 did not run install script 2.") + endif() + + if(CYGWIN OR MINGW) + set(LIBPATHS ${LIBPATHS} "${CMAKE_INSTALL_PREFIX}/MyTest/bin") + endif() + message("Search for library in: ${LIBPATHS}") + + set(TEST1_LIBRARY "TEST1_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST2_LIBRARY "TEST2_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + set(TEST4_LIBRARY "TEST4_LIBRARY-NOTFOUND" CACHE FILEPATH "Force find." FORCE) + + find_library(TEST1_LIBRARY NAMES ${t1NAMES} PATHS ${LIBPATHS} DOC "First library") - FIND_LIBRARY(TEST2_LIBRARY + find_library(TEST2_LIBRARY NAMES ${t2NAMES} PATHS ${LIBPATHS} DOC "Second library") - FIND_LIBRARY(TEST4_LIBRARY + find_library(TEST4_LIBRARY NAMES ${t4NAMES} PATHS ${LIBPATHS} DOC "Fourth library") # Test importing a library found on disk. - ADD_LIBRARY(lib_test4 UNKNOWN IMPORTED) - SET_PROPERTY(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) + add_library(lib_test4 UNKNOWN IMPORTED) + set_property(TARGET lib_test4 PROPERTY IMPORTED_LOCATION ${TEST4_LIBRARY}) - INCLUDE_DIRECTORIES(${CMAKE_INSTALL_PREFIX}/MyTest/include) - ADD_EXECUTABLE (SimpleInstExeS2 inst2.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) - SET(install_target SimpleInstExeS2) + include_directories(${CMAKE_INSTALL_PREFIX}/MyTest/include) + add_executable (SimpleInstExeS2 inst2.cxx foo.c foo.h) + target_link_libraries(SimpleInstExeS2 ${TEST1_LIBRARY} ${TEST2_LIBRARY} lib_test4) + set(install_target SimpleInstExeS2) - IF("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(STATUS "test1 correctly found in lib/static") - ELSE("${TEST1_LIBRARY}" MATCHES "static") - MESSAGE(SEND_ERROR "test1 not found in lib/static!") - ENDIF("${TEST1_LIBRARY}" MATCHES "static") + if("${TEST1_LIBRARY}" MATCHES "static") + message(STATUS "test1 correctly found in lib/static") + else() + message(SEND_ERROR "test1 not found in lib/static!") + endif() # Check for failure of configuration-specific installation. - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - MESSAGE(FATAL_ERROR "Debug-configuration file installed for Release!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") - MESSAGE(FATAL_ERROR "Release-configuration file installed for Debug!") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Release/lib1debug.h") + message(FATAL_ERROR "Debug-configuration file installed for Release!") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/include/Debug/lib1release.h") + message(FATAL_ERROR "Release-configuration file installed for Debug!") + endif() # Check for failure of directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - MESSAGE(FATAL_ERROR "Directory installation installed CVS directory.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - MESSAGE(FATAL_ERROR "Directory installation installed CMakeLists.txt.") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - MESSAGE(FATAL_ERROR "Directory installation did not install alternate TSD.h") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") - IF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") - MESSAGE(FATAL_ERROR "Directory installation installed alternate TSD.cxx") - ENDIF(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install TSD.h") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + message(FATAL_ERROR "Directory installation installed CVS directory.") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/CMakeLists.txt") + message(FATAL_ERROR "Directory installation installed CMakeLists.txt.") + endif() + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.h") + message(FATAL_ERROR "Directory installation did not install alternate TSD.h") + endif() + if(EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/alt/TestSubDir/TSD.cxx") + message(FATAL_ERROR "Directory installation installed alternate TSD.cxx") + endif() # Check that scripts properly installed. - IF(WIN32 AND NOT CYGWIN) - SET(BAT .bat) - ELSE(WIN32 AND NOT CYGWIN) - SET(BAT) - ENDIF(WIN32 AND NOT CYGWIN) - FOREACH(loc share share/old1 share/old2 share/old3 share/alt) - SET(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") - EXECUTE_PROCESS( + if(WIN32 AND NOT CYGWIN) + set(BAT .bat) + else() + set(BAT) + endif() + foreach(loc share share/old1 share/old2 share/old3 share/alt) + set(CUR_SCRIPT "${CMAKE_INSTALL_PREFIX}/MyTest/${loc}/sample_script${BAT}") + execute_process( COMMAND ${CUR_SCRIPT} RESULT_VARIABLE SAMPLE_SCRIPT_RESULT OUTPUT_VARIABLE SAMPLE_SCRIPT_OUTPUT ) - IF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - MESSAGE(FATAL_ERROR + if(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") + message(FATAL_ERROR "Sample script [${CUR_SCRIPT}] failed: [${SAMPLE_SCRIPT_RESULT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_RESULT}" MATCHES "^0$") - IF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - MESSAGE(FATAL_ERROR + endif() + if(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") + message(FATAL_ERROR "Bad sample script [${CUR_SCRIPT}] output: [${SAMPLE_SCRIPT_OUTPUT}]") - ENDIF(NOT "${SAMPLE_SCRIPT_OUTPUT}" MATCHES "Sample Script Output") - ENDFOREACH(loc) + endif() + endforeach() # Check for failure of empty directory installation. - IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - MESSAGE(FATAL_ERROR "Empty directory installation did not install.") - ENDIF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") - FILE(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") - IF(EMPTY_FILES) - MESSAGE(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") - ENDIF(EMPTY_FILES) + if(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty") + message(FATAL_ERROR "Empty directory installation did not install.") + endif() + file(GLOB EMPTY_FILES "${CMAKE_INSTALL_PREFIX}/MyTest/share/empty/*") + if(EMPTY_FILES) + message(FATAL_ERROR "Empty directory installed [${EMPTY_FILES}].") + endif() # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstExeS2 PROPERTIES + set_target_properties(SimpleInstExeS2 PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - INSTALL_TARGETS(/MyTest/bin SimpleInstExeS2) + install_targets(/MyTest/bin SimpleInstExeS2) # try to import the exported targets again - SET(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) - FIND_PACKAGE(SimpleInstallS1 REQUIRED) - GET_TARGET_PROPERTY(simpleInstallImported S1_SimpleInstall IMPORTED) - IF(NOT simpleInstallImported) - MESSAGE(FATAL_ERROR "Target S1_SimpleInstall could not be imported") - ENDIF(NOT simpleInstallImported) - -ELSE(STAGE2) + set(SimpleInstallS1_DIR ${CMAKE_INSTALL_PREFIX}/MyTest/lib) + find_package(SimpleInstallS1 REQUIRED) + get_target_property(simpleInstallImported S1_SimpleInstall IMPORTED) + if(NOT simpleInstallImported) + message(FATAL_ERROR "Target S1_SimpleInstall could not be imported") + endif() + +else() # Wipe out the install directory to do a fresh test. - FILE(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) + file(REMOVE_RECURSE ${CMAKE_INSTALL_PREFIX}/MyTest) # this is stage 1, so create libraries and modules and install everything - ADD_LIBRARY(test1 STATIC lib1.cxx) - ADD_LIBRARY(test2 SHARED lib2.cxx) - ADD_LIBRARY(test3 MODULE lib3.cxx) - ADD_LIBRARY(test4 SHARED lib4.cxx) + add_library(test1 STATIC lib1.cxx) + add_library(test2 SHARED lib2.cxx) + add_library(test3 MODULE lib3.cxx) + add_library(test4 SHARED lib4.cxx) # Test <ARCHIVE|LIBRARY|RUNTIME>_OUTPUT_NAME properties. - SET_PROPERTY(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) - SET_PROPERTY(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY ARCHIVE_OUTPUT_NAME test4out) + set_property(TARGET test4 PROPERTY LIBRARY_OUTPUT_NAME test4out) - ADD_EXECUTABLE (SimpleInstall inst.cxx foo.c foo.h) - TARGET_LINK_LIBRARIES(SimpleInstall test1 test2 test4) - SET(install_target SimpleInstall) + add_executable (SimpleInstall inst.cxx foo.c foo.h) + target_link_libraries(SimpleInstall test1 test2 test4) + set(install_target SimpleInstall) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) + set_target_properties(SimpleInstall PROPERTIES OUTPUT_NAME SimpleInstExe) # Disable VERSION test until it is implemented in the Xcode generator. - IF(NOT XCODE) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES VERSION 1.2) - ENDIF(NOT XCODE) + if(NOT XCODE) + set_target_properties(SimpleInstall PROPERTIES VERSION 1.2) + endif() # Make sure the test executable can run from the install tree. - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES + set_target_properties(SimpleInstall PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}/MyTest/lib) # Test per-configuration output name. - SET_TARGET_PROPERTIES(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) - SET_TARGET_PROPERTIES(test2 PROPERTIES PUBLIC_HEADER foo.h) + set_target_properties(test1 PROPERTIES RELEASE_OUTPUT_NAME test1rel) + set_target_properties(test2 PROPERTIES PUBLIC_HEADER foo.h) - IF(CMAKE_GENERATOR MATCHES "Makefiles") - ADD_SUBDIRECTORY(TestSubDir) - ADD_DEPENDENCIES(SimpleInstall TSD) - ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") + if(CMAKE_GENERATOR MATCHES "Makefiles") + add_subdirectory(TestSubDir) + add_dependencies(SimpleInstall TSD) + endif() - ADD_DEPENDENCIES(SimpleInstall test3) - ADD_DEPENDENCIES(test2 test3) - ADD_DEPENDENCIES(test4 test2) + add_dependencies(SimpleInstall test3) + add_dependencies(test2 test3) + add_dependencies(test4 test2) - INSTALL(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 + install(TARGETS SimpleInstall test1 test2 test3 EXPORT SimpleInstallS1 RUNTIME DESTINATION MyTest/bin COMPONENT Runtime # .exe, .dll LIBRARY DESTINATION MyTest/lib COMPONENT Runtime # .so, mod.dll ARCHIVE DESTINATION MyTest/lib/static COMPONENT Development # .a, .lib - PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development + PUBLIC_HEADER DESTINATION MyTest/include COMPONENT Development ) - INSTALL(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE + install(TARGETS test4 PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE RUNTIME DESTINATION MyTest/bin LIBRARY DESTINATION MyTest/lib ARCHIVE DESTINATION MyTest/lib/static OPTIONAL # for coverage...target should always exist ) - INSTALL(FILES lib1.h DESTINATION MyTest/include/foo) - INSTALL(FILES lib2.h + install(FILES lib1.h DESTINATION MyTest/include/foo) + install(FILES lib2.h DESTINATION MyTest/include/foo COMPONENT Development PERMISSIONS OWNER_READ OWNER_WRITE @@ -218,40 +218,40 @@ ELSE(STAGE2) ) # Test old-style install commands. - INSTALL_FILES(/MyTest/include FILES lib3.h) - INSTALL_FILES(/MyTest/include/old .h lib3) - INSTALL_FILES(/MyTest/include/old "^lib2.h$") - INSTALL_PROGRAMS(/MyTest/share/old1 FILES + install_files(/MyTest/include FILES lib3.h) + install_files(/MyTest/include/old .h lib3) + install_files(/MyTest/include/old "^lib2.h$") + install_programs(/MyTest/share/old1 FILES scripts/sample_script scripts/sample_script.bat) - INSTALL_PROGRAMS(/MyTest/share/old2 + install_programs(/MyTest/share/old2 scripts/sample_script scripts/sample_script.bat) # "export" the targets collected in "SimpleInstallS1" - INSTALL(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake - DESTINATION MyTest/lib + install(EXPORT SimpleInstallS1 FILE SimpleInstallS1Config.cmake + DESTINATION MyTest/lib NAMESPACE S1_ ) - EXPORT(TARGETS SimpleInstall test1 test2 test3 + export(TARGETS SimpleInstall test1 test2 test3 FILE "${CMAKE_CURRENT_BINARY_DIR}/SimpleInstallS1Config.cmake" NAMESPACE S2_ ) - ADD_SUBDIRECTORY(scripts) + add_subdirectory(scripts) # Test optional installation. - INSTALL(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) + install(FILES does_not_exist.h DESTINATION MyTest/include/foo OPTIONAL) # Test configuration-specific installation. - INSTALL(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release + install(FILES lib1.h RENAME lib1release.h CONFIGURATIONS Release DESTINATION MyTest/include/Release ) - INSTALL(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug + install(FILES lib1.h RENAME lib1debug.h CONFIGURATIONS Debug DESTINATION MyTest/include/Debug ) # Test directory installation. - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") - FILE(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") - INSTALL( + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") + file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") + install( DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -262,14 +262,14 @@ ELSE(STAGE2) ) # Alternate directory installation for coverage. - INSTALL( + install( DIRECTORY scripts/ DESTINATION MyTest/share/alt COMPONENT Development USE_SOURCE_PERMISSIONS PATTERN "CVS" EXCLUDE REGEX "\\.txt$" EXCLUDE ) - INSTALL( + install( DIRECTORY TestSubDir DESTINATION MyTest/share/alt FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -278,109 +278,109 @@ ELSE(STAGE2) ) # Test empty directory installation. - INSTALL(DIRECTORY DESTINATION MyTest/share/empty) + install(DIRECTORY DESTINATION MyTest/share/empty) # Test optional directory installation. - INSTALL(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) + install(DIRECTORY does-not-exist DESTINATION MyTest/share OPTIONAL) # Test user-specified install scripts, with and without COMPONENT. - INSTALL( + install( SCRIPT InstallScript1.cmake - CODE "SET(INSTALL_CODE_DID_RUN 1)" + CODE "set(INSTALL_CODE_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript2.cmake ) - INSTALL( + install( SCRIPT InstallScript3.cmake - CODE "SET(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" + CODE "set(INSTALL_CODE_WITH_COMPONENT_DID_RUN 1)" SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/InstallScript4.cmake COMPONENT Development ) - SET_DIRECTORY_PROPERTIES(PROPERTIES + set_directory_properties(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${CMAKE_INSTALL_PREFIX}/InstallScriptOut.cmake;${CMAKE_INSTALL_PREFIX}/InstallScript4Out.cmake") - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES PRE_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PreInstall.cmake) - SET_TARGET_PROPERTIES(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT + set_target_properties(SimpleInstall PROPERTIES POST_INSTALL_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/PostInstall.cmake) - SET_TARGET_PROPERTIES(test4 PROPERTIES VERSION 1.2 SOVERSION 3 + set_target_properties(test4 PROPERTIES VERSION 1.2 SOVERSION 3 INSTALL_NAME_DIR @executable_path/../lib) -ENDIF(STAGE2) +endif() -IF(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) -ELSE(CMAKE_CONFIGURATION_TYPES) - SET(SI_CONFIG) -ENDIF(CMAKE_CONFIGURATION_TYPES) +if(CMAKE_CONFIGURATION_TYPES) + set(SI_CONFIG -C ${CMAKE_CFG_INTDIR}) +else() + set(SI_CONFIG) +endif() # Dummy test of CPack -SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") -SET(CPACK_PACKAGE_VENDOR "Kitware") -SET(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Test of packaging with cpack") +set(CPACK_PACKAGE_VENDOR "Kitware") +set(CPACK_INSTALL_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/PackageScript.cmake") -IF(WIN32 AND NOT UNIX) - FIND_PROGRAM(NSIS_MAKENSIS NAMES makensis +if(WIN32 AND NOT UNIX) + find_program(NSIS_MAKENSIS NAMES makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\NSIS] DOC "Where is makensis.exe located" ) - IF(NOT NSIS_MAKENSIS) - SET(CPACK_GENERATOR TGZ) - ENDIF(NOT NSIS_MAKENSIS) -ENDIF(WIN32 AND NOT UNIX) -IF(UNIX AND NOT APPLE) - SET(CPACK_GENERATOR "TGZ;STGZ;TZ") - # FIND_PROGRAM(found_compress + if(NOT NSIS_MAKENSIS) + set(CPACK_GENERATOR TGZ) + endif() +endif() +if(UNIX AND NOT APPLE) + set(CPACK_GENERATOR "TGZ;STGZ;TZ") + # find_program(found_compress # NAMES compress) - # IF(found_compress) - # FIND_PROGRAM(file_command NAMES file) - # IF(NOT file_command) + # if(found_compress) + # find_program(file_command NAMES file) + # if(NOT file_command) # set(file_command file) - # ENDIF(NOT file_command) - # EXECUTE_PROCESS(COMMAND ${file_command} ${found_compress} + # endif() + # execute_process(COMMAND ${file_command} ${found_compress} # OUTPUT_VARIABLE output) # set(SKIP_TZ FALSE) # if("${output}" MATCHES "script") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "script") + # endif() # if("${output}" MATCHES "dummy.sh") # set(SKIP_TZ TRUE) - # endif("${output}" MATCHES "dummy.sh") + # endif() # if(NOT SKIP_TZ) # message("compress found and it was not a script") # message("output from file command: [${output}]") - # SET(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") - # else(NOT SKIP_TZ) + # set(CPACK_GENERATOR "${CPACK_GENERATOR};TZ") + # else() # message("compress found, but it was a script so dont use it") # message("output from file command: [${output}]") - # endif(NOT SKIP_TZ) - # ENDIF(found_compress) - FIND_PROGRAM(found_bz2 + # endif() + # endif() + find_program(found_bz2 NAMES bzip2) - IF(found_bz2) - SET(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") - ENDIF(found_bz2) -ENDIF(UNIX AND NOT APPLE) + if(found_bz2) + set(CPACK_GENERATOR "${CPACK_GENERATOR};TBZ2") + endif() +endif() -SET(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") -SET(CMAKE_INSTALL_MFC_LIBRARIES 1) -SET(CMAKE_INSTALL_DEBUG_LIBRARIES 1) -INCLUDE(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_EXECUTABLES "SimpleInstall" "Simple Install") +set(CMAKE_INSTALL_MFC_LIBRARIES 1) +set(CMAKE_INSTALL_DEBUG_LIBRARIES 1) +include(InstallRequiredSystemLibraries) -IF(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET --build-target package) +if(CTEST_TEST_CPACK) + set(PACKAGE_TARGET --build-target package) # Avoid settings that require the .zip file command line tools... # (just build an NSIS installer without component support) # - SET(CPACK_BINARY_ZIP OFF) - SET(CPACK_MONOLITHIC_INSTALL ON) -ELSE(CTEST_TEST_CPACK) - SET(PACKAGE_TARGET) -ENDIF(CTEST_TEST_CPACK) + set(CPACK_BINARY_ZIP OFF) + set(CPACK_MONOLITHIC_INSTALL ON) +else() + set(PACKAGE_TARGET) +endif() -INCLUDE(CPack) +include(CPack) -ADD_CUSTOM_COMMAND( +add_custom_command( TARGET ${install_target} POST_BUILD COMMAND ${CMAKE_CTEST_COMMAND} diff --git a/Tests/SimpleInstallS2/InstallScript1.cmake b/Tests/SimpleInstallS2/InstallScript1.cmake index 27b7725f8..ef9da5761 100644 --- a/Tests/SimpleInstallS2/InstallScript1.cmake +++ b/Tests/SimpleInstallS2/InstallScript1.cmake @@ -1,5 +1,5 @@ -MESSAGE("This is install script 1.") -SET(INSTALL_SCRIPT_1_DID_RUN 1) -IF(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install code.") -ENDIF(INSTALL_CODE_DID_RUN) +message("This is install script 1.") +set(INSTALL_SCRIPT_1_DID_RUN 1) +if(INSTALL_CODE_DID_RUN) + message(FATAL_ERROR "Install script 1 did not run before install code.") +endif() diff --git a/Tests/SimpleInstallS2/InstallScript2.cmake b/Tests/SimpleInstallS2/InstallScript2.cmake index 927cae8b6..c1d20a3a6 100644 --- a/Tests/SimpleInstallS2/InstallScript2.cmake +++ b/Tests/SimpleInstallS2/InstallScript2.cmake @@ -1,14 +1,14 @@ -MESSAGE("This is install script 2.") -IF(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_1_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 1 did not run before install script 2.") -ENDIF(INSTALL_SCRIPT_1_DID_RUN) -IF(INSTALL_CODE_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 2 did not run after install code.") -ENDIF(INSTALL_CODE_DID_RUN) -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" - "SET(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" +message("This is install script 2.") +if(INSTALL_SCRIPT_1_DID_RUN) + message("Install script ordering works.") +else() + message(FATAL_ERROR "Install script 1 did not run before install script 2.") +endif() +if(INSTALL_CODE_DID_RUN) + message("Install code ordering works.") +else() + message(FATAL_ERROR "Install script 2 did not run after install code.") +endif() +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScriptOut.cmake" + "set(CMAKE_INSTALL_SCRIPT_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/InstallScript3.cmake b/Tests/SimpleInstallS2/InstallScript3.cmake index b1aecd4c2..64851564d 100644 --- a/Tests/SimpleInstallS2/InstallScript3.cmake +++ b/Tests/SimpleInstallS2/InstallScript3.cmake @@ -1,12 +1,12 @@ -MESSAGE("This is install script 3.") -SET(INSTALL_SCRIPT_3_DID_RUN 1) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install code with component.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 3.") +set(INSTALL_SCRIPT_3_DID_RUN 1) +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message(FATAL_ERROR "Install script 3 did not run before install code with component.") +endif() -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 3 should only run for \"Development\" INSTALL COMPONENT.") +endif() +endif() diff --git a/Tests/SimpleInstallS2/InstallScript4.cmake b/Tests/SimpleInstallS2/InstallScript4.cmake index 0ffea4bc8..34d0a73bb 100644 --- a/Tests/SimpleInstallS2/InstallScript4.cmake +++ b/Tests/SimpleInstallS2/InstallScript4.cmake @@ -1,22 +1,22 @@ -MESSAGE("This is install script 4.") -IF(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE("Install script ordering works.") -ELSE(INSTALL_SCRIPT_3_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 3 did not run before install script 4.") -ENDIF(INSTALL_SCRIPT_3_DID_RUN) -IF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE("Install code ordering works.") -ELSE(INSTALL_CODE_WITH_COMPONENT_DID_RUN) - MESSAGE(FATAL_ERROR "Install script 4 did not run after install with component code.") -ENDIF(INSTALL_CODE_WITH_COMPONENT_DID_RUN) +message("This is install script 4.") +if(INSTALL_SCRIPT_3_DID_RUN) + message("Install script ordering works.") +else() + message(FATAL_ERROR "Install script 3 did not run before install script 4.") +endif() +if(INSTALL_CODE_WITH_COMPONENT_DID_RUN) + message("Install code ordering works.") +else() + message(FATAL_ERROR "Install script 4 did not run after install with component code.") +endif() -IF(CMAKE_INSTALL_COMPONENT) -IF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") - MESSAGE("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") - MESSAGE(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") -ENDIF(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") -ENDIF(CMAKE_INSTALL_COMPONENT) +if(CMAKE_INSTALL_COMPONENT) +if(NOT "${CMAKE_INSTALL_COMPONENT}" STREQUAL "Development") + message("CMAKE_INSTALL_COMPONENT=\"${CMAKE_INSTALL_COMPONENT}\"") + message(FATAL_ERROR "Install script 4 should only run for \"Development\" INSTALL COMPONENT.") +endif() +endif() -FILE(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" - "SET(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" +file(WRITE "${CMAKE_INSTALL_PREFIX}/MyTest/InstallScript4Out.cmake" + "set(CMAKE_INSTALL_SCRIPT_4_DID_RUN 1)\n" ) diff --git a/Tests/SimpleInstallS2/PackageScript.cmake b/Tests/SimpleInstallS2/PackageScript.cmake index 3567a2f43..53b790932 100644 --- a/Tests/SimpleInstallS2/PackageScript.cmake +++ b/Tests/SimpleInstallS2/PackageScript.cmake @@ -1,10 +1,10 @@ -MESSAGE("This is packaging script") -MESSAGE("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") +message("This is packaging script") +message("It writes a file with all variables available in ${CMAKE_INSTALL_PREFIX}/AllVariables.txt") -FILE(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") -GET_CMAKE_PROPERTY(res VARIABLES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt +file(WRITE ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "") +get_cmake_property(res VARIABLES) +foreach(var ${res}) + file(APPEND ${CMAKE_INSTALL_PREFIX}/AllVariables.txt "${var} \"${${var}}\"\n") -ENDFOREACH(var ${res}) +endforeach() diff --git a/Tests/SimpleInstallS2/PostInstall.cmake b/Tests/SimpleInstallS2/PostInstall.cmake index 52ea140a5..d616221ef 100644 --- a/Tests/SimpleInstallS2/PostInstall.cmake +++ b/Tests/SimpleInstallS2/PostInstall.cmake @@ -1,6 +1,6 @@ -MESSAGE("In post install") -IF(PRE_INSTALL_DID_RUN) - MESSAGE("Pre and post install work fine") -ELSE(PRE_INSTALL_DID_RUN) - MESSAGE(FATAL_ERROR "Pre install did not run before post install") -ENDIF(PRE_INSTALL_DID_RUN) +message("In post install") +if(PRE_INSTALL_DID_RUN) + message("Pre and post install work fine") +else() + message(FATAL_ERROR "Pre install did not run before post install") +endif() diff --git a/Tests/SimpleInstallS2/PreInstall.cmake b/Tests/SimpleInstallS2/PreInstall.cmake index 2ea2f7716..7a9851e1d 100644 --- a/Tests/SimpleInstallS2/PreInstall.cmake +++ b/Tests/SimpleInstallS2/PreInstall.cmake @@ -1,2 +1,2 @@ -MESSAGE("This is in pre install") -SET(PRE_INSTALL_DID_RUN 1) +message("This is in pre install") +set(PRE_INSTALL_DID_RUN 1) diff --git a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt index 4f6295300..860e10425 100644 --- a/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt +++ b/Tests/SimpleInstallS2/TestSubDir/CMakeLists.txt @@ -1,3 +1,3 @@ -ADD_EXECUTABLE(TSD TSD.cxx TSD_utils.cxx) -INSTALL_FILES(/MyTest/include FILES TSD.h) -INSTALL_TARGETS(/MyTest/bin TSD) +add_executable(TSD TSD.cxx TSD_utils.cxx) +install_files(/MyTest/include FILES TSD.h) +install_targets(/MyTest/bin TSD) diff --git a/Tests/SimpleInstallS2/lib2.h b/Tests/SimpleInstallS2/lib2.h index ea5a6f7ea..d69b78613 100644 --- a/Tests/SimpleInstallS2/lib2.h +++ b/Tests/SimpleInstallS2/lib2.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float Lib2Func(); diff --git a/Tests/SimpleInstallS2/lib3.h b/Tests/SimpleInstallS2/lib3.h index c250ed769..66bc52a7f 100644 --- a/Tests/SimpleInstallS2/lib3.h +++ b/Tests/SimpleInstallS2/lib3.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float Lib3Func(); diff --git a/Tests/SimpleInstallS2/lib4.h b/Tests/SimpleInstallS2/lib4.h index 4b94ea207..11c127247 100644 --- a/Tests/SimpleInstallS2/lib4.h +++ b/Tests/SimpleInstallS2/lib4.h @@ -5,7 +5,7 @@ # define CM_TEST_LIB_EXPORT __declspec( dllimport ) # endif #else -# define CM_TEST_LIB_EXPORT +# define CM_TEST_LIB_EXPORT #endif CM_TEST_LIB_EXPORT float Lib4Func(); diff --git a/Tests/SimpleInstallS2/scripts/CMakeLists.txt b/Tests/SimpleInstallS2/scripts/CMakeLists.txt index d46c1652e..ec34e8c50 100644 --- a/Tests/SimpleInstallS2/scripts/CMakeLists.txt +++ b/Tests/SimpleInstallS2/scripts/CMakeLists.txt @@ -1 +1 @@ -INSTALL_PROGRAMS(/MyTest/share/old3 "^sample_script(\\.bat)?$") +install_programs(/MyTest/share/old3 "^sample_script(\\.bat)?$") diff --git a/Tests/SourceGroups/CMakeLists.txt b/Tests/SourceGroups/CMakeLists.txt index c3cf38c7a..6573c8241 100644 --- a/Tests/SourceGroups/CMakeLists.txt +++ b/Tests/SourceGroups/CMakeLists.txt @@ -2,9 +2,9 @@ cmake_minimum_required (VERSION 2.6) project(SourceGroups) # this is not really a test which can fail -# it is more an example with several source_group() +# it is more an example with several source_group() # commands. -# The created projects have to be loaded manually +# The created projects have to be loaded manually # in Visual Studio/Xcode/Eclipse/... # to see whether the correct groups have been created. @@ -19,7 +19,7 @@ source_group(Base\\Sub1\\Sub2 FILES sub1/foobar.c) # a group with empty name source_group("" FILES foo.c) -# a group, whose name consists only of the delimiter +# a group, whose name consists only of the delimiter #should be handled the same way as an empty name source_group("\\" FILES baz.c) diff --git a/Tests/SourceGroups/README.txt b/Tests/SourceGroups/README.txt index 1a4baf536..8b1378917 100644 --- a/Tests/SourceGroups/README.txt +++ b/Tests/SourceGroups/README.txt @@ -1 +1 @@ - + diff --git a/Tests/StringFileTest/CMakeLists.txt b/Tests/StringFileTest/CMakeLists.txt index 7792a353d..6d798b067 100644 --- a/Tests/StringFileTest/CMakeLists.txt +++ b/Tests/StringFileTest/CMakeLists.txt @@ -1,164 +1,164 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(StringFileTest) -INCLUDE_DIRECTORIES(${StringFileTest_BINARY_DIR}) +project(StringFileTest) +include_directories(${StringFileTest_BINARY_DIR}) # Read file test -FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile) # Test reading a binary file into hex representation -FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/test.bin" hexContents HEX) -IF("${hexContents}" STREQUAL "0001027700") - MESSAGE("FILE(READ HEX) correctly read [${hexContents}]") -ELSE("${hexContents}" STREQUAL "0001027700") - MESSAGE(SEND_ERROR "FILE(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") -ENDIF("${hexContents}" STREQUAL "0001027700") +if("${hexContents}" STREQUAL "0001027700") + message("file(READ HEX) correctly read [${hexContents}]") +else() + message(SEND_ERROR "file(READ HEX) incorrectly read [${hexContents}], but expected was [0001027700]") +endif() -# FILE(STRINGS) test -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings +# file(STRINGS) test +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in" infile_strings LIMIT_COUNT 1 LIMIT_INPUT 1024 LIMIT_OUTPUT 1024 LENGTH_MINIMUM 10 LENGTH_MAXIMUM 23 REGEX include NEWLINE_CONSUME) -SET(infile_strings_goal "#include \"includefile\"\n") -IF("${infile_strings}" STREQUAL "${infile_strings_goal}") - MESSAGE("FILE(STRINGS) correctly read [${infile_strings}]") -ELSE("${infile_strings}" STREQUAL "${infile_strings_goal}") - MESSAGE(SEND_ERROR - "FILE(STRINGS) incorrectly read [${infile_strings}]") -ENDIF("${infile_strings}" STREQUAL "${infile_strings_goal}") +set(infile_strings_goal "#include \"includefile\"\n") +if("${infile_strings}" STREQUAL "${infile_strings_goal}") + message("file(STRINGS) correctly read [${infile_strings}]") +else() + message(SEND_ERROR + "file(STRINGS) incorrectly read [${infile_strings}]") +endif() # test reading a file and getting its binary data as hex string -FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) -IF(NOT "${infilehex}" STREQUAL "53313036") - MESSAGE(SEND_ERROR - "FILE(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") -ENDIF(NOT "${infilehex}" STREQUAL "53313036") +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infilehex LIMIT 4 HEX) +if(NOT "${infilehex}" STREQUAL "53313036") + message(SEND_ERROR + "file(READ ... HEX) error, read: \"${infilehex}\", expected \"53313036\"") +endif() -# test that FILE(STRINGS) also work with Intel hex and Motorola S-record files +# test that file(STRINGS) also work with Intel hex and Motorola S-record files # this file has been created with "sdcc main.c" -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO) -SET(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]") -IF("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE("FILE(STRINGS) correctly read from hex file [${infile_strings}]") -ELSE("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE(SEND_ERROR - "FILE(STRINGS) incorrectly read from hex file [${infile_strings}]") -ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.ihx" infile_strings REGEX INFO) +set(infile_strings_goal "INFO:compiler\\[SDCC-HEX\\]") +if("${infile_strings}" MATCHES "${infile_strings_goal}") + message("file(STRINGS) correctly read from hex file [${infile_strings}]") +else() + message(SEND_ERROR + "file(STRINGS) incorrectly read from hex file [${infile_strings}]") +endif() # this file has been created with "sdcc main.c --out-fmt-s19" -FILE(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO) -SET(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]") -IF("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE("FILE(STRINGS) correctly read from srec file [${infile_strings}]") -ELSE("${infile_strings}" MATCHES "${infile_strings_goal}") - MESSAGE(SEND_ERROR - "FILE(STRINGS) incorrectly read from srec file [${infile_strings}]") -ENDIF("${infile_strings}" MATCHES "${infile_strings_goal}") +file(STRINGS "${CMAKE_CURRENT_SOURCE_DIR}/main.srec" infile_strings REGEX INFO) +set(infile_strings_goal "INFO:compiler\\[SDCC-SREC\\]") +if("${infile_strings}" MATCHES "${infile_strings_goal}") + message("file(STRINGS) correctly read from srec file [${infile_strings}]") +else() + message(SEND_ERROR + "file(STRINGS) incorrectly read from srec file [${infile_strings}]") +endif() # String test -STRING(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") -STRING(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") -STRING(REGEX REPLACE "[Aa][uU][tT][oO]([cC][oO][nN][fF]|[mM][aA][kK][eE])" +string(REGEX MATCH "[cC][mM][aA][kK][eE]" rmvar "CMake is great") +string(REGEX MATCHALL "[cC][mM][aA][kK][eE]" rmallvar "CMake is better than cmake or CMake") +string(REGEX REPLACE "[Aa][uU][tT][oO]([cC][oO][nN][fF]|[mM][aA][kK][eE])" "CMake" rrepvar "People should use Autoconf and Automake") -STRING(COMPARE EQUAL "CMake" "Autoconf" nceqvar) -STRING(COMPARE EQUAL "CMake" "CMake" ceqvar) -STRING(COMPARE NOTEQUAL "CMake" "Autoconf" cneqvar) -STRING(COMPARE NOTEQUAL "CMake" "CMake" ncneqvar) -STRING(COMPARE LESS "before" "after" nclvar) -STRING(COMPARE LESS "max" "min" clvar) -STRING(COMPARE GREATER "before" "after" cgvar) -STRING(COMPARE GREATER "max" "min" ncgvar) -STRING(ASCII 67 109 97 107 101 savar) -STRING(TOUPPER "CMake" tuvar) -STRING(TOLOWER "CMake" tlvar) -STRING(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf") - -IF("abc" STREQUAL "xyz") - MESSAGE(SEND_ERROR "Problem with the IF(STREQUAL), \"abc\" and \"xyz\" considered equal") -ENDIF("abc" STREQUAL "xyz") - -IF("CMake is cool" MATCHES "(CMake) (is).+") - IF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") - MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"") - ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") - IF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") - MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"") - ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") - IF(NOT "${CMAKE_MATCH_2}" STREQUAL "is") - MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"") - ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "is") -ELSE("CMake is cool" MATCHES "(CMake) (is).+") - MESSAGE(SEND_ERROR "Problem with the IF(MATCHES), no match found") -ENDIF("CMake is cool" MATCHES "(CMake) (is).+") - -STRING(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake") -IF(NOT "${matchResultVar}" STREQUAL "People should use CMake") - MESSAGE(SEND_ERROR "STRING(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"") -ENDIF(NOT "${matchResultVar}" STREQUAL "People should use CMake") -IF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") - MESSAGE(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"") -ENDIF(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") -IF(NOT "${CMAKE_MATCH_1}" STREQUAL "People") - MESSAGE(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"") -ENDIF(NOT "${CMAKE_MATCH_1}" STREQUAL "People") -IF(NOT "${CMAKE_MATCH_2}" STREQUAL "") - MESSAGE(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string") -ENDIF(NOT "${CMAKE_MATCH_2}" STREQUAL "") - - -STRING(STRIP " +string(COMPARE EQUAL "CMake" "Autoconf" nceqvar) +string(COMPARE EQUAL "CMake" "CMake" ceqvar) +string(COMPARE NOTEQUAL "CMake" "Autoconf" cneqvar) +string(COMPARE NOTEQUAL "CMake" "CMake" ncneqvar) +string(COMPARE LESS "before" "after" nclvar) +string(COMPARE LESS "max" "min" clvar) +string(COMPARE GREATER "before" "after" cgvar) +string(COMPARE GREATER "max" "min" ncgvar) +string(ASCII 67 109 97 107 101 savar) +string(TOUPPER "CMake" tuvar) +string(TOLOWER "CMake" tlvar) +string(REPLACE "Autoconf" "CMake" repvar "People should use Autoconf") + +if("abc" STREQUAL "xyz") + message(SEND_ERROR "Problem with the if(STREQUAL), \"abc\" and \"xyz\" considered equal") +endif() + +if("CMake is cool" MATCHES "(CMake) (is).+") + if(NOT "${CMAKE_MATCH_0}" STREQUAL "CMake is cool") + message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"CMake is cool\"") + endif() + if(NOT "${CMAKE_MATCH_1}" STREQUAL "CMake") + message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"CMake\"") + endif() + if(NOT "${CMAKE_MATCH_2}" STREQUAL "is") + message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected \"is\"") + endif() +else() + message(SEND_ERROR "Problem with the if(MATCHES), no match found") +endif() + +string(REGEX MATCH "(People).+CMake" matchResultVar "People should use CMake") +if(NOT "${matchResultVar}" STREQUAL "People should use CMake") + message(SEND_ERROR "string(REGEX MATCH) problem: \"${matchResultVar}\", expected \"People should use CMake\"") +endif() +if(NOT "${CMAKE_MATCH_0}" STREQUAL "People should use CMake") + message(SEND_ERROR "CMAKE_MATCH_0 wrong: \"${CMAKE_MATCH_0}\", expected \"People should use CMake\"") +endif() +if(NOT "${CMAKE_MATCH_1}" STREQUAL "People") + message(SEND_ERROR "CMAKE_MATCH_1 wrong: \"${CMAKE_MATCH_1}\", expected \"People\"") +endif() +if(NOT "${CMAKE_MATCH_2}" STREQUAL "") + message(SEND_ERROR "CMAKE_MATCH_2 wrong: \"${CMAKE_MATCH_2}\", expected empty string") +endif() + + +string(STRIP " ST1 " ST1) -STRING(STRIP "ST2 " ST2) -STRING(STRIP " ST3" ST3) +string(STRIP "ST2 " ST2) +string(STRIP " ST3" ST3) -FOREACH(var ST1 ST2 ST3) - IF("${var}" STREQUAL "${${var}}") - MESSAGE("[${var}] == [${${var}}]") - ELSE("${var}" STREQUAL "${${var}}") - MESSAGE(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") - ENDIF("${var}" STREQUAL "${${var}}") -ENDFOREACH(var) +foreach(var ST1 ST2 ST3) + if("${var}" STREQUAL "${${var}}") + message("[${var}] == [${${var}}]") + else() + message(SEND_ERROR "Problem with the STRIP command for ${var}: [${${var}}]") + endif() +endforeach() -STRING(SUBSTRING "People should use Autoconf" 7 10 substringres) -SET(substringres "Everybody ${substringres} CMake") +string(SUBSTRING "People should use Autoconf" 7 10 substringres) +set(substringres "Everybody ${substringres} CMake") -STRING(LENGTH ${substringres} lengthres) +string(LENGTH ${substringres} lengthres) -FILE(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest") +file(RELATIVE_PATH relpath "/usr/local/bin" "/usr/X11R6/bin/xnest") # Escaping test -SET(var "\\ \" \ \t \n \r \# \( \) \0") -MESSAGE("Output: [${var}]") -SET(var \\ \" \ \t \n \r \# \( \) \0) -MESSAGE("Output: [${var}]") +set(var "\\ \" \ \t \n \r \# \( \) \0") +message("Output: [${var}]") +set(var \\ \" \ \t \n \r \# \( \) \0) +message("Output: [${var}]") # Make-style unquoted argument test -SET(var $(VAR1)$(VAR2)/$(VAR3)) -MESSAGE("Output: [${var}]") -STRING(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result) -IF(NOT result) - MESSAGE(SEND_ERROR "Unquoted $(VAR) syntax is broken.") -ENDIF(NOT result) +set(var $(VAR1)$(VAR2)/$(VAR3)) +message("Output: [${var}]") +string(COMPARE EQUAL "${var}" "$(VAR1)$(VAR2)/$(VAR3)" result) +if(NOT result) + message(SEND_ERROR "Unquoted $(VAR) syntax is broken.") +endif() # Obscure environment variable name -SET("ENV{x+(y)}" "Obscure environment variable value") -MESSAGE("Output: [$ENV{x+(y)}]") -IF(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value") - MESSAGE(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.") -ENDIF() +set("ENV{x+(y)}" "Obscure environment variable value") +message("Output: [$ENV{x+(y)}]") +if(NOT "$ENV{x+(y)}" STREQUAL "Obscure environment variable value") + message(SEND_ERROR "Environment variable \"ENV{x+(y)}\" does not work.") +endif() # Make directories test -FILE(MAKE_DIRECTORY - "${CMAKE_CURRENT_BINARY_DIR}/Includes" +file(MAKE_DIRECTORY + "${CMAKE_CURRENT_BINARY_DIR}/Includes" "${CMAKE_CURRENT_BINARY_DIR}/Directory1" "${CMAKE_CURRENT_BINARY_DIR}/Directory2" ) # Write results to the file (test write file) -SET(file "${CMAKE_CURRENT_BINARY_DIR}/Includes/Values.h") -FILE(WRITE "${file}" "/* this file is generated */\n") -FOREACH(var +set(file "${CMAKE_CURRENT_BINARY_DIR}/Includes/Values.h") +file(WRITE "${file}" "/* this file is generated */\n") +foreach(var rmvar rmallvar rrepvar @@ -177,28 +177,28 @@ FOREACH(var savar tuvar tlvar) - FILE(APPEND "${file}" "#define ${var} \"${${var}}\"\n") -ENDFOREACH(var) + file(APPEND "${file}" "#define ${var} \"${${var}}\"\n") +endforeach() # Verify that the file was created recently. -IF(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") - MESSAGE(FATAL_ERROR "IF(FILE_IS_NEWER) does not seem to work.") -ENDIF(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") +if(NOT "${file}" IS_NEWER_THAN "${CMAKE_CURRENT_SOURCE_DIR}/InputFile.h.in") + message(FATAL_ERROR "if(FILE_IS_NEWER) does not seem to work.") +endif() # Test configuration of the string -SET(TEST_DEFINED 123) -SET(TEST_NOT_DEFINED) -STRING(CONFIGURE "${infile}" infile+-/out @ONLY) -SET(infile "${infile+-/out}") +set(TEST_DEFINED 123) +set(TEST_NOT_DEFINED) +string(CONFIGURE "${infile}" infile+-/out @ONLY) +set(infile "${infile+-/out}") # Write include file to a file -STRING(REGEX REPLACE "includefile" "${file}" outfile "${infile}") -FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}") -FILE(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" +string(REGEX REPLACE "includefile" "${file}" outfile "${infile}") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${outfile}") +file(RENAME "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h-tmp" "${CMAKE_CURRENT_BINARY_DIR}/OutputFile.h") # Test file copy with relative paths -FILE(COPY . +file(COPY . DESTINATION src FILE_PERMISSIONS OWNER_READ # test no OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE @@ -207,31 +207,31 @@ FILE(COPY . ) # Test file glob -FILE(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*") -MESSAGE("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}") -SET(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx") -MESSAGE("Glob expression is [${expr}].") -FILE(GLOB src_files "${expr}") -MESSAGE("Globbed files [${src_files}].") -ADD_EXECUTABLE(StringFileTest ${src_files}) - -SET(expr "${CMAKE_CURRENT_SOURCE_DIR}/../*.cxx") -FILE(GLOB_RECURSE rel_src_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/.." "${expr}") -MESSAGE("Globbed files [${rel_src_files}].") +file(GLOB_RECURSE src_files "${CMAKE_CURRENT_SOURCE_DIR}/*") +message("Files in ${CMAKE_CURRENT_SOURCE_DIR} are ${src_files}") +set(expr "${CMAKE_CURRENT_BINARY_DIR}/src/[sS][!a-su-zA-Z0-9][^a-qs-zA-Z0-9]ing?ile*.cxx") +message("Glob expression is [${expr}].") +file(GLOB src_files "${expr}") +message("Globbed files [${src_files}].") +add_executable(StringFileTest ${src_files}) + +set(expr "${CMAKE_CURRENT_SOURCE_DIR}/../*.cxx") +file(GLOB_RECURSE rel_src_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/.." "${expr}") +message("Globbed files [${rel_src_files}].") # Test FOREACH range -MESSAGE("Cheack if FOREACH with RANGE works") -MACRO(TEST_RANGE ARGS CHECK) - SET(r) - FOREACH(a RANGE ${ARGS}) - SET(r ${r} ${a}) - ENDFOREACH(a) - MESSAGE("FOREACH with RANGE ${ARGS} produces ${r}") - IF("x${r}x" MATCHES "^x${CHECK}x$") - ELSE("x${r}x" MATCHES "^x${CHECK}x$") - MESSAGE(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}") - ENDIF("x${r}x" MATCHES "^x${CHECK}x$") -ENDMACRO(TEST_RANGE) +message("Cheack if FOREACH with RANGE works") +macro(TEST_RANGE ARGS CHECK) + set(r) + foreach(a RANGE ${ARGS}) + set(r ${r} ${a}) + endforeach() + message("FOREACH with RANGE ${ARGS} produces ${r}") + if("x${r}x" MATCHES "^x${CHECK}x$") + else() + message(SEND_ERROR "The range resulted in: ${r} should be ${CHECK}") + endif() +endmacro() TEST_RANGE("5" "0;1;2;3;4;5") TEST_RANGE("3;5" "3;4;5") TEST_RANGE("5;3" "5;4;3") @@ -246,7 +246,7 @@ set(var_a) set(var_b) foreach(item IN LISTS list1 list2 ITEMS "" a "") set(var_${item} "${var_${item}}x") -endforeach(item) +endforeach() if(NOT "${var_}" STREQUAL "xxxxx") message(FATAL_ERROR "count incorrect for \"\": [${var_}]") endif() @@ -258,25 +258,25 @@ if(NOT "${var_b}" STREQUAL "x") endif() # Test SUBSTRING command -SET(ST_INPUTSTRING "0123456789") -STRING(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY) -STRING(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE) -STRING(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL) -STRING(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS) -STRING(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE) - -IF(ST_EMPTY) - MESSAGE(SEND_ERROR "SUBSTRING with length 0 does not return an empty string") -ENDIF(ST_EMPTY) -IF(NOT ST_ONE STREQUAL "1") - MESSAGE(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"") -ENDIF(NOT ST_ONE STREQUAL "1") -IF(NOT ST_INPUTSTRING STREQUAL ST_ALL) - MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with length") -ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL) -IF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) - MESSAGE(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1") -ENDIF(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) -IF(NOT ST_NINE STREQUAL "9") - MESSAGE(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") -ENDIF(NOT ST_NINE STREQUAL "9") +set(ST_INPUTSTRING "0123456789") +string(SUBSTRING ${ST_INPUTSTRING} 3 0 ST_EMPTY) +string(SUBSTRING ${ST_INPUTSTRING} 1 1 ST_ONE) +string(SUBSTRING ${ST_INPUTSTRING} 0 10 ST_ALL) +string(SUBSTRING ${ST_INPUTSTRING} 0 -1 ST_ALL_MINUS) +string(SUBSTRING ${ST_INPUTSTRING} 9 -1 ST_NINE) + +if(ST_EMPTY) + message(SEND_ERROR "SUBSTRING with length 0 does not return an empty string") +endif() +if(NOT ST_ONE STREQUAL "1") + message(SEND_ERROR "SUBSTING command does not cut the correct selected character, was \"" ${ST_ONE} "\", should be \"1\"") +endif() +if(NOT ST_INPUTSTRING STREQUAL ST_ALL) + message(SEND_ERROR "SUBSTRING does not return the whole string when selected with length") +endif() +if(NOT ST_INPUTSTRING STREQUAL ST_ALL_MINUS) + message(SEND_ERROR "SUBSTRING does not return the whole string when selected with -1") +endif() +if(NOT ST_NINE STREQUAL "9") + message(SEND_ERROR "SUBSTRING does not return the tail when selected with -1") +endif() diff --git a/Tests/StringFileTest/InputFile.h.in b/Tests/StringFileTest/InputFile.h.in index 3e70a36e8..0f01ccfc6 100644 --- a/Tests/StringFileTest/InputFile.h.in +++ b/Tests/StringFileTest/InputFile.h.in @@ -3,7 +3,7 @@ /* This should be configured to a define. */ #cmakedefine TEST_DEFINED @TEST_DEFINED@ /* This should be configured to a commented undef with the curlies in place */ -#cmakedefine TEST_NOT_DEFINED ${TEST_NOT_DEFINED} +#cmakedefine TEST_NOT_DEFINED ${TEST_NOT_DEFINED} /* This complicated line should be configured unchanged: */ static const char* configvar = @@ -34,5 +34,5 @@ int CheckMethod(const char* var, const char* val ) return 1; #else return 0; -#endif +#endif } diff --git a/Tests/StringFileTest/StringFile.cxx b/Tests/StringFileTest/StringFile.cxx index 609ebaf20..9eba6bff9 100644 --- a/Tests/StringFileTest/StringFile.cxx +++ b/Tests/StringFileTest/StringFile.cxx @@ -26,6 +26,6 @@ int main(int, char*[]) res += CheckMethod(relpath, "../../X11R6/bin/xnest"); res += CheckMethod(configvar, "@$@$junk =~ s/#$xyz#/$foo_bar{$wibble}->{$xyz}/;@@"); - + return res; } diff --git a/Tests/SubDir/CMakeLists.txt b/Tests/SubDir/CMakeLists.txt index 9cfbe25ce..6822e6bd9 100644 --- a/Tests/SubDir/CMakeLists.txt +++ b/Tests/SubDir/CMakeLists.txt @@ -1,46 +1,46 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SUBDIR) -SUBDIRS(Executable EXCLUDE_FROM_ALL Examples) -WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") +project(SUBDIR) +subdirs(Executable EXCLUDE_FROM_ALL Examples) +write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") #WATCOM WMAKE does not support + in the name of a file! -IF(WATCOM) - SET(PLUS_NAME_FILES +if(WATCOM) + set(PLUS_NAME_FILES AnotherSubdir/pair_int.int.c vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - SET(PLUS_NAME_FILES +else() + set(PLUS_NAME_FILES AnotherSubdir/pair+int.int.c vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) +endif() -ADD_EXECUTABLE(TestFromSubdir +add_executable(TestFromSubdir AnotherSubdir/testfromsubdir.c AnotherSubdir/secondone ${PLUS_NAME_FILES} ) -AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES) -IF(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +aux_source_directory(ThirdSubDir SOURCES) +if(WATCOM) + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else() + set(SOURCES2 ${f} ${SOURCES2}) + endif() + endforeach() + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - MESSAGE("${f}") - ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +else() + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else() + set(SOURCES2 ${f} ${SOURCES2}) + message("${f}") + endif() + endforeach() + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) -MESSAGE("Sources: ${SOURCES}") -ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES}) +endif() +message("Sources: ${SOURCES}") +add_executable(TestWithAuxSourceDir ${SOURCES}) diff --git a/Tests/SubDir/Examples/CMakeLists.txt b/Tests/SubDir/Examples/CMakeLists.txt index b0f1e896c..8cd7e24e1 100644 --- a/Tests/SubDir/Examples/CMakeLists.txt +++ b/Tests/SubDir/Examples/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Examples) -SUBDIRS(example1 example2) +project(Examples) +subdirs(example1 example2) diff --git a/Tests/SubDir/Examples/example1/CMakeLists.txt b/Tests/SubDir/Examples/example1/CMakeLists.txt index 303618321..20d065e54 100644 --- a/Tests/SubDir/Examples/example1/CMakeLists.txt +++ b/Tests/SubDir/Examples/example1/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(example1) -ADD_EXECUTABLE(example1 example1.cxx) +project(example1) +add_executable(example1 example1.cxx) -ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD +add_custom_command(TARGET example1 POST_BUILD COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere COMMENT "Remove marker file that should exist because this should not be run") diff --git a/Tests/SubDir/Examples/example2/CMakeLists.txt b/Tests/SubDir/Examples/example2/CMakeLists.txt index 19a537686..388e33c3d 100644 --- a/Tests/SubDir/Examples/example2/CMakeLists.txt +++ b/Tests/SubDir/Examples/example2/CMakeLists.txt @@ -1,2 +1,2 @@ -PROJECT(example2) -ADD_EXECUTABLE(example2 example2.cxx) +project(example2) +add_executable(example2 example2.cxx) diff --git a/Tests/SubDir/Executable/CMakeLists.txt b/Tests/SubDir/Executable/CMakeLists.txt index d679168d8..77e6751cd 100644 --- a/Tests/SubDir/Executable/CMakeLists.txt +++ b/Tests/SubDir/Executable/CMakeLists.txt @@ -1 +1 @@ -ADD_EXECUTABLE(test test.cxx) +add_executable(test test.cxx) diff --git a/Tests/SubDirSpaces/CMakeLists.txt b/Tests/SubDirSpaces/CMakeLists.txt index 879530b56..69f1d6833 100644 --- a/Tests/SubDirSpaces/CMakeLists.txt +++ b/Tests/SubDirSpaces/CMakeLists.txt @@ -1,16 +1,16 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SUBDIR) +project(SUBDIR) # Some systems do not seem to support rpath with spaces. -IF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") - SET(CMAKE_SKIP_BUILD_RPATH 1) -ENDIF("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") +if("${CMAKE_SYSTEM}" MATCHES "IRIX|QNX") + set(CMAKE_SKIP_BUILD_RPATH 1) +endif() # be able to see output from make on dashboards -SET(CMAKE_VERBOSE_MAKEFILE 1) +set(CMAKE_VERBOSE_MAKEFILE 1) message("${CMAKE_MAKE_PROGRAM}") set(CMAKE_PAREN TRUE) -IF("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake") +if("${CMAKE_MAKE_PROGRAM}" MATCHES "wmake") message("wmake does not support () in path") set(CMAKE_PAREN FALSE) elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make") @@ -23,55 +23,55 @@ elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "make") endif() endif() -IF(CMAKE_PAREN) - ADD_DEFINITIONS(-DCMAKE_PAREN=1) - SUBDIRS("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples") -ELSE(CMAKE_PAREN) - SUBDIRS("Executable Sources" EXCLUDE_FROM_ALL "Some Examples") -ENDIF(CMAKE_PAREN) +if(CMAKE_PAREN) + add_definitions(-DCMAKE_PAREN=1) + subdirs("Executable Sources" "Some(x86) Sources" EXCLUDE_FROM_ALL "Some Examples") +else() + subdirs("Executable Sources" EXCLUDE_FROM_ALL "Some Examples") +endif() -WRITE_FILE(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") +write_file(${SUBDIR_BINARY_DIR}/ShouldBeHere "This file should exist.") #WATCOM WMAKE does not support + in the name of a file! -IF(WATCOM) - SET(PLUS_NAME_FILES +if(WATCOM) + set(PLUS_NAME_FILES "Another Subdir/pair_int.int.c" vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - SET(PLUS_NAME_FILES +else() + set(PLUS_NAME_FILES "Another Subdir/pair+int.int.c" vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) +endif() -ADD_EXECUTABLE(TestFromSubdir +add_executable(TestFromSubdir "Another Subdir/testfromsubdir.c" "Another Subdir/secondone" ${PLUS_NAME_FILES} ) -AUX_SOURCE_DIRECTORY(ThirdSubDir SOURCES) -IF(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - ENDIF("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +aux_source_directory(ThirdSubDir SOURCES) +if(WATCOM) + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair+int.int1.c") + else() + set(SOURCES2 ${f} ${SOURCES2}) + endif() + endforeach() + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm_vcl_pair_double.foo.c) -ELSE(WATCOM) - FOREACH(f ${SOURCES}) - IF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ELSE("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - SET(SOURCES2 ${f} ${SOURCES2}) - ENDIF("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") - ENDFOREACH(f) - SET(SOURCES ${SOURCES2}) - SET(SOURCES ${SOURCES} +else() + foreach(f ${SOURCES}) + if("${f}" STREQUAL "ThirdSubDir/pair_int.int1.c") + else() + set(SOURCES2 ${f} ${SOURCES2}) + endif() + endforeach() + set(SOURCES ${SOURCES2}) + set(SOURCES ${SOURCES} vcl_algorithm+vcl_pair+double.foo.c) -ENDIF(WATCOM) -ADD_EXECUTABLE(TestWithAuxSourceDir ${SOURCES}) -IF(CMAKE_PAREN) +endif() +add_executable(TestWithAuxSourceDir ${SOURCES}) +if(CMAKE_PAREN) target_link_libraries(TestWithAuxSourceDir testOddPath) -ENDIF(CMAKE_PAREN) +endif() diff --git a/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt b/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt index d679168d8..77e6751cd 100644 --- a/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt +++ b/Tests/SubDirSpaces/Executable Sources/CMakeLists.txt @@ -1 +1 @@ -ADD_EXECUTABLE(test test.cxx) +add_executable(test test.cxx) diff --git a/Tests/SubDirSpaces/Executable/CMakeLists.txt b/Tests/SubDirSpaces/Executable/CMakeLists.txt index d679168d8..77e6751cd 100644 --- a/Tests/SubDirSpaces/Executable/CMakeLists.txt +++ b/Tests/SubDirSpaces/Executable/CMakeLists.txt @@ -1 +1 @@ -ADD_EXECUTABLE(test test.cxx) +add_executable(test test.cxx) diff --git a/Tests/SubDirSpaces/Some Examples/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/CMakeLists.txt index b0f1e896c..8cd7e24e1 100644 --- a/Tests/SubDirSpaces/Some Examples/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(Examples) -SUBDIRS(example1 example2) +project(Examples) +subdirs(example1 example2) diff --git a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt index 303618321..20d065e54 100644 --- a/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/example1/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(example1) -ADD_EXECUTABLE(example1 example1.cxx) +project(example1) +add_executable(example1 example1.cxx) -ADD_CUSTOM_COMMAND(TARGET example1 POST_BUILD +add_custom_command(TARGET example1 POST_BUILD COMMAND "${CMAKE_COMMAND}" ARGS -E remove ${SUBDIR_BINARY_DIR}/ShouldBeHere COMMENT "Remove marker file that should exist because this should not be run") diff --git a/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt b/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt index 19a537686..388e33c3d 100644 --- a/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt +++ b/Tests/SubDirSpaces/Some Examples/example2/CMakeLists.txt @@ -1,2 +1,2 @@ -PROJECT(example2) -ADD_EXECUTABLE(example2 example2.cxx) +project(example2) +add_executable(example2 example2.cxx) diff --git a/Tests/SwigTest/CMakeLists.txt b/Tests/SwigTest/CMakeLists.txt index 5a8e61922..17a502d7e 100644 --- a/Tests/SwigTest/CMakeLists.txt +++ b/Tests/SwigTest/CMakeLists.txt @@ -1,50 +1,50 @@ -SET(language "python") +set(language "python") cmake_minimum_required (VERSION 2.6) -PROJECT(example_${language}_class) +project(example_${language}_class) -FIND_PACKAGE(SWIG REQUIRED) -INCLUDE(${SWIG_USE_FILE}) +find_package(SWIG REQUIRED) +include(${SWIG_USE_FILE}) -IF(${language} MATCHES python) - FIND_PACKAGE(PythonLibs) - INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES}) -ENDIF(${language} MATCHES python) -IF(${language} MATCHES perl) - FIND_PACKAGE(PerlLibs) - INCLUDE_DIRECTORIES(${PERL_INCLUDE_PATH}) - ADD_DEFINITIONS(${PERL_EXTRA_C_FLAGS}) - SET(SWIG_LANG_LIBRARIES ${PERL_LIBRARY}) -ENDIF(${language} MATCHES perl) -IF(${language} MATCHES tcl) - FIND_PACKAGE(TCL) - INCLUDE_DIRECTORIES(${TCL_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${TCL_LIBRARY}) -ENDIF(${language} MATCHES tcl) -IF(${language} MATCHES ruby) - FIND_PACKAGE(Ruby) - INCLUDE_DIRECTORIES(${RUBY_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY}) -ENDIF(${language} MATCHES ruby) -IF(${language} MATCHES php4) - FIND_PACKAGE(PHP4) - INCLUDE_DIRECTORIES(${PHP4_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY}) -ENDIF(${language} MATCHES php4) -IF(${language} MATCHES pike) - FIND_PACKAGE(Pike) - INCLUDE_DIRECTORIES(${PIKE_INCLUDE_PATH}) - SET(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY}) -ENDIF(${language} MATCHES pike) +if(${language} MATCHES python) + find_package(PythonLibs) + include_directories(${PYTHON_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${PYTHON_LIBRARIES}) +endif() +if(${language} MATCHES perl) + find_package(PerlLibs) + include_directories(${PERL_INCLUDE_PATH}) + add_definitions(${PERL_EXTRA_C_FLAGS}) + set(SWIG_LANG_LIBRARIES ${PERL_LIBRARY}) +endif() +if(${language} MATCHES tcl) + find_package(TCL) + include_directories(${TCL_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${TCL_LIBRARY}) +endif() +if(${language} MATCHES ruby) + find_package(Ruby) + include_directories(${RUBY_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${RUBY_LIBRARY}) +endif() +if(${language} MATCHES php4) + find_package(PHP4) + include_directories(${PHP4_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${PHP4_LIBRARY}) +endif() +if(${language} MATCHES pike) + find_package(Pike) + include_directories(${PIKE_INCLUDE_PATH}) + set(SWIG_LANG_LIBRARIES ${PIKE_LIBRARY}) +endif() -INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) +include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -SET(CMAKE_SWIG_FLAGS "") +set(CMAKE_SWIG_FLAGS "") -SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES CPLUSPLUS ON) -SET_SOURCE_FILES_PROPERTIES(example.i PROPERTIES SWIG_FLAGS "-includeall") +set_source_files_properties(example.i PROPERTIES CPLUSPLUS ON) +set_source_files_properties(example.i PROPERTIES SWIG_FLAGS "-includeall") SWIG_ADD_MODULE(example "${language}" example.i example.cxx) SWIG_LINK_LIBRARIES(example ${SWIG_LANG_LIBRARIES}) diff --git a/Tests/SwigTest/example.h b/Tests/SwigTest/example.h index 46d901361..c9d59f22b 100644 --- a/Tests/SwigTest/example.h +++ b/Tests/SwigTest/example.h @@ -8,7 +8,7 @@ public: virtual ~Shape() { nshapes--; }; - double x, y; + double x, y; void move(double dx, double dy); virtual double area(void) = 0; virtual double perimeter(void) = 0; @@ -36,4 +36,4 @@ public: - + diff --git a/Tests/SwigTest/runme.pike b/Tests/SwigTest/runme.pike index a6377600e..ec28dd70e 100755 --- a/Tests/SwigTest/runme.pike +++ b/Tests/SwigTest/runme.pike @@ -42,12 +42,12 @@ int main() /* See if we can force 's' to be garbage-collected */ s = 0; - + /* Now we should be down to only 1 shape */ write("%d shapes remain\n", Shape_nshapes_get()); - + /* Done */ write("Goodbye\n"); - + return 0; } diff --git a/Tests/SwigTest/runme.py b/Tests/SwigTest/runme.py index 42a5aa363..ed3909e30 100644 --- a/Tests/SwigTest/runme.py +++ b/Tests/SwigTest/runme.py @@ -3,7 +3,7 @@ # This file illustrates the shadow-class C++ interface generated # by SWIG. -import example +import example # ----- Object creation ----- diff --git a/Tests/SystemInformation/CMakeLists.txt b/Tests/SystemInformation/CMakeLists.txt index c4285758e..838fd4aa1 100644 --- a/Tests/SystemInformation/CMakeLists.txt +++ b/Tests/SystemInformation/CMakeLists.txt @@ -1,61 +1,61 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(SystemInformation) +project(SystemInformation) -INCLUDE_DIRECTORIES("This does not exists") -GET_DIRECTORY_PROPERTY(incl INCLUDE_DIRECTORIES) -SET_DIRECTORY_PROPERTIES(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}") +include_directories("This does not exists") +get_directory_property(incl INCLUDE_DIRECTORIES) +set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES "${SystemInformation_BINARY_DIR};${SystemInformation_SOURCE_DIR}") -MESSAGE("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT") +message("To prevent CTest from stripping output, you have to display: CTEST_FULL_OUTPUT") -CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/SystemInformation.in +configure_file(${SystemInformation_SOURCE_DIR}/SystemInformation.in ${SystemInformation_BINARY_DIR}/SystemInformation.out) -CONFIGURE_FILE(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in +configure_file(${SystemInformation_SOURCE_DIR}/DumpInformation.h.in ${SystemInformation_BINARY_DIR}/DumpInformation.h) -ADD_EXECUTABLE(SystemInformation DumpInformation.cxx) +add_executable(SystemInformation DumpInformation.cxx) -MACRO(FOO args) - MESSAGE("Test macro") -ENDMACRO(FOO) +macro(FOO args) + message("Test macro") +endmacro() FOO(lala) -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "") -GET_CMAKE_PROPERTY(res VARIABLES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "") +get_cmake_property(res VARIABLES) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllVariables.txt "${var} \"${${var}}\"\n") -ENDFOREACH(var ${res}) +endforeach() -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "") -GET_CMAKE_PROPERTY(res COMMANDS) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "") +get_cmake_property(res COMMANDS) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllCommands.txt "${var}\n") -ENDFOREACH(var ${res}) +endforeach() -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") -GET_CMAKE_PROPERTY(res MACROS) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "") +get_cmake_property(res MACROS) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/AllMacros.txt "${var}\n") -ENDFOREACH(var ${res}) +endforeach() -FILE(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "") -GET_DIRECTORY_PROPERTY(res INCLUDE_DIRECTORIES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "") +get_directory_property(res INCLUDE_DIRECTORIES) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "INCLUDE_DIRECTORY: ${var}\n") -ENDFOREACH(var) +endforeach() -GET_DIRECTORY_PROPERTY(res LINK_DIRECTORIES) -FOREACH(var ${res}) - FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt +get_directory_property(res LINK_DIRECTORIES) +foreach(var ${res}) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "LINK_DIRECTORIES: ${var}\n") -ENDFOREACH(var) +endforeach() -GET_DIRECTORY_PROPERTY(res INCLUDE_REGULAR_EXPRESSION) -FILE(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt +get_directory_property(res INCLUDE_REGULAR_EXPRESSION) +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/OtherProperties.txt "INCLUDE_REGULAR_EXPRESSION: ${res}\n") diff --git a/Tests/SystemInformation/DumpInformation.cxx b/Tests/SystemInformation/DumpInformation.cxx index 579dcbcf2..acafa874d 100644 --- a/Tests/SystemInformation/DumpInformation.cxx +++ b/Tests/SystemInformation/DumpInformation.cxx @@ -15,7 +15,7 @@ void cmDumpInformationPrintFile(const char* name, FILE* fout) fflush(fout); return; } - + FILE* fin = fopen(name, "r"); if(fin) { @@ -59,7 +59,7 @@ int main(int,char *[]) DumpInformation_BINARY_DIR "/AllMacros.txt", DumpInformation_BINARY_DIR "/OtherProperties.txt", DumpInformation_BINARY_DIR "/../../Source/cmConfigure.h", - DumpInformation_BINARY_DIR "/../../CMakeCache.txt", + DumpInformation_BINARY_DIR "/../../CMakeCache.txt", DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeOutput.log", DumpInformation_BINARY_DIR "/../../CMakeFiles/CMakeError.log", DumpInformation_BINARY_DIR "/../../Bootstrap.cmk/cmake_bootstrap.log", @@ -75,6 +75,6 @@ int main(int,char *[]) { cmDumpInformationPrintFile(*f, stdout); } - + return 0; -} +} diff --git a/Tests/TarTest/CMakeLists.txt b/Tests/TarTest/CMakeLists.txt index a3c5b31ff..bcc340bb3 100644 --- a/Tests/TarTest/CMakeLists.txt +++ b/Tests/TarTest/CMakeLists.txt @@ -1,20 +1,20 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TarTest) +project(TarTest) # this is macro that we will be running -MACRO(EXEC_TAR_COMMAND DIR ARGS) - EXEC_PROGRAM("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) - IF(${RET}) - MESSAGE(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") - ENDIF(${RET}) -ENDMACRO(EXEC_TAR_COMMAND) +macro(EXEC_TAR_COMMAND DIR ARGS) + exec_program("${CMAKE_COMMAND}" "${DIR}" ARGS "-E tar ${ARGS}" RETURN_VALUE RET) + if(${RET}) + message(FATAL_ERROR "CMake tar command failed with arguments \"${ARGS}\"") + endif() +endmacro() # Create a directory structure -SET(CHECK_FILES) -MACRO(COPY F1 F2) - CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) - SET(CHECK_FILES ${CHECK_FILES} "${F2}") -ENDMACRO(COPY) +set(CHECK_FILES) +macro(COPY F1 F2) + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${F1}" "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${F2}" COPYONLY) + set(CHECK_FILES ${CHECK_FILES} "${F2}") +endmacro() COPY("CMakeLists.txt" "f1.txt") COPY("CMakeLists.txt" "d1/f1.txt") COPY("CMakeLists.txt" "d 2/f1.txt") @@ -23,22 +23,22 @@ COPY("CMakeLists.txt" "d_4/f1.txt") COPY("CMakeLists.txt" "d-4/f1.txt") COPY("CMakeLists.txt" "My Special Directory/f1.txt") -IF(UNIX) - EXEC_PROGRAM("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") - SET(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") -ENDIF(UNIX) +if(UNIX) + exec_program("ln" ARGS "-sf f1.txt \"${CMAKE_CURRENT_BINARY_DIR}/tar_dir/d1/f2.txt\"") + set(CHECK_FILES ${CHECK_FILES} "d1/f2.txt") +endif() # cleanup first in case there are files left from previous runs # if the umask is odd on the machine it might create files that # are not automatically over written. These tests are run # each time the configure step is run. -FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") -FILE(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") -FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -FILE(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar") +file(REMOVE "${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz") +file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") +file(REMOVE_RECURSE "${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") -MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") -MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") +make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar") +make_directory("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz") # Run tests @@ -48,22 +48,22 @@ EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}" "cvfz \"${CMAKE_CURRENT_BINARY_DI EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar" "xvf \"${CMAKE_CURRENT_BINARY_DIR}/test_tar.tar\"") EXEC_TAR_COMMAND("${CMAKE_CURRENT_BINARY_DIR}/test_output_tgz" "xvfz \"${CMAKE_CURRENT_BINARY_DIR}/test_tgz.tgz\"") -MACRO(CHECK_DIR_STRUCTURE DIR) - FOREACH(file ${CHECK_FILES}) - SET(sfile "${DIR}/${file}") - SET(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") - IF(NOT EXISTS "${sfile}") - MESSAGE(SEND_ERROR "Cannot find file ${sfile}") - ELSE(NOT EXISTS "${sfile}") - EXEC_PROGRAM("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) - IF(${ret}) - MESSAGE(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") - ENDIF(${ret}) - ENDIF(NOT EXISTS "${sfile}") - ENDFOREACH(file) -ENDMACRO(CHECK_DIR_STRUCTURE) +macro(CHECK_DIR_STRUCTURE DIR) + foreach(file ${CHECK_FILES}) + set(sfile "${DIR}/${file}") + set(rfile "${CMAKE_CURRENT_BINARY_DIR}/tar_dir/${file}") + if(NOT EXISTS "${sfile}") + message(SEND_ERROR "Cannot find file ${sfile}") + else() + exec_program("${CMAKE_COMMAND}" ARGS "-E compare_files \"${sfile}\" \"${rfile}\"" RETURN_VALUE ret) + if(${ret}) + message(SEND_ERROR "Files \"${sfile}\" \"${rfile}\" are different") + endif() + endif() + endforeach() +endmacro() CHECK_DIR_STRUCTURE("${CMAKE_CURRENT_BINARY_DIR}/test_output_tar/tar_dir") -ADD_EXECUTABLE(TarTest TestTarExec.cxx) +add_executable(TarTest TestTarExec.cxx) diff --git a/Tests/TargetName/scripts/CMakeLists.txt b/Tests/TargetName/scripts/CMakeLists.txt index 40d4e2fb0..58af64d65 100644 --- a/Tests/TargetName/scripts/CMakeLists.txt +++ b/Tests/TargetName/scripts/CMakeLists.txt @@ -1,7 +1,7 @@ if(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/hello_world - COMMAND ${CMAKE_COMMAND} -E copy + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/hello_world ${CMAKE_CURRENT_BINARY_DIR} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hello_world ) @@ -10,4 +10,4 @@ if(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") DEPENDS #hello_world ${CMAKE_CURRENT_BINARY_DIR}/hello_world ) -endif(NOT CMAKE_BINARY_DIR STREQUAL "${CMAKE_SOURCE_DIR}") +endif() diff --git a/Tests/TestDriver/CMakeLists.txt b/Tests/TestDriver/CMakeLists.txt index bd5e97414..663ecab55 100644 --- a/Tests/TestDriver/CMakeLists.txt +++ b/Tests/TestDriver/CMakeLists.txt @@ -1,15 +1,15 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TestDriverTest) +project(TestDriverTest) -SET(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx ) -SET(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx ) -INCLUDE_DIRECTORIES(${TestDriverTest_SOURCE_DIR}) -CREATE_TEST_SOURCELIST(testSrcs - TestDriverTest.cxx - test1.cxx - test2.cxx - subdir/test3.cxx +set(Extra_SRCS testExtraStuff.cxx testExtraStuff2.cxx ) +set(Extra_SRCS ${Extra_SRCS};testExtraStuff3.cxx ) +include_directories(${TestDriverTest_SOURCE_DIR}) +create_test_sourcelist(testSrcs + TestDriverTest.cxx + test1.cxx + test2.cxx + subdir/test3.cxx EXTRA_INCLUDE testArgs.h FUNCTION testProccessArgs) -ADD_EXECUTABLE(TestDriverTest ${testSrcs} ${Extra_SRCS}) +add_executable(TestDriverTest ${testSrcs} ${Extra_SRCS}) diff --git a/Tests/TestDriver/test1.cxx b/Tests/TestDriver/test1.cxx index ac82f8ae9..b998fdae6 100644 --- a/Tests/TestDriver/test1.cxx +++ b/Tests/TestDriver/test1.cxx @@ -17,7 +17,7 @@ int test1(int ac, char* av[]) { return -1; } - + printf("test1\n"); for(int i =0; i < ac; i++) printf("arg %d is %s\n", ac, av[i]); diff --git a/Tests/Testing/CMakeLists.txt b/Tests/Testing/CMakeLists.txt index 815b52b58..8f69cbe44 100644 --- a/Tests/Testing/CMakeLists.txt +++ b/Tests/Testing/CMakeLists.txt @@ -2,58 +2,58 @@ # Testing # cmake_minimum_required (VERSION 2.7) -PROJECT (Testing) +project (Testing) # # Lib and exe path # -SET (LIBRARY_OUTPUT_PATH - ${Testing_BINARY_DIR}/bin/ CACHE PATH +set (LIBRARY_OUTPUT_PATH + ${Testing_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH - ${Testing_BINARY_DIR}/bin/ CACHE PATH +set (EXECUTABLE_OUTPUT_PATH + ${Testing_BINARY_DIR}/bin/ CACHE PATH "Single output directory for building all executables.") # # Where will executable tests be written ? # -IF (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -ELSE (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH .) -ENDIF (EXECUTABLE_OUTPUT_PATH) +if (EXECUTABLE_OUTPUT_PATH) + set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) +else () + set (CXX_TEST_PATH .) +endif () # # Include Dart # (will also set NSLOOKUP, HOSTNAME, etc.) # -INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) +include (${CMAKE_ROOT}/Modules/Dart.cmake) # # Extra coverage # -BUILD_COMMAND(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM}) -BUILD_NAME(BUILD_NAME_VAR) -SITE_NAME(SITE_NAME_VAR) +build_command(BUILD_COMMAND_VAR ${CMAKE_MAKE_PROGRAM}) +build_name(BUILD_NAME_VAR) +site_name(SITE_NAME_VAR) # # Enable testing # -ENABLE_TESTING() +enable_testing() # # Add test # -ADD_EXECUTABLE(testing testing.cxx) -ADD_TEST(testing.1 ${Testing_BINARY_DIR}/bin/testing) +add_executable(testing testing.cxx) +add_test(testing.1 ${Testing_BINARY_DIR}/bin/testing) # # skip level test # -ADD_SUBDIRECTORY(Sub/Sub2) +add_subdirectory(Sub/Sub2) # Per-config target name and generator expressions. -ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) -ADD_TEST(NAME testing.perconfig COMMAND perconfig) -ADD_TEST(NAME testing.driver COMMAND ${PerConfig_COMMAND}) +add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../PerConfig PerConfig) +add_test(NAME testing.perconfig COMMAND perconfig) +add_test(NAME testing.driver COMMAND ${PerConfig_COMMAND}) diff --git a/Tests/Testing/DartConfig.cmake b/Tests/Testing/DartConfig.cmake index 26af720ac..de6ea4b41 100644 --- a/Tests/Testing/DartConfig.cmake +++ b/Tests/Testing/DartConfig.cmake @@ -1,24 +1,24 @@ # Dashboard is opened for submissions for a 24 hour period starting at # the specified NIGHLY_START_TIME. Time is specified in 24 hour format. -SET (NIGHTLY_START_TIME "23:00:00 EST") +set (NIGHTLY_START_TIME "23:00:00 EST") # Dart server to submit results (used by client) -SET (DROP_SITE "") -SET (DROP_LOCATION "") -SET (DROP_SITE_USER "") -SET (DROP_SITE_PASSWORD "") -SET (TRIGGER_SITE "") +set (DROP_SITE "") +set (DROP_LOCATION "") +set (DROP_SITE_USER "") +set (DROP_SITE_PASSWORD "") +set (TRIGGER_SITE "") -# Dart server configuration -# SET (CVS_WEB_URL "") -# SET (CVS_WEB_CVSROOT "") -# SET (USE_DOXYGEN "Off") -# SET (DOXYGEN_URL "") -# SET (GNATS_WEB_URL "") +# Dart server configuration +# set (CVS_WEB_URL "") +# set (CVS_WEB_CVSROOT "") +# set (USE_DOXYGEN "Off") +# set (DOXYGEN_URL "") +# set (GNATS_WEB_URL "") # Continuous email delivery variables -# SET (CONTINUOUS_FROM "") -# SET (SMTP_MAILHOST "") -# SET (CONTINUOUS_MONITOR_LIST "") -# SET (CONTINUOUS_BASE_URL "") +# set (CONTINUOUS_FROM "") +# set (SMTP_MAILHOST "") +# set (CONTINUOUS_MONITOR_LIST "") +# set (CONTINUOUS_BASE_URL "") diff --git a/Tests/Testing/Sub/Sub2/CMakeLists.txt b/Tests/Testing/Sub/Sub2/CMakeLists.txt index fb9e8619e..78f4d1a95 100644 --- a/Tests/Testing/Sub/Sub2/CMakeLists.txt +++ b/Tests/Testing/Sub/Sub2/CMakeLists.txt @@ -1,8 +1,8 @@ # # Add test # -ADD_EXECUTABLE(testing2 testing2.cxx) -ADD_TEST(testing.2 ${Testing_BINARY_DIR}/bin/testing2) +add_executable(testing2 testing2.cxx) +add_test(testing.2 ${Testing_BINARY_DIR}/bin/testing2) add_test(NotCycle.a ${CMAKE_COMMAND} -E echo a) add_test(NotCycle.test1 ${CMAKE_COMMAND} -E echo test1) diff --git a/Tests/TryCompile/CMakeLists.txt b/Tests/TryCompile/CMakeLists.txt index 938c092c0..b6b66d8ee 100644 --- a/Tests/TryCompile/CMakeLists.txt +++ b/Tests/TryCompile/CMakeLists.txt @@ -1,120 +1,120 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(TryCompile) +project(TryCompile) -MACRO(TEST_ASSERT value msg) - IF (NOT ${value}) - MESSAGE (SEND_ERROR "Assertion failure:" ${msg} ) - ENDIF (NOT ${value}) -ENDMACRO(TEST_ASSERT) +macro(TEST_ASSERT value msg) + if (NOT ${value}) + message (SEND_ERROR "Assertion failure:" ${msg} ) + endif () +endmacro() -MACRO(TEST_FAIL value msg) - IF (${value}) - MESSAGE (SEND_ERROR "Failing test succeeded:" ${msg} ) - ENDIF (${value}) -ENDMACRO(TEST_FAIL) +macro(TEST_FAIL value msg) + if (${value}) + message (SEND_ERROR "Failing test succeeded:" ${msg} ) + endif () +endmacro() -MACRO(TEST_EXPECT_EXACT command expected) - IF(NOT "x${result}" STREQUAL "x${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF(NOT "x${result}" STREQUAL "x${expected}") -ENDMACRO(TEST_EXPECT_EXACT command expected) +macro(TEST_EXPECT_EXACT command expected) + if(NOT "x${result}" STREQUAL "x${expected}") + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif() +endmacro() -MACRO(TEST_EXPECT_CONTAINS command expected) - IF(NOT "${result}" MATCHES "${expected}") - MESSAGE(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") - ENDIF(NOT "${result}" MATCHES "${expected}") -ENDMACRO(TEST_EXPECT_CONTAINS command expected) +macro(TEST_EXPECT_CONTAINS command expected) + if(NOT "${result}" MATCHES "${expected}") + message(SEND_ERROR "${CMAKE_CURRENT_LIST_LINE}: TEST \"${command}\" failed: \"${result}\" expected: \"${expected}\"") + endif() +endmacro() # try to compile a file that should compile # also check that COPY_FILE works -TRY_COMPILE(SHOULD_PASS - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_compile(SHOULD_PASS + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/pass.c OUTPUT_VARIABLE TRY_OUT COPY_FILE ${TryCompile_BINARY_DIR}/CopyOfPass ) -IF(NOT SHOULD_PASS) - MESSAGE(SEND_ERROR "should pass failed ${TRY_OUT}") -ENDIF(NOT SHOULD_PASS) -IF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") - MESSAGE(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed") -ELSE(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") - FILE(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass") -ENDIF(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") +if(NOT SHOULD_PASS) + message(SEND_ERROR "should pass failed ${TRY_OUT}") +endif() +if(NOT EXISTS "${TryCompile_BINARY_DIR}/CopyOfPass") + message(SEND_ERROR "COPY_FILE to \"${TryCompile_BINARY_DIR}/CopyOfPass\" failed") +else() + file(REMOVE "${TryCompile_BINARY_DIR}/CopyOfPass") +endif() # try to compile a file that should not compile -TRY_COMPILE(SHOULD_FAIL - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_compile(SHOULD_FAIL + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/fail.c OUTPUT_VARIABLE TRY_OUT) -IF(SHOULD_FAIL) - MESSAGE(SEND_ERROR "Should fail passed ${TRY_OUT}") -ENDIF(SHOULD_FAIL) +if(SHOULD_FAIL) + message(SEND_ERROR "Should fail passed ${TRY_OUT}") +endif() # try to compile a file that should compile -TRY_COMPILE(SHOULD_PASS - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_compile(SHOULD_PASS + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/pass.c OUTPUT_VARIABLE TRY_OUT) -IF(NOT SHOULD_PASS) - MESSAGE(SEND_ERROR "should pass failed ${TRY_OUT}") -ENDIF(NOT SHOULD_PASS) +if(NOT SHOULD_PASS) + message(SEND_ERROR "should pass failed ${TRY_OUT}") +endif() # try to compile a file that should not compile -TRY_COMPILE(SHOULD_FAIL - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_compile(SHOULD_FAIL + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/fail.c OUTPUT_VARIABLE TRY_OUT) -IF(SHOULD_FAIL) - MESSAGE(SEND_ERROR "Should fail passed ${TRY_OUT}") -ENDIF(SHOULD_FAIL) - -IF(NOT SHOULD_FAIL) - IF(SHOULD_PASS) - MESSAGE("All Tests passed, ignore all previous output.") - ELSE(SHOULD_PASS) - MESSAGE("Test failed") - ENDIF(SHOULD_PASS) -ELSE(NOT SHOULD_FAIL) - MESSAGE("Test failed") -ENDIF(NOT SHOULD_FAIL) -TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +if(SHOULD_FAIL) + message(SEND_ERROR "Should fail passed ${TRY_OUT}") +endif() + +if(NOT SHOULD_FAIL) + if(SHOULD_PASS) + message("All Tests passed, ignore all previous output.") + else() + message("Test failed") + endif() +else() + message("Test failed") +endif() +try_compile(CMAKE_ANSI_FOR_SCOPE + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) -IF (CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler supports ansi for") -ELSE(CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler does not support ansi for scope") -ENDIF(CMAKE_ANSI_FOR_SCOPE) - -TRY_COMPILE(CMAKE_ANSI_FOR_SCOPE - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +if (CMAKE_ANSI_FOR_SCOPE) + message("Compiler supports ansi for") +else() + message("Compiler does not support ansi for scope") +endif() + +try_compile(CMAKE_ANSI_FOR_SCOPE + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${CMAKE_ROOT}/Modules/TestForAnsiForScope.cxx OUTPUT_VARIABLE OUT) -IF (CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler supports ansi for") -ELSE(CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler does not support ansi for scope") -ENDIF(CMAKE_ANSI_FOR_SCOPE) - -MESSAGE("use the module now") -INCLUDE(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake) -IF (CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler supports ansi for") -ELSE(CMAKE_ANSI_FOR_SCOPE) - MESSAGE("Compiler does not support ansi for scope") -ENDIF(CMAKE_ANSI_FOR_SCOPE) - -MESSAGE("Testing try_compile project mode") -TRY_COMPILE(TEST_INNER +if (CMAKE_ANSI_FOR_SCOPE) + message("Compiler supports ansi for") +else() + message("Compiler does not support ansi for scope") +endif() + +message("use the module now") +include(${CMAKE_ROOT}/Modules/TestForANSIForScope.cmake) +if (CMAKE_ANSI_FOR_SCOPE) + message("Compiler supports ansi for") +else() + message("Compiler does not support ansi for scope") +endif() + +message("Testing try_compile project mode") +try_compile(TEST_INNER ${TryCompile_BINARY_DIR}/CMakeFiles/Inner ${TryCompile_SOURCE_DIR}/Inner TryCompileInner innerexe OUTPUT_VARIABLE output) TEST_ASSERT(TEST_INNER "try_compile project mode failed:\n${output}") -ADD_EXECUTABLE(TryCompile pass.c) +add_executable(TryCompile pass.c) ###################################### @@ -123,73 +123,73 @@ ADD_EXECUTABLE(TryCompile pass.c) # try to run a file that should compile and run without error # also check that OUTPUT_VARIABLE contains both the compile output # and the run output -TRY_RUN(SHOULD_RUN SHOULD_COMPILE - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_run(SHOULD_RUN SHOULD_COMPILE + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/exit_success.c OUTPUT_VARIABLE TRY_OUT) -IF(NOT SHOULD_COMPILE) - MESSAGE(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}") -ENDIF(NOT SHOULD_COMPILE) -IF(NOT "${SHOULD_RUN}" STREQUAL "0") - MESSAGE(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}") -ENDIF(NOT "${SHOULD_RUN}" STREQUAL "0") +if(NOT SHOULD_COMPILE) + message(SEND_ERROR "exit_success failed compiling: ${TRY_OUT}") +endif() +if(NOT "${SHOULD_RUN}" STREQUAL "0") + message(SEND_ERROR "exit_success failed running with exit code ${SHOULD_RUN}") +endif() # check the compile output for the filename -IF(NOT "${TRY_OUT}" MATCHES "exit_success") - MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"") -ENDIF(NOT "${TRY_OUT}" MATCHES "exit_success") +if(NOT "${TRY_OUT}" MATCHES "exit_success") + message(SEND_ERROR " TRY_OUT didn't contain \"exit_success\": \"${TRY_OUT}\"") +endif() # check the run output -IF(NOT "${TRY_OUT}" MATCHES "hello world") - MESSAGE(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") -ENDIF(NOT "${TRY_OUT}" MATCHES "hello world") +if(NOT "${TRY_OUT}" MATCHES "hello world") + message(SEND_ERROR " TRY_OUT didn't contain \"hello world\": \"${TRY_OUT}\"") +endif() -TRY_RUN(ARG_TEST_RUN ARG_TEST_COMPILE - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_run(ARG_TEST_RUN ARG_TEST_COMPILE + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/expect_arg.c OUTPUT_VARIABLE TRY_OUT ARGS arg1 arg2) -IF(NOT ARG_TEST_COMPILE) - MESSAGE(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") -ENDIF(NOT ARG_TEST_COMPILE) -IF(NOT "${ARG_TEST_RUN}" STREQUAL "0") - MESSAGE(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") -ENDIF(NOT "${ARG_TEST_RUN}" STREQUAL "0") +if(NOT ARG_TEST_COMPILE) + message(SEND_ERROR "expect_arg failed compiling: ${TRY_OUT}") +endif() +if(NOT "${ARG_TEST_RUN}" STREQUAL "0") + message(SEND_ERROR "expect_arg failed running with exit code ${ARG_TEST_RUN} ${TRY_OUT}") +endif() # try to run a file that should compile and run, but return an error -TRY_RUN(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE - ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp +try_run(SHOULD_EXIT_WITH_ERROR SHOULD_COMPILE + ${TryCompile_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp ${TryCompile_SOURCE_DIR}/exit_with_error.c COMPILE_OUTPUT_VARIABLE COMPILE_OUTPUT RUN_OUTPUT_VARIABLE RUN_OUTPUT) -IF(NOT SHOULD_COMPILE) - MESSAGE(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}") -ENDIF(NOT SHOULD_COMPILE) -IF("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") - MESSAGE(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}") -ENDIF("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") +if(NOT SHOULD_COMPILE) + message(STATUS " exit_with_error failed compiling: ${COMPILE_OUTPUT}") +endif() +if("${SHOULD_EXIT_WITH_ERROR}" STREQUAL "0") + message(SEND_ERROR " exit_with_error passed with exit code ${SHOULD_EXIT_WITH_ERROR}") +endif() # check the compile output, it should contain the filename -IF(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") - MESSAGE(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"") -ENDIF(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") +if(NOT "${COMPILE_OUTPUT}" MATCHES "exit_with_error") + message(SEND_ERROR " COMPILE_OUT didn't contain \"exit_with_error\": \"${COMPILE_OUTPUT}\"") +endif() #... but not the run time output -IF("${COMPILE_OUTPUT}" MATCHES "hello world") - MESSAGE(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"") -ENDIF("${COMPILE_OUTPUT}" MATCHES "hello world") +if("${COMPILE_OUTPUT}" MATCHES "hello world") + message(SEND_ERROR " COMPILE_OUT contains the run output: \"${COMPILE_OUTPUT}\"") +endif() # check the run output, it should stdout -IF(NOT "${RUN_OUTPUT}" MATCHES "hello world") - MESSAGE(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"") -ENDIF(NOT "${RUN_OUTPUT}" MATCHES "hello world") +if(NOT "${RUN_OUTPUT}" MATCHES "hello world") + message(SEND_ERROR " RUN_OUTPUT didn't contain \"hello world\": \"${RUN_OUTPUT}\"") +endif() ####################################################################### # # also test that the CHECK_C_SOURCE_COMPILES, CHECK_CXX_SOURCE_COMPILES # CHECK_C_SOURCE_RUNS and CHECK_CXX_SOURCE_RUNS macros work -INCLUDE(CheckCSourceCompiles) -INCLUDE(CheckCXXSourceCompiles) -INCLUDE(CheckCSourceRuns) -INCLUDE(CheckCXXSourceRuns) +include(CheckCSourceCompiles) +include(CheckCXXSourceCompiles) +include(CheckCSourceRuns) +include(CheckCXXSourceRuns) CHECK_C_SOURCE_COMPILES("I dont build" C_BUILD_SHOULD_FAIL) CHECK_C_SOURCE_COMPILES("int main() {return 0;}" C_BUILD_SHOULD_WORK) @@ -211,27 +211,27 @@ TEST_ASSERT(CXX_BUILD_SHOULD_WORK "CHECK_CXX_SOURCE_COMPILES() failed") TEST_FAIL(CXX_RUN_SHOULD_FAIL "CHECK_CXX_SOURCE_RUNS() succeeded, but should have failed") TEST_ASSERT(CXX_RUN_SHOULD_WORK "CHECK_CXX_SOURCE_RUNS() failed") -FOREACH(lang C CXX) - IF(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$") - SET(${lang}_DD --) - ENDIF() -ENDFOREACH() +foreach(lang C CXX) + if(NOT "${CMAKE_${lang}_COMPILER_ID}" MATCHES "^(PathScale)$") + set(${lang}_DD --) + endif() +endforeach() -UNSET(C_BOGUS_FLAG CACHE) -INCLUDE(CheckCCompilerFlag) +unset(C_BOGUS_FLAG CACHE) +include(CheckCCompilerFlag) CHECK_C_COMPILER_FLAG(${C_DD}-_this_is_not_a_flag_ C_BOGUS_FLAG) TEST_FAIL(C_BOGUS_FLAG "CHECK_C_COMPILER_FLAG() succeeded, but should have failed") -UNSET(CXX_BOGUS_FLAG CACHE) -INCLUDE(CheckCXXCompilerFlag) +unset(CXX_BOGUS_FLAG CACHE) +include(CheckCXXCompilerFlag) CHECK_CXX_COMPILER_FLAG(${CXX_DD}-_this_is_not_a_flag_ CXX_BOGUS_FLAG) TEST_FAIL(CXX_BOGUS_FLAG "CHECK_CXX_COMPILER_FLAG() succeeded, but should have failed") -IF("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") - UNSET(C_STRICT_PROTOTYPES CACHE) +if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") + unset(C_STRICT_PROTOTYPES CACHE) CHECK_C_COMPILER_FLAG("-Werror;-Wstrict-prototypes" C_STRICT_PROTOTYPES) TEST_ASSERT(C_STRICT_PROTOTYPES "CHECK_C_COMPILER_FLAG failed -Werror -Wstrict-prototypes") -ENDIF() +endif() ####################################################################### # diff --git a/Tests/TryCompile/expect_arg.c b/Tests/TryCompile/expect_arg.c index 7ca49aa43..f18e03f60 100644 --- a/Tests/TryCompile/expect_arg.c +++ b/Tests/TryCompile/expect_arg.c @@ -10,7 +10,7 @@ int main(int ac, char*av[]) } if(ac == 3) { - if(strcmp(av[1], "arg1") ==0 + if(strcmp(av[1], "arg1") ==0 && strcmp(av[2], "arg2") ==0) { printf("arg1 and arg2 present and accounted for!\n"); diff --git a/Tests/TryCompile/pass.c b/Tests/TryCompile/pass.c index 40bc5e2dd..43e8a7ee0 100644 --- a/Tests/TryCompile/pass.c +++ b/Tests/TryCompile/pass.c @@ -3,4 +3,4 @@ int main() return 0; } - + diff --git a/Tests/Tutorial/Step2/CMakeLists.txt b/Tests/Tutorial/Step2/CMakeLists.txt index c82b7df98..cf1d30ee2 100644 --- a/Tests/Tutorial/Step2/CMakeLists.txt +++ b/Tests/Tutorial/Step2/CMakeLists.txt @@ -24,7 +24,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) diff --git a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx index 76b8e2d9d..62523f69f 100644 --- a/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx +++ b/Tests/Tutorial/Step2/MathFunctions/mysqrt.cxx @@ -8,9 +8,9 @@ double mysqrt(double x) { return 0; } - + double result; - double delta; + double delta; result = x; // do ten iterations diff --git a/Tests/Tutorial/Step3/CMakeLists.txt b/Tests/Tutorial/Step3/CMakeLists.txt index 0b05fd737..762302bc5 100644 --- a/Tests/Tutorial/Step3/CMakeLists.txt +++ b/Tests/Tutorial/Step3/CMakeLists.txt @@ -24,7 +24,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -32,7 +32,7 @@ target_link_libraries (Tutorial ${EXTRA_LIBS}) # add the install targets install (TARGETS Tutorial DESTINATION bin) -install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" +install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" DESTINATION include) @@ -44,7 +44,7 @@ add_test (TutorialRuns Tutorial 25) # does it sqrt of 25 add_test (TutorialComp25 Tutorial 25) -set_tests_properties (TutorialComp25 +set_tests_properties (TutorialComp25 PROPERTIES PASS_REGULAR_EXPRESSION "25 is 5" ) @@ -63,6 +63,6 @@ set_tests_properties (TutorialSmall # does the usage message work? add_test (TutorialUsage Tutorial) set_tests_properties (TutorialUsage - PROPERTIES + PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number" ) diff --git a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx index 76b8e2d9d..62523f69f 100644 --- a/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx +++ b/Tests/Tutorial/Step3/MathFunctions/mysqrt.cxx @@ -8,9 +8,9 @@ double mysqrt(double x) { return 0; } - + double result; - double delta; + double delta; result = x; // do ten iterations diff --git a/Tests/Tutorial/Step4/CMakeLists.txt b/Tests/Tutorial/Step4/CMakeLists.txt index 3b24b4416..6994aa1ce 100644 --- a/Tests/Tutorial/Step4/CMakeLists.txt +++ b/Tests/Tutorial/Step4/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -37,7 +37,7 @@ target_link_libraries (Tutorial ${EXTRA_LIBS}) # add the install targets install (TARGETS Tutorial DESTINATION bin) -install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" +install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" DESTINATION include) # enable testing @@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25) # does the usage message work? add_test (TutorialUsage Tutorial) set_tests_properties (TutorialUsage - PROPERTIES + PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number" ) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (25 "25 is 5") diff --git a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx index 0cf7db480..d081d11d2 100644 --- a/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx +++ b/Tests/Tutorial/Step4/MathFunctions/mysqrt.cxx @@ -11,7 +11,7 @@ double mysqrt(double x) { return 0; } - + double result; // if we have both log and exp then use them @@ -19,7 +19,7 @@ double mysqrt(double x) result = exp(log(x)*0.5); fprintf(stdout,"Computing sqrt of %g to be %g using log\n",x,result); #else - double delta; + double delta; result = x; // do ten iterations diff --git a/Tests/Tutorial/Step5/CMakeLists.txt b/Tests/Tutorial/Step5/CMakeLists.txt index 3002ea084..e40b676b4 100644 --- a/Tests/Tutorial/Step5/CMakeLists.txt +++ b/Tests/Tutorial/Step5/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -37,7 +37,7 @@ target_link_libraries (Tutorial ${EXTRA_LIBS}) # add the install targets install (TARGETS Tutorial DESTINATION bin) -install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" +install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" DESTINATION include) # enable testing @@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25) # does the usage message work? add_test (TutorialUsage Tutorial) set_tests_properties (TutorialUsage - PROPERTIES + PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number" ) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx index 540254271..ef98d5fdc 100644 --- a/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx +++ b/Tests/Tutorial/Step5/MathFunctions/MakeTable.cxx @@ -1,4 +1,4 @@ -// A simple program that builds a sqrt table +// A simple program that builds a sqrt table #include <stdio.h> #include <math.h> @@ -12,14 +12,14 @@ int main (int argc, char *argv[]) { return 1; } - + // open the output file FILE *fout = fopen(argv[1],"w"); if (!fout) { return 1; } - + // create a source file with a table of square roots fprintf(fout,"double sqrtTable[] = {\n"); for (i = 0; i < 10; ++i) diff --git a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx index 33659b740..1f9b88719 100644 --- a/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx +++ b/Tests/Tutorial/Step5/MathFunctions/mysqrt.cxx @@ -14,11 +14,11 @@ double mysqrt(double x) { return 0; } - + double result; // if we have both log and exp then use them - double delta; + double delta; // use the table to help find an initial value result = x; diff --git a/Tests/Tutorial/Step6/CMakeLists.txt b/Tests/Tutorial/Step6/CMakeLists.txt index 4f70f4fc4..0fb7cac5f 100644 --- a/Tests/Tutorial/Step6/CMakeLists.txt +++ b/Tests/Tutorial/Step6/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -37,7 +37,7 @@ target_link_libraries (Tutorial ${EXTRA_LIBS}) # add the install targets install (TARGETS Tutorial DESTINATION bin) -install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" +install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" DESTINATION include) # enable testing @@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25) # does the usage message work? add_test (TutorialUsage Tutorial) set_tests_properties (TutorialUsage - PROPERTIES + PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number" ) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt index d606ac03e..9961e6945 100644 --- a/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt +++ b/Tests/Tutorial/Step6/MathFunctions/CMakeLists.txt @@ -12,7 +12,7 @@ add_custom_command ( ) set_source_files_properties ( - mysqrt.cxx PROPERTIES + mysqrt.cxx PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h ) diff --git a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx index 540254271..ef98d5fdc 100644 --- a/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx +++ b/Tests/Tutorial/Step6/MathFunctions/MakeTable.cxx @@ -1,4 +1,4 @@ -// A simple program that builds a sqrt table +// A simple program that builds a sqrt table #include <stdio.h> #include <math.h> @@ -12,14 +12,14 @@ int main (int argc, char *argv[]) { return 1; } - + // open the output file FILE *fout = fopen(argv[1],"w"); if (!fout) { return 1; } - + // create a source file with a table of square roots fprintf(fout,"double sqrtTable[] = {\n"); for (i = 0; i < 10; ++i) diff --git a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx index 33659b740..1f9b88719 100644 --- a/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx +++ b/Tests/Tutorial/Step6/MathFunctions/mysqrt.cxx @@ -14,11 +14,11 @@ double mysqrt(double x) { return 0; } - + double result; // if we have both log and exp then use them - double delta; + double delta; // use the table to help find an initial value result = x; diff --git a/Tests/Tutorial/Step7/CMakeLists.txt b/Tests/Tutorial/Step7/CMakeLists.txt index 42f73f221..d9a92fbef 100644 --- a/Tests/Tutorial/Step7/CMakeLists.txt +++ b/Tests/Tutorial/Step7/CMakeLists.txt @@ -29,7 +29,7 @@ if (USE_MYMATH) include_directories ("${PROJECT_SOURCE_DIR}/MathFunctions") add_subdirectory (MathFunctions) set (EXTRA_LIBS ${EXTRA_LIBS} MathFunctions) -endif (USE_MYMATH) +endif () # add the executable add_executable (Tutorial tutorial.cxx) @@ -37,7 +37,7 @@ target_link_libraries (Tutorial ${EXTRA_LIBS}) # add the install targets install (TARGETS Tutorial DESTINATION bin) -install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" +install (FILES "${PROJECT_BINARY_DIR}/TutorialConfig.h" DESTINATION include) # enable testing @@ -49,7 +49,7 @@ add_test (TutorialRuns Tutorial 25) # does the usage message work? add_test (TutorialUsage Tutorial) set_tests_properties (TutorialUsage - PROPERTIES + PROPERTIES PASS_REGULAR_EXPRESSION "Usage:.*number" ) @@ -59,7 +59,7 @@ macro (do_test arg result) set_tests_properties (TutorialComp${arg} PROPERTIES PASS_REGULAR_EXPRESSION ${result} ) -endmacro (do_test) +endmacro () # do a bunch of result based tests do_test (4 "4 is 2") diff --git a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt index d606ac03e..9961e6945 100644 --- a/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt +++ b/Tests/Tutorial/Step7/MathFunctions/CMakeLists.txt @@ -12,7 +12,7 @@ add_custom_command ( ) set_source_files_properties ( - mysqrt.cxx PROPERTIES + mysqrt.cxx PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Table.h ) diff --git a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx index 540254271..ef98d5fdc 100644 --- a/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx +++ b/Tests/Tutorial/Step7/MathFunctions/MakeTable.cxx @@ -1,4 +1,4 @@ -// A simple program that builds a sqrt table +// A simple program that builds a sqrt table #include <stdio.h> #include <math.h> @@ -12,14 +12,14 @@ int main (int argc, char *argv[]) { return 1; } - + // open the output file FILE *fout = fopen(argv[1],"w"); if (!fout) { return 1; } - + // create a source file with a table of square roots fprintf(fout,"double sqrtTable[] = {\n"); for (i = 0; i < 10; ++i) diff --git a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx index 33659b740..1f9b88719 100644 --- a/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx +++ b/Tests/Tutorial/Step7/MathFunctions/mysqrt.cxx @@ -14,11 +14,11 @@ double mysqrt(double x) { return 0; } - + double result; // if we have both log and exp then use them - double delta; + double delta; // use the table to help find an initial value result = x; diff --git a/Tests/Tutorial/Step7/build1.cmake b/Tests/Tutorial/Step7/build1.cmake index 039d5569b..baa475f28 100644 --- a/Tests/Tutorial/Step7/build1.cmake +++ b/Tests/Tutorial/Step7/build1.cmake @@ -1,5 +1,5 @@ -SET(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") -SET(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1") +set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") +set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build1") -SET(CTEST_CMAKE_COMMAND "cmake") -SET(CTEST_COMMAND "ctest -D Experimental") +set(CTEST_CMAKE_COMMAND "cmake") +set(CTEST_COMMAND "ctest -D Experimental") diff --git a/Tests/Tutorial/Step7/build2.cmake b/Tests/Tutorial/Step7/build2.cmake index 5112355b2..c2f2e2e10 100644 --- a/Tests/Tutorial/Step7/build2.cmake +++ b/Tests/Tutorial/Step7/build2.cmake @@ -1,6 +1,6 @@ -SET(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") -SET(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build2") -SET(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005") +set(CTEST_SOURCE_DIRECTORY "$ENV{HOME}/Dashboards/My Tests/CMake/Tests/Tutorial/Step7") +set(CTEST_BINARY_DIRECTORY "${CTEST_SOURCE_DIRECTORY}-build2") +set(CTEST_CMAKE_GENERATOR "Visual Studio 8 2005") CTEST_START("Experimental") CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}") diff --git a/Tests/Unset/CMakeLists.txt b/Tests/Unset/CMakeLists.txt index bacb6d21f..781da3fa6 100644 --- a/Tests/Unset/CMakeLists.txt +++ b/Tests/Unset/CMakeLists.txt @@ -5,51 +5,51 @@ project(Unset C) set(x 42) if(NOT x EQUAL 42) message(FATAL_ERROR "x!=42") -endif(NOT x EQUAL 42) +endif() if(NOT DEFINED x) message(FATAL_ERROR "x should be defined!") -endif(NOT DEFINED x) +endif() unset(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") -endif(DEFINED x) +endif() # Local variable test unset via set() set(x 43) if(NOT x EQUAL 43) message(FATAL_ERROR "x!=43") -endif(NOT x EQUAL 43) +endif() set(x) if(DEFINED x) message(FATAL_ERROR "x should be undefined now!") -endif(DEFINED x) +endif() # Cache variable set(BAR "test" CACHE STRING "documentation") if(NOT DEFINED BAR) message(FATAL_ERROR "BAR not defined") -endif(NOT DEFINED BAR) +endif() # Test interaction of cache entries with variables. set(BAR "test-var") if(NOT "$CACHE{BAR}" STREQUAL "test") message(FATAL_ERROR "\$CACHE{BAR} changed by variable BAR") -endif(NOT "$CACHE{BAR}" STREQUAL "test") +endif() if(NOT "${BAR}" STREQUAL "test-var") message(FATAL_ERROR "\${BAR} not separate from \$CACHE{BAR}") -endif(NOT "${BAR}" STREQUAL "test-var") +endif() unset(BAR) if(NOT "${BAR}" STREQUAL "test") message(FATAL_ERROR "\${BAR} does not fall through to \$CACHE{BAR}") -endif(NOT "${BAR}" STREQUAL "test") +endif() # Test unsetting of CACHE entry. unset(BAR CACHE) if(DEFINED BAR) message(FATAL_ERROR "BAR still defined") -endif(DEFINED BAR) +endif() add_executable(Unset unset.c) diff --git a/Tests/VSExternalInclude/CMakeLists.txt b/Tests/VSExternalInclude/CMakeLists.txt index a2fd61973..399ac6997 100644 --- a/Tests/VSExternalInclude/CMakeLists.txt +++ b/Tests/VSExternalInclude/CMakeLists.txt @@ -1,54 +1,54 @@ cmake_minimum_required (VERSION 2.6) -PROJECT(VSExternalInclude) +project(VSExternalInclude) -IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") - SET(PROJECT_EXT dsp) -ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") - SET(PROJECT_EXT vcproj) -ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") -IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") - SET(PROJECT_EXT vcxproj) -ENDIF() +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") + set(PROJECT_EXT dsp) +else() + set(PROJECT_EXT vcproj) +endif() +if(${CMAKE_GENERATOR} MATCHES "Visual Studio 1[01]") + set(PROJECT_EXT vcxproj) +endif() # make sure directories exists -SET(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1) -MAKE_DIRECTORY("${LIB1_BINARY_DIR}") +set(LIB1_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib1) +make_directory("${LIB1_BINARY_DIR}") -SET(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2) -MAKE_DIRECTORY("${LIB2_BINARY_DIR}") +set(LIB2_BINARY_DIR ${VSExternalInclude_BINARY_DIR}/Lib2) +make_directory("${LIB2_BINARY_DIR}") # generate lib1 -EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" +exec_program("${CMAKE_COMMAND}" "${LIB1_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" \"${VSExternalInclude_SOURCE_DIR}/Lib1\" OUTPUT_VARIABLE OUT) -MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"") +message("CMAKE Ran with the following output:\n\"${OUT}\"") # generate lib2 -EXEC_PROGRAM("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" +exec_program("${CMAKE_COMMAND}" "${LIB2_BINARY_DIR}" ARGS -G\"${CMAKE_GENERATOR}\" \"${VSExternalInclude_SOURCE_DIR}/Lib2\" OUTPUT_VARIABLE OUT) -MESSAGE("CMAKE Ran with the following output:\n\"${OUT}\"") +message("CMAKE Ran with the following output:\n\"${OUT}\"") -INCLUDE_EXTERNAL_MSPROJECT(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT}) +include_external_msproject(lib1 ${VSExternalInclude_BINARY_DIR}/Lib1/LIB1.${PROJECT_EXT}) # lib2 depends on lib1 -INCLUDE_EXTERNAL_MSPROJECT(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1) +include_external_msproject(lib2 ${VSExternalInclude_BINARY_DIR}/Lib2/LIB2.${PROJECT_EXT} lib1) -INCLUDE_DIRECTORIES(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1) +include_directories(${VSExternalInclude_SOURCE_DIR}/Lib2 ${VSExternalInclude_SOURCE_DIR}/Lib1) -SET(SOURCES main.cpp) +set(SOURCES main.cpp) -ADD_EXECUTABLE(VSExternalInclude ${SOURCES}) +add_executable(VSExternalInclude ${SOURCES}) # target depends on lib2 -ADD_DEPENDENCIES(VSExternalInclude lib2) +add_dependencies(VSExternalInclude lib2) # VS 10 vcxproj files have depends in them # Since lib1 and lib2 do not depend on each other # then the vcxproj files do not depend on each other # and the sln file can no longer be the only source # of that depend. So, for VS 10 make the executable # depend on lib1 and lib2 -IF(MSVC10 OR MSVC11) - ADD_DEPENDENCIES(VSExternalInclude lib1) -ENDIF() +if(MSVC10 OR MSVC11) + add_dependencies(VSExternalInclude lib1) +endif() # Interaction testing between the FOLDER target property and # INCLUDE_EXTERNAL_MSPROJECT targets: diff --git a/Tests/VSExternalInclude/Lib1/CMakeLists.txt b/Tests/VSExternalInclude/Lib1/CMakeLists.txt index 72ffcedc1..1cb01c5dd 100644 --- a/Tests/VSExternalInclude/Lib1/CMakeLists.txt +++ b/Tests/VSExternalInclude/Lib1/CMakeLists.txt @@ -1,5 +1,5 @@ -PROJECT(LIB1) +project(LIB1) -SET(SOURCES lib1.cpp) +set(SOURCES lib1.cpp) -ADD_LIBRARY(lib1 ${SOURCES}) +add_library(lib1 ${SOURCES}) diff --git a/Tests/VSExternalInclude/Lib2/CMakeLists.txt b/Tests/VSExternalInclude/Lib2/CMakeLists.txt index 31e40e4e1..f726c3f8b 100644 --- a/Tests/VSExternalInclude/Lib2/CMakeLists.txt +++ b/Tests/VSExternalInclude/Lib2/CMakeLists.txt @@ -1,7 +1,7 @@ -PROJECT(VSEXTERNAL_LIB2) +project(VSEXTERNAL_LIB2) -INCLUDE_DIRECTORIES(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1) +include_directories(${VSEXTERNAL_LIB2_SOURCE_DIR}/../Lib1) -SET(SOURCES lib2.cpp) +set(SOURCES lib2.cpp) -ADD_LIBRARY(lib2 ${SOURCES}) +add_library(lib2 ${SOURCES}) diff --git a/Tests/Wrapping/CMakeLists.txt b/Tests/Wrapping/CMakeLists.txt index c84dedc47..58e9c3242 100644 --- a/Tests/Wrapping/CMakeLists.txt +++ b/Tests/Wrapping/CMakeLists.txt @@ -2,82 +2,82 @@ # Wrapping # cmake_minimum_required (VERSION 2.6) -PROJECT (Wrapping) +project (Wrapping) # Disable cleaning of custom command outputs to preserve the hacks # used to generate the files using CONFIGURE_FILE. -SET_DIRECTORY_PROPERTIES(PROPERTIES CLEAN_NO_CUSTOM 1) +set_directory_properties(PROPERTIES CLEAN_NO_CUSTOM 1) # # Lib and exe path # -SET (LIBRARY_OUTPUT_PATH - ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL +set (LIBRARY_OUTPUT_PATH + ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH - ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL +set (EXECUTABLE_OUTPUT_PATH + ${Wrapping_BINARY_DIR}/bin/ CACHE INTERNAL "Single output directory for building all executables.") # # Where will executable tests be written ? # -IF (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) -ELSE (EXECUTABLE_OUTPUT_PATH) - SET (CXX_TEST_PATH .) -ENDIF (EXECUTABLE_OUTPUT_PATH) +if (EXECUTABLE_OUTPUT_PATH) + set (CXX_TEST_PATH ${EXECUTABLE_OUTPUT_PATH}) +else () + set (CXX_TEST_PATH .) +endif () # # Add exe # -ADD_EXECUTABLE (wrapping wrapping.cxx) +add_executable (wrapping wrapping.cxx) -ADD_EXECUTABLE (Wrap Wrap.c) -IF(WIN32) - SET(EXE_EXT ".exe") -ENDIF(WIN32) -SET(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT}) +add_executable (Wrap Wrap.c) +if(WIN32) + set(EXE_EXT ".exe") +endif() +set(WRAP ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Wrap${EXE_EXT}) # -# QT Wrappers +# Qt Wrappers # -SET (QT_WRAP_CPP "On") -SET (QT_MOC_EXE "echo") -INCLUDE( FindQt3 ) +set (QT_WRAP_CPP "On") +set (QT_MOC_EXE "echo") +include( FindQt3 ) -IF (QT_FOUND AND QT_WRAP_UI) - message("found qt 3 test it...") - INCLUDE_DIRECTORIES( ${QT_INCLUDE_DIR} ) - INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} ) +if (QT_FOUND AND QT_WRAP_UI) + message("found Qt 3 test it...") + include_directories( ${QT_INCLUDE_DIR} ) + include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) - CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/foo.ui.in ${CMAKE_CURRENT_BINARY_DIR}/foo.ui IMMEDIATE) - SET (QT_WRAP_UI "On") - SET (QT_UIC_EXE "${QT_UIC_EXECUTABLE}") + set (QT_WRAP_UI "On") + set (QT_UIC_EXE "${QT_UIC_EXECUTABLE}") - SET (QTUI_SRCS + set (QTUI_SRCS qtwrapping.ui ${CMAKE_CURRENT_BINARY_DIR}/foo.ui ) - QT_WRAP_UI (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS}) - QT_WRAP_CPP (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h) + qt_wrap_ui (myqtlib QTUI_H_SRCS QTUI_S_SRCS ${QTUI_SRCS}) + qt_wrap_cpp (myqtlib QT_MOC_SRCS ${SRCS} vtkTestMoc.h) - MESSAGE("QT files are ${QTUI_S_SRCS}") - MESSAGE("QT other files are ${QTUI_H_SRCS}") - ADD_DEFINITIONS(${QT_DEFINITIONS}) - ADD_LIBRARY(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS}) - ADD_EXECUTABLE (qtwrapping qtwrappingmain.cxx) - TARGET_LINK_LIBRARIES(qtwrapping myqtlib) + message("Qt files are ${QTUI_S_SRCS}") + message("Qt other files are ${QTUI_H_SRCS}") + add_definitions(${QT_DEFINITIONS}) + add_library(myqtlib ${QTUI_S_SRCS} ${QT_MOC_SRCS}) + add_executable (qtwrapping qtwrappingmain.cxx) + target_link_libraries(qtwrapping myqtlib) - TARGET_LINK_LIBRARIES( qtwrapping ${QT_LIBRARIES} ) -ELSE (QT_FOUND AND QT_WRAP_UI) - ADD_EXECUTABLE (qtwrapping qtnoqtmain.cxx) -ENDIF (QT_FOUND AND QT_WRAP_UI) + target_link_libraries( qtwrapping ${QT_LIBRARIES} ) +else () + add_executable (qtwrapping qtnoqtmain.cxx) +endif () # # FLTK Wrappers @@ -85,23 +85,23 @@ ENDIF (QT_FOUND AND QT_WRAP_UI) # Since FLTK_FLUID_EXE is supposed to create a .cxx/.h from a .fl/.fld, # create an empty one so that the dependencies can be met. # -SET (FLTK_SRCS +set (FLTK_SRCS fltk1.fl ) -ADD_EXECUTABLE(fakefluid fakefluid.cxx) -GET_TARGET_PROPERTY(FLUID_LOC fakefluid LOCATION) -SET (FLTK_WRAP_UI "On") -SET (FLTK_FLUID_EXECUTABLE "${FLUID_LOC}") -FLTK_WRAP_UI (wraplibFLTK ${FLTK_SRCS}) -ADD_LIBRARY(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS}) -ADD_DEPENDENCIES(wraplibFLTK fakefluid) -ADD_DEPENDENCIES(fakefluid Wrap) +add_executable(fakefluid fakefluid.cxx) +get_target_property(FLUID_LOC fakefluid LOCATION) +set (FLTK_WRAP_UI "On") +set (FLTK_FLUID_EXECUTABLE "${FLUID_LOC}") +fltk_wrap_ui (wraplibFLTK ${FLTK_SRCS}) +add_library(wraplibFLTK ${wraplibFLTK_FLTK_UI_SRCS}) +add_dependencies(wraplibFLTK fakefluid) +add_dependencies(fakefluid Wrap) # # Mangled Mesa # -CONFIGURE_FILE( +configure_file( ${Wrapping_SOURCE_DIR}/dummy ${Wrapping_BINARY_DIR}/gl.h COPYONLY IMMEDIATE) -USE_MANGLED_MESA (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa) +use_mangled_mesa (${Wrapping_BINARY_DIR} ${Wrapping_BINARY_DIR}/mangled_mesa) diff --git a/Tests/Wrapping/qtnoqtmain.cxx b/Tests/Wrapping/qtnoqtmain.cxx index 8b7334a18..92594d52e 100644 --- a/Tests/Wrapping/qtnoqtmain.cxx +++ b/Tests/Wrapping/qtnoqtmain.cxx @@ -2,4 +2,4 @@ int main(int ac, char** av) { return 0; } - + diff --git a/Tests/X11/CMakeLists.txt b/Tests/X11/CMakeLists.txt index 03aa09578..76ae58c74 100644 --- a/Tests/X11/CMakeLists.txt +++ b/Tests/X11/CMakeLists.txt @@ -1,40 +1,40 @@ # a simple C only test case cmake_minimum_required (VERSION 2.6) -PROJECT (UseX11 CXX C) +project (UseX11 CXX C) -INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake) -MESSAGE("X11_FOUND: ${X11_FOUND}") +include (${CMAKE_ROOT}/Modules/FindX11.cmake) +message("X11_FOUND: ${X11_FOUND}") -ADD_EXECUTABLE (UseX11 X11.c) +add_executable (UseX11 X11.c) install(TARGETS UseX11 DESTINATION bin) -# so for universal binaries this test will fail if -# -IF(APPLE) - LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH) - IF(NUMARCH GREATER 1) - IF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) - SET(X11_FOUND FALSE) - MESSAGE("disable X11, because of universal binary and sysroot") - ENDIF(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) - ENDIF(NUMARCH GREATER 1) -ENDIF(APPLE) +# so for universal binaries this test will fail if +# +if(APPLE) + list(LENGTH CMAKE_OSX_ARCHITECTURES NUMARCH) + if(NUMARCH GREATER 1) + if(NOT EXISTS /usr/X11R6/lib//libSM.6.dylib) + set(X11_FOUND FALSE) + message("disable X11, because of universal binary and sysroot") + endif() + endif() +endif() -IF(X11_FOUND) - ADD_DEFINITIONS(-DCMAKE_HAS_X) - INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR}) - TARGET_LINK_LIBRARIES(UseX11 ${X11_LIBRARIES}) - IF(APPLE) - ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx) - TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES}) +if(X11_FOUND) + add_definitions(-DCMAKE_HAS_X) + include_directories(${X11_INCLUDE_DIR}) + target_link_libraries(UseX11 ${X11_LIBRARIES}) + if(APPLE) + add_executable(HelloWorldX11 HelloWorldX11.cxx) + target_link_libraries(HelloWorldX11 ${X11_LIBRARIES}) install(TARGETS HelloWorldX11 DESTINATION bin) set(CPACK_BINARY_OSXX11 ON CACHE BOOL "" FORCE) set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE ) set(CPACK_PACKAGE_NAME HelloWorldX11Package) set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11) - ENDIF(APPLE) -ENDIF(X11_FOUND) + endif() +endif() # build a CPack driven installer package include(CPack) diff --git a/Tests/X11/HelloWorldX11.cxx b/Tests/X11/HelloWorldX11.cxx index e3c9dd9cf..f2b8bdd47 100644 --- a/Tests/X11/HelloWorldX11.cxx +++ b/Tests/X11/HelloWorldX11.cxx @@ -9,7 +9,7 @@ * Copyright (c) 2004 __MyCompanyName__. All rights reserved. * */ - + #ifndef MAIN_H #define MAIN_H 1 @@ -28,10 +28,10 @@ public: // constructor Main(int argc, char * const argv[]); //virtual ~Main(); - + private: - + /* here are our X variables */ Display *dis; @@ -53,7 +53,7 @@ private: /*** START MAIN.CPP ***/ -// modified from Brian Hammond's Howdy program at +// modified from Brian Hammond's Howdy program at // http://www.insanityengine.com/doc/x11/xintro.html // jeff louie 02.05.2004 @@ -73,11 +73,11 @@ Main::Main (int argc, char * const argv[]) { init_x(); // event loop - while(1) { + while(1) { // get the next event and stuff it into our event variable. // Note: only events we set the mask for are detected! XNextEvent(dis, &event); - + switch (event.type) { int x; @@ -115,19 +115,19 @@ Main::Main (int argc, char * const argv[]) { } } -void Main::init_x() { +void Main::init_x() { unsigned long black,white; dis=XOpenDisplay(NULL); screen=DefaultScreen(dis); black=BlackPixel(dis,screen), white=WhitePixel(dis, screen); - win=XCreateSimpleWindow(dis,DefaultRootWindow(dis),0,0, + win=XCreateSimpleWindow(dis,DefaultRootWindow(dis),0,0, 300, 300, 5,black, white); XSetStandardProperties(dis,win,"Hello World","Hi",None,NULL,0,NULL); XSelectInput(dis, win, ExposureMask|ButtonPressMask|KeyPressMask); // get Graphics Context - gc=XCreateGC(dis, win, 0,0); + gc=XCreateGC(dis, win, 0,0); XSetBackground(dis,gc,white); XSetForeground(dis,gc,black); XClearWindow(dis, win); @@ -137,8 +137,8 @@ void Main::init_x() { void Main::close_x() { XFreeGC(dis, gc); XDestroyWindow(dis,win); - XCloseDisplay(dis); - exit(1); + XCloseDisplay(dis); + exit(1); }; void Main::redraw() { diff --git a/Tests/test_clean.cmake.in b/Tests/test_clean.cmake.in index ce5e62b79..d700749ca 100644 --- a/Tests/test_clean.cmake.in +++ b/Tests/test_clean.cmake.in @@ -1,2 +1,2 @@ -SET(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@") -FILE(REMOVE_RECURSE ${TEST_BUILD_DIRS}) +set(TEST_BUILD_DIRS "@TEST_BUILD_DIRS@") +file(REMOVE_RECURSE ${TEST_BUILD_DIRS}) |