X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=salome_adm%2Fcmake_files%2FFindOmniORB.cmake;h=0bdb3040277f3cfca25c51c1fcf52808e2d5fc62;hb=63414a08d9492c25c206579c1953ec6f390679fd;hp=e43909d2ee819877013cd497785675cdc2f88c86;hpb=017e69c8531a6a8d2b0d696848a209ce73e15cbf;p=modules%2Fkernel.git diff --git a/salome_adm/cmake_files/FindOmniORB.cmake b/salome_adm/cmake_files/FindOmniORB.cmake index e43909d2e..0bdb30402 100644 --- a/salome_adm/cmake_files/FindOmniORB.cmake +++ b/salome_adm/cmake_files/FindOmniORB.cmake @@ -7,7 +7,7 @@ # OMNIORB_VERSION - OmniORB4 version # OMNIORB_IDL_COMPILER - OmniORB4 idl compiler command (omniidl) # OMNIORB_NAMESERVER - OmniORB4 CORBA naming service (omniNames) -# OMNIORB_PYTHON_BACKEND +# OMNIORB_PYTHONPATH - path to the OmniORB Python modules # and many other mainly used in UseOmniORB.cmake # # Detection is made through calls to @@ -18,12 +18,12 @@ # ################################################################ -# Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -36,11 +36,10 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -################################################################ # minimum OmniORB4 supported version # 4.0.6 has known bug float/double marshalling using CORBA::Any -set(OMNIORB_MINIMUM_VERSION "4.1.2") +SET(OmniORB_MINIMUM_VERSION "4.1.2") IF(WIN32) # Guide the FIND_LIBRARY command towards the correct directory <...>/lib/x86_win32: @@ -55,13 +54,23 @@ FIND_PATH(OMNIORB_INCLUDE_DIR omniORB4/CORBA.h) ############################################################################## # find libraries ############################################################################## + +# Win release / debug specific stuff: +IF (WIN32) + IF(CMAKE_BUILD_TYPE STREQUAL Debug) + SET(OMNIORB_RD_SUFFIX d) + ELSE() + SET(OMNIORB_RD_SUFFIX) + ENDIF() +ENDIF() + IF (WIN32) FIND_LIBRARY(OMNIORB_LIBRARY_omniORB4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniORB4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) FIND_LIBRARY( OMNIORB_LIBRARY_omnithread - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omnithread_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) FIND_LIBRARY( OMNIORB_LIBRARY_omniDynamic4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}omniDynamic4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) ELSE (WIN32) FIND_LIBRARY(OMNIORB_LIBRARY_omniORB4 NAMES omniORB4) FIND_LIBRARY(OMNIORB_LIBRARY_omnithread NAMES omnithread) @@ -72,9 +81,9 @@ ENDIF (WIN32) IF (WIN32) FIND_LIBRARY( OMNIORB_LIBRARY_COS4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COS4${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COS4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) FIND_LIBRARY( OMNIORB_LIBRARY_COSDynamic4 - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4${CMAKE_STATIC_LIBRARY_SUFFIX}) + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}COSDynamic4_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) ELSE (WIN32) FIND_LIBRARY(OMNIORB_LIBRARY_COS4 NAMES COS4) FIND_LIBRARY(OMNIORB_LIBRARY_COSDynamic4 NAMES COSDynamic4) @@ -85,33 +94,18 @@ ENDIF (WIN32) ############################################################################## IF (WIN32) FIND_PROGRAM( OMNIORB_IDL_COMPILER - NAMES omniidl PATHS bin/x86_win32 + NAMES omniidl + PATH_SUFFIXES x86_win32 DOC "What is the path where omniidl (the idl compiler) can be found") FIND_PROGRAM( OMNIORB_OMNINAMES_COMMAND - NAMES omniNames PATHS bin/x86_win32 + NAMES omniNames + PATH_SUFFIXES x86_win32 DOC "What is the path where omniNames (the ORB server) can be found") ELSE(WIN32) FIND_PROGRAM(OMNIORB_IDL_COMPILER NAMES omniidl) FIND_PROGRAM(OMNIORB_NAMESERVER NAMES omniNames) ENDIF (WIN32) -############################################################################## -# find python back-end -############################################################################## - -SET(_py_version "${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") -SET(CMAKE_FIND_ROOT_PATH ${CMAKE_PREFIX_PATH}) -SET(_doc "Path to python-backend directory (omniidl_be) including python.py file") -IF(WIN32) - FIND_PATH(OMNIORB_PYTHON_BACKEND - NAMES python.py PATHS "/lib/python/omniidl_be" DOC ${_doc}) -ELSE() - FIND_PATH(OMNIORB_PYTHON_BACKEND - NAMES __init__.py - PATHS "/lib/python${_py_version}/site-packages/omniidl_be" "/usr/lib/omniidl/omniidl_be" - DOC ${_doc}) -ENDIF() - ############################################################################## # Cook our stuff ############################################################################## @@ -119,7 +113,7 @@ ENDIF() MARK_AS_ADVANCED(OMNIORB_DIR OMNIORB_INCLUDE_DIR) MARK_AS_ADVANCED(OMNIORB_LIBRARY_omniORB4 OMNIORB_LIBRARY_omnithread OMNIORB_LIBRARY_omniDynamic4) MARK_AS_ADVANCED(OMNIORB_IDL_COMPILER OMNIORB_NAMESERVER OMNIORB_VERSION) -MARK_AS_ADVANCED(OMNIORB_LIBRARY_COS4 OMNIORB_LIBRARY_COSDynamic4 OMNIORB_PYTHON_BACKEND) +MARK_AS_ADVANCED(OMNIORB_LIBRARY_COS4 OMNIORB_LIBRARY_COSDynamic4) SET(OMNIORB_LIBRARIES ${OMNIORB_LIBRARY_omniORB4} @@ -133,6 +127,10 @@ IF(OMNIORB_LIBRARY_COSDynamic4) LIST(APPEND OMNIORB_LIBRARIES ${OMNIORB_LIBRARY_COSDynamic4}) ENDIF() +# Set path to the OmniORB Python modules +GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${OMNIORB_LIBRARIES}" PATH) +SET(OMNIORB_PYTHONPATH "${_tmp_ROOT_DIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") + # Optionaly, extract the the version number from the acconfig.h file: # The version check is done at the very bottom of this file. IF( EXISTS ${OMNIORB_INCLUDE_DIR}/omniORB4/acconfig.h ) @@ -143,18 +141,15 @@ ELSE() SET( OMNIORB_VERSION "NOT-FOUND" ) ENDIF( EXISTS ${OMNIORB_INCLUDE_DIR}/omniORB4/acconfig.h ) -SET(OMNIORB_IDLCXXFLAGS -Wba -nf) -SET(OMNIORB_IDLPYFLAGS -bpython) -IF (OMNIORB_PYTHON_BACKEND) - SET(OMNIORB_IDLPYFLAGS "-p ${OMNIORB_PYTHON_BACKEND} ${OMNIORB_IDLPYFLAGS}") -ENDIF() +SET(OMNIORB_IDLCXXFLAGS -bcxx -Wba -nf) SET(IDLCXXFLAGS ${OMNIORB_IDLCXXFLAGS}) -SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) SET(IDL_CLN_H .hh) SET(IDL_SRV_H .hh) SET(OMNIORB_DEFINITIONS "-D__x86__ -DCOMP_CORBA_DOUBLE -DCOMP_CORBA_LONG") IF(WIN32) - SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__WIN32__") + ## OmniORB isn`t defines SIZEOF_LONG and SIZEOF_INT on WIN32 platform + ## Note SIZE_OF_LONG calculates in the SalomeSetupPlatform.cmake + SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__WIN32__ -DSIZEOF_INT=4 -DSIZEOF_LONG=${SIZE_OF_LONG}") ENDIF() IF(APPLE) SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__macos__")#for omnithread.h to be checked... @@ -165,10 +160,10 @@ INCLUDE(FindPackageHandleStandardArgs) IF(OMNIORB_VERSION) FIND_PACKAGE_HANDLE_STANDARD_ARGS(OmniORB REQUIRED_VARS OMNIORB_INCLUDE_DIR OMNIORB_LIBRARY_omniORB4 OMNIORB_LIBRARY_omnithread - OMNIORB_LIBRARY_omniDynamic4 OMNIORB_IDL_COMPILER OMNIORB_PYTHON_BACKEND + OMNIORB_LIBRARY_omniDynamic4 OMNIORB_IDL_COMPILER VERSION_VAR OMNIORB_VERSION ) ELSE() FIND_PACKAGE_HANDLE_STANDARD_ARGS(OmniORB REQUIRED_VARS OMNIORB_INCLUDE_DIR OMNIORB_LIBRARY_omniORB4 OMNIORB_LIBRARY_omnithread - OMNIORB_LIBRARY_omniDynamic4 OMNIORB_IDL_COMPILER OMNIORB_PYTHON_BACKEND) + OMNIORB_LIBRARY_omniDynamic4 OMNIORB_IDL_COMPILER) ENDIF()