Skip to content

Commit

Permalink
only include libraries if they dont already exist
Browse files Browse the repository at this point in the history
  • Loading branch information
darcys22 committed Sep 3, 2023
1 parent fd48684 commit 7e216fd
Showing 1 changed file with 24 additions and 14 deletions.
38 changes: 24 additions & 14 deletions external/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
set(CPR_USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
add_subdirectory(cpr)
set(SECP256K1_ENABLE_MODULE_RECOVERY ON CACHE BOOL "" FORCE)
set(SECP256K1_VALGRIND OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_CTIME_TESTS OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(secp256k1)
add_subdirectory(Catch2)
if(NOT TARGET cpr)
set(CPR_USE_SYSTEM_CURL ON CACHE BOOL "" FORCE)
add_subdirectory(cpr)
endif()

if(NOT TARGET secp256k1)
set(SECP256K1_ENABLE_MODULE_RECOVERY ON CACHE BOOL "" FORCE)
set(SECP256K1_VALGRIND OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_BENCHMARK OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_EXHAUSTIVE_TESTS OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_CTIME_TESTS OFF CACHE BOOL "" FORCE)
set(SECP256K1_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(secp256k1)
endif()

if(NOT TARGET Catch2)
add_subdirectory(Catch2)
endif()

# RLPValue is built using autotools
include(ExternalProject)
Expand Down Expand Up @@ -38,6 +46,8 @@ add_dependencies(rlpvalue librlpvalue)
set_target_properties(rlpvalue PROPERTIES IMPORTED_LOCATION ${RLP_SHARED_LIB})
set_target_properties(rlpvalue PROPERTIES INTERFACE_INCLUDE_DIRECTORIES ${RLP_INCLUDES})

set(JSON_BuildTests OFF CACHE INTERNAL "")
set(JSON_MultipleHeaders ON CACHE BOOL "") # Allows multi-header nlohmann use
add_subdirectory(json EXCLUDE_FROM_ALL)
if(NOT TARGET nlohmann_json)
set(JSON_BuildTests OFF CACHE INTERNAL "")
set(JSON_MultipleHeaders ON CACHE BOOL "") # Allows multi-header nlohmann use
add_subdirectory(json EXCLUDE_FROM_ALL)
endif()

0 comments on commit 7e216fd

Please sign in to comment.