Salome HOME
Copyright update 2022
[modules/paravis.git] / src / Plugins / ParaMEDCorba / CMakeLists.txt
1 # Copyright (C) 2020-2022  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 cmake_minimum_required(VERSION 3.8)
21 project(ParaMEDCorba)
22
23 include(GNUInstallDirs)
24 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}")
25 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
26 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}")
27
28 find_package(SalomeFIELDS)
29
30 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/plugin/ParaMEDCorbaModule )
31
32 set("_paraview_plugin_default_${CMAKE_PROJECT_NAME}" ON)
33 paraview_plugin_scan(
34   ENABLE_BY_DEFAULT YES
35   PLUGIN_FILES      "${CMAKE_CURRENT_SOURCE_DIR}/plugin/paraview.plugin"
36   PROVIDES_PLUGINS  plugins
37   REQUIRES_MODULES  required_modules)
38
39 foreach(module IN LISTS required_modules)
40   if(NOT TARGET "${module}")
41     message("Missing required module: ${module}")
42     return()
43   endif()
44 endforeach()
45
46 set(BUILD_SHARED_LIBS ON)
47 paraview_plugin_build(
48   RUNTIME_DESTINATION "${CMAKE_INSTALL_BINDIR}"
49   LIBRARY_DESTINATION "${CMAKE_INSTALL_LIBDIR}"
50   LIBRARY_SUBDIRECTORY "${PARAVIEW_PLUGIN_SUBDIR}"
51   PLUGINS ${plugins}
52   AUTOLOAD ${plugins})
53
54
55 ########################
56
57   # CMAKE_MINIMUM_REQUIRED( VERSION 2.8.7 )
58   # IF(WIN32)
59   #   CMAKE_POLICY(SET CMP0020 OLD) # disable automatic linking to qtmain.lib 
60   # ENDIF(WIN32)
61
62   # ## !!! This definition corrupts wrapping process
63   # #SET( LIBRARY_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin CACHE INTERNAL "Single place for output" )
64   # #SET( EXECUTABLE_OUTPUT_PATH ${ParaMEDCorba_BINARY_DIR}/bin  CACHE INTERNAL "Single place for output" )
65   # MARK_AS_ADVANCED(
66   #   LIBRARY_OUTPUT_PATH
67   #   EXECUTABLE_OUTPUT_PATH
68   # )
69
70   # FIND_PACKAGE( ParaView COMPONENTS pqCore NO_MODULE)
71
72   # IF( ParaView_FOUND )
73     
74   #   INCLUDE( ${PARAVIEW_USE_FILE} )
75     
76   #   FIND_PACKAGE( VTK COMPONENTS vtkClientServer NO_MODULE NO_DEFAULT_PATH)
77   #   INCLUDE( ${VTK_USE_FILE} )
78
79   #   SET( PARACORBAPLUG_SRCS
80   #     ${ParaMEDCorba_SOURCE_DIR}/vtkParaMEDCorbaSource.cxx
81   #     )
82
83   #   ADD_LIBRARY (ParaMEDMEM2VTK SHARED VTKMEDCouplingMeshClient.cxx VTKMEDCouplingUMeshClient.cxx VTKMEDCouplingCMeshClient.cxx
84   #     VTKMEDCouplingFieldClient.cxx VTKParaMEDFieldClient.cxx VTKMEDCouplingMultiFieldsClient.cxx VTKMEDCouplingCurveLinearMeshClient.cxx)
85     
86   #   ADD_PARAVIEW_PLUGIN( ParaMEDCorbaPlugin "1.0"
87   #     SERVER_MANAGER_XML ParaMEDCorbaServerManager.xml
88   #     SERVER_MANAGER_SOURCES ${PARACORBAPLUG_SRCS} )
89     
90   #   INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIR} ${FIELDS_ROOT_DIR}/include/salome ${KERNEL_ROOT_DIR}/include/salome)
91   #   ADD_DEFINITIONS(${OMNIORB_DEFINITIONS})
92
93   #   TARGET_LINK_LIBRARIES(ParaMEDMEM2VTK
94   #     #vtkCommon
95   #     #vtkFiltering
96   #     #vtkGraphics
97   #     vtkClientServer
98   #     vtkPVVTKExtensionsRendering
99   #     pqCore
100   #     ${OMNIORB_LIBRARIES}
101   #     ${FIELDS_SalomeIDLMED}
102   #     ${KERNEL_SalomeIDLKernel}
103   #     )
104   #   TARGET_LINK_LIBRARIES(ParaMEDCorbaPlugin
105   #     ParaMEDMEM2VTK
106   #     )
107     
108   #   #Build library with a static runtime and ignore MSVCRT.lib on WINDOWS
109   #   IF(WIN32)
110   #     IF(CMAKE_BUILD_TYPE STREQUAL Debug)
111   #       SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRTD")
112   #       SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MTd")
113   #     ELSE()
114   #       SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES LINK_FLAGS "/NODEFAULTLIB:MSVCRT")
115   #       SET_TARGET_PROPERTIES(ParaMEDMEM2VTK PROPERTIES COMPILE_FLAGS "/MT")
116   #     ENDIF()
117   #   ENDIF(WIN32)
118
119   #   INSTALL(TARGETS ParaMEDCorbaPlugin DESTINATION lib/paraview)
120
121   #   INSTALL(TARGETS ParaMEDMEM2VTK DESTINATION lib/salome)
122     
123   #   ADD_EXECUTABLE( testParaMEDCorba
124   #     ${ParaMEDCorba_SOURCE_DIR}/testParaMEDCorba.cxx
125   #     )
126   #   # SET_TARGET_PROPERTIES(testCorbaPlugin PROPERTIES COMPILE_FLAGS "${OMNIORB_DEFINITIONS}")
127
128   #   # RNV: ${vtkgl2ps_LIBRARIES} was added for Fedora 26 OS    
129   #   TARGET_LINK_LIBRARIES( testParaMEDCorba
130   #     ParaMEDCorbaPlugin
131   #     ${vtkgl2ps_LIBRARIES}
132   #     )
133     
134   #   INSTALL(FILES ParaMEDCorbaServerManager.xml DESTINATION share)
135     
136   
137   # ENDIF( ParaView_FOUND )
138