2018-05-19 21:40:20 +02:00
|
|
|
project(mycryptopp)
|
|
|
|
|
2019-10-20 03:35:03 +02:00
|
|
|
add_library(cryptopp INTERFACE)
|
2018-05-20 22:33:16 +02:00
|
|
|
# note: include directory is called vendor_cryptopp instead of cryptopp to avoid include clashes with system headers
|
2018-05-19 23:18:35 +02:00
|
|
|
target_include_directories(cryptopp SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
|
2018-09-27 08:13:53 +02:00
|
|
|
# Forward debug build info (i.e. set CRYPTOPP_DEBUG variable if building in debug mode)
|
2019-10-20 03:35:03 +02:00
|
|
|
target_compile_definitions(cryptopp INTERFACE $<$<CONFIG:Debug>:CRYPTOPP_DEBUG>) # add to all targets depending on this
|
2018-09-27 08:13:53 +02:00
|
|
|
add_compile_options($<$<CONFIG:Debug>:-DCRYPTOPP_DEBUG>) # add to stuff built in subdirectories (like the actual library)
|
2018-07-09 04:58:52 +02:00
|
|
|
|
2021-12-09 10:37:35 +01:00
|
|
|
if (NOT DISABLE_OPENMP)
|
|
|
|
set(USE_OPENMP ON CACHE BOOL "")
|
2018-09-28 08:31:26 +02:00
|
|
|
endif()
|
2020-06-28 19:04:12 +02:00
|
|
|
set(CRYPTOPP_BUILD_TESTING OFF CACHE BOOL "")
|
2018-11-11 02:07:38 +01:00
|
|
|
set(BUILD_DOCUMENTATION OFF CACHE BOOL "")
|
|
|
|
set(BUILD_SHARED OFF CACHE BOOL "")
|
|
|
|
set(BUILD_STATIC ON CACHE BOOL "")
|
2022-02-22 06:18:21 +01:00
|
|
|
set(USE_INTERMEDIATE_OBJECTS_TARGET OFF CACHE BOOL "")
|
2019-01-12 20:29:33 +01:00
|
|
|
set(cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING OFF CACHE BOOL "")
|
2018-05-19 21:40:20 +02:00
|
|
|
|
2022-06-18 21:11:24 +02:00
|
|
|
add_library(vendor_cryptopp STATIC IMPORTED)
|
|
|
|
set_target_properties(vendor_cryptopp PROPERTIES IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/vendor_cryptopp/libcryptopp.a)
|
|
|
|
target_link_libraries(cryptopp INTERFACE vendor_cryptopp)
|