blob: 9fb23f0a5051240cebec9345f94722cab4c63329 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
include_guard(GLOBAL)
function(otr_dist_select_variant)
file(GLOB variants CONFIGURE_DEPENDS "variant/*")
set(variant-list "")
foreach(k ${variants})
get_filename_component(name "${k}" NAME)
if(EXISTS "${k}/_variant.cmake")
list(APPEND variant-list "${name}")
else()
message(FATAL_ERROR "stray variant dir '${name}'")
endif()
endforeach()
set(opentrack_variant "default" CACHE STRING "")
set(dir "${CMAKE_SOURCE_DIR}/variant/${opentrack_variant}")
if(NOT EXISTS "${dir}/_variant.cmake")
set(opentrack_variant "default" CACHE STRING "" FORCE)
set(dir "${CMAKE_SOURCE_DIR}/variant/${opentrack_variant}")
endif()
set_property(CACHE opentrack_variant PROPERTY STRINGS "${variant-list}")
include("${dir}/_variant.cmake")
otr_init_variant()
endfunction()
|