diff options
author | Brad King <brad.king@kitware.com> | 2024-05-02 13:35:39 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-05-02 13:35:51 (GMT) |
commit | fc188e35d1b671cfa292684b15baaf8b921318c3 (patch) | |
tree | a67d566a0c301df95a8e8f483c783ebf658d4c4b /Modules | |
parent | 1d8848c4ce2e1b030f7d6129aa741d0db5a4b3cf (diff) | |
parent | 68a8c89430d94e89cf0044e6f3775fb61d447594 (diff) | |
download | CMake-fc188e35d1b671cfa292684b15baaf8b921318c3.zip CMake-fc188e35d1b671cfa292684b15baaf8b921318c3.tar.gz CMake-fc188e35d1b671cfa292684b15baaf8b921318c3.tar.bz2 |
Merge topic 'fphsa-before-project'
68a8c89430 FPHSA: Add hint for failure when called before project()
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9480
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindPackageHandleStandardArgs.cmake | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 63b2bf2..c6db433 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -225,6 +225,9 @@ macro(_FPHSA_FAILURE_MESSAGE _msg) set (__msg "${_msg}") if (FPHSA_REASON_FAILURE_MESSAGE) string(APPEND __msg "\n Reason given by package: ${FPHSA_REASON_FAILURE_MESSAGE}\n") + elseif(NOT DEFINED PROJECT_NAME) + string(APPEND __msg "\n" + "Hint: The project() command has not yet been called. It sets up system-specific search paths.") endif() if (${_NAME}_FIND_REQUIRED) message(FATAL_ERROR "${__msg}") |