diff options
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPackageHandleStandardArgs.cmake | 9 | ||||
-rw-r--r-- | Modules/Internal/CheckCompilerFlag.cmake | 14 | ||||
-rw-r--r-- | Modules/Internal/CheckSourceCompiles.cmake | 14 | ||||
-rw-r--r-- | Modules/Internal/CheckSourceRuns.cmake | 12 |
4 files changed, 27 insertions, 22 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 7af0171..7e17277 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -275,8 +275,10 @@ function(FIND_PACKAGE_CHECK_VERSION version result) unset (${FPCV_RESULT_MESSAGE_VARIABLE} PARENT_SCOPE) endif() - if (CMAKE_FIND_PACKAGE_NAME) - set (package ${CMAKE_FIND_PACKAGE_NAME}) + if (_CMAKE_FPHSA_PACKAGE_NAME) + set (package "${_CMAKE_FPHSA_PACKAGE_NAME}") + elseif (CMAKE_FIND_PACKAGE_NAME) + set (package "${CMAKE_FIND_PACKAGE_NAME}") else() message (FATAL_ERROR "find_package_check_version(): Cannot be used outside a 'Find Module'") endif() @@ -436,6 +438,9 @@ function(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) "will be used.") endif() + # to propagate package name to FIND_PACKAGE_CHECK_VERSION + set(_CMAKE_FPHSA_PACKAGE_NAME "${_NAME}") + # now that we collected all arguments, process them if("x${FPHSA_FAIL_MESSAGE}" STREQUAL "xDEFAULT_MSG") diff --git a/Modules/Internal/CheckCompilerFlag.cmake b/Modules/Internal/CheckCompilerFlag.cmake index f790d87..6b2a11e 100644 --- a/Modules/Internal/CheckCompilerFlag.cmake +++ b/Modules/Internal/CheckCompilerFlag.cmake @@ -11,20 +11,20 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var) - if(_lang STREQUAL C) + if(_lang STREQUAL "C") set(_lang_src "int main(void) { return 0; }") set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C") - elseif(_lang STREQUAL CXX) + elseif(_lang STREQUAL "CXX") set(_lang_src "int main() { return 0; }") set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+") - elseif(_lang STREQUAL CUDA) + elseif(_lang STREQUAL "CUDA") set(_lang_src "__host__ int main() { return 0; }") set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for C\\+\\+" # Host GNU FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL Fortran) + elseif(_lang STREQUAL "Fortran") set(_lang_src " program test\n stop\n end program") set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Fortran") - elseif(_lang STREQUAL OBJC) + elseif(_lang STREQUAL "OBJC") set(_lang_src [=[ #ifndef __OBJC__ # error "Not an Objective-C compiler" @@ -32,7 +32,7 @@ function(CMAKE_CHECK_COMPILER_FLAG _lang _flag _var) int main(void) { return 0; }]=]) set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C" # GNU FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL OBJCXX) + elseif(_lang STREQUAL "OBJCXX") set(_lang_src [=[ #ifndef __OBJC__ # error "Not an Objective-C++ compiler" @@ -40,7 +40,7 @@ int main(void) { return 0; }]=]) int main(void) { return 0; }]=]) set(_lang_fail_regex FAIL_REGEX "command[ -]line option .* is valid for .* but not for Objective-C\\+\\+" # GNU FAIL_REGEX "argument unused during compilation: .*") # Clang - elseif(_lang STREQUAL ISPC) + elseif(_lang STREQUAL "ISPC") set(_lang_src "float func(uniform int32, float a) { return a / 2.25; }") else() message (SEND_ERROR "check_compiler_flag: ${_lang}: unknown language.") diff --git a/Modules/Internal/CheckSourceCompiles.cmake b/Modules/Internal/CheckSourceCompiles.cmake index 91c8964..3b2152a 100644 --- a/Modules/Internal/CheckSourceCompiles.cmake +++ b/Modules/Internal/CheckSourceCompiles.cmake @@ -10,25 +10,25 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST function(CMAKE_CHECK_SOURCE_COMPILES _lang _source _var) if(NOT DEFINED "${_var}") - if(_lang STREQUAL C) + if(_lang STREQUAL "C") set(_lang_textual "C") set(_lang_ext "c") - elseif(_lang STREQUAL CXX) + elseif(_lang STREQUAL "CXX") set(_lang_textual "C++") set(_lang_ext "cxx") - elseif(_lang STREQUAL CUDA) + elseif(_lang STREQUAL "CUDA") set(_lang_textual "CUDA") set(_lang_ext "cu") - elseif(_lang STREQUAL Fortran) + elseif(_lang STREQUAL "Fortran") set(_lang_textual "Fortran") set(_lang_ext "F90") - elseif(_lang STREQUAL ISPC) + elseif(_lang STREQUAL "ISPC") set(_lang_textual "ISPC") set(_lang_ext "ispc") - elseif(_lang STREQUAL OBJC) + elseif(_lang STREQUAL "OBJC") set(_lang_textual "Objective-C") set(_lang_ext "m") - elseif(_lang STREQUAL OBJCXX) + elseif(_lang STREQUAL "OBJCXX") set(_lang_textual "Objective-C++") set(_lang_ext "mm") else() diff --git a/Modules/Internal/CheckSourceRuns.cmake b/Modules/Internal/CheckSourceRuns.cmake index 3a4b758..676f3d0 100644 --- a/Modules/Internal/CheckSourceRuns.cmake +++ b/Modules/Internal/CheckSourceRuns.cmake @@ -10,22 +10,22 @@ cmake_policy(SET CMP0057 NEW) # if() supports IN_LIST function(CMAKE_CHECK_SOURCE_RUNS _lang _source _var) if(NOT DEFINED "${_var}") - if(_lang STREQUAL C) + if(_lang STREQUAL "C") set(_lang_textual "C") set(_lang_ext "c") - elseif(_lang STREQUAL CXX) + elseif(_lang STREQUAL "CXX") set(_lang_textual "C++") set(_lang_ext "cxx") - elseif(_lang STREQUAL CUDA) + elseif(_lang STREQUAL "CUDA") set(_lang_textual "CUDA") set(_lang_ext "cu") - elseif(_lang STREQUAL Fortran) + elseif(_lang STREQUAL "Fortran") set(_lang_textual "Fortran") set(_lang_ext "F90") - elseif(_lang STREQUAL OBJC) + elseif(_lang STREQUAL "OBJC") set(_lang_textual "Objective-C") set(_lang_ext "m") - elseif(_lang STREQUAL OBJCXX) + elseif(_lang STREQUAL "OBJCXX") set(_lang_textual "Objective-C++") set(_lang_ext "mm") else() |