Salome HOME
CMake: new CMake procedure for GUI.
[modules/gui.git] / src / VTKViewer / CMakeLists.txt
1 # Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
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 INCLUDE(UseQt4Ext)
20 INCLUDE(${VTK_USE_FILE})
21
22 INCLUDE_DIRECTORIES(
23   ${CAS_INCLUDE_DIRS}
24   ${QT_INCLUDES}
25   ${PTHREAD_INCLUDE_DIRS}
26   ${KERNEL_INCLUDE_DIRS}
27   ${CMAKE_CURRENT_SOURCE_DIR}/../Qtx
28   ${CMAKE_CURRENT_SOURCE_DIR}/../SUIT
29 )
30
31 ADD_DEFINITIONS(${CAS_DEFINITIONS} ${QT_DEFINITIONS})
32
33 SET(COMMON_LIBS ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${VTK_LIBRARIES} ${CAS_KERNEL} qtx suit ${SALOMELocalTrace})
34
35 SET(GUI_HEADERS   
36   VTKViewer_RenderWindow.h
37   VTKViewer_RenderWindowInteractor.h
38   VTKViewer_ViewManager.h
39   VTKViewer_ViewModel.h
40   VTKViewer_ViewWindow.h
41   VTKViewer_MarkerWidget.h
42   VTKViewer_MarkerDlg.h
43 )
44 QT4_WRAP_CPP(GUI_HEADERS_MOC ${GUI_HEADERS})
45
46 SET(RCCS VTKViewer.qrc)
47 QT4_ADD_RESOURCES(RCC_SRCS ${RCCS})
48
49 SET(VTKViewer_SOURCES
50   VTKViewer_CellLocationsArray.cxx
51   VTKViewer_Actor.cxx
52   VTKViewer_FramedTextActor.cxx
53   VTKViewer_ExtractUnstructuredGrid.cxx
54   VTKViewer_Filter.cxx
55   VTKViewer_GeometryFilter.cxx
56   VTKViewer_AppendFilter.cxx
57   VTKViewer_Algorithm.cxx
58   VTKViewer_InteractorStyle.cxx
59   VTKViewer_RenderWindow.cxx
60   VTKViewer_RenderWindowInteractor.cxx
61   VTKViewer_ShrinkFilter.cxx
62   VTKViewer_Transform.cxx
63   VTKViewer_TransformFilter.cxx
64   VTKViewer_Trihedron.cxx
65   VTKViewer_Utilities.cxx
66   VTKViewer_ViewManager.cxx
67   VTKViewer_ViewModel.cxx
68   VTKViewer_ConvexTool.cxx
69   VTKViewer_ViewWindow.cxx
70   VTKViewer_ArcBuilder.cxx
71   VTKViewer_MarkerUtils.cxx
72   VTKViewer_MarkerWidget.cxx
73   VTKViewer_MarkerDlg.cxx
74   VTKViewer_PolyDataMapper.cxx
75   VTKViewer_DataSetMapper.cxx
76   VTKViewer_Texture.cxx
77   VTKViewer_OpenGLRenderer.cxx
78   VTKViewer_CellCenters.cxx
79 )
80
81 SET(GUITS_SOURCES
82   resources/VTKViewer_images.ts
83   resources/VTKViewer_msg_en.ts
84   resources/VTKViewer_msg_fr.ts
85 )
86
87 ADD_LIBRARY(VTKViewer ${VTKViewer_SOURCES} ${GUI_HEADERS_MOC} ${RCC_SRCS})
88 TARGET_LINK_LIBRARIES(VTKViewer ${COMMON_LIBS})
89 INSTALL(TARGETS VTKViewer EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
90
91 #ADD_EXECUTABLE(TestVTKViewer VTKViewer.cxx)
92 #SET_TARGET_PROPERTIES(TestVTKViewer PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}"  OUTPUT_NAME "VTKViewer")
93 #TARGET_LINK_LIBRARIES(TestVTKViewer VTKViewer ${COMMON_LIBS})
94 #INSTALL(TARGETS TestVTKViewer DESTINATION ${SALOME_INSTALL_BINS})
95
96 SET(COMMON_HEADERS_H 
97   VTKViewer.h
98   VTKViewer_CellLocationsArray.h
99   VTKViewer_Actor.h
100   VTKViewer_FramedTextActor.h
101   VTKViewer_ExtractUnstructuredGrid.h
102   VTKViewer_ConvexTool.h
103   VTKViewer_Filter.h
104   VTKViewer_GeometryFilter.h
105   VTKViewer_AppendFilter.h
106   VTKViewer_Algorithm.h
107   VTKViewer_InteractorStyle.h
108   VTKViewer_RenderWindow.h
109   VTKViewer_RenderWindowInteractor.h
110   VTKViewer_ShrinkFilter.h
111   VTKViewer_TransformFilter.h
112   VTKViewer_Transform.h
113   VTKViewer_Trihedron.h
114   VTKViewer_Utilities.h
115   VTKViewer_ViewManager.h
116   VTKViewer_ViewModel.h
117   VTKViewer_ViewWindow.h
118   VTKViewer_Functor.h
119   VTKViewer_ArcBuilder.h
120   VTKViewer_MarkerDef.h
121   VTKViewer_MarkerUtils.h
122   VTKViewer_MarkerWidget.h
123   VTKViewer_MarkerDlg.h
124   VTKViewer_PolyDataMapper.h
125   VTKViewer_DataSetMapper.h
126   VTKViewer_Texture.h
127   VTKViewer_OpenGLRenderer.h
128   VTKViewer_CellCenters.h
129 )
130
131 INSTALL(FILES ${COMMON_HEADERS_H} DESTINATION ${SALOME_INSTALL_HEADERS})
132 QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}")
133
134 FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
135 INSTALL(FILES ${GUIPNG_DATA} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA})