From c1cffca5ac8bd5cea5517ebbeb0257cf404de82f Mon Sep 17 00:00:00 2001 From: MALASHKIN Andrei Date: Mon, 20 May 2024 10:10:58 +0200 Subject: [PATCH] cleanup cmake --- .github/workflows/publish-results.yml | 2 +- .github/workflows/pull-request-action.yml | 6 +++--- CMakeLists.txt | 16 ++-------------- cmake/modules | 2 +- example/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 6 files changed, 9 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish-results.yml b/.github/workflows/publish-results.yml index fe59679..8513165 100644 --- a/.github/workflows/publish-results.yml +++ b/.github/workflows/publish-results.yml @@ -10,4 +10,4 @@ on: jobs: call-reusable-workflow: name: Call Reusable Testing Callback Workflow - uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-publish-result.yml@v1.2.0 + uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-publish-result.yml@v1.2.1 diff --git a/.github/workflows/pull-request-action.yml b/.github/workflows/pull-request-action.yml index 0761334..dd66764 100644 --- a/.github/workflows/pull-request-action.yml +++ b/.github/workflows/pull-request-action.yml @@ -11,7 +11,7 @@ on: jobs: handle-syncwith: name: Call Reusable SyncWith Handler - uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.2.0 + uses: NilFoundation/ci-cd/.github/workflows/reusable-handle-syncwith.yml@v1.2.1 with: ci-cd-ref: 'v1.2.0' secrets: inherit @@ -20,7 +20,7 @@ jobs: name: Linux Reusable Crypto3 Testing needs: - handle-syncwith - uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-testing-linux.yml@v1.2.0 + uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-testing-linux.yml@v1.2.1 secrets: inherit with: @@ -33,7 +33,7 @@ jobs: # name: Mac Reusable Crypto3 Testing # needs: # - handle-syncwith -# uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-testing-mac.yml@v1.2.0 +# uses: NilFoundation/ci-cd/.github/workflows/reusable-crypto3-testing-mac.yml@v1.2.1 # # secrets: inherit # with: diff --git a/CMakeLists.txt b/CMakeLists.txt index c6b29ef..f908069 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,24 +14,13 @@ include(CMDeploy) include(CMSetupVersion) cm_workspace(marshalling) - -macro(cm_find_package NAME) - if(NOT "${NAME}" MATCHES "^${CMAKE_WORKSPACE_NAME}_.*$" AND NOT "${NAME}" STREQUAL CM) - find_package(${ARGV}) - else() - set(${ARGV0}_FOUND ON CACHE BOOL "") - endif() -endmacro() - cm_project(crypto3_zk WORKSPACE_NAME ${CMAKE_WORKSPACE_NAME} LANGUAGES C CXX) -cm_find_package(CM) include(CMDeploy) 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}) @@ -64,9 +53,8 @@ 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/cmake/modules b/cmake/modules index 5e6b354..5763974 160000 --- a/cmake/modules +++ b/cmake/modules @@ -1 +1 @@ -Subproject commit 5e6b354eaa69f6a275992e08220e925c34ba0a19 +Subproject commit 57639741ecf018835deb97a04db2200241d7fbd3 diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index ca15480..f690a6f 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -12,7 +12,7 @@ include(CMDeploy) include(CMSetupVersion) - cm_find_package(Boost REQUIRED COMPONENTS filesystem log log_setup program_options thread system) + find_package(Boost REQUIRED COMPONENTS filesystem log log_setup program_options thread system) macro(define_marshalling_example name) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index c3c6b55..96de741 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -10,7 +10,7 @@ include(CMTest) if(NOT Boost_UNIT_TEST_FRAMEWORK_FOUND) - cm_find_package(Boost REQUIRED COMPONENTS unit_test_framework filesystem log log_setup program_options thread system) + 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}