aboutsummaryrefslogtreecommitdiff
path: root/examples/cmakescript/default.cmake
blob: 6da7cd615ce45dda852be5844a33b735e388b7b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# CMake can execute standalone CMake scripts with the -P parameter
# in the following manner: `cmake -P script.cmake`

set(flags ON OFF ON OFF OFF ON)
set(num_activated_flags)

foreach (value IN LISTS flags)
  if (value)
    math(EXPR num_activated_flags "${num_activated_flags} + 1")
  endif()
endforeach()

message("Activated Options: ${num_activated_flags}")