# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+
+
+INCLUDE(${KERNEL_ROOT_DIR}/salome_adm/cmake_files/UseOMNIORB.cmake)
+
INCLUDE_DIRECTORIES(
${OMNIORB_INCLUDES_DIR}
- $ENV{KERNEL_ROOT_DIR}/include/salome
+ ${KERNEL_ROOT_DIR}/include/salome
${CMAKE_CURRENT_BINARY_DIR}
)
-SET(IDL_FILES
+SET(SalomeIDLMED_IDLSOURCES
MED.idl
MED_Gen.idl
Compo1Py.idl
MEDCouplingCorbaServant.idl
- MEDCouplingCorbaServantTest.idl
ParaMEDCouplingCorbaServant.idl
)
-SET(IDLCXXFLAGS -I${CMAKE_CURRENT_SOURCE_DIR} -I$ENV{KERNEL_ROOT_DIR}/idl/salome)
-
-MACRO( CompileIDLPythonAndInstall OMNIORB_IDL_PYTHON IDLPYFLAGS IDL_FILE FULLDIR )
- FILE(MAKE_DIRECTORY ${FULLDIR})
- STRING(REPLACE " " ";" IDLPYFLAGS2 ${IDLPYFLAGS})
- MESSAGE(STATUS "Compiling ${IDL_FILE} into ${FULLDIR}")
- EXECUTE_PROCESS(COMMAND ${OMNIORB_IDL_PYTHON} ${IDLPYFLAGS2} -C${FULLDIR} ${IDL_FILE})
-ENDMACRO( CompileIDLPythonAndInstall )
-
-INSTALL(CODE "MACRO( CompileIDLPythonAndInstall OMNIORB_IDL_PYTHON IDLPYFLAGS IDL_FILE FULLDIR )
- FILE(MAKE_DIRECTORY \${FULLDIR})
- STRING(REPLACE \" \" \";\" IDLPYFLAGS2 \${IDLPYFLAGS})
- MESSAGE(STATUS \"Compiling \${IDL_FILE} into \${FULLDIR}\")
- EXECUTE_PROCESS(COMMAND \${OMNIORB_IDL_PYTHON} \${IDLPYFLAGS2} -C\${FULLDIR} \${IDL_FILE})
-ENDMACRO( CompileIDLPythonAndInstall )")
-
-FOREACH(input ${IDL_FILES})
- STRING(REGEX REPLACE ".idl" "" base ${input})
- SET(src ${CMAKE_CURRENT_BINARY_DIR}/${base}SK.cc)
- SET(outputs ${src})
- SET(dynsrc ${CMAKE_CURRENT_BINARY_DIR}/${base}DynSK.cc)
- SET(outputs ${outputs} ${dynsrc})
- SET(inc ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
- SET(outputs ${outputs} ${inc})
- SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
- SET(flags ${IDLCXXFLAGS} ${OMNIORB_IDLCXXFLAGS})
- STRING(REGEX MATCH "-bcxx" ISBCXX ${flags})
- IF(NOT ISBCXX)
- SET(flags -bcxx ${flags})
- ENDIF(NOT ISBCXX)
- ADD_CUSTOM_COMMAND(OUTPUT ${outputs}
- COMMAND ${OMNIORB_IDL} ${flags} ${input}
- MAIN_DEPENDENCY ${input})
-
- INSTALL(FILES ${input} DESTINATION idl/salome)
- SET(IDL_HEADER ${CMAKE_CURRENT_BINARY_DIR}/${base}.hh)
- INSTALL(FILES ${IDL_HEADER} DESTINATION include/salome)
- INSTALL(CODE "SET(IDL_FILE ${input})")
- INSTALL(CODE "SET(DIR ${salomepythondir})")
- IF(WINDOWS)
- INSTALL(CODE "SET(DIR bin/salome)")
- ENDIF(WINDOWS)
- INSTALL(CODE "SET(CMAKE_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})")
- INSTALL(CODE "SET(OMNIORB_IDL_PYTHON ${OMNIORB_IDL_PYTHON})")
- SET(flags)
- FOREACH(f ${IDLCXXFLAGS})
- SET(flags "${flags} ${f}")
- ENDFOREACH(f ${IDLCXXFLAGS})
- STRING(REGEX MATCH "-bpython" ISBPYTHON ${flags})
- IF(NOT ISBPYTHON)
- SET(flags "-bpython ${flags}")
- ENDIF(NOT ISBPYTHON)
- SET(IDLPYFLAGS ${flags})
- STRING(REPLACE "\\" "/" IDLPYFLAGS ${IDLPYFLAGS})
- INSTALL(CODE "SET(IDLPYFLAGS ${IDLPYFLAGS})")
- STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
- INSTALL(CODE "CompileIDLPythonAndInstall( \"${OMNIORB_IDL_PYTHON}\" \"${IDLPYFLAGS}\" \"${input}\" \"${CMAKE_INSTALL_PREFIX}/${MED_salomepythondir}\" )")
-ENDFOREACH(input ${IDL_FILES})
+SET(SalomeIDLMEDTests_IDLSOURCES
+ MEDCouplingCorbaServantTest.idl
+ )
-SET(SalomeIDLMED_SOURCES
- MEDSK.cc
- MED_GenSK.cc
- MEDCouplingCorbaServantSK.cc
- Compo1PySK.cc
- ParaMEDCouplingCorbaServantSK.cc
+SET(IDL_INCLUDE_DIRS
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${KERNEL_ROOT_DIR}/idl/salome
)
-ADD_LIBRARY(SalomeIDLMED SHARED ${SalomeIDLMED_SOURCES})
+OMNIORB_ADD_MODULE(SalomeIDLMED "${SalomeIDLMED_IDLSOURCES}" "${IDL_INCLUDE_DIRS}")
TARGET_LINK_LIBRARIES(SalomeIDLMED ${CORBA_LIBS} ${KERNEL_LDFLAGS} ${SalomeIDLKernel})
SET_TARGET_PROPERTIES(SalomeIDLMED PROPERTIES COMPILE_FLAGS "${OMNIORB_FLAGS}")
-SET(SalomeIDLMEDTests_SOURCES
- MEDCouplingCorbaServantTestSK.cc
-)
-
-ADD_LIBRARY(SalomeIDLMEDTests SHARED ${SalomeIDLMEDTests_SOURCES})
+OMNIORB_ADD_MODULE(SalomeIDLMEDTests "${SalomeIDLMEDTests_IDLSOURCES}" "${IDL_INCLUDE_DIRS}")
TARGET_LINK_LIBRARIES(SalomeIDLMEDTests ${CORBA_LIBS} ${KERNEL_LDFLAGS} ${SalomeIDLKernel})
SET_TARGET_PROPERTIES(SalomeIDLMEDTests PROPERTIES COMPILE_FLAGS "${OMNIORB_FLAGS}")
-
-#INSTALL(TARGETS medcoupling DESTINATION ${MED_salomelib_LIBS})
-
-#FILE(GLOB medcoupling_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx")
-#FILE(GLOB medcoupling_HEADERS_TXX "${CMAKE_CURRENT_SOURCE_DIR}/*.txx")
-#INSTALL(FILES ${medcoupling_HEADERS_HXX} ${medcoupling_HEADERS_TXX} DESTINATION ${MED_salomeinclude_HEADERS})