summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-09-09 15:36:20 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-09 19:10:09 -0300
commitd60308ead4a5df126176d034ebd728bc5be5cb3c (patch)
tree293f3cc93ab3d6b90b8c3887772b045e765433c2
parent4c79cca936632da8fd6c9174babd4a9f72624f52 (diff)
Created cmake option 'ENABLE_VERSION_SUFFIX' to use version on generated files to allow multiples version installed simultaneous.sb-0.8.0
Reviewer: Hugo Parente Lima <hugo.pl@gmail.com> Luciano Wolf <luciano.wolf@openbossa.org>
-rw-r--r--CMakeLists.txt26
-rw-r--r--data/ApiExtractorConfig.cmake.in (renamed from ApiExtractorConfig.cmake.in)8
-rw-r--r--data/ApiExtractorConfigVersion.cmake.in (renamed from ApiExtractorConfigVersion.cmake.in)0
-rw-r--r--data/CMakeLists.txt11
-rw-r--r--data/apiextractor.pc.in (renamed from apiextractor.pc.in)4
5 files changed, 30 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1787b165..6ae13342 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -10,6 +10,7 @@ find_package(LibXslt 1.1.19)
option(DISABLE_DOCSTRINGS "Disable documentation extraction." 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 (NOT DISABLE_DOCSTRINGS)
if (NOT LIBXSLT_FOUND OR NOT LIBXML2_FOUND)
@@ -58,6 +59,12 @@ add_definitions(-DQT_PLUGIN)
add_definitions(-DQT_SHARED)
add_definitions(-DRXX_ALLOCATOR_INIT_0)
+if(ENABLE_VERSION_SUFFIX)
+ set(apiextractor_SUFFIX "-${apiextractor_MAJOR_VERSION}.${apiextractor_MINOR_VERSION}")
+else()
+ set(apiextractor_SUFFIX "")
+endif()
+
set(apiextractor_SRC
apiextractor.cpp
abstractmetabuilder.cpp
@@ -121,13 +128,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
add_library(apiextractor SHARED ${apiextractor_SRC} ${apiextractor_RCCS_SRC})
target_link_libraries(apiextractor ${APIEXTRACTOR_EXTRA_LIBRARIES} ${QT_QTCORE_LIBRARY} ${QT_QTXMLPATTERNS_LIBRARY} ${QT_QTXML_LIBRARY})
-set_target_properties(apiextractor PROPERTIES VERSION ${apiextractor_VERSION} SOVERSION ${apiextractor_SOVERSION} DEFINE_SYMBOL APIEXTRACTOR_EXPORTS)
-
-# create pkg-config file
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/apiextractor.pc.in"
- "${CMAKE_CURRENT_BINARY_DIR}/apiextractor.pc" @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ApiExtractorConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfig.cmake" @ONLY)
-configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ApiExtractorConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfigVersion.cmake" @ONLY)
+set_target_properties(apiextractor PROPERTIES VERSION ${apiextractor_VERSION}
+ SOVERSION ${apiextractor_SOVERSION}
+ OUTPUT_NAME "apiextractor${apiextractor_SUFFIX}"
+ DEFINE_SYMBOL APIEXTRACTOR_EXPORTS)
# uninstall target
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY)
@@ -161,14 +165,10 @@ if (BUILD_TESTS)
enable_testing()
add_subdirectory(tests)
endif()
+add_subdirectory(data)
-install(FILES ${root_HEADERS} DESTINATION include/apiextractor)
+install(FILES ${root_HEADERS} DESTINATION include/apiextractor${apiextractor_SUFFIX})
install(TARGETS apiextractor EXPORT apiextractor
LIBRARY DESTINATION "${LIB_INSTALL_DIR}"
ARCHIVE DESTINATION "${LIB_INSTALL_DIR}"
RUNTIME DESTINATION bin)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apiextractor.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfig.cmake"
- DESTINATION "${LIB_INSTALL_DIR}/cmake/ApiExtractor-${apiextractor_VERSION}")
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfigVersion.cmake"
- DESTINATION "${LIB_INSTALL_DIR}/cmake/ApiExtractor-${apiextractor_VERSION}")
diff --git a/ApiExtractorConfig.cmake.in b/data/ApiExtractorConfig.cmake.in
index 70fc794e..666defb6 100644
--- a/ApiExtractorConfig.cmake.in
+++ b/data/ApiExtractorConfig.cmake.in
@@ -2,13 +2,13 @@
# APIEXTRACTOR_INCLUDE_DIR - Directories to include to use APIEXTRACTOR
# APIEXTRACTOR_LIBRARIES - Files to link against to use APIEXTRACTOR
-SET(APIEXTRACTOR_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/apiextractor")
+SET(APIEXTRACTOR_INCLUDE_DIR "@CMAKE_INSTALL_PREFIX@/include/apiextractor@apiextractor_SUFFIX@")
if(MSVC)
- SET(APIEXTRACTOR_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@apiextractor.lib")
+ SET(APIEXTRACTOR_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@apiextractor@apiextractor_SUFFIX@.lib")
elseif(WIN32)
- SET(APIEXTRACTOR_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@apiextractor@CMAKE_SHARED_LIBRARY_SUFFIX@")
+ SET(APIEXTRACTOR_LIBRARY "@CMAKE_INSTALL_PREFIX@/bin/@CMAKE_SHARED_LIBRARY_PREFIX@apiextractor@apiextractor_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
else()
- SET(APIEXTRACTOR_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@apiextractor@CMAKE_SHARED_LIBRARY_SUFFIX@")
+ SET(APIEXTRACTOR_LIBRARY "@LIB_INSTALL_DIR@/@CMAKE_SHARED_LIBRARY_PREFIX@apiextractor@apiextractor_SUFFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@")
endif()
SET(APIEXTRACTOR_DOCSTRINGS_DISABLED @DISABLE_DOCSTRINGS@)
diff --git a/ApiExtractorConfigVersion.cmake.in b/data/ApiExtractorConfigVersion.cmake.in
index a9f7318f..a9f7318f 100644
--- a/ApiExtractorConfigVersion.cmake.in
+++ b/data/ApiExtractorConfigVersion.cmake.in
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
new file mode 100644
index 00000000..66b2f967
--- /dev/null
+++ b/data/CMakeLists.txt
@@ -0,0 +1,11 @@
+# create pkg-config file
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/apiextractor.pc.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/apiextractor${apiextractor_SUFFIX}.pc" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ApiExtractorConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfig.cmake" @ONLY)
+configure_file("${CMAKE_CURRENT_SOURCE_DIR}/ApiExtractorConfigVersion.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfigVersion.cmake" @ONLY)
+
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apiextractor${apiextractor_SUFFIX}.pc" DESTINATION "${LIB_INSTALL_DIR}/pkgconfig")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfig.cmake"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/ApiExtractor-${apiextractor_VERSION}")
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/ApiExtractorConfigVersion.cmake"
+ DESTINATION "${LIB_INSTALL_DIR}/cmake/ApiExtractor-${apiextractor_VERSION}")
diff --git a/apiextractor.pc.in b/data/apiextractor.pc.in
index 07896a1a..5b59fc63 100644
--- a/apiextractor.pc.in
+++ b/data/apiextractor.pc.in
@@ -7,5 +7,5 @@ Name: apiextractor
Description: Qt4 Binding Generator library
Requires: QtCore
Version: @apiextractor_VERSION@
-Libs: -L${libdir} -lapiextractor
-Cflags: -I${includedir}/apiextractor
+Libs: -L${libdir} -lapiextractor@apiextractor_SUFFIX@
+Cflags: -I${includedir}/apiextractor@apiextractor_SUFFIX@