1 # Copyright (C) 2010-2012 CEA/DEN, EDF R&D
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.
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.
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
17 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 SET(VERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MAINTENANCE})
21 SET(SOVERSION_INFO ${VERSION_MAJOR}.${VERSION_MINOR})
23 ADD_DEFINITIONS(-DHAVE_SALOME_CONFIG)
24 INCLUDE_DIRECTORIES(${OMNIORB_INCLUDE_DIRS} ${KERNEL_ROOT_DIR}/include/salome ${CMAKE_BINARY_DIR}/idl)
35 PARAVIS_Gen_TypesSK.cc
39 # potential problem on parallel make on the following - multiple outputs
47 FOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES})
48 SET(srcs ${srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f})
49 ENDFOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES})
52 ADD_LIBRARY(SalomeIDLPARAVIS STATIC ${srcs})
54 ADD_LIBRARY(SalomeIDLPARAVIS SHARED ${srcs})
58 FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${OMNIORB_DEFINITIONS} ${KERNEL_CXXFLAGS})
59 SET(flags "${flags} ${f}")
60 ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${OMNIORB_DEFINITIONS} ${KERNEL_CXXFLAGS})
62 SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES COMPILE_FLAGS "${flags}")
63 SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO})
65 TARGET_LINK_LIBRARIES(SalomeIDLPARAVIS ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${OMNIORB_LIBRARIES})
66 INSTALL(TARGETS SalomeIDLPARAVIS DESTINATION lib/salome)
68 ADD_EXECUTABLE(vtkWrapIDL
69 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c
70 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParsePreprocess.c
71 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseHierarchy.c
72 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseExtras.c
73 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseMain.c
74 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseData.c
75 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseString.c
76 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrap.c
77 # ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrapText.c
78 ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c)
80 set_property(SOURCE ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseMain.c PROPERTY COMPILE_DEFINITIONS
81 VTK_PARSE_VERSION="${VTK_MAJOR_VERSION}.${VTK_MINOR_VERSION}")
83 ADD_DEPENDENCIES(vtkWrapIDL generate_txt)
85 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/ParaView)
87 FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES})
88 SET(flags "${flags} ${f}")
89 ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES})
92 #IF(VTK_LEGACY_REMOVE)
93 # ADD_DEFINITIONS(-DVTK_PARSE_LEGACY_REMOVE)
95 SET_TARGET_PROPERTIES(vtkWrapIDL PROPERTIES COMPILE_FLAGS "${flags}")
97 TARGET_LINK_LIBRARIES(vtkWrapIDL ${PLATFORM_LDFLAGS} ${PLATFORM_LIBADD})
98 SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL)
100 IF(CMAKE_BUILD_TOOL STREQUAL nmake)
101 SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL.exe)
102 ELSE(CMAKE_BUILD_TOOL STREQUAL nmake)
103 SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL.exe)
104 ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake)
106 INSTALL(FILES ${vtkWrapIDL_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
108 FOREACH(input ${BASEIDL_FILES} ${WRAP_IDL})
109 STRING(REGEX REPLACE ".idl" "" base ${input})
110 SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc)
112 SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc)
113 SET(outputs ${outputs} ${dynsrc})
114 SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
115 SET(outputs ${outputs} ${inc})
116 LIST(FIND BASEIDL_FILES ${input} BASE_INDEX)
117 IF(${BASE_INDEX} EQUAL -1)
118 SET(input ${CMAKE_CURRENT_BINARY_DIR}/${input})
119 ELSE(${BASE_INDEX} EQUAL -1)
120 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
121 ENDIF(${BASE_INDEX} EQUAL -1)
124 COMMAND ${OMNIORB_IDL_PYTHON} -bcxx ${IDLCXXFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome ${OMNIORB_IDLCXXFLAGS} ${input}
125 MAIN_DEPENDENCY ${input}
127 INSTALL(FILES ${input} DESTINATION idl/salome)
129 SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
130 INSTALL(FILES ${IDL_HEADER} DESTINATION include/salome)
131 INSTALL(CODE "SET(IDL_FILE ${input})")
132 INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION}/site-packages/salome)")
133 INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})")
134 INSTALL(CODE "SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_PYTHON})")
135 INSTALL(CODE "SET(IDLPYFLAGS -bpythonIDL -p${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome)")
136 INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/deprecated/install_python_from_idl.cmake)
138 ENDFOREACH(input ${IDL_FILES})