summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt8
-rw-r--r--data/CMakeLists.txt14
-rw-r--r--data/ShibokenConfig.cmake.in (renamed from libshiboken/ShibokenConfig.cmake.in)8
-rw-r--r--data/ShibokenConfigVersion.cmake.in9
-rw-r--r--data/shiboken.pc.in (renamed from libshiboken/shiboken.pc.in)6
-rw-r--r--libshiboken/CMakeLists.txt18
-rw-r--r--libshiboken/ShibokenConfigVersion.cmake.in9
-rw-r--r--tests/otherbinding/CMakeLists.txt4
-rw-r--r--tests/samplebinding/CMakeLists.txt4
9 files changed, 42 insertions, 38 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6338fee3..2f72ef81 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,7 @@ add_definitions(${QT_DEFINITIONS})
option(AVOID_PROTECTED_HACK "Avoid protected hack on generated bindings." FALSE)
option(BUILD_TESTS "Build tests." TRUE)
+option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE)
if(MSVC)
set(CMAKE_CXX_FLAGS "/Zc:wchar_t- /GR /EHsc /DWIN32 /D_WINDOWS /D_SCL_SECURE_NO_WARNINGS")
@@ -54,6 +55,11 @@ set(shiboken_MAJOR_VERSION "0")
set(shiboken_MINOR_VERSION "5")
set(shiboken_MICRO_VERSION "0")
set(shiboken_VERSION "${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}.${shiboken_MICRO_VERSION}")
+if(ENABLE_VERSION_SUFFIX)
+ set(shiboken_SUFFIX "-${shiboken_MAJOR_VERSION}.${shiboken_MINOR_VERSION}")
+else()
+ set(shiboken_SUFFIX "")
+endif()
set(shiboken_SRC
cppgenerator.cpp
@@ -78,6 +84,7 @@ target_link_libraries(shiboken_generator
${QT_QTCORE_LIBRARY})
add_executable(shiboken main.cpp)
+set_target_properties(shiboken PROPERTIES OUTPUT_NAME shiboken${shiboken_SUFFIX})
target_link_libraries(shiboken ${QT_QTCORE_LIBRARY})
# uninstall target
@@ -118,6 +125,7 @@ add_subdirectory(libshiboken)
if (BUILD_TESTS)
add_subdirectory(tests)
endif()
+add_subdirectory(data)
set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${shiboken_VERSION})
add_custom_target(dist
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644
index 00000000..85c9d6a9
--- /dev/null
+++ b/data/CMakeLists.txt
@@ -0,0 +1,14 @@
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfig.cmake.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.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"
+ "${CMAKE_CURRENT_BINARY_DIR}/shiboken${shiboken_SUFFIX}.pc" @ONLY)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.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"
+ DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+
diff --git a/libshiboken/ShibokenConfig.cmake.in b/data/ShibokenConfig.cmake.in
index da513be0..148c35b9 100644
--- a/libshiboken/ShibokenConfig.cmake.in
+++ b/data/ShibokenConfig.cmake.in
@@ -1,11 +1,11 @@
# SHIBOKEN_INCLUDE_DIR - Directories to include to use SHIBOKEN
# SHIBOKEN_LIBRARIES - Files to link against to use SHIBOKEN
-SET(SHIBOKEN_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/shiboken")
+SET(SHIBOKEN_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/shiboken@shiboken_SUFFIX@")
if(MSVC)
- SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken.lib")
+ SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@.lib")
elseif(WIN32)
- SET(SHIBOKEN_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@CMAKE_SHARED_LIBRARY_SUFFIX@")
+ SET(SHIBOKEN_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
else()
- SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@CMAKE_SHARED_LIBRARY_SUFFIX@")
+ SET(SHIBOKEN_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@shiboken@shiboken_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
endif()
diff --git a/data/ShibokenConfigVersion.cmake.in b/data/ShibokenConfigVersion.cmake.in
new file mode 100644
index 00000000..89d84fc1
--- /dev/null
+++ b/data/ShibokenConfigVersion.cmake.in
@@ -0,0 +1,9 @@
+set(PACKAGE_VERSION @shiboken_VERSION@)
+if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @shiboken_MAJOR_VERSION@)
+ if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @shiboken_MINOR_VERSION@)
+ set(PACKAGE_VERSION_COMPATIBLE 1)
+ if("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @shiboken_MICRO_VERSION@)
+ set(PACKAGE_VERSION_EXACT 1)
+ endif()
+ endif()
+endif()
diff --git a/libshiboken/shiboken.pc.in b/data/shiboken.pc.in
index c188831d..ed1cc6c8 100644
--- a/libshiboken/shiboken.pc.in
+++ b/data/shiboken.pc.in
@@ -6,7 +6,7 @@ generator_location=@CMAKE_INSTALL_PREFIX@/bin/shiboken
Name: shiboken
Description: Support library for Python bindings created with Shiboken generator.
-Version: @libshiboken_VERSION@
-Libs: -L${libdir} -lpython
-Cflags: -I${includedir}
+Version: @shiboken_VERSION@
+Libs: -L${libdir} -lpython -lshiboken${shiboken_SUFFIX}
+Cflags: -I${includedir}/shiboken${shiboken_SUFFIX}
diff --git a/libshiboken/CMakeLists.txt b/libshiboken/CMakeLists.txt
index a632b68a..bfd160b1 100644
--- a/libshiboken/CMakeLists.txt
+++ b/libshiboken/CMakeLists.txt
@@ -14,13 +14,6 @@ set(libshiboken_MICRO_VERSION ${shiboken_MICRO_VERSION})
set(libshiboken_VERSION "${libshiboken_MAJOR_VERSION}.${libshiboken_MINOR_VERSION}.${libshiboken_MICRO_VERSION}")
set(libshiboken_SOVERSION "${libshiboken_MAJOR_VERSION}.${libshiboken_MINOR_VERSION}")
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ShibokenConfig.cmake.in"
- "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.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"
- "${CMAKE_CURRENT_BINARY_DIR}/shiboken.pc" @ONLY)
-
set(libshiboken_SRC
basewrapper.cpp
gilstate.cpp
@@ -36,7 +29,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${SPARSEHASH_INCLUDE_PATH})
add_library(libshiboken SHARED ${libshiboken_SRC})
target_link_libraries(libshiboken ${SBK_PYTHON_LIBRARIES})
-set_target_properties(libshiboken PROPERTIES OUTPUT_NAME "shiboken"
+set_target_properties(libshiboken PROPERTIES OUTPUT_NAME "shiboken${shiboken_SUFFIX}"
VERSION ${libshiboken_VERSION}
SOVERSION ${libshiboken_SOVERSION}
DEFINE_SYMBOL LIBSHIBOKEN_EXPORTS)
@@ -55,15 +48,8 @@ install(FILES
shibokenmacros.h
threadstatesaver.h
typeresolver.h
- DESTINATION include/shiboken)
+ DESTINATION include/shiboken${shiboken_SUFFIX})
install(TARGETS libshiboken EXPORT shiboken
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION bin)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfig.cmake"
- DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${libshiboken_VERSION}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ShibokenConfigVersion.cmake"
- DESTINATION "${LIB_INSTALL_DIR}/cmake/Shiboken-${libshiboken_VERSION}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/shiboken.pc"
- DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
-
diff --git a/libshiboken/ShibokenConfigVersion.cmake.in b/libshiboken/ShibokenConfigVersion.cmake.in
deleted file mode 100644
index c29b249d..00000000
--- a/libshiboken/ShibokenConfigVersion.cmake.in
+++ /dev/null
@@ -1,9 +0,0 @@
-set(PACKAGE_VERSION @libshiboken_VERSION@)
-if("${PACKAGE_FIND_VERSION_MAJOR}" EQUAL @libshiboken_MAJOR_VERSION@)
- if("${PACKAGE_FIND_VERSION_MINOR}" EQUAL @libshiboken_MINOR_VERSION@)
- set(PACKAGE_VERSION_COMPATIBLE 1)
- if("${PACKAGE_FIND_VERSION_PATCH}" EQUAL @libshiboken_MICRO_VERSION@)
- set(PACKAGE_VERSION_EXACT 1)
- endif()
- endif()
-endif()
diff --git a/tests/otherbinding/CMakeLists.txt b/tests/otherbinding/CMakeLists.txt
index 0864d961..25294bf7 100644
--- a/tests/otherbinding/CMakeLists.txt
+++ b/tests/otherbinding/CMakeLists.txt
@@ -13,10 +13,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/other/otherobjecttype_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/other/other_module_wrapper.cpp
)
-find_program(GENERATOR generatorrunner REQUIRED)
-
add_custom_command(OUTPUT ${other_SRC}
-COMMAND ${GENERATOR} --generatorSet=${shiboken_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic
+COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=${shiboken_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic
${CMAKE_CURRENT_SOURCE_DIR}/global.h
--include-paths=${libother_SOURCE_DIR}${PATH_SEP}${libsample_SOURCE_DIR}${PATH_SEP}${libsample_SOURCE_DIR}/..
--typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}${PATH_SEP}${sample_SOURCE_DIR}
diff --git a/tests/samplebinding/CMakeLists.txt b/tests/samplebinding/CMakeLists.txt
index c4b19c70..14ec6693 100644
--- a/tests/samplebinding/CMakeLists.txt
+++ b/tests/samplebinding/CMakeLists.txt
@@ -75,10 +75,8 @@ ${CMAKE_CURRENT_BINARY_DIR}/sample/voidholder_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/sample/valueandvirtual_wrapper.cpp
)
-find_program(GENERATOR generatorrunner REQUIRED)
-
add_custom_command(OUTPUT ${sample_SRC}
-COMMAND ${GENERATOR} --generatorSet=${shiboken_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic
+COMMAND ${GENERATORRUNNER_BINARY} --generatorSet=${shiboken_BINARY_DIR}/shiboken_generator${CMAKE_RELEASE_POSTFIX}${CMAKE_DEBUG_POSTFIX} --enable-parent-ctor-heuristic
${CMAKE_CURRENT_SOURCE_DIR}/global.h
--include-paths=${libsample_SOURCE_DIR}
--typesystem-paths=${CMAKE_CURRENT_SOURCE_DIR}