Skip to content

Commit

Permalink
implement install for parallel-crypto3
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMlashkin committed Sep 24, 2024
1 parent a52736a commit 619331b
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
17 changes: 17 additions & 0 deletions parallel-crypto3/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,20 @@ add_subdirectory(libs/parallelization-utils)
add_subdirectory(libs/parallel-containers)
add_subdirectory(libs/parallel-math)
add_subdirectory(libs/parallel-zk)

# Configure package file to be able to import headers
include(CMakePackageConfigHelpers)
include(GNUInstallDirs)
set(CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/parallel-crypto3)

configure_package_config_file(
cmake/Config.cmake.in
parallel-crypto3Config.cmake
INSTALL_DESTINATION ${CONFIG_DIR}
)

install(
FILES
${CMAKE_CURRENT_BINARY_DIR}/parallel-crypto3Config.cmake
DESTINATION ${CONFIG_DIR}
)
16 changes: 16 additions & 0 deletions parallel-crypto3/cmake/Config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@PACKAGE_INIT@

include(CMakeFindDependencyMacro)
find_dependency(Boost COMPONENTS REQUIRED
container json filesystem log log_setup program_options thread system unit_test_framework)

# Protect against multiple inclusion
if (TARGET parallel-crypto3::all)
return()
endif()

add_library(parallel-crypto3::all INTERFACE IMPORTED)

set_target_properties(parallel-crypto3::all PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "@CMAKE_INSTALL_FULL_INCLUDEDIR@"
INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES})
6 changes: 1 addition & 5 deletions proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,9 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")

find_package(crypto3 REQUIRED)
find_package(parallel-crypto3 REQUIRED)
find_package(crypto3_transpiler REQUIRED)

find_package(actor_zk REQUIRED)
find_package(actor_containers REQUIRED)
find_package(actor_core REQUIRED)
find_package(actor_math REQUIRED)

# TODO: move thread to actor-core
find_package(Boost REQUIRED COMPONENTS filesystem log program_options thread)
if(ENABLE_TESTS)
Expand Down
2 changes: 1 addition & 1 deletion proof-producer/bin/proof-producer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ setup_proof_generator_target(TARGET_NAME ${SINGLE_THREADED_TARGET})

# Declare multi-threaded target
set(MULTI_THREADED_TARGET "${CURRENT_PROJECT_NAME}-multi-threaded")
setup_proof_generator_target(TARGET_NAME ${MULTI_THREADED_TARGET} ADDITIONAL_DEPENDENCIES actor::zk)
setup_proof_generator_target(TARGET_NAME ${MULTI_THREADED_TARGET} ADDITIONAL_DEPENDENCIES parallel-crypto3::all)

install(TARGETS ${SINGLE_THREADED_TARGET} ${MULTI_THREADED_TARGET} RUNTIME DESTINATION bin)

0 comments on commit 619331b

Please sign in to comment.