libcryfs/vendor/cryptopp/CMakeLists.txt

29 lines
1.3 KiB
CMake
Raw Normal View History

project(mycryptopp)
add_library(cryptopp INTERFACE)
# 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})
# Forward debug build info (i.e. set CRYPTOPP_DEBUG variable if building in debug mode)
target_compile_definitions(cryptopp INTERFACE $<$<CONFIG:Debug>:CRYPTOPP_DEBUG>) # add to all targets depending on this
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
if (NOT DISABLE_OPENMP)
set(USE_OPENMP ON CACHE BOOL "")
endif()
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 "")
set(USE_INTERMEDIATE_OBJECTS_TARGET OFF CACHE BOOL "")
set(cryptocpp_DISPLAY_CMAKE_SUPPORT_WARNING OFF CACHE BOOL "")
2022-06-09 15:26:04 +02:00
set(LIBCRYPTOPP_A "${CMAKE_CURRENT_SOURCE_DIR}/vendor_cryptopp/build/${CMAKE_ANDROID_ARCH_ABI}/libcryptopp.a")
add_custom_target(
vendor_cryptopp
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/android-build.sh ${CMAKE_ANDROID_NDK} ${CMAKE_ANDROID_ARCH_ABI}
BYPRODUCTS ${LIBCRYPTOPP_A}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(cryptopp INTERFACE ${LIBCRYPTOPP_A})