aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Morgner <felix.morgner@gmail.com>2023-06-09 11:45:08 +0200
committerFelix Morgner <felix.morgner@gmail.com>2023-06-09 11:45:08 +0200
commit1c83f818853cd260006def9e163d5b7627eb92b0 (patch)
treea69b8a15950c34716add30cb39a44312b56aecd1
parent7ce8f285efd6d3c036e54423881b85ab67c071bb (diff)
downloadnewtype-1c83f818853cd260006def9e163d5b7627eb92b0.tar.xz
newtype-1c83f818853cd260006def9e163d5b7627eb92b0.zip
build: build examples and install their sources
-rw-r--r--source/examples/CMakeLists.txt20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/examples/CMakeLists.txt b/source/examples/CMakeLists.txt
index 5b6ddd8..45d1638 100644
--- a/source/examples/CMakeLists.txt
+++ b/source/examples/CMakeLists.txt
@@ -1,10 +1,12 @@
-if(BUILD_EXAMPLES)
- function(add_example NAME)
- add_executable("ex_${NAME}" "src/${NAME}.cpp")
- target_link_libraries("ex_${NAME}" "${PROJECT_NAME}")
- endfunction()
+function(add_example NAME)
+ add_executable("ex_${NAME}" "src/${NAME}.cpp")
+ target_link_libraries("ex_${NAME}" "${PROJECT_NAME}")
+endfunction()
- add_example("basic_usage")
- add_example("basic_usage_with_show")
- add_example("basic_usage_with_read")
-endif()
+add_example("basic_usage")
+add_example("basic_usage_with_show")
+add_example("basic_usage_with_read")
+
+install(DIRECTORY "src/"
+ TYPE DOC
+)