Salome HOME
Merge remote branch 'origin/V7_8_BR'
[modules/med.git] / src / MEDCalc / cmp / CMakeLists.txt
1 # Copyright (C) 2012-2016  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 ADD_DEFINITIONS(${HDF5_DEFINITIONS} ${MEDFILE_DEFINITIONS} ${OMNIORB_DEFINITIONS})
21
22 INCLUDE_DIRECTORIES(
23   ${OMNIORB_INCLUDE_DIR} ${OMNIORB_INCLUDE_DIRS}
24   ${MEDFILE_INCLUDE_DIRS}
25   ${HDF5_INCLUDE_DIRS}
26   ${PTHREAD_INCLUDE_DIR}
27   ${PYTHON_INCLUDE_DIRS}
28   ${MEDCOUPLING_INCLUDE_DIRS}
29   ${CMAKE_CURRENT_BINARY_DIR}
30   ${CMAKE_CURRENT_SOURCE_DIR}/..
31   ${PROJECT_BINARY_DIR}/idl
32 )
33
34 SET(COMMON_SOURCES
35   MEDCommandsHistoryManager_i.cxx
36   MEDFactoryClient.cxx
37   MEDDataManager_i.cxx
38   MEDCalculator_i.cxx
39   MEDPresentationManager_i.cxx
40   MEDPresentation.cxx
41   # presentations
42   MEDPresentationScalarMap.cxx
43   MEDPresentationContour.cxx
44   MEDPresentationVectorField.cxx
45   MEDPresentationSlices.cxx
46   MEDPresentationDeflectionShape.cxx
47   MEDPresentationPointSprite.cxx
48 )
49
50 SET(MEDFactoryEngine_SOURCES
51   ${COMMON_SOURCES}
52   MEDFactory_i.cxx
53 )
54
55 SET(MEDEngine_SOURCES
56   ${COMMON_SOURCES}
57   MED.cxx
58 )
59
60 SET(COMMON_LIBS
61   ${PLATFORM_LIBRARIES}
62   SalomeIDLMED
63   ${KERNEL_TOOLSDS} ${KERNEL_SalomeDS} ${KERNEL_SalomeHDFPersist} ${KERNEL_SalomeContainer} ${KERNEL_SalomeCommunication}
64   ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeLifeCycleCORBA} ${KERNEL_SALOMELocalTrace} ${KERNEL_SALOMEBasics}
65   ${KERNEL_SalomeGenericObj}
66   ${MEDFILE_C_LIBRARIES}
67   ${HDF5_LIBRARIES}
68   ${OMNIORB_LIBRARIES}
69   ${PYTHON_LIBRARIES}
70   ${MEDCoupling_medcoupling} ${MEDCoupling_medloader} ${MEDCoupling_medcouplingremapper}
71 )
72
73 # This undefines the macros MIN and MAX which are specified in the windows headers
74 IF(WIN32)
75   SET(COMMON_FLAGS "${COMMON_FLAGS} -DNOMINMAX")
76 ENDIF(WIN32)
77
78 ADD_LIBRARY(MEDFactoryEngine SHARED ${MEDFactoryEngine_SOURCES})
79 SET_TARGET_PROPERTIES(MEDFactoryEngine PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
80 TARGET_LINK_LIBRARIES(MEDFactoryEngine ${COMMON_LIBS})
81
82 ADD_LIBRARY(MEDEngine SHARED ${MEDEngine_SOURCES})
83 SET_TARGET_PROPERTIES(MEDEngine PROPERTIES COMPILE_FLAGS "${COMMON_FLAGS}")
84 TARGET_LINK_LIBRARIES(MEDEngine ${COMMON_LIBS})
85
86 #INSTALL(TARGETS MEDFactoryEngine DESTINATION ${SALOME_INSTALL_LIBS})
87 INSTALL(TARGETS MEDFactoryEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
88 INSTALL(TARGETS MEDEngine EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
89
90 FILE(GLOB MEDCALC_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
91 INSTALL(FILES ${MEDCALC_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
92 FILE(GLOB MEDCALC_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
93 INSTALL(FILES ${MEDCALC_HEADERS_HXX} DESTINATION ${SALOME_INSTALL_HEADERS})
94
95 IF(SALOME_ENABLE_PYTHON)
96   INSTALL(FILES test_medcalc_components.py PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ DESTINATION ${SALOME_INSTALL_BINS}/xmed)
97 ENDIF()