summaryrefslogtreecommitdiffhomepage
path: root/cmake/opentrack-boilerplate.cmake
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2017-02-24 17:05:49 +0100
committerStanislaw Halik <sthalik@misaki.pl>2017-02-24 17:05:49 +0100
commit857ade6d3ea723f5caa0c63632f855eb6e9eacee (patch)
treed26a2be2d9e1db7f61099dd3a9da2271dcfb197f /cmake/opentrack-boilerplate.cmake
parent8e7c72ce68c8b1dbb79cf32c96b25f1b8b57ab6e (diff)
cmake: install program sources more robustly
Before it skipped some subdirectory parts.
Diffstat (limited to 'cmake/opentrack-boilerplate.cmake')
-rw-r--r--cmake/opentrack-boilerplate.cmake33
1 files changed, 5 insertions, 28 deletions
diff --git a/cmake/opentrack-boilerplate.cmake b/cmake/opentrack-boilerplate.cmake
index eaab2f99..03c090f3 100644
--- a/cmake/opentrack-boilerplate.cmake
+++ b/cmake/opentrack-boilerplate.cmake
@@ -79,30 +79,8 @@ function(opentrack_compat target)
opentrack_fixup_subsystem(${target})
endfunction()
-function(opentrack_sources n ret)
- get_target_property(srcs ${n} SOURCES)
- if(srcs)
- foreach(f ${srcs})
- get_source_file_property(autogen "${f}" GENERATED)
- if(NOT autogen)
- list(APPEND ${ret} "${f}")
- endif()
- endforeach()
- endif()
- set(${ret} "${${ret}}" PARENT_SCOPE)
-endfunction()
-
include(CMakeParseArguments)
-function(opentrack_install_sources n)
- opentrack_sources(${n} sources)
- file(RELATIVE_PATH subdir "${CMAKE_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}")
- foreach (i ${sources})
- install(FILES "${i}" DESTINATION "${opentrack-doc-src-pfx}/${subdir}" ${opentrack-perms})
- endforeach()
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt" DESTINATION "${opentrack-doc-src-pfx}/${subdir}" ${opentrack-perms})
-endfunction()
-
function(opentrack_is_target_c_only ret srcs)
set(val TRUE)
foreach(i ${srcs})
@@ -179,9 +157,6 @@ function(opentrack_boilerplate n)
target_link_libraries(${n} opentrack-api opentrack-options opentrack-compat)
endif()
- if(NOT arg_NO-INSTALL)
- opentrack_install_sources(${n})
- endif()
opentrack_compat(${n})
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -227,9 +202,7 @@ function(opentrack_boilerplate n)
set_property(GLOBAL PROPERTY "opentrack-ts-${i}" "${tt}")
endforeach()
- get_property(modules GLOBAL PROPERTY opentrack-all-modules)
- list(APPEND modules "${n}")
- set_property(GLOBAL PROPERTY opentrack-all-modules "${modules}")
+ set_property(GLOBAL APPEND PROPERTY opentrack-all-modules "${n}")
foreach(i ${langs})
add_custom_command(OUTPUT "${i}"
@@ -241,5 +214,9 @@ function(opentrack_boilerplate n)
endforeach()
add_custom_target(i18n-module-${n} DEPENDS ${langs})
+
+ if(NOT arg_NO-INSTALL)
+ set_property(GLOBAL APPEND PROPERTY opentrack-all-source-dirs "${CMAKE_CURRENT_SOURCE_DIR}")
+ endif()
endfunction()