summaryrefslogtreecommitdiffstats
path: root/data
diff options
context:
space:
mode:
authorLauro Neto <lauro.neto@openbossa.org>2011-01-11 17:07:26 -0300
committerRenato Araujo Oliveira Filho <renato.filho@openbossa.org>2011-01-12 17:23:46 -0300
commit297151081ffae13c8dbb66ffde61f2c15eaae2a3 (patch)
tree802d1533c5749a50859e97beec19b4552839fb30 /data
parent498ba2f39e64129d6911cedfd1334032350543eb (diff)
downloadshiboken-297151081ffae13c8dbb66ffde61f2c15eaae2a3.tar.gz
shiboken-297151081ffae13c8dbb66ffde61f2c15eaae2a3.tar.xz
shiboken-297151081ffae13c8dbb66ffde61f2c15eaae2a3.zip
Append python name to libshiboken output file
libshiboken is strongly tied to the python it was compiled against. This commit adds the python name to the output file to make this connection explicit. The generator plugin, binary and includes are untouched as they don't depend on python. Also, Instead of installing the cmake info in a single file, ShibokenConfig.cmake will load the correct file (ShibokenConfig-<python name>.cmake) based on the value of PYTHON_BASENAME when cmake is called. The last shiboken installed will be the default as each install will overwrite ShibokenConfig.cmake. To select an specific python, call cmake with -DPYTHON_BASENAME=python2.6, for python2.6 release. Reviewer: Marcelo Lira <marcelo.lira@openbossa.org> Lauro Moura <lauro.neto@openbossa.org>
Diffstat (limited to 'data')
-rw-r--r--data/CMakeLists.txt4
-rw-r--r--data/ShibokenConfig-spec.cmake.in29
-rw-r--r--data/ShibokenConfig.cmake.in31
3 files changed, 37 insertions, 27 deletions
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
index 9ad9381d..66838599 100644
--- a/data/CMakeLists.txt
+++ b/data/CMakeLists.txt
@@ -6,6 +6,8 @@ endif()
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfig.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.cmake" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfig-spec.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig-${PYTHON_BASENAME}.cmake" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfigVersion.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfigVersion.cmake" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shiboken.pc.in"
@@ -13,6 +15,8 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/shiboken.pc.in"
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${shiboken_VERSION}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig-${PYTHON_BASENAME}.cmake"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${shiboken_VERSION}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfigVersion.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${shiboken_VERSION}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/shiboken${shiboken_SUFFIX}.pc"
diff --git a/data/ShibokenConfig-spec.cmake.in b/data/ShibokenConfig-spec.cmake.in
new file mode 100644
index 00000000..36f0e733
--- /dev/null
+++ b/data/ShibokenConfig-spec.cmake.in
@@ -0,0 +1,29 @@
+# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
+# SHIBOKEN_LIBRARIES - Files to link against to use SHIBOKEN
+# SHIBOKEN_BUILD_TYPE - Tells if Shiboken was compiled in Release or Debug mode.
+# SHIBOKEN_PYTHON_INTERPRETER - Python interpreter (regular or debug) to be used with the bindings.
+# SHIBOKEN_PYTHON_LIBRARIES - Python libraries (regular or debug) Shiboken is linked against.
+
+SET(SHIBOKEN_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/shiboken@shiboken_SUFFIX@")
+if(MSVC)
+ SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@-@PYTHON_BASENAME@@LIBRARY_OUTPUT_SUFFIX@.lib")
+elseif(WIN32)
+ SET(SHIBOKEN_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@-@PYTHON_BASENAME@@LIBRARY_OUTPUT_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
+else()
+ SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@-@PYTHON_BASENAME@@LIBRARY_OUTPUT_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
+endif()
+SET(SHIBOKEN_PYTHON_INCLUDE_DIR "@SBK_PYTHON_INCLUDE_DIR@")
+SET(SHIBOKEN_PYTHON_INCLUDE_DIR "@SBK_PYTHON_INCLUDE_DIR@")
+SET(SHIBOKEN_PYTHON_INTERPRETER "@PYTHON_EXECUTABLE@")
+SET(SHIBOKEN_PYTHON_LIBRARIES "@SBK_PYTHON_LIBRARIES@")
+SET(SHIBOKEN_PYTHON_BASENAME "@PYTHON_BASENAME@")
+message(STATUS "libshiboken built for @SHIBOKEN_BUILD_TYPE@")
+@SBK_ADD_PY_DEBUG_DEFINITION@
+
+# We don't use just "if (@AVOID_PROTECTED_HACK@)" to avoid require all users to turn on the cmake policy CMP0012
+# for more info type: cmake --help-policy CMP0012
+set(SHIBOKEN_AVOID_PROTECTED_HACK @AVOID_PROTECTED_HACK@)
+if (SHIBOKEN_AVOID_PROTECTED_HACK)
+ add_definitions(-DAVOID_PROTECTED_HACK)
+ message(STATUS "Avoiding protected hack!")
+endif()
diff --git a/data/ShibokenConfig.cmake.in b/data/ShibokenConfig.cmake.in
index c7abc831..92f5d02c 100644
--- a/data/ShibokenConfig.cmake.in
+++ b/data/ShibokenConfig.cmake.in
@@ -1,28 +1,5 @@
-# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
-# SHIBOKEN_LIBRARIES - Files to link against to use SHIBOKEN
-# SHIBOKEN_BUILD_TYPE - Tells if Shiboken was compiled in Release or Debug mode.
-# SHIBOKEN_PYTHON_INTERPRETER - Python interpreter (regular or debug) to be used with the bindings.
-# SHIBOKEN_PYTHON_LIBRARIES - Python libraries (regular or debug) Shiboken is linked against.
-
-SET(SHIBOKEN_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/shiboken@shiboken_SUFFIX@")
-if(MSVC)
- SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@.lib")
-elseif(WIN32)
- SET(SHIBOKEN_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
-else()
- SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@@LIBRARY_OUTPUT_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
-endif()
-SET(SHIBOKEN_PYTHON_INCLUDE_DIR "@SBK_PYTHON_INCLUDE_DIR@")
-SET(SHIBOKEN_PYTHON_INTERPRETER "@PYTHON_EXECUTABLE@")
-SET(SHIBOKEN_PYTHON_LIBRARIES "@SBK_PYTHON_LIBRARIES@")
-SET(SHIBOKEN_BUILD_TYPE "@SHIBOKEN_BUILD_TYPE@")
-message(STATUS "libshiboken built for @SHIBOKEN_BUILD_TYPE@")
-@SBK_ADD_PY_DEBUG_DEFINITION@
-
-# We don't use just "if (@AVOID_PROTECTED_HACK@)" to avoid require all users to turn on the cmake policy CMP0012
-# for more info type: cmake --help-policy CMP0012
-set(SHIBOKEN_AVOID_PROTECTED_HACK @AVOID_PROTECTED_HACK@)
-if (SHIBOKEN_AVOID_PROTECTED_HACK)
- add_definitions(-DAVOID_PROTECTED_HACK)
- message(STATUS "Avoiding protected hack!")
+if (NOT PYTHON_BASENAME)
+ message(STATUS "Using default python: @PYTHON_BASENAME@")
+ SET(PYTHON_BASENAME @PYTHON_BASENAME@)
endif()
+include(@LIB_INSTALL_DIR@/cmake/Shiboken-@shiboken_VERSION@/ShibokenConfig-${PYTHON_BASENAME}.cmake)