Jens Wiklander | 5beb50f | 2018-01-17 20:23:18 +0100 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.2) |
| 2 | project (optee_examples C) |
| 3 | |
| 4 | # https://cmake.org/Wiki/CMake_Useful_Variables |
| 5 | set (CMAKE_TOOLCHAIN_FILE CMakeToolchain.txt) |
| 6 | |
| 7 | include(GNUInstallDirs) |
| 8 | |
| 9 | add_compile_options (-Wall) |
| 10 | #add_compile_options ( |
| 11 | # -Wall -Wbad-function-cast -Wcast-align |
| 12 | # -Werror-implicit-function-declaration -Wextra |
| 13 | # -Wfloat-equal -Wformat-nonliteral -Wformat-security |
| 14 | # -Wformat=2 -Winit-self -Wmissing-declarations |
| 15 | # -Wmissing-format-attribute -Wmissing-include-dirs |
| 16 | # -Wmissing-noreturn -Wmissing-prototypes -Wnested-externs |
| 17 | # -Wpointer-arith -Wshadow -Wstrict-prototypes |
| 18 | # -Wswitch-default -Wunsafe-loop-optimizations |
| 19 | # -Wwrite-strings -Werror -fPIC |
| 20 | #) |
| 21 | |
| 22 | find_program(CCACHE_FOUND ccache) |
| 23 | if(CCACHE_FOUND) |
| 24 | set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) |
| 25 | set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) |
| 26 | endif(CCACHE_FOUND) |
| 27 | |
| 28 | file(GLOB dirs *) |
| 29 | foreach(dir ${dirs}) |
| 30 | if(EXISTS ${dir}/CMakeLists.txt) |
| 31 | add_subdirectory(${dir}) |
| 32 | endif() |
| 33 | endforeach() |