[sword-svn] r2759 - in trunk: . bindings/swig/python cmake
greg.hellings at crosswire.org
greg.hellings at crosswire.org
Fri Jan 4 14:35:13 MST 2013
Author: greg.hellings
Date: 2013-01-04 14:35:12 -0700 (Fri, 04 Jan 2013)
New Revision: 2759
Added:
trunk/bindings/swig/python/install.cmake.in
trunk/cmake/options.cmake
Removed:
trunk/bindings/swig/python/install.cmake
Modified:
trunk/CMakeLists.txt
trunk/bindings/swig/python/CMakeLists.txt
Log:
Improve bindings build experience:
-Move handling up to a bindings/CMakeLists.txt file
-Add dynamic handling of Python install path through the variable
SWORD_PYTHON_INSTALL_DIR
-Move handling of new options to cmake/options.cmake
Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt 2013-01-04 21:34:37 UTC (rev 2758)
+++ trunk/CMakeLists.txt 2013-01-04 21:35:12 UTC (rev 2759)
@@ -29,6 +29,8 @@
#
# Our include directory, for our own internally created "FIND_PACKAGE" calls, like CLucene
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
+# User options
+INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/options.cmake")
# Source variables
INCLUDE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/sources.cmake")
# Our local includes
Modified: trunk/bindings/swig/python/CMakeLists.txt
===================================================================
--- trunk/bindings/swig/python/CMakeLists.txt 2013-01-04 21:34:37 UTC (rev 2758)
+++ trunk/bindings/swig/python/CMakeLists.txt 2013-01-04 21:35:12 UTC (rev 2759)
@@ -43,6 +43,16 @@
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/Sword.cxx ${SWORD_LINK_NAME}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-INSTALL(SCRIPT install.cmake)
+# Allow user installation to custom directory
+IF(SWORD_PYTHON_INSTALL_DIR)
+ SET(SETUP_ARGS "--home=${SWORD_PYTHON_INSTALL_DIR}")
+ELSE(SWORD_PYTHON_INSTALL_DIR)
+ SET(SETUP_ARGS "")
+ENDIF(SWORD_PYTHON_INSTALL_DIR)
+CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/install.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/install.cmake")
+# Run external installation script
+INSTALL(SCRIPT "${CMAKE_CURRENT_BINARY_DIR}/install.cmake")
+
MESSAGE(STATUS "Python: yes")
Deleted: trunk/bindings/swig/python/install.cmake
===================================================================
--- trunk/bindings/swig/python/install.cmake 2013-01-04 21:34:37 UTC (rev 2758)
+++ trunk/bindings/swig/python/install.cmake 2013-01-04 21:35:12 UTC (rev 2759)
@@ -1,4 +0,0 @@
-EXECUTE_PROCESS(COMMAND
- python setup.py install
- WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bindings/swig/python"
-)
Added: trunk/bindings/swig/python/install.cmake.in
===================================================================
--- trunk/bindings/swig/python/install.cmake.in (rev 0)
+++ trunk/bindings/swig/python/install.cmake.in 2013-01-04 21:35:12 UTC (rev 2759)
@@ -0,0 +1,4 @@
+EXECUTE_PROCESS(COMMAND
+ python setup.py install @SETUP_ARGS@
+ WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+)
Added: trunk/cmake/options.cmake
===================================================================
--- trunk/cmake/options.cmake (rev 0)
+++ trunk/cmake/options.cmake 2013-01-04 21:35:12 UTC (rev 2759)
@@ -0,0 +1,3 @@
+# A list of the options that the library supports
+OPTION(SWORD_PYTHON_INSTALL_DIR "Directory where the Python bindings will be installed. Defaults to default Python path."
+ "")
More information about the sword-cvs
mailing list