From cea402d7354b5a07c1884790291764969c362240 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Mon, 23 Sep 2024 12:51:36 +0200 Subject: [PATCH 1/8] cmake refactoring --- transpiler/CMakeLists.txt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/transpiler/CMakeLists.txt b/transpiler/CMakeLists.txt index fc385b0532..f3cf7f3d21 100644 --- a/transpiler/CMakeLists.txt +++ b/transpiler/CMakeLists.txt @@ -17,27 +17,28 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug") endif() cm_workspace(crypto3) -cm_project(transpiler WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES ASM C CXX) +cm_project(transpiler WORKSPACE_NAME crypto3 LANGUAGES ASM C CXX) -cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) +cm_setup_version(VERSION 0.1.0 PREFIX crypto3_transpiler) find_package(crypto3 REQUIRED) -add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(crypto3_transpiler INTERFACE) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) -target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE +target_include_directories(crypto3_transpiler INTERFACE "$" "$" ${Boost_INCLUDE_DIRS}) -target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE +target_link_libraries(crypto3_transpiler INTERFACE crypto3::all ${Boost_LIBRARIES}) + include(CMDeploy) cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include From d8bd02fb12d20028c38ade790bf90ece7b5cc44a Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Mon, 23 Sep 2024 13:29:07 +0200 Subject: [PATCH 2/8] get rid of cm_deploy in transpiler --- .../bin/proof-producer/CMakeLists.txt | 2 +- transpiler/CMakeLists.txt | 25 +++++++++++++++---- transpiler/cmake/Config.cmake.in | 17 +++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) create mode 100644 transpiler/cmake/Config.cmake.in diff --git a/proof-producer/bin/proof-producer/CMakeLists.txt b/proof-producer/bin/proof-producer/CMakeLists.txt index ec905b2d8c..7a139cc1b6 100644 --- a/proof-producer/bin/proof-producer/CMakeLists.txt +++ b/proof-producer/bin/proof-producer/CMakeLists.txt @@ -68,7 +68,7 @@ function(setup_proof_generator_target) target_link_libraries(${ARG_TARGET_NAME} crypto3::all - crypto3::transpiler + crypto3_transpiler Boost::filesystem Boost::log diff --git a/transpiler/CMakeLists.txt b/transpiler/CMakeLists.txt index f3cf7f3d21..738b84eae1 100644 --- a/transpiler/CMakeLists.txt +++ b/transpiler/CMakeLists.txt @@ -39,10 +39,25 @@ target_link_libraries(crypto3_transpiler INTERFACE crypto3::all ${Boost_LIBRARIES}) -include(CMDeploy) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +include(CMakePackageConfigHelpers) +include(GNUInstallDirs) +set(CONFIG_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/crypto3_transpiler) + +configure_package_config_file( + cmake/Config.cmake.in + crypto3_transpilerConfig.cmake + INSTALL_DESTINATION ${CONFIG_DIR} +) + +# Install generated cmake config +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/crypto3_transpilerConfig.cmake + DESTINATION ${CONFIG_DIR} +) + +# Install transpiler headers +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/transpiler/cmake/Config.cmake.in b/transpiler/cmake/Config.cmake.in new file mode 100644 index 0000000000..df4f6dcf48 --- /dev/null +++ b/transpiler/cmake/Config.cmake.in @@ -0,0 +1,17 @@ +@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 crypto3_transpiler) + return() +endif() + + +add_library(crypto3_transpiler INTERFACE IMPORTED) + +set_target_properties(crypto3_transpiler PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "@CMAKE_INSTALL_FULL_INCLUDEDIR@" + INTERFACE_LINK_LIBRARIES ${Boost_LIBRARIES}) From 7891254f4f2b577cd332cb38667ac2bd95643b87 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 24 Sep 2024 10:07:30 +0200 Subject: [PATCH 3/8] remove cm_find_package --- crypto3/libs/mac/CMakeLists.txt | 4 ---- crypto3/libs/pbkdf/CMakeLists.txt | 3 --- crypto3/libs/random/CMakeLists.txt | 2 -- crypto3/libs/vdf/CMakeLists.txt | 3 --- 4 files changed, 12 deletions(-) diff --git a/crypto3/libs/mac/CMakeLists.txt b/crypto3/libs/mac/CMakeLists.txt index f3e081ce41..5eec0e425b 100644 --- a/crypto3/libs/mac/CMakeLists.txt +++ b/crypto3/libs/mac/CMakeLists.txt @@ -11,10 +11,6 @@ cm_project(mac WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) include(CMDeploy) include(CMSetupVersion) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) -cm_find_package(${CMAKE_WORKSPACE_NAME}_modes) - option(CRYPTO3_MAC_CBC "Build with CBC MAC support" TRUE) option(CRYPTO3_MAC_CMAC "Build with CMAC support" TRUE) option(CRYPTO3_MAC_HMAC "Build with HMAC support" TRUE) diff --git a/crypto3/libs/pbkdf/CMakeLists.txt b/crypto3/libs/pbkdf/CMakeLists.txt index 2b529944e2..9014ca7ac3 100644 --- a/crypto3/libs/pbkdf/CMakeLists.txt +++ b/crypto3/libs/pbkdf/CMakeLists.txt @@ -12,9 +12,6 @@ include(CMConfig) cm_project(pbkdf WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) -cm_find_package(${CMAKE_WORKSPACE_NAME}_mac) - option(CRYPTO3_PBKDF_PBKDF1 "Build with PBKDF1 support" TRUE) option(CRYPTO3_PBKDF_PBKDF2 "Build with PBKDF2 support" TRUE) option(CRYPTO3_PBKDF_PGP_S2K "Build with PGP S2K support" TRUE) diff --git a/crypto3/libs/random/CMakeLists.txt b/crypto3/libs/random/CMakeLists.txt index d47a5a7499..7830972164 100644 --- a/crypto3/libs/random/CMakeLists.txt +++ b/crypto3/libs/random/CMakeLists.txt @@ -20,8 +20,6 @@ include(CMSetupVersion) cm_workspace(crypto3 SOURCES_DIR "${CMAKE_CURRENT_LIST_DIR}") -cm_find_package(${CMAKE_WORKSPACE_NAME}_random) - cm_project(random WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) cm_setup_version(VERSION 1.74.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) diff --git a/crypto3/libs/vdf/CMakeLists.txt b/crypto3/libs/vdf/CMakeLists.txt index 9fdd3042e5..dc1a0c1a29 100644 --- a/crypto3/libs/vdf/CMakeLists.txt +++ b/crypto3/libs/vdf/CMakeLists.txt @@ -69,9 +69,6 @@ elseif(CRYPTO3_VDF_BOOST) if(Boost_FOUND) cm_find_package(TomMath) endif() - - cm_find_package(${CMAKE_WORKSPACE_NAME}_block) - cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) endif() if(CRYPTO3_VDF_GMP OR CRYPTO3_VDF_MPIR) From e6f88e2c736c99d28c57635e9add8a9d54af53bd Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 24 Sep 2024 10:11:35 +0200 Subject: [PATCH 4/8] remove cm_find_package from tests --- crypto3/libs/hash/test/CMakeLists.txt | 2 -- crypto3/libs/kdf/CMakeLists.txt | 4 ---- crypto3/libs/kdf/test/CMakeLists.txt | 3 --- crypto3/libs/mac/test/CMakeLists.txt | 3 --- crypto3/libs/passhash/CMakeLists.txt | 3 --- crypto3/libs/passhash/test/CMakeLists.txt | 4 ---- crypto3/libs/pubkey/test/CMakeLists.txt | 4 ---- crypto3/libs/stream/test/CMakeLists.txt | 2 -- crypto3/libs/threshold/CMakeLists.txt | 2 -- crypto3/libs/threshold/test/CMakeLists.txt | 2 -- crypto3/libs/vdf/CMakeLists.txt | 6 ------ 11 files changed, 35 deletions(-) diff --git a/crypto3/libs/hash/test/CMakeLists.txt b/crypto3/libs/hash/test/CMakeLists.txt index 1915e96f74..dd26cd3dd3 100644 --- a/crypto3/libs/hash/test/CMakeLists.txt +++ b/crypto3/libs/hash/test/CMakeLists.txt @@ -8,8 +8,6 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${${CURRENT_PROJECT_NAME}_INTERFACE_LIBRARIES} Boost::unit_test_framework) diff --git a/crypto3/libs/kdf/CMakeLists.txt b/crypto3/libs/kdf/CMakeLists.txt index 6ab361a27d..138d965a11 100644 --- a/crypto3/libs/kdf/CMakeLists.txt +++ b/crypto3/libs/kdf/CMakeLists.txt @@ -12,10 +12,6 @@ include(CMConfig) cm_project(kdf WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) -cm_find_package(${CMAKE_WORKSPACE_NAME}_mac) - option(CRYPTO3_KDF_HKDF "Build with HKDF support" TRUE) option(CRYPTO3_KDF_KDF1 "Build with HKDF support" TRUE) option(CRYPTO3_KDF_KDF1_18033 "Build with HKDF support" TRUE) diff --git a/crypto3/libs/kdf/test/CMakeLists.txt b/crypto3/libs/kdf/test/CMakeLists.txt index 8a4928c12c..369f9c6afe 100644 --- a/crypto3/libs/kdf/test/CMakeLists.txt +++ b/crypto3/libs/kdf/test/CMakeLists.txt @@ -8,9 +8,6 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} Boost::unit_test_framework) diff --git a/crypto3/libs/mac/test/CMakeLists.txt b/crypto3/libs/mac/test/CMakeLists.txt index f19792a4c2..085d7872ba 100644 --- a/crypto3/libs/mac/test/CMakeLists.txt +++ b/crypto3/libs/mac/test/CMakeLists.txt @@ -8,9 +8,6 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} Boost::unit_test_framework) diff --git a/crypto3/libs/passhash/CMakeLists.txt b/crypto3/libs/passhash/CMakeLists.txt index 8f2ed581f2..8fdd7ebca3 100644 --- a/crypto3/libs/passhash/CMakeLists.txt +++ b/crypto3/libs/passhash/CMakeLists.txt @@ -12,9 +12,6 @@ include(CMConfig) cm_project(passhash WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -cm_find_package(${CMAKE_WORKSPACE_NAME}_codec) -cm_find_package(${CMAKE_WORKSPACE_NAME}_mac) - cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) diff --git a/crypto3/libs/passhash/test/CMakeLists.txt b/crypto3/libs/passhash/test/CMakeLists.txt index 651108f149..57cb1d085a 100644 --- a/crypto3/libs/passhash/test/CMakeLists.txt +++ b/crypto3/libs/passhash/test/CMakeLists.txt @@ -8,10 +8,6 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -cm_find_package(${CMAKE_WORKSPACE_NAME}_codec) -cm_find_package(${CMAKE_WORKSPACE_NAME}_kdf) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::block ${CMAKE_WORKSPACE_NAME}::kdf diff --git a/crypto3/libs/pubkey/test/CMakeLists.txt b/crypto3/libs/pubkey/test/CMakeLists.txt index 9201b8a342..f2292a4a56 100644 --- a/crypto3/libs/pubkey/test/CMakeLists.txt +++ b/crypto3/libs/pubkey/test/CMakeLists.txt @@ -1,9 +1,5 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_marshalling) -cm_find_package(${CMAKE_WORKSPACE_NAME}_random) -cm_find_package(${CMAKE_WORKSPACE_NAME}_blueprint) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::pkpad Boost::unit_test_framework) diff --git a/crypto3/libs/stream/test/CMakeLists.txt b/crypto3/libs/stream/test/CMakeLists.txt index b1dc38270b..346d406b71 100644 --- a/crypto3/libs/stream/test/CMakeLists.txt +++ b/crypto3/libs/stream/test/CMakeLists.txt @@ -8,8 +8,6 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_block) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} Boost::unit_test_framework) diff --git a/crypto3/libs/threshold/CMakeLists.txt b/crypto3/libs/threshold/CMakeLists.txt index 44387084be..7df8836a42 100644 --- a/crypto3/libs/threshold/CMakeLists.txt +++ b/crypto3/libs/threshold/CMakeLists.txt @@ -12,8 +12,6 @@ include(CMConfig) cm_project(threshold WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -cm_find_package(${CMAKE_WORKSPACE_NAME}_pubkey) - cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) diff --git a/crypto3/libs/threshold/test/CMakeLists.txt b/crypto3/libs/threshold/test/CMakeLists.txt index 96199cfa49..ae182fc972 100644 --- a/crypto3/libs/threshold/test/CMakeLists.txt +++ b/crypto3/libs/threshold/test/CMakeLists.txt @@ -8,8 +8,6 @@ include(CMTest) -cm_find_package(${CMAKE_WORKSPACE_NAME}_pubkey) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} Boost::unit_test_framework) diff --git a/crypto3/libs/vdf/CMakeLists.txt b/crypto3/libs/vdf/CMakeLists.txt index dc1a0c1a29..e2191fa3bd 100644 --- a/crypto3/libs/vdf/CMakeLists.txt +++ b/crypto3/libs/vdf/CMakeLists.txt @@ -56,12 +56,6 @@ if(CRYPTO3_VDF_MPIR OR CRYPTO3_VDF_GMP OR CRYPTO3_VDF_FLINT) cm_find_package(MPFR REQUIRED) endif() elseif(CRYPTO3_VDF_BOOST) - if(NOT TARGET ${CMAKE_WORKSPACE_NAME}::multiprecision) - if(${CMAKE_WORKSPACE_NAME} STREQUAL boost) - cm_find_package(${CMAKE_WORKSPACE_NAME}_multiprecision) - endif() - endif() - if(NOT Boost_FOUND) find_package(Boost REQUIRED) endif() From 0b70bc959716c7c829abaf32d3fb70e66c7811df Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 24 Sep 2024 10:35:51 +0200 Subject: [PATCH 5/8] don't use cm_deploy for crypto3 --- crypto3/libs/algebra/CMakeLists.txt | 9 +++------ crypto3/libs/benchmark_tools/CMakeLists.txt | 11 ++++------- crypto3/libs/block/CMakeLists.txt | 9 ++++----- crypto3/libs/blueprint/CMakeLists.txt | 10 +++------- crypto3/libs/codec/CMakeLists.txt | 9 ++++----- crypto3/libs/containers/CMakeLists.txt | 7 +++---- crypto3/libs/hash/CMakeLists.txt | 8 +++----- crypto3/libs/kdf/CMakeLists.txt | 9 ++++----- crypto3/libs/mac/CMakeLists.txt | 9 ++++----- crypto3/libs/marshalling/algebra/CMakeLists.txt | 8 ++++---- crypto3/libs/marshalling/core/CMakeLists.txt | 8 ++++---- .../libs/marshalling/multiprecision/CMakeLists.txt | 8 ++++---- crypto3/libs/marshalling/zk/CMakeLists.txt | 11 +++++------ crypto3/libs/math/CMakeLists.txt | 9 ++++----- crypto3/libs/modes/CMakeLists.txt | 8 ++++---- crypto3/libs/multiprecision/CMakeLists.txt | 13 ++++--------- crypto3/libs/passhash/CMakeLists.txt | 9 ++++----- crypto3/libs/pbkdf/CMakeLists.txt | 9 ++++----- crypto3/libs/pkpad/CMakeLists.txt | 6 +----- crypto3/libs/pubkey/CMakeLists.txt | 6 +----- crypto3/libs/random/CMakeLists.txt | 12 ++++-------- crypto3/libs/stream/CMakeLists.txt | 9 ++++----- crypto3/libs/threshold/CMakeLists.txt | 7 ++++--- crypto3/libs/vdf/CMakeLists.txt | 7 +++---- crypto3/libs/zk/CMakeLists.txt | 9 ++++----- 25 files changed, 90 insertions(+), 130 deletions(-) diff --git a/crypto3/libs/algebra/CMakeLists.txt b/crypto3/libs/algebra/CMakeLists.txt index 6ef66dee54..bca8ee15cf 100644 --- a/crypto3/libs/algebra/CMakeLists.txt +++ b/crypto3/libs/algebra/CMakeLists.txt @@ -11,8 +11,6 @@ include(CMSetupVersion) cm_project(algebra WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES ASM C CXX) -include(CMDeploy) - # Blurprint components are using point {0, 0} as a point in infinity, while the stadard is {0, 1} # for most curves. We will use compatibility mode with blueprint as default. Setting this flag to # TRUE will change the value of inf point for all curves to the standard value. @@ -25,6 +23,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -36,10 +35,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::multiprecision) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) @@ -47,3 +42,5 @@ if(BUILD_EXAMPLES) add_subdirectory(example) endif() +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/benchmark_tools/CMakeLists.txt b/crypto3/libs/benchmark_tools/CMakeLists.txt index 56d2581004..1928a05a99 100644 --- a/crypto3/libs/benchmark_tools/CMakeLists.txt +++ b/crypto3/libs/benchmark_tools/CMakeLists.txt @@ -8,12 +8,10 @@ include(CMConfig) include(CMSetupVersion) cm_project(benchmark_tools WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES CXX) - -include(CMDeploy) - cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -22,8 +20,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $ $) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/block/CMakeLists.txt b/crypto3/libs/block/CMakeLists.txt index a048825d93..ce33866678 100644 --- a/crypto3/libs/block/CMakeLists.txt +++ b/crypto3/libs/block/CMakeLists.txt @@ -7,7 +7,6 @@ #---------------------------------------------------------------------------# include(CMConfig) -include(CMDeploy) include(CMSetupVersion) cm_project(block WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) @@ -171,6 +170,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -202,9 +202,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER ${Boost_INCLUDE_DIRS}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/blueprint/CMakeLists.txt b/crypto3/libs/blueprint/CMakeLists.txt index 7dc198a34c..254d703bfa 100644 --- a/crypto3/libs/blueprint/CMakeLists.txt +++ b/crypto3/libs/blueprint/CMakeLists.txt @@ -3,11 +3,10 @@ include(CMSetupVersion) cm_project(blueprint WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -include(CMDeploy) - cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -19,11 +18,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${Boost_LIBRARIES} ) - -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) @@ -31,3 +25,5 @@ if(BUILD_EXAMPLES) add_subdirectory(example) endif() +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/codec/CMakeLists.txt b/crypto3/libs/codec/CMakeLists.txt index 39d3fb3763..ecb6560f51 100644 --- a/crypto3/libs/codec/CMakeLists.txt +++ b/crypto3/libs/codec/CMakeLists.txt @@ -7,7 +7,6 @@ #---------------------------------------------------------------------------# include(CMConfig) -include(CMDeploy) include(CMSetupVersion) cm_project(codec WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) @@ -19,6 +18,7 @@ set(BUILD_WITH_CONFIGURATION_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE ST cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) if(CRYPTO3_CODEC_BASE58) target_compile_definitions(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE CRYPTO3_CODEC_BASE58) @@ -38,10 +38,9 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER ${Boost_INCLUDE_DIRS}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - # Some tests failed, so we are turning off tests for this submodule for now. # include(CMTest) # cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/containers/CMakeLists.txt b/crypto3/libs/containers/CMakeLists.txt index 0fe20bf82f..384e70b189 100644 --- a/crypto3/libs/containers/CMakeLists.txt +++ b/crypto3/libs/containers/CMakeLists.txt @@ -25,8 +25,6 @@ include(CMConfig) include(CMSetupVersion) - -include(CMDeploy) include(CMSetupVersion) cm_project(containers WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) @@ -38,6 +36,7 @@ set(DOXYGEN_OUTPUT_DIR "${CMAKE_CURRENT_LIST_DIR}/docs" CACHE STRING "Specify do cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -55,11 +54,11 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER ${Boost_INCLUDE_DIRS}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) if (BUILD_EXAMPLES) add_subdirectory(example) endif () +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/hash/CMakeLists.txt b/crypto3/libs/hash/CMakeLists.txt index 218eb7ae6a..25271e0ef7 100644 --- a/crypto3/libs/hash/CMakeLists.txt +++ b/crypto3/libs/hash/CMakeLists.txt @@ -7,7 +7,6 @@ #---------------------------------------------------------------------------# include(CMConfig) -include(CMDeploy) include(CMSetupVersion) cm_project(hash WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) @@ -126,6 +125,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -143,10 +143,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - if(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "x86_64" OR ${CMAKE_TARGET_ARCHITECTURE} STREQUAL "x86") if(CXX_AVX512_FOUND) target_compile_definitions(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE @@ -165,3 +161,5 @@ elseif(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "ppc64") "${CMAKE_UPPER_WORKSPACE_NAME}_HAS_POWER8") endif() +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/kdf/CMakeLists.txt b/crypto3/libs/kdf/CMakeLists.txt index 138d965a11..c957141987 100644 --- a/crypto3/libs/kdf/CMakeLists.txt +++ b/crypto3/libs/kdf/CMakeLists.txt @@ -6,7 +6,6 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# -include(CMDeploy) include(CMSetupVersion) include(CMConfig) @@ -61,6 +60,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -73,9 +73,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER "$" "$") -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/mac/CMakeLists.txt b/crypto3/libs/mac/CMakeLists.txt index 5eec0e425b..a794aaa69d 100644 --- a/crypto3/libs/mac/CMakeLists.txt +++ b/crypto3/libs/mac/CMakeLists.txt @@ -8,7 +8,6 @@ cm_project(mac WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -include(CMDeploy) include(CMSetupVersion) option(CRYPTO3_MAC_CBC "Build with CBC MAC support" TRUE) @@ -54,6 +53,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -71,10 +71,9 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - # mac/test/hmac.cpp does not compile, so commenting this for now. #include(CMTest) #cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/marshalling/algebra/CMakeLists.txt b/crypto3/libs/marshalling/algebra/CMakeLists.txt index ed5caf8bea..988717ad67 100644 --- a/crypto3/libs/marshalling/algebra/CMakeLists.txt +++ b/crypto3/libs/marshalling/algebra/CMakeLists.txt @@ -16,6 +16,7 @@ option(BUILD_WITH_NO_WARNINGS "Build threading warnings as errors" FALSE) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -34,10 +35,6 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE Boost::random ) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) if((CMAKE_COMPILER_IS_GNUCC) OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) @@ -90,3 +87,6 @@ endif() if(CMAKE_TOOLCHAIN_FILE AND EXISTS ${CMAKE_TOOLCHAIN_FILE}) message(STATUS "Loading toolchain from ${CMAKE_TOOLCHAIN_FILE}") endif() + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/marshalling/core/CMakeLists.txt b/crypto3/libs/marshalling/core/CMakeLists.txt index 92ca677ceb..baa43c4444 100644 --- a/crypto3/libs/marshalling/core/CMakeLists.txt +++ b/crypto3/libs/marshalling/core/CMakeLists.txt @@ -26,6 +26,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -39,10 +40,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE Boost::container) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) @@ -121,3 +118,6 @@ if(DOXYGEN_FOUND) ${CMAKE_SOURCE_DIR}/cmake/DocCleanupScript.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif() + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/marshalling/multiprecision/CMakeLists.txt b/crypto3/libs/marshalling/multiprecision/CMakeLists.txt index 32930efcb1..144d1b43db 100644 --- a/crypto3/libs/marshalling/multiprecision/CMakeLists.txt +++ b/crypto3/libs/marshalling/multiprecision/CMakeLists.txt @@ -16,6 +16,7 @@ option(BUILD_WITH_NO_WARNINGS "Build threading warnings as errors" FALSE) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -32,10 +33,6 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE crypto3::multiprecision ${CMAKE_WORKSPACE_NAME}::marshalling-core) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) if((CMAKE_COMPILER_IS_GNUCC) OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) @@ -88,3 +85,6 @@ endif() if(CMAKE_TOOLCHAIN_FILE AND EXISTS ${CMAKE_TOOLCHAIN_FILE}) message(STATUS "Loading toolchain from ${CMAKE_TOOLCHAIN_FILE}") endif() + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/marshalling/zk/CMakeLists.txt b/crypto3/libs/marshalling/zk/CMakeLists.txt index dfeb3e68de..2c223f3a7d 100644 --- a/crypto3/libs/marshalling/zk/CMakeLists.txt +++ b/crypto3/libs/marshalling/zk/CMakeLists.txt @@ -1,12 +1,10 @@ include(CMConfig) -include(CMDeploy) include(CMSetupVersion) cm_workspace(crypto3) cm_project(marshalling-zk WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) cm_find_package(CM) -include(CMDeploy) include(FindPkgConfig) include(CMSetupVersion) @@ -16,6 +14,7 @@ option(BUILD_WITH_NO_WARNINGS "Build threading warnings as errors" FALSE) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -24,6 +23,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER "$" "$") + target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE Boost::container @@ -39,10 +39,6 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::marshalling-algebra ${CMAKE_WORKSPACE_NAME}::marshalling-core) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) if(BUILD_EXAMPLES) @@ -99,3 +95,6 @@ endif() if(CMAKE_TOOLCHAIN_FILE AND EXISTS ${CMAKE_TOOLCHAIN_FILE}) message(STATUS "Loading toolchain from ${CMAKE_TOOLCHAIN_FILE}") endif() + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/math/CMakeLists.txt b/crypto3/libs/math/CMakeLists.txt index 33b3c8abe2..18a73dd09c 100644 --- a/crypto3/libs/math/CMakeLists.txt +++ b/crypto3/libs/math/CMakeLists.txt @@ -12,11 +12,11 @@ include(CMSetupVersion) cm_project(math WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES ASM C CXX) cm_find_package(CM) -include(CMDeploy) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -35,8 +35,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE Boost::random ) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/modes/CMakeLists.txt b/crypto3/libs/modes/CMakeLists.txt index 50e3eea387..586581617f 100644 --- a/crypto3/libs/modes/CMakeLists.txt +++ b/crypto3/libs/modes/CMakeLists.txt @@ -45,6 +45,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -62,9 +63,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/multiprecision/CMakeLists.txt b/crypto3/libs/multiprecision/CMakeLists.txt index 91d4d4b6b4..d91da79331 100644 --- a/crypto3/libs/multiprecision/CMakeLists.txt +++ b/crypto3/libs/multiprecision/CMakeLists.txt @@ -7,11 +7,6 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# - - -set(BOOST_CMAKE FALSE) - -include(CMDeploy) include(CMConfig) include(CMSetupVersion) @@ -20,6 +15,7 @@ cm_project(multiprecision WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES CXX) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -32,9 +28,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/passhash/CMakeLists.txt b/crypto3/libs/passhash/CMakeLists.txt index 8fdd7ebca3..ad6e6a0322 100644 --- a/crypto3/libs/passhash/CMakeLists.txt +++ b/crypto3/libs/passhash/CMakeLists.txt @@ -6,7 +6,6 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# -include(CMDeploy) include(CMSetupVersion) include(CMConfig) @@ -15,6 +14,8 @@ cm_project(passhash WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) + set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -30,10 +31,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER ${Boost_INCLUDE_DIRS}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/pbkdf/CMakeLists.txt b/crypto3/libs/pbkdf/CMakeLists.txt index 9014ca7ac3..c7bac4c132 100644 --- a/crypto3/libs/pbkdf/CMakeLists.txt +++ b/crypto3/libs/pbkdf/CMakeLists.txt @@ -6,7 +6,6 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# -include(CMDeploy) include(CMSetupVersion) include(CMConfig) @@ -31,6 +30,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -43,9 +43,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER "$" "$") -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/pkpad/CMakeLists.txt b/crypto3/libs/pkpad/CMakeLists.txt index 22485cf669..f181eef0ad 100644 --- a/crypto3/libs/pkpad/CMakeLists.txt +++ b/crypto3/libs/pkpad/CMakeLists.txt @@ -1,6 +1,5 @@ cm_project(pkpad WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -include(CMDeploy) include(CMSetupVersion) option(CRYPTO3_PK_PAD_EME_OAEP "Build with EME OAEP support" TRUE) @@ -57,6 +56,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -74,10 +74,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - # Disabling tests because ./libs/pkpad/test/pkpad_emsa1_test is unable to find it's test data. # The paths need to be fixed. # include(CMTest) diff --git a/crypto3/libs/pubkey/CMakeLists.txt b/crypto3/libs/pubkey/CMakeLists.txt index ec370cbfd8..cf8538aa69 100644 --- a/crypto3/libs/pubkey/CMakeLists.txt +++ b/crypto3/libs/pubkey/CMakeLists.txt @@ -1,7 +1,6 @@ cm_project(pubkey WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) cm_find_package(CM) -include(CMDeploy) include(CMSetupVersion) list(APPEND ${CURRENT_PROJECT_NAME}_LIBRARIES @@ -33,6 +32,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -47,10 +47,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) if(BUILD_EXAMPLES) diff --git a/crypto3/libs/random/CMakeLists.txt b/crypto3/libs/random/CMakeLists.txt index 7830972164..e17a64758f 100644 --- a/crypto3/libs/random/CMakeLists.txt +++ b/crypto3/libs/random/CMakeLists.txt @@ -10,11 +10,6 @@ cmake_minimum_required(VERSION 3.5) set(BOOST_CMAKE FALSE) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake" - "${CMAKE_CURRENT_LIST_DIR}/cmake/packages" - "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/share/modules/cmake") - -include(CMDeploy) include(CMConfig) include(CMSetupVersion) @@ -25,6 +20,8 @@ cm_project(random WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) cm_setup_version(VERSION 1.74.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) + set_property(TARGET ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTY EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -44,9 +41,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE ${CURRENT_SOURCES_DIR}/include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) include(CMTest) cm_add_test_subdirectory(test) diff --git a/crypto3/libs/stream/CMakeLists.txt b/crypto3/libs/stream/CMakeLists.txt index 04ae0e363b..7b0ed8fcd3 100644 --- a/crypto3/libs/stream/CMakeLists.txt +++ b/crypto3/libs/stream/CMakeLists.txt @@ -7,7 +7,6 @@ #---------------------------------------------------------------------------# include(CMConfig) -include(CMDeploy) include(CMSetupVersion) cm_project(stream WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) @@ -37,6 +36,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -64,9 +64,8 @@ if(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "x86_64" OR endif() endif() -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/crypto3/libs/threshold/CMakeLists.txt b/crypto3/libs/threshold/CMakeLists.txt index 7df8836a42..db419416a9 100644 --- a/crypto3/libs/threshold/CMakeLists.txt +++ b/crypto3/libs/threshold/CMakeLists.txt @@ -15,6 +15,8 @@ cm_project(threshold WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) + set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -31,9 +33,8 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) include(CMTest) cm_add_test_subdirectory(test) diff --git a/crypto3/libs/vdf/CMakeLists.txt b/crypto3/libs/vdf/CMakeLists.txt index e2191fa3bd..f589fb7f47 100644 --- a/crypto3/libs/vdf/CMakeLists.txt +++ b/crypto3/libs/vdf/CMakeLists.txt @@ -6,7 +6,6 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# -include(CMDeploy) include(CMSetupVersion) include(CMConfig) @@ -76,6 +75,7 @@ endif() cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) if(CRYPTO3_VDF_USE_SIMD) target_compile_definitions(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE @@ -164,9 +164,8 @@ elseif(CRYPTO3_VDF_BOOST) endif() endif() -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Commenting out the tests since libs/vdf/test/chia.cpp fails. #include(CMTest) diff --git a/crypto3/libs/zk/CMakeLists.txt b/crypto3/libs/zk/CMakeLists.txt index a9eb134ae1..2468fb8f09 100644 --- a/crypto3/libs/zk/CMakeLists.txt +++ b/crypto3/libs/zk/CMakeLists.txt @@ -18,12 +18,12 @@ endif() cm_project(zk WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -include(CMDeploy) include(FindPkgConfig) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -52,9 +52,8 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE crypto3::benchmark_tools ) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) From 8fea9bd5c7f8966ed92a56075977890f7224930b Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 24 Sep 2024 10:44:35 +0200 Subject: [PATCH 6/8] remove cm_deploy from parallel-crypto3 --- parallel-crypto3/CMakeLists.txt | 1 - .../libs/parallel-containers/CMakeLists.txt | 6 +++--- parallel-crypto3/libs/parallel-math/CMakeLists.txt | 9 ++++----- parallel-crypto3/libs/parallel-zk/CMakeLists.txt | 9 ++++----- .../libs/parallelization-utils/CMakeLists.txt | 10 ++++------ 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/parallel-crypto3/CMakeLists.txt b/parallel-crypto3/CMakeLists.txt index e4906392e2..00fb5f9d50 100644 --- a/parallel-crypto3/CMakeLists.txt +++ b/parallel-crypto3/CMakeLists.txt @@ -29,7 +29,6 @@ endif() # TODO: check what is actually required here include(CMConfig) -include(CMDeploy) include(CMSetupVersion) # TODO: beutify entire cmake tree of parallel crypto3 modules the same way we did in origin crypto3 diff --git a/parallel-crypto3/libs/parallel-containers/CMakeLists.txt b/parallel-crypto3/libs/parallel-containers/CMakeLists.txt index 699fd04800..8313bde9dc 100644 --- a/parallel-crypto3/libs/parallel-containers/CMakeLists.txt +++ b/parallel-crypto3/libs/parallel-containers/CMakeLists.txt @@ -28,7 +28,6 @@ include(CMSetupVersion) cm_workspace(actor) -include(CMDeploy) include(CMSetupVersion) if (NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) @@ -56,6 +55,7 @@ list(APPEND ${CURRENT_PROJECT_NAME}_SOURCES cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -75,8 +75,6 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER ${Boost_INCLUDE_DIRS}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - if (BUILD_TESTS) add_subdirectory(test) endif () @@ -85,3 +83,5 @@ if (BUILD_EXAMPLES) add_subdirectory(example) endif () +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/parallel-crypto3/libs/parallel-math/CMakeLists.txt b/parallel-crypto3/libs/parallel-math/CMakeLists.txt index fbf51db388..7c755e0f85 100644 --- a/parallel-crypto3/libs/parallel-math/CMakeLists.txt +++ b/parallel-crypto3/libs/parallel-math/CMakeLists.txt @@ -16,11 +16,11 @@ endif() cm_project(math WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES ASM C CXX) cm_find_package(CM) -include(CMDeploy) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -42,8 +42,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE Boost::random ) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/parallel-crypto3/libs/parallel-zk/CMakeLists.txt b/parallel-crypto3/libs/parallel-zk/CMakeLists.txt index d24a865f84..d409cf5cab 100644 --- a/parallel-crypto3/libs/parallel-zk/CMakeLists.txt +++ b/parallel-crypto3/libs/parallel-zk/CMakeLists.txt @@ -18,12 +18,12 @@ endif() cm_project(zk WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -include(CMDeploy) include(FindPkgConfig) cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -53,9 +53,8 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE # crypto3::benchmark_tools ) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - include(CMTest) cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) diff --git a/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt b/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt index 338fbeb0f6..05c5df5d4d 100644 --- a/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt +++ b/parallel-crypto3/libs/parallelization-utils/CMakeLists.txt @@ -23,7 +23,6 @@ if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) endif() cm_find_package(CM) -include(CMDeploy) include(FindPkgConfig) option(BUILD_WITH_CCACHE "Build with ccache usage" TRUE) @@ -46,6 +45,7 @@ list(APPEND ${CURRENT_PROJECT_NAME}_SOURCES ${${CURRENT_PROJECT_NAME}_UNGROUPED_ cm_setup_version(VERSION 0.1.0 PREFIX ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) add_library(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE) +add_library(${CMAKE_WORKSPACE_NAME}::${CURRENT_PROJECT_NAME} ALIAS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}) set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES EXPORT_NAME ${CURRENT_PROJECT_NAME}) @@ -59,9 +59,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${Boost_LIBRARIES}) -cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - INCLUDE include - NAMESPACE ${CMAKE_WORKSPACE_NAME}::) - - cm_add_test_subdirectory(test) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) From f6d1ef809c0e21d7b5ab68aa18d6510177403f41 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 24 Sep 2024 10:56:22 +0200 Subject: [PATCH 7/8] implement install for parallel-crypto3 --- parallel-crypto3/CMakeLists.txt | 17 +++++++++++++++++ parallel-crypto3/cmake/Config.cmake.in | 16 ++++++++++++++++ proof-producer/CMakeLists.txt | 6 +----- .../bin/proof-producer/CMakeLists.txt | 2 +- 4 files changed, 35 insertions(+), 6 deletions(-) create mode 100644 parallel-crypto3/cmake/Config.cmake.in diff --git a/parallel-crypto3/CMakeLists.txt b/parallel-crypto3/CMakeLists.txt index 00fb5f9d50..3921bd0223 100644 --- a/parallel-crypto3/CMakeLists.txt +++ b/parallel-crypto3/CMakeLists.txt @@ -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} +) diff --git a/parallel-crypto3/cmake/Config.cmake.in b/parallel-crypto3/cmake/Config.cmake.in new file mode 100644 index 0000000000..ab755d88a4 --- /dev/null +++ b/parallel-crypto3/cmake/Config.cmake.in @@ -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}) diff --git a/proof-producer/CMakeLists.txt b/proof-producer/CMakeLists.txt index 8814ebf72a..d958071845 100644 --- a/proof-producer/CMakeLists.txt +++ b/proof-producer/CMakeLists.txt @@ -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) diff --git a/proof-producer/bin/proof-producer/CMakeLists.txt b/proof-producer/bin/proof-producer/CMakeLists.txt index 7a139cc1b6..35660d26f6 100644 --- a/proof-producer/bin/proof-producer/CMakeLists.txt +++ b/proof-producer/bin/proof-producer/CMakeLists.txt @@ -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) From 0a9e1d7d69ff2ef8ff1bf90ab35eba26b4fd9ab0 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 24 Sep 2024 13:36:53 +0200 Subject: [PATCH 8/8] upadate docs to build a single test --- readme.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index 04c1524d27..383004288f 100644 --- a/readme.md +++ b/readme.md @@ -25,13 +25,18 @@ For most cases, you want to have an incremental build: ``` nix develop .#crypto3-debug-tests cd crypto3/ -mkdir build && cd build eval "$configurePhase" eval "$buildPhase" eval "$checkPhase" ``` - +if you want to build a single test: +``` +nix develop .#crypto3-debug-tests +cd crypto3/ +eval "$configurePhase" +ninja TEST_NAME +``` To build and test an individual project (crypto3, for example): ```