summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Help/manual/cmake-compile-features.7.rst8
-rw-r--r--Help/release/dev/cpack-productbuild-signing.rst8
-rw-r--r--Help/release/dev/gcc-features.rst5
-rw-r--r--Modules/AndroidTestUtilities.cmake17
-rw-r--r--Modules/AndroidTestUtilities/PushToAndroidDevice.cmake4
-rw-r--r--Modules/CPackProductBuild.cmake20
-rw-r--r--Modules/Compiler/GNU-C-FeatureTests.cmake10
-rw-r--r--Modules/Compiler/GNU-C.cmake9
-rw-r--r--Modules/Compiler/GNU-CXX.cmake2
-rw-r--r--Modules/FindHDF5.cmake185
-rw-r--r--Modules/FindMPI.cmake4
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/CPack/cmCPackProductBuildGenerator.cxx22
-rw-r--r--Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt28
-rw-r--r--Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake13
-rw-r--r--Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake5
17 files changed, 230 insertions, 113 deletions
diff --git a/Help/manual/cmake-compile-features.7.rst b/Help/manual/cmake-compile-features.7.rst
index 4f48ad9..448fe9a 100644
--- a/Help/manual/cmake-compile-features.7.rst
+++ b/Help/manual/cmake-compile-features.7.rst
@@ -338,6 +338,14 @@ versions specified for each:
* ``SunPro``: Oracle SolarisStudio version 12.4.
* ``Intel``: Intel compiler versions 12.1 through 17.0.
+CMake is currently aware of the :prop_tgt:`C standards <C_STANDARD>`
+and :prop_gbl:`compile features <CMAKE_C_KNOWN_FEATURES>` available from
+the following :variable:`compiler ids <CMAKE_<LANG>_COMPILER_ID>` as of the
+versions specified for each:
+
+* all compilers and versions listed above for C++
+* ``GNU``: GNU compiler versions 3.4 through 5.0.
+
CMake is currently aware of the :prop_tgt:`CUDA standards <CUDA_STANDARD>`
from the following :variable:`compiler ids <CMAKE_<LANG>_COMPILER_ID>` as of the
versions specified for each:
diff --git a/Help/release/dev/cpack-productbuild-signing.rst b/Help/release/dev/cpack-productbuild-signing.rst
new file mode 100644
index 0000000..0b91b38
--- /dev/null
+++ b/Help/release/dev/cpack-productbuild-signing.rst
@@ -0,0 +1,8 @@
+cpack-productbuild-signing
+--------------------------
+
+* The :module:`CPackProductBuild` module gained options to sign packages.
+ See the variables :variable:`CPACK_PRODUCTBUILD_IDENTITY_NAME`,
+ :variable:`CPACK_PRODUCTBUILD_KEYCHAIN_PATH`,
+ :variable:`CPACK_PKGBUILD_IDENTITY_NAME`, and
+ :variable:`CPACK_PKGBUILD_KEYCHAIN_PATH`.
diff --git a/Help/release/dev/gcc-features.rst b/Help/release/dev/gcc-features.rst
new file mode 100644
index 0000000..c6959ab
--- /dev/null
+++ b/Help/release/dev/gcc-features.rst
@@ -0,0 +1,5 @@
+gcc-features
+------------
+
+* The :manual:`Compile Features <cmake-compile-features(7)>` functionality
+ is now aware of the availability of C99 in gcc since version 3.4.
diff --git a/Modules/AndroidTestUtilities.cmake b/Modules/AndroidTestUtilities.cmake
index a0a74fa..62d04f3 100644
--- a/Modules/AndroidTestUtilities.cmake
+++ b/Modules/AndroidTestUtilities.cmake
@@ -110,11 +110,18 @@ function(android_add_test_data test_name)
endforeach()
set(DATA_TARGET_NAME "${test_name}")
- ExternalData_Expand_Arguments(
- ${DATA_TARGET_NAME}
- extern_data_output
- ${AST_FILES})
- ExternalData_Add_Target(${DATA_TARGET_NAME})
+ string(FIND "${AST_FILES}" "DATA{" data_files_found)
+ if(${data_files_found} GREATER "-1")
+ # Use ExternalData if any DATA{} files were found.
+ ExternalData_Expand_Arguments(
+ ${DATA_TARGET_NAME}
+ extern_data_output
+ ${AST_FILES})
+ ExternalData_Add_Target(${DATA_TARGET_NAME})
+ else()
+ add_custom_target(${DATA_TARGET_NAME} ALL)
+ set(extern_data_output ${AST_FILES})
+ endif()
# For regular files on Linux, just copy them directly.
foreach(path ${AST_FILES})
diff --git a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
index d8ca730..04529b1 100644
--- a/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
+++ b/Modules/AndroidTestUtilities/PushToAndroidDevice.cmake
@@ -39,7 +39,9 @@ function(android_push_test_files_to_device)
# if(file_exists) will return true.
macro(check_device_file_exists device_file file_exists)
set(${file_exists} "")
- execute_adb_command(shell ls ${device_file})
+ execute_process(
+ COMMAND ${adb_executable} shell ls ${device_file}
+ OUTPUT_VARIABLE out_var ERROR_VARIABLE out_var)
if(NOT out_var) # when a directory exists but is empty the output is empty
set(${file_exists} "YES")
else()
diff --git a/Modules/CPackProductBuild.cmake b/Modules/CPackProductBuild.cmake
index ea2fa7c..d545d3e 100644
--- a/Modules/CPackProductBuild.cmake
+++ b/Modules/CPackProductBuild.cmake
@@ -20,9 +20,29 @@
# the automatically detected command (or specify its location if the
# auto-detection fails to find it.)
#
+# .. variable:: CPACK_PRODUCTBUILD_IDENTITY_NAME
+#
+# Adds a digital signature to the resulting package.
+#
+#
+# .. variable:: CPACK_PRODUCTBUILD_KEYCHAIN_PATH
+#
+# Specify a specific keychain to search for the signing identity.
+#
+#
# .. variable:: CPACK_COMMAND_PKGBUILD
#
# Path to the pkgbuild(1) command used to generate an OS X component package
# on OS X. This variable can be used to override the automatically detected
# command (or specify its location if the auto-detection fails to find it.)
#
+#
+# .. variable:: CPACK_PKGBUILD_IDENTITY_NAME
+#
+# Adds a digital signature to the resulting package.
+#
+#
+# .. variable:: CPACK_PKGBUILD_KEYCHAIN_PATH
+#
+# Specify a specific keychain to search for the signing identity.
+#
diff --git a/Modules/Compiler/GNU-C-FeatureTests.cmake b/Modules/Compiler/GNU-C-FeatureTests.cmake
index b3fe33f..0ab5265 100644
--- a/Modules/Compiler/GNU-C-FeatureTests.cmake
+++ b/Modules/Compiler/GNU-C-FeatureTests.cmake
@@ -1,5 +1,5 @@
-set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404")
+set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 304")
# GNU 4.7 correctly sets __STDC_VERSION__ to 201112L, but GNU 4.6 sets it
# to 201000L. As the former is strictly greater than the latter, test only
@@ -8,10 +8,10 @@ set(_cmake_oldestSupported "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404")
# to the distinction between __cplusplus and __GXX_EXPERIMENTAL_CXX0X__ tests.
set(GNU46_C11 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 406 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201000L")
set(_cmake_feature_test_c_static_assert "${GNU46_C11}")
-# Since 4.4 at least:
-set(GNU44_C99 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 404 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
-set(_cmake_feature_test_c_restrict "${GNU44_C99}")
-set(_cmake_feature_test_c_variadic_macros "${GNU44_C99}")
+# Since 3.4 at least:
+set(GNU34_C99 "(__GNUC__ * 100 + __GNUC_MINOR__) >= 304 && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L")
+set(_cmake_feature_test_c_restrict "${GNU34_C99}")
+set(_cmake_feature_test_c_variadic_macros "${GNU34_C99}")
set(GNU_C90 "${_cmake_oldestSupported}")
set(_cmake_feature_test_c_function_prototypes "${GNU_C90}")
diff --git a/Modules/Compiler/GNU-C.cmake b/Modules/Compiler/GNU-C.cmake
index 05c3bb2..3f02618 100644
--- a/Modules/Compiler/GNU-C.cmake
+++ b/Modules/Compiler/GNU-C.cmake
@@ -4,12 +4,12 @@ __compiler_gnu(C)
if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.5)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c90")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu90")
-elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_C90_STANDARD_COMPILE_OPTION "-std=c89")
set(CMAKE_C90_EXTENSION_COMPILE_OPTION "-std=gnu89")
endif()
-if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
set(CMAKE_C99_STANDARD_COMPILE_OPTION "-std=c99")
set(CMAKE_C99_EXTENSION_COMPILE_OPTION "-std=gnu99")
endif()
@@ -22,7 +22,7 @@ elseif (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.6)
set(CMAKE_C11_EXTENSION_COMPILE_OPTION "-std=gnu1x")
endif()
-if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
if (NOT CMAKE_C_COMPILER_FORCED)
if (NOT CMAKE_C_STANDARD_COMPUTED_DEFAULT)
message(FATAL_ERROR "CMAKE_C_STANDARD_COMPUTED_DEFAULT should be set for ${CMAKE_C_COMPILER_ID} (${CMAKE_C_COMPILER}) version ${CMAKE_C_COMPILER_VERSION}")
@@ -38,10 +38,9 @@ if(NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
endif()
endif()
-
macro(cmake_record_c_compile_features)
set(_result 0)
- if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 4.4)
+ if (NOT CMAKE_C_COMPILER_VERSION VERSION_LESS 3.4)
if(_result EQUAL 0 AND CMAKE_C11_STANDARD_COMPILE_OPTION)
_record_compiler_features_c(11)
endif()
diff --git a/Modules/Compiler/GNU-CXX.cmake b/Modules/Compiler/GNU-CXX.cmake
index b04ea11..c007c98 100644
--- a/Modules/Compiler/GNU-CXX.cmake
+++ b/Modules/Compiler/GNU-CXX.cmake
@@ -6,7 +6,7 @@ if (WIN32)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fno-keep-inline-dllexport")
endif()
else()
- if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.2)
+ if(NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.0)
set(CMAKE_CXX_COMPILE_OPTIONS_VISIBILITY_INLINES_HIDDEN "-fvisibility-inlines-hidden")
endif()
endif()
diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake
index 6e5a25e..e1199a7 100644
--- a/Modules/FindHDF5.cmake
+++ b/Modules/FindHDF5.cmake
@@ -340,71 +340,61 @@ macro( _HDF5_parse_compile_line
libraries
libraries_hl)
- # Match the include paths
- set( RE " -I *([^\" ]+|\"[^\"]+\")")
- string( REGEX MATCHALL "${RE}" include_path_flags "${${compile_line_var}}")
- foreach( IPATH IN LISTS include_path_flags )
- string( REGEX REPLACE "${RE}" "\\1" IPATH "${IPATH}" )
- list( APPEND ${include_paths} ${IPATH} )
- endforeach()
-
- # Match the definitions
- set( RE " -D([^ ]*)")
- string( REGEX MATCHALL "${RE}" definition_flags "${${compile_line_var}}" )
- foreach( DEF IN LISTS definition_flags )
- string( STRIP "${DEF}" DEF )
- list( APPEND ${definitions} ${DEF} )
- endforeach()
-
- # Match the library paths
- set( RE " -L *([^\" ]+|\"[^\"]+\")")
- string( REGEX MATCHALL "${RE}" library_path_flags "${${compile_line_var}}")
- foreach( LPATH IN LISTS library_path_flags )
- string( REGEX REPLACE "${RE}" "\\1" LPATH "${LPATH}" )
- list( APPEND ${library_paths} ${LPATH} )
- endforeach()
-
- # now search for the lib names specified in the compile line (match -l...)
- # match only -l's preceded by a space or comma
- set( RE " -l *([^\" ]+|\"[^\"]+\")")
- string( REGEX MATCHALL "${RE}" library_name_flags "${${compile_line_var}}")
- foreach( LNAME IN LISTS library_name_flags )
- string( REGEX REPLACE "${RE}" "\\1" LNAME "${LNAME}" )
- if(LNAME MATCHES ".*hl")
- list(APPEND ${libraries_hl} ${LNAME})
- else()
- list(APPEND ${libraries} ${LNAME})
- endif()
- endforeach()
+ if(UNIX)
+ separate_arguments(_HDF5_COMPILE_ARGS UNIX_COMMAND "${${compile_line_var}}")
+ else()
+ separate_arguments(_HDF5_COMPILE_ARGS WINDOWS_COMMAND "${${compile_line_var}}")
+ endif()
- # now search for full library paths with no flags
- set( RE " ([^\" ]+|\"[^\"]+\")")
- string( REGEX MATCHALL "${RE}" library_name_noflags "${${compile_line_var}}")
- foreach( LIB IN LISTS library_name_noflags )
- string( REGEX REPLACE "${RE}" "\\1" LIB "${LIB}" )
- get_filename_component(LIB "${LIB}" ABSOLUTE)
- if(NOT EXISTS ${LIB} OR IS_DIRECTORY ${LIB})
- continue()
- endif()
- get_filename_component(LPATH ${LIB} DIRECTORY)
- get_filename_component(LNAME ${LIB} NAME_WE)
- string( REGEX REPLACE "^lib" "" LNAME ${LNAME} )
- list( APPEND ${library_paths} ${LPATH} )
- if(LNAME MATCHES ".*hl")
- list(APPEND ${libraries_hl} ${LNAME})
- else()
- list(APPEND ${libraries} ${LNAME})
- endif()
- endforeach()
+ foreach(arg IN LISTS _HDF5_COMPILE_ARGS)
+ if("${arg}" MATCHES "^-I(.*)$")
+ # include directory
+ list(APPEND ${include_paths} "${CMAKE_MATCH_1}")
+ elseif("${arg}" MATCHES "^-D(.*)$")
+ # compile definition
+ list(APPEND ${definitions} "${CMAKE_MATCH_1}")
+ elseif("${arg}" MATCHES "^-L(.*)$")
+ # library search path
+ list(APPEND ${library_paths} "${CMAKE_MATCH_1}")
+ elseif("${arg}" MATCHES "^-l(hdf5.*hl.*)$")
+ # library name (hl)
+ list(APPEND ${libraries_hl} "${CMAKE_MATCH_1}")
+ elseif("${arg}" MATCHES "^-l(.*)$")
+ # library name
+ list(APPEND ${libraries} "${CMAKE_MATCH_1}")
+ elseif("${arg}" MATCHES "^(.:)?[/\\].*\\.(a|so|dylib|sl|lib)$")
+ # library file
+ if(NOT EXISTS "${arg}")
+ continue()
+ endif()
+ get_filename_component(_HDF5_LPATH "${arg}" DIRECTORY)
+ get_filename_component(_HDF5_LNAME "${arg}" NAME_WE)
+ string(REGEX REPLACE "^lib" "" _HDF5_LNAME "${_HDF5_LNAME}")
+ list(APPEND ${library_paths} "${_HDF5_LPATH}")
+ if(_HDF5_LNAME MATCHES "hdf5.*hl")
+ list(APPEND ${libraries_hl} "${_HDF5_LNAME}")
+ else()
+ list(APPEND ${libraries} "${_HDF5_LNAME}")
+ endif()
+ endif()
+ endforeach()
endmacro()
if(NOT HDF5_ROOT)
set(HDF5_ROOT $ENV{HDF5_ROOT})
endif()
+if(HDF5_ROOT)
+ set(_HDF5_SEARCH_OPTS NO_DEFAULT_PATH)
+else()
+ set(_HDF5_SEARCH_OPTS)
+endif()
# Try to find HDF5 using an installed hdf5-config.cmake
-if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
- find_package(HDF5 QUIET NO_MODULE)
+if(NOT HDF5_FOUND)
+ find_package(HDF5 QUIET NO_MODULE
+ HINTS ${HDF5_ROOT}
+ ${_HDF5_SEARCH_OPTS}
+ )
if( HDF5_FOUND)
set(HDF5_IS_PARALLEL ${HDF5_ENABLE_PARALLEL})
set(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIR})
@@ -458,7 +448,7 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
endif()
endif()
-if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
+if(NOT HDF5_FOUND)
set(_HDF5_NEED_TO_SEARCH False)
set(HDF5_COMPILER_NO_INTERROGATE True)
# Only search for languages we've enabled
@@ -506,8 +496,10 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
# search options with the wrapper
find_program(HDF5_${__lang}_COMPILER_EXECUTABLE
NAMES ${HDF5_${__lang}_COMPILER_NAMES} NAMES_PER_DIR
+ HINTS ${HDF5_ROOT}
PATH_SUFFIXES bin Bin
DOC "HDF5 ${__lang} Wrapper compiler. Used only to detect HDF5 compile flags."
+ ${_HDF5_SEARCH_OPTS}
)
mark_as_advanced( HDF5_${__lang}_COMPILER_EXECUTABLE )
unset(HDF5_${__lang}_COMPILER_NAMES)
@@ -526,15 +518,26 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
)
set(HDF5_${__lang}_LIBRARIES)
- set(_HDF5_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES})
- if(HDF5_USE_STATIC_LIBRARIES)
- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX})
- else()
- set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX})
- endif()
-
foreach(L IN LISTS HDF5_${__lang}_LIBRARY_NAMES)
- find_library(HDF5_${__lang}_LIBRARY_${L} ${L} ${HDF5_${__lang}_LIBRARY_DIRS})
+ set(_HDF5_SEARCH_NAMES_LOCAL)
+ if(x"${L}" MATCHES "hdf5")
+ # hdf5 library
+ set(_HDF5_SEARCH_OPTS_LOCAL ${_HDF5_SEARCH_OPTS})
+ if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
+ set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a)
+ endif()
+ else()
+ # external library
+ set(_HDF5_SEARCH_OPTS_LOCAL)
+ endif()
+ find_library(HDF5_${__lang}_LIBRARY_${L}
+ NAMES ${_HDF5_SEARCH_NAMES_LOCAL} ${L} NAMES_PER_DIR
+ HINTS ${HDF5_${__lang}_LIBRARY_DIRS}
+ ${HDF5_ROOT}
+ ${_HDF5_SEARCH_OPTS_LOCAL}
+ )
+ unset(_HDF5_SEARCH_OPTS_LOCAL)
+ unset(_HDF5_SEARCH_NAMES_LOCAL)
if(HDF5_${__lang}_LIBRARY_${L})
list(APPEND HDF5_${__lang}_LIBRARIES ${HDF5_${__lang}_LIBRARY_${L}})
else()
@@ -544,7 +547,25 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
if(FIND_HL)
set(HDF5_${__lang}_HL_LIBRARIES)
foreach(L IN LISTS HDF5_${__lang}_HL_LIBRARY_NAMES)
- find_library(HDF5_${__lang}_LIBRARY_${L} ${L} ${HDF5_${__lang}_LIBRARY_DIRS})
+ set(_HDF5_SEARCH_NAMES_LOCAL)
+ if("x${L}" MATCHES "hdf5")
+ # hdf5 library
+ set(_HDF5_SEARCH_OPTS_LOCAL ${_HDF5_SEARCH_OPTS})
+ if(UNIX AND HDF5_USE_STATIC_LIBRARIES)
+ set(_HDF5_SEARCH_NAMES_LOCAL lib${L}.a)
+ endif()
+ else()
+ # external library
+ set(_HDF5_SEARCH_OPTS_LOCAL)
+ endif()
+ find_library(HDF5_${__lang}_LIBRARY_${L}
+ NAMES ${_HDF5_SEARCH_NAMES_LOCAL} ${L} NAMES_PER_DIR
+ HINTS ${HDF5_${__lang}_LIBRARY_DIRS}
+ ${HDF5_ROOT}
+ ${_HDF5_SEARCH_OPTS_LOCAL}
+ )
+ unset(_HDF5_SEARCH_OPTS_LOCAL)
+ unset(_HDF5_SEARCH_NAMES_LOCAL)
if(HDF5_${__lang}_LIBRARY_${L})
list(APPEND HDF5_${__lang}_HL_LIBRARIES ${HDF5_${__lang}_LIBRARY_${L}})
else()
@@ -554,8 +575,6 @@ if(NOT HDF5_FOUND AND NOT HDF5_ROOT)
set(HDF5_HL_FOUND True)
endif()
- set(CMAKE_FIND_LIBRARY_SUFFIXES ${_HDF5_CMAKE_FIND_LIBRARY_SUFFIXES})
-
set(HDF5_${__lang}_FOUND True)
mark_as_advanced(HDF5_${__lang}_DEFINITIONS)
mark_as_advanced(HDF5_${__lang}_INCLUDE_DIRS)
@@ -626,14 +645,11 @@ elseif(NOT HDF5_FOUND AND NOT _HDF5_NEED_TO_SEARCH)
endif()
endif()
-if(HDF5_ROOT)
- set(SEARCH_OPTS NO_DEFAULT_PATH)
-endif()
find_program( HDF5_DIFF_EXECUTABLE
NAMES h5diff
HINTS ${HDF5_ROOT}
PATH_SUFFIXES bin Bin
- ${SEARCH_OPTS}
+ ${_HDF5_SEARCH_OPTS}
DOC "HDF5 file differencing tool." )
mark_as_advanced( HDF5_DIFF_EXECUTABLE )
@@ -662,7 +678,7 @@ if( NOT HDF5_FOUND )
HINTS ${HDF5_ROOT}
PATHS $ENV{HOME}/.local/include
PATH_SUFFIXES include Include
- ${SEARCH_OPTS}
+ ${_HDF5_SEARCH_OPTS}
)
mark_as_advanced(HDF5_${LANGUAGE}_INCLUDE_DIR)
list(APPEND HDF5_INCLUDE_DIRS ${HDF5_${__lang}_INCLUDE_DIR})
@@ -686,12 +702,12 @@ if( NOT HDF5_FOUND )
find_library(HDF5_${LIB}_LIBRARY_DEBUG
NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
- ${SEARCH_OPTS}
+ ${_HDF5_SEARCH_OPTS}
)
find_library( HDF5_${LIB}_LIBRARY_RELEASE
NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
- ${SEARCH_OPTS}
+ ${_HDF5_SEARCH_OPTS}
)
select_library_configurations( HDF5_${LIB} )
list(APPEND HDF5_${__lang}_LIBRARIES ${HDF5_${LIB}_LIBRARY})
@@ -723,12 +739,12 @@ if( NOT HDF5_FOUND )
find_library(HDF5_${LIB}_LIBRARY_DEBUG
NAMES ${THIS_LIBRARY_SEARCH_DEBUG}
HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
- ${SEARCH_OPTS}
+ ${_HDF5_SEARCH_OPTS}
)
find_library( HDF5_${LIB}_LIBRARY_RELEASE
NAMES ${THIS_LIBRARY_SEARCH_RELEASE}
HINTS ${HDF5_ROOT} PATH_SUFFIXES lib Lib
- ${SEARCH_OPTS}
+ ${_HDF5_SEARCH_OPTS}
)
select_library_configurations( HDF5_${LIB} )
list(APPEND HDF5_${__lang}_HL_LIBRARIES ${HDF5_${LIB}_LIBRARY})
@@ -780,17 +796,18 @@ if( NOT HDF5_FOUND )
"HDF5 library compiled with parallel IO support" )
mark_as_advanced( HDF5_IS_PARALLEL )
- # For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
- # HDF5_INCLUDE_DIRS
- if( HDF5_INCLUDE_DIRS )
- set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
- endif()
set(HDF5_REQUIRED_VARS HDF5_LIBRARIES HDF5_INCLUDE_DIRS)
if(FIND_HL)
list(APPEND HDF5_REQUIRED_VARS HDF5_HL_LIBRARIES)
endif()
endif()
+# For backwards compatibility we set HDF5_INCLUDE_DIR to the value of
+# HDF5_INCLUDE_DIRS
+if( HDF5_INCLUDE_DIRS )
+ set( HDF5_INCLUDE_DIR "${HDF5_INCLUDE_DIRS}" )
+endif()
+
# If HDF5_REQUIRED_VARS is empty at this point, then it's likely that
# something external is trying to explicitly pass already found
# locations
@@ -803,3 +820,5 @@ find_package_handle_standard_args(HDF5
VERSION_VAR HDF5_VERSION
HANDLE_COMPONENTS
)
+
+unset(_HDF5_SEARCH_OPTS)
diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake
index e91a6a9..ff2c4de 100644
--- a/Modules/FindMPI.cmake
+++ b/Modules/FindMPI.cmake
@@ -314,6 +314,7 @@ function (interrogate_mpi_compiler lang try_libs)
set(MPI_COMPILE_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_COMPILE_FLAGS})
+ string(REGEX REPLACE "^ " "" FLAG ${FLAG})
if (MPI_COMPILE_FLAGS_WORK)
string(APPEND MPI_COMPILE_FLAGS_WORK " ${FLAG}")
else()
@@ -323,6 +324,8 @@ function (interrogate_mpi_compiler lang try_libs)
# Extract include paths from compile command line
string(REGEX MATCHALL "(^| )-I([^\" ]+|\"[^\"]+\")" MPI_ALL_INCLUDE_PATHS "${MPI_COMPILE_CMDLINE}")
+ set(MPI_INCLUDE_PATH_WORK)
+
foreach(IPATH ${MPI_ALL_INCLUDE_PATHS})
string(REGEX REPLACE "^ ?-I" "" IPATH ${IPATH})
string(REPLACE "//" "/" IPATH ${IPATH})
@@ -365,6 +368,7 @@ function (interrogate_mpi_compiler lang try_libs)
string(REGEX MATCHALL "(^| )(-Wl,|-Xlinker )([^\" ]+|\"[^\"]+\")" MPI_ALL_LINK_FLAGS "${MPI_LINK_CMDLINE}")
set(MPI_LINK_FLAGS_WORK)
foreach(FLAG ${MPI_ALL_LINK_FLAGS})
+ string(REGEX REPLACE "^ " "" FLAG ${FLAG})
if (MPI_LINK_FLAGS_WORK)
string(APPEND MPI_LINK_FLAGS_WORK " ${FLAG}")
else()
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index fd32907..8db6f58 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 7)
-set(CMake_VERSION_PATCH 20170203)
+set(CMake_VERSION_PATCH 20170206)
#set(CMake_VERSION_RC 1)
diff --git a/Source/CPack/cmCPackProductBuildGenerator.cxx b/Source/CPack/cmCPackProductBuildGenerator.cxx
index a46e3a6..a5a18dc 100644
--- a/Source/CPack/cmCPackProductBuildGenerator.cxx
+++ b/Source/CPack/cmCPackProductBuildGenerator.cxx
@@ -75,6 +75,14 @@ int cmCPackProductBuildGenerator::PackageFiles()
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string productbuild = this->GetOption("CPACK_COMMAND_PRODUCTBUILD");
+ std::string identityName;
+ if (const char* n = this->GetOption("CPACK_PRODUCTBUILD_IDENTITY_NAME")) {
+ identityName = n;
+ }
+ std::string keychainPath;
+ if (const char* p = this->GetOption("CPACK_PRODUCTBUILD_KEYCHAIN_PATH")) {
+ keychainPath = p;
+ }
pkgCmd << productbuild << " --distribution \"" << packageDirFileName
<< "/Contents/distribution.dist\""
@@ -82,6 +90,9 @@ int cmCPackProductBuildGenerator::PackageFiles()
<< "\""
<< " --resources \"" << resDir << "\""
<< " --version \"" << version << "\""
+ << (identityName.empty() ? "" : " --sign \"" + identityName + "\"")
+ << (keychainPath.empty() ? ""
+ : " --keychain \"" + keychainPath + "\"")
<< " \"" << packageFileNames[0] << "\"";
// Run ProductBuild
@@ -193,12 +204,23 @@ bool cmCPackProductBuildGenerator::GenerateComponentPackage(
std::string version = this->GetOption("CPACK_PACKAGE_VERSION");
std::string pkgbuild = this->GetOption("CPACK_COMMAND_PKGBUILD");
+ std::string identityName;
+ if (const char* n = this->GetOption("CPACK_PKGBUILD_IDENTITY_NAME")) {
+ identityName = n;
+ }
+ std::string keychainPath;
+ if (const char* p = this->GetOption("CPACK_PKGBUILD_KEYCHAIN_PATH")) {
+ keychainPath = p;
+ }
pkgCmd << pkgbuild << " --root \"" << packageDir << "\""
<< " --identifier \"" << pkgId << "\""
<< " --scripts \"" << scriptDir << "\""
<< " --version \"" << version << "\""
<< " --install-location \"/\""
+ << (identityName.empty() ? "" : " --sign \"" + identityName + "\"")
+ << (keychainPath.empty() ? ""
+ : " --keychain \"" + keychainPath + "\"")
<< " \"" << packageFile << "\"";
// Run ProductBuild
diff --git a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
index 7957ab8..2657aeb 100644
--- a/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
+++ b/Tests/Module/WriteCompilerDetectionHeader/CMakeLists.txt
@@ -20,6 +20,17 @@ write_compiler_detection_header(
${cxx_known_features} ${c_known_features}
)
+write_compiler_detection_header(
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/multi_file_compiler_detection.h"
+ PREFIX MULTI
+ OUTPUT_FILES_VAR multi_files
+ OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
+ COMPILERS GNU Clang AppleClang MSVC SunPro Intel
+ VERSION 3.1
+ FEATURES
+ ${cxx_known_features} ${c_known_features}
+)
+
macro(set_defines target true_defs false_defs)
set(defines)
foreach(def ${true_defs})
@@ -57,7 +68,11 @@ if (CMAKE_C_COMPILE_FEATURES)
add_executable(C_undefined c_undefined.c)
set_property(TARGET C_undefined PROPERTY C_STANDARD 90)
- target_compile_options(C_undefined PRIVATE -Werror=undef)
+ include(CheckCCompilerFlag)
+ check_c_compiler_flag(-Werror=undef use_error_undef)
+ if (use_error_undef)
+ target_compile_options(C_undefined PRIVATE -Werror=undef)
+ endif()
add_executable(WriteCompilerDetectionHeader_C main.c)
set_property(TARGET WriteCompilerDetectionHeader_C PROPERTY C_STANDARD 90)
@@ -116,17 +131,6 @@ add_executable(WriteCompilerDetectionHeader main.cpp)
set_property(TARGET WriteCompilerDetectionHeader PROPERTY CXX_STANDARD 98)
set_defines(WriteCompilerDetectionHeader "${true_defs}" "${false_defs}")
-write_compiler_detection_header(
- FILE "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/multi_file_compiler_detection.h"
- PREFIX MULTI
- OUTPUT_FILES_VAR multi_files
- OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files/compiler_support"
- COMPILERS GNU Clang AppleClang MSVC SunPro Intel
- VERSION 3.1
- FEATURES
- ${cxx_known_features} ${c_known_features}
-)
-
add_executable(multi_files multi_files.cpp)
set_property(TARGET multi_files PROPERTY CXX_STANDARD 98)
target_include_directories(multi_files PRIVATE ${CMAKE_CURRENT_BINARY_DIR}/compiler_multi_files)
diff --git a/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake b/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake
index f0ae24b..7d031d4 100644
--- a/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake
+++ b/Tests/RunCMake/AndroidTestUtilities/RunCMakeTest.cmake
@@ -18,3 +18,4 @@ endfunction()
run_ATU(SetupTest1 "")
run_ATU(SetupTest2 "tests")
run_ATU(SetupTest3 "tests")
+run_ATU(SetupTest4 "")
diff --git a/Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake b/Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake
new file mode 100644
index 0000000..9a27266
--- /dev/null
+++ b/Tests/RunCMake/AndroidTestUtilities/SetupTest4.cmake
@@ -0,0 +1,13 @@
+enable_testing()
+include(AndroidTestUtilities)
+
+find_program(adb_executable adb)
+
+set(test_files "data/a.txt")
+
+set(ANDROID 1)
+
+android_add_test_data(setup_test
+ FILES ${test_files}
+ DEVICE_TEST_DIR "/data/local/tests/example1"
+ DEVICE_OBJECT_STORE "/sdcard/.ExternalData/SHA")
diff --git a/Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake b/Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake
new file mode 100644
index 0000000..ef7569d
--- /dev/null
+++ b/Tests/RunCMake/AndroidTestUtilities/SetupTest4Build-check.cmake
@@ -0,0 +1,5 @@
+include(${CMAKE_CURRENT_LIST_DIR}/check.cmake)
+compare_build_to_expected(FILES
+ "data/a.txt"
+ )
+check_for_setup_test()