From ece34950cc64cbe9f9309a32acc66e1bdf6f7a61 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Fri, 21 Jun 2024 15:20:26 +0700 Subject: [PATCH] build: add `MY_MKDIR_ENABLE_TESTS` option --- .github/workflows/test.yaml | 2 +- CMakeLists.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 95910aa..0049a91 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,7 +15,7 @@ jobs: - name: Configure Project uses: threeal/cmake-action@v1.3.0 with: - options: BUILD_TESTING=ON + options: MY_MKDIR_ENABLE_TESTS=ON - name: Test Project uses: threeal/ctest-action@v1.0.0 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a4ae30..58b033e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,13 +8,14 @@ project( LANGUAGES NONE ) +option(MY_MKDIR_ENABLE_TESTS "Enable test targets.") option( MY_MKDIR_ENABLE_INSTALL "Enable install targets." ${PROJECT_IS_TOP_LEVEL} ) include(cmake/MkdirRecursive.cmake) -if(PROJECT_IS_TOP_LEVEL AND BUILD_TESTING) +if(MY_MKDIR_ENABLE_TESTS) enable_testing() add_test(