-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Find GNUnet library and include path
- Loading branch information
Showing
4 changed files
with
49 additions
and
4 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
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,41 @@ | ||
if (TARGET GNUnet::GNUnet) | ||
return() | ||
endif () | ||
|
||
find_path(GNUnet_INCLUDE_DIRS NAMES gnunet/gnunet_common.h | ||
DOC "The GNUnet include directory") | ||
|
||
set(GNUnet_LIBS namestore gnsrecord identity core util fs dht nse cadet peerinfo datastore gns messenger | ||
transport hello) | ||
set(all_libs_found TRUE) | ||
foreach(lib ${GNUnet_LIBS}) | ||
find_library(GNUnet_${lib}_LIBRARY NAMES gnunet${lib}) | ||
if (NOT GNUnet_${lib}_LIBRARY) | ||
message(STATUS "Missing GNUnet library: ${lib}") | ||
set(all_libs_found FALSE) | ||
endif () | ||
list(APPEND GNUnet_LIBRARIES ${GNUnet_${lib}_LIBRARY}) | ||
endforeach() | ||
|
||
if (NOT all_libs_found) | ||
message(STATUS "Missing some or all GNUnet library") | ||
set(GNUnet_FOUND FALSE) | ||
return() | ||
endif () | ||
|
||
# HACK: CMake requires a library as the "target" of an imported library, so we | ||
# use a library we know will be present on the system. | ||
add_library(GNUnet::GNUnet IMPORTED UNKNOWN) | ||
set_target_properties(GNUnet::GNUnet PROPERTIES | ||
INTERFACE_INCLUDE_DIRECTORIES "${GNUnet_INCLUDE_DIRS}" | ||
IMPORTED_LOCATION ${GNUnet_util_LIBRARY} | ||
INTERFACE_LINK_LIBRARIES "${GNUnet_LIBRARIES}" | ||
) | ||
|
||
mark_as_advanced(GNUnet_INCLUDE_DIRS GNUnet_LIBRARIES) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args( | ||
GNUnet | ||
REQUIRED_VARS GNUnet_LIBRARIES GNUnet_INCLUDE_DIRS | ||
) |
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