diff options
| author | dario-loi <loi.1940849@studenti.uniroma1.it> | 2024-11-24 19:06:09 +0100 |
|---|---|---|
| committer | dario-loi <loi.1940849@studenti.uniroma1.it> | 2024-11-24 19:17:47 +0100 |
| commit | e416c072833477d1e50a036414100f7b75d5e1be (patch) | |
| tree | c0885f1ba0df4493aab803cc9048b812a3f5c920 /example/CMakeLists.txt | |
| parent | 8c86cb24ae3b1cbdbe749f228bc62cbbd5cdedfd (diff) | |
| parent | 5881f9997a4d1ffeb2fe87d03fad731dd9cb6a03 (diff) | |
Merge branch 'master' of https://github.com/dario-loi/fbgl
Diffstat (limited to 'example/CMakeLists.txt')
| -rw-r--r-- | example/CMakeLists.txt | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 837e6e8..3051dfc 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -1,31 +1,24 @@ 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)
\ No newline at end of file |
