summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeASMInformation.cmake9
-rw-r--r--Modules/CMakeCInformation.cmake9
-rw-r--r--Modules/CMakeCXXInformation.cmake9
-rw-r--r--Modules/CMakeFortranInformation.cmake9
-rw-r--r--Modules/CMakeIOSInstallCombined.cmake14
-rw-r--r--Modules/CMakeRCInformation.cmake4
-rw-r--r--Modules/CPackComponent.cmake14
-rw-r--r--Modules/CPackIFW.cmake4
-rw-r--r--Modules/FindHDF5.cmake25
-rw-r--r--Modules/GenerateExportHeader.cmake17
-rw-r--r--Modules/GetPrerequisites.cmake2
-rw-r--r--Modules/InstallRequiredSystemLibraries.cmake4
-rw-r--r--Modules/exportheader.cmake.in2
13 files changed, 89 insertions, 33 deletions
diff --git a/Modules/CMakeASMInformation.cmake b/Modules/CMakeASMInformation.cmake
index 0e547c4..1bb16ac 100644
--- a/Modules/CMakeASMInformation.cmake
+++ b/Modules/CMakeASMInformation.cmake
@@ -76,10 +76,11 @@ endif()
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
- set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
-endif()
+
+foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_ASM${ASM_DIALECT}_FLAGS${c}_INIT}" CMAKE_ASM${ASM_DIALECT}_FLAGS${c}_INIT)
+endforeach()
+
set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
"Flags used by the assembler during all build types.")
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake
index fa87ca8..98eedc4 100644
--- a/Modules/CMakeCInformation.cmake
+++ b/Modules/CMakeCInformation.cmake
@@ -111,10 +111,11 @@ if(NOT CMAKE_MODULE_EXISTS)
endif()
set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-if(CMAKE_C_FLAGS_INIT STREQUAL " ")
- set(CMAKE_C_FLAGS_INIT)
-endif()
+
+foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_C_FLAGS${c}_INIT}" CMAKE_C_FLAGS${c}_INIT)
+endforeach()
+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index b35280f..07e4f39 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -206,10 +206,11 @@ endforeach()
# use _INIT variables so that this only happens the first time
# and you can set these flags in the cmake cache
set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
- set(CMAKE_CXX_FLAGS_INIT)
-endif()
+
+foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_CXX_FLAGS${c}_INIT}" CMAKE_CXX_FLAGS${c}_INIT)
+endforeach()
+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index 1fd0972..45dbfcc 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -173,10 +173,11 @@ endif()
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
-# avoid just having a space as the initial value for the cache
-if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
- set(CMAKE_Fortran_FLAGS_INIT)
-endif()
+
+foreach(c "" _DEBUG _RELEASE _MINSIZEREL _RELWITHDEBINFO)
+ string(STRIP "${CMAKE_Fortran_FLAGS${c}_INIT}" CMAKE_Fortran_FLAGS${c}_INIT)
+endforeach()
+
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.")
diff --git a/Modules/CMakeIOSInstallCombined.cmake b/Modules/CMakeIOSInstallCombined.cmake
index 1256f56..234322c 100644
--- a/Modules/CMakeIOSInstallCombined.cmake
+++ b/Modules/CMakeIOSInstallCombined.cmake
@@ -237,20 +237,30 @@ function(ios_install_combined target destination)
endif()
set(cmd xcrun -f lipo)
+
+ # Do not merge OUTPUT_VARIABLE and ERROR_VARIABLE since latter may contain
+ # some diagnostic information even for the successful run.
execute_process(
COMMAND ${cmd}
RESULT_VARIABLE result
OUTPUT_VARIABLE output
- ERROR_VARIABLE output
+ ERROR_VARIABLE error_output
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_STRIP_TRAILING_WHITESPACE
)
if(NOT result EQUAL 0)
message(
- FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}"
+ FATAL_ERROR "Command failed (${result}): ${cmd}\n\nOutput:\n${output}\nOutput(error):\n${error_output}"
)
endif()
set(_lipo_path ${output})
+ list(LENGTH _lipo_path len)
+ if(NOT len EQUAL 1)
+ message(FATAL_ERROR "Unexpected xcrun output: ${_lipo_path}")
+ endif()
+ if(NOT EXISTS "${_lipo_path}")
+ message(FATAL_ERROR "File not found: ${_lipo_path}")
+ endif()
set(CURRENT_CONFIG "${CMAKE_INSTALL_CONFIG_NAME}")
set(CURRENT_TARGET "${target}")
diff --git a/Modules/CMakeRCInformation.cmake b/Modules/CMakeRCInformation.cmake
index 94abd4b..60276e2 100644
--- a/Modules/CMakeRCInformation.cmake
+++ b/Modules/CMakeRCInformation.cmake
@@ -28,9 +28,9 @@ set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
+string(STRIP "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CMAKE_RC_FLAGS_INIT)
-
-set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
+set (CMAKE_RC_FLAGS "${CMAKE_RC_FLAGS_INIT}" CACHE STRING
"Flags for Windows Resource Compiler.")
# These are the only types of flags that should be passed to the rc
diff --git a/Modules/CPackComponent.cmake b/Modules/CPackComponent.cmake
index 038a717..6a33086 100644
--- a/Modules/CPackComponent.cmake
+++ b/Modules/CPackComponent.cmake
@@ -360,6 +360,20 @@ macro(cpack_append_string_variable_set_command var strvar)
endif ()
endmacro()
+# Macro that appends a SET command for the given list variable name (var)
+# to the macro named strvar, but only if the variable named "var"
+# has been defined. It's like add variable, but wrap each item to quotes.
+# The string will eventually be appended to a CPack configuration file.
+macro(cpack_append_list_variable_set_command var strvar)
+ if (DEFINED ${var})
+ string(APPEND ${strvar} "set(${var}")
+ foreach(_val IN LISTS ${var})
+ string(APPEND ${strvar} "\n \"${_val}\"")
+ endforeach()
+ string(APPEND ${strvar} ")\n")
+ endif ()
+endmacro()
+
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been set to true. The string will eventually be
diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake
index 083fc28..2f0e03e 100644
--- a/Modules/CPackIFW.cmake
+++ b/Modules/CPackIFW.cmake
@@ -571,7 +571,7 @@ macro(cpack_ifw_configure_component compname)
endforeach()
foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
- cpack_append_variable_set_command(
+ cpack_append_list_variable_set_command(
CPACK_IFW_COMPONENT_${_CPACK_IFWCOMP_UNAME}_${_IFW_ARG_NAME}
_CPACK_IFWCOMP_STR)
endforeach()
@@ -604,7 +604,7 @@ macro(cpack_ifw_configure_component_group grpname)
endforeach()
foreach(_IFW_ARG_NAME ${_IFW_MULTI_ARGS})
- cpack_append_variable_set_command(
+ cpack_append_list_variable_set_command(
CPACK_IFW_COMPONENT_GROUP_${_CPACK_IFWGRP_UNAME}_${_IFW_ARG_NAME}
_CPACK_IFWGRP_STR)
endforeach()
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/GenerateExportHeader.cmake b/Modules/GenerateExportHeader.cmake
index 6389d30..6205b8c 100644
--- a/Modules/GenerateExportHeader.cmake
+++ b/Modules/GenerateExportHeader.cmake
@@ -20,6 +20,7 @@
# [NO_DEPRECATED_MACRO_NAME <no_deprecated_macro_name>]
# [DEFINE_NO_DEPRECATED]
# [PREFIX_NAME <prefix_name>]
+# [CUSTOM_CONTENT_FROM_VARIABLE <variable>]
# )
#
#
@@ -60,8 +61,10 @@
# The CMake fragment will generate a file in the
# ``${CMAKE_CURRENT_BINARY_DIR}`` called ``somelib_export.h`` containing the
# macros ``SOMELIB_EXPORT``, ``SOMELIB_NO_EXPORT``, ``SOMELIB_DEPRECATED``,
-# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``. The
-# resulting file should be installed with other headers in the library.
+# ``SOMELIB_DEPRECATED_EXPORT`` and ``SOMELIB_DEPRECATED_NO_EXPORT``.
+# They will be followed by content taken from the variable specified by
+# the ``CUSTOM_CONTENT_FROM_VARIABLE`` option, if any.
+# The resulting file should be installed with other headers in the library.
#
# The ``BASE_NAME`` argument can be used to override the file name and the
# names used for the macros:
@@ -288,7 +291,7 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
set(options DEFINE_NO_DEPRECATED)
set(oneValueArgs PREFIX_NAME BASE_NAME EXPORT_MACRO_NAME EXPORT_FILE_NAME
DEPRECATED_MACRO_NAME NO_EXPORT_MACRO_NAME STATIC_DEFINE
- NO_DEPRECATED_MACRO_NAME)
+ NO_DEPRECATED_MACRO_NAME CUSTOM_CONTENT_FROM_VARIABLE)
set(multiValueArgs)
cmake_parse_arguments(_GEH "${options}" "${oneValueArgs}" "${multiValueArgs}"
@@ -361,6 +364,14 @@ macro(_DO_GENERATE_EXPORT_HEADER TARGET_LIBRARY)
endif()
string(MAKE_C_IDENTIFIER ${EXPORT_IMPORT_CONDITION} EXPORT_IMPORT_CONDITION)
+ if(_GEH_CUSTOM_CONTENT_FROM_VARIABLE)
+ if(DEFINED "${_GEH_CUSTOM_CONTENT_FROM_VARIABLE}")
+ set(CUSTOM_CONTENT "${${_GEH_CUSTOM_CONTENT_FROM_VARIABLE}}")
+ else()
+ set(CUSTOM_CONTENT "")
+ endif()
+ endif()
+
configure_file("${_GENERATE_EXPORT_HEADER_MODULE_DIR}/exportheader.cmake.in"
"${EXPORT_FILE_NAME}" @ONLY)
endmacro()
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 1981040..631220b 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
if(WIN32)
find_program(gp_grep_cmd findstr)
else()
diff --git a/Modules/InstallRequiredSystemLibraries.cmake b/Modules/InstallRequiredSystemLibraries.cmake
index aa84077..1c6e751 100644
--- a/Modules/InstallRequiredSystemLibraries.cmake
+++ b/Modules/InstallRequiredSystemLibraries.cmake
@@ -25,8 +25,8 @@
#
# ``CMAKE_INSTALL_UCRT_LIBRARIES``
# Set to TRUE to install the Windows Universal CRT libraries for
-# app-local deployment. This is meaningful only with MSVC from
-# Visual Studio 2015 or higher.
+# app-local deployment (e.g. to Windows XP). This is meaningful
+# only with MSVC from Visual Studio 2015 or higher.
#
# ``CMAKE_INSTALL_MFC_LIBRARIES``
# Set to TRUE to install the MSVC MFC runtime libraries.
diff --git a/Modules/exportheader.cmake.in b/Modules/exportheader.cmake.in
index 7cfbcbd..9dd75bf 100644
--- a/Modules/exportheader.cmake.in
+++ b/Modules/exportheader.cmake.in
@@ -38,5 +38,5 @@
# define @NO_DEPRECATED_MACRO_NAME@
# endif
#endif
-
+@CUSTOM_CONTENT@
#endif