diff options
-rw-r--r-- | Help/manual/cmake-properties.7.rst | 1 | ||||
-rw-r--r-- | Help/manual/cmake-variables.7.rst | 1 | ||||
-rw-r--r-- | Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst (renamed from Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst) | 2 | ||||
-rw-r--r-- | Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst | 4 | ||||
-rw-r--r-- | Modules/Internal/FeatureTesting.cmake | 5 | ||||
-rw-r--r-- | Modules/Qt4Macros.cmake | 4 | ||||
-rw-r--r-- | Source/CMakeVersion.cmake | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 54 | ||||
-rw-r--r-- | Source/cmake.cxx | 6 | ||||
-rw-r--r-- | Source/cmake.h | 48 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 43 | ||||
-rw-r--r-- | Source/kwsys/hashtable.hxx.in | 3 | ||||
-rw-r--r-- | Tests/CompileFeatures/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/Qt4Targets/CMakeLists.txt | 61 | ||||
-rw-r--r-- | Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt | 12 |
15 files changed, 134 insertions, 115 deletions
diff --git a/Help/manual/cmake-properties.7.rst b/Help/manual/cmake-properties.7.rst index a82522d..da21e29 100644 --- a/Help/manual/cmake-properties.7.rst +++ b/Help/manual/cmake-properties.7.rst @@ -16,6 +16,7 @@ Properties of Global Scope /prop_gbl/ALLOW_DUPLICATE_CUSTOM_TARGETS /prop_gbl/AUTOGEN_TARGETS_FOLDER /prop_gbl/AUTOMOC_TARGETS_FOLDER + /prop_gbl/CMAKE_CXX_KNOWN_FEATURES /prop_gbl/DEBUG_CONFIGURATIONS /prop_gbl/DISABLED_FEATURES /prop_gbl/ENABLED_FEATURES diff --git a/Help/manual/cmake-variables.7.rst b/Help/manual/cmake-variables.7.rst index dfdd09b..82242f5 100644 --- a/Help/manual/cmake-variables.7.rst +++ b/Help/manual/cmake-variables.7.rst @@ -258,7 +258,6 @@ Variables for Languages /variable/CMAKE_COMPILER_IS_GNULANG /variable/CMAKE_CXX_COMPILE_FEATURES - /variable/CMAKE_CXX_KNOWN_FEATURES /variable/CMAKE_CXX_STANDARD /variable/CMAKE_CXX_EXTENSIONS /variable/CMAKE_Fortran_MODDIR_DEFAULT diff --git a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst index 7533f6d..b8b0fcd 100644 --- a/Help/variable/CMAKE_CXX_KNOWN_FEATURES.rst +++ b/Help/prop_gbl/CMAKE_CXX_KNOWN_FEATURES.rst @@ -3,7 +3,7 @@ CMAKE_CXX_KNOWN_FEATURES List of C++ features known to this version of CMake. -The features listed in this variable may be known to be available to the +The features listed in this global property may be known to be available to the C++ compiler. If the feature is available with the C++ compiler, it will be listed in the :variable:`CMAKE_CXX_COMPILE_FEATURES` variable. diff --git a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst index 6be0124..1102c21 100644 --- a/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst +++ b/Help/variable/CMAKE_CXX_COMPILE_FEATURES.rst @@ -4,5 +4,5 @@ CMAKE_CXX_COMPILE_FEATURES List of features known to the C++ compiler These features are known to be available for use with the C++ compiler. This -list is a subset of the features listed in the :variable:`CMAKE_CXX_KNOWN_FEATURES` -variable. +list is a subset of the features listed in the :prop_gbl:`CMAKE_CXX_KNOWN_FEATURES` +global property. diff --git a/Modules/Internal/FeatureTesting.cmake b/Modules/Internal/FeatureTesting.cmake index 92d262c..0fff36b 100644 --- a/Modules/Internal/FeatureTesting.cmake +++ b/Modules/Internal/FeatureTesting.cmake @@ -6,7 +6,10 @@ macro(record_compiler_features lang compile_flags feature_list) file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.bin") file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/feature_tests.${lang_lc}" " extern const char features[] = {\"\"\n") - foreach(feature ${CMAKE_${lang}_KNOWN_FEATURES}) + + get_property(known_features GLOBAL PROPERTY CMAKE_${lang}_KNOWN_FEATURES) + + foreach(feature ${known_features}) if (_cmake_feature_test_${feature}) if (${_cmake_feature_test_${feature}} STREQUAL 1) set(_feature_condition "\"1\" ") diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index b1b12d6..8c4daac 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -135,7 +135,9 @@ function (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target set(targetincludes) set(targetdefines) else() - file(WRITE ${_moc_parameters_file} "${_moc_parameters}\n") + set(CMAKE_CONFIGURABLE_FILE_CONTENT "${_moc_parameters}") + configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" + "${_moc_parameters_file}" @ONLY) endif() set(_moc_extra_parameters_file @${_moc_parameters_file}) diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake index 7b8dc93..949954b 100644 --- a/Source/CMakeVersion.cmake +++ b/Source/CMakeVersion.cmake @@ -1,5 +1,5 @@ # CMake version number components. set(CMake_VERSION_MAJOR 3) set(CMake_VERSION_MINOR 0) -set(CMake_VERSION_PATCH 20140505) +set(CMake_VERSION_PATCH 20140507) #set(CMake_VERSION_RC 1) diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index e758720..9ad637a 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -41,54 +41,6 @@ #include <ctype.h> // for isspace #include <assert.h> -#define FOR_EACH_CXX_FEATURE(F) \ - F(cxx_alias_templates) \ - F(cxx_alignas) \ - F(cxx_alignof) \ - F(cxx_attributes) \ - F(cxx_auto_type) \ - F(cxx_constexpr) \ - F(cxx_decltype) \ - F(cxx_decltype_incomplete_return_types) \ - F(cxx_default_function_template_args) \ - F(cxx_defaulted_functions) \ - F(cxx_defaulted_move_initializers) \ - F(cxx_delegating_constructors) \ - F(cxx_deleted_functions) \ - F(cxx_enum_forward_declarations) \ - F(cxx_explicit_conversions) \ - F(cxx_extended_friend_declarations) \ - F(cxx_extern_templates) \ - F(cxx_final) \ - F(cxx_func_identifier) \ - F(cxx_generalized_initializers) \ - F(cxx_inheriting_constructors) \ - F(cxx_inline_namespaces) \ - F(cxx_lambdas) \ - F(cxx_local_type_template_args) \ - F(cxx_long_long_type) \ - F(cxx_noexcept) \ - F(cxx_nonstatic_member_init) \ - F(cxx_nullptr) \ - F(cxx_override) \ - F(cxx_range_for) \ - F(cxx_raw_string_literals) \ - F(cxx_reference_qualified_functions) \ - F(cxx_right_angle_brackets) \ - F(cxx_rvalue_references) \ - F(cxx_sizeof_member) \ - F(cxx_static_assert) \ - F(cxx_strong_enums) \ - F(cxx_template_template_parameters) \ - F(cxx_thread_local) \ - F(cxx_trailing_return_types) \ - F(cxx_unicode_literals) \ - F(cxx_uniform_initialization) \ - F(cxx_unrestricted_unions) \ - F(cxx_user_literals) \ - F(cxx_variadic_macros) \ - F(cxx_variadic_templates) - class cmMakefile::Internals { public: @@ -2499,12 +2451,6 @@ const char* cmMakefile::GetDefinition(const std::string& name) const { this->Internal->VarUsageStack.top().insert(name); } - if (name == "CMAKE_CXX_KNOWN_FEATURES") - { -#define STRING_LIST_ELEMENT(F) ";" #F - return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; -#undef STRING_LIST_ELEMENT - } const char* def = this->Internal->VarStack.top().Get(name); if(!def) { diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 7aada4b..3e78990 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -2273,6 +2273,12 @@ const char *cmake::GetProperty(const std::string& prop, } this->SetProperty("ENABLED_LANGUAGES", lang.c_str()); } + if (prop == "CMAKE_CXX_KNOWN_FEATURES") + { +#define STRING_LIST_ELEMENT(F) ";" #F + return FOR_EACH_CXX_FEATURE(STRING_LIST_ELEMENT) + 1; +#undef STRING_LIST_ELEMENT + } return this->Properties.GetPropertyValue(prop, scope, chain); } diff --git a/Source/cmake.h b/Source/cmake.h index 76a3179..33b4f74 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -458,4 +458,52 @@ private: {"-Wno-dev", "Suppress developer warnings."},\ {"-Wdev", "Enable developer warnings."} +#define FOR_EACH_CXX_FEATURE(F) \ + F(cxx_alias_templates) \ + F(cxx_alignas) \ + F(cxx_alignof) \ + F(cxx_attributes) \ + F(cxx_auto_type) \ + F(cxx_constexpr) \ + F(cxx_decltype) \ + F(cxx_decltype_incomplete_return_types) \ + F(cxx_default_function_template_args) \ + F(cxx_defaulted_functions) \ + F(cxx_defaulted_move_initializers) \ + F(cxx_delegating_constructors) \ + F(cxx_deleted_functions) \ + F(cxx_enum_forward_declarations) \ + F(cxx_explicit_conversions) \ + F(cxx_extended_friend_declarations) \ + F(cxx_extern_templates) \ + F(cxx_final) \ + F(cxx_func_identifier) \ + F(cxx_generalized_initializers) \ + F(cxx_inheriting_constructors) \ + F(cxx_inline_namespaces) \ + F(cxx_lambdas) \ + F(cxx_local_type_template_args) \ + F(cxx_long_long_type) \ + F(cxx_noexcept) \ + F(cxx_nonstatic_member_init) \ + F(cxx_nullptr) \ + F(cxx_override) \ + F(cxx_range_for) \ + F(cxx_raw_string_literals) \ + F(cxx_reference_qualified_functions) \ + F(cxx_right_angle_brackets) \ + F(cxx_rvalue_references) \ + F(cxx_sizeof_member) \ + F(cxx_static_assert) \ + F(cxx_strong_enums) \ + F(cxx_template_template_parameters) \ + F(cxx_thread_local) \ + F(cxx_trailing_return_types) \ + F(cxx_unicode_literals) \ + F(cxx_uniform_initialization) \ + F(cxx_unrestricted_unions) \ + F(cxx_user_literals) \ + F(cxx_variadic_macros) \ + F(cxx_variadic_templates) + #endif diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 720a7c3..6544098 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -88,15 +88,6 @@ typedef int siginfo_t; # include <ifaddrs.h> # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN # endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -# include <execinfo.h> -# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -# include <cxxabi.h> -# endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -# include <dlfcn.h> -# endif -# endif #endif #if defined(__OpenBSD__) || defined(__NetBSD__) @@ -126,16 +117,8 @@ typedef int siginfo_t; # include <ifaddrs.h> # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN # endif -# if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050 -# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -# include <execinfo.h> -# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -# include <cxxabi.h> -# endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -# include <dlfcn.h> -# endif -# endif +# if !(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0 >= 1050) +# undef KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE # endif #endif @@ -150,15 +133,6 @@ typedef int siginfo_t; # define KWSYS_SYSTEMINFORMATION_IMPLEMENT_FQDN # endif # endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) -# include <execinfo.h> -# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) -# include <cxxabi.h> -# endif -# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) -# include <dlfcn.h> -# endif -# endif # if defined(KWSYS_CXX_HAS_RLIMIT64) typedef struct rlimit64 ResourceLimitType; # define GetResourceLimit getrlimit64 @@ -178,6 +152,19 @@ typedef struct rlimit ResourceLimitType; # include <OS.h> #endif +#if defined(KWSYS_SYSTEMINFORMATION_HAS_BACKTRACE) +# include <execinfo.h> +# if defined(KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE) +# include <cxxabi.h> +# endif +# if defined(KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP) +# include <dlfcn.h> +# endif +#else +# undef KWSYS_SYSTEMINFORMATION_HAS_CPP_DEMANGLE +# undef KWSYS_SYSTEMINFORMATION_HAS_SYMBOL_LOOKUP +#endif + #include <memory.h> #include <stdlib.h> #include <stdio.h> diff --git a/Source/kwsys/hashtable.hxx.in b/Source/kwsys/hashtable.hxx.in index 651de82..307f6bc 100644 --- a/Source/kwsys/hashtable.hxx.in +++ b/Source/kwsys/hashtable.hxx.in @@ -310,6 +310,9 @@ struct _Hashtable_node { _Hashtable_node* _M_next; _Val _M_val; + void public_method_to_quiet_warning_about_all_methods_private(); +private: + void operator=(_Hashtable_node<_Val> const&); // poison node assignment }; template <class _Val, class _Key, class _HashFcn, diff --git a/Tests/CompileFeatures/CMakeLists.txt b/Tests/CompileFeatures/CMakeLists.txt index ce5004b..501138d 100644 --- a/Tests/CompileFeatures/CMakeLists.txt +++ b/Tests/CompileFeatures/CMakeLists.txt @@ -22,7 +22,8 @@ macro(run_test feature) endif() endmacro() -foreach(feature ${CMAKE_CXX_KNOWN_FEATURES}) +get_property(features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) +foreach(feature ${features}) run_test(${feature}) endforeach() diff --git a/Tests/Qt4Targets/CMakeLists.txt b/Tests/Qt4Targets/CMakeLists.txt index 7430084..ae0a02b 100644 --- a/Tests/Qt4Targets/CMakeLists.txt +++ b/Tests/Qt4Targets/CMakeLists.txt @@ -37,29 +37,44 @@ set_property(TARGET Qt4WrapMacroTest PROPERTY AUTOMOC OFF) target_include_directories(Qt4WrapMacroTest PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/interface") target_link_libraries(Qt4WrapMacroTest Qt4::QtGui) -set(timeformat "%Y%j%H%M%S") -try_compile(RESULT - "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild" - "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" - IncrementalMoc - CMAKE_FLAGS -DADD_DEF=0 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}") -file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild/moc_foo.cpp" tsvar_before "${timeformat}") -if (NOT tsvar_before) - message(SEND_ERROR "Unable to read timestamp from moc file from first build!") -endif() +macro(test_incremental def) + set(timeformat "%Y%j%H%M%S") + try_compile(RESULT + "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}" + "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" + IncrementalMoc + CMAKE_FLAGS -D${def}=0 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output + ) + file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}/moc_foo.cpp" tsvar_before "${timeformat}") + if (NOT tsvar_before) + message(SEND_ERROR + "Unable to read timestamp from moc file from first build with -D${def}!\n" + "try_compile output:\n${output}" + ) + endif() -execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2) # Ensure that the timestamp will change. + execute_process(COMMAND "${CMAKE_COMMAND}" -E sleep 2) # Ensure that the timestamp will change. -try_compile(RESULT - "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild" - "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" - IncrementalMoc - CMAKE_FLAGS -DADD_DEF=1 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}") -file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild/moc_foo.cpp" tsvar_after "${timeformat}") -if (NOT tsvar_after) - message(SEND_ERROR "Unable to read timestamp from moc file from second build!") -endif() + try_compile(RESULT + "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}" + "${CMAKE_CURRENT_SOURCE_DIR}/IncrementalMoc" + IncrementalMoc + CMAKE_FLAGS -D${def}=1 "-DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}" + OUTPUT_VARIABLE output + ) + file(TIMESTAMP "${CMAKE_CURRENT_BINARY_DIR}/IncrementalMocBuild_${def}/moc_foo.cpp" tsvar_after "${timeformat}") + if (NOT tsvar_after) + message(SEND_ERROR + "Unable to read timestamp from moc file from second build!\n" + "try_compile output:\n${output}" + ) + endif() -if (NOT tsvar_after GREATER tsvar_before) - message(SEND_ERROR "Rebuild did not re-create moc file. Before: ${tsvar_before}. After: ${tsvar_after}") -endif() + if (NOT tsvar_after GREATER tsvar_before) + message(SEND_ERROR "Rebuild did not re-create moc file with -D${def}. Before: ${tsvar_before}. After: ${tsvar_after}") + endif() +endmacro() + +test_incremental(ADD_TARGET_DEF) +test_incremental(ADD_DIR_DEF) diff --git a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt index 4ba0ced..65e2b64 100644 --- a/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt +++ b/Tests/Qt4Targets/IncrementalMoc/CMakeLists.txt @@ -4,10 +4,18 @@ project(IncrementalMoc) find_package(Qt4 REQUIRED) -qt4_generate_moc(foo.h moc_foo.cpp) +if (ADD_TARGET_DEF) + set(target_args TARGET testlib) +endif() + +if (ADD_DIR_DEF) + add_definitions(-DNEW_DEF) +endif() + +qt4_generate_moc(foo.h moc_foo.cpp ${target_args}) add_library(testlib foo.cpp moc_foo.cpp) target_link_libraries(testlib Qt4::QtCore) -if (ADD_DEF) +if (ADD_TARGET_DEF) target_compile_definitions(testlib PRIVATE NEW_DEF) endif() |