Skip to content

Commit

Permalink
[Conf] Scinded the Python CMake support files
Browse files Browse the repository at this point in the history
  • Loading branch information
da115115 committed May 31, 2020
1 parent 288ebfd commit 8091794
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
15 changes: 12 additions & 3 deletions config/project_config_embeddable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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
##
Expand Down
20 changes: 20 additions & 0 deletions rmol-config-python.cmake.in
Original file line number Diff line number Diff line change
@@ -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)

7 changes: 0 additions & 7 deletions rmol-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,16 @@
# 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
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
Expand All @@ -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)

0 comments on commit 8091794

Please sign in to comment.