summarylogtreecommitdiffstats
path: root/bindings_dirs.patch
blob: 26347c45048426a67671ba4181243c0338510db9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
diff -ru a/swig/python/CMakeLists.txt b/swig/python/CMakeLists.txt
--- a/swig/python/CMakeLists.txt	2013-11-06 08:20:44.000000000 +0100
+++ b/swig/python/CMakeLists.txt	2013-11-09 13:12:11.428962684 +0100
@@ -40,24 +40,24 @@
     ENDIF(PYTHON_DEBUG_LIBRARIES)
   ENDIF (WIN32)
   
-  EXECUTE_PROCESS (
-    COMMAND ${PYTHON_EXECUTABLE} -c "from distutils import sysconfig;print sysconfig.get_python_lib(0)"
-    OUTPUT_VARIABLE PYTHON_INSTALL_PATH
-    OUTPUT_STRIP_TRAILING_WHITESPACE
-  )
-   
   FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h")
   FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../${ZORBA_API_HEADER}"  "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_HEADER}")
   ENDFOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
 
-  SET (PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/share/python")
+  IF (NOT DEFINED PYTHON_INSTALL_PATH)
+    SET (PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/share/python")
+  ELSE (NOT DEFINED PYTHON_INSTALL_PATH)
+    SET (PYTHON_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${PYTHON_INSTALL_PATH}")
+  ENDIF (NOT DEFINED PYTHON_INSTALL_PATH)
+
+  GET_PROPERTY(ZORBA_API_OUTPUT_NAME TARGET _zorba_api_python PROPERTY OUTPUT_NAME)
 
   IF (NOT WIN32)   
     INSTALL (
       FILES
         ${CMAKE_CURRENT_BINARY_DIR}/zorba_api.py
-        ${CMAKE_CURRENT_BINARY_DIR}/_zorba_api_python.so
+        ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_OUTPUT_NAME}.so
       DESTINATION ${PYTHON_INSTALL_PATH}
     )
   ELSE(NOT WIN32)
diff -ru a/swig/ruby/CMakeLists.txt b/swig/ruby/CMakeLists.txt
--- a/swig/ruby/CMakeLists.txt	2013-11-06 08:20:44.000000000 +0100
+++ b/swig/ruby/CMakeLists.txt	2013-11-09 12:21:32.153061448 +0100
@@ -56,31 +56,34 @@
     SET_TARGET_PROPERTIES( ${SWIG_MODULE_zorba_api_REAL_NAME} PROPERTIES PREFIX "" )
   ENDIF ( LINUX OR CYGWIN OR APPLE )
 
-  EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']"
-    OUTPUT_VARIABLE RUBY_SITEARCH_DIR)
-
   FILE(GLOB ZORBA_API_HEADERS RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.h")
   FOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
     CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/../${ZORBA_API_HEADER}"  "${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_HEADER}")
   ENDFOREACH(ZORBA_API_HEADER ${ZORBA_API_HEADERS})
 
-  SET (RUBY_SITEARCH_DIR "${CMAKE_INSTALL_PREFIX}/share/ruby")
+  IF ( NOT DEFINED RUBY_INSTALL_PATH )
+    SET (RUBY_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/share/ruby")
+  ELSE ( NOT DEFINED RUBY_INSTALL_PATH )
+    SET (RUBY_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${RUBY_INSTALL_PATH}")
+  ENDIF ( NOT DEFINED RUBY_INSTALL_PATH )
+
+  GET_PROPERTY(ZORBA_API_OUTPUT_NAME TARGET zorba_api PROPERTY OUTPUT_NAME)
   
   IF ( APPLE )
     INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api_ruby.bundle
-    DESTINATION ${RUBY_SITEARCH_DIR} )
+    DESTINATION ${RUBY_INSTALL_PATH} )
   ELSE ( APPLE )
     IF ( LINUX )
-      INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api_ruby.so
-      DESTINATION ${RUBY_SITEARCH_DIR}
+      INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_OUTPUT_NAME}.so
+      DESTINATION ${RUBY_INSTALL_PATH}
       COMPONENT ruby_swig )
     ELSE ( LINUX )
       IF (MSVC_IDE)
-        INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/zorba_api_ruby.so
+        INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/${ZORBA_API_OUTPUT_NAME}.so
         DESTINATION share/ruby
         COMPONENT ruby_swig )
       ELSE (MSVC_IDE)
-        INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/zorba_api_ruby.so
+        INSTALL ( FILES ${CMAKE_CURRENT_BINARY_DIR}/${ZORBA_API_OUTPUT_NAME}.so
         DESTINATION share/ruby
         COMPONENT ruby_swig )
       ENDIF (MSVC_IDE)