diff options
Diffstat (limited to 'KF5ConfigMacros.cmake')
-rw-r--r-- | KF5ConfigMacros.cmake | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/KF5ConfigMacros.cmake b/KF5ConfigMacros.cmake index 469d9b01..2fe34367 100644 --- a/KF5ConfigMacros.cmake +++ b/KF5ConfigMacros.cmake @@ -1,4 +1,5 @@ # KCONFIG_ADD_KCFG_FILES (SRCS_VAR [GENERATE_MOC] [USE_RELATIVE_PATH] file1.kcfgc ... fileN.kcfgc) +# KCONFIG_ADD_KCFG_FILES (<target> [GENERATE_MOC] [USE_RELATIVE_PATH] file1.kcfgc ... fileN.kcfgc) # Use this to add KDE config compiler files to your application/library. # Use optional GENERATE_MOC to generate moc if you use signals in your kcfg files. # Use optional USE_RELATIVE_PATH to generate the classes in the build following the given @@ -32,7 +33,7 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. -function (KCONFIG_ADD_KCFG_FILES _sources ) +function (KCONFIG_ADD_KCFG_FILES _target_or_source_var) set(options GENERATE_MOC USE_RELATIVE_PATH) cmake_parse_arguments(ARG "${options}" "" "" ${ARGN}) @@ -127,6 +128,10 @@ function (KCONFIG_ADD_KCFG_FILES _sources ) list(APPEND sources ${_src_FILE} ${_header_FILE}) endforeach (_current_FILE) - set(${_sources} ${${_sources}} ${sources} PARENT_SCOPE) + if (TARGET ${_target_or_source_var}) + target_sources(${_target_or_source_var} PRIVATE ${sources}) + else() + set(${_target_or_source_var} ${${_target_or_source_var}} ${sources} PARENT_SCOPE) + endif() endfunction(KCONFIG_ADD_KCFG_FILES) |