From: abn Date: Tue, 5 Jul 2016 08:28:45 +0000 (+0200) Subject: Moving *all* CMake detection files to common CONFIGURATION repo. X-Git-Tag: V8_1_0b1~1^2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=291ceeb6e63a94943b25e3b31aac144c521117d0;p=modules%2Fyacs.git Moving *all* CMake detection files to common CONFIGURATION repo. --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 68603fd0a..c4b8e697c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,6 +36,16 @@ SET(${PROJECT_NAME_UC}_VERSION ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION}) SET(${PROJECT_NAME_UC}_VERSION_DEV 1) +# Common CMake macros +# =================== +SET(CONFIGURATION_ROOT_DIR $ENV{CONFIGURATION_ROOT_DIR} CACHE PATH "Path to the Salome CMake configuration files") +IF(EXISTS ${CONFIGURATION_ROOT_DIR}) + LIST(APPEND CMAKE_MODULE_PATH "${CONFIGURATION_ROOT_DIR}/cmake") + INCLUDE(SalomeMacros) +ELSE() + MESSAGE(FATAL_ERROR "We absolutely need the Salome CMake configuration files, please define CONFIGURATION_ROOT_DIR !") +ENDIF() + # Find KERNEL (optional) # ============== OPTION(SALOME_YACS_USE_KERNEL "Use SALOME KERNEL" ON) @@ -43,7 +53,6 @@ IF( SALOME_YACS_USE_KERNEL ) SET(KERNEL_ROOT_DIR $ENV{KERNEL_ROOT_DIR} CACHE PATH "Path to the Salome KERNEL") IF( EXISTS ${KERNEL_ROOT_DIR} ) LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files") - INCLUDE(SalomeMacros) FIND_PACKAGE(SalomeKERNEL REQUIRED) KERNEL_WITH_CORBA() # check whether KERNEL builded with CORBA ADD_DEFINITIONS(${KERNEL_DEFINITIONS} -DSALOME_KERNEL) diff --git a/adm/CMakeLists.txt b/adm/CMakeLists.txt index 40503601c..4c4bfeea5 100644 --- a/adm/CMakeLists.txt +++ b/adm/CMakeLists.txt @@ -18,4 +18,3 @@ # ADD_SUBDIRECTORY(unix) -ADD_SUBDIRECTORY(cmake) diff --git a/adm/cmake/CMakeLists.txt b/adm/cmake/CMakeLists.txt deleted file mode 100644 index 40bd199d3..000000000 --- a/adm/cmake/CMakeLists.txt +++ /dev/null @@ -1,57 +0,0 @@ -# Copyright (C) 2012-2016 CEA/DEN, EDF R&D -# -# 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, 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 -# 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 -# - -# =============================================================== -# Files to be installed -# =============================================================== - -# These files are data, module or lib files -SET(_adm_data - FindQScintilla.cmake - FindSalomeQScintilla.cmake - FindSphinx.cmake - FindSalomeSphinx.cmake - FindYACS.cmake - FindSalomeYACS.cmake -) -IF(NOT SALOME_YACS_USE_KERNEL) - LIST(APPEND _adm_data - FindGraphviz.cmake - FindSalomeGraphviz.cmake - FindCppUnit.cmake - FindOmniORB.cmake - FindOmniORBPy.cmake - FindPThread.cmake - FindSalomeBoost.cmake - FindSalomeCppUnit.cmake - FindSalomeDoxygen.cmake - FindSalomeLibXml2.cmake - FindSalomeOmniORB.cmake - FindSalomeOmniORBPy.cmake - FindSalomePThread.cmake - FindSalomePythonLibs.cmake - FindSalomePythonInterp.cmake - FindSalomeNumPySciPy.cmake - FindSalomeSWIG.cmake - SalomeMacros.cmake - SalomeSetupPlatform.cmake - UseOmniORB.cmake - ) -ENDIF(NOT SALOME_YACS_USE_KERNEL) -INSTALL(FILES ${_adm_data} DESTINATION ${SALOME_INSTALL_CMAKE_LOCAL}) diff --git a/adm/cmake/FindCppUnit.cmake b/adm/cmake/FindCppUnit.cmake deleted file mode 100644 index d5796b936..000000000 --- a/adm/cmake/FindCppUnit.cmake +++ /dev/null @@ -1,97 +0,0 @@ -# - Find CppUnit -# Sets the following variables: -# CPPUNIT_INCLUDE_DIRS - path to the CppUnit include directory -# CPPUNIT_LIBRARIES - path to the CppUnit libraries to be linked against -# CPPUNIT_DEFINITIONS - specific CppUnit definitions to be added -# -# The header cppunit/extensions/HelperMacros.h is looked for. -# The following libraries are searched -# cppunit_dll, or cppunitd_dll (Windows) -# cppunit (Linux) -# - -######################################################################### -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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, 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 -# 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 -# - -IF(NOT CppUnit_FIND_QUIETLY) - MESSAGE(STATUS "Looking for CppUnit ...") -ENDIF() - -# Headers -SET(CPPUNIT_ROOT_DIR $ENV{CPPUNIT_ROOT_DIR} CACHE PATH "Path to the CPPUNIT.") -IF(CPPUNIT_ROOT_DIR) - LIST(APPEND CMAKE_INCLUDE_PATH "${CPPUNIT_ROOT_DIR}/include") - LIST(APPEND CMAKE_PROGRAM_PATH "${CPPUNIT_ROOT_DIR}/bin") -ENDIF(CPPUNIT_ROOT_DIR) - -SET(CPPUNIT_INCLUDE_TO_FIND cppunit/extensions/HelperMacros.h) -FIND_PATH(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_TO_FIND}) - -# Libraries -IF(WIN32) - IF(CMAKE_BUILD_TYPE STREQUAL Debug) - FIND_LIBRARY(CPPUNIT_LIBRARIES cppunitd_dll) - ELSE(CMAKE_BUILD_TYPE STREQUAL Debug) - FIND_LIBRARY(CPPUNIT_LIBRARIES cppunit_dll) - ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug) -ELSE(WIN32) - FIND_PROGRAM(CPPUNIT_CONFIG_BIN cppunit-config) - IF(NOT CPPUNIT_CONFIG_BIN) - MESSAGE(FATAL_ERROR "Error in CPPUNIT detection ! cppunit-config executable not found !") - ENDIF(NOT CPPUNIT_CONFIG_BIN) - EXECUTE_PROCESS(COMMAND ${CPPUNIT_CONFIG_BIN} --libs OUTPUT_VARIABLE CPPUNIT_LDFLAGS) - STRING(STRIP ${CPPUNIT_LDFLAGS} CPPUNIT_LDFLAGS) - STRING(REPLACE " " ";" LDFLAGS_LIST ${CPPUNIT_LDFLAGS}) - FOREACH(LDFLAG ${LDFLAGS_LIST}) - STRING(REGEX MATCH "^-L.*" LIBDIR "${LDFLAG}") - STRING(REGEX MATCH "^-l.*" LIB "${LDFLAG}") - IF(LIBDIR) - STRING(REGEX REPLACE "^-L" "" LIBDIR ${LIBDIR}) - LIST(APPEND CMAKE_LIBRARY_PATH ${LIBDIR}) - ELSEIF(LIB) - STRING(REGEX REPLACE "^-l" "" LIB ${LIB}) - LIST(APPEND LIBS ${LIB}) - ELSE() - MESSAGE(FATAL_ERROR "Unrecognized token \"${LDFLAG}\" in the output of cppunit-config --libs") - ENDIF() - ENDFOREACH(LDFLAG ${LDFLAGS_LIST}) - FOREACH(LIB ${LIBS}) - FIND_LIBRARY(CPPUNIT_SUBLIB_${LIB} ${LIB}) - IF(NOT CPPUNIT_SUBLIB_${LIB}) - MESSAGE(FATAL_ERROR "Error in CPPUNIT detection! Fail to locate the needed library ${LIB}!") - ENDIF(NOT CPPUNIT_SUBLIB_${LIB}) - LIST(APPEND CPPUNIT_LIBRARIES ${CPPUNIT_SUBLIB_${LIB}}) - ENDFOREACH(LIB ${LIBS}) -# MESSAGE("**** ${CPPUNIT_LIBRARIES}") -ENDIF(WIN32) - -# Global variables -SET(CPPUNIT_DEFINITIONS) -IF(WIN32) - SET(CPPUNIT_DEFINITIONS -DCPPUNIT_DLL) -ENDIF(WIN32) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppUnit REQUIRED_VARS CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES) - - diff --git a/adm/cmake/FindGraphviz.cmake b/adm/cmake/FindGraphviz.cmake deleted file mode 100644 index cc3de0deb..000000000 --- a/adm/cmake/FindGraphviz.cmake +++ /dev/null @@ -1,79 +0,0 @@ -# - Graphviz detection -# -# Output variables: GRAPHVIZ_EXECUTABLE - where is executable 'dot' takes place. -# GRAPHVIZ_INCLUDE_DIRS - where to find headers. -# GRAPHVIZ_LIBRARIES - where to get libraries. -# GRAPHVIZ_VERSION - Graphviz version -# GRAPHVIZ_DEFINITIONS - Graphviz definitions -# GRAPHVIZ_FOUND - True if Graphviz was found. -# -########################################################################### -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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, 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 -# 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_PROGRAM(GRAPHVIZ_EXECUTABLE dot) - -FIND_PATH(GRAPHVIZ_INCLUDE_DIR NAMES graphviz/cgraph.h) -SET(GRAPHVIZ_INCLUDE_DIRS ${GRAPHVIZ_INCLUDE_DIR} ${GRAPHVIZ_INCLUDE_DIR}/graphviz) - -IF(GRAPHVIZ_EXECUTABLE) - IF(NOT CMAKE_PREFIX_PATH) # Case where dot is in the path and -DGRAPHVIZ_ROOT_DIR not defined. - GET_FILENAME_COMPONENT(GRAPHVIZ_EXECUTABLE_DIR ${GRAPHVIZ_EXECUTABLE} PATH) - GET_FILENAME_COMPONENT(GRAPHVIZ_EXECUTABLE_DIR ${GRAPHVIZ_EXECUTABLE_DIR} PATH) - SET(CMAKE_PREFIX_PATH "${GRAPHVIZ_EXECUTABLE_DIR}") - ENDIF(NOT CMAKE_PREFIX_PATH) -ENDIF(GRAPHVIZ_EXECUTABLE) - -FIND_LIBRARY(GRAPHVIZ_cdt_LIBRARY NAMES cdt PATH_SUFFIXES bin) -FIND_LIBRARY(GRAPHVIZ_graph_LIBRARY NAMES cgraph PATH_SUFFIXES bin) -FIND_LIBRARY(GRAPHVIZ_gvc_LIBRARY NAMES gvc PATH_SUFFIXES bin) -FIND_LIBRARY(GRAPHVIZ_pathplan_LIBRARY NAMES pathplan PATH_SUFFIXES bin) - -SET(GRAPHVIZ_LIBRARIES - ${GRAPHVIZ_cdt_LIBRARY} - ${GRAPHVIZ_graph_LIBRARY} - ${GRAPHVIZ_gvc_LIBRARY} - ${GRAPHVIZ_pathplan_LIBRARY} - ) - -IF(GRAPHVIZ_EXECUTABLE) - EXECUTE_PROCESS(COMMAND ${GRAPHVIZ_EXECUTABLE} "-V" ERROR_VARIABLE GRAPHVIZ_VERSION ERROR_STRIP_TRAILING_WHITESPACE) - STRING(REGEX REPLACE ".* ([0-9.]+) .*" "\\1" GRAPHVIZ_VERSION "${GRAPHVIZ_VERSION}") -ENDIF() - -SET(GRAPHVIZ_DEFINITIONS) -IF("${GRAPHVIZ_VERSION}" VERSION_LESS "2.36.0") - SET(GRAPHVIZ_DEFINITIONS -DWITH_CGRAPH) -ENDIF() - -## Don't detect cgraph on Windows -#IF(NOT WIN32) -# FIND_LIBRARY(GRAPHVIZ_cgraph_LIBRARY NAMES cgraph PATH_SUFFIXES bin) -# SET(GRAPHVIZ_LIBRARIES ${GRAPHVIZ_cgraph_LIBRARY}) -#ENDIF() - -# Handle the standard arguments of the find_package() command: -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Graphviz REQUIRED_VARS - GRAPHVIZ_EXECUTABLE - GRAPHVIZ_LIBRARIES - GRAPHVIZ_INCLUDE_DIRS) diff --git a/adm/cmake/FindOmniORB.cmake b/adm/cmake/FindOmniORB.cmake deleted file mode 100644 index 23ebc1baf..000000000 --- a/adm/cmake/FindOmniORB.cmake +++ /dev/null @@ -1,169 +0,0 @@ -# - Find OmniORB4 cmake module and Pyhon backends -# -# Sets the following variables: -# OMNIORB_FOUND - TRUE if OmniORB4 installation has been found -# OMNIORB_INCLUDE_DIR - OmniORB4 headers path -# OMNIORB_LIBRARIES - OmniORB4 libraries -# OMNIORB_VERSION - OmniORB4 version -# OMNIORB_IDL_COMPILER - OmniORB4 idl compiler command (omniidl) -# OMNIORB_NAMESERVER - OmniORB4 CORBA naming service (omniNames) -# OMNIORB_PYTHONPATH - path to the OmniORB Python modules -# and many other mainly used in UseOmniORB.cmake -# -# Detection is made through calls to -# find_library, find_program, find_path -# and can be guided by extending CMAKE_PREFIX_PATH. Given the CMake precedence -# rule this will take precedence over the standard system paths. -# See for example doc of find_library(). -# - -################################################################ -# Copyright (C) 2007-2016 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, 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 -# 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 -# - -# minimum OmniORB4 supported version -# 4.0.6 has known bug float/double marshalling using CORBA::Any -SET(OmniORB_MINIMUM_VERSION "4.1.2") - -IF(WIN32) - # Guide the FIND_LIBRARY command towards the correct directory <...>/lib/x86_win32: - SET(CMAKE_LIBRARY_ARCHITECTURE x86_win32) -ENDIF() - -############################################################################## -# find headers -############################################################################## -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_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) - FIND_LIBRARY( OMNIORB_LIBRARY_omnithread - 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_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -ELSE (WIN32) - FIND_LIBRARY(OMNIORB_LIBRARY_omniORB4 NAMES omniORB4) - FIND_LIBRARY(OMNIORB_LIBRARY_omnithread NAMES omnithread) - FIND_LIBRARY(OMNIORB_LIBRARY_omniDynamic4 NAMES omniDynamic4) -ENDIF (WIN32) - -# Optional libraries - -IF (WIN32) - FIND_LIBRARY( OMNIORB_LIBRARY_COS4 - 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_rt${OMNIORB_RD_SUFFIX}${CMAKE_STATIC_LIBRARY_SUFFIX}) -ELSE (WIN32) - FIND_LIBRARY(OMNIORB_LIBRARY_COS4 NAMES COS4) - FIND_LIBRARY(OMNIORB_LIBRARY_COSDynamic4 NAMES COSDynamic4) -ENDIF (WIN32) - -############################################################################## -# find command line tools -############################################################################## -IF (WIN32) - FIND_PROGRAM( OMNIORB_IDL_COMPILER - 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 - 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) - -############################################################################## -# Cook our stuff -############################################################################## - -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) - -SET(OMNIORB_LIBRARIES - ${OMNIORB_LIBRARY_omniORB4} - ${OMNIORB_LIBRARY_omnithread} - ${OMNIORB_LIBRARY_omniDynamic4}) - -IF(OMNIORB_LIBRARY_COS4) - LIST(APPEND OMNIORB_LIBRARIES ${OMNIORB_LIBRARY_COS4}) -ENDIF() -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 ) - FILE( READ ${OMNIORB_INCLUDE_DIR}/omniORB4/acconfig.h OMNIORB_ACCONFIG_H ) - STRING( REGEX MATCH "#define[\t ]+PACKAGE_VERSION[\t ]+\"([0-9]+.[0-9]+.[0-9]+)\"" OMNIORB_ACCONFIG_H "${OMNIORB_ACCONFIG_H}" ) - STRING( REGEX REPLACE ".*\"([0-9]+.[0-9]+.[0-9]+)\".*" "\\1" OMNIORB_VERSION "${OMNIORB_ACCONFIG_H}" ) -ELSE() - SET( OMNIORB_VERSION "NOT-FOUND" ) -ENDIF( EXISTS ${OMNIORB_INCLUDE_DIR}/omniORB4/acconfig.h ) - -SET(OMNIORB_IDLCXXFLAGS -bcxx -Wba -nf) -SET(IDLCXXFLAGS ${OMNIORB_IDLCXXFLAGS}) -SET(IDL_CLN_H .hh) -SET(IDL_SRV_H .hh) -SET(OMNIORB_DEFINITIONS "-D__x86__ -DCOMP_CORBA_DOUBLE -DCOMP_CORBA_LONG") -IF(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... -ENDIF() - -# Handle standard arguments: -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 - 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) -ENDIF() diff --git a/adm/cmake/FindOmniORBPy.cmake b/adm/cmake/FindOmniORBPy.cmake deleted file mode 100644 index b1c4e6dcc..000000000 --- a/adm/cmake/FindOmniORBPy.cmake +++ /dev/null @@ -1,57 +0,0 @@ -# - Find OmniORB4 Python backend -# -# Sets the following variables: -# OMNIORB_PYTHON_BACKEND - path to the Python backend -# OMNIORBPY_PYTHONPATH - Python path to the OmniORB modules -# -# Detection is made by looking for -# lib/python${_py_version}/site-packages/omniidl_be/python.py -# - -################################################################ -# Copyright (C) 2007-2016 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, 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 -# 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}") -FIND_PATH(OMNIORB_PYTHON_BACKEND - NAMES python.py - PATHS "${OMNIORBPY_ROOT_DIR}" "/usr" - PATH_SUFFIXES "/lib/python${_py_version}/site-packages/omniidl_be" "/lib/omniidl/omniidl_be" "/lib/python/omniidl_be" - DOC "Path to python-backend directory (omniidl_be) including python.py file") - -############################################################################## -# Cook our stuff -############################################################################## -MARK_AS_ADVANCED(OMNIORB_PYTHON_BACKEND) - -SET(OMNIORB_IDLPYFLAGS) -IF (OMNIORB_PYTHON_BACKEND) - LIST(APPEND OMNIORB_IDLPYFLAGS -bpython -p${OMNIORB_PYTHON_BACKEND}) -ENDIF() -SET(IDLPYFLAGS ${OMNIORB_IDLPYFLAGS}) - -GET_FILENAME_COMPONENT(OMNIORBPY_PYTHONPATH "${OMNIORB_PYTHON_BACKEND}" PATH) - -# Handle standard arguments: -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(OmniORBPy REQUIRED_VARS OMNIORB_PYTHON_BACKEND) diff --git a/adm/cmake/FindPThread.cmake b/adm/cmake/FindPThread.cmake deleted file mode 100644 index f06e86561..000000000 --- a/adm/cmake/FindPThread.cmake +++ /dev/null @@ -1,67 +0,0 @@ -# - Find PThread -# This module finds an installed PThread using the variable PTHREAD_ROOT_DIR -# as a lookup path. -# It sets the following variables: -# PTHREAD_FOUND - set to true if PThread is found -# PTHREAD_INCLUDE_DIR - the directory where the include files are located -# PTHREAD_LIBRARIES - the path to PThread library -# -# The file "pthread.h" is looked for PTHREAD_INCLUDE_DIR. -# Libraries are searched with following names: -# pthread -# On Win32: -# pthreadVC2 -# or in Debug mode: -# pthreadVC2d -# - - -############################################################# -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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, 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 -# 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 -# - -IF(NOT PThread_FIND_QUIETLY) - MESSAGE(STATUS "Looking for PThread...") -ENDIF () - -IF(WIN32) - SET(PTHREADS_INCLUDE_TO_FIND pthread.h) - FIND_PATH(PTHREAD_INCLUDE_DIR ${PTHREADS_INCLUDE_TO_FIND}) - # Default build type is assumed to be Release: - IF(NOT CMAKE_BUILD_TYPE STREQUAL Debug) - FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVC2) - ELSE() - FIND_LIBRARY(PTHREAD_LIBRARIES pthreadVC2d) - ENDIF() -ELSE(WIN32) - FIND_PATH(PTHREAD_INCLUDE_DIR pthread.h) - FIND_LIBRARY(PTHREAD_LIBRARIES NAMES pthread) -ENDIF(WIN32) - -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PThread REQUIRED_VARS PTHREAD_INCLUDE_DIR PTHREAD_LIBRARIES) - -IF(PTHREAD_FOUND) - IF(NOT PThread_FIND_QUIETLY) - MESSAGE(STATUS "PThread library: ${PTHREAD_LIBRARIES}") - ENDIF() -ENDIF() diff --git a/adm/cmake/FindQScintilla.cmake b/adm/cmake/FindQScintilla.cmake deleted file mode 100644 index ee814eca7..000000000 --- a/adm/cmake/FindQScintilla.cmake +++ /dev/null @@ -1,116 +0,0 @@ -# QScintilla is a port to Qt of Neil Hodgson's Scintilla C++ editor control -# available at http://www.riverbankcomputing.com/software/qscintilla/ -# -# The module defines the following variables: -# QSCINTILLA_FOUND - the system has QScintilla -# QSCINTILLA_INCLUDE_DIR - where to find Qsci/qsciscintilla.h -# QSCINTILLA_INCLUDE_DIRS - qwt includes -# QSCINTILLA_LIBRARY - where to find the QScintilla library -# QSCINTILLA_LIBRARIES - aditional libraries -# QSCINTILLA_MAJOR_VERSION - major version -# QSCINTILLA_MINOR_VERSION - minor version -# QSCINTILLA_PATCH_VERSION - patch version -# QSCINTILLA_VERSION_STRING - version (ex. 2.6.2) -# QSCINTILLA_ROOT_DIR - root dir (ex. /usr/local) - -#============================================================================= -# Copyright 2010-2013, Julien Schueller -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this -# list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright notice, -# this list of conditions and the following disclaimer in the documentation -# and/or other materials provided with the distribution. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -# The views and conclusions contained in the software and documentation are those -# of the authors and should not be interpreted as representing official policies, -# either expressed or implied, of the FreeBSD Project. -#============================================================================= - - -find_path ( QSCINTILLA_INCLUDE_DIR - NAMES Qsci/qsciscintilla.h - HINTS ${QT_INCLUDE_DIR} -) - -set ( QSCINTILLA_INCLUDE_DIRS ${QSCINTILLA_INCLUDE_DIR} ${QSCINTILLA_INCLUDE_DIR}/Qsci ) - -# version -set ( _VERSION_FILE ${QSCINTILLA_INCLUDE_DIR}/Qsci/qsciglobal.h ) -if ( EXISTS ${_VERSION_FILE} ) - file ( STRINGS ${_VERSION_FILE} _VERSION_LINE REGEX "define[ ]+QSCINTILLA_VERSION_STR" ) - if ( _VERSION_LINE ) - string ( REGEX REPLACE ".*define[ ]+QSCINTILLA_VERSION_STR[ ]+\"(.*)\".*" "\\1" QSCINTILLA_VERSION_STRING "${_VERSION_LINE}" ) - string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\1" QSCINTILLA_MAJOR_VERSION "${QSCINTILLA_VERSION_STRING}" ) - string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\2" QSCINTILLA_MINOR_VERSION "${QSCINTILLA_VERSION_STRING}" ) - string ( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9]+)" "\\3" QSCINTILLA_PATCH_VERSION "${QSCINTILLA_VERSION_STRING}" ) - endif () -endif () - - -# check version -set ( _QSCINTILLA_VERSION_MATCH TRUE ) -if ( QScintilla_FIND_VERSION AND QSCINTILLA_VERSION_STRING ) - if ( QScintilla_FIND_VERSION_EXACT ) - if ( NOT QScintilla_FIND_VERSION VERSION_EQUAL QSCINTILLA_VERSION_STRING ) - set ( _QSCINTILLA_VERSION_MATCH FALSE ) - endif () - else () - if ( QSCINTILLA_VERSION_STRING VERSION_LESS QScintilla_FIND_VERSION ) - set ( _QSCINTILLA_VERSION_MATCH FALSE ) - endif () - endif () -endif () - - -find_library ( QSCINTILLA_LIBRARY - NAMES qscintilla qscintilla2 libqscintilla2 - HINTS ${QT_LIBRARY_DIR} -) - -set ( QSCINTILLA_LIBRARIES ${QSCINTILLA_LIBRARY} ) - - -# try to guess root dir from include dir -if ( QSCINTILLA_INCLUDE_DIR ) - string ( REGEX REPLACE "(.*)/include.*" "\\1" QSCINTILLA_ROOT_DIR ${QSCINTILLA_INCLUDE_DIR} ) -# try to guess root dir from library dir -elseif ( QSCINTILLA_LIBRARY ) - string ( REGEX REPLACE "(.*)/lib[/|32|64].*" "\\1" QSCINTILLA_ROOT_DIR ${QSCINTILLA_LIBRARY} ) -endif () - - -# handle the QUIETLY and REQUIRED arguments -include ( FindPackageHandleStandardArgs ) -if ( CMAKE_VERSION LESS 2.8.3 ) - find_package_handle_standard_args( QScintilla DEFAULT_MSG QSCINTILLA_LIBRARY QSCINTILLA_INCLUDE_DIR _QSCINTILLA_VERSION_MATCH ) -else () - find_package_handle_standard_args( QScintilla REQUIRED_VARS QSCINTILLA_LIBRARY QSCINTILLA_INCLUDE_DIR _QSCINTILLA_VERSION_MATCH VERSION_VAR QSCINTILLA_VERSION_STRING ) -endif () - -mark_as_advanced ( - QSCINTILLA_LIBRARY - QSCINTILLA_LIBRARIES - QSCINTILLA_INCLUDE_DIR - QSCINTILLA_INCLUDE_DIRS - QSCINTILLA_MAJOR_VERSION - QSCINTILLA_MINOR_VERSION - QSCINTILLA_PATCH_VERSION - QSCINTILLA_VERSION_STRING - QSCINTILLA_ROOT_DIR -) diff --git a/adm/cmake/FindSalomeBoost.cmake b/adm/cmake/FindSalomeBoost.cmake deleted file mode 100644 index 82a1dce94..000000000 --- a/adm/cmake/FindSalomeBoost.cmake +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# Boost detection dor Salome -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -SET(Boost_USE_STATIC_LIBS OFF) -SET(Boost_USE_MULTITHREADED ON) -SET(Boost_USE_STATIC_RUNTIME OFF) -SET(Boost_NO_BOOST_CMAKE ON) -SET(SalomeBoost_FIND_COMPONENTS filesystem regex signals system thread date_time chrono) - -IF(WIN32) - # Under windows, one extra sub-directory in the boost installation hierarchy: - SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Boost Boost_INCLUDE_DIRS 2) -ELSE() - SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Boost Boost_INCLUDE_DIRS 1) -ENDIF() -IF(Boost_FOUND OR BOOST_FOUND) - MESSAGE(STATUS "Boost include dirs is: ${Boost_INCLUDE_DIRS}") -ENDIF() -#MARK_AS_ADVANCED() - -## Specific definitions: -IF(WIN32) - SET(BOOST_DEFINITIONS -DBOOST_DISABLE_ASSERTS -DBOOST_ALL_DYN_LINK) -ENDIF() - -IF(Boost_FOUND OR BOOST_FOUND) - SALOME_ACCUMULATE_HEADERS(Boost_INCLUDE_DIRS) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${Boost_LIBRARIES}) -ENDIF() \ No newline at end of file diff --git a/adm/cmake/FindSalomeCppUnit.cmake b/adm/cmake/FindSalomeCppUnit.cmake deleted file mode 100644 index 1b6283a6c..000000000 --- a/adm/cmake/FindSalomeCppUnit.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# CppUnit detection for Salome -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# - -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(CppUnit CPPUNIT_INCLUDE_DIRS 1) -MARK_AS_ADVANCED(CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES CPPUNIT_CONFIG_BIN CPPUNIT_SUBLIB_cppunit CPPUNIT_SUBLIB_dl) - -IF(CPPUNIT_FOUND) - SALOME_ACCUMULATE_HEADERS(CPPUNIT_INCLUDE_DIRS) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${CPPUNIT_LIBRARIES}) -ENDIF() diff --git a/adm/cmake/FindSalomeDoxygen.cmake b/adm/cmake/FindSalomeDoxygen.cmake deleted file mode 100644 index 53ce831ac..000000000 --- a/adm/cmake/FindSalomeDoxygen.cmake +++ /dev/null @@ -1,44 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# Doxygen detection for salome -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -# Additional variables: -# -# DOXYGEN_SUPPORT_STL (string) [advanced] : set to YES if doxygen properly manages STL files -# or to NO otherwise (version 1.4.4 or older); see description of -# BUILTIN_STL_SUPPORT configuration variable in the doxygen documentation - -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Doxygen DOXYGEN_EXECUTABLE 2) -IF(DOXYGEN_FOUND) - IF(DOXYGEN_VERSION VERSION_LESS "1.4.5") - SET(DOXYGEN_SUPPORT_STL NO) - ELSE() - SET(DOXYGEN_SUPPORT_STL YES) - ENDIF() -ENDIF() -MARK_AS_ADVANCED(DOXYGEN_SUPPORT_STL) - -IF(DOXYGEN_FOUND) - SALOME_ACCUMULATE_ENVIRONMENT(PATH ${DOXYGEN_EXECUTABLE}) -ENDIF() diff --git a/adm/cmake/FindSalomeGraphviz.cmake b/adm/cmake/FindSalomeGraphviz.cmake deleted file mode 100644 index 157c24fb7..000000000 --- a/adm/cmake/FindSalomeGraphviz.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# Graphviz detection for salome -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# - -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Graphviz GRAPHVIZ_EXECUTABLE 2) -MARK_AS_ADVANCED(GRAPHVIZ_EXECUTABLE GRAPHVIZ_LIBRARIES GRAPHVIZ_INCLUDE_DIRS) - -IF(GRAPHVIZ_FOUND) - SALOME_ACCUMULATE_ENVIRONMENT(PATH ${GRAPHVIZ_EXECUTABLE}) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${GRAPHVIZ_LIBRARIES}) -ENDIF() \ No newline at end of file diff --git a/adm/cmake/FindSalomeLibXml2.cmake b/adm/cmake/FindSalomeLibXml2.cmake deleted file mode 100644 index 515032f1c..000000000 --- a/adm/cmake/FindSalomeLibXml2.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# LibXml2 detection for SALOME -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -IF(WIN32) - SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 1) -ELSE() - SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(LibXml2 LIBXML2_INCLUDE_DIR 2) -ENDIF() -#MARK_AS_ADVANCED() - -IF(LIBXML2_FOUND) - SALOME_ACCUMULATE_HEADERS(LIBXML2_INCLUDE_DIR) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${LIBXML2_LIBRARIES}) -ENDIF() diff --git a/adm/cmake/FindSalomeNumPySciPy.cmake b/adm/cmake/FindSalomeNumPySciPy.cmake deleted file mode 100644 index 34d662406..000000000 --- a/adm/cmake/FindSalomeNumPySciPy.cmake +++ /dev/null @@ -1,52 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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: Roman NIKOLAEV -# -# Looking for an installation of NumPy and SciPy, and if found the following variables are set -# NUMPY_INCLUDE_DIR - NumPy header location -# NUMPY_DEFINITIONS - NumPy compiler flags -# SCIPY_DEFINITIONS - SciPy compiler flags -# SCIPY_VERSION - SciPy version -# - -IF(SALOMEPYTHONINTERP_FOUND) - # Numpy - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy ; import sys ; sys.stdout.write(numpy.get_include())" OUTPUT_VARIABLE NUMPY_INCLUDE_DIR ERROR_QUIET ) - IF(NUMPY_INCLUDE_DIR) - SET(NUMPY_FOUND TRUE) - ENDIF(NUMPY_INCLUDE_DIR) - IF(NUMPY_FOUND) - SET(NUMPY_DEFINITIONS -DWITH_NUMPY) - MESSAGE(STATUS "NumPy found : ${NUMPY_INCLUDE_DIR}") - ELSE(NUMPY_FOUND) - MESSAGE(STATUS "NumPy not found.") - ENDIF(NUMPY_FOUND) - - # SciPy detection - EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import scipy ; import sys ; sys.stdout.write(scipy.version.version)" OUTPUT_VARIABLE SCIPY_VERSION ERROR_QUIET ) - IF(SCIPY_VERSION) - SET(SCIPY_FOUND TRUE) - ENDIF(SCIPY_VERSION) - IF(SCIPY_FOUND) - MESSAGE(STATUS "Scipy found : Version ${SCIPY_VERSION}") - SET(SCIPY_DEFINITIONS -DWITH_SCIPY) - ELSE(SCIPY_FOUND) - MESSAGE(STATUS "SciPy not found.") - ENDIF(SCIPY_FOUND) -ENDIF() \ No newline at end of file diff --git a/adm/cmake/FindSalomeOmniORB.cmake b/adm/cmake/FindSalomeOmniORB.cmake deleted file mode 100644 index 88baba219..000000000 --- a/adm/cmake/FindSalomeOmniORB.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 and detection for SALOME -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OmniORB OMNIORB_INCLUDE_DIR 1) -#MARK_AS_ADVANCED() - -IF(OMNIORB_FOUND) - SALOME_ACCUMULATE_HEADERS(OMNIORB_INCLUDE_DIR) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OMNIORB_LIBRARIES}) - SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${OMNIORB_LIBRARIES} - ${OMNIORB_PYTHONPATH}) -ENDIF() \ No newline at end of file diff --git a/adm/cmake/FindSalomeOmniORBPy.cmake b/adm/cmake/FindSalomeOmniORBPy.cmake deleted file mode 100644 index 881d10b2c..000000000 --- a/adm/cmake/FindSalomeOmniORBPy.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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: - - IF(NOT OMNIORBPY_ROOT_DIR_EXP) - 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 is not defined) ...") - SET(OMNIORBPY_ROOT_DIR "${OMNIORB_ROOT_DIR}") - ENDIF() - ENDIF() - - IF(WIN32) - SET(DIR_COUNT 3) - ELSE(WIN32) - SET(DIR_COUNT 4) - ENDIF(WIN32) - - SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OmniORBPy OMNIORB_PYTHON_BACKEND ${DIR_COUNT}) - #MARK_AS_ADVANCED() -ELSE() - IF(NOT SalomeOmniORBPy_FIND_QUIETLY) - MESSAGE(STATUS "OmniORB Python backend needs OmniORB, and OmniORB was not found!") - ENDIF() -ENDIF() - -IF(OMNIORBPY_FOUND) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${OMNIORBPY_LIBRARIES}) - SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${OMNIORBPY_LIBRARIES} - ${OMNIORBPY_PYTHONPATH}) -ENDIF() diff --git a/adm/cmake/FindSalomePThread.cmake b/adm/cmake/FindSalomePThread.cmake deleted file mode 100644 index 2caf0d4f7..000000000 --- a/adm/cmake/FindSalomePThread.cmake +++ /dev/null @@ -1,33 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# PThread detection for SALOME -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PThread PTHREAD_INCLUDE_DIR 1) -MARK_AS_ADVANCED(PTHREAD_LIBRARIES PTHREAD_INCLUDE_DIR) - -IF(SALOMEPTHREAD_FOUND) - SALOME_ACCUMULATE_HEADERS(PTHREAD_INCLUDE_DIR) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PTHREAD_LIBRARIES}) -ENDIF() - diff --git a/adm/cmake/FindSalomePythonInterp.cmake b/adm/cmake/FindSalomePythonInterp.cmake deleted file mode 100644 index 23f229d23..000000000 --- a/adm/cmake/FindSalomePythonInterp.cmake +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# Python interpreter detection for SALOME -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# - -# Make sure the detection of both libs and interpreter (if both needed) occur in the correct order: -IF(SALOMEPYTHONLIBS_FOUND AND NOT SALOMEPYTHONINTERP_FOUND) - MESSAGE(FATAL_ERROR "Developer error -> Python interpreter should be detected/required before Python libs!") -ENDIF() - -# Use the PYTHON_ROOT_DIR if PYTHONINTERP_ROOT_DIR is not defined: -SET(PYTHON_ROOT_DIR "$ENV{PYTHON_ROOT_DIR}" CACHE PATH "Path to the Python installation (libs+interpreter)") -IF(EXISTS "${PYTHON_ROOT_DIR}" AND (NOT PYTHONINTERP_ROOT_DIR)) - # Extract sub-directory "paraview-x.xx": - MESSAGE(STATUS "Setting PYTHONINTERP_ROOT_DIR to: ${PYTHON_ROOT_DIR}") - SET(PYTHONINTERP_ROOT_DIR "${PYTHON_ROOT_DIR}" CACHE PATH "Path to PythonInterp directory") -ENDIF() -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PythonInterp PYTHON_EXECUTABLE 1) - -IF(SALOMEPYTHONINTERP_FOUND) - SET(PYTHON_PYTHONPATH "${PYTHON_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}") - GET_FILENAME_COMPONENT(_python_bin "${PYTHON_EXECUTABLE}" NAME ) - SET(PYTHONBIN "${_python_bin}" CACHE STRING "Name of Python interpreter") - SALOME_ACCUMULATE_ENVIRONMENT(PATH ${PYTHON_EXECUTABLE}) - SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${PYTHON_PYTHONPATH}) -ENDIF() - diff --git a/adm/cmake/FindSalomePythonLibs.cmake b/adm/cmake/FindSalomePythonLibs.cmake deleted file mode 100644 index 36473f2a2..000000000 --- a/adm/cmake/FindSalomePythonLibs.cmake +++ /dev/null @@ -1,56 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# Python libraries detection for SALOME -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# - -# Use the PYTHON_ROOT_DIR if PYTHONLIBS_ROOT_DIR is not defined: -SET(PYTHON_ROOT_DIR "$ENV{PYTHON_ROOT_DIR}" CACHE PATH "Path to the Python installation (libs+interpreter)") -IF(EXISTS "${PYTHON_ROOT_DIR}" AND (NOT PYTHONLIBS_ROOT_DIR)) - MESSAGE(STATUS "Setting PYTHONLIBS_ROOT_DIR to: ${PYTHON_ROOT_DIR}") - SET(PYTHONLIBS_ROOT_DIR "${PYTHON_ROOT_DIR}" CACHE PATH "Path to PythonLibs directory") -ENDIF() -IF (SALOMEPYTHONINTERP_FOUND AND NOT "${PYTHON_VERSION_STRING}" STREQUAL "") - # Trying to search libraries with same version as an interpreter version - SET(PythonLibs_FIND_VERSION ${PYTHON_VERSION_STRING}) - SET(PythonLibs_FIND_VERSION_MAJOR ${PYTHON_VERSION_MAJOR}) -ENDIF() -IF(WIN32) - set(CMAKE_LIBRARY_PATH "${PYTHON_ROOT_DIR}/libs") -ENDIF() -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(PythonLibs PYTHON_INCLUDE_DIR 2) - -IF(SALOMEPYTHONLIBS_FOUND) - SALOME_ACCUMULATE_HEADERS(PYTHON_INCLUDE_DIR) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${PYTHON_LIBRARIES}) -ENDIF() - -## Specifics -- check matching version with Interpreter if already detected: -IF (SALOMEPYTHONLIBS_FOUND AND SALOMEPYTHONINTERP_FOUND) - # Now ensure versions are matching - IF("${PYTHONLIBS_VERSION_STRING}" STREQUAL "${PYTHON_VERSION_STRING}") - MESSAGE(STATUS "Python libs and interpreter versions are matching: ${PYTHONLIBS_VERSION_STRING}") - ELSE() - MESSAGE(FATAL_ERROR "Python libs and interpreter versions are NOT matching: ${PYTHONLIBS_VERSION_STRING} vs ${PYTHON_VERSION_STRING}") - ENDIF() -ENDIF() diff --git a/adm/cmake/FindSalomeQScintilla.cmake b/adm/cmake/FindSalomeQScintilla.cmake deleted file mode 100644 index 639b13b65..000000000 --- a/adm/cmake/FindSalomeQScintilla.cmake +++ /dev/null @@ -1,32 +0,0 @@ -# Copyright (C) 2013-2016 CEA/DEN, EDF R&D -# -# 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, 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 -# 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 -# - -# QScintilla detection for Salome -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(QScintilla QSCINTILLA_ROOT_DIR 0) -# IF(QScintilla_FOUND OR QSCINTILLA_FOUND) -# MESSAGE(STATUS "QScintilla include dir is: ${QSCINTILLA_INCLUDE_DIRS}") -# ENDIF() - -IF(QSCINTILLA_FOUND) - SALOME_ACCUMULATE_HEADERS(QSCINTILLA_INCLUDE_DIRS) - SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH ${QSCINTILLA_LIBRARIES}) -ENDIF() \ No newline at end of file diff --git a/adm/cmake/FindSalomeSWIG.cmake b/adm/cmake/FindSalomeSWIG.cmake deleted file mode 100644 index dac53f3cd..000000000 --- a/adm/cmake/FindSalomeSWIG.cmake +++ /dev/null @@ -1,31 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# SWIG detection for SALOME -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2) -MARK_AS_ADVANCED(SWIG_EXECUTABLE SWIG_VERSION) - -IF(SWIG_FOUND) - SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SWIG_EXECUTABLE}) -ENDIF() diff --git a/adm/cmake/FindSalomeSphinx.cmake b/adm/cmake/FindSalomeSphinx.cmake deleted file mode 100644 index 31e9a609e..000000000 --- a/adm/cmake/FindSalomeSphinx.cmake +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (C) 2013-2016 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, 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 -# 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 -# - -# Sphinx detection for Salome -# -# !! Please read the generic detection procedure in SalomeMacros.cmake !! -# - -SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(Sphinx SPHINX_EXECUTABLE 2) - -# Also retrieve paths to DOCUTILS and SETUPTOOLS: -SET(SETUPTOOLS_ROOT_DIR "$ENV{SETUPTOOLS_ROOT_DIR}" CACHE PATH "Path to the Setuptools installation") -SET(DOCUTILS_ROOT_DIR "$ENV{DOCUTILS_ROOT_DIR}" CACHE PATH "Path to the Docutils installation") - -# Ensure the command is run with the given PYTHONPATH -IF(WIN32 AND NOT CYGWIN) - SET(SPHINX_EXECUTABLE ${SPHINX_EXECUTABLE}) - SET(SPHINX_APIDOC_EXECUTABLE ${SPHINX_APIDOC_EXECUTABLE}) -ELSE() - SET(SPHINX_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$$PYTHONPATH" ${SPHINX_EXECUTABLE}) - SET(SPHINX_APIDOC_EXECUTABLE /usr/bin/env PYTHONPATH="${SPHINX_PYTHONPATH}:$$PYTHONPATH" ${SPHINX_APIDOC_EXECUTABLE}) -ENDIF() - -MARK_AS_ADVANCED(SPHINX_EXECUTABLE) - -IF(SPHINX_FOUND) - SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_EXECUTABLE}) - SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SPHINX_APIDOC_EXECUTABLE}) - SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH ${SPHINX_PYTHONPATH}) -ENDIF() diff --git a/adm/cmake/FindSalomeYACS.cmake b/adm/cmake/FindSalomeYACS.cmake deleted file mode 100644 index e97e32ad9..000000000 --- a/adm/cmake/FindSalomeYACS.cmake +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (C) 2013-2016 CEA/DEN, EDF R&D -# -# 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, 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 -# 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 -# - -IF(NOT SalomeYACS_FIND_QUIETLY) - MESSAGE(STATUS "Looking for Salome YACS ...") -ENDIF() - -SET(CMAKE_PREFIX_PATH "${YACS_ROOT_DIR}") - -SALOME_FIND_PACKAGE(SalomeYACS SalomeYACS CONFIG) - -IF(NOT SalomeYACS_FIND_QUIETLY) - MESSAGE(STATUS "Found Salome YACS: ${YACS_ROOT_DIR}") -ENDIF() - -FOREACH(_res ${SalomeYACS_EXTRA_ENV}) - SALOME_ACCUMULATE_ENVIRONMENT(${_res} "${SalomeYACS_EXTRA_ENV_${_res}}") -ENDFOREACH() \ No newline at end of file diff --git a/adm/cmake/FindSphinx.cmake b/adm/cmake/FindSphinx.cmake deleted file mode 100644 index 26aa3f0b5..000000000 --- a/adm/cmake/FindSphinx.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# - Sphinx detection -# -# Output variables: -# SPHINX_EXECUTABLE - path to the Sphinx executable -# SPHINX_PYTHONPATH - path to the Sphinx Python modules -# -########################################################################### -# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE -# -# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -# -# 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, 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 -# 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_PROGRAM(SPHINX_EXECUTABLE sphinx-build PATH_SUFFIXES Scripts) -FIND_PROGRAM(SPHINX_APIDOC_EXECUTABLE sphinx-apidoc PATH_SUFFIXES Scripts) - -# Get root dir locally, going up two levels from the exec: -GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${SPHINX_EXECUTABLE}" PATH) -GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH) -IF(WIN32) - SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/site-packages") -ELSE() - SET(SPHINX_PYTHONPATH "${_tmp_ROOT_DIR}/lib/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/site-packages") -ENDIF() - -# Handle the standard arguments of the find_package() command: -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Sphinx REQUIRED_VARS SPHINX_EXECUTABLE SPHINX_APIDOC_EXECUTABLE) - -IF(SPHINX_EXECUTABLE) - EXECUTE_PROCESS(COMMAND ${SPHINX_EXECUTABLE} "--version" OUTPUT_VARIABLE SPHINX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) - STRING(REGEX REPLACE ".* ([0-9.]+)$" "\\1" SPHINX_VERSION "${SPHINX_VERSION}" ) - MESSAGE(STATUS "Sphinx version is ${SPHINX_VERSION}") - IF(SPHINX_VERSION VERSION_LESS "1.3") - SET(SPHINX_THEME "default") - ELSE() - SET(SPHINX_THEME "classic") - ENDIF() -ENDIF(SPHINX_EXECUTABLE) diff --git a/adm/cmake/FindYACS.cmake b/adm/cmake/FindYACS.cmake deleted file mode 100644 index cd0081c6c..000000000 --- a/adm/cmake/FindYACS.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2013-2016 CEA/DEN, EDF R&D -# -# 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, 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 -# 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 -# - -SET(YACS_CXXFLAGS -I${YACS_ROOT_DIR}/include/salome) # to be removed -SET(YACS_INCLUDE_DIRS ${YACS_ROOT_DIR}/include/salome) - -FIND_LIBRARY(YACS_YACSloader YACSloader ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_YACSBases YACSBases ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_YACSlibEngine YACSlibEngine ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_YACSRuntimeSALOME YACSRuntimeSALOME ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_YACSDLTest YACSDLTest ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_SalomeIDLYACS SalomeIDLYACS ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_TestComponentLocal TestComponentLocal ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_PluginSimplex PluginSimplex ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_PluginOptEvTest1 PluginOptEvTest1 ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_HMI HMI ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_GenericGui GenericGui ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_YACS YACS ${YACS_ROOT_DIR}/lib/salome) -FIND_LIBRARY(YACS_SalomeWrap SalomeWrap ${YACS_ROOT_DIR}/lib/salome) diff --git a/adm/cmake/SalomeMacros.cmake b/adm/cmake/SalomeMacros.cmake deleted file mode 100644 index 258173142..000000000 --- a/adm/cmake/SalomeMacros.cmake +++ /dev/null @@ -1,957 +0,0 @@ -# Copyright (C) 2012-2016 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, 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 -# 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: A.Geay, V. Sandler, A. Bruneton -# - -#---------------------------------------------------------------------------- -# LIST_CONTAINS is a macro useful for determining whether a list has a -# particular entry -#---------------------------------------------------------------------------- -MACRO(LIST_CONTAINS var value) - SET(${var}) - FOREACH(value2 ${ARGN}) - IF(${value} STREQUAL "${value2}") - SET(${var} TRUE) - ENDIF (${value} STREQUAL "${value2}") - ENDFOREACH (value2) -ENDMACRO(LIST_CONTAINS) - -#---------------------------------------------------------------------------- -# The PARSE_ARGUMENTS macro will take the arguments of another macro and -# define several variables. -# -# USAGE: PARSE_ARGUMENTS(prefix arg_names options arg1 arg2...) -# -# ARGUMENTS: -# -# prefix: IN: a prefix to put on all variables it creates. -# -# arg_names: IN: a list of names. -# For each item in arg_names, PARSE_ARGUMENTS will create a -# variable with that name, prefixed with prefix_. Each variable will be filled -# with the arguments that occur after the given arg_name is encountered -# up to the next arg_name or the end of the arguments. All options are -# removed from these lists. PARSE_ARGUMENTS also creates a -# prefix_DEFAULT_ARGS variable containing the list of all arguments up -# to the first arg_name encountered. -# -# options: IN: a list of options. -# For each item in options, PARSE_ARGUMENTS will create a -# variable with that name, prefixed with prefix_. So, for example, if prefix is -# MY_MACRO and options is OPTION1;OPTION2, then PARSE_ARGUMENTS will -# create the variables MY_MACRO_OPTION1 and MY_MACRO_OPTION2. These -# variables will be set to true if the option exists in the command line -# or false otherwise. -# arg_names and options lists should be quoted. -# -# The rest of PARSE_ARGUMENTS are arguments from another macro to be parsed. -#---------------------------------------------------------------------------- -MACRO(PARSE_ARGUMENTS prefix arg_names option_names) - SET(DEFAULT_ARGS) - FOREACH(arg_name ${arg_names}) - SET(${prefix}_${arg_name}) - ENDFOREACH(arg_name) - FOREACH(option ${option_names}) - SET(${prefix}_${option} FALSE) - ENDFOREACH(option) - SET(current_arg_name DEFAULT_ARGS) - SET(current_arg_list) - FOREACH(arg ${ARGN}) - LIST_CONTAINS(is_arg_name ${arg} ${arg_names}) - IF (is_arg_name) - SET(${prefix}_${current_arg_name} ${current_arg_list}) - SET(current_arg_name ${arg}) - SET(current_arg_list) - ELSE (is_arg_name) - LIST_CONTAINS(is_option ${arg} ${option_names}) - IF (is_option) - SET(${prefix}_${arg} TRUE) - ELSE (is_option) - SET(current_arg_list ${current_arg_list} ${arg}) - ENDIF (is_option) - ENDIF (is_arg_name) - ENDFOREACH(arg) - SET(${prefix}_${current_arg_name} ${current_arg_list}) -ENDMACRO(PARSE_ARGUMENTS) - -#---------------------------------------------------------------------------- -# SALOME_INSTALL_SCRIPTS is a macro useful for installing scripts. -# -# USAGE: SALOME_INSTALL_SCRIPTS(file_list path [WORKING_DIRECTORY dir] [DEF_PERMS]) -# -# ARGUMENTS: -# file_list: IN : list of files to be installed. This list should be quoted. -# path: IN : full pathname for installing. -# -# By default files to be installed as executable scripts. -# If DEF_PERMS option is provided, than permissions for installed files are -# only OWNER_WRITE, OWNER_READ, GROUP_READ, and WORLD_READ. -#---------------------------------------------------------------------------- -MACRO(SALOME_INSTALL_SCRIPTS file_list path) - PARSE_ARGUMENTS(SALOME_INSTALL_SCRIPTS "WORKING_DIRECTORY" "DEF_PERMS" ${ARGN}) - SET(PERMS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ) - IF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS) - SET(PERMS ${PERMS} OWNER_EXECUTE GROUP_EXECUTE WORLD_EXECUTE) - ENDIF(NOT SALOME_INSTALL_SCRIPTS_DEF_PERMS) - SET(_all_pyc) - SET(_all_pyo) - SET(_all_subdirs) - FOREACH(file ${file_list}) - SET(PREFIX "") - SET(_source_prefix "") - GET_FILENAME_COMPONENT(file_name ${file} NAME) - IF(NOT IS_ABSOLUTE ${file}) - IF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) - SET(PREFIX "${SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY}/") - ENDIF(SALOME_INSTALL_SCRIPTS_WORKING_DIRECTORY) - SET(_source_prefix "${CMAKE_CURRENT_SOURCE_DIR}/") - ENDIF(NOT IS_ABSOLUTE ${file}) - INSTALL(FILES ${PREFIX}${file} DESTINATION ${path} PERMISSIONS ${PERMS}) - GET_FILENAME_COMPONENT(ext ${file} EXT) - GET_FILENAME_COMPONENT(we_ext ${file} NAME_WE) - - IF(ext STREQUAL .py) - # Generate and install the pyc and pyo - # [ABN] Important: we avoid references or usage of CMAKE_INSTALL_PREFIX which is not correctly set - # when using CPack. - SET(_pyc_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.pyc") - SET(_pyo_file "${CMAKE_CURRENT_BINARY_DIR}/${we_ext}.pyo") - LIST(APPEND _all_pyc ${_pyc_file}) - LIST(APPEND _all_pyo ${_pyo_file}) - ADD_CUSTOM_COMMAND( - OUTPUT ${_pyc_file} - COMMAND ${PYTHON_EXECUTABLE} -c "import py_compile ; py_compile.compile('${_source_prefix}${file}', '${_pyc_file}', doraise=True )" - DEPENDS ${PREFIX}${file} - VERBATIM - ) - ADD_CUSTOM_COMMAND( - OUTPUT ${_pyo_file} - COMMAND ${PYTHON_EXECUTABLE} -O -c "import py_compile ; py_compile.compile('${_source_prefix}${file}', '${_pyo_file}', doraise=True )" - DEPENDS ${PREFIX}${file} - VERBATIM - ) - # Install the .pyo and the .pyc - INSTALL(FILES ${_pyc_file} DESTINATION ${path} PERMISSIONS ${PERMS}) - INSTALL(FILES ${_pyo_file} DESTINATION ${path} PERMISSIONS ${PERMS}) - ENDIF(ext STREQUAL .py) - - # get relativa path (from CMAKE_SOURCE_DIR to CMAKE_CURRENT_SOURCE_DIR) - STRING(REGEX REPLACE ${CMAKE_SOURCE_DIR} "" rel_dir ${CMAKE_CURRENT_SOURCE_DIR}) - # convert "/" to "_" - IF(rel_dir) - STRING(REGEX REPLACE "/" "_" unique_name ${rel_dir}) - ELSE(rel_dir) - SET(unique_name _) - ENDIF(rel_dir) - - ENDFOREACH(file ${file_list}) - # Generate only one target for all requested Python script compilation. - # Make sure that the target name is unique too. - IF(_all_pyc) - SET(_cnt 0) - WHILE(TARGET "PYCOMPILE${unique_name}_${_cnt}") - MATH(EXPR _cnt ${_cnt}+1) - ENDWHILE() - ADD_CUSTOM_TARGET("PYCOMPILE${unique_name}_${_cnt}" ALL DEPENDS ${_all_pyc} ${_all_pyo}) - ENDIF() -ENDMACRO(SALOME_INSTALL_SCRIPTS) - -#---------------------------------------------------------------------------- -# SALOME_CONFIGURE_FILE is a macro useful for copying a file to another location -# and modify its contents. -# -# USAGE: SALOME_CONFIGURE_FILE(in_file out_file [INSTALL dir]) -# -# ARGUMENTS: -# in_file: IN : input file (if relative path is given, full file path is computed from current source dir). -# out_file: IN : output file (if relative path is given, full file path is computed from current build dir). -# If INSTALL is specified, then 'out_file' will be installed to the 'dir' directory. -#---------------------------------------------------------------------------- -MACRO(SALOME_CONFIGURE_FILE IN_FILE OUT_FILE) - IF(IS_ABSOLUTE ${IN_FILE}) - SET(_in_file ${IN_FILE}) - ELSE() - SET(_in_file ${CMAKE_CURRENT_SOURCE_DIR}/${IN_FILE}) - ENDIF() - IF(IS_ABSOLUTE ${OUT_FILE}) - SET(_out_file ${OUT_FILE}) - ELSE() - SET(_out_file ${CMAKE_CURRENT_BINARY_DIR}/${OUT_FILE}) - ENDIF() - MESSAGE(STATUS "Creation of ${_out_file}") - CONFIGURE_FILE(${_in_file} ${_out_file} @ONLY) - PARSE_ARGUMENTS(SALOME_CONFIGURE_FILE "INSTALL" "" ${ARGN}) - IF(SALOME_CONFIGURE_FILE_INSTALL) - INSTALL(FILES ${_out_file} DESTINATION ${SALOME_CONFIGURE_FILE_INSTALL}) - ENDIF(SALOME_CONFIGURE_FILE_INSTALL) -ENDMACRO(SALOME_CONFIGURE_FILE) - - -####################################################################################### -# Useful macros for SALOME own package detection system -# - -### -# SALOME_CHECK_EQUAL_PATHS(result path1 path2) -# Check if two paths are identical, resolving links. If the paths do not exist a simple -# text comparison is performed. -# result is a boolean. -### -MACRO(SALOME_CHECK_EQUAL_PATHS varRes path1 path2) - SET("${varRes}" OFF) - IF(EXISTS "${path1}") - GET_FILENAME_COMPONENT(_tmp1 "${path1}" REALPATH) - ELSE() - SET(_tmp1 "${path1}") - ENDIF() - - IF(EXISTS "${path2}") - GET_FILENAME_COMPONENT(_tmp2 "${path2}" REALPATH) - ELSE() - SET(_tmp2 "${path2}") - ENDIF() - - IF("${_tmp1}" STREQUAL "${_tmp2}") - SET("${varRes}" ON) - ENDIF() -# MESSAGE(${${varRes}}) -ENDMACRO() - -#### -# SALOME_LOG_OPTIONAL_PACKAGE(pkg flag) -# -# Register in global variables the detection status (found or not) of the optional package 'pkg' -# and the configuration flag that should be turned off to avoid detection of the package. -# The global variables are read again by SALOME_PACKAGE_REPORT_AND_CHECK to produce -# a summary report of the detection status and stops the process if necessary. -MACRO(SALOME_LOG_OPTIONAL_PACKAGE pkg flag) - # Was the package found - STRING(TOUPPER ${pkg} _pkg_UC) - IF(${pkg}_FOUND OR ${_pkg_UC}_FOUND) - SET(_isFound TRUE) - ELSE() - SET(_isFound FALSE) - ENDIF() - - # Is the package already in the list? Then update its status: - LIST(FIND _SALOME_OPTIONAL_PACKAGES_names ${pkg} _result) - IF(NOT ${_result} EQUAL -1) - LIST(REMOVE_AT _SALOME_OPTIONAL_PACKAGES_found ${_result}) - LIST(REMOVE_AT _SALOME_OPTIONAL_PACKAGES_flags ${_result}) - LIST(INSERT _SALOME_OPTIONAL_PACKAGES_found ${_result} ${_isFound}) - LIST(INSERT _SALOME_OPTIONAL_PACKAGES_flags ${_result} ${flag}) - ELSE() - # Otherwise insert it - LIST(APPEND _SALOME_OPTIONAL_PACKAGES_names ${pkg}) - LIST(APPEND _SALOME_OPTIONAL_PACKAGES_found ${_isFound}) - LIST(APPEND _SALOME_OPTIONAL_PACKAGES_flags ${flag}) - ENDIF() - -ENDMACRO(SALOME_LOG_OPTIONAL_PACKAGE) - -#### -# SALOME_JUSTIFY_STRING() -# -# Justifies the string specified as an argument to the given length -# adding required number of spaces to the end. Does noting if input -# string is longer as required length. -# Puts the result to the output variable. -# -# USAGE: SALOME_JUSTIFY_STRING(input length result) -# -# ARGUMENTS: -# input [in] input string -# length [in] required length of resulting string -# result [out] name of variable where the result string is put to -# -MACRO(SALOME_JUSTIFY_STRING input length result) - SET(${result} ${input}) - STRING(LENGTH ${input} _input_length) - MATH(EXPR _nb_spaces "${length}-${_input_length}-1") - IF (_nb_spaces GREATER 0) - FOREACH(_idx RANGE ${_nb_spaces}) - SET(${result} "${${result}} ") - ENDFOREACH() - ENDIF() -ENDMACRO(SALOME_JUSTIFY_STRING) - -#### -# SALOME_PACKAGE_REPORT_AND_CHECK() -# -# Print a quick summary of the detection of optional prerequisites. -# If a package was not found, the configuration is stopped. The summary also indicates -# which flag should be turned off to skip the detection of the package. -# -# If optional JUSTIFY argument is specified, names of packages -# are left-justified to the given length; default value is 10. -# -# USAGE: SALOME_PACKAGE_REPORT_AND_CHECK([JUSTIFY length]) -# -MACRO(SALOME_PACKAGE_REPORT_AND_CHECK) - SET(_will_fail OFF) - PARSE_ARGUMENTS(SALOME_PACKAGE_REPORT "JUSTIFY" "" ${ARGN}) - IF(SALOME_PACKAGE_REPORT_JUSTIFY) - SET(_length ${SALOME_PACKAGE_REPORT_JUSTIFY}) - ELSE() - SET(_length 23) - ENDIF() - MESSAGE(STATUS "") - MESSAGE(STATUS " Optional packages - Detection report ") - MESSAGE(STATUS " ==================================== ") - MESSAGE(STATUS "") - IF(DEFINED _SALOME_OPTIONAL_PACKAGES_names) - LIST(LENGTH _SALOME_OPTIONAL_PACKAGES_names _list_len) - # Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ... - MATH(EXPR _range "${_list_len}-1") - FOREACH(_idx RANGE ${_range}) - LIST(GET _SALOME_OPTIONAL_PACKAGES_names ${_idx} _pkg_name) - LIST(GET _SALOME_OPTIONAL_PACKAGES_found ${_idx} _pkg_found) - LIST(GET _SALOME_OPTIONAL_PACKAGES_flags ${_idx} _pkg_flag) - SALOME_JUSTIFY_STRING(${_pkg_name} ${_length} _pkg_name) - IF(_pkg_found) - SET(_found_msg "Found") - SET(_flag_msg "") - ELSE() - SET(_will_fail ON) - SET(_found_msg "NOT Found") - SET(_flag_msg " - ${_pkg_flag} can be switched OFF to skip this prerequisite.") - ENDIF() - - MESSAGE(STATUS " * ${_pkg_name} -> ${_found_msg}${_flag_msg}") - ENDFOREACH() - ENDIF(DEFINED _SALOME_OPTIONAL_PACKAGES_names) - MESSAGE(STATUS "") - MESSAGE(STATUS "") - - # Failure if some packages were missing: - IF(_will_fail) - MESSAGE(FATAL_ERROR "Some required prerequisites have NOT been found. Take a look at the report above to fix this.") - ENDIF() -ENDMACRO(SALOME_PACKAGE_REPORT_AND_CHECK) - -#### -# SALOME_FIND_PACKAGE(englobingPackageName standardPackageName modus [onlyTryQuietly]) -# -# example: SALOME_FIND_PACKAGE(SalomeVTK VTK CONFIG) -# -# Encapsulate the call to the standard FIND_PACKAGE(standardPackageName) passing all the options -# given when calling the command FIND_PACKAGE(SalomeXYZ). Those options are stored implicitly in -# CMake variables: xyz__FIND_QUIETLY, xyz_FIND_REQUIRED, etc ... -# -# If a list of components was specified when invoking the initial FIND_PACKAGE(SalomeXyz ...) this is -# also handled properly. -# -# Modus is either MODULE or CONFIG (cf standard FIND_PACKAGE() documentation). -# The last argument is optional and if set to TRUE will force the search to be OPTIONAL and QUIET. -# If the package is looked for in CONFIG mode, the standard system paths are skipped. If you still want a -# system installation to be found in this mode, you have to set the ROOT_DIR variable explicitly to /usr (for -# example). -# -# This macro is to be called from within the FindSalomeXXXX.cmake file. -# -#### -MACRO(SALOME_FIND_PACKAGE englobPkg stdPkg mode) - SET(_OPT_ARG ${ARGV3}) - # Only bother if the package was not already found: - # Some old packages use the lower case version - standard should be to always use - # upper case: - STRING(TOUPPER ${stdPkg} stdPkgUC) - IF(NOT (${stdPkg}_FOUND OR ${stdPkgUC}_FOUND)) - IF(${englobPkg}_FIND_QUIETLY OR _OPT_ARG) - SET(_tmp_quiet "QUIET") - ELSE() - SET(_tmp_quiet) - ENDIF() - IF(${englobPkg}_FIND_REQUIRED AND NOT _OPT_ARG) - SET(_tmp_req "REQUIRED") - ELSE() - SET(_tmp_req) - ENDIF() - IF(${englobPkg}_FIND_VERSION_EXACT) - SET(_tmp_exact "EXACT") - ELSE() - SET(_tmp_exact) - ENDIF() - - # Call the CMake FIND_PACKAGE() command: - STRING(TOLOWER ${stdPkg} _pkg_lc) - IF(("${mode}" STREQUAL "NO_MODULE") OR ("${mode}" STREQUAL "CONFIG")) - # Hope to find direclty a CMake config file, indicating the SALOME CMake file - # paths (the command already looks in places like "share/cmake", etc ... by default) - # Note the options NO_CMAKE_BUILDS_PATH, NO_CMAKE_PACKAGE_REGISTRY to avoid (under Windows) - # looking into a previous CMake build done via a GUI, or into the Win registry. - # NO_CMAKE_SYSTEM_PATH and NO_SYSTEM_ENVIRONMENT_PATH ensure any _system_ files like 'xyz-config.cmake' - # don't get loaded (typically Boost). To force their loading, set the XYZ_ROOT_DIR variable to '/usr'. - # See documentation of FIND_PACKAGE() for full details. - - # Do we need to call the signature using components? - IF(${englobPkg}_FIND_COMPONENTS) - FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} - NO_MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS} - PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake" - NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) - ELSE() - FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} - NO_MODULE ${_tmp_quiet} ${_tmp_req} - PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files" "adm/cmake" - NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PATH - NO_SYSTEM_ENVIRONMENT_PATH) - ENDIF() - MARK_AS_ADVANCED(${stdPkg}_DIR) - - ELSEIF("${mode}" STREQUAL "MODULE") - - # Do we need to call the signature using components? - IF(${englobPkg}_FIND_COMPONENTS) - FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} - MODULE ${_tmp_quiet} ${_tmp_req} COMPONENTS ${${englobPkg}_FIND_COMPONENTS}) - ELSE() - FIND_PACKAGE(${stdPkg} ${${englobPkg}_FIND_VERSION} ${_tmp_exact} - MODULE ${_tmp_quiet} ${_tmp_req}) - ENDIF() - - ELSE() - - MESSAGE(FATAL_ERROR "Invalid mode argument in the call to the macro SALOME_FIND_PACKAGE. Should be CONFIG or MODULE.") - - ENDIF() - - ENDIF() -ENDMACRO() - - -#################################################################### -# SALOME_FIND_PACKAGE_DETECT_CONFLICTS(pkg referenceVariable upCount) -# pkg : name of the system package to be detected -# referenceVariable: variable containing a path that can be browsed up to -# retrieve the package root directory (xxx_ROOT_DIR) -# upCount : number of times we have to go up from the path -# to obtain the package root directory. -# If this is a path to a file, going up one time gives the directory containing the file -# going up 2 times gives the parent directory. -# -# For example: SALOME_FIND_PACKAGE_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2) -# with SWIG_EXECUTABLE set to '/usr/bin/swig' -# will produce '/usr' -# -# Generic detection (and conflict check) procedure for package XYZ: -# 1. Load a potential env variable XYZ_ROOT_DIR as a default choice for the cache entry XYZ_ROOT_DIR -# If empty, load a potential XYZ_ROOT_DIR_EXP as default value (path exposed by another package depending -# directly on XYZ) -# 2. Invoke FIND_PACKAGE() in this order: -# * in CONFIG mode first (if possible): priority is given to a potential -# "XYZ-config.cmake" file -# * then switch to the standard MODULE mode, appending on CMAKE_PREFIX_PATH -# the above XYZ_ROOT_DIR variable -# 3. Extract the path actually found into a temp variable _XYZ_TMP_DIR -# 4. Warn if XYZ_ROOT_DIR is set and doesn't match what was found (e.g. when CMake found the system installation -# instead of what is pointed to by XYZ_ROOT_DIR - happens when a typo in the content of XYZ_ROOT_DIR). -# 5. Conflict detection: -# * check the temp variable against a potentially existing XYZ_ROOT_DIR_EXP -# 6. Finally expose what was *actually* found in XYZ_ROOT_DIR. -# 7. Specific stuff: for example exposing a prerequisite of XYZ to the rest of the world for future -# conflict detection. This is added after the call to the macro by the callee. -# -MACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS pkg referenceVariable upCount) - ## - ## 0. Initialization - ## - PARSE_ARGUMENTS(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS "ENVVAR" "" ${ARGN}) - - # Package name, upper case - STRING(TOUPPER ${pkg} pkg_UC) - - ## - ## 1. Load environment or any previously detected root dir for the package - ## - SET(_envvar ${pkg_UC}_ROOT_DIR) - IF(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR) - SET(_envvar "${SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS_ENVVAR}") - ENDIF() - IF(DEFINED ENV{${_envvar}}) - FILE(TO_CMAKE_PATH "$ENV{${_envvar}}" _${pkg_UC}_ROOT_DIR_ENV) - SET(_dflt_value "${_${pkg_UC}_ROOT_DIR_ENV}") - ELSE() - # will be blank if no package was previously loaded: - SET(_dflt_value "${${pkg_UC}_ROOT_DIR_EXP}") - ENDIF() - # Detect if the variable has been set on the command line or elsewhere: - IF(DEFINED ${_envvar}) - SET(_var_already_there TRUE) - ELSE() - SET(_var_already_there FALSE) - ENDIF() - # Make cache entry - SET(${_envvar} "${_dflt_value}" CACHE PATH "Path to ${pkg_UC} directory") - - ## - ## 2. Find package - try CONFIG mode first (i.e. looking for XYZ-config.cmake) - ## - - # Override the variable - don't append to it, as it would give precedence - # to what was stored there before! - IF(DEFINED ${_envvar}) - SET(CMAKE_PREFIX_PATH "${${_envvar}}") - ENDIF() - - # Try find_package in config mode. This has the priority, but is - # performed QUIET and not REQUIRED: - SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} NO_MODULE TRUE) - - IF (${pkg_UC}_FOUND OR ${pkg}_FOUND) - MESSAGE(STATUS "Found ${pkg} in CONFIG mode!") - ENDIF() - - # Otherwise try the standard way (module mode, with the standard CMake Find*** macro): - # We do it quietly to produce our own error message, except if we are in debug mode: - IF(SALOME_CMAKE_DEBUG) - SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE FALSE) - ELSE() - SALOME_FIND_PACKAGE("Salome${pkg}" ${pkg} MODULE TRUE) - ENDIF() - - # Set the "FOUND" variable for the SALOME wrapper: - IF(${pkg_UC}_FOUND OR ${pkg}_FOUND) - SET(SALOME${pkg_UC}_FOUND TRUE) - ELSE() - SET(SALOME${pkg_UC}_FOUND FALSE) - IF(NOT Salome${pkg}_FIND_QUIETLY) - IF(Salome${pkg}_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? " - "It currently contains ${_envvar}=${${_envvar}} " - "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.") - ELSE() - MESSAGE(WARNING "Package ${pkg} couldn't be found - did you set the corresponing root dir correctly? " - "It currently contains ${_envvar}=${${_envvar}} " - "Append -DSALOME_CMAKE_DEBUG=ON on the command line if you want to see the original CMake error.") - ENDIF() - ENDIF() - ENDIF() - - IF (${pkg_UC}_FOUND OR ${pkg}_FOUND) - ## 3. Set the root dir which was finally retained by going up "upDir" times - ## from the given reference path. The variable "referenceVariable" may be a list. - ## In this case we take its first element. - - # First test if the variable exists, warn otherwise: - IF(NOT DEFINED ${referenceVariable}) - MESSAGE(WARNING "${pkg}: the reference variable '${referenceVariable}' used when calling the macro " - "SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() is not defined.") - ENDIF() - - LIST(LENGTH ${referenceVariable} _tmp_len) - IF(_tmp_len) - LIST(GET ${referenceVariable} 0 _tmp_ROOT_DIR) - ELSE() - # Note the double de-reference of "referenceVariable": - SET(_tmp_ROOT_DIR "${${referenceVariable}}") - ENDIF() - # Up cound can be reset by detection procedure - SET(_upCount ${upCount}) - IF(DEFINED ${pkg_UC}_UPCOUNT) - SET(_upCount ${${pkg_UC}_UPCOUNT}) - ENDIF() - IF(${_upCount}) - FOREACH(_unused RANGE 1 ${_upCount}) - GET_FILENAME_COMPONENT(_tmp_ROOT_DIR "${_tmp_ROOT_DIR}" PATH) - ENDFOREACH() - ENDIF() - - ## - ## 4. Warn if CMake found something not located under ENV(XYZ_ROOT_DIR) - ## - IF(DEFINED ENV{${_envvar}}) - SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${_${pkg_UC}_ROOT_DIR_ENV}") - IF(NOT _res) - MESSAGE(WARNING "${pkg} was found, but not at the path given by the " - "environment ${_envvar}! Is the variable correctly set? " - "The two paths are: ${_tmp_ROOT_DIR} and: ${_${pkg_UC}_ROOT_DIR_ENV}") - - ELSE() - MESSAGE(STATUS "${pkg} found directory matches what was specified in the ${_envvar} variable, all good!") - ENDIF() - ELSE() - IF(NOT _var_already_there) - MESSAGE(STATUS "Variable ${_envvar} was not explicitly defined. " - "An installation was found anyway: ${_tmp_ROOT_DIR}") - ENDIF() - ENDIF() - - ## - ## 5. Conflict detection - ## From another prerequisite using the package: - ## - IF(${pkg_UC}_ROOT_DIR_EXP) - SALOME_CHECK_EQUAL_PATHS(_res "${_tmp_ROOT_DIR}" "${${pkg_UC}_ROOT_DIR_EXP}") - IF(NOT _res) - MESSAGE(WARNING "Warning: ${pkg}: detected version conflicts with a previously found ${pkg}!" - " The two paths are " ${_tmp_ROOT_DIR} " vs " ${${pkg_UC}_ROOT_DIR_EXP}) - ELSE() - MESSAGE(STATUS "${pkg} directory matches what was previously exposed by another prereq, all good!") - ENDIF() - ENDIF() - - ## - ## 6. Save the detected installation - ## - SET(${_envvar} "${_tmp_ROOT_DIR}") - - ELSE() - MESSAGE(STATUS "${pkg} was not found.") - ENDIF() - - SET(Salome${pkg}_FOUND "${pkg}_FOUND") -ENDMACRO(SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS) - - -#################################################################### -# SALOME_ADD_MPI_TO_HDF5() -# -# Overload the HDF5 flags so that they also contain MPI references. -# This is to be used when HDF5 was compiled with MPI support; -MACRO(SALOME_ADD_MPI_TO_HDF5) - SET(HDF5_INCLUDE_DIRS ${HDF5_INCLUDE_DIRS} ${MPI_INCLUDE_DIRS}) - SET(HDF5_DEFINITIONS "${HDF5_DEFINITIONS} ${MPI_DEFINITIONS}") - SET(HDF5_LIBRARIES ${HDF5_LIBRARIES} ${MPI_LIBRARIES}) -ENDMACRO(SALOME_ADD_MPI_TO_HDF5) - -#################################################################### -# SALOME_TOHEXA() -# Convert a number (smaller than 16) into hexadecimal representation -# with a leading 0. -MACRO(SALOME_TOHEXA num result) - SET(_hexa_map a b c d e f) - IF(${num} LESS 10) - SET(${result} "0${num}") - ELSE() - MATH(EXPR _res "${num}-10" ) - LIST(GET _hexa_map ${_res} _out) - SET(${result} "0${_out}") - ENDIF() -ENDMACRO(SALOME_TOHEXA) - -#################################################################### -# SALOME_XVERSION() -# -# Computes hexadecimal version of SALOME package -# -# USAGE: SALOME_XVERSION(package) -# -# ARGUMENTS: -# -# package: IN: SALOME package name -# -# The macro reads SALOME package version from PACKAGE_VERSION variable -# (note package name in uppercase as assumed for SALOME modules); -# hexadecimal version value in form 0xAABBCC (where AA, BB and CC are -# major, minor and maintenance components of package version in -# hexadecimal form) is put to the PACKAGE_XVERSION variable -MACRO(SALOME_XVERSION pkg) - STRING(TOUPPER ${pkg} _pkg_UC) - IF(${_pkg_UC}_VERSION) - SET(_major) - SET(_minor) - SET(_patch) - SALOME_TOHEXA(${${_pkg_UC}_MAJOR_VERSION} _major) - SALOME_TOHEXA(${${_pkg_UC}_MINOR_VERSION} _minor) - SALOME_TOHEXA(${${_pkg_UC}_PATCH_VERSION} _patch) - SET(${_pkg_UC}_XVERSION "0x${_major}${_minor}${_patch}") - ENDIF() -ENDMACRO(SALOME_XVERSION) - - -######################################################################### -# SALOME_ACCUMULATE_HEADERS() -# -# This macro is called in the various FindSalomeXYZ.cmake modules to accumulate -# internally the list of include headers to be saved for future export. -# The full set of include is saved in a variable called -# _${PROJECT_NAME}_EXTRA_HEADERS -# -MACRO(SALOME_ACCUMULATE_HEADERS lst) - FOREACH(l IN LISTS ${lst}) - LIST(FIND _${PROJECT_NAME}_EXTRA_HEADERS "${l}" _res) - IF(_res EQUAL "-1") - IF(NOT "${l}" STREQUAL "/usr/include") - LIST(APPEND _${PROJECT_NAME}_EXTRA_HEADERS "${l}") - ENDIF() - ENDIF() - ENDFOREACH() -ENDMACRO(SALOME_ACCUMULATE_HEADERS) - -######################################################################### -# SALOME_ACCUMULATE_ENVIRONMENT() -# -# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(envvar value [value ...]) -# -# ARGUMENTS: -# envvar [in] environment variable name, e.g. PATH -# value [in] value(s) to be added to environment variable -# -# This macro is called in the various FindSalomeXYZ.cmake modules to -# accumulate environment variables, to be used later to run some command -# in proper environment. -# -# 1. Each envrironment variable is stored in specific CMake variable -# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable. -# 2. Full list of environment variable names is stored in CMake variable -# _${PROJECT_NAME}_EXTRA_ENV. -# -# Notes: -# - The arguments list can include optional CHECK or NOCHECK keywords: -# * For all arguments following CHECK keyword the macro perform an -# additional check (see below); this is the default mode, it is suitable -# for path variables (PATH, LD_LIBRARY_PATH, etc). -# * For all arguments following NOCHECK keyword, no additional check is -# performed. -# Checking an argument means that we check: -# - That the path actually exists -# - That this is not a standard system path (starting with "/usr"); this avoids -# polluting LD_LIBRARY_PATH or PATH with things like "/usr/lib64" ... -# -MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar) - SET(_is_check ON) - FOREACH(_item ${ARGN}) - IF(${_item} STREQUAL "NOCHECK") - SET(_is_check OFF) - ELSEIF(${_item} STREQUAL "CHECK") - SET(_is_check ON) - ELSE() - IF(_is_check) - IF(NOT IS_DIRECTORY ${_item}) - IF(TARGET ${_item}) - GET_TARGET_PROPERTY(_item ${_item} LOCATION) - ENDIF() - GET_FILENAME_COMPONENT(_item ${_item} PATH) - ENDIF() - IF(EXISTS ${_item}) - STRING(REGEX MATCH "^(/usr|/lib|/bin)" _usr_find ${_item}) - LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) - IF(NOT _usr_find AND _res EQUAL -1) - LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) - ENDIF() - ENDIF() - ELSE(_is_check) - LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) - IF( _res EQUAL -1) - LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) - ENDIF() - ENDIF(_is_check) - ENDIF() - ENDFOREACH() - - LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res) - IF(_res EQUAL -1) - LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar}) - ENDIF() - SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "SET\(${PROJECT_NAME}_EXTRA_ENV ${_${PROJECT_NAME}_EXTRA_ENV}\)") - FOREACH(_res ${_${PROJECT_NAME}_EXTRA_ENV}) - STRING(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" _res_path "${_${PROJECT_NAME}_EXTRA_ENV_${_res}}") - SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "${_${PROJECT_NAME}_EXTRA_ENV_FULL}\nSET\(${PROJECT_NAME}_EXTRA_ENV_${_res} ${_res_path}\)") - ENDFOREACH() -ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT) - -######################################################################### -# SALOME_GENERATE_ENVIRONMENT_SCRIPT() -# -# USAGE: SALOME_GENERATE_ENVIRONMENT_SCRIPT(output script cmd opts) -# -# ARGUMENTS: -# output [out] output command, e.g. for creation of target. -# script [in] output environement script name -# cmd [in] input command, e.g. sphinx or python command. -# opts [in] options for input command (cmd). -# -# This macro is called when it's necessary to use given environment to run some command. -# Macro generates environement script using previously created variables -# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable and -# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT); -# and puts generated command in proper environment into argument. -# -# Notes: -# - If