Fix Crypto++ include directories and libraries paths
This commit is contained in:
@ -46,33 +46,8 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Handle Crypto++ dependency
|
# Handle Crypto++ dependency
|
||||||
# First try to find it as a package
|
set(CRYPTOPP_INCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg/installed/x64-windows/include")
|
||||||
find_package(PkgConfig QUIET)
|
set(CRYPTOPP_LIBRARIES "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg/installed/x64-windows/lib/cryptopp.lib")
|
||||||
if(PKG_CONFIG_FOUND)
|
|
||||||
pkg_check_modules(CRYPTOPP QUIET libcrypto++ cryptopp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Try to find Crypto++ using find_package
|
|
||||||
find_package(cryptopp CONFIG QUIET)
|
|
||||||
|
|
||||||
if(cryptopp_FOUND)
|
|
||||||
# Use the found package
|
|
||||||
message(STATUS "Found Crypto++ package via find_package")
|
|
||||||
set(CRYPTOPP_INCLUDE_DIRS "")
|
|
||||||
set(CRYPTOPP_LIBRARIES cryptopp::cryptopp)
|
|
||||||
else()
|
|
||||||
# Try to find it via vcpkg
|
|
||||||
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../vcpkg/installed/x64-windows/include/cryptopp/config.h")
|
|
||||||
message(STATUS "Found Crypto++ via vcpkg")
|
|
||||||
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")
|
|
||||||
else()
|
|
||||||
# For now, we'll provide a warning and use stub implementations
|
|
||||||
# In a real implementation, you would install Crypto++ separately
|
|
||||||
message(WARNING "Crypto++ not found. Using stub implementations for cryptographic functions.")
|
|
||||||
add_definitions(-DNO_CRYPTO)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Add library sources
|
# Add library sources
|
||||||
set(SOURCES
|
set(SOURCES
|
||||||
@ -97,19 +72,11 @@ add_library(privatebinapi SHARED ${SOURCES} ${HEADERS})
|
|||||||
# Include directories
|
# Include directories
|
||||||
target_include_directories(privatebinapi PUBLIC
|
target_include_directories(privatebinapi PUBLIC
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||||
|
${CRYPTOPP_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
# Include Crypto++
|
# Link Crypto++
|
||||||
if(NOT DEFINED NO_CRYPTO)
|
target_link_libraries(privatebinapi PRIVATE ${CRYPTOPP_LIBRARIES})
|
||||||
if(cryptopp_FOUND)
|
|
||||||
# Crypto++ found via find_package
|
|
||||||
target_link_libraries(privatebinapi PRIVATE cryptopp::cryptopp)
|
|
||||||
elseif(CRYPTOPP_INCLUDE_DIRS)
|
|
||||||
# Crypto++ found via vcpkg or other method
|
|
||||||
target_include_directories(privatebinapi PRIVATE ${CRYPTOPP_INCLUDE_DIRS})
|
|
||||||
target_link_libraries(privatebinapi PRIVATE ${CRYPTOPP_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Include nlohmann/json
|
# Include nlohmann/json
|
||||||
if(nlohmann_json_FOUND)
|
if(nlohmann_json_FOUND)
|
||||||
|
|||||||
Reference in New Issue
Block a user