From 80917947347ec4a4ac6ff8bcd04a14e441bdf15b Mon Sep 17 00:00:00 2001 From: Denis Arnaud Date: Sun, 31 May 2020 23:56:54 +0200 Subject: [PATCH] [Conf] Scinded the Python CMake support files --- config/project_config_embeddable.cmake | 15 ++++++++++++--- rmol-config-python.cmake.in | 20 ++++++++++++++++++++ rmol-config.cmake.in | 7 ------- 3 files changed, 32 insertions(+), 10 deletions(-) create mode 100644 rmol-config-python.cmake.in diff --git a/config/project_config_embeddable.cmake b/config/project_config_embeddable.cmake index 9cd798b..4e19c9b 100644 --- a/config/project_config_embeddable.cmake +++ b/config/project_config_embeddable.cmake @@ -2127,7 +2127,7 @@ macro (module_script_add _script_file) # Install the Python helpers install (PROGRAMS ${${MODULE_LIB_TARGET}_PY_SRCS} - DESTINATION "${INSTALL_PY_LIB_DIR}" COMPONENT devel) + DESTINATION "${INSTALL_PY_LIB_DIR}" COMPONENT python-devel) endif ("${_script_ext}" STREQUAL "py") # Add the 'scripts_${MODULE_NAME}' target, depending on the @@ -2139,7 +2139,7 @@ macro (module_script_add _script_file) # The Python scripts have to be installed in the Python # site-package/library dedicated directory install (PROGRAMS ${_full_script_path} - DESTINATION "${INSTALL_PY_LIB_DIR}" COMPONENT devel) + DESTINATION "${INSTALL_PY_LIB_DIR}" COMPONENT python-devel) else ("${_script_ext}" STREQUAL "py") install (PROGRAMS ${_full_script_path} DESTINATION bin COMPONENT devel) endif ("${_script_ext}" STREQUAL "py") @@ -2654,13 +2654,22 @@ macro (install_dev_helper_files) endif (NOT "${PROJECT_NAME}" STREQUAL "opentrep") configure_file (${PROJECT_NAME}-config.cmake.in "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" @ONLY) + if (NEED_PYTHON) + configure_file (${PROJECT_NAME}-config-python.cmake.in + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-python.cmake" @ONLY) + endif (NEED_PYTHON) configure_file (${PROJECT_NAME}-config-version.cmake.in "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" @ONLY) install (FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" DESTINATION "${${PACKAGE_NAME}_CMAKE_DIR}" COMPONENT devel) - + if (NEED_PYTHON) + install (FILES + "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-python.cmake" + DESTINATION "${${PACKAGE_NAME}_CMAKE_DIR}" COMPONENT python-devel) + endif (NEED_PYTHON) + ## ## Then, build and install development helper files for other build systems ## diff --git a/rmol-config-python.cmake.in b/rmol-config-python.cmake.in new file mode 100644 index 0000000..bc2577e --- /dev/null +++ b/rmol-config-python.cmake.in @@ -0,0 +1,20 @@ +# +# Config file for the RMOL Python package. It defines the following variables: +# RMOL_VERSION - version of RMOL +# RMOL_PY_LIBRARY_DIRS - Python library directories for RMOL +# RMOL_PY_LIBRARIES - Python libraries to link against +# RMOL_PY_EXECUTABLES - Python binaries/executables +# + +# Tell the user project where to find RMOL Python libraries +set (RMOL_VERSION "@PACKAGE_VERSION@") +set (RMOL_PY_LIBRARY_DIRS "@RMOL_PY_LIB_DIR@") + +# Library dependencies for RMOL (contains definitions for the RMOL IMPORTED +# targets) +include ("@RMOL_CMAKE_DIR@/rmol-python-library-depends.cmake") + +# These are the RMOL IMPORTED targets, created by rmol-library-depends.cmake +set (RMOL_PY_LIBRARIES pyrmollib) +set (RMOL_PY_EXECUTABLES pyrmol) + diff --git a/rmol-config.cmake.in b/rmol-config.cmake.in index e505f63..8dd4d00 100644 --- a/rmol-config.cmake.in +++ b/rmol-config.cmake.in @@ -4,12 +4,9 @@ # RMOL_BINARY_DIRS - binary directories for RMOL # RMOL_INCLUDE_DIRS - include directories for RMOL # RMOL_LIBRARY_DIRS - library directories for RMOL -# RMOL_PY_LIBRARY_DIRS - Python library directories for RMOL # RMOL_LIBEXEC_DIR - internal exec directory for RMOL # RMOL_LIBRARIES - libraries to link against -# RMOL_PY_LIBRARIES - Python libraries to link against # RMOL_EXECUTABLES - the RMOL binaries/executables -# RMOL_PY_EXECUTABLES - Python binaries/executables # # Tell the user project where to find RMOL headers and libraries @@ -17,7 +14,6 @@ set (RMOL_VERSION "@PACKAGE_VERSION@") set (RMOL_BINARY_DIRS "@RMOL_BIN_DIR@") set (RMOL_INCLUDE_DIRS "@RMOL_INCLUDE_DIRS@") set (RMOL_LIBRARY_DIRS "@RMOL_LIB_DIR@") -set (RMOL_PY_LIBRARY_DIRS "@RMOL_PY_LIB_DIR@") set (RMOL_LIBEXEC_DIR "@RMOL_LIBEXEC_DIR@") # Library dependencies for RMOL (contains definitions for the RMOL IMPORTED @@ -26,7 +22,4 @@ include ("@RMOL_CMAKE_DIR@/rmol-library-depends.cmake") # These are the RMOL IMPORTED targets, created by rmol-library-depends.cmake set (RMOL_LIBRARIES rmollib) -set (RMOL_PY_LIBRARIES pyrmollib) set (RMOL_EXECUTABLES rmol rmol_extractBPC rmol_drawBPC) -set (RMOL_PY_EXECUTABLES pyrmol) -