Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FPHSA: detect package name mismatches
The `FPHSA_NAME_MISMATCHED` variable may be set if this is intentional (but should be cleared after the call to not affect other FPHSA calls). It may also be passed via the `NAME_MISMATCHED` option for new-signature FPHSA calls.
- Loading branch information
Showing
10 changed files
with
113 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
fphsa-name-mismatch | ||
------------------- | ||
|
||
* The :module:`FindPackageHandleStandardArgs` module learned to check the | ||
package name passed in for typo mistakes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}") | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(NAMEMISMATCH REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE") | ||
set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}") | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(NAMEMISMATCH "old signature" "${CMAKE_FIND_PACKAGE_NAME}_MODULE") | ||
set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}") | ||
include(FindPackageHandleStandardArgs) | ||
set(FPHSA_NAME_MISMATCHED 1) | ||
find_package_handle_standard_args(NAMEMISMATCH "old signature" "${CMAKE_FIND_PACKAGE_NAME}_MODULE") | ||
unset(FPHSA_NAME_MISMATCHED) | ||
set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}") | ||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(NAMEMISMATCH NAME_MISMATCHED REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE") | ||
set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
set("${CMAKE_FIND_PACKAGE_NAME}_MODULE" "${CMAKE_CURRENT_LIST_FILE}") | ||
include(FindPackageHandleStandardArgs) | ||
set(FPHSA_NAME_MISMATCHED 1) | ||
find_package_handle_standard_args(NAMEMISMATCH REQUIRED_VARS "${CMAKE_FIND_PACKAGE_NAME}_MODULE") | ||
unset(FPHSA_NAME_MISMATCHED) | ||
set("${CMAKE_FIND_PACKAGE_NAME}_FOUND" 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CMake Warning \(dev\) at .*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\): | ||
The package name passed to `find_package_handle_standard_args` | ||
\(NAMEMISMATCH\) does not match the name of the calling package | ||
\(NameMismatch\). This can lead to problems in calling code that expects | ||
`find_package` result variables \(e.g., `_FOUND`\) to follow a certain | ||
pattern. | ||
Call Stack \(most recent call first\): | ||
FindNameMismatch.cmake:3 \(find_package_handle_standard_args\) | ||
NameMismatch.cmake:3 \(find_package\) | ||
CMakeLists.txt:3 \(include\) | ||
This warning is for project developers. Use -Wno-dev to suppress it. | ||
|
||
CMake Warning \(dev\) at .*/Modules/FindPackageHandleStandardArgs.cmake:[0-9]+ \(message\): | ||
The package name passed to `find_package_handle_standard_args` | ||
\(NAMEMISMATCH\) does not match the name of the calling package | ||
\(NameMismatchOld\). This can lead to problems in calling code that expects | ||
`find_package` result variables \(e.g., `_FOUND`\) to follow a certain | ||
pattern. | ||
Call Stack \(most recent call first\): | ||
FindNameMismatchOld.cmake:3 \(find_package_handle_standard_args\) | ||
NameMismatch.cmake:4 \(find_package\) | ||
CMakeLists.txt:3 \(include\) | ||
This warning is for project developers. Use -Wno-dev to suppress it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}") | ||
|
||
find_package(NameMismatch REQUIRED) | ||
find_package(NameMismatchOld REQUIRED) | ||
find_package(NameMismatchSuppressed REQUIRED) | ||
find_package(NameMismatchSuppressedCompat REQUIRED) | ||
find_package(NameMismatchSuppressedArg REQUIRED) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters