Salome HOME
New CMake implementation
[modules/med.git] / src / MEDOP / gui / dialogs / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 #
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 #
19
20 ADD_DEFINITIONS(${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS} ${OMNIORB_DEFINITIONS})
21
22 INCLUDE(UseQt4Ext)
23
24 MACRO (QT4_WRAP_UI_XX outfiles )
25   QT4_EXTRACT_OPTIONS(ui_files ui_options ${ARGN})
26   FOREACH (it ${ui_files})
27     GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
28     GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
29     SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.hxx)
30     ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
31       COMMAND ${QT_UIC_EXECUTABLE}
32       ARGS ${ui_options} -o ${outfile} ${infile}
33       MAIN_DEPENDENCY ${infile})
34     SET(${outfiles} ${${outfiles}} ${outfile})
35   ENDFOREACH (it)
36 ENDMACRO (QT4_WRAP_UI_XX)
37
38 SET(MEDOPGUI_dialogs_FORMS
39   GenericDialog.ui
40   DlgAlias.ui
41   DlgUseInWorkspace.ui
42   DlgChangeUnderlyingMesh.ui
43   DlgImageToMed.ui
44 )
45 QT4_WRAP_UI_XX(MEDOPGUI_dialogs_FORMS_HEADERS ${MEDOPGUI_dialogs_FORMS})
46
47 SET(MEDOPGUI_dialogs_FILES
48   GenericDialog.hxx
49   DlgAlias.hxx
50   DlgUseInWorkspace.hxx
51   DlgChangeUnderlyingMesh.hxx
52   DlgImageToMed.hxx
53 )
54 QT4_WRAP_CPP(MEDOPGUI_dialogs_HEADERS_MOC ${MEDOPGUI_dialogs_FILES})
55
56 INCLUDE_DIRECTORIES(
57   ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS}
58   ${CAS_INCLUDE_DIRS}
59   ${BOOST_INCLUDE_DIRS}
60   ${PTHREAD_INCLUDE_DIRS}
61   ${CMAKE_CURRENT_BINARY_DIR}
62   ${KERNEL_ROOT_DIR}/include/salome
63   ${GUI_ROOT_DIR}/include/salome
64   ${CMAKE_CURRENT_SOURCE_DIR}/..
65   ${QT4_INCLUDE_DIRECTORY}
66 )
67
68 SET(MEDOPGUI_dialogs_SOURCES
69   GenericDialog.cxx
70   DlgAlias.cxx
71   DlgUseInWorkspace.cxx
72   DlgChangeUnderlyingMesh.cxx
73   DlgImageToMed.cxx
74 )
75
76 ADD_LIBRARY(MEDOPGUI_dialogs SHARED ${MEDOPGUI_dialogs_SOURCES} ${MEDOPGUI_dialogs_HEADERS_MOC} ${MEDOPGUI_dialogs_FORMS_HEADERS})
77 TARGET_LINK_LIBRARIES(MEDOPGUI_dialogs ${CAS_KERNEL} ${QT_LIBRARIES} ${KERNEL_SalomeIDLKernel} 
78     ${GUI_SalomeGuiHelpers} ${OMNIORB_LIBRARIES} ${GUI_qtx} ${GUI_suit} ${PLATFORM_LIBRARIES} 
79     ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SalomeKernelHelpers} ${GUI_SalomeGuiHelpers})
80 INSTALL(TARGETS MEDOPGUI_dialogs DESTINATION ${SALOME_INSTALL_LIBS})
81
82 #
83 # ---------------------------------------------------------
84 # Unit test programs
85 # ---------------------------------------------------------
86 #
87 ADD_EXECUTABLE(dlgTester dlgTester.cxx)
88 TARGET_LINK_LIBRARIES(dlgTester MEDOPGUI_dialogs ${QT_LIBS} ${PLATFORM_LIBS})
89 INSTALL(TARGETS dlgTester DESTINATION ${SALOME_INSTALL_BINS})
90 #ADD_TEST(dlgTester dlgTester)
91
92 FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
93 INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
94