Skip to content

Commit

Permalink
build: add MUSEN_BUILD_EXAMPLES option
Browse files Browse the repository at this point in the history
  • Loading branch information
threeal committed Aug 4, 2024
1 parent ade2dd9 commit 9ed62fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Build project
uses: threeal/[email protected]
with:
options: MUSEN_BUILD_TESTS=ON
options: MUSEN_BUILD_TESTS=ON MUSEN_BUILD_EXAMPLES=ON
run-build: true

- name: Test project
Expand Down
7 changes: 5 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.5)
project(musen)

option(MUSEN_BUILD_TESTS "Build test targets.")
option(MUSEN_BUILD_EXAMPLES "Build example targets.")

function(cpmaddpackage)
file(
Expand Down Expand Up @@ -42,13 +43,15 @@ install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION "lib"
RUNTIME DESTINATION "bin")

add_subdirectory("examples")

if(MUSEN_BUILD_TESTS)
enable_testing()
add_subdirectory("test/gtest")
endif()

if(MUSEN_BUILD_EXAMPLES)
add_subdirectory("examples")
endif()

install(EXPORT ${PROJECT_NAME}_export
FILE ${PROJECT_NAME}-config.cmake
NAMESPACE ${PROJECT_NAME}::
Expand Down

0 comments on commit 9ed62fd

Please sign in to comment.