From 6640d08195f535c5985c5db750e404f21776e061 Mon Sep 17 00:00:00 2001 From: Alfi Maulana Date: Wed, 2 Oct 2024 13:06:40 +0700 Subject: [PATCH] feat: rename sample project to `MyProject` Signed-off-by: Alfi Maulana --- .github/workflows/build.yaml | 2 +- .github/workflows/test.yaml | 2 +- CMakeLists.txt | 22 +++++++++---------- cmake/MyMkdirConfig.cmake | 1 - .../{MkdirRecursive.cmake => MyProject.cmake} | 0 cmake/MyProjectConfig.cmake | 1 + test/mkdir_recursive.cmake | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) delete mode 100644 cmake/MyMkdirConfig.cmake rename cmake/{MkdirRecursive.cmake => MyProject.cmake} (100%) create mode 100644 cmake/MyProjectConfig.cmake diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4b4155e..be0c609 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,7 +23,7 @@ jobs: - name: Upload Project uses: actions/upload-artifact@v4.4.0 with: - name: MyMkdir + name: MyProject path: install if-no-files-found: error overwrite: true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f9c722d..6c5aaaf 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -15,7 +15,7 @@ jobs: - name: Configure Project uses: threeal/cmake-action@v2.0.0 with: - options: MY_MKDIR_ENABLE_TESTS=ON + options: MY_PROJECT_ENABLE_TESTS=ON run-build: false - name: Test Project diff --git a/CMakeLists.txt b/CMakeLists.txt index 07f5292..473f5c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,14 @@ cmake_minimum_required(VERSION 3.21) project( - MyMkdir + MyProject VERSION 0.0.0 DESCRIPTION "A starter CMake package for creating directories recursively" HOMEPAGE_URL https://github.com/threeal/cmake-starter LANGUAGES NONE) -option(MY_MKDIR_ENABLE_TESTS "Enable test targets.") -option(MY_MKDIR_ENABLE_INSTALL "Enable install targets." "${PROJECT_IS_TOP_LEVEL}") +option(MY_PROJECT_ENABLE_TESTS "Enable test targets.") +option(MY_PROJECT_ENABLE_INSTALL "Enable install targets." "${PROJECT_IS_TOP_LEVEL}") # Prefer system packages over the find modules provided by this project. if(NOT DEFINED CMAKE_FIND_PACKAGE_PREFER_CONFIG) @@ -16,23 +16,23 @@ if(NOT DEFINED CMAKE_FIND_PACKAGE_PREFER_CONFIG) endif() list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) -include(MkdirRecursive) +include(MyProject) -if(MY_MKDIR_ENABLE_TESTS) +if(MY_PROJECT_ENABLE_TESTS) enable_testing() find_package(Assertion 1.0.0 REQUIRED) assertion_add_test(test/mkdir_recursive.cmake) endif() -if(MY_MKDIR_ENABLE_INSTALL) +if(MY_PROJECT_ENABLE_INSTALL) include(CMakePackageConfigHelpers) write_basic_package_version_file( - MyMkdirConfigVersion.cmake COMPATIBILITY SameMajorVersion) + MyProjectConfigVersion.cmake COMPATIBILITY SameMajorVersion) install( - FILES cmake/MkdirRecursive.cmake - cmake/MyMkdirConfig.cmake - ${CMAKE_CURRENT_BINARY_DIR}/MyMkdirConfigVersion.cmake - DESTINATION lib/cmake/MyMkdir) + FILES cmake/MyProject.cmake + cmake/MyProjectConfig.cmake + ${CMAKE_CURRENT_BINARY_DIR}/MyProjectConfigVersion.cmake + DESTINATION lib/cmake/MyProject) endif() diff --git a/cmake/MyMkdirConfig.cmake b/cmake/MyMkdirConfig.cmake deleted file mode 100644 index a52304e..0000000 --- a/cmake/MyMkdirConfig.cmake +++ /dev/null @@ -1 +0,0 @@ -include(${CMAKE_CURRENT_LIST_DIR}/MkdirRecursive.cmake) diff --git a/cmake/MkdirRecursive.cmake b/cmake/MyProject.cmake similarity index 100% rename from cmake/MkdirRecursive.cmake rename to cmake/MyProject.cmake diff --git a/cmake/MyProjectConfig.cmake b/cmake/MyProjectConfig.cmake new file mode 100644 index 0000000..4319a60 --- /dev/null +++ b/cmake/MyProjectConfig.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/MyProject.cmake) diff --git a/test/mkdir_recursive.cmake b/test/mkdir_recursive.cmake index 65f34d9..8d0ff24 100644 --- a/test/mkdir_recursive.cmake +++ b/test/mkdir_recursive.cmake @@ -1,4 +1,4 @@ -find_package(MyMkdir REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR}/../cmake) +find_package(MyProject REQUIRED PATHS ${CMAKE_CURRENT_LIST_DIR}/../cmake) section("it should create a directory recursively") file(REMOVE_RECURSE parent)