diff options
author | Brad King <brad.king@kitware.com> | 2010-12-17 15:32:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2010-12-17 15:32:01 (GMT) |
commit | ad25a968b9e47e9e966d166dd0e494dc684ebd66 (patch) | |
tree | 5638f53977907708fd7473f5b3c9a582a36a1a92 /Tests | |
parent | c128abe383e2f08e3f3e916f9b64356ca47056d1 (diff) | |
parent | 78c86f454272a2ac417ad6a89e4c7ed7e4975adb (diff) | |
download | CMake-ad25a968b9e47e9e966d166dd0e494dc684ebd66.zip CMake-ad25a968b9e47e9e966d166dd0e494dc684ebd66.tar.gz CMake-ad25a968b9e47e9e966d166dd0e494dc684ebd66.tar.bz2 |
Merge branch 'ImprovedDotSupport2' into dev/strict-mode
Conflicts:
Source/cmake.cxx
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeLists.txt | 15 | ||||
-rw-r--r-- | Tests/CMakeTests/GetPrerequisitesTest.cmake.in | 22 | ||||
-rw-r--r-- | Tests/CheckCompilerRelatedVariables/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/EmptyLibrary/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/EmptyLibrary/subdir/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/EmptyLibrary/subdir/test.h | 1 | ||||
-rw-r--r-- | Tests/ExternalProject/CMakeLists.txt | 16 |
7 files changed, 55 insertions, 7 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5471052..02d393b 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -153,6 +153,9 @@ IF(BUILD_TESTING) ADD_TEST_MACRO(ExportImport ExportImport) ADD_TEST_MACRO(Unset Unset) ADD_TEST_MACRO(PolicyScope PolicyScope) + ADD_TEST_MACRO(EmptyLibrary EmptyLibrary) + 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 PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode") @@ -1718,7 +1721,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF() ENDIF() - IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode") + if(NOT DEFINED CTEST_RUN_Java) + if(APPLE) + set(CTEST_RUN_Java OFF) + else() + set(CTEST_RUN_Java ON) + endif() + endif() + + IF(CTEST_RUN_Java) find_package(Java QUIET) IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW) GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH) @@ -1742,7 +1753,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ ENDIF("${JNI_FILE}" MATCHES "JDK1_2") ENDIF(JNI_H) ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW) - ENDIF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode") + ENDIF(CTEST_RUN_Java) # add some cross compiler tests, for now only with makefile based generators IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop") diff --git a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in index e8bfb47..daf467b 100644 --- a/Tests/CMakeTests/GetPrerequisitesTest.cmake.in +++ b/Tests/CMakeTests/GetPrerequisitesTest.cmake.in @@ -77,6 +77,11 @@ message(STATUS "") list_prerequisites("${CMAKE_COMMAND}" 0 0 1) message(STATUS "") +message(STATUS "=============================================================================") +string(LENGTH "$ENV{PATH}" PATH_LENGTH_BEGIN) +message(STATUS "Begin PATH length is: ${PATH_LENGTH_BEGIN}") +message(STATUS "") + # Leave the code for these tests in here, but turn them off by default... they # take longer than they're worth during development... @@ -116,11 +121,11 @@ message(STATUS "") message(STATUS "=============================================================================") message(STATUS "Test overriding 'gp_tool' with value unlikely to be found") message(STATUS "") -if(WIN32 OR APPLE) - set(gp_tool "ldd") -else(WIN32 OR APPLE) +if(APPLE) + set(gp_tool "dumpbin") +else() set(gp_tool "otool") -endif(WIN32 OR APPLE) +endif() set(gp_cmd "gp_cmd-NOTFOUND") list_prerequisites("${CMAKE_COMMAND}" 0 0 0) set(gp_cmd) @@ -139,6 +144,15 @@ foreach(v ${vs}) endforeach(v) message(STATUS "") +message(STATUS "=============================================================================") +string(LENGTH "$ENV{PATH}" PATH_LENGTH_END) +message(STATUS "Final PATH length is: ${PATH_LENGTH_END}") + +if(PATH_LENGTH_END GREATER ${PATH_LENGTH_BEGIN}) + message(FATAL_ERROR "list_prerequisties is endlessly appending the path of gp_tool to the PATH.") +endif() +message(STATUS "") + message(STATUS "=============================================================================") message(STATUS "End of test") diff --git a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt index 7206f1d..8095a1c 100644 --- a/Tests/CheckCompilerRelatedVariables/CMakeLists.txt +++ b/Tests/CheckCompilerRelatedVariables/CMakeLists.txt @@ -76,7 +76,8 @@ endif() file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/main.cxx" - "int main() { return 0; }" + "int main() { return 0; } +" ) add_executable( diff --git a/Tests/EmptyLibrary/CMakeLists.txt b/Tests/EmptyLibrary/CMakeLists.txt new file mode 100644 index 0000000..baddbbf --- /dev/null +++ b/Tests/EmptyLibrary/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 2.6) +project(TestEmptyLibrary) + +add_subdirectory(subdir) diff --git a/Tests/EmptyLibrary/subdir/CMakeLists.txt b/Tests/EmptyLibrary/subdir/CMakeLists.txt new file mode 100644 index 0000000..e273f8d --- /dev/null +++ b/Tests/EmptyLibrary/subdir/CMakeLists.txt @@ -0,0 +1 @@ +add_library(test test.h) diff --git a/Tests/EmptyLibrary/subdir/test.h b/Tests/EmptyLibrary/subdir/test.h new file mode 100644 index 0000000..8511f53 --- /dev/null +++ b/Tests/EmptyLibrary/subdir/test.h @@ -0,0 +1 @@ +extern int dummy; diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index bf90a52..a878194 100644 --- a/Tests/ExternalProject/CMakeLists.txt +++ b/Tests/ExternalProject/CMakeLists.txt @@ -7,6 +7,13 @@ find_package(CVS) find_package(Subversion) find_package(Git) +option(ExternalProjectTest_USE_FOLDERS "Enable folder grouping in IDEs." ON) +if(ExternalProjectTest_USE_FOLDERS) + set_property(GLOBAL PROPERTY USE_FOLDERS ON) +else() + set_property(GLOBAL PROPERTY USE_FOLDERS OFF) +endif() + set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakePredefinedTargets-in-ExternalProjectTest") @@ -61,6 +68,15 @@ ExternalProject_Add(${proj} INSTALL_COMMAND "" ) +set(proj TargetNameSameAsFolder) +ExternalProject_Add(${proj} + BUILD_COMMAND "" + CONFIGURE_COMMAND "" + DOWNLOAD_COMMAND "" + INSTALL_COMMAND "" +) +set_property(TARGET ${proj} PROPERTY FOLDER "${proj}") + set(proj MinimalNoOpProject) ExternalProject_Add(${proj} BUILD_COMMAND "" |