diff options
-rw-r--r-- | Help/prop_tgt/CXX_EXTENSIONS.rst | 3 | ||||
-rw-r--r-- | Help/prop_tgt/CXX_STANDARD.rst | 2 | ||||
-rw-r--r-- | Help/prop_tgt/C_EXTENSIONS.rst | 3 | ||||
-rw-r--r-- | Help/prop_tgt/C_STANDARD.rst | 2 | ||||
-rw-r--r-- | Help/prop_tgt/FRAMEWORK.rst | 4 | ||||
-rw-r--r-- | Help/prop_tgt/SOVERSION.rst | 25 | ||||
-rw-r--r-- | Help/prop_tgt/VERSION.rst | 27 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 25 | ||||
-rw-r--r-- | Modules/GetPrerequisites.cmake | 2 | ||||
-rw-r--r-- | Source/cmNinjaTargetGenerator.cxx | 6 | ||||
-rw-r--r-- | Tests/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/CMakeLists.txt | 7 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/lib.cpp | 4 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/main.cpp | 6 | ||||
-rw-r--r-- | Tests/VSResourceNinjaForceRSP/test.rc | 4 |
15 files changed, 101 insertions, 22 deletions
diff --git a/Help/prop_tgt/CXX_EXTENSIONS.rst b/Help/prop_tgt/CXX_EXTENSIONS.rst index 0f547e2..280bb3a 100644 --- a/Help/prop_tgt/CXX_EXTENSIONS.rst +++ b/Help/prop_tgt/CXX_EXTENSIONS.rst @@ -6,7 +6,8 @@ Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be used. For some compilers, this results in adding a flag such as ``-std=gnu++11`` instead of ``-std=c++11`` to the compile line. This -property is ``ON`` by default. +property is ``ON`` by default. The basic C++ standard level is +controlled by the :prop_tgt:`CXX_STANDARD` target property. See the :manual:`cmake-compile-features(7)` manual for information on compile features and a list of supported compilers. diff --git a/Help/prop_tgt/CXX_STANDARD.rst b/Help/prop_tgt/CXX_STANDARD.rst index edc9ba5..5b186c1 100644 --- a/Help/prop_tgt/CXX_STANDARD.rst +++ b/Help/prop_tgt/CXX_STANDARD.rst @@ -22,6 +22,8 @@ with a compiler which does not support ``-std=gnu++11`` or an equivalent flag will not result in an error or warning, but will instead add the ``-std=gnu++98`` flag if supported. This "decay" behavior may be controlled with the :prop_tgt:`CXX_STANDARD_REQUIRED` target property. +Additionally, the :prop_tgt:`CXX_EXTENSIONS` target property may be used to +control whether compiler-specific extensions are enabled on a per-target basis. See the :manual:`cmake-compile-features(7)` manual for information on compile features and a list of supported compilers. diff --git a/Help/prop_tgt/C_EXTENSIONS.rst b/Help/prop_tgt/C_EXTENSIONS.rst index fce67f4..05b14ce 100644 --- a/Help/prop_tgt/C_EXTENSIONS.rst +++ b/Help/prop_tgt/C_EXTENSIONS.rst @@ -6,7 +6,8 @@ Boolean specifying whether compiler specific extensions are requested. This property specifies whether compiler specific extensions should be used. For some compilers, this results in adding a flag such as ``-std=gnu11`` instead of ``-std=c11`` to the compile line. This -property is ``ON`` by default. +property is ``ON`` by default. The basic C standard level is +controlled by the :prop_tgt:`C_STANDARD` target property. See the :manual:`cmake-compile-features(7)` manual for information on compile features and a list of supported compilers. diff --git a/Help/prop_tgt/C_STANDARD.rst b/Help/prop_tgt/C_STANDARD.rst index 5e36821..815a686 100644 --- a/Help/prop_tgt/C_STANDARD.rst +++ b/Help/prop_tgt/C_STANDARD.rst @@ -22,6 +22,8 @@ with a compiler which does not support ``-std=gnu11`` or an equivalent flag will not result in an error or warning, but will instead add the ``-std=gnu99`` or ``-std=gnu90`` flag if supported. This "decay" behavior may be controlled with the :prop_tgt:`C_STANDARD_REQUIRED` target property. +Additionally, the :prop_tgt:`C_EXTENSIONS` target property may be used to +control whether compiler-specific extensions are enabled on a per-target basis. See the :manual:`cmake-compile-features(7)` manual for information on compile features and a list of supported compilers. diff --git a/Help/prop_tgt/FRAMEWORK.rst b/Help/prop_tgt/FRAMEWORK.rst index 6c212c3..8120c36 100644 --- a/Help/prop_tgt/FRAMEWORK.rst +++ b/Help/prop_tgt/FRAMEWORK.rst @@ -26,6 +26,10 @@ Example of creation ``dynamicFramework``: FRAMEWORK_VERSION C MACOSX_FRAMEWORK_IDENTIFIER com.cmake.dynamicFramework MACOSX_FRAMEWORK_INFO_PLIST Info.plist + # "current version" in semantic format in Mach-O binary file + VERSION 16.4.0 + # "compatibility version" in semantic format in Mach-O binary file + SOVERSION 1.0.0 PUBLIC_HEADER dynamicFramework.h XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY "iPhone Developer" ) diff --git a/Help/prop_tgt/SOVERSION.rst b/Help/prop_tgt/SOVERSION.rst index 672ff23..82b6b97 100644 --- a/Help/prop_tgt/SOVERSION.rst +++ b/Help/prop_tgt/SOVERSION.rst @@ -3,12 +3,25 @@ SOVERSION What version number is this target. -For shared libraries VERSION and SOVERSION can be used to specify the -build version and API version respectively. When building or +For shared libraries :prop_tgt:`VERSION` and ``SOVERSION`` can be used to +specify the build version and API version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. -SOVERSION is ignored if NO_SONAME property is set. For shared -libraries and executables on Windows the VERSION attribute is parsed -to extract a "major.minor" version number. These numbers are used as -the image version of the binary. +``SOVERSION`` is ignored if :prop_tgt:`NO_SONAME` property is set. + +Windows Versions +^^^^^^^^^^^^^^^^ + +For shared libraries and executables on Windows the :prop_tgt:`VERSION` +attribute is parsed to extract a ``<major>.<minor>`` version number. +These numbers are used as the image version of the binary. + +Mach-O Versions +^^^^^^^^^^^^^^^ + +For shared libraries and executables on Mach-O systems (e.g. OS X, iOS), +the ``SOVERSION`` property corresponds to *compatibility version* and +:prop_tgt:`VERSION` to *current version*. See the :prop_tgt:`FRAMEWORK` target +property for an example. Versions of Mach-O binaries may be checked with the +``otool -L <binary>`` command. diff --git a/Help/prop_tgt/VERSION.rst b/Help/prop_tgt/VERSION.rst index 87f6c49..66e7bde 100644 --- a/Help/prop_tgt/VERSION.rst +++ b/Help/prop_tgt/VERSION.rst @@ -3,14 +3,27 @@ VERSION What version number is this target. -For shared libraries VERSION and SOVERSION can be used to specify the -build version and API version respectively. When building or +For shared libraries ``VERSION`` and :prop_tgt:`SOVERSION` can be used +to specify the build version and API version respectively. When building or installing appropriate symlinks are created if the platform supports symlinks and the linker supports so-names. If only one of both is specified the missing is assumed to have the same version number. For -executables VERSION can be used to specify the build version. When +executables ``VERSION`` can be used to specify the build version. When building or installing appropriate symlinks are created if the -platform supports symlinks. For shared libraries and executables on -Windows the VERSION attribute is parsed to extract a "major.minor" -version number. These numbers are used as the image version of the -binary. +platform supports symlinks. + +Windows Versions +^^^^^^^^^^^^^^^^ + +For shared libraries and executables on Windows the ``VERSION`` +attribute is parsed to extract a ``<major>.<minor>`` version number. +These numbers are used as the image version of the binary. + +Mach-O Versions +^^^^^^^^^^^^^^^ + +For shared libraries and executables on Mach-O systems (e.g. OS X, iOS), +the :prop_tgt:`SOVERSION` property correspond to *compatibility version* and +``VERSION`` to *current version*. See the :prop_tgt:`FRAMEWORK` target +property for an example. Versions of Mach-O binaries may be checked with the +``otool -L <binary>`` command. diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index bc0d50b..b074f63 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -362,20 +362,35 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) set(_suffix "-shared") endif() foreach(_lang ${HDF5_LANGUAGE_BINDINGS}) - get_target_property(_lang_location ${HDF5_${_component}_TARGET}${_suffix} LOCATION) + + #Older versions of hdf5 don't have a static/shared suffix so + #if we detect that occurrence clear the suffix + if(_suffix AND NOT TARGET ${HDF5_${_lang}_TARGET}${_suffix}) + if(NOT TARGET ${HDF5_${_lang}_TARGET}) + #cant find this component with our without the suffix + #so bail out, and let the following locate HDF5 + set(HDF5_FOUND FALSE) + break() + endif() + set(_suffix "") + endif() + + get_target_property(_lang_location ${HDF5_${_lang}_TARGET}${_suffix} LOCATION) if( _lang_location ) set(HDF5_${_lang}_LIBRARY ${_lang_location} CACHE PATH "HDF5 ${_lang} library" ) mark_as_advanced(HDF5_${_lang}_LIBRARY) list(APPEND HDF5_LIBRARIES ${HDF5_${_lang}_LIBRARY}) + set(HDF5_${_lang}_LIBRARIES ${HDF5_${_lang}_LIBRARY}) endif() if(FIND_HL) get_target_property(_lang_hl_location ${HDF5_${_lang}_HL_TARGET}${_suffix} LOCATION) - if( _lang_location ) - set(HDF5_${_lang}_HL_LIBRARY ${_lang_location} CACHE PATH + if( _lang_hl_location ) + set(HDF5_${_lang}_HL_LIBRARY ${_lang_hl_location} CACHE PATH "HDF5 ${_lang} HL library" ) - mark_as_advanced(HDF5_${_lang}_LIBRARY) + mark_as_advanced(HDF5_${_lang}_HL_LIBRARY) list(APPEND HDF5_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY}) + set(HDF5_${_lang}_HL_LIBRARIES ${HDF5_${_lang}_HL_LIBRARY}) endif() endif() endforeach() @@ -411,6 +426,8 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT) set(HDF5_${__lang}_DEFINITIONS) set(HDF5_${__lang}_INCLUDE_DIRS) set(HDF5_${__lang}_LIBRARIES) + set(HDF5_${__lang}_HL_LIBRARIES) + mark_as_advanced(HDF5_${__lang}_COMPILER_EXECUTABLE_NO_INTERROGATE) mark_as_advanced(HDF5_${__lang}_DEFINITIONS) mark_as_advanced(HDF5_${__lang}_INCLUDE_DIRS) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 375349f..aa5bf28 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -746,7 +746,7 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa set(gp_regex_error "") set(gp_regex_fallback "") set(gp_regex_cmp_count 1) - # objdump generaates copious output so we create a grep filter to pre-filter results + # objdump generates copious output so we create a grep filter to pre-filter results find_program(gp_grep_cmd grep) if(gp_grep_cmd) set(gp_cmd_maybe_filter COMMAND ${gp_grep_cmd} "^[[:blank:]]*DLL Name: ") diff --git a/Source/cmNinjaTargetGenerator.cxx b/Source/cmNinjaTargetGenerator.cxx index 1aa2ddb..bad5e2f 100644 --- a/Source/cmNinjaTargetGenerator.cxx +++ b/Source/cmNinjaTargetGenerator.cxx @@ -316,7 +316,7 @@ void cmNinjaTargetGenerator::WriteCompileRule(const std::string& lang) std::string rspcontent; std::string responseFlag; - if (this->ForceResponseFile()) { + if (lang != "RC" && this->ForceResponseFile()) { rspfile = "$RSP_FILE"; responseFlag = "@" + rspfile; rspcontent = " $DEFINES $INCLUDES $FLAGS"; @@ -593,7 +593,9 @@ void cmNinjaTargetGenerator::WriteObjectBuildStatement( this->SetMsvcTargetPdbVariable(vars); - int const commandLineLengthLimit = this->ForceResponseFile() ? -1 : 0; + bool const isRC = (language == "RC"); + int const commandLineLengthLimit = + ((!isRC && this->ForceResponseFile())) ? -1 : 0; std::string const rspfile = objectFileName + ".rsp"; this->GetGlobalGenerator()->WriteBuild( diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 2db5ded..f21e430 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -274,6 +274,9 @@ if(BUILD_TESTING) endif() if(TEST_RESOURCES) ADD_TEST_MACRO(VSResource VSResource) + if (CMAKE_GENERATOR MATCHES "Ninja") + add_test_macro(VSResourceNinjaForceRSP VSResourceNinjaForceRSP) + endif () endif() ADD_TEST_MACRO(MSManifest MSManifest) ADD_TEST_MACRO(Simple Simple) diff --git a/Tests/VSResourceNinjaForceRSP/CMakeLists.txt b/Tests/VSResourceNinjaForceRSP/CMakeLists.txt new file mode 100644 index 0000000..29ba0ce --- /dev/null +++ b/Tests/VSResourceNinjaForceRSP/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 2.8.4) +project(VSResourceNinjaForceRSP) + +set(CMAKE_NINJA_FORCE_RESPONSE_FILE TRUE) + +add_library(ResourceLib lib.cpp test.rc) +add_executable(VSResourceNinjaForceRSP main.cpp test.rc) diff --git a/Tests/VSResourceNinjaForceRSP/lib.cpp b/Tests/VSResourceNinjaForceRSP/lib.cpp new file mode 100644 index 0000000..c912397 --- /dev/null +++ b/Tests/VSResourceNinjaForceRSP/lib.cpp @@ -0,0 +1,4 @@ +int lib() +{ + return 0; +} diff --git a/Tests/VSResourceNinjaForceRSP/main.cpp b/Tests/VSResourceNinjaForceRSP/main.cpp new file mode 100644 index 0000000..247411d --- /dev/null +++ b/Tests/VSResourceNinjaForceRSP/main.cpp @@ -0,0 +1,6 @@ +int main(int argc, char** argv) +{ + (void)argc; + (void)argv; + return 0; +} diff --git a/Tests/VSResourceNinjaForceRSP/test.rc b/Tests/VSResourceNinjaForceRSP/test.rc new file mode 100644 index 0000000..1ffade6 --- /dev/null +++ b/Tests/VSResourceNinjaForceRSP/test.rc @@ -0,0 +1,4 @@ +STRINGTABLE +BEGIN + 1234 "5" +END |