Update to properly use vcpkg-provided Crypto++

This commit is contained in:
2025-08-28 10:00:56 +02:00
parent 292780f991
commit cad675e0be
3 changed files with 12 additions and 73 deletions

View File

@ -46,8 +46,13 @@ else()
endif()
# Handle Crypto++ dependency
set(CRYPTOPP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg/installed/x64-windows/include")
set(CRYPTOPP_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg/installed/x64-windows/lib/cryptopp.lib")
find_package(cryptopp CONFIG QUIET)
if(cryptopp_FOUND)
message(STATUS "Found Crypto++ package via vcpkg")
else()
message(WARNING "Crypto++ not found via vcpkg. Make sure to use the vcpkg toolchain file.")
endif()
# Add library sources
set(SOURCES
@ -72,11 +77,12 @@ add_library(privatebinapi SHARED ${SOURCES} ${HEADERS})
# Include directories
target_include_directories(privatebinapi PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
${CRYPTOPP_INCLUDE_DIRS}
)
# Link Crypto++
target_link_libraries(privatebinapi PRIVATE ${CRYPTOPP_LIBRARIES})
if(cryptopp_FOUND)
target_link_libraries(privatebinapi PRIVATE cryptopp::cryptopp)
endif()
# Include nlohmann/json
if(nlohmann_json_FOUND)