Skip to content

Commit

Permalink
feat: rename sample project to MyProject
Browse files Browse the repository at this point in the history
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
  • Loading branch information
threeal committed Oct 2, 2024
1 parent d43324a commit 6640d08
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 11 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
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)
set(CMAKE_FIND_PACKAGE_PREFER_CONFIG TRUE)
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()
1 change: 0 additions & 1 deletion cmake/MyMkdirConfig.cmake

This file was deleted.

File renamed without changes.
1 change: 1 addition & 0 deletions cmake/MyProjectConfig.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/MyProject.cmake)
2 changes: 1 addition & 1 deletion test/mkdir_recursive.cmake
Original file line number Diff line number Diff line change
@@ -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)
Expand Down

0 comments on commit 6640d08

Please sign in to comment.