From 66096ae733cabc99a763e00e803d710493318563 Mon Sep 17 00:00:00 2001 From: Andrei Malashkin Date: Tue, 28 May 2024 10:21:39 +0200 Subject: [PATCH] cleanup top cmake --- CMakeLists.txt | 19 +++-------- libs/algebra/CMakeLists.txt | 3 +- libs/algebra/example/CMakeLists.txt | 2 +- libs/algebra/test/bench_test/CMakeLists.txt | 23 +------------ libs/block/CMakeLists.txt | 6 +--- libs/block/test/CMakeLists.txt | 13 +------ libs/codec/CMakeLists.txt | 6 +--- libs/codec/test/CMakeLists.txt | 12 +------ libs/containers/CMakeLists.txt | 11 ++---- libs/containers/example/CMakeLists.txt | 2 +- libs/containers/test/CMakeLists.txt | 27 +++------------ libs/hash/CMakeLists.txt | 6 +--- libs/hash/test/CMakeLists.txt | 25 ++------------ libs/kdf/CMakeLists.txt | 4 --- libs/kdf/test/CMakeLists.txt | 12 +------ libs/mac/CMakeLists.txt | 6 +--- libs/mac/test/CMakeLists.txt | 12 +------ libs/marshalling/algebra/CMakeLists.txt | 10 +++--- libs/marshalling/algebra/test/CMakeLists.txt | 34 ++++--------------- libs/marshalling/core/CMakeLists.txt | 2 +- libs/marshalling/core/example/CMakeLists.txt | 6 +--- libs/marshalling/core/test/CMakeLists.txt | 29 +++------------- .../marshalling/multiprecision/CMakeLists.txt | 7 ++-- .../multiprecision/test/CMakeLists.txt | 15 +------- libs/marshalling/zk/CMakeLists.txt | 7 ++-- libs/marshalling/zk/example/CMakeLists.txt | 4 +-- libs/marshalling/zk/test/CMakeLists.txt | 28 ++------------- libs/math/CMakeLists.txt | 9 ++--- libs/math/test/CMakeLists.txt | 26 +++----------- libs/math/test/benchmarks/CMakeLists.txt | 7 +--- libs/modes/CMakeLists.txt | 6 +--- libs/modes/test/CMakeLists.txt | 13 +------ libs/multiprecision/CMakeLists.txt | 4 +-- libs/multiprecision/test/CMakeLists.txt | 4 +-- libs/passhash/CMakeLists.txt | 6 +--- libs/passhash/test/CMakeLists.txt | 14 ++------ libs/pbkdf/CMakeLists.txt | 2 -- libs/pbkdf/test/CMakeLists.txt | 14 ++------ libs/pkpad/CMakeLists.txt | 6 +--- libs/pkpad/test/CMakeLists.txt | 12 +------ libs/pubkey/CMakeLists.txt | 11 ++---- libs/pubkey/example/CMakeLists.txt | 2 +- libs/pubkey/test/CMakeLists.txt | 26 ++------------ libs/random/CMakeLists.txt | 2 +- libs/random/example/CMakeLists.txt | 2 +- libs/random/test/CMakeLists.txt | 4 +-- libs/stream/CMakeLists.txt | 6 +--- libs/stream/test/CMakeLists.txt | 12 +------ libs/threshold/CMakeLists.txt | 6 +--- libs/threshold/test/CMakeLists.txt | 13 +------ libs/vdf/CMakeLists.txt | 6 ++-- libs/vdf/test/CMakeLists.txt | 13 +------ libs/zk/CMakeLists.txt | 6 +--- libs/zk/test/CMakeLists.txt | 24 ++----------- 54 files changed, 90 insertions(+), 497 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ebabc2ff74..6d0e494a94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,9 +23,8 @@ cm_workspace(crypto3) cm_setup_version(VERSION 0.3.0 PREFIX ${CMAKE_WORKSPACE_NAME}) option(BUILD_SHARED_LIBS "Build shared library" FALSE) # TODO: it makes no sense for header-only lib, remove -option(USE_STATIC_BOOST "Use static libraries for Boost" FALSE) -option(BUILD_TESTS "Include tests to `all` target" FALSE) # used by CMTest module -option(CMAKE_ENABLE_TESTS "Enable tests" FALSE) # used by CMTest module +option(Boost_USE_STATIC_LIBS "Use static libraries for Boost" OFF) +option(ENABLE_TESTS "Enable tests" TRUE) # used by CMTest module option(BUILD_BENCH_TESTS "Build performance benchmark tests" FALSE) option(BUILD_DOCS "Build with configuring Doxygen documentation compiler" FALSE) @@ -40,18 +39,10 @@ else() target_architecture(CMAKE_TARGET_ARCHITECTURE) endif() -if(USE_STATIC_BOOST) - set(Boost_USE_STATIC_LIBS ON) -else() - set(Boost_USE_STATIC_LIBS OFF) -endif() - -# TODO: in subdirs use Boost::lib_name instead of wide ${Boost_LIBRARIES}, split next lines into 2 find_package calls -set(BOOST_COMPONENTS "container;random;system") -if(CMAKE_ENABLE_TESTS) - list(APPEND BOOST_COMPONENTS "unit_test_framework") +find_package(Boost REQUIRED COMPONENTS container random filesystem log log_setup program_options thread system) +if(ENABLE_TESTS) + find_package(Boost REQUIRED COMPONENTS unit_test_framework timer) endif() -find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) add_subdirectories("${CMAKE_CURRENT_LIST_DIR}/libs/") add_subdirectories("${CMAKE_CURRENT_LIST_DIR}/libs/marshalling") diff --git a/libs/algebra/CMakeLists.txt b/libs/algebra/CMakeLists.txt index 5ed409310e..74a13f103f 100644 --- a/libs/algebra/CMakeLists.txt +++ b/libs/algebra/CMakeLists.txt @@ -54,8 +54,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $) target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${CMAKE_WORKSPACE_NAME}::multiprecision - Boost::unit_test_framework) + ${CMAKE_WORKSPACE_NAME}::multiprecision) cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include diff --git a/libs/algebra/example/CMakeLists.txt b/libs/algebra/example/CMakeLists.txt index 2b321620fa..90969025d4 100644 --- a/libs/algebra/example/CMakeLists.txt +++ b/libs/algebra/example/CMakeLists.txt @@ -12,8 +12,8 @@ macro(define_algebra_example name) ${CMAKE_WORKSPACE_NAME}_algebra $ + ) - ${Boost_LIBRARIES}) set_target_properties(algebra_${name}_example PROPERTIES CXX_STANDARD 14) endmacro() diff --git a/libs/algebra/test/bench_test/CMakeLists.txt b/libs/algebra/test/bench_test/CMakeLists.txt index bf9c23ae7a..a5c919dda5 100644 --- a/libs/algebra/test/bench_test/CMakeLists.txt +++ b/libs/algebra/test/bench_test/CMakeLists.txt @@ -8,27 +8,13 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - add_custom_target(algebra_runtime_bench_tests) macro(define_runtime_algebra_test name) set(test_name "algebra_${name}_bench_test") add_dependencies(algebra_runtime_bench_tests ${test_name}) - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${test_name}.xml") - endif() - - cm_test(NAME ${test_name} SOURCES ${name}.cpp ARGS ${additional_args}) + cm_test(NAME ${test_name} SOURCES ${name}.cpp) target_include_directories(${test_name} PRIVATE "$" @@ -39,13 +25,6 @@ macro(define_runtime_algebra_test name) set_target_properties(${test_name} PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED TRUE) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${test_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${test_name} PRIVATE "-fconstexpr-steps=2147483647") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/libs/block/CMakeLists.txt b/libs/block/CMakeLists.txt index 8534b54ede..6743597624 100644 --- a/libs/block/CMakeLists.txt +++ b/libs/block/CMakeLists.txt @@ -27,10 +27,6 @@ endif() cm_project(block WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -if((NOT Boost_CONTAINER_FOUND OR NOT Boost_FOUND) AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost COMPONENTS REQUIRED container) -endif() - include(TargetArchitecture) include(TargetConfiguration) include(PlatformConfiguration) @@ -492,7 +488,7 @@ elseif(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "ppc64") endif() target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ diff --git a/libs/block/test/CMakeLists.txt b/libs/block/test/CMakeLists.txt index 5c9851c18a..96bd9918f0 100644 --- a/libs/block/test/CMakeLists.txt +++ b/libs/block/test/CMakeLists.txt @@ -6,12 +6,8 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_block_cipher_test name) set(test_name "block_${name}_test") @@ -28,13 +24,6 @@ macro(define_block_cipher_test name) set_target_properties(${test_name} PROPERTIES CXX_STANDARD 14) endif() - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${test_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - string(CONCAT TEST_DATA ${CMAKE_CURRENT_SOURCE_DIR} "/data/" "${name}" ".json") target_compile_definitions(${test_name} PRIVATE TEST_DATA="${TEST_DATA}") endmacro() diff --git a/libs/codec/CMakeLists.txt b/libs/codec/CMakeLists.txt index 7b11e06d6f..c816d21158 100644 --- a/libs/codec/CMakeLists.txt +++ b/libs/codec/CMakeLists.txt @@ -28,10 +28,6 @@ endif() cm_project(codec WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -if((NOT Boost_CONTAINER_FOUND OR NOT Boost_FOUND) AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost COMPONENTS REQUIRED container) -endif() - option(CRYPTO3_CODEC_BASE58 "Build unit tests" TRUE) set(BUILD_WITH_CONFIGURATION_FILE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake" CACHE STRING "Directory for build.hpp lookup") @@ -78,7 +74,7 @@ set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $<$:${CMAKE_WORKSPACE_NAME}::multiprecision> - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ diff --git a/libs/codec/test/CMakeLists.txt b/libs/codec/test/CMakeLists.txt index 919462548f..75b67e0d61 100644 --- a/libs/codec/test/CMakeLists.txt +++ b/libs/codec/test/CMakeLists.txt @@ -8,14 +8,10 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::multiprecision - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_codec_test name) cm_test(NAME codec_${name}_test SOURCES ${name}.cpp) @@ -32,12 +28,6 @@ macro(define_codec_test name) CXX_STANDARD_REQUIRED TRUE) endif() - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(codec_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES "hex" "base") diff --git a/libs/containers/CMakeLists.txt b/libs/containers/CMakeLists.txt index 6dc5f87ae7..fb94fa49e7 100644 --- a/libs/containers/CMakeLists.txt +++ b/libs/containers/CMakeLists.txt @@ -42,10 +42,6 @@ cm_workspace(crypto3) include(CMDeploy) include(CMSetupVersion) -if (NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost COMPONENTS REQUIRED filesystem) -endif () - cm_project(containers WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) option(BUILD_DOXYGEN_DOCS "Build with configuring Doxygen documentation compiler" TRUE) @@ -76,7 +72,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE "$" @@ -86,9 +82,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}::) -if (BUILD_TESTS) - add_subdirectory(test) -endif () +include(CMTest) +cm_add_test_subdirectory(test) if (BUILD_EXAMPLES) add_subdirectory(example) diff --git a/libs/containers/example/CMakeLists.txt b/libs/containers/example/CMakeLists.txt index 346575486f..57efe55cb4 100644 --- a/libs/containers/example/CMakeLists.txt +++ b/libs/containers/example/CMakeLists.txt @@ -36,7 +36,7 @@ macro(define_containers_example example) target_link_libraries(${target_name} PRIVATE ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + Boost::container) set_target_properties(${target_name} PROPERTIES CXX_STANDARD 17) endmacro() diff --git a/libs/containers/test/CMakeLists.txt b/libs/containers/test/CMakeLists.txt index de27394203..7cfa9f335b 100644 --- a/libs/containers/test/CMakeLists.txt +++ b/libs/containers/test/CMakeLists.txt @@ -25,16 +25,14 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + Boost::unit_test_framework + Boost::random + ) macro(define_storage_test test) get_filename_component(test_name ${test} NAME) @@ -46,17 +44,7 @@ macro(define_storage_test test) set(target_name ${PARENT_DIR}_${target_name}) endwhile() - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${target_name}.xml") - endif() - - cm_test(NAME ${target_name} SOURCES ${test}.cpp ARGS ${additional_args}) + cm_test(NAME ${target_name} SOURCES ${test}.cpp) target_include_directories(${target_name} PRIVATE "$" @@ -66,13 +54,6 @@ macro(define_storage_test test) set_target_properties(${target_name} PROPERTIES CXX_STANDARD 17) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${target_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${target_name} PRIVATE "-fconstexpr-steps=2147483647" "-ftemplate-backtrace-limit=0") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/libs/hash/CMakeLists.txt b/libs/hash/CMakeLists.txt index ae9692157b..60505457cd 100644 --- a/libs/hash/CMakeLists.txt +++ b/libs/hash/CMakeLists.txt @@ -29,10 +29,6 @@ endif() cm_project(hash WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost COMPONENTS REQUIRED container) -endif() - include(TargetArchitecture) include(TargetConfiguration) include(PlatformConfiguration) @@ -241,7 +237,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::block - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE "$" diff --git a/libs/hash/test/CMakeLists.txt b/libs/hash/test/CMakeLists.txt index ea65cd9197..7bf0f5673e 100644 --- a/libs/hash/test/CMakeLists.txt +++ b/libs/hash/test/CMakeLists.txt @@ -10,31 +10,17 @@ include(CMTest) cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${${CURRENT_PROJECT_NAME}_INTERFACE_LIBRARIES} ${CMAKE_WORKSPACE_NAME}::block - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_hash_test name) set(test_name "hash_${name}_test") - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${test_name}.xml") - endif() - - cm_test(NAME ${test_name} SOURCES ${name}.cpp ARGS ${additional_args}) + cm_test(NAME ${test_name} SOURCES ${name}.cpp) target_include_directories(${test_name} PRIVATE "$" @@ -46,13 +32,6 @@ macro(define_hash_test name) CXX_STANDARD 17 CXX_STANDARD_REQUIRED TRUE) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${test_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${test_name} PRIVATE "-fconstexpr-steps=2147483647") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/libs/kdf/CMakeLists.txt b/libs/kdf/CMakeLists.txt index 8b8a51c92d..541ce56aa6 100644 --- a/libs/kdf/CMakeLists.txt +++ b/libs/kdf/CMakeLists.txt @@ -33,10 +33,6 @@ cm_find_package(${CMAKE_WORKSPACE_NAME}_block) cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) cm_find_package(${CMAKE_WORKSPACE_NAME}_mac) -if(NOT Boost) - find_package(Boost REQUIRED) -endif() - list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS include/nil/crypto3/kdf/algorithm/derive.hpp diff --git a/libs/kdf/test/CMakeLists.txt b/libs/kdf/test/CMakeLists.txt index b63b253162..d1cfa4ab3b 100644 --- a/libs/kdf/test/CMakeLists.txt +++ b/libs/kdf/test/CMakeLists.txt @@ -11,16 +11,12 @@ include(CMTest) cm_find_package(${CMAKE_WORKSPACE_NAME}_block) cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::block ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_kdf_test name) cm_test(NAME ${name}_test SOURCES ${name}.cpp) @@ -33,12 +29,6 @@ macro(define_kdf_test name) set_target_properties(${name}_test PROPERTIES CXX_STANDARD 14) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES diff --git a/libs/mac/CMakeLists.txt b/libs/mac/CMakeLists.txt index ba53497558..671fdaac35 100644 --- a/libs/mac/CMakeLists.txt +++ b/libs/mac/CMakeLists.txt @@ -22,10 +22,6 @@ endif() cm_project(mac WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost) -endif() - include(CMDeploy) include(CMSetupVersion) @@ -169,7 +165,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::hash ${CMAKE_WORKSPACE_NAME}::modes - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ diff --git a/libs/mac/test/CMakeLists.txt b/libs/mac/test/CMakeLists.txt index 34330e1889..a8bd48be92 100644 --- a/libs/mac/test/CMakeLists.txt +++ b/libs/mac/test/CMakeLists.txt @@ -11,16 +11,12 @@ include(CMTest) cm_find_package(${CMAKE_WORKSPACE_NAME}_block) cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::block ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_mac_test name) cm_test(NAME ${name}_test SOURCES ${name}.cpp) @@ -33,12 +29,6 @@ macro(define_mac_test name) set_target_properties(${name}_test PROPERTIES CXX_STANDARD 14) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES "hmac" diff --git a/libs/marshalling/algebra/CMakeLists.txt b/libs/marshalling/algebra/CMakeLists.txt index ef72d0219c..16ddfa9ea2 100755 --- a/libs/marshalling/algebra/CMakeLists.txt +++ b/libs/marshalling/algebra/CMakeLists.txt @@ -22,7 +22,6 @@ include(FindPkgConfig) include(CMSetupVersion) -option(BUILD_TESTS "Build unit tests" TRUE) option(BUILD_WITH_NO_WARNINGS "Build threading warnings as errors" FALSE) list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS @@ -50,15 +49,16 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE crypto3::algebra ${CMAKE_WORKSPACE_NAME}::crypto3_multiprecision - ${CMAKE_WORKSPACE_NAME}::core) + ${CMAKE_WORKSPACE_NAME}::core + + Boost::random + ) cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) -if(BUILD_TESTS) - add_subdirectory(test) -endif() +cm_add_test_subdirectory(test) if((CMAKE_COMPILER_IS_GNUCC) OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) set(extra_flags_list -Wall -Wextra -Wcast-align -Wcast-qual diff --git a/libs/marshalling/algebra/test/CMakeLists.txt b/libs/marshalling/algebra/test/CMakeLists.txt index c7b56e49a6..c363a873d7 100644 --- a/libs/marshalling/algebra/test/CMakeLists.txt +++ b/libs/marshalling/algebra/test/CMakeLists.txt @@ -9,32 +9,21 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework filesystem log log_setup program_options thread system) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES} crypto3::multiprecision crypto3::algebra - ${CMAKE_WORKSPACE_NAME}::crypto3_multiprecision - ${CMAKE_WORKSPACE_NAME}::core) + ${CMAKE_WORKSPACE_NAME}::crypto3_multiprecision + ${CMAKE_WORKSPACE_NAME}::core + + Boost::unit_test_framework + Boost::random + ) macro(define_marshalling_test name) set(test_name "marshalling_${name}_test") - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${test_name}.xml") - endif() - - cm_test(NAME ${test_name} SOURCES ${name}.cpp ARGS ${additional_args}) + cm_test(NAME ${test_name} SOURCES ${name}.cpp) target_include_directories(${test_name} PRIVATE "$" @@ -46,15 +35,6 @@ macro(define_marshalling_test name) CXX_STANDARD 17 CXX_STANDARD_REQUIRED TRUE) - if(TARGET Boost::unit_test_framework) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${test_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${test_name} PRIVATE "-fconstexpr-steps=2147483647") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/libs/marshalling/core/CMakeLists.txt b/libs/marshalling/core/CMakeLists.txt index 1573aaded8..67a4b93529 100755 --- a/libs/marshalling/core/CMakeLists.txt +++ b/libs/marshalling/core/CMakeLists.txt @@ -165,7 +165,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES}) + Boost::container) cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include diff --git a/libs/marshalling/core/example/CMakeLists.txt b/libs/marshalling/core/example/CMakeLists.txt index 549398194f..fce0014d66 100644 --- a/libs/marshalling/core/example/CMakeLists.txt +++ b/libs/marshalling/core/example/CMakeLists.txt @@ -10,17 +10,13 @@ include(CMTest) -if (NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif () - macro(define_marshalling_example name) add_executable(marshalling_${name}_example ${name}.cpp) target_link_libraries(marshalling_${name}_example PRIVATE ${CMAKE_WORKSPACE_NAME}::core - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(marshalling_${name}_example PRIVATE "$" diff --git a/libs/marshalling/core/test/CMakeLists.txt b/libs/marshalling/core/test/CMakeLists.txt index 1b2a70f4b0..8225afb916 100644 --- a/libs/marshalling/core/test/CMakeLists.txt +++ b/libs/marshalling/core/test/CMakeLists.txt @@ -9,29 +9,17 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES}) + Boost::unit_test_framework + Boost::random + ) macro(define_marshalling_test name) get_filename_component(name ${name} NAME) set(test_name "marshalling_${name}_test") - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR} ${TEST_REPORTS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${test_name}.xml") - endif() - - cm_test(NAME ${test_name} SOURCES ${name}.cpp ARGS ${additional_args}) + cm_test(NAME ${test_name} SOURCES ${name}.cpp) target_include_directories(marshalling_${name}_test PRIVATE "$" @@ -42,15 +30,6 @@ macro(define_marshalling_test name) set_target_properties(marshalling_${name}_test PROPERTIES CXX_STANDARD 11 CXX_STANDARD_REQUIRED TRUE) - - if(TARGET Boost::unit_test_framework) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(marshalling_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - endif() endmacro() set(TESTS_NAMES diff --git a/libs/marshalling/multiprecision/CMakeLists.txt b/libs/marshalling/multiprecision/CMakeLists.txt index 55dbcf8bd6..4994d9188f 100755 --- a/libs/marshalling/multiprecision/CMakeLists.txt +++ b/libs/marshalling/multiprecision/CMakeLists.txt @@ -22,7 +22,6 @@ include(FindPkgConfig) include(CMSetupVersion) -option(BUILD_TESTS "Build unit tests" TRUE) option(BUILD_WITH_NO_WARNINGS "Build threading warnings as errors" FALSE) list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS @@ -48,7 +47,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER $<$:${Boost_INCLUDE_DIRS}>) target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES} + Boost::container crypto3::multiprecision ${CMAKE_WORKSPACE_NAME}::core) @@ -57,9 +56,7 @@ cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) -if(BUILD_TESTS) - add_subdirectory(test) -endif() +cm_add_test_subdirectory(test) if((CMAKE_COMPILER_IS_GNUCC) OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")) set(extra_flags_list -Wall -Wextra -Wcast-align -Wcast-qual diff --git a/libs/marshalling/multiprecision/test/CMakeLists.txt b/libs/marshalling/multiprecision/test/CMakeLists.txt index 5aa75b0d00..45a89c103b 100644 --- a/libs/marshalling/multiprecision/test/CMakeLists.txt +++ b/libs/marshalling/multiprecision/test/CMakeLists.txt @@ -9,12 +9,8 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework filesystem log log_setup program_options thread system) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES} + Boost::unit_test_framework crypto3::multiprecision ${CMAKE_WORKSPACE_NAME}::core) @@ -46,15 +42,6 @@ macro(define_marshalling_test name) CXX_STANDARD 17 CXX_STANDARD_REQUIRED TRUE) - if(TARGET Boost::unit_test_framework) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(marshalling_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(marshalling_${name}_test PRIVATE "-fconstexpr-steps=2147483647") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/libs/marshalling/zk/CMakeLists.txt b/libs/marshalling/zk/CMakeLists.txt index 63afd76461..36f9bd2705 100755 --- a/libs/marshalling/zk/CMakeLists.txt +++ b/libs/marshalling/zk/CMakeLists.txt @@ -22,7 +22,6 @@ include(FindPkgConfig) include(CMSetupVersion) -option(BUILD_TESTS "Build unit tests" TRUE) 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}) @@ -37,7 +36,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER "$") target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES} + Boost::container crypto3::multiprecision crypto3::algebra @@ -55,9 +54,7 @@ cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) -if(BUILD_TESTS) - add_subdirectory(test) -endif() +cm_add_test_subdirectory(test) if(BUILD_EXAMPLES) add_subdirectory(example) diff --git a/libs/marshalling/zk/example/CMakeLists.txt b/libs/marshalling/zk/example/CMakeLists.txt index deedaf77cc..9d2c0efe50 100644 --- a/libs/marshalling/zk/example/CMakeLists.txt +++ b/libs/marshalling/zk/example/CMakeLists.txt @@ -11,8 +11,6 @@ cm_find_package(CM) include(CMDeploy) include(CMSetupVersion) -find_package(Boost REQUIRED COMPONENTS filesystem log log_setup program_options thread system) - macro(define_marshalling_example name) add_executable(marshalling_${name}_example ${name}.cpp) @@ -26,7 +24,7 @@ macro(define_marshalling_example name) ${CMAKE_WORKSPACE_NAME}::crypto3_zk ${CMAKE_WORKSPACE_NAME}::core - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(marshalling_${name}_example PRIVATE "$" diff --git a/libs/marshalling/zk/test/CMakeLists.txt b/libs/marshalling/zk/test/CMakeLists.txt index 96de741b79..06434eb819 100644 --- a/libs/marshalling/zk/test/CMakeLists.txt +++ b/libs/marshalling/zk/test/CMakeLists.txt @@ -9,12 +9,8 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework filesystem log log_setup program_options thread system) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES} + Boost::unit_test_framework crypto3::multiprecision crypto3::algebra @@ -32,19 +28,8 @@ macro(define_marshalling_test test) get_filename_component(name ${test} NAME) - set(additional_args "") set(full_test_name marshalling_${name}_test) - - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${full_test_name}.xml") - endif() - - cm_test(NAME ${full_test_name} SOURCES ${test}.cpp ARGS ${additional_args}) + cm_test(NAME ${full_test_name} SOURCES ${test}.cpp) target_include_directories(marshalling_${name}_test PRIVATE "$" @@ -56,15 +41,6 @@ macro(define_marshalling_test test) CXX_STANDARD 17 CXX_STANDARD_REQUIRED TRUE) - if(TARGET Boost::unit_test_framework) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(marshalling_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${full_test_name} PRIVATE "-fconstexpr-steps=2147483647") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt index 6e9819a302..df281c8fbc 100644 --- a/libs/math/CMakeLists.txt +++ b/libs/math/CMakeLists.txt @@ -31,8 +31,6 @@ cm_project(math WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES ASM C CXX) cm_find_package(CM) include(CMDeploy) -option(BUILD_TESTS "Build unit tests" FALSE) - list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS) list(APPEND ${CURRENT_PROJECT_NAME}_UNGROUPED_SOURCES) @@ -59,12 +57,11 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::multiprecision - ${Boost_LIBRARIES}) + Boost::random + ) cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) -if(BUILD_TESTS) - add_subdirectory(test) -endif() +cm_add_test_subdirectory(test) diff --git a/libs/math/test/CMakeLists.txt b/libs/math/test/CMakeLists.txt index 2c6721bd52..84c42d6d70 100644 --- a/libs/math/test/CMakeLists.txt +++ b/libs/math/test/CMakeLists.txt @@ -8,31 +8,19 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::multiprecision - ${Boost_LIBRARIES}) + Boost::random + Boost::unit_test_framework + ) macro(define_math_test name) set(test_name "math_${name}_test") - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${test_name}.xml") - endif() - - cm_test(NAME ${test_name} SOURCES ${name}.cpp ARGS ${additional_args}) + cm_test(NAME ${test_name} SOURCES ${name}.cpp) target_include_directories(${test_name} PRIVATE "$" @@ -42,12 +30,6 @@ macro(define_math_test name) set_target_properties(${test_name} PROPERTIES CXX_STANDARD 17) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${test_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES diff --git a/libs/math/test/benchmarks/CMakeLists.txt b/libs/math/test/benchmarks/CMakeLists.txt index 53cc44dd0f..c64b0ee6e2 100644 --- a/libs/math/test/benchmarks/CMakeLists.txt +++ b/libs/math/test/benchmarks/CMakeLists.txt @@ -6,18 +6,13 @@ # http://www.boost.org/LICENSE_1_0.txt #---------------------------------------------------------------------------# -find_package(Boost REQUIRED COMPONENTS - timer - unit_test_framework -) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::multiprecision ${CMAKE_WORKSPACE_NAME}::random - ${Boost_LIBRARIES} + Boost::unit_test_framework ) set(TESTS_NAMES diff --git a/libs/modes/CMakeLists.txt b/libs/modes/CMakeLists.txt index 46290f55c6..a6190c4204 100644 --- a/libs/modes/CMakeLists.txt +++ b/libs/modes/CMakeLists.txt @@ -22,10 +22,6 @@ endif() cm_project(modes WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost REQUIRED) -endif() - include(CMConfig) include(CMSetupVersion) @@ -137,7 +133,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::codec ${CMAKE_WORKSPACE_NAME}::hash - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ diff --git a/libs/modes/test/CMakeLists.txt b/libs/modes/test/CMakeLists.txt index 0f0f1b074c..942d878dfc 100644 --- a/libs/modes/test/CMakeLists.txt +++ b/libs/modes/test/CMakeLists.txt @@ -8,17 +8,13 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::block ${CMAKE_WORKSPACE_NAME}::codec ${CMAKE_WORKSPACE_NAME}::multiprecision - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_mode_test name) cm_test(NAME mode_${name}_test SOURCES ${name}.cpp) @@ -30,13 +26,6 @@ macro(define_mode_test name) ${Boost_INCLUDE_DIRS}) set_target_properties(mode_${name}_test PROPERTIES CXX_STANDARD 14) - - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(mode_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES diff --git a/libs/multiprecision/CMakeLists.txt b/libs/multiprecision/CMakeLists.txt index 5712888f6c..4ed60beca9 100644 --- a/libs/multiprecision/CMakeLists.txt +++ b/libs/multiprecision/CMakeLists.txt @@ -19,8 +19,6 @@ include(CMDeploy) include(CMConfig) include(CMSetupVersion) -find_package(Boost REQUIRED) - if(NOT CMAKE_WORKSPACE_NAME OR NOT ("${CMAKE_WORKSPACE_NAME}" STREQUAL "crypto3")) cm_workspace(crypto3) endif() @@ -43,7 +41,7 @@ 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 ${CURRENT_SOURCES_DIR}/include + INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) include(CMTest) diff --git a/libs/multiprecision/test/CMakeLists.txt b/libs/multiprecision/test/CMakeLists.txt index 594b2457df..3eadb3048e 100644 --- a/libs/multiprecision/test/CMakeLists.txt +++ b/libs/multiprecision/test/CMakeLists.txt @@ -20,11 +20,9 @@ add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_modular_cpp_int_tests) #add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_examples) #add_custom_target(${CURRENT_PROJECT_NAME}_test_suite_compile_fail) -find_package(Boost REQUIRED COMPONENTS unit_test_framework) - cm_test_link_libraries( ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} - ${Boost_LIBRARIES} + Boost::unit_test_framework ) # HACK: Workaround broken includes diff --git a/libs/passhash/CMakeLists.txt b/libs/passhash/CMakeLists.txt index c4e14f8dd4..9fc6d7a12d 100644 --- a/libs/passhash/CMakeLists.txt +++ b/libs/passhash/CMakeLists.txt @@ -29,10 +29,6 @@ endif() cm_project(passhash WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -if(NOT Boost_FOUND) - find_package(Boost) -endif() - cm_find_package(${CMAKE_WORKSPACE_NAME}_codec) cm_find_package(${CMAKE_WORKSPACE_NAME}_mac) @@ -59,7 +55,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::codec ${CMAKE_WORKSPACE_NAME}::mac - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE "$" diff --git a/libs/passhash/test/CMakeLists.txt b/libs/passhash/test/CMakeLists.txt index fd47c622ed..5773631e8e 100644 --- a/libs/passhash/test/CMakeLists.txt +++ b/libs/passhash/test/CMakeLists.txt @@ -12,17 +12,13 @@ cm_find_package(${CMAKE_WORKSPACE_NAME}_block) cm_find_package(${CMAKE_WORKSPACE_NAME}_codec) cm_find_package(${CMAKE_WORKSPACE_NAME}_kdf) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::block ${CMAKE_WORKSPACE_NAME}::codec ${CMAKE_WORKSPACE_NAME}::kdf - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_passhash_test name) cm_test(NAME passhash_${name}_test SOURCES ${name}.cpp) @@ -34,13 +30,7 @@ macro(define_passhash_test name) ${Boost_INCLUDE_DIRS}) set_target_properties(passhash_${name}_test PROPERTIES CXX_STANDARD 14) - - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(passhash_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() + endmacro() set(TESTS_NAMES diff --git a/libs/pbkdf/CMakeLists.txt b/libs/pbkdf/CMakeLists.txt index 899e772b83..4ee838d1d7 100644 --- a/libs/pbkdf/CMakeLists.txt +++ b/libs/pbkdf/CMakeLists.txt @@ -32,8 +32,6 @@ cm_project(pbkdf WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) cm_find_package(${CMAKE_WORKSPACE_NAME}_hash) cm_find_package(${CMAKE_WORKSPACE_NAME}_mac) -find_package(Boost REQUIRED) - list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS include/nil/crypto3/pbkdf/pbkdf.hpp) diff --git a/libs/pbkdf/test/CMakeLists.txt b/libs/pbkdf/test/CMakeLists.txt index ede2708636..26730e9d93 100644 --- a/libs/pbkdf/test/CMakeLists.txt +++ b/libs/pbkdf/test/CMakeLists.txt @@ -8,16 +8,12 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::hash ${CMAKE_WORKSPACE_NAME}::mac - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_pbkdf_test name) cm_test(NAME ${name}_test SOURCES ${name}.cpp) @@ -29,13 +25,7 @@ macro(define_pbkdf_test name) ${Boost_INCLUDE_DIRS}) set_target_properties(${name}_test PROPERTIES CXX_STANDARD 14) - - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() + endmacro() set(TESTS_NAMES diff --git a/libs/pkpad/CMakeLists.txt b/libs/pkpad/CMakeLists.txt index 0338ed3dae..90306b0f56 100644 --- a/libs/pkpad/CMakeLists.txt +++ b/libs/pkpad/CMakeLists.txt @@ -19,10 +19,6 @@ cm_project(pkpad WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) include(CMDeploy) include(CMSetupVersion) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost COMPONENTS) -endif() - list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS include/nil/crypto3/pkpad/algorithm/encode.hpp include/nil/crypto3/pkpad/algorithm/verify.hpp) @@ -232,7 +228,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::algebra marshalling::crypto3_algebra - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ diff --git a/libs/pkpad/test/CMakeLists.txt b/libs/pkpad/test/CMakeLists.txt index 31955e9be2..f696d120c5 100644 --- a/libs/pkpad/test/CMakeLists.txt +++ b/libs/pkpad/test/CMakeLists.txt @@ -1,16 +1,12 @@ include(CMTest) -if (NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif () - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::codec ${CMAKE_WORKSPACE_NAME}::hash ${CMAKE_WORKSPACE_NAME}::algebra marshalling::crypto3_algebra - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_pkpad_test name) cm_test(NAME pkpad_${name}_test SOURCES ${name}.cpp) @@ -23,12 +19,6 @@ macro(define_pkpad_test name) set_target_properties(pkpad_${name}_test PROPERTIES CXX_STANDARD 17) - get_target_property(target_type Boost::unit_test_framework TYPE) - if (target_type STREQUAL "SHARED_LIB") - target_compile_definitions(pkpad_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif (target_type STREQUAL "STATIC_LIB") - - endif () endmacro() set(TESTS_NAMES diff --git a/libs/pubkey/CMakeLists.txt b/libs/pubkey/CMakeLists.txt index a5f3e359bd..aa570b4fb2 100644 --- a/libs/pubkey/CMakeLists.txt +++ b/libs/pubkey/CMakeLists.txt @@ -20,11 +20,6 @@ cm_find_package(CM) include(CMDeploy) include(CMSetupVersion) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost REQUIRED) -endif() - -option(BUILD_TESTS "Build unit tests" FALSE) option(BUILD_EXAMPLES "Build examples" FALSE) list(APPEND ${CURRENT_PROJECT_NAME}_LIBRARIES @@ -107,7 +102,7 @@ set_target_properties(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} PROPERTIES target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${${CURRENT_PROJECT_NAME}_LIBRARIES} - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ @@ -119,9 +114,7 @@ cm_deploy(TARGETS ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INCLUDE include NAMESPACE ${CMAKE_WORKSPACE_NAME}::) -if(BUILD_TESTS) - add_subdirectory(test) -endif() +cm_add_test_subdirectory(test) if(BUILD_EXAMPLES) add_subdirectory(example) diff --git a/libs/pubkey/example/CMakeLists.txt b/libs/pubkey/example/CMakeLists.txt index 0cc6c9793e..5fdb8e70af 100644 --- a/libs/pubkey/example/CMakeLists.txt +++ b/libs/pubkey/example/CMakeLists.txt @@ -19,7 +19,7 @@ macro(define_pubkey_example name) ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::multiprecision - ${Boost_LIBRARIES}) + Boost::container) set_target_properties(pubkey_${name}_example PROPERTIES CXX_STANDARD 17 CXX_STANDARD_REQUIRED TRUE) endmacro() diff --git a/libs/pubkey/test/CMakeLists.txt b/libs/pubkey/test/CMakeLists.txt index ceb3186e4e..925503cb38 100644 --- a/libs/pubkey/test/CMakeLists.txt +++ b/libs/pubkey/test/CMakeLists.txt @@ -1,9 +1,5 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_find_package(${CMAKE_WORKSPACE_NAME}_marshalling) cm_find_package(${CMAKE_WORKSPACE_NAME}_random) cm_find_package(${CMAKE_WORKSPACE_NAME}_blueprint) @@ -15,21 +11,11 @@ cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::pkpad ${CMAKE_WORKSPACE_NAME}::random - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_pubkey_test name) - set(additional_args "") - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${test_name}.xml") - endif() - - cm_test(NAME pubkey_${name}_test SOURCES ${name}.cpp ARGS ${additional_args}) + cm_test(NAME pubkey_${name}_test SOURCES ${name}.cpp) target_include_directories(pubkey_${name}_test PRIVATE "$" @@ -40,18 +26,12 @@ macro(define_pubkey_test name) set_target_properties(pubkey_${name}_test PROPERTIES CXX_STANDARD 17) - get_target_property(target_type Boost::unit_test_framework TYPE) + if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(pubkey_${name}_test PRIVATE "-fconstexpr-steps=2147483647" "-ftemplate-backtrace-limit=0") elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(pubkey_${name}_test PRIVATE "-fconstexpr-ops-limit=4294967295" "-ftemplate-backtrace-limit=0") endif() - - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(pubkey_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES diff --git a/libs/random/CMakeLists.txt b/libs/random/CMakeLists.txt index 9b1b20489b..00abd8f3f9 100644 --- a/libs/random/CMakeLists.txt +++ b/libs/random/CMakeLists.txt @@ -41,7 +41,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE marshalling::crypto3_algebra - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ $ diff --git a/libs/random/example/CMakeLists.txt b/libs/random/example/CMakeLists.txt index 09288bc041..1780bcd219 100644 --- a/libs/random/example/CMakeLists.txt +++ b/libs/random/example/CMakeLists.txt @@ -21,7 +21,7 @@ macro(define_random_example name) ${CMAKE_WORKSPACE_NAME}::stream ${CMAKE_WORKSPACE_NAME}::multiprecision - ${Boost_LIBRARIES}) + Boost::container) set_target_properties(random_${name}_example PROPERTIES CXX_STANDARD 17) endmacro() diff --git a/libs/random/test/CMakeLists.txt b/libs/random/test/CMakeLists.txt index cab3cd0025..ff06c44445 100644 --- a/libs/random/test/CMakeLists.txt +++ b/libs/random/test/CMakeLists.txt @@ -9,8 +9,6 @@ include(CMTest) -find_package(Boost REQUIRED COMPONENTS filesystem unit_test_framework) - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::algebra @@ -21,7 +19,7 @@ cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} marshalling::crypto3_algebra - ${Boost_LIBRARIES}) + Boost::unit_test_framework) #cm_test(NAME ${CURRENT_PROJECT_NAME}_chacha_test SOURCES ${CURRENT_TEST_SOURCES_DIR}/chacha.cpp) #set_target_properties(${CURRENT_PROJECT_NAME}_chacha_test PROPERTIES CXX_STANDARD 17) diff --git a/libs/stream/CMakeLists.txt b/libs/stream/CMakeLists.txt index 5c5d3c5971..5469176e86 100644 --- a/libs/stream/CMakeLists.txt +++ b/libs/stream/CMakeLists.txt @@ -52,10 +52,6 @@ else() target_architecture(CMAKE_TARGET_ARCHITECTURE) endif() -if((NOT Boost_CONTAINER_FOUND OR NOT Boost_FOUND) AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost COMPONENTS REQUIRED container) -endif() - list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS) list(APPEND ${CURRENT_PROJECT_NAME}_UNGROUPED_SOURCES) @@ -118,7 +114,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::block - ${Boost_LIBRARIES}) + Boost::container) if(${CMAKE_TARGET_ARCHITECTURE} STREQUAL "x86_64" OR ${CMAKE_TARGET_ARCHITECTURE} STREQUAL "x86") diff --git a/libs/stream/test/CMakeLists.txt b/libs/stream/test/CMakeLists.txt index 1e58187627..ad69c0ba3c 100644 --- a/libs/stream/test/CMakeLists.txt +++ b/libs/stream/test/CMakeLists.txt @@ -10,15 +10,11 @@ include(CMTest) cm_find_package(${CMAKE_WORKSPACE_NAME}_block) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::block - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_stream_test name) cm_test(NAME stream_${name}_test SOURCES ${name}.cpp) @@ -32,12 +28,6 @@ macro(define_stream_test name) set_target_properties(stream_${name}_test PROPERTIES CXX_STANDARD 14 CXX_STANDARD_REQUIRED TRUE) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(stream_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES "chacha" "rc4" "salsa20") diff --git a/libs/threshold/CMakeLists.txt b/libs/threshold/CMakeLists.txt index 831dcefea3..3f6be0fd68 100644 --- a/libs/threshold/CMakeLists.txt +++ b/libs/threshold/CMakeLists.txt @@ -30,10 +30,6 @@ endif() cm_project(threshold WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME}) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost) -endif() - cm_find_package(${CMAKE_WORKSPACE_NAME}_pubkey) list(APPEND ${CURRENT_PROJECT_NAME}_PUBLIC_HEADERS) @@ -57,7 +53,7 @@ target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE ${CMAKE_WORKSPACE_NAME}::multiprecision ${CMAKE_WORKSPACE_NAME}::pubkey - ${Boost_LIBRARIES}) + Boost::container) target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE $ diff --git a/libs/threshold/test/CMakeLists.txt b/libs/threshold/test/CMakeLists.txt index c7485be679..702b8f57b9 100644 --- a/libs/threshold/test/CMakeLists.txt +++ b/libs/threshold/test/CMakeLists.txt @@ -10,15 +10,11 @@ include(CMTest) cm_find_package(${CMAKE_WORKSPACE_NAME}_pubkey) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::pubkey - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_threshold_test name) cm_test(NAME threshold_${name}_test SOURCES ${name}.cpp) @@ -30,13 +26,6 @@ macro(define_threshold_test name) ${Boost_INCLUDE_DIRS}) set_target_properties(threshold_${name}_test PROPERTIES CXX_STANDARD 17) - - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(threshold_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES diff --git a/libs/vdf/CMakeLists.txt b/libs/vdf/CMakeLists.txt index b987e6beb3..dbd8fa74f8 100644 --- a/libs/vdf/CMakeLists.txt +++ b/libs/vdf/CMakeLists.txt @@ -77,8 +77,6 @@ elseif(CRYPTO3_VDF_BOOST) if(NOT TARGET ${CMAKE_WORKSPACE_NAME}::multiprecision) if(${CMAKE_WORKSPACE_NAME} STREQUAL boost) cm_find_package(${CMAKE_WORKSPACE_NAME}_multiprecision) - else() - find_package(Boost) endif() endif() @@ -235,10 +233,10 @@ elseif(CRYPTO3_VDF_BOOST) ${CMAKE_WORKSPACE_NAME}_block ${CMAKE_WORKSPACE_NAME}_hash - ${Boost_LIBRARIES}) + Boost::container) else() target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES}) + Boost::container) endif() endif() diff --git a/libs/vdf/test/CMakeLists.txt b/libs/vdf/test/CMakeLists.txt index 7f1a5a033a..57d51e4b91 100644 --- a/libs/vdf/test/CMakeLists.txt +++ b/libs/vdf/test/CMakeLists.txt @@ -8,10 +8,6 @@ include(CMTest) -if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - find_package(Boost REQUIRED COMPONENTS unit_test_framework) -endif() - cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} ${CMAKE_WORKSPACE_NAME}::multiprecision @@ -19,7 +15,7 @@ cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} $<$:${GMP_LIBRARIES}> $<$:${TomMath_LIBRARIES}> - ${Boost_LIBRARIES}) + Boost::unit_test_framework) macro(define_vdf_test name) cm_test(NAME vdf_${name}_test SOURCES ${name}.cpp) @@ -38,13 +34,6 @@ macro(define_vdf_test name) $<$:CRYPTO3_VDF_BOOST_GMP>) set_target_properties(vdf_${name}_test PROPERTIES CXX_STANDARD 14) - - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(vdf_${name}_test PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() endmacro() set(TESTS_NAMES "chia" "pietrzak" "wesolowski") diff --git a/libs/zk/CMakeLists.txt b/libs/zk/CMakeLists.txt index 6f5cc041c4..732c56abfe 100644 --- a/libs/zk/CMakeLists.txt +++ b/libs/zk/CMakeLists.txt @@ -32,10 +32,6 @@ endif() cm_project(zk WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -if(NOT Boost_FOUND AND NOT CMAKE_CROSSCOMPILING) - find_package(Boost) -endif() - include(CMDeploy) include(FindPkgConfig) @@ -54,7 +50,7 @@ target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTER target_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE - ${Boost_LIBRARIES} + Boost::container ${CMAKE_WORKSPACE_NAME}::algebra ${CMAKE_WORKSPACE_NAME}::block diff --git a/libs/zk/test/CMakeLists.txt b/libs/zk/test/CMakeLists.txt index 7609118f8e..d241ddf2bb 100644 --- a/libs/zk/test/CMakeLists.txt +++ b/libs/zk/test/CMakeLists.txt @@ -8,8 +8,6 @@ include(CMTest) -find_package(Boost REQUIRED COMPONENTS unit_test_framework) - target_include_directories(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} INTERFACE "$" "$") @@ -27,7 +25,7 @@ cm_test_link_libraries(${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME} marshalling::crypto3_algebra marshalling::crypto3_zk - ${Boost_LIBRARIES}) + Boost::unit_test_framework) option(ZK_PLACEHOLDER_PROFILING_ENABLED "Build with placeholder profiling" FALSE) @@ -39,18 +37,7 @@ macro(define_zk_test test) get_filename_component(name ${test} NAME) string(REPLACE "/" "_" full_test_name ${CMAKE_WORKSPACE_NAME}_${CURRENT_PROJECT_NAME}_${test}_test) - set(additional_args "") - - if(ENABLE_JUNIT_TEST_OUTPUT) - set(TEST_RESULTS_DIR "${CMAKE_CURRENT_BINARY_DIR}/junit_results") - set(TEST_LOGS_DIR "${TEST_RESULTS_DIR}/logs") - file(MAKE_DIRECTORY ${TEST_LOGS_DIR}) - - set(additional_args "--log_format=JUNIT" - "--log_sink=${TEST_LOGS_DIR}/${full_test_name}.xml") - endif() - - cm_test(NAME ${full_test_name} SOURCES ${test}.cpp ARGS ${additional_args}) + cm_test(NAME ${full_test_name} SOURCES ${test}.cpp) target_include_directories(${full_test_name} PRIVATE "$" @@ -60,13 +47,6 @@ macro(define_zk_test test) set_target_properties(${full_test_name} PROPERTIES CXX_STANDARD 17) - get_target_property(target_type Boost::unit_test_framework TYPE) - if(target_type STREQUAL "SHARED_LIB") - target_compile_definitions(${full_test_name} PRIVATE BOOST_TEST_DYN_LINK) - elseif(target_type STREQUAL "STATIC_LIB") - - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") target_compile_options(${full_test_name} PRIVATE "-fconstexpr-steps=2147483647") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")