From: barate Date: Thu, 27 Oct 2011 11:52:40 +0000 (+0000) Subject: Fix GUI compilation with CMake X-Git-Tag: Before_0020136~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e4884daff986418b47fe8e266db30da02a7eb6d8;p=modules%2Fkernel.git Fix GUI compilation with CMake --- diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index 9bfddcc5d..cf97aef37 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -1510,6 +1510,53 @@ class CMakeFile(object): ''') pass + # -- + # For GUI/tools/dlgfactory + # -- + key = "UIC_FILES_QDIALOG" + if self.__thedict__.has_key(key): + newlines.append(''' + FOREACH(output ${UIC_FILES_QDIALOG} ${UIC_FILES_GDIALOG}) + STRING(REPLACE "ui_" "" input ${output}) + STRING(REPLACE ".hxx" ".ui" input ${input}) + SET(input_path ${CMAKE_CURRENT_SOURCE_DIR}/${input}) + IF (NOT EXISTS ${input_path}) + SET(input_path ${CMAKE_CURRENT_BINARY_DIR}/${input}) + ENDIF (NOT EXISTS input_path) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND ${QT_UIC_EXECUTABLE} -o ${output} ${input_path} + MAIN_DEPENDENCY ${input} + ) + ENDFOREACH(output ${UIC_FILES}) + + FOREACH(output ${MOC_FILES_QDIALOG} ${MOC_FILES_GDIALOG}) + STRING(REGEX REPLACE _moc.cxx .hxx input ${output}) + SET(input_path ${CMAKE_CURRENT_SOURCE_DIR}/${input}) + IF (NOT EXISTS ${input_path}) + SET(input_path ${CMAKE_CURRENT_BINARY_DIR}/${input}) + ENDIF (NOT EXISTS input_path) + ADD_CUSTOM_COMMAND( + OUTPUT ${output} + COMMAND ${QT_MOC_EXECUTABLE} ${MOC_FLAGS} ${input_path} -o ${output} + MAIN_DEPENDENCY ${input} + ) + ENDFOREACH(output ${MOC_FILES}) + + ADD_CUSTOM_COMMAND( + OUTPUT QDialogTest.ui QDialogTest.hxx QDialogTest.cxx + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.sh -n QDialogTest -t qdialog + DEPENDS __QDIALOG__.ui __QDIALOG__.hxx __QDIALOG__.cxx dlgfactory.sh + ) + + ADD_CUSTOM_COMMAND( + OUTPUT GDialogTest.ui GDialogTest.hxx GDialogTest.cxx + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/dlgfactory.sh -n GDialogTest -t gdialog + DEPENDS __GDIALOG__.ui __GDIALOG__.hxx __GDIALOG__.cxx dlgfactory.sh + ) + ''') + pass + # -- # For make check # --