summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt10
-rw-r--r--PySide/CMakeLists.txt16
-rw-r--r--libpyside/CMakeLists.txt7
-rw-r--r--libpyside/PySideConfig.cmake.in6
-rw-r--r--libpyside/pyside.pc.in8
5 files changed, 22 insertions, 25 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b99350e..5ba7022b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/Modules/
${CMAKE_MODULE_PATH})
find_package(PythonLibs REQUIRED)
find_package(PythonInterpWithDebug REQUIRED)
+find_package(GeneratorRunner 0.6 REQUIRED)
find_package(Shiboken 0.5 REQUIRED)
find_package(Qt4 4.5.0 REQUIRED)
@@ -17,6 +18,7 @@ if (NOT ${XVFB_RUN} MATCHES "XVFB_RUN-NOTFOUND")
message("Using xvfb-run to perform QtGui tests.")
endif()
+option(ENABLE_VERSION_SUFFIX "Used to use current version in suffix to generated files. This is used to allow multiples versions installed simultaneous." FALSE)
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE PATH "The subdirectory relative to the install prefix where libraries will be installed (default is /lib${LIB_SUFFIX})" FORCE)
if(CMAKE_HOST_APPLE)
@@ -66,6 +68,9 @@ set(BINDING_API_MINOR_VERSION "4")
set(BINDING_API_MICRO_VERSION "1")
set(BINDING_API_VERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}.${BINDING_API_MICRO_VERSION}" CACHE STRING "PySide version" FORCE)
set(PYSIDE_QT_VERSION "${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}" CACHE STRING "Qt version used to compile PySide" FORCE)
+if(ENABLE_VERSION_SUFFIX)
+ set(pyside_SUFFIX "-${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}")
+endif()
include(${QT_USE_FILE})
if (${QTVERSION} VERSION_LESS 4.5.0)
@@ -112,11 +117,6 @@ else()
endif()
set(BINDING_VERSION ${BINDING_API_VERSION}.${QT_VERSION_MAJOR}.${QT_VERSION_MINOR})
-find_program(GENERATOR generatorrunner REQUIRED)
-
-if (NOT GENERATOR)
- message(FATAL_ERROR "You need to specify GENERATOR variable (-DGENERATOR=value)")
-endif()
# uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake"
diff --git a/PySide/CMakeLists.txt b/PySide/CMakeLists.txt
index 66621bef..3114991d 100644
--- a/PySide/CMakeLists.txt
+++ b/PySide/CMakeLists.txt
@@ -1,10 +1,6 @@
project(pyside)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/__init__.py" "${CMAKE_CURRENT_SOURCE_DIR}/private.py"
- DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}")
-
-macro(execute_generator module sources typesystem_path)
- message("Running generator for ${module}...")
-endmacro()
+ DESTINATION "${SITE_PACKAGE}/${BINDING_NAME}${pyside_SUFFIX}")
macro(create_pyside_module module_name module_include_dir module_libraries module_deps module_typesystem_path module_sources typesystem_name)
string(TOLOWER ${module_name} _module)
@@ -16,7 +12,7 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
endif()
add_custom_command(OUTPUT ${${module_sources}}
- COMMAND ${GENERATOR} ${GENERATOR_EXTRA_FLAGS}
+ COMMAND ${GENERATORRUNNER_BINARY} ${GENERATOR_EXTRA_FLAGS}
${CMAKE_BINARY_DIR}/PySide/global.h
--include-paths=${pyside_SOURCE_DIR}${PATH_SEP}${QT_INCLUDE_DIR}
--typesystem-paths=${pyside_SOURCE_DIR}${PATH_SEP}${${module_typesystem_path}}
@@ -44,12 +40,12 @@ macro(create_pyside_module module_name module_include_dir module_libraries modul
# install
install(FILES ${pyside_BINARY_DIR}/${module_name}${CMAKE_DEBUG_POSTFIX}${${module_name}_suffix}
- DESTINATION ${SITE_PACKAGE}/PySide)
+ DESTINATION ${SITE_PACKAGE}/PySide${pyside_SUFFIX})
string(TOLOWER ${module_name} lower_module_name)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/PySide/${module_name}/pyside_${lower_module_name}_python.h
- DESTINATION include/PySide/${module_name}/)
+ DESTINATION include/PySide${pyside_SUFFIX}/${module_name}/)
file(GLOB typesystem_files ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_*.xml ${typesystem_path})
- install(FILES ${typesystem_files} DESTINATION share/PySide/typesystems)
+ install(FILES ${typesystem_files} DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
endmacro()
macro(check_qt_class module class global_sources)
@@ -171,5 +167,5 @@ HAS_QT_MODULE(QT_QTDECLARATIVE_FOUND QtDeclarative)
# install
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/typesystem_templates.xml
- DESTINATION share/PySide/typesystems)
+ DESTINATION share/PySide${pyside_SUFFIX}/typesystems)
diff --git a/libpyside/CMakeLists.txt b/libpyside/CMakeLists.txt
index 284a3848..11196f83 100644
--- a/libpyside/CMakeLists.txt
+++ b/libpyside/CMakeLists.txt
@@ -24,6 +24,7 @@ target_link_libraries(pyside
set_target_properties(pyside PROPERTIES
VERSION ${BINDING_API_VERSION}
SOVERSION "${BINDING_API_MAJOR_VERSION}.${BINDING_API_MINOR_VERSION}"
+ OUTPUT_NAME "pyside${pyside_SUFFIX}"
DEFINE_SYMBOL PYSIDE_EXPORTS)
#
@@ -43,18 +44,18 @@ set(libpyside_HEADERS
# create pkg-config file
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pyside.pc.in"
- "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" @ONLY)
+ "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" @ONLY)
# create cmake-config files
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake" @ONLY)
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/PySideConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake" @ONLY)
install(FILES ${libpyside_HEADERS}
- DESTINATION include/${BINDING_NAME})
+ DESTINATION include/${BINDING_NAME}${pyside_SUFFIX})
install(TARGETS pyside EXPORT pyside
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION bin)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/pyside${pyside_SUFFIX}.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfig.cmake"
DESTINATION "${LIB_INSTALL_DIR}/cmake/PySide-${BINDING_API_VERSION}")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/PySideConfigVersion.cmake"
diff --git a/libpyside/PySideConfig.cmake.in b/libpyside/PySideConfig.cmake.in
index 6d618a5b..9e0f42e9 100644
--- a/libpyside/PySideConfig.cmake.in
+++ b/libpyside/PySideConfig.cmake.in
@@ -2,6 +2,6 @@
# PYSIDE_LIBRARIES - Files to link against to use PySide
# PYSIDE_TYPESYSTEMS - Type system files that should be used by other bindings extending PySide
-SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide")
-SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@CMAKE_SHARED_LIBRARY_SUFFIX@")
-SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems")
+SET(PYSIDE_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@")
+SET(PYSIDE_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@pyside@pyside_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
+SET(PYSIDE_TYPESYSTEMS "@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFFIX@/typesystems")
diff --git a/libpyside/pyside.pc.in b/libpyside/pyside.pc.in
index ca7a0a5e..516f8e1e 100644
--- a/libpyside/pyside.pc.in
+++ b/libpyside/pyside.pc.in
@@ -1,12 +1,12 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=@CMAKE_INSTALL_PREFIX@
libdir=@LIB_INSTALL_DIR@
-includedir=@CMAKE_INSTALL_PREFIX@/include/PySide
-typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide/typesystems
+includedir=@CMAKE_INSTALL_PREFIX@/include/PySide@pyside_SUFFIX@
+typesystemdir=@CMAKE_INSTALL_PREFIX@/share/PySide@pyside_SUFFIX@/typesystems
-Name: PySide
+Name: PySide@pyside_SUFFIX@
Description: Support library for Python bindings of Qt-based libraries.
Version: @BINDING_API_VERSION@
-Libs: -L${libdir} -lpython -lpyside
+Libs: -L${libdir} -lpython -lpyside@pyside_SUFFIX@
Cflags: -I${includedir}