mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-11-22 17:39:53 +03:00
Add liboqs with find_package
This commit is contained in:
parent
eb66e7d360
commit
7dc3f2240c
2
src/Mayaqua/3rdparty/Findliboqs.cmake
vendored
Normal file
2
src/Mayaqua/3rdparty/Findliboqs.cmake
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
set(oqs_FOUND TRUE)
|
||||||
|
add_library(OQS::oqs ALIAS oqs)
|
@ -74,12 +74,21 @@ if(WIN32)
|
|||||||
"ws2_32.lib"
|
"ws2_32.lib"
|
||||||
"WtsApi32.Lib"
|
"WtsApi32.Lib"
|
||||||
)
|
)
|
||||||
|
|
||||||
if (SKIP_OQS_PROVIDER)
|
if (SKIP_OQS_PROVIDER)
|
||||||
add_definitions(-DSKIP_OQS_PROVIDER)
|
add_definitions(-DSKIP_OQS_PROVIDER)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(3rdparty/liboqs)
|
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
|
||||||
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
|
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
|
||||||
|
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/Mayaqua/3rdparty/")
|
||||||
|
|
||||||
|
add_subdirectory(3rdparty/liboqs)
|
||||||
add_subdirectory(3rdparty/oqs-provider)
|
add_subdirectory(3rdparty/oqs-provider)
|
||||||
|
|
||||||
|
target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
|
||||||
|
get_target_property(target_include_dirs oqsprovider INCLUDE_DIRECTORIES)
|
||||||
|
message("Include directories for target_name: ${target_include_dirs}")
|
||||||
|
|
||||||
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
target_link_libraries(mayaqua PRIVATE oqsprovider)
|
target_link_libraries(mayaqua PRIVATE oqsprovider)
|
||||||
endif()
|
endif()
|
||||||
@ -105,9 +114,17 @@ if(UNIX)
|
|||||||
if (SKIP_OQS_PROVIDER)
|
if (SKIP_OQS_PROVIDER)
|
||||||
add_definitions(-DSKIP_OQS_PROVIDER)
|
add_definitions(-DSKIP_OQS_PROVIDER)
|
||||||
else()
|
else()
|
||||||
add_subdirectory(3rdparty/liboqs)
|
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
|
||||||
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
|
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
|
||||||
|
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/Mayaqua/3rdparty/")
|
||||||
|
|
||||||
|
add_subdirectory(3rdparty/liboqs)
|
||||||
add_subdirectory(3rdparty/oqs-provider)
|
add_subdirectory(3rdparty/oqs-provider)
|
||||||
|
|
||||||
|
target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
|
||||||
|
get_target_property(target_include_dirs oqsprovider INCLUDE_DIRECTORIES)
|
||||||
|
message("Include directories for target_name: ${target_include_dirs}")
|
||||||
|
|
||||||
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
|
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||||
target_link_libraries(mayaqua PRIVATE oqsprovider)
|
target_link_libraries(mayaqua PRIVATE oqsprovider)
|
||||||
endif()
|
endif()
|
||||||
|
Loading…
Reference in New Issue
Block a user