-
Notifications
You must be signed in to change notification settings - Fork 644
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build libsodium first, then import libzmq targets
- Loading branch information
Showing
3 changed files
with
144 additions
and
99 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 |
---|---|---|
|
@@ -44,3 +44,4 @@ env | |
CMakeFiles | ||
CMakeCache.txt | ||
cmake_install.cmake | ||
_deps |
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,42 @@ | ||
# copy libzmq's findsodium, which can't be told where to look | ||
# we want to get our local bundled static libsodium | ||
# not any other | ||
message(STATUS "in my findsodium") | ||
set(SODIUM_FOUND FALSE) | ||
|
||
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON) | ||
find_package(PkgConfig) | ||
if (PkgConfig_FOUND) | ||
pkg_check_modules(PC_SODIUM "libsodium") | ||
if (PC_SODIUM_STATIC_FOUND) | ||
set(pkg_config_names_private "${pkg_config_names_private} libsodium") | ||
set(SODIUM_LIBRARIES ${PC_SODIUM_STATIC_LIBRARIES}) | ||
set(SODIUM_INCLUDE_DIRS ${PC_SODIUM_STATIC_INCLUDE_DIRS}) | ||
set(SODIUM_FOUND TRUE) | ||
endif() | ||
endif() | ||
|
||
if (NOT SODIUM_FOUND) | ||
find_path( | ||
SODIUM_INCLUDE_DIRS | ||
NAMES sodium.h | ||
HINTS ${BUNDLE_DIR}/include | ||
) | ||
# TODO: find bundled sodium on msvc | ||
find_library( | ||
SODIUM_LIBRARIES | ||
NAMES libsodium.a sodium.lib | ||
HINTS ${BUNDLE_DIR}/lib | ||
) | ||
if (SODIUM_LIBRARIES) | ||
# pkg-config didn't work, what do we need? | ||
if (NOT MSVC) | ||
list(APPEND SODIUM_LIBRARIES pthread) | ||
endif() | ||
set(SODIUM_FOUND TRUE) | ||
endif() | ||
endif() | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(sodium DEFAULT_MSG SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS) | ||
mark_as_advanced(SODIUM_FOUND SODIUM_LIBRARIES SODIUM_INCLUDE_DIRS) |