Salome HOME
Update copyrights
[modules/paravis.git] / src / Plugins / ParaMEDCorba / CMakeLists.txt
1 # Copyright (C) 2010-2019  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   IF(WIN32)
24     CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
25   ENDIF(WIN32)
26
27   ## !!! This definition corrupts wrapping process
28   #SET( LIBRARY_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin CACHE INTERNAL "Single place for output" )
29   #SET( EXECUTABLE_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin  CACHE INTERNAL "Single place for output" )
30   MARK_AS_ADVANCED(
31     LIBRARY_OUTPUT_PATH
32     EXECUTABLE_OUTPUT_PATH
33   )
34
35   FIND_PACKAGE( ParaView COMPONENTS pqCore NO_MODULE)
36
37   IF( ParaView_FOUND )
38     
39     INCLUDE( ${PARAVIEW_USE_FILE} )
40     
41     FIND_PACKAGE( VTK COMPONENTS vtkClientServer NO_MODULE NO_DEFAULT_PATH)
42     INCLUDE( ${VTK_USE_FILE} )
43
44     SET( PARACORBAPLUG_SRCS
45       ${ParaMEDCorba_SOURCE_DIR}/vtkParaMEDCorbaSource.cxx
46       )
47
48     ADD_LIBRARY (ParaMEDMEM2VTK SHARED VTKMEDCouplingMeshClient.cxx VTKMEDCouplingUMeshClient.cxx VTKMEDCouplingCMeshClient.cxx
49       VTKMEDCouplingFieldClient.cxx VTKParaMEDFieldClient.cxx VTKMEDCouplingMultiFieldsClient.cxx VTKMEDCouplingCurveLinearMeshClient.cxx)
50     
51     ADD_PARAVIEW_PLUGIN( ParaMEDCorbaPlugin "1.0"
52       SERVER_MANAGER_XML ParaMEDCorbaServerManager.xml
53       SERVER_MANAGER_SOURCES ${PARACORBAPLUG_SRCS} )
54     
55     INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} ${FIELDS_ROOT_DIR}/include/salome ${KERNEL_ROOT_DIR}/include/salome)
56     ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
57
58     TARGET_LINK_LIBRARIES(ParaMEDMEM2VTK
59       #vtkCommon
60       #vtkFiltering
61       #vtkGraphics
62       vtkClientServer
63       vtkPVVTKExtensionsRendering
64       pqCore
65       ${OMNIORB_LIBRARIES}
66       ${FIELDS_SalomeIDLMED}
67       ${KERNEL_SalomeIDLKernel}
68       )
69     TARGET_LINK_LIBRARIES(ParaMEDCorbaPlugin
70       ParaMEDMEM2VTK
71       )
72     
73     #Build library with a static runtime and ignore MSVCRT.lib on WINDOWS
74     IF(WIN32)
75       IF(CMAKE_BUILD_TYPE STREQUAL Debug)
76         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRTD")
77         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MTd")
78       ELSE()
79         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT")
80         SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MT")
81       ENDIF()
82     ENDIF(WIN32)
83
84     INSTALL(TARGETS ParaMEDCorbaPlugin DESTINATION lib/paraview)
85
86     INSTALL(TARGETS ParaMEDMEM2VTK DESTINATION lib/salome)
87     
88     ADD_EXECUTABLE( testParaMEDCorba
89       ${ParaMEDCorba_SOURCE_DIR}/testParaMEDCorba.cxx
90       )
91     # SET_TARGET_PROPERTIES(testCorbaPlugin PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}")
92
93     # RNV: ${vtkgl2ps_LIBRARIES} was added for Fedora 26 OS    
94     TARGET_LINK_LIBRARIES( testParaMEDCorba
95       ParaMEDCorbaPlugin
96       ${vtkgl2ps_LIBRARIES}
97       )
98     
99     INSTALL(FILES ParaMEDCorbaServerManager.xml DESTINATION share)
100     
101   
102   ENDIF( ParaView_FOUND )
103