Fix CMakeLists.txt target_link_libraries syntax

This commit is contained in:
2025-08-28 09:54:12 +02:00
parent 8e92ccb386
commit 65823b7016

View File

@ -99,14 +99,7 @@ target_include_directories(privatebinapi PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
)
# Include nlohmann/json
if(nlohmann_json_FOUND)
target_link_libraries(privatebinapi nlohmann_json::nlohmann_json)
else()
target_include_directories(privatebinapi PRIVATE ${NLOHMANN_JSON_INCLUDE_DIRS})
endif()
# Include Crypto++
# Link dependencies
if(cryptopp_FOUND)
target_link_libraries(privatebinapi PRIVATE cryptopp::cryptopp)
elseif(CRYPTOPP_LIBRARIES)
@ -114,8 +107,14 @@ elseif(CRYPTOPP_LIBRARIES)
target_link_libraries(privatebinapi PRIVATE ${CRYPTOPP_LIBRARIES})
endif()
# Link dependencies
target_link_libraries(privatebinapi ${PLATFORM_LIBS})
# Include nlohmann/json
if(nlohmann_json_FOUND)
target_link_libraries(privatebinapi PRIVATE nlohmann_json::nlohmann_json)
else()
target_include_directories(privatebinapi PRIVATE ${NLOHMANN_JSON_INCLUDE_DIRS})
endif()
target_link_libraries(privatebinapi PRIVATE ${PLATFORM_LIBS})
# Install targets
install(TARGETS privatebinapi