diff options
author | Brad King <brad.king@kitware.com> | 2012-08-14 12:31:45 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-08-14 12:31:45 (GMT) |
commit | cd3bd23266a4a6c00595134a17a8bdaea9e28af5 (patch) | |
tree | 515fcf4fdee211067497339acb52de321640c4fc /Tests/CMakeOnly | |
parent | 9acb4f118cd9a52aaa66897b1c0cd11dace3851c (diff) | |
parent | 68bc863d5bd64f3e893722e403d4fd56bd2e175a (diff) | |
download | CMake-cd3bd23266a4a6c00595134a17a8bdaea9e28af5.zip CMake-cd3bd23266a4a6c00595134a17a8bdaea9e28af5.tar.gz CMake-cd3bd23266a4a6c00595134a17a8bdaea9e28af5.tar.bz2 |
Merge topic 'cleanup-style'
68bc863 Merge branch 'master' into cleanup-style
a05eba5 CMakeVersion.bash: Update sed expression for lower-case 'set'
3c0488d Fix WarnUnusedUnusedViaUnset test pass/fail regex
6c2c483 Remove trailing TAB from NSIS.template.in
9db3116 Remove CMake-language block-end command arguments
77543bd Convert CMake-language commands to lower case
7bbaa42 Remove trailing whitespace from most CMake and C/C++ code
be9db98 Merge topic 'watcom-compiler-version'
af42ae4 Watcom: Simplify compiler version detection (#11866)
Diffstat (limited to 'Tests/CMakeOnly')
-rw-r--r-- | Tests/CMakeOnly/AllFindModules/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt | 50 | ||||
-rw-r--r-- | Tests/CMakeOnly/CheckSymbolExists/CMakeLists.txt | 38 |
3 files changed, 51 insertions, 51 deletions
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt index 551cee3..fb0bd15 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,7 +65,7 @@ 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. @@ -73,12 +73,12 @@ endmacro(check_version_string) foreach(VTEST ALSA ARMADILLO BZIP2 CUPS CURL EXPAT FREETYPE GETTEXT GIT 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/CheckCXXSymbolExists/CMakeLists.txt b/Tests/CMakeOnly/CheckCXXSymbolExists/CMakeLists.txt index 1c978c1..9528aa3 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 7c969d3..7656577 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 () |