From: bruneton Date: Thu, 4 Jul 2013 09:00:24 +0000 (+0000) Subject: CMake: splitting OmniORB and OmniORBPy detection X-Git-Tag: B4KillOfAutomake~23 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=768c906a6cd74a6fe602815fa274cd3099e69eee;p=modules%2Fkernel.git CMake: splitting OmniORB and OmniORBPy detection --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 60ef2c2b4..c0931b869 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,6 +90,7 @@ FIND_PACKAGE(SalomeBoost REQUIRED) IF(NOT SALOME_LIGHT_ONLY) FIND_PACKAGE(SalomeOmniORB REQUIRED) + FIND_PACKAGE(SalomeOmniORBPy REQUIRED) ENDIF() IF(SALOME_USE_MPI) FIND_PACKAGE(SalomeMPI REQUIRED) diff --git a/salome_adm/cmake_files/CMakeLists.txt b/salome_adm/cmake_files/CMakeLists.txt index f94ae3b90..1aa932743 100755 --- a/salome_adm/cmake_files/CMakeLists.txt +++ b/salome_adm/cmake_files/CMakeLists.txt @@ -29,6 +29,7 @@ SET(DATA FindGraphviz.cmake FindSalomeKERNEL.cmake FindOmniORB.cmake + FindOmniORBPy.cmake FindPThread.cmake FindSalomeBoost.cmake FindSalomeCppUnit.cmake @@ -40,6 +41,7 @@ SET(DATA FindSalomeMedfile.cmake FindSalomeMPI.cmake FindSalomeOmniORB.cmake + FindSalomeOmniORBPy.cmake FindSalomePThread.cmake FindSalomePython.cmake FindSalomeSphinx.cmake diff --git a/salome_adm/cmake_files/FindOmniORB.cmake b/salome_adm/cmake_files/FindOmniORB.cmake index a264362cc..501ca5e96 100644 --- a/salome_adm/cmake_files/FindOmniORB.cmake +++ b/salome_adm/cmake_files/FindOmniORB.cmake @@ -95,23 +95,6 @@ ELSE(WIN32) 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 python.py - PATHS "/lib/python${_py_version}/site-packages/omniidl_be" "/usr/lib/omniidl/omniidl_be" - DOC ${_doc}) -ENDIF() - ############################################################################## # Cook our stuff ############################################################################## @@ -119,7 +102,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} @@ -144,12 +127,12 @@ ELSE() 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_IDLPYFLAGS -bpython) +#IF (OMNIORB_PYTHON_BACKEND) + #SET(OMNIORB_IDLPYFLAGS "-p ${OMNIORB_PYTHON_BACKEND} ${OMNIORB_IDLPYFLAGS}") +#ENDIF() SET(IDLCXXFLAGS ${OMNIORB_IDLCXXFLAGS}) -SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) +#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") @@ -165,10 +148,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() diff --git a/salome_adm/cmake_files/FindOmniORBPy.cmake b/salome_adm/cmake_files/FindOmniORBPy.cmake new file mode 100644 index 000000000..7a1c728eb --- /dev/null +++ b/salome_adm/cmake_files/FindOmniORBPy.cmake @@ -0,0 +1,72 @@ +# - Find OmniORB4 Python backend +# +# Sets the following variables: +# OMNIORB_PYTHON_BACKEND - path to the Python backend +# +# Detection is made by looking for +# lib/python${_py_version}/site-packages/omniidl_be/python.py +# + +################################################################ +# Copyright (C) 2007-2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +################################################################ + +############################################################################## +# 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 python.py + PATHS "/lib/python${_py_version}/site-packages/omniidl_be" "/usr/lib/omniidl/omniidl_be" + DOC ${_doc}) +ENDIF() + +############################################################################## +# Cook our stuff +############################################################################## +MARK_AS_ADVANCED(OMNIORB_PYTHON_BACKEND) + +#SET(OMNIORB_IDLCXXFLAGS -Wba -nf) +SET(OMNIORB_IDLPYFLAGS -bpython) +IF (OMNIORB_PYTHON_BACKEND) + SET(OMNIORB_IDLPYFLAGS "-p ${OMNIORB_PYTHON_BACKEND} ${OMNIORB_IDLPYFLAGS}") +ENDIF() +#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__") +#ENDIF() +#IF(APPLE) + #SET(OMNIORB_DEFINITIONS "${OMNIORB_DEFINITIONS} -D__macos__")#for omnithread.h to be checked... +#ENDIF() + +# Handle standard arguments: +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(OmniORBPy REQUIRED_VARS OMNIORB_PYTHON_BACKEND) diff --git a/salome_adm/cmake_files/FindSalomeOmniORB.cmake b/salome_adm/cmake_files/FindSalomeOmniORB.cmake index 3b7d58218..9d8b0661d 100644 --- a/salome_adm/cmake_files/FindSalomeOmniORB.cmake +++ b/salome_adm/cmake_files/FindSalomeOmniORB.cmake @@ -19,7 +19,7 @@ # Author: Adrien Bruneton # -# omniORB detection for SALOME +# omniORB and detection for SALOME # # !! Please read the generic detection procedure in SalomeMacros.cmake !! # diff --git a/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake new file mode 100644 index 000000000..9a6006af5 --- /dev/null +++ b/salome_adm/cmake_files/FindSalomeOmniORBPy.cmake @@ -0,0 +1,41 @@ +# Copyright (C) 2013 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. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# Author: Adrien Bruneton +# + +# omniORB Python backend detection for SALOME +# +# !! Please read the generic detection procedure in SalomeMacros.cmake !! +# + +IF(SalomeOmniORB_FOUND) + # If no OMNIORBPY_ROOT_DIR is given, then try with OMNIORB_ROOT_DIR: + SET(OMNIORBPY_ROOT_DIR "$ENV{OMNIORBPY_ROOT_DIR}" CACHE PATH "Path to the OmniORB Python backend") + IF(EXISTS "${OMNIORB_ROOT_DIR}" AND (NOT OMNIORBPY_ROOT_DIR)) + MESSAGE(STATUS "Looking for OmniORB Python backend in the OmniORB installation (OMNIORB_ROOT_DIR exists and OMNIORBPY_ROOT_DIR_ROOT_DIR is not defined) ...") + SET(OMNIORBPY_ROOT_DIR "${OMNIORB_ROOT_DIR}") + ENDIF() + + SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OmniORBPy OMNIORB_PYTHON_BACKEND 4) + #MARK_AS_ADVANCED() +ELSE() + IF(NOT SalomeOmniORBPy_FIND_QUIETLY) + MESSAGE(STATUS "OmniORB Python backend needs OmniORB, and OmniORB was not found!") + ENDIF() +ENDIF() diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index 78afda0a8..34730369c 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -421,5 +421,7 @@ MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) ELSE() MESSAGE(STATUS "${pkg} was not found.") ENDIF() + + SET(Salome${pkg}_FOUND "${pkg}_FOUND") ENDMACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS)