diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeDetermineCompilerId.cmake | 9 | ||||
-rw-r--r-- | Modules/CPackIFW.cmake | 2 | ||||
-rw-r--r-- | Modules/CompilerId/Xcode-3.pbxproj.in | 1 | ||||
-rw-r--r-- | Modules/FindCups.cmake | 48 | ||||
-rw-r--r-- | Modules/FindHDF5.cmake | 140 |
5 files changed, 131 insertions, 69 deletions
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 2f84c8e..83ce392 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -360,6 +360,15 @@ Id flags: ${testflags} ${CMAKE_${lang}_COMPILER_ID_FLAGS_ALWAYS} else() set(id_sdkroot "") endif() + set(id_clang_cxx_library "") + set(stdlib_regex "(^| )(-stdlib=)([^ ]+)( |$)") + string(REGEX MATCHALL "${stdlib_regex}" all_stdlib_matches "${CMAKE_CXX_FLAGS}") + if(all_stdlib_matches) + list(GET all_stdlib_matches "-1" last_stdlib_match) + if(last_stdlib_match MATCHES "${stdlib_regex}") + set(id_clang_cxx_library "CLANG_CXX_LIBRARY = \"${CMAKE_MATCH_3}\";") + endif() + endif() configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-3.pbxproj.in ${id_dir}/CompilerId${lang}.xcodeproj/project.pbxproj @ONLY) unset(_ENV_MACOSX_DEPLOYMENT_TARGET) diff --git a/Modules/CPackIFW.cmake b/Modules/CPackIFW.cmake index 141e842..8380977 100644 --- a/Modules/CPackIFW.cmake +++ b/Modules/CPackIFW.cmake @@ -518,7 +518,7 @@ macro(_cpack_ifw_resolve_script _variable) get_filename_component(${_ifw_script_macro} ${_ifw_script_file} ABSOLUTE) set(_ifw_script_file ${${_ifw_script_macro}}) if(NOT EXISTS ${_ifw_script_file}) - message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" is not exists") + message(WARNING "CPack IFW: script file \"${_ifw_script_file}\" does not exist") set(${_ifw_script_macro}) endif() endif() diff --git a/Modules/CompilerId/Xcode-3.pbxproj.in b/Modules/CompilerId/Xcode-3.pbxproj.in index 813c074..672044e 100644 --- a/Modules/CompilerId/Xcode-3.pbxproj.in +++ b/Modules/CompilerId/Xcode-3.pbxproj.in @@ -86,6 +86,7 @@ SYMROOT = .; @id_toolset@ @id_lang_version@ + @id_clang_cxx_library@ @id_deployment_target@ @id_sdkroot@ }; diff --git a/Modules/FindCups.cmake b/Modules/FindCups.cmake index 10ce229..27105b9 100644 --- a/Modules/FindCups.cmake +++ b/Modules/FindCups.cmake @@ -5,18 +5,38 @@ FindCups -------- -Try to find the Cups printing system +Find the CUPS printing system. -Once done this will define +Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which +features this function (i.e. at least 1.1.19) -:: +Imported targets +^^^^^^^^^^^^^^^^ - CUPS_FOUND - system has Cups - CUPS_INCLUDE_DIR - the Cups include directory - CUPS_LIBRARIES - Libraries needed to use Cups - CUPS_VERSION_STRING - version of Cups found (since CMake 2.8.8) - Set CUPS_REQUIRE_IPP_DELETE_ATTRIBUTE to TRUE if you need a version which - features this function (i.e. at least 1.1.19) +This module defines :prop_tgt:`IMPORTED` target ``Cups::Cups``, if Cups has +been found. + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +``CUPS_FOUND`` + true if CUPS headers and libraries were found +``CUPS_INCLUDE_DIRS`` + the directory containing the Cups headers +``CUPS_LIBRARIES`` + the libraries to link against to use CUPS. +``CUPS_VERSION_STRING`` + the version of CUPS found (since CMake 2.8.8) + +Cache variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``CUPS_INCLUDE_DIR`` + the directory containing the Cups headers #]=======================================================================] find_path(CUPS_INCLUDE_DIR cups/cups.h ) @@ -66,3 +86,13 @@ else () endif () mark_as_advanced(CUPS_INCLUDE_DIR CUPS_LIBRARIES) + +if (CUPS_FOUND) + set(CUPS_INCLUDE_DIRS "${CUPS_INCLUDE_DIR}") + if (NOT TARGET Cups::Cups) + add_library(Cups::Cups INTERFACE IMPORTED) + set_target_properties(Cups::Cups PROPERTIES + INTERFACE_LINK_LIBRARIES "${CUPS_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${CUPS_INCLUDE_DIR}") + endif () +endif () diff --git a/Modules/FindHDF5.cmake b/Modules/FindHDF5.cmake index 2772b7d..70bfc96 100644 --- a/Modules/FindHDF5.cmake +++ b/Modules/FindHDF5.cmake @@ -8,7 +8,6 @@ FindHDF5 Find HDF5, a library for reading and writing self describing array data. - This module invokes the HDF5 wrapper compiler that should be installed alongside HDF5. Depending upon the HDF5 Configuration, the wrapper compiler is called either h5cc or h5pcc. If this succeeds, the module @@ -45,54 +44,75 @@ an HDF5 client application, this module also makes an effort to find tools that come with the HDF5 distribution that may be useful for regression testing. -This module will define the following variables: - -:: - - HDF5_FOUND - true if HDF5 was found on the system - HDF5_VERSION - HDF5 version in format Major.Minor.Release - HDF5_INCLUDE_DIRS - Location of the hdf5 includes - HDF5_INCLUDE_DIR - Location of the hdf5 includes (deprecated) - HDF5_DEFINITIONS - Required compiler definitions for HDF5 - HDF5_LIBRARIES - Required libraries for all requested bindings - HDF5_HL_LIBRARIES - Required libraries for the HDF5 high level API for all - bindings, if the HL component is enabled - -Available components are: C CXX Fortran and HL. For each enabled language -binding, a corresponding HDF5_${LANG}_LIBRARIES variable, and potentially -HDF5_${LANG}_DEFINITIONS, will be defined. -If the HL component is enabled, then an HDF5_${LANG}_HL_LIBRARIES will +Result Variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + +``HDF5_FOUND`` + HDF5 was found on the system +``HDF5_VERSION`` + HDF5 library version +``HDF5_INCLUDE_DIRS`` + Location of the HDF5 header files +``HDF5_DEFINITIONS`` + Required compiler definitions for HDF5 +``HDF5_LIBRARIES`` + Required libraries for all requested bindings +``HDF5_HL_LIBRARIES`` + Required libraries for the HDF5 high level API for all bindings, + if the ``HL`` component is enabled + +Available components are: ``C`` ``CXX`` ``Fortran`` and ``HL``. +For each enabled language binding, a corresponding ``HDF5_${LANG}_LIBRARIES`` +variable, and potentially ``HDF5_${LANG}_DEFINITIONS``, will be defined. +If the ``HL`` component is enabled, then an ``HDF5_${LANG}_HL_LIBRARIES`` will also be defined. With all components enabled, the following variables will be defined: -:: - - HDF5_C_DEFINITIONS -- Required compiler definitions for HDF5 C bindings - HDF5_CXX_DEFINITIONS -- Required compiler definitions for HDF5 C++ bindings - HDF5_Fortran_DEFINITIONS -- Required compiler definitions for HDF5 Fortran bindings - HDF5_C_INCLUDE_DIRS -- Required include directories for HDF5 C bindings - HDF5_CXX_INCLUDE_DIRS -- Required include directories for HDF5 C++ bindings - HDF5_Fortran_INCLUDE_DIRS -- Required include directories for HDF5 Fortran bindings - HDF5_C_LIBRARIES - Required libraries for the HDF5 C bindings - HDF5_CXX_LIBRARIES - Required libraries for the HDF5 C++ bindings - HDF5_Fortran_LIBRARIES - Required libraries for the HDF5 Fortran bindings - HDF5_C_HL_LIBRARIES - Required libraries for the high level C bindings - HDF5_CXX_HL_LIBRARIES - Required libraries for the high level C++ bindings - HDF5_Fortran_HL_LIBRARIES - Required libraries for the high level Fortran - bindings. - - HDF5_IS_PARALLEL - Whether or not HDF5 was found with parallel IO support - HDF5_C_COMPILER_EXECUTABLE - the path to the HDF5 C wrapper compiler - HDF5_CXX_COMPILER_EXECUTABLE - the path to the HDF5 C++ wrapper compiler - HDF5_Fortran_COMPILER_EXECUTABLE - the path to the HDF5 Fortran wrapper compiler - HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C compiler - which is also the HDF5 wrapper - HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary C++ - compiler which is also - the HDF5 wrapper - HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE - path to the primary - Fortran compiler which - is also the HDF5 wrapper - HDF5_DIFF_EXECUTABLE - the path to the HDF5 dataset comparison tool +``HDF5_C_DEFINITIONS`` + Required compiler definitions for HDF5 C bindings +``HDF5_CXX_DEFINITIONS`` + Required compiler definitions for HDF5 C++ bindings +``HDF5_Fortran_DEFINITIONS`` + Required compiler definitions for HDF5 Fortran bindings +``HDF5_C_INCLUDE_DIRS`` + Required include directories for HDF5 C bindings +``HDF5_CXX_INCLUDE_DIRS`` + Required include directories for HDF5 C++ bindings +``HDF5_Fortran_INCLUDE_DIRS`` + Required include directories for HDF5 Fortran bindings +``HDF5_C_LIBRARIES`` + Required libraries for the HDF5 C bindings +``HDF5_CXX_LIBRARIES`` + Required libraries for the HDF5 C++ bindings +``HDF5_Fortran_LIBRARIES`` + Required libraries for the HDF5 Fortran bindings +``HDF5_C_HL_LIBRARIES`` + Required libraries for the high level C bindings +``HDF5_CXX_HL_LIBRARIES`` + Required libraries for the high level C++ bindings +``HDF5_Fortran_HL_LIBRARIES`` + Required libraries for the high level Fortran bindings. + +``HDF5_IS_PARALLEL`` + HDF5 library has parallel IO support +``HDF5_C_COMPILER_EXECUTABLE`` + path to the HDF5 C wrapper compiler +``HDF5_CXX_COMPILER_EXECUTABLE`` + path to the HDF5 C++ wrapper compiler +``HDF5_Fortran_COMPILER_EXECUTABLE`` + path to the HDF5 Fortran wrapper compiler +``HDF5_C_COMPILER_EXECUTABLE_NO_INTERROGATE`` + path to the primary C compiler which is also the HDF5 wrapper +``HDF5_CXX_COMPILER_EXECUTABLE_NO_INTERROGATE`` + path to the primary C++ compiler which is also the HDF5 wrapper +``HDF5_Fortran_COMPILER_EXECUTABLE_NO_INTERROGATE`` + path to the primary Fortran compiler which is also the HDF5 wrapper +``HDF5_DIFF_EXECUTABLE`` + path to the HDF5 dataset comparison tool + +Hints +^^^^^ The following variable can be set to guide the search for HDF5 libraries and includes: @@ -100,10 +120,10 @@ The following variable can be set to guide the search for HDF5 libraries and inc Specify the path to the HDF5 installation to use. ``HDF5_FIND_DEBUG`` - Set to a true value to get some extra debugging output. + Set ``true`` to get extra debugging output. ``HDF5_NO_FIND_PACKAGE_CONFIG_FILE`` - Set to a true value to skip trying to find ``hdf5-config.cmake``. + Set ``true`` to skip trying to find ``hdf5-config.cmake``. #]=======================================================================] # This module is maintained by Will Dicharry <wdicharry@stellarscience.com>. @@ -322,20 +342,22 @@ macro( _HDF5_invoke_compiler language output return_value version is_parallel) elseif("${language}" STREQUAL "Fortran") set(test_file ${scratch_dir}/cmake_hdf5_test.f90) endif() - exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE} - ARGS -show ${lib_type_args} ${test_file} - OUTPUT_VARIABLE ${output} - RETURN_VALUE ${return_value} - ) + execute_process( + COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -show ${lib_type_args} ${test_file} + OUTPUT_VARIABLE ${output} + ERROR_VARIABLE ${output} + RESULT_VARIABLE ${return_value} + ) if(NOT ${${return_value}} EQUAL 0) message(STATUS "Unable to determine HDF5 ${language} flags from HDF5 wrapper.") endif() - exec_program( ${HDF5_${language}_COMPILER_EXECUTABLE} - ARGS -showconfig - OUTPUT_VARIABLE config_output - RETURN_VALUE config_return - ) + execute_process( + COMMAND ${HDF5_${language}_COMPILER_EXECUTABLE} -showconfig + OUTPUT_VARIABLE config_output + ERROR_VARIABLE config_output + RESULT_VARIABLE config_return + ) if(NOT ${return_value} EQUAL 0) message( STATUS "Unable to determine HDF5 ${language} version from HDF5 wrapper.") |