Salome HOME
CMake improvement: usage of SALOME_GUI_MODE() macro
[modules/paravis.git] / src / Plugins / ParaMEDCorba / CMakeLists.txt
1 # Copyright (C) 2010-2015  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, or (at your option) any later version.
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.8.7 )
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 COMPONENTS pqCore NO_MODULE)
32
33   IF( ParaView_FOUND )
34     
35     INCLUDE( ${PARAVIEW_USE_FILE} )
36
37     FIND_PACKAGE( VTK COMPONENTS vtkClientServer NO_MODULE)
38     INCLUDE( ${VTK_USE_FILE} )
39
40     SET( PARACORBAPLUG_SRCS
41       ${ParaMEDCorba_SOURCE_DIR}/vtkParaMEDCorbaSource.cxx
42       )
43
44     ADD_LIBRARY (ParaMEDMEM2VTK SHARED VTKMEDCouplingMeshClient.cxx VTKMEDCouplingUMeshClient.cxx VTKMEDCouplingCMeshClient.cxx
45       VTKMEDCouplingFieldClient.cxx VTKParaMEDFieldClient.cxx VTKMEDCouplingMultiFieldsClient.cxx VTKMEDCouplingCurveLinearMeshClient.cxx)
46     
47     ADD_PARAVIEW_PLUGIN( ParaMEDCorbaPlugin "1.0"
48       SERVER_MANAGER_XML ParaMEDCorbaServerManager.xml
49       SERVER_MANAGER_SOURCES ${PARACORBAPLUG_SRCS} )
50     
51     INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} ${MED_ROOT_DIR}/include/salome ${KERNEL_ROOT_DIR}/include/salome)
52     ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
53
54     TARGET_LINK_LIBRARIES(ParaMEDMEM2VTK
55       #vtkCommon
56       #vtkFiltering
57       #vtkGraphics
58       vtkClientServer
59       vtkPVVTKExtensionsRendering
60       pqCore
61       ${OMNIORB_LIBRARIES}
62       ${MED_SalomeIDLMED}
63       ${KERNEL_SalomeIDLKernel}
64       ${QT_LIBRARIES}
65       )
66     TARGET_LINK_LIBRARIES(ParaMEDCorbaPlugin
67       ParaMEDMEM2VTK
68       )
69     
70     #Build library with a static runtime and ignore MSVCRT.lib on WINDOWS
71     IF(WIN32)
72       IF(CMAKE_BUILD_TYPE STREQUAL Debug)
73         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRTD")
74         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MTd")
75       ELSE()
76         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT")
77         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MT")
78       ENDIF()
79     ENDIF(WIN32)
80
81     INSTALL(TARGETS ParaMEDCorbaPlugin DESTINATION lib/paraview)
82
83     INSTALL(TARGETS ParaMEDMEM2VTK DESTINATION lib/salome)
84     
85     ADD_EXECUTABLE( testParaMEDCorba
86       ${ParaMEDCorba_SOURCE_DIR}/testParaMEDCorba.cxx
87       )
88     # SET_TARGET_PROPERTIES(testCorbaPlugin PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}")
89     
90     TARGET_LINK_LIBRARIES( testParaMEDCorba
91       ParaMEDCorbaPlugin
92       )
93     
94     INSTALL(FILES ParaMEDCorbaServerManager.xml DESTINATION share)
95     
96   
97   ENDIF( ParaView_FOUND )
98