diff options
Diffstat (limited to 'Tests/CMakeOnly')
-rw-r--r-- | Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 42 | ||||
-rw-r--r-- | Tests/CMakeOnly/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CMakeOnly/ProjectInclude/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CMakeOnly/ProjectInclude/include.cmake | 1 | ||||
-rw-r--r-- | Tests/CMakeOnly/Test.cmake.in | 3 |
5 files changed, 37 insertions, 19 deletions
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 9257fcc..22b1b7b 100644 --- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt +++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt @@ -45,25 +45,31 @@ if (NOT QT4_FOUND) endforeach(FIND_MODULE) endif (NOT QT4_FOUND) -# If any of these modules reported that it was found a version number should have been -# reported. -set(VERSIONS_REQUIRED - ALSA BISON BZIP2 CUPS CURL DOXYGEN EXPAT FLEX FREETYPE GETTEXT GIF GIT - ImageMagick JASPER LibArchive LIBXML2 LIBXSLT PERL PKG_CONFIG PostgreSQL - SWIG TIFF ZLIB) - -foreach(VTEST ${VERSIONS_REQUIRED}) - if (${VTEST}_FOUND) - if (DEFINED ${VTEST}_VERSION_STRING) - if (NOT ${VTEST}_VERSION_STRING MATCHES "^[0-9][0-9\\.]*[A-Za-z_]*[0-9\\.]*$") - message(SEND_ERROR "${VTEST}_VERSION_STRING has unexpected content ${${VTEST}_VERSION_STRING}") - endif() - elseif (DEFINED ${VTEST}_VERSION) - if (NOT ${VTEST}_VERSION MATCHES "^[0-9][0-9\\.]*[A-Za-z_]*[0-9\\.]*$") - message(SEND_ERROR "${VTEST}_VERSION has unexpected content ${${VTEST}_VERSION}") +macro(check_version_string MODULE_NAME VERSION_VAR) + if (${MODULE_NAME}_FOUND) + if (DEFINED ${VERSION_VAR}) + if (NOT ${VERSION_VAR} MATCHES "^[0-9][0-9\\.]*[-A-Za-z_\\+]*[0-9\\.]*$") + message(SEND_ERROR "${VERSION_VAR} has unexpected content ${${VERSION_VAR}}") endif() else() - message(SEND_ERROR "${VTEST}_FOUND is set but no version number is defined") + message(SEND_ERROR "${MODULE_NAME}_FOUND is set but no version number is defined") endif() - endif(${VTEST}_FOUND) + endif () +endmacro(check_version_string) + +# 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 + JASPER LIBXML2 LIBXSLT PERL PostgreSQL TIFF ZLIB) + check_version_string(${VTEST} ${VTEST}_VERSION_STRING) endforeach(VTEST) + +foreach(VTEST BISON Boost CUDA DOXYGEN FLEX GIF GTK2 LibArchive OPENSCENEGRAPH + RUBY SWIG) + check_version_string(${VTEST} ${VTEST}_VERSION) +endforeach(VTEST) + +check_version_string(PYTHONINTERP PYTHON_VERSION_STRING) +check_version_string(SUBVERSION Subversion_VERSION_SVN) +check_version_string(PKGCONFIG PKG_CONFIG_VERSION_STRING) diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 4407efb..a1551ca 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -22,3 +22,9 @@ add_CMakeOnly_test(CheckLanguage) add_CMakeOnly_test(AllFindModules) add_CMakeOnly_test(TargetScope) + +add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND} + -DTEST=ProjectInclude + -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectInclude/include.cmake + -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake + ) diff --git a/Tests/CMakeOnly/ProjectInclude/CMakeLists.txt b/Tests/CMakeOnly/ProjectInclude/CMakeLists.txt new file mode 100644 index 0000000..a9abb4a --- /dev/null +++ b/Tests/CMakeOnly/ProjectInclude/CMakeLists.txt @@ -0,0 +1,4 @@ +project(ProjectInclude) +if(NOT AUTO_INCLUDE) + message(FATAL_ERROR "include file not found") +endif() diff --git a/Tests/CMakeOnly/ProjectInclude/include.cmake b/Tests/CMakeOnly/ProjectInclude/include.cmake new file mode 100644 index 0000000..527ebe7 --- /dev/null +++ b/Tests/CMakeOnly/ProjectInclude/include.cmake @@ -0,0 +1 @@ +set(AUTO_INCLUDE TRUE) diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in index aa2d093..42af068 100644 --- a/Tests/CMakeOnly/Test.cmake.in +++ b/Tests/CMakeOnly/Test.cmake.in @@ -3,7 +3,8 @@ set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build") file(REMOVE_RECURSE "${binary_dir}") file(MAKE_DIRECTORY "${binary_dir}") execute_process( - COMMAND ${CMAKE_COMMAND} "${source_dir}" -G "@CMAKE_TEST_GENERATOR@" + COMMAND ${CMAKE_COMMAND} ${CMAKE_ARGS} + "${source_dir}" -G "@CMAKE_TEST_GENERATOR@" WORKING_DIRECTORY "${binary_dir}" RESULT_VARIABLE result ) |