summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake25
1 files changed, 14 insertions, 11 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index b26b32e0..b0fdf577 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -39,20 +39,23 @@ otr_write_library_paths()
function(otr_glob_sources var)
set(basedir "${CMAKE_CURRENT_SOURCE_DIR}")
- foreach(dir . ${ARGN})
+ foreach(i ui rc res cc cxx hh all)
+ set(${var}-${i} "")
+ endforeach()
+ foreach(dir ${ARGN})
set(dir "${basedir}/${dir}")
- file(GLOB ${var}-cxx "${dir}/*.cpp")
- file(GLOB ${var}-cc "${dir}/*.c")
- file(GLOB ${var}-hh "${dir}/*.h" "${dir}/*.hpp" "${dir}/*.inc")
- file(GLOB ${var}-res "${dir}/*.rc")
- foreach(f ${var}-res)
+ file(GLOB cxx "${dir}/*.cpp")
+ file(GLOB cc "${dir}/*.c")
+ file(GLOB hh "${dir}/*.h" "${dir}/*.hpp" "${dir}/*.inc")
+ file(GLOB res "${dir}/*.rc")
+ foreach(f res)
set_source_files_properties(${f} PROPERTIES LANGUAGE RC)
endforeach()
- file(GLOB ${var}-ui "${dir}/*.ui")
- file(GLOB ${var}-rc "${dir}/*.qrc")
- set(${var}-all ${${var}-cc} ${${var}-cxx} ${${var}-hh} ${${var}-res})
+ file(GLOB ui "${dir}/*.ui")
+ file(GLOB rc "${dir}/*.qrc")
+ set(all ${cc} ${cxx} ${hh} ${res})
foreach(i ui rc res cc cxx hh all)
- set(${var}-${i} "${${var}-${i}}" PARENT_SCOPE)
+ set(${var}-${i} "${${var}-${i}}" ${${i}} PARENT_SCOPE)
endforeach()
endforeach()
endfunction()
@@ -128,7 +131,7 @@ function(otr_module n_)
if(NOT arg_SUBDIRS)
otr_glob_sources(${n} .)
else()
- otr_glob_sources(${n} ${arg_SUBDIRS})
+ otr_glob_sources(${n} . ${arg_SUBDIRS})
endif()
list(APPEND ${n}-all ${arg_SOURCES})