-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: find liboath using the correct name
we should reference liboath by the $name in Find${name}.cmake, also the $name should be consistent when calling find_package_handle_standard_args(). in this change * rename Findliboath.cmake to FindOATH.cmake to be consistent with other find_package() moduless. * use "OATH" in find_package_handle_standard_args() instead of "oath" * set the interface properties for OATH::OATH, so the target linking against it can reference its header directories and libraries automatically. * remove the stale comment for find_package_handle_standard_args() * set OATH_INCLUDE_DIRS and OATH_LIBRARIES to follow the convention of find_package(), even they are not used directly in this project. Reported-by: Erwan Velu <[email protected]> Signed-off-by: Kefu Chai <[email protected]>
- Loading branch information
Showing
5 changed files
with
35 additions
and
25 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
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,32 @@ | ||
# CMake module to search for liboath headers | ||
# | ||
# If it's found it sets OATH_FOUND to TRUE | ||
# and following variables are set: | ||
# OATH_INCLUDE_DIRS | ||
# OATH_LIBRARIES | ||
find_path(OATH_INCLUDE_DIR | ||
oath.h | ||
PATHS | ||
/usr/include | ||
/usr/local/include | ||
/usr/include/liboath) | ||
find_library(OATH_LIBRARY NAMES oath liboath PATHS | ||
/usr/local/lib | ||
/usr/lib) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(OATH DEFAULT_MSG OATH_LIBRARY OATH_INCLUDE_DIR) | ||
|
||
mark_as_advanced(OATH_LIBRARY OATH_INCLUDE_DIR) | ||
|
||
if(OATH_FOUND) | ||
set(OATH_INCLUDE_DIRS "${OATH_INCLUDE_DIR}") | ||
set(OATH_LIBRARIES "${OATH_LIBRARY}") | ||
if(NOT TARGET OATH::OATH) | ||
add_library(OATH::OATH UNKNOWN IMPORTED) | ||
endif() | ||
set_target_properties(OATH::OATH PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${OATH_INCLUDE_DIRS}" | ||
IMPORTED_LINK_INTERFACE_LANGUAGES "C" | ||
IMPORTED_LOCATION "${OATH_LIBRARIES}") | ||
endif() |
This file was deleted.
Oops, something went wrong.
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