diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-24 20:34:57 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2019-04-24 20:34:57 +0200 |
commit | b178d5428c30574cf648c037897242071eaf167e (patch) | |
tree | 3eeca7c6a49ae820099ab9fac63843c12f81ac11 /cmake | |
parent | f35409972b97f3e236817b29359d18c1461247f6 (diff) |
cmake: fix otr_module(... SUBDIRS ...)
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/opentrack-boilerplate.cmake | 25 |
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}) |