From 9bbdd1615b484c229657fd0896b2dbebdea9988d Mon Sep 17 00:00:00 2001 From: Alex Merry Date: Wed, 16 Apr 2014 17:30:41 +0100 Subject: Allow ecm_create_qm_loader() to be passed the _SRCS variable This allows a more straightforward way of using it, which matches the macros that generate things like D-Bus interfaces. REVIEW: 117475 --- modules/ECMCreateQmFromPoFiles.cmake | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) (limited to 'modules/ECMCreateQmFromPoFiles.cmake') diff --git a/modules/ECMCreateQmFromPoFiles.cmake b/modules/ECMCreateQmFromPoFiles.cmake index e7a401a1..3da31940 100644 --- a/modules/ECMCreateQmFromPoFiles.cmake +++ b/modules/ECMCreateQmFromPoFiles.cmake @@ -51,26 +51,20 @@ # # :: # -# ecm_create_qm_loader( ) +# ecm_create_qm_loader( ) # # ecm_create_qm_loader() generates a C++ file which ensures translations are -# automatically loaded at startup. The path of the .cpp file is stored in -# . This variable must be added to the list of sources to -# build. For example this call: +# automatically loaded at startup. The path of the .cpp file is appended to +# . Typical usage is like: # # .. code-block:: cmake # -# ecm_create_qm_loader(qmloader mylib) -# -# generates a C++ file which loads "mylib.qm" at startup, assuming it has been -# installed by ecm_create_qm_from_po_files(). The name of the C++ file is -# stored in the ``${qmloader}`` CMake variable. This variable must be integrated -# in the list of source files for the library: -# -# .. code-block:: cmake -# -# set(mylib_SRCS foo.cpp bar.cpp ${qmloader}) +# set(mylib_SRCS foo.cpp bar.cpp) +# ecm_create_qm_loader(mylib_SRCS mylib) # add_library(mylib ${mylib_SRCS}) +# +# This generates a C++ file which loads "mylib.qm" at startup, assuming it has +# been installed by ecm_create_qm_from_po_files(), and compiles it into ``mylib``. #============================================================================= # Copyright 2014 Aurélien Gâteau @@ -164,7 +158,7 @@ endfunction() function(ECM_CREATE_QM_LOADER out_var catalog_name) # catalog_name is used in ECMQmLoader.cpp.in configure_file(${ECM_MODULE_DIR}/ECMQmLoader.cpp.in ECMQmLoader.cpp @ONLY) - set(${out_var} ${CMAKE_CURRENT_BINARY_DIR}/ECMQmLoader.cpp PARENT_SCOPE) + set(${out_var} ${${out_var}} ${CMAKE_CURRENT_BINARY_DIR}/ECMQmLoader.cpp PARENT_SCOPE) endfunction() function(ECM_CREATE_QM_FROM_PO_FILES) -- cgit v1.2.1