From d86700f6dbfcd94f9952f24c10b68f1c5989fb63 Mon Sep 17 00:00:00 2001 From: bruneton Date: Tue, 22 Oct 2013 13:42:08 +0000 Subject: [PATCH] OMNIORB_ADD_MODULE now creates a target "omniorb_module_" depending on all the files generated when processing the IDLs of the module. This can be used to set up a depency on the header (and other files) generated by omniidl. --- salome_adm/cmake_files/UseOmniORB.cmake | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/salome_adm/cmake_files/UseOmniORB.cmake b/salome_adm/cmake_files/UseOmniORB.cmake index 414018599..cedaaa758 100644 --- a/salome_adm/cmake_files/UseOmniORB.cmake +++ b/salome_adm/cmake_files/UseOmniORB.cmake @@ -61,7 +61,10 @@ ENDMACRO(OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL) # - From FindOmniORBPy.cmake # OMNIORB_IDLPYFLAGS : the options to give to omniidl generator for Python backend # OMNIORB_PYTHON_BACKEND : Python backend -# +# +# The macro automatically adds a target "omniorb_module_" which can be used to set up +# dependencies on the generation of the files produced by omniidl (typically the header files). +# # TODO: # 1. Replace hardcoded dirpaths bin/salome, idl/salome, etc by corresponding configuration options. # 2. Revise/improve OMNIORB_COMPILE_IDL_FORPYTHON_ON_INSTALL macro usage. @@ -77,6 +80,8 @@ MACRO(OMNIORB_ADD_MODULE module idlfiles incdirs) # module sources SET(_sources) + # module produced files + SET(_all_outputs) # type of the libraries: SHARED for Linux, STATIC for Windows SET(_type SHARED) IF(WIN32) @@ -114,6 +119,7 @@ MACRO(OMNIORB_ADD_MODULE module idlfiles incdirs) LIST(APPEND _sources ${_src}) LIST(APPEND _sources ${_dynsrc}) SET(_outputs ${_inc} ${_src} ${_dynsrc}) + LIST(APPEND _all_outputs ${_outputs}) ADD_CUSTOM_COMMAND(OUTPUT ${_outputs} COMMAND ${OMNIORB_IDL_COMPILER} ${_cxx_flags} ${_input_cmd} @@ -131,5 +137,5 @@ MACRO(OMNIORB_ADD_MODULE module idlfiles incdirs) ADD_LIBRARY(${module} ${_type} ${_sources}) TARGET_LINK_LIBRARIES(${module} ${_linklibs}) SET_TARGET_PROPERTIES(${module} PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}") - + ADD_CUSTOM_TARGET(omniorb_module_${module} DEPENDS ${_all_outputs}) ENDMACRO(OMNIORB_ADD_MODULE) -- 2.39.2