summaryrefslogtreecommitdiff
path: root/example/CMakeLists.txt
diff options
context:
space:
mode:
authordario-loi <77234595+dario-loi@users.noreply.github.com>2024-11-24 14:46:27 +0100
committerdario-loi <loi.1940849@studenti.uniroma1.it>2024-11-24 18:38:21 +0100
commit8183b19a87f7b6be35bceef11ace399d876d158b (patch)
treea56c6368ff4f8dda180abca577c70b54079afc6c /example/CMakeLists.txt
parent76a7cf28f44820d1db2e02980201657186190d43 (diff)
parent0898b3d26129f3880223d0d457fe05fd3f6be180 (diff)
Merge branch 'lvntky:master' into master
Diffstat (limited to 'example/CMakeLists.txt')
-rw-r--r--example/CMakeLists.txt39
1 files changed, 23 insertions, 16 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index 411945a..837e6e8 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -1,24 +1,31 @@
cmake_minimum_required(VERSION 3.21)
-project(fbglExamples C)
+ project(fbglExamples C)
-include(../cmake/folders.cmake)
+ include(../ cmake / folders.cmake)
-if(PROJECT_IS_TOP_LEVEL)
- find_package(fbgl REQUIRED)
-endif()
+ if (PROJECT_IS_TOP_LEVEL) find_package(
+ fbgl REQUIRED) endif()
-add_custom_target(run-examples)
+ add_custom_target(run - examples)
-function(add_example NAME)
- add_executable("${NAME}" "${NAME}.c")
- target_link_libraries("${NAME}" PRIVATE fbgl::fbgl)
- target_compile_features("${NAME}" PRIVATE c_std_99)
- add_custom_target("run_${NAME}" COMMAND "${NAME}" VERBATIM)
- add_dependencies("run_${NAME}" "${NAME}")
- add_dependencies(run-examples "run_${NAME}")
-endfunction()
+ function(add_example NAME) add_executable(
+ "${NAME}"
+ "${NAME}.c") target_link_libraries("${NAME}" PRIVATE
+ fbgl::fbgl)
+ target_compile_features("${NAME}" PRIVATE c_std_99) add_custom_target(
+ "run_${NAME}" COMMAND
+ "${NAME}" VERBATIM)
+ add_dependencies(
+ "run_${NAME}"
+ "${NAME}")
+ add_dependencies(
+ run -
+ examples
+ "run_${NAME}") endfunction()
-add_example(empty_example)
+ add_example(
+ empty_example)
-add_folders(Example)
+ add_folders(
+ Example)