diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CheckLanguage.cmake | 2 | ||||
-rw-r--r-- | Modules/FindGTK2.cmake | 9 | ||||
-rw-r--r-- | Modules/FindMPI.cmake | 6 | ||||
-rw-r--r-- | Modules/FindPkgConfig.cmake | 50 | ||||
-rw-r--r-- | Modules/Platform/Windows-MSVC.cmake | 12 |
5 files changed, 57 insertions, 22 deletions
diff --git a/Modules/CheckLanguage.cmake b/Modules/CheckLanguage.cmake index a1a3a7a..95e4fbe 100644 --- a/Modules/CheckLanguage.cmake +++ b/Modules/CheckLanguage.cmake @@ -43,7 +43,7 @@ macro(check_language lang) file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}) set(extra_compiler_variables) - if(lang STREQUAL CUDA) + if(${lang} STREQUAL CUDA) set(extra_compiler_variables "set(CMAKE_CUDA_HOST_COMPILER \\\"\${CMAKE_CUDA_HOST_COMPILER}\\\")") endif() diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 83091f3..600e4aa 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -708,11 +708,14 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) _GTK2_FIND_LIBRARY (CAIRO cairo false false) _GTK2_ADD_TARGET (CAIRO) + _GTK2_FIND_INCLUDE_DIR(HARFBUZZ hb.h) + _GTK2_FIND_LIBRARY (HARFBUZZ harfbuzz false false) + _GTK2_ADD_TARGET (HARFBUZZ) + _GTK2_FIND_INCLUDE_DIR(PANGO pango/pango.h) _GTK2_FIND_LIBRARY (PANGO pango false true) - _GTK2_ADD_TARGET (PANGO GTK2_DEPENDS gobject glib) - - _GTK2_FIND_INCLUDE_DIR(HARFBUZZ hb.h) + _GTK2_ADD_TARGET (PANGO GTK2_DEPENDS gobject glib + GTK2_OPTIONAL_DEPENDS harfbuzz) _GTK2_FIND_LIBRARY (PANGOCAIRO pangocairo false true) _GTK2_ADD_TARGET (PANGOCAIRO GTK2_DEPENDS pango cairo gobject glib) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index d6cd799..42941c9 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -298,9 +298,9 @@ else() endif() # PGI compiler names -set(_MPI_PGI_C_COMPILER_NAMES mpipgcc mppgcc) -set(_MPI_PGI_CXX_COMPILER_NAMES mpipgCC mppgCC) -set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) +set(_MPI_PGI_C_COMPILER_NAMES mpipgicc mpipgcc mppgcc) +set(_MPI_PGI_CXX_COMPILER_NAMES mpipgic++ mpipgCC mppgCC) +set(_MPI_PGI_Fortran_COMPILER_NAMES mpipgifort mpipgf95 mpipgf90 mppgf95 mppgf90 mpipgf77 mppgf77) # XLC MPI Compiler names set(_MPI_XL_C_COMPILER_NAMES mpxlc mpxlc_r mpixlc mpixlc_r) diff --git a/Modules/FindPkgConfig.cmake b/Modules/FindPkgConfig.cmake index bd1bc7c..2121f66 100644 --- a/Modules/FindPkgConfig.cmake +++ b/Modules/FindPkgConfig.cmake @@ -364,6 +364,36 @@ macro(_pkg_restore_path_internal) unset(_pkgconfig_path_old) endmacro() +# pkg-config returns -isystem include directories in --cflags-only-other, +# depending on the version and if there is a space between -isystem and +# the actual path +function(_pkgconfig_extract_isystem _prefix) + set(cflags "${${_prefix}_CFLAGS_OTHER}") + set(outflags "") + set(incdirs "${${_prefix}_INCLUDE_DIRS}") + + set(next_is_isystem FALSE) + foreach (THING IN LISTS cflags) + # This may filter "-isystem -isystem". That would not work anyway, + # so let it happen. + if (THING STREQUAL "-isystem") + set(next_is_isystem TRUE) + continue() + endif () + if (next_is_isystem) + set(next_is_isystem FALSE) + list(APPEND incdirs "${THING}") + elseif (THING MATCHES "^-isystem") + string(SUBSTRING "${THING}" 8 -1 THING) + list(APPEND incdirs "${THING}") + else () + list(APPEND outflags "${THING}") + endif () + endforeach () + set(${_prefix}_CFLAGS_OTHER "${outflags}" PARENT_SCOPE) + set(${_prefix}_INCLUDE_DIRS "${incdirs}" PARENT_SCOPE) +endfunction() + ### macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cmake_environment_path _imp_target _imp_target_global _prefix) _pkgconfig_unset(${_prefix}_FOUND) @@ -497,14 +527,18 @@ macro(_pkg_check_modules_internal _is_required _is_silent _no_cmake_path _no_cma endforeach() # set variables which are combined for multiple modules - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS "(^| )-L" --libs-only-L ) - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS "" --libs ) - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER "" --libs-only-other ) - - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )-I" --cflags-only-I ) - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) - _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARIES "(^| )-l" --libs-only-l ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LIBRARY_DIRS "(^| )-L" --libs-only-L ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS "" --libs ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" LDFLAGS_OTHER "" --libs-only-other ) + + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" INCLUDE_DIRS "(^| )(-I|-isystem ?)" --cflags-only-I ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS "" --cflags ) + _pkgconfig_invoke_dyn("${_pkg_check_modules_packages}" "${_prefix}" CFLAGS_OTHER "" --cflags-only-other ) + + if (${_prefix}_CFLAGS_OTHER MATCHES "-isystem") + _pkgconfig_extract_isystem("${_prefix}") + endif () _pkg_recalculate("${_prefix}" ${_no_cmake_path} ${_no_cmake_environment_path} ${_imp_target} ${_imp_target_global}) endif() diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 34f5d03..e0f33bd 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -331,13 +331,11 @@ macro(__windows_compiler_msvc lang) set(CMAKE_PCH_EXTENSION .pch) set(CMAKE_LINK_PCH ON) - if(MSVC_VERSION GREATER_EQUAL 1910) - # VS 2017 or greater - if (NOT ${CMAKE_${lang}_COMPILER_ID} STREQUAL "Clang") - set(CMAKE_PCH_PROLOGUE "#pragma system_header") - else() - set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") - endif() + if (CMAKE_${lang}_COMPILER_ID STREQUAL "Clang") + set(CMAKE_PCH_PROLOGUE "#pragma clang system_header") + elseif(MSVC_VERSION GREATER_EQUAL 1913) + # At least MSVC toolet 14.13 from VS 2017 15.6 + set(CMAKE_PCH_PROLOGUE "#pragma system_header") endif() if (NOT ${CMAKE_${lang}_COMPILER_ID} STREQUAL "Clang") set(CMAKE_PCH_COPY_COMPILE_PDB ON) |