[Cmake-commits] CMake branch, next, updated. v2.8.12.1-4927-g2fe761a

Stephen Kelly steveire at gmail.com
Sat Nov 9 03:56:36 EST 2013


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  2fe761a02d821042fd0440c56af9a9635606b340 (commit)
       via  833af5df2b8548b4dfe4f7ca1924845bb02bf54b (commit)
       via  e146ea5ab9adfa023ab08fe721b6373c9b8f9589 (commit)
       via  f3406b606bb1f1b7d8b9c6dff4e280091974eeb9 (commit)
       via  b4f68f821b1dc9e344e1aad5d6eddd6a2ce627eb (commit)
       via  a3f5825eefe7182ece198093c2c21d17fcdc7e04 (commit)
      from  633b6f979290bceb7093c8ca8481d70eac25436f (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=2fe761a02d821042fd0440c56af9a9635606b340
commit 2fe761a02d821042fd0440c56af9a9635606b340
Merge: 633b6f9 833af5d
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 9 03:56:33 2013 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Sat Nov 9 03:56:33 2013 -0500

    Merge topic 'target_compile_features' into next
    
    833af5d Add failure tests for target_compile_features.
    e146ea5 Add the compiler version to error output.
    f3406b6 Record compilers capable of msvcxx_sealed feature.
    b4f68f8 Record compilers capable of the gnuxx_typeof feature.
    a3f5825 cmTargetPropCommandBase: Change the interface to return bool.


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=833af5df2b8548b4dfe4f7ca1924845bb02bf54b
commit 833af5df2b8548b4dfe4f7ca1924845bb02bf54b
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 9 09:19:52 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 9 09:54:16 2013 +0100

    Add failure tests for target_compile_features.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 97bf14d..8404e68 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -128,4 +128,5 @@ endif()
 add_RunCMake_test(File_Generate)
 add_RunCMake_test(ExportWithoutLanguage)
 add_RunCMake_test(target_link_libraries)
+add_RunCMake_test(target_compile_features)
 add_RunCMake_test(CheckModules)
diff --git a/Tests/RunCMake/target_compile_features/CMakeLists.txt b/Tests/RunCMake/target_compile_features/CMakeLists.txt
new file mode 100644
index 0000000..a06591c
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12)
+project(${RunCMake_TEST} CXX)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
new file mode 100644
index 0000000..f2abef7
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
@@ -0,0 +1,11 @@
+include(RunCMake)
+
+run_cmake(not_enough_args)
+run_cmake(alias_target)
+run_cmake(utility_target)
+run_cmake(invalid_args)
+run_cmake(invalid_args_on_interface)
+run_cmake(imported_target)
+run_cmake(no_target)
+run_cmake(not_a_cxx_feature)
+run_cmake(no_matching_cxx_feature)
diff --git a/Tests/RunCMake/target_compile_features/alias_target-result.txt b/Tests/RunCMake/target_compile_features/alias_target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/alias_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/alias_target-stderr.txt b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
new file mode 100644
index 0000000..417bf62
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/alias_target-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at alias_target.cmake:4 \(target_compile_features\):
+  target_compile_features can not be used on an ALIAS target.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/alias_target.cmake b/Tests/RunCMake/target_compile_features/alias_target.cmake
new file mode 100644
index 0000000..d35ddba
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/alias_target.cmake
@@ -0,0 +1,4 @@
+
+add_executable(main empty.cpp)
+add_executable(Alias::Main ALIAS main)
+target_compile_features(Alias::Main PRIVATE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/empty.cpp b/Tests/RunCMake/target_compile_features/empty.cpp
new file mode 100644
index 0000000..bfbbdde
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty()
+{
+  return 0;
+}
diff --git a/Tests/RunCMake/target_compile_features/imported_target-result.txt b/Tests/RunCMake/target_compile_features/imported_target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/imported_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/imported_target-stderr.txt b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
new file mode 100644
index 0000000..c6ff5ec
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/imported_target-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at imported_target.cmake:3 \(target_compile_features\):
+  Cannot specify compile features for imported target "main".
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/imported_target.cmake b/Tests/RunCMake/target_compile_features/imported_target.cmake
new file mode 100644
index 0000000..e248c2f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/imported_target.cmake
@@ -0,0 +1,3 @@
+
+add_library(main INTERFACE IMPORTED)
+target_compile_features(main INTERFACE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args-result.txt b/Tests/RunCMake/target_compile_features/invalid_args-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/invalid_args-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
new file mode 100644
index 0000000..bd5b7b9
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at invalid_args.cmake:3 \(target_compile_features\):
+  target_compile_features called with invalid arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args.cmake b/Tests/RunCMake/target_compile_features/invalid_args.cmake
new file mode 100644
index 0000000..1a7fb37
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/invalid_args.cmake
@@ -0,0 +1,3 @@
+
+add_executable(main empty.cpp)
+target_compile_features(main INVALID cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-result.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
new file mode 100644
index 0000000..c30209a
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at invalid_args_on_interface.cmake:3 \(target_compile_features\):
+  target_compile_features may only be set INTERFACE properties on INTERFACE
+  targets
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake b/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake
new file mode 100644
index 0000000..324d0f3
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake
@@ -0,0 +1,3 @@
+
+add_library(main INTERFACE)
+target_compile_features(main PRIVATE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-result.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
new file mode 100644
index 0000000..435836f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at no_matching_cxx_feature.cmake:15 \(target_compile_features\):
+  The compiler feature "[^"]+" is not known to compiler "[^"]*"[ \n]*version[ \n]*.+\.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake
new file mode 100644
index 0000000..5d5133e
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake
@@ -0,0 +1,18 @@
+
+# Assume for testing that a compiler which supports gnuxx_typeof does not
+# support msvcxx_sealed
+if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";gnuxx_typeof;")
+  set(feature msvcxx_sealed)
+  if (";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";msvcxx_sealed;")
+    message(SEND_ERROR "Compiler supports both gnuxx_typeof and msvcxx_sealed!")
+  endif()
+else()
+  set(feature gnuxx_typeof)
+endif()
+
+add_executable(main empty.cpp)
+
+target_compile_features(main
+  PRIVATE
+    ${feature}
+)
diff --git a/Tests/RunCMake/target_compile_features/no_target-result.txt b/Tests/RunCMake/target_compile_features/no_target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/no_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/no_target-stderr.txt b/Tests/RunCMake/target_compile_features/no_target-stderr.txt
new file mode 100644
index 0000000..323ba7a
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/no_target-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at no_target.cmake:2 \(target_compile_features\):
+  Cannot specify compile features for target "main" which is not built by
+  this project.
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/no_target.cmake b/Tests/RunCMake/target_compile_features/no_target.cmake
new file mode 100644
index 0000000..3f0afe2
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/no_target.cmake
@@ -0,0 +1,2 @@
+
+target_compile_features(main INTERFACE cxx_delegating_constructors)
diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-result.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
new file mode 100644
index 0000000..a27030f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at not_a_cxx_feature.cmake:3 \(target_compile_features\):
+  target_compile_features specified unknown feature "cxx_not_a_feature".
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake b/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake
new file mode 100644
index 0000000..0207b72
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake
@@ -0,0 +1,6 @@
+
+add_executable(main empty.cpp)
+target_compile_features(main
+  PRIVATE
+    cxx_not_a_feature
+)
diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-result.txt b/Tests/RunCMake/target_compile_features/not_enough_args-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/not_enough_args-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
new file mode 100644
index 0000000..2f8d812
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at not_enough_args.cmake:3 \(target_compile_features\):
+  target_compile_features called with incorrect number of arguments
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/not_enough_args.cmake b/Tests/RunCMake/target_compile_features/not_enough_args.cmake
new file mode 100644
index 0000000..9561230
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/not_enough_args.cmake
@@ -0,0 +1,3 @@
+
+add_executable(main empty.cpp)
+target_compile_features(main)
diff --git a/Tests/RunCMake/target_compile_features/utility_target-result.txt b/Tests/RunCMake/target_compile_features/utility_target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/utility_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_compile_features/utility_target-stderr.txt b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
new file mode 100644
index 0000000..d239059
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/utility_target-stderr.txt
@@ -0,0 +1,4 @@
+CMake Error at utility_target.cmake:4 \(target_compile_features\):
+  target_compile_features called with non-compilable target type
+Call Stack \(most recent call first\):
+  CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_compile_features/utility_target.cmake b/Tests/RunCMake/target_compile_features/utility_target.cmake
new file mode 100644
index 0000000..8919056
--- /dev/null
+++ b/Tests/RunCMake/target_compile_features/utility_target.cmake
@@ -0,0 +1,4 @@
+
+add_custom_target(utility)
+
+target_compile_features(utility PRIVATE cxx_delegating_constructors)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e146ea5ab9adfa023ab08fe721b6373c9b8f9589
commit e146ea5ab9adfa023ab08fe721b6373c9b8f9589
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 9 09:19:22 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 9 09:54:16 2013 +0100

    Add the compiler version to error output.

diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 19a515c..e5b9445 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -4486,7 +4486,8 @@ AddRequiredTargetFeature(cmTarget *target, const char *feature) const
     cmOStringStream e;
     e << "The compiler feature \"" << feature
       << "\" is not known to compiler \""
-      << this->GetDefinition("CMAKE_CXX_COMPILER_ID") << "\".";
+      << this->GetDefinition("CMAKE_CXX_COMPILER_ID") << "\" version "
+      << this->GetDefinition("CMAKE_CXX_COMPILER_VERSION") << ".";
     this->IssueMessage(cmake::FATAL_ERROR, e.str().c_str());
     return false;
     }

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f3406b606bb1f1b7d8b9c6dff4e280091974eeb9
commit f3406b606bb1f1b7d8b9c6dff4e280091974eeb9
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 9 09:18:53 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 9 09:54:16 2013 +0100

    Record compilers capable of msvcxx_sealed feature.

diff --git a/Modules/Compiler/Clang-CXX-FeatureTests.cmake b/Modules/Compiler/Clang-CXX-FeatureTests.cmake
index ecd2a55..545c879 100644
--- a/Modules/Compiler/Clang-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/Clang-CXX-FeatureTests.cmake
@@ -7,3 +7,6 @@ foreach(feature ${testable_features})
 endforeach()
 
 set(_cmake_feature_test_gnuxx_typeof "!defined(__STRICT_ANSI__)")
+if (SIMULATED_COMPILER_ID STREQUAL MSVC)
+  set(_cmake_feature_test_msvcxx_sealed "1")
+endif()
diff --git a/Modules/Platform/Windows-MSVC-CXX.cmake b/Modules/Platform/Windows-MSVC-CXX.cmake
index 0e85005..cd43419 100644
--- a/Modules/Platform/Windows-MSVC-CXX.cmake
+++ b/Modules/Platform/Windows-MSVC-CXX.cmake
@@ -4,3 +4,6 @@ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 18.0)
   set(_FS_CXX " /FS")
 endif()
 __windows_compiler_msvc(CXX)
+if(NOT MSVC_VERSION VERSION_LESS 1400)
+  set(_cmake_feature_test_msvcxx_sealed "1")
+endif()
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index a1c463c..19a515c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -43,7 +43,8 @@
 
 #define FOR_EACH_CXX_FEATURE(F) \
   F(cxx_delegating_constructors) \
-  F(gnuxx_typeof)
+  F(gnuxx_typeof) \
+  F(msvcxx_sealed)
 
 class cmMakefile::Internals
 {
diff --git a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
index 9b5b346..1547126 100644
--- a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
@@ -5,6 +5,12 @@ project(target_compile_features)
 if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang")
   add_executable(gnuxx_typeof_test gnuxx_typeof_test.cpp)
 endif()
+if (("${CMAKE_CXX_COMPILER};" MATCHES "MSVC"
+      AND NOT MSVC_VERSION VERSION_LESS 1400)
+    OR ("${CMAKE_CXX_COMPILER};" STREQUAL "Clang"
+      AND "${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC"))
+  add_executable(msvcxx_sealed_test msvcxx_sealed_test.cpp)
+endif()
 
 if (NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;")
   add_executable(target_compile_features dummy.cpp)

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b4f68f821b1dc9e344e1aad5d6eddd6a2ce627eb
commit b4f68f821b1dc9e344e1aad5d6eddd6a2ce627eb
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 9 09:18:32 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 9 09:54:16 2013 +0100

    Record compilers capable of the gnuxx_typeof feature.

diff --git a/Modules/Compiler/Clang-CXX-FeatureTests.cmake b/Modules/Compiler/Clang-CXX-FeatureTests.cmake
index b71b127..ecd2a55 100644
--- a/Modules/Compiler/Clang-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/Clang-CXX-FeatureTests.cmake
@@ -5,3 +5,5 @@ set(testable_features
 foreach(feature ${testable_features})
   set(_cmake_feature_test_${feature} "__has_extension(${feature})")
 endforeach()
+
+set(_cmake_feature_test_gnuxx_typeof "!defined(__STRICT_ANSI__)")
diff --git a/Modules/Compiler/GNU-CXX-FeatureTests.cmake b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
index 7da0563..c8e7216 100644
--- a/Modules/Compiler/GNU-CXX-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-CXX-FeatureTests.cmake
@@ -1,2 +1,3 @@
 
+set(_cmake_feature_test_gnuxx_typeof "!defined(__STRICT_ANSI__)")
 set(_cmake_feature_test_cxx_delegating_constructors "(__GNUC__ * 100 + __GNUC_MINOR__) >= 407")
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index b2db909..0c8a1f6 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -11,6 +11,7 @@ else()
   endif()
 endif()
 
+set(CMAKE_CXX98_COMPILE_EXTENSIONS)
 set(CMAKE_CXX11_COMPILE_FEATURES)
 
 include("${CMAKE_ROOT}/Modules/Internal/FeatureTesting.cmake")
@@ -23,6 +24,7 @@ endmacro()
 if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
   set(CMAKE_CXX98_STANDARD_COMPILE_OPTION "-std=c++98")
   set(CMAKE_CXX98_EXTENSION_COMPILE_OPTION "-std=gnu++98")
+  _get_gcc_features(gnu++98 CMAKE_CXX98_COMPILE_EXTENSIONS)
 endif()
 
 if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
@@ -30,13 +32,17 @@ if (NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
   set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++11")
 
   _get_gcc_features(c++11 CMAKE_CXX11_COMPILE_FEATURES)
+  _get_gcc_features(gnu++11 CMAKE_CXX11_COMPILE_EXTENSIONS)
 elseif(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.3)
   set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++0x")
   set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=gnu++0x")
 
   _get_gcc_features(c++0x CMAKE_CXX11_COMPILE_FEATURES)
+  _get_gcc_features(gnu++0x CMAKE_CXX11_COMPILE_EXTENSIONS)
 endif()
 
 set(CMAKE_CXX_COMPILE_FEATURES
+  ${CMAKE_CXX98_COMPILE_EXTENSIONS}
   ${CMAKE_CXX11_COMPILE_FEATURES}
+  ${CMAKE_CXX11_COMPILE_EXTENSIONS}
 )
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 2542f71..a1c463c 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -42,7 +42,8 @@
 #include <assert.h>
 
 #define FOR_EACH_CXX_FEATURE(F) \
-  F(cxx_delegating_constructors)
+  F(cxx_delegating_constructors) \
+  F(gnuxx_typeof)
 
 class cmMakefile::Internals
 {
diff --git a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
index 3d10f24..9b5b346 100644
--- a/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
+++ b/Tests/CMakeCommands/target_compile_features/CMakeLists.txt
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 2.8)
 
 project(target_compile_features)
 
+if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU|Clang")
+  add_executable(gnuxx_typeof_test gnuxx_typeof_test.cpp)
+endif()
+
 if (NOT ";${CMAKE_CXX_COMPILE_FEATURES};" MATCHES ";cxx_delegating_constructors;")
   add_executable(target_compile_features dummy.cpp)
   return()

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a3f5825eefe7182ece198093c2c21d17fcdc7e04
commit a3f5825eefe7182ece198093c2c21d17fcdc7e04
Author:     Stephen Kelly <steveire at gmail.com>
AuthorDate: Sat Nov 9 00:18:35 2013 +0100
Commit:     Stephen Kelly <steveire at gmail.com>
CommitDate: Sat Nov 9 08:43:52 2013 +0100

    cmTargetPropCommandBase: Change the interface to return bool.
    
    This is needed for the target_compile_features command, which
    may fail at configure time if an invalid feature is specified.

diff --git a/Source/cmTargetCompileDefinitionsCommand.cxx b/Source/cmTargetCompileDefinitionsCommand.cxx
index 46c9666..2ad2405 100644
--- a/Source/cmTargetCompileDefinitionsCommand.cxx
+++ b/Source/cmTargetCompileDefinitionsCommand.cxx
@@ -58,9 +58,10 @@ std::string cmTargetCompileDefinitionsCommand
 }
 
 //----------------------------------------------------------------------------
-void cmTargetCompileDefinitionsCommand
+bool cmTargetCompileDefinitionsCommand
 ::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
                                    bool, bool)
 {
   tgt->AppendProperty("COMPILE_DEFINITIONS", this->Join(content).c_str());
+  return true;
 }
diff --git a/Source/cmTargetCompileDefinitionsCommand.h b/Source/cmTargetCompileDefinitionsCommand.h
index 7405e90..eedcfbf 100644
--- a/Source/cmTargetCompileDefinitionsCommand.h
+++ b/Source/cmTargetCompileDefinitionsCommand.h
@@ -44,7 +44,7 @@ private:
   virtual void HandleImportedTarget(const std::string &tgt);
   virtual void HandleMissingTarget(const std::string &name);
 
-  virtual void HandleDirectContent(cmTarget *tgt,
+  virtual bool HandleDirectContent(cmTarget *tgt,
                                    const std::vector<std::string> &content,
                                    bool prepend, bool system);
   virtual std::string Join(const std::vector<std::string> &content);
diff --git a/Source/cmTargetCompileFeaturesCommand.cxx b/Source/cmTargetCompileFeaturesCommand.cxx
index 6948717..8a7e5f8 100644
--- a/Source/cmTargetCompileFeaturesCommand.cxx
+++ b/Source/cmTargetCompileFeaturesCommand.cxx
@@ -52,13 +52,20 @@ std::string cmTargetCompileFeaturesCommand
 }
 
 //----------------------------------------------------------------------------
-void cmTargetCompileFeaturesCommand
+bool cmTargetCompileFeaturesCommand
 ::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
                                    bool, bool)
 {
   for(std::vector<std::string>::const_iterator it = content.begin();
     it != content.end(); ++it)
     {
-    this->Makefile->AddRequiredTargetFeature(tgt, it->c_str());
+    if(!this->Makefile->AddRequiredTargetFeature(tgt, it->c_str()))
+      {
+      cmOStringStream e;
+      e << "specified unknown feature \"" << *it << "\".";
+      this->SetError(e.str().c_str());
+      return false;
+      }
     }
+  return true;
 }
diff --git a/Source/cmTargetCompileFeaturesCommand.h b/Source/cmTargetCompileFeaturesCommand.h
index 9386c84..97a61ba 100644
--- a/Source/cmTargetCompileFeaturesCommand.h
+++ b/Source/cmTargetCompileFeaturesCommand.h
@@ -32,7 +32,7 @@ private:
   virtual void HandleImportedTarget(const std::string &tgt);
   virtual void HandleMissingTarget(const std::string &name);
 
-  virtual void HandleDirectContent(cmTarget *tgt,
+  virtual bool HandleDirectContent(cmTarget *tgt,
                                    const std::vector<std::string> &content,
                                    bool prepend, bool system);
   virtual std::string Join(const std::vector<std::string> &content);
diff --git a/Source/cmTargetCompileOptionsCommand.cxx b/Source/cmTargetCompileOptionsCommand.cxx
index 254acc7..18499fd 100644
--- a/Source/cmTargetCompileOptionsCommand.cxx
+++ b/Source/cmTargetCompileOptionsCommand.cxx
@@ -51,7 +51,7 @@ std::string cmTargetCompileOptionsCommand
 }
 
 //----------------------------------------------------------------------------
-void cmTargetCompileOptionsCommand
+bool cmTargetCompileOptionsCommand
 ::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
                                    bool, bool)
 {
@@ -59,4 +59,5 @@ void cmTargetCompileOptionsCommand
   this->Makefile->GetBacktrace(lfbt);
   cmValueWithOrigin entry(this->Join(content), lfbt);
   tgt->InsertCompileOption(entry);
+  return true;
 }
diff --git a/Source/cmTargetCompileOptionsCommand.h b/Source/cmTargetCompileOptionsCommand.h
index 3713e5a..4376ba7 100644
--- a/Source/cmTargetCompileOptionsCommand.h
+++ b/Source/cmTargetCompileOptionsCommand.h
@@ -44,7 +44,7 @@ private:
   virtual void HandleImportedTarget(const std::string &tgt);
   virtual void HandleMissingTarget(const std::string &name);
 
-  virtual void HandleDirectContent(cmTarget *tgt,
+  virtual bool HandleDirectContent(cmTarget *tgt,
                                    const std::vector<std::string> &content,
                                    bool prepend, bool system);
   virtual std::string Join(const std::vector<std::string> &content);
diff --git a/Source/cmTargetIncludeDirectoriesCommand.cxx b/Source/cmTargetIncludeDirectoriesCommand.cxx
index e7b906c..af7fe77 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.cxx
+++ b/Source/cmTargetIncludeDirectoriesCommand.cxx
@@ -64,7 +64,7 @@ std::string cmTargetIncludeDirectoriesCommand
 }
 
 //----------------------------------------------------------------------------
-void cmTargetIncludeDirectoriesCommand
+bool cmTargetIncludeDirectoriesCommand
 ::HandleDirectContent(cmTarget *tgt, const std::vector<std::string> &content,
                       bool prepend, bool system)
 {
@@ -76,6 +76,7 @@ void cmTargetIncludeDirectoriesCommand
     {
     tgt->AddSystemIncludeDirectories(content);
     }
+  return true;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTargetIncludeDirectoriesCommand.h b/Source/cmTargetIncludeDirectoriesCommand.h
index 6863ee5..bb0efcd 100644
--- a/Source/cmTargetIncludeDirectoriesCommand.h
+++ b/Source/cmTargetIncludeDirectoriesCommand.h
@@ -45,7 +45,7 @@ private:
   virtual void HandleImportedTarget(const std::string &tgt);
   virtual void HandleMissingTarget(const std::string &name);
 
-  virtual void HandleDirectContent(cmTarget *tgt,
+  virtual bool HandleDirectContent(cmTarget *tgt,
                                    const std::vector<std::string> &content,
                                    bool prepend, bool system);
   virtual void HandleInterfaceContent(cmTarget *tgt,
diff --git a/Source/cmTargetPropCommandBase.cxx b/Source/cmTargetPropCommandBase.cxx
index e7b6999..2470b28 100644
--- a/Source/cmTargetPropCommandBase.cxx
+++ b/Source/cmTargetPropCommandBase.cxx
@@ -131,29 +131,31 @@ bool cmTargetPropCommandBase
         || args[i] == "PRIVATE"
         || args[i] == "INTERFACE" )
       {
-      this->PopulateTargetProperies(scope, content, prepend, system);
-      return true;
+      return this->PopulateTargetProperies(scope, content, prepend, system);
       }
     content.push_back(args[i]);
     }
-  this->PopulateTargetProperies(scope, content, prepend, system);
-  return true;
+  return this->PopulateTargetProperies(scope, content, prepend, system);
 }
 
 //----------------------------------------------------------------------------
-void cmTargetPropCommandBase
+bool cmTargetPropCommandBase
 ::PopulateTargetProperies(const std::string &scope,
                           const std::vector<std::string> &content,
                           bool prepend, bool system)
 {
   if (scope == "PRIVATE" || scope == "PUBLIC")
     {
-    this->HandleDirectContent(this->Target, content, prepend, system);
+    if (!this->HandleDirectContent(this->Target, content, prepend, system))
+      {
+      return false;
+      }
     }
   if (scope == "INTERFACE" || scope == "PUBLIC")
     {
     this->HandleInterfaceContent(this->Target, content, prepend, system);
     }
+  return true;
 }
 
 //----------------------------------------------------------------------------
diff --git a/Source/cmTargetPropCommandBase.h b/Source/cmTargetPropCommandBase.h
index c402836..67a8596 100644
--- a/Source/cmTargetPropCommandBase.h
+++ b/Source/cmTargetPropCommandBase.h
@@ -43,7 +43,7 @@ private:
   virtual void HandleImportedTarget(const std::string &tgt) = 0;
   virtual void HandleMissingTarget(const std::string &name) = 0;
 
-  virtual void HandleDirectContent(cmTarget *tgt,
+  virtual bool HandleDirectContent(cmTarget *tgt,
                                    const std::vector<std::string> &content,
                                    bool prepend, bool system) = 0;
 
@@ -51,7 +51,7 @@ private:
 
   bool ProcessContentArgs(std::vector<std::string> const& args,
                           unsigned int &argIndex, bool prepend, bool system);
-  void PopulateTargetProperies(const std::string &scope,
+  bool PopulateTargetProperies(const std::string &scope,
                                const std::vector<std::string> &content,
                                bool prepend, bool system);
 };

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

Summary of changes:
 Modules/Compiler/Clang-CXX-FeatureTests.cmake      |    5 +++++
 Modules/Compiler/GNU-CXX-FeatureTests.cmake        |    1 +
 Modules/Compiler/GNU-CXX.cmake                     |    6 ++++++
 Modules/Platform/Windows-MSVC-CXX.cmake            |    3 +++
 Source/cmMakefile.cxx                              |    7 +++++--
 Source/cmTargetCompileDefinitionsCommand.cxx       |    3 ++-
 Source/cmTargetCompileDefinitionsCommand.h         |    2 +-
 Source/cmTargetCompileFeaturesCommand.cxx          |   11 +++++++++--
 Source/cmTargetCompileFeaturesCommand.h            |    2 +-
 Source/cmTargetCompileOptionsCommand.cxx           |    3 ++-
 Source/cmTargetCompileOptionsCommand.h             |    2 +-
 Source/cmTargetIncludeDirectoriesCommand.cxx       |    3 ++-
 Source/cmTargetIncludeDirectoriesCommand.h         |    2 +-
 Source/cmTargetPropCommandBase.cxx                 |   14 ++++++++------
 Source/cmTargetPropCommandBase.h                   |    4 ++--
 .../target_compile_features/CMakeLists.txt         |   10 ++++++++++
 Tests/RunCMake/CMakeLists.txt                      |    1 +
 .../target_compile_features/CMakeLists.txt         |    3 +++
 .../target_compile_features/RunCMakeTest.cmake     |   11 +++++++++++
 .../alias_target-result.txt}                       |    0
 .../alias_target-stderr.txt                        |    4 ++++
 .../target_compile_features/alias_target.cmake     |    4 ++++
 .../{CMP0022 => target_compile_features}/empty.cpp |    0
 .../imported_target-result.txt}                    |    0
 .../imported_target-stderr.txt                     |    4 ++++
 .../target_compile_features/imported_target.cmake  |    3 +++
 .../invalid_args-result.txt}                       |    0
 .../invalid_args-stderr.txt                        |    4 ++++
 .../target_compile_features/invalid_args.cmake     |    3 +++
 .../invalid_args_on_interface-result.txt}          |    0
 .../invalid_args_on_interface-stderr.txt           |    5 +++++
 .../invalid_args_on_interface.cmake                |    3 +++
 .../no_matching_cxx_feature-result.txt}            |    0
 .../no_matching_cxx_feature-stderr.txt             |    4 ++++
 .../no_matching_cxx_feature.cmake                  |   18 ++++++++++++++++++
 .../no_target-result.txt}                          |    0
 .../target_compile_features/no_target-stderr.txt   |    5 +++++
 .../target_compile_features/no_target.cmake        |    2 ++
 .../not_a_cxx_feature-result.txt}                  |    0
 .../not_a_cxx_feature-stderr.txt                   |    4 ++++
 .../not_a_cxx_feature.cmake                        |    6 ++++++
 .../not_enough_args-result.txt}                    |    0
 .../not_enough_args-stderr.txt                     |    4 ++++
 .../target_compile_features/not_enough_args.cmake  |    3 +++
 .../utility_target-result.txt}                     |    0
 .../utility_target-stderr.txt                      |    4 ++++
 .../target_compile_features/utility_target.cmake   |    4 ++++
 47 files changed, 158 insertions(+), 19 deletions(-)
 create mode 100644 Tests/RunCMake/target_compile_features/CMakeLists.txt
 create mode 100644 Tests/RunCMake/target_compile_features/RunCMakeTest.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/alias_target-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/alias_target-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/alias_target.cmake
 copy Tests/RunCMake/{CMP0022 => target_compile_features}/empty.cpp (100%)
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/imported_target-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/imported_target-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/imported_target.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/invalid_args-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/invalid_args-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/invalid_args.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/invalid_args_on_interface-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/invalid_args_on_interface-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/invalid_args_on_interface.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/no_matching_cxx_feature-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/no_matching_cxx_feature-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/no_matching_cxx_feature.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/no_target-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/no_target-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/no_target.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/not_a_cxx_feature-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/not_a_cxx_feature-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/not_a_cxx_feature.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/not_enough_args-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/not_enough_args-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/not_enough_args.cmake
 copy Tests/RunCMake/{CMP0004/CMP0004-NEW-result.txt => target_compile_features/utility_target-result.txt} (100%)
 create mode 100644 Tests/RunCMake/target_compile_features/utility_target-stderr.txt
 create mode 100644 Tests/RunCMake/target_compile_features/utility_target.cmake


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list