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(${KERNEL_ROOT_DIR}/include/salome ${CMAKE_BINARY_DIR}/idl)
26 #INCLUDE(vtkWrapHierarchy.cmake)
27 #SET(VTK_WRAP_HIERARCHY_EXE vtkWrapHierarchy)
38 PARAVIS_Gen_TypesSK.cc
42 # potential problem on parallel make on the following - multiple outputs
50 FOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES})
51 SET(srcs ${srcs} ${CMAKE_CURRENT_BINARY_DIR}/${f})
52 ENDFOREACH(f ${BASEIDL_SK_FILES} ${WRAP_SK_FILES})
55 ADD_LIBRARY(SalomeIDLPARAVIS STATIC ${srcs})
57 ADD_LIBRARY(SalomeIDLPARAVIS SHARED ${srcs})
61 FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${CORBA_INCLUDES} ${CORBA_CXXFLAGS} ${KERNEL_CXXFLAGS})
62 SET(flags "${flags} ${f}")
63 ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${CORBA_INCLUDES} ${CORBA_CXXFLAGS} ${KERNEL_CXXFLAGS})
65 SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES COMPILE_FLAGS "${flags}")
66 SET_TARGET_PROPERTIES(SalomeIDLPARAVIS PROPERTIES VERSION ${VERSION_INFO} SOVERSION ${SOVERSION_INFO})
68 TARGET_LINK_LIBRARIES(SalomeIDLPARAVIS ${PLATFORM_LIBADD} ${PLATFORM_LDFLAGS} ${CORBA_LIBS})
69 INSTALL(TARGETS SalomeIDLPARAVIS DESTINATION lib/salome)
71 ADD_EXECUTABLE(vtkWrapIDL
72 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParse.tab.c
73 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParsePreprocess.c
74 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseHierarchy.c
75 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseExtras.c
76 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkParseMain.c
77 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrap.c
78 ${CMAKE_SOURCE_DIR}/src/ParaView/vtkWrapText.c
79 ${CMAKE_CURRENT_SOURCE_DIR}/vtkWrapIDL.c)
81 ADD_DEPENDENCIES(vtkWrapIDL generate_txt)
83 INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/ParaView)
85 FOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES})
86 SET(flags "${flags} ${f}")
87 ENDFOREACH(f ${PLATFORM_CPPFLAGS} ${PTHREAD_CFLAGS} ${PARAVIEW_INCLUDES} ${VTK_INCLUDES})
89 SET_TARGET_PROPERTIES(vtkWrapIDL PROPERTIES COMPILE_FLAGS "${flags}")
91 TARGET_LINK_LIBRARIES(vtkWrapIDL ${PLATFORM_LDFLAGS} ${PLATFORM_LIBADD})
92 SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL)
94 IF(CMAKE_BUILD_TOOL STREQUAL nmake)
95 SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/vtkWrapIDL.exe)
96 ELSE(CMAKE_BUILD_TOOL STREQUAL nmake)
97 SET(vtkWrapIDL_EXEFILE ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/vtkWrapIDL.exe)
98 ENDIF(CMAKE_BUILD_TOOL STREQUAL nmake)
100 INSTALL(FILES ${vtkWrapIDL_EXEFILE} DESTINATION bin/salome PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
102 FOREACH(input ${BASEIDL_FILES} ${WRAP_IDL})
103 STRING(REGEX REPLACE ".idl" "" base ${input})
104 SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc)
106 SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc)
107 SET(outputs ${outputs} ${dynsrc})
108 SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
109 SET(outputs ${outputs} ${inc})
110 LIST(FIND BASEIDL_FILES ${input} BASE_INDEX)
111 IF(${BASE_INDEX} EQUAL -1)
112 SET(input ${CMAKE_CURRENT_BINARY_DIR}/${input})
113 ELSE(${BASE_INDEX} EQUAL -1)
114 SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
115 ENDIF(${BASE_INDEX} EQUAL -1)
118 COMMAND ${OMNIORB_IDL} -bcxx ${IDLCXXFLAGS} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome ${OMNIORB_IDLCXXFLAGS} ${input}
119 MAIN_DEPENDENCY ${input}
121 INSTALL(FILES ${input} DESTINATION idl/salome)
123 SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
124 INSTALL(FILES ${IDL_HEADER} DESTINATION include/salome)
125 INSTALL(CODE "SET(IDL_FILE ${input})")
126 INSTALL(CODE "SET(DIR lib/python${PYTHON_VERSION}/site-packages/salome)")
127 INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})")
128 INSTALL(CODE "SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_PYTHON})")
129 INSTALL(CODE "SET(IDLPYFLAGS -bpythonIDL -p${CMAKE_CURRENT_SOURCE_DIR} -I${CMAKE_CURRENT_SOURCE_DIR} -I${KERNEL_ROOT_DIR}/idl/salome)")
130 INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_python_from_idl.cmake)
132 ENDFOREACH(input ${IDL_FILES})