[Cmake-commits] CMake branch, next, updated. v2.8.7-1985-gcd3c397

Rolf Eike Beer eike at sf-mail.de
Fri Jan 6 16:26:33 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  cd3c3977ccfc2b4faffa4089081e9ea357f96d60 (commit)
       via  4e4b043a20e29a60664820099273b04e85b11f0c (commit)
      from  df24447d5490434028475a5ac73b6a6e2d2fcf6d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=cd3c3977ccfc2b4faffa4089081e9ea357f96d60
commit cd3c3977ccfc2b4faffa4089081e9ea357f96d60
Merge: df24447 4e4b043
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Jan 6 16:26:30 2012 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Fri Jan 6 16:26:30 2012 -0500

    Merge topic 'test-symbol-exists' into next
    
    4e4b043 Check{,CXX}SymbolExists: add dummy executable for tests


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4e4b043a20e29a60664820099273b04e85b11f0c
commit 4e4b043a20e29a60664820099273b04e85b11f0c
Author:     Rolf Eike Beer <eike at sf-mail.de>
AuthorDate: Fri Jan 6 22:23:33 2012 +0100
Commit:     Rolf Eike Beer <eike at sf-mail.de>
CommitDate: Fri Jan 6 22:25:55 2012 +0100

    Check{,CXX}SymbolExists: add dummy executable for tests
    
    This allows using the usual macro to add tests. It also verifies that we really
    found errno before as we are now going to use it.

diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 4f40a1b..4a174af 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -242,11 +242,9 @@ IF(BUILD_TESTING)
 
   ADD_TEST_MACRO(Module.CheckCXXCompilerFlag CheckCXXCompilerFlag)
 
-  ADD_SUBDIRECTORY(Module/CheckSymbolExists)
-  LIST(APPEND TEST_BUILD_DIRS ${CMAKE_CURRENT_BINARY_DIR}/Module/CheckSymbolExists/symbol_build)
+  ADD_TEST_MACRO(Module.CheckSymbolExists CheckSymbolExists)
 
-  ADD_SUBDIRECTORY(Module/CheckCXXSymbolExists)
-  LIST(APPEND TEST_BUILD_DIRS ${CMAKE_CURRENT_BINARY_DIR}/Module/CheckCXXSymbolExists/symbol_build)
+  ADD_TEST_MACRO(Module.CheckCXXSymbolExists CheckCXXSymbolExists)
 
   ADD_TEST(LinkFlags-prepare
     ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
diff --git a/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt b/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt
index 8094639..e46b0cc 100644
--- a/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt
+++ b/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt
@@ -7,17 +7,64 @@
 # If you change this test do not forget to change the CheckSymbolExists
 # test, too.
 
-cmake_minimum_required(VERSION 2.8)
-
-set(_test_dir "${CMAKE_CURRENT_BINARY_DIR}/symbol_cxx")
-set(_test_build_dir "${CMAKE_CURRENT_BINARY_DIR}/symbol_build")
-file(MAKE_DIRECTORY "${_test_dir}" "${_test_build_dir}")
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in"
-  "${_test_dir}/CMakeLists.txt" @ONLY)
-ADD_TEST(CheckCXXSymbolExists
-  ${CMAKE_CMAKE_COMMAND}
-    -G "${CMAKE_GENERATOR}"
-    "${_test_dir}"
-  )
-set_tests_properties(CheckCXXSymbolExists PROPERTIES
-  WORKING_DIRECTORY "${_test_build_dir}")
+PROJECT(CheckCXXSymbolExistsTest CXX)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+
+SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/../CheckSymbolExists")
+
+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}")
+  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}")
+  ELSE (CSE_RESULT_${_config_type})
+    MESSAGE(STATUS "Nonexistent symbol was not found")
+  ENDIF (CSE_RESULT_${_config_type})
+endforeach()
+
+set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+unset(CSE_RESULT_ERRNO_CERRNO CACHE)
+
+MESSAGE(STATUS "Checking <cerrno>")
+
+check_cxx_symbol_exists(errno "cerrno" CSE_RESULT_ERRNO_CERRNO)
+
+IF (NOT CSE_RESULT_ERRNO_CERRNO)
+  unset(CSE_RESULT_ERRNO_ERRNOH CACHE)
+
+  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 (CMAKE_COMPILER_IS_GNUCXX)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
+  unset(CSE_RESULT_O3 CACHE)
+  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")
+  ELSE (CSE_RESULT_O3)
+    MESSAGE(STATUS "Nonexistent symbol was not found")
+  ENDIF (CSE_RESULT_O3)
+ENDIF (CMAKE_COMPILER_IS_GNUCXX)
+
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/errno.cxx.in" "${CMAKE_CURRENT_BINARY_DIR}/errno.cxx" @ONLY)
+
+add_executable(CheckCXXSymbolExists "${CMAKE_CURRENT_BINARY_DIR}/errno.cxx")
diff --git a/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt.in b/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt.in
deleted file mode 100644
index e73200b..0000000
--- a/Tests/Module/CheckCXXSymbolExists/CMakeLists.txt.in
+++ /dev/null
@@ -1,55 +0,0 @@
-PROJECT(CheckCXXSymbolExistsTest CXX)
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
-
-SET(CMAKE_REQUIRED_INCLUDES "@CMAKE_CURRENT_SOURCE_DIR@/../CheckSymbolExists")
-
-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}")
-  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}")
-  ELSE (CSE_RESULT_${_config_type})
-    MESSAGE(STATUS "Nonexistent symbol was not found")
-  ENDIF (CSE_RESULT_${_config_type})
-endforeach()
-
-set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
-unset(CSE_RESULT_ERRNO CACHE)
-
-MESSAGE(STATUS "Checking <cerrno>")
-
-check_cxx_symbol_exists(errno "cerrno" CSE_RESULT_ERRNO)
-
-IF (NOT CSE_RESULT_ERRNO)
-  MESSAGE(STATUS "Checking <errno.h>")
-
-  check_cxx_symbol_exists(errno "errno.h" CSE_RESULT_ERRNO)
-
-  IF (NOT CSE_RESULT_ERRNO)
-    MESSAGE(SEND_ERROR "CheckCXXSymbolExists did not find errno in <cerrno> and <errno.h>")
-  ELSE (NOT CSE_RESULT_ERRNO)
-    MESSAGE(STATUS "errno found in <errno.h>")
-  ENDIF (NOT CSE_RESULT_ERRNO)
-ELSE (NOT CSE_RESULT_ERRNO)
-  MESSAGE(STATUS "errno found in <cerrno>")
-ENDIF (NOT CSE_RESULT_ERRNO)
-
-IF (CMAKE_COMPILER_IS_GNUCXX)
-  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
-  unset(CSE_RESULT_O3 CACHE)
-  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")
-  ELSE (CSE_RESULT_O3)
-    MESSAGE(STATUS "Nonexistent symbol was not found")
-  ENDIF (CSE_RESULT_O3)
-ENDIF (CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Tests/Module/CheckCXXSymbolExists/errno.cxx.in b/Tests/Module/CheckCXXSymbolExists/errno.cxx.in
new file mode 100644
index 0000000..3de782a
--- /dev/null
+++ b/Tests/Module/CheckCXXSymbolExists/errno.cxx.in
@@ -0,0 +1,13 @@
+#cmakedefine CSE_RESULT_ERRNO_ERRNOH
+#cmakedefine CSE_RESULT_ERRNO_CERRNO
+
+#ifdef CSE_RESULT_ERRNO_CERRNO
+#include <cerrno>
+#else
+#include <errno.h>
+#endif
+
+int main()
+{
+  return errno;
+}
diff --git a/Tests/Module/CheckSymbolExists/CMakeLists.txt b/Tests/Module/CheckSymbolExists/CMakeLists.txt
index 8cfdbcb..b65cdaf 100644
--- a/Tests/Module/CheckSymbolExists/CMakeLists.txt
+++ b/Tests/Module/CheckSymbolExists/CMakeLists.txt
@@ -7,17 +7,51 @@
 # If you change this test do not forget to change the CheckCXXSymbolExists
 # test, too.
 
-cmake_minimum_required(VERSION 2.8)
-
-set(_test_dir "${CMAKE_CURRENT_BINARY_DIR}/symbol_c")
-set(_test_build_dir "${CMAKE_CURRENT_BINARY_DIR}/symbol_build")
-file(MAKE_DIRECTORY "${_test_dir}" "${_test_build_dir}")
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.in"
-  "${_test_dir}/CMakeLists.txt" @ONLY)
-ADD_TEST(CheckSymbolExists
-  ${CMAKE_CMAKE_COMMAND}
-    -G "${CMAKE_GENERATOR}"
-    "${_test_dir}"
-  )
-set_tests_properties(CheckSymbolExists PROPERTIES
-  WORKING_DIRECTORY "${_test_build_dir}")
+PROJECT(CheckSymbolExistsTest C)
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
+
+SET(CMAKE_REQUIRED_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}")
+
+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}")
+
+  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}")
+  ELSE (CSE_RESULT_${_config_type})
+    MESSAGE(STATUS "Nonexistent symbol was not found")
+  ENDIF (CSE_RESULT_${_config_type})
+endforeach()
+
+set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
+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 (CMAKE_COMPILER_IS_GNUC)
+  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+  unset(CSE_RESULT_O3 CACHE)
+  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")
+  ELSE (CSE_RESULT_O3)
+    MESSAGE(STATUS "Nonexistent symbol was not found")
+  ENDIF (CSE_RESULT_O3)
+ENDIF (CMAKE_COMPILER_IS_GNUC)
+
+add_executable(CheckSymbolExists errno.c)
diff --git a/Tests/Module/CheckSymbolExists/CMakeLists.txt.in b/Tests/Module/CheckSymbolExists/CMakeLists.txt.in
deleted file mode 100644
index 3e0bad5..0000000
--- a/Tests/Module/CheckSymbolExists/CMakeLists.txt.in
+++ /dev/null
@@ -1,46 +0,0 @@
-PROJECT(CheckSymbolExistsTest C)
-
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
-
-SET(CMAKE_REQUIRED_INCLUDES "@CMAKE_CURRENT_SOURCE_DIR@")
-
-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}")
-
-  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}")
-  ELSE (CSE_RESULT_${_config_type})
-    MESSAGE(STATUS "Nonexistent symbol was not found")
-  ENDIF (CSE_RESULT_${_config_type})
-endforeach()
-
-set(CMAKE_TRY_COMPILE_CONFIGURATION ${CMAKE_BUILD_TYPE})
-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 (CMAKE_COMPILER_IS_GNUC)
-  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
-  unset(CSE_RESULT_O3 CACHE)
-  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")
-  ELSE (CSE_RESULT_O3)
-    MESSAGE(STATUS "Nonexistent symbol was not found")
-  ENDIF (CSE_RESULT_O3)
-ENDIF (CMAKE_COMPILER_IS_GNUC)
diff --git a/Tests/Module/CheckSymbolExists/errno.c b/Tests/Module/CheckSymbolExists/errno.c
new file mode 100644
index 0000000..6010f7c
--- /dev/null
+++ b/Tests/Module/CheckSymbolExists/errno.c
@@ -0,0 +1,6 @@
+#include <errno.h>
+
+int main()
+{
+  return errno;
+}

-----------------------------------------------------------------------

Summary of changes:
 Tests/CMakeLists.txt                               |    6 +-
 Tests/Module/CheckCXXSymbolExists/CMakeLists.txt   |   75 ++++++++++++++++----
 .../Module/CheckCXXSymbolExists/CMakeLists.txt.in  |   55 --------------
 Tests/Module/CheckCXXSymbolExists/errno.cxx.in     |   13 ++++
 Tests/Module/CheckSymbolExists/CMakeLists.txt      |   62 +++++++++++++----
 Tests/Module/CheckSymbolExists/CMakeLists.txt.in   |   46 ------------
 Tests/Module/CheckSymbolExists/errno.c             |    6 ++
 7 files changed, 130 insertions(+), 133 deletions(-)
 delete mode 100644 Tests/Module/CheckCXXSymbolExists/CMakeLists.txt.in
 create mode 100644 Tests/Module/CheckCXXSymbolExists/errno.cxx.in
 delete mode 100644 Tests/Module/CheckSymbolExists/CMakeLists.txt.in
 create mode 100644 Tests/Module/CheckSymbolExists/errno.c


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list