From d855eb83fe08c3462e9a5dade8724aaa97554a7d Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Tue, 5 Dec 2017 14:31:34 +0100 Subject: [PATCH] A small package export --- src/Plugins/MEDWriter/CMakeLists.txt | 8 +++++ .../MEDWriter/MEDWriterConfig.cmake.in | 32 +++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 src/Plugins/MEDWriter/MEDWriterConfig.cmake.in diff --git a/src/Plugins/MEDWriter/CMakeLists.txt b/src/Plugins/MEDWriter/CMakeLists.txt index 2c132b00..b3697307 100644 --- a/src/Plugins/MEDWriter/CMakeLists.txt +++ b/src/Plugins/MEDWriter/CMakeLists.txt @@ -56,4 +56,12 @@ PV_PROCESS_MODULES() ADD_SUBDIRECTORY(ParaViewPlugin) +INCLUDE(CMakePackageConfigHelpers) + +CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in + ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake + INSTALL_DESTINATION "${MEDWRITER_INSTALL_CMAKE_LOCAL}" + PATH_VARS CMAKE_INSTALL_PREFIX MEDWRITER_INSTALL_HEADERS) + +INSTALL(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" DESTINATION "${MEDWRITER_INSTALL_CMAKE_LOCAL}") INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${MEDWRITER_INSTALL_CMAKE_LOCAL}" FILE ${PROJECT_NAME}Targets.cmake) diff --git a/src/Plugins/MEDWriter/MEDWriterConfig.cmake.in b/src/Plugins/MEDWriter/MEDWriterConfig.cmake.in new file mode 100644 index 00000000..468a9d87 --- /dev/null +++ b/src/Plugins/MEDWriter/MEDWriterConfig.cmake.in @@ -0,0 +1,32 @@ +############################################################### +# Copyright (C) 2017 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 +# + +@PACKAGE_INIT@ + +# 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) +INCLUDE("@PROJECT_NAME@Targets") + +# Package root dir: +SET_AND_CHECK(MEDWRITER_ROOT_DIR_EXP "@PACKAGE_CMAKE_INSTALL_PREFIX@") + +# Include directories and definitions +SET_AND_CHECK(MEDWRITER_INCLUDE_DIRS "${MEDWRITER_ROOT_DIR_EXP}/@MEDWRITER_INSTALL_HEADERS@") \ No newline at end of file -- 2.39.2