Windows registry and builds done with a Cmake GUI.
KERNEL config file now automatically import required dependent targets
(for example HDF5 targets, if HDF5 was used in CONFIG mode)
# List of targets in this project we want to make visible to the rest of the world.
# They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup"
SET(_${PROJECT_NAME}_exposed_targets
- CalciumC SalomeCalcium DF Launcher LifeCycleCORBATest NamingServiceTest
+ CalciumC SalomeCalcium DF Launcher
OpUtil Registry ResourcesManager SALOMEBasics SalomeCatalog SalomeCommunication
SalomeContainer SalomeDatastream SalomePalm SalomeDSCContainer SalomeDSClient
- SalomeDSCSupervBasic SalomeDSCSuperv SalomeDSImpl SALOMEDSImplTest
- SalomeDS SALOMEDSTest SalomeGenericObj SalomeHDFPersist SalomeIDLKernel
- SalomeLauncher SalomeLifeCycleCORBA SALOMELocalTrace SALOMELocalTraceTest
+ SalomeDSCSupervBasic SalomeDSCSuperv SalomeDSImpl
+ SalomeDS SalomeGenericObj SalomeHDFPersist SalomeIDLKernel
+ SalomeLauncher SalomeLifeCycleCORBA SALOMELocalTrace
SalomeLoggerServer SalomeNotification SalomeNS
- SalomeResourcesManager SalomeTestComponentEngine
- SALOMETraceCollectorTest TOOLSDS UtilsTest with_loggerTraceCollector SalomeKernelHelpers)
+ SalomeResourcesManager
+ TOOLSDS with_loggerTraceCollector SalomeKernelHelpers)
# MPI specific targets:
IF(SALOME_USE_MPI)
SalomeMPIContainer SalomeTestMPIComponentEngine)
ENDIF()
+# Test targets:
+IF(SALOME_BUILD_TESTS)
+ LIST(APPEND _${PROJECT_NAME}_exposed_targets
+ LifeCycleCORBATest NamingServiceTest SALOMEDSImplTest SALOMEDSTest SALOMELocalTraceTest
+ SalomeTestComponentEngine SALOMETraceCollectorTest UtilsTest )
+ENDIF()
+
# Add all targets to the build-tree export set
EXPORT(TARGETS ${_${PROJECT_NAME}_exposed_targets}
FILE ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Targets.cmake)
FindSalomeHDF5.cmake
FindSalomeLibBatch.cmake
FindSalomeLibXml2.cmake
+ FindSalomeMedfile.cmake
FindSalomeMPI.cmake
FindSalomeOmniORB.cmake
FindSalomePThread.cmake
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+#
+# TODO: this file should be removed when switching to full CMake
+#
+
SET(KERNEL_CXXFLAGS -I${KERNEL_ROOT_DIR}/include/salome) # to be removed
SET(KERNEL_INCLUDE_DIRS ${KERNEL_ROOT_DIR}/include/salome)
# KERNEL detection for salome - this is typically called by dependent modules
# (GUI, PARAVIS, etc ...)
#
-# The detection is simpler than for other prerequisites:
+# The detection is simpler than for other prerequisites.
+# Indeed calling SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS() with SalomeKERNEL is tricky:
+# - one would write SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(KERNEL xyz n)
+# - then the macro would look first for a file named SalomeKERNELConfig.cmake (=the normal situation)
+# - if not found (because KERNEL_ROOT_DIR was badly set for example) the macro would then look
+# for a file named FindSalomeKERNEL.cmake
+# => this is the current file, and that would trigger an infinite recursion ... :-)
+# This could be detected with a flag mechanism, but honestly this becomes an overkill.
#
+# So we go for a simple lookup, without conflict check:
+#
+
+IF(NOT SalomeKERNEL_FIND_QUIETLY)
+ MESSAGE(STATUS "Looking for Salome KERNEL ...")
+ENDIF()
SET(CMAKE_PREFIX_PATH "${KERNEL_ROOT_DIR}")
SALOME_FIND_PACKAGE(SalomeKERNEL SalomeKERNEL CONFIG)
+
+IF(NOT SalomeKERNEL_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Salome KERNEL: ${KERNEL_ROOT_DIR}")
+ENDIF()
--- /dev/null
+# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+# Author: Adrien Bruneton
+#
+
+# Medfile detection dor Salome
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(medfile MEDFILE_ROOT_DIR_EXP 0)
+#MARK_AS_ADVANCED()
\ No newline at end of file
# Load the dependencies for the libraries of @PROJECT_NAME@
# (contains definitions for IMPORTED targets). This is only
# imported if we are not built as a subproject (in this case targets are already there)
-IF(NOT SALOMEBasics AND NOT @PROJECT_NAME@_BINARY_DIR)
+IF(NOT TARGET SALOMEBasics AND NOT @PROJECT_NAME@_BINARY_DIR)
INCLUDE("@PACKAGE_SALOME_INSTALL_CMAKE@/@PROJECT_NAME@Targets.cmake")
ENDIF()
ENDIF()
IF(SALOME_USE_LIBBATCH)
SET_AND_CHECK(LIBBATCH_ROOT_DIR_EXP "@PACKAGE_LIBBATCH_ROOT_DIR@")
- # Make libbatch targets available, so the linking of dependent projects find them:
- INCLUDE("${LIBBATCH_ROOT_DIR_EXP}/share/cmake/libbatch/LibBatchTargets.cmake")
ENDIF()
SET_AND_CHECK(PTHREAD_ROOT_DIR_EXP "@PACKAGE_PTHREAD_ROOT_DIR@")
SET_AND_CHECK(PYTHON_ROOT_DIR_EXP "@PACKAGE_PYTHON_ROOT_DIR@")
SET_AND_CHECK(SWIG_ROOT_DIR_EXP "@PACKAGE_SWIG_ROOT_DIR@")
+# For all prerequisites, load the corresponding targets if the package was used
+# in CONFIG mode. This ensures dependent projects link correctly
+# without having to set LD_LIBRARY_PATH:
+SET(_PREREQ CppUnit Graphviz Doxygen Sphinx MPI omniORB LibBatch PThread Boost HDF5 libXml2 Python)
+SET(_PREREQ_CONFIG_DIR "@CppUnit_DIR@" "@Graphviz_DIR@" "@Doxygen_DIR@" "@Sphinx_DIR@"
+ "@MPI_DIR@" "@omniORB_DIR@" "@LibBatch_DIR@" "@PThread_DIR@" "@Boost_DIR@" "@HDF5_DIR@"
+ "@libXml2_DIR@" "@Python_DIR@")
+LIST(LENGTH _PREREQ_CONFIG_DIR _list_len)
+# Another CMake stupidity - FOREACH(... RANGE r) generates r+1 numbers ...
+MATH(EXPR _range "${_list_len}-1")
+FOREACH(_p RANGE ${_range})
+ LIST(GET _PREREQ ${_p} _pkg )
+ LIST(GET _PREREQ_CONFIG_DIR ${_p} _pkg_dir)
+ IF(_pkg_dir)
+ MESSAGE(STATUS "===> Reloading targets from ${_pkg} ...")
+ FIND_PACKAGE(${_pkg} REQUIRED NO_MODULE
+ PATHS "${_pkg_dir}"
+ NO_DEFAULT_PATH)
+ ENDIF()
+ENDFOREACH()
+
# Installation directories
SET(SALOME_INSTALL_BINS "@SALOME_INSTALL_BINS@")
SET(SALOME_INSTALL_LIBS "@SALOME_INSTALL_LIBS@")
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 look 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.
+ # 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")
+ PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY)
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")
+ PATH_SUFFIXES "salome_adm/cmake_files" "adm_local/cmake_files"
+ NO_CMAKE_BUILDS_PATH NO_CMAKE_PACKAGE_REGISTRY NO_CMAKE_SYSTEM_PACKAGE_REGISTRY)
ENDIF()
MARK_AS_ADVANCED(${stdPkg}_DIR)