Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/paravis.git] / src / Plugins / ParaMEDCorba / CMakeLists.txt
1 # Copyright (C) 2010-2012  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 PROJECT( ParaMEDCorba )
21
22   CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
23   ## !!! This definition corrupts wrapping process
24   #SET( LIBRARY_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin CACHE INTERNAL "Single place for output" )
25   #SET( EXECUTABLE_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin  CACHE INTERNAL "Single place for output" )
26   MARK_AS_ADVANCED(
27     LIBRARY_OUTPUT_PATH
28     EXECUTABLE_OUTPUT_PATH
29   )
30
31   FIND_PACKAGE( ParaView REQUIRED )
32
33   IF( ParaView_FOUND )
34     
35     INCLUDE( ${PARAVIEW_USE_FILE} )
36
37     SET( PARACORBAPLUG_SRCS
38       ${ParaMEDCorba_SOURCE_DIR}/vtkParaMEDCorbaSource.cxx
39       )
40
41     ADD_LIBRARY (ParaMEDMEM2VTK SHARED VTKMEDCouplingMeshClient.cxx VTKMEDCouplingUMeshClient.cxx VTKMEDCouplingCMeshClient.cxx
42       VTKMEDCouplingFieldClient.cxx VTKParaMEDFieldClient.cxx VTKMEDCouplingMultiFieldsClient.cxx )
43     
44     ADD_PARAVIEW_PLUGIN( ParaMEDCorbaPlugin "1.0"
45       SERVER_MANAGER_XML ParaMEDCorbaServerManager.xml
46       GUI_RESOURCE_FILES
47       ParaMEDCorbaUserInterfaceSources.xml
48       SERVER_MANAGER_SOURCES ${PARACORBAPLUG_SRCS} )
49     
50     SET(flags)
51     FOREACH(f ${CORBA_INCLUDES} ${CORBA_CXXFLAGS})
52       SET(flags "${flags} ${f}")
53     ENDFOREACH(f ${CORBA_INCLUDES} ${CORBA_CXXFLAGS})
54     
55     INCLUDE_DIRECTORIES(${MED_ROOT_DIR}/include/salome ${KERNEL_ROOT_DIR}/include/salome)
56     SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "${flags}")
57     SET_TARGET_PROPERTIES(ParaMEDCorbaPlugin PROPERTIES COMPILE_FLAGS "${flags}")
58
59     TARGET_LINK_LIBRARIES(ParaMEDMEM2VTK
60       vtkCommon
61       vtkFiltering
62       vtkGraphics
63       vtkClientServer
64       pqCore
65       ${CORBA_LIBS}
66       ${SalomeIDLMED}
67       ${SalomeIDLKernel}
68       ${QT_LIBS}
69       ${CORBA_LIBS}
70       )
71     TARGET_LINK_LIBRARIES(ParaMEDCorbaPlugin
72       ParaMEDMEM2VTK
73       )
74     
75     INSTALL(TARGETS ParaMEDCorbaPlugin DESTINATION lib/paraview)
76
77     INSTALL(TARGETS ParaMEDMEM2VTK DESTINATION lib/salome)
78     
79     ADD_EXECUTABLE( testParaMEDCorba
80       ${ParaMEDCorba_SOURCE_DIR}/testParaMEDCorba.cxx
81       )
82     # SET_TARGET_PROPERTIES(testCorbaPlugin PROPERTIES COMPILE_FLAGS "${flags}")
83     
84     TARGET_LINK_LIBRARIES( testParaMEDCorba
85       ParaMEDCorbaPlugin
86       )
87     
88     INSTALL(FILES ParaMEDCorbaServerManager.xml DESTINATION share)
89     
90   
91   ENDIF( ParaView_FOUND )
92