]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
Cmakization of MED.
authorageay <ageay>
Wed, 21 Mar 2012 13:06:49 +0000 (13:06 +0000)
committerageay <ageay>
Wed, 21 Mar 2012 13:06:49 +0000 (13:06 +0000)
CMakeLists.txt
idl/CMakeLists.txt

index d6c9872bbe75bbc1ae6da74d695f3fbe4a03a19b..497ff948b542af325a8dc2f44055fc4434540492 100644 (file)
@@ -76,6 +76,7 @@ SET(MED_salomebin_BINS bin/salome)
 SET(MED_salomelib_LIBS lib/salome)
 
 SET(MED_salomeidl_IDLS idl/salome)
+SET(KERNEL_salomeidl_IDLS ${MED_salomeidl_IDLS})
 
 SET(MED_salomeinclude_HEADERS include/salome)
 
@@ -88,6 +89,7 @@ SET(MED_salomescript_SCRIPTS bin/salome)
 SET(MED_salomescript_DATA bin/salome)
 
 SET(MED_salomescript_PYTHON bin/salome)
+SET(KERNEL_salomescript_PYTHON ${MED_salomescript_PYTHON})
 
 SET(MED_appliskel_SCRIPTS bin/salome/appliskel)
 
@@ -96,6 +98,7 @@ SET(MED_appliskel_PYTHON bin/salome/appliskel)
 SET(MED_pythondir lib/python${PYTHON_VERSION}/site-packages)
 
 SET(MED_salomepythondir ${MED_pythondir}/salome)
+SET(KERNEL_salomepythondir ${MED_salomepythondir})
 
 SET(MED_sharedpkgpython_PYTHON ${MED_salomepythondir}/shared_modules)
 
index 5832d5dd203c4e36f80fe6fbc3d13fc3db6fbd1a..f16adae804dd9a39b28bef563198e9045ebdb4b0 100644 (file)
 # 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})