summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorChristian Mollekopf <mollekopf@kolabsys.com>2012-04-21 15:12:07 (GMT)
committerChristian Mollekopf <mollekopf@kolabsys.com>2012-04-21 15:12:07 (GMT)
commit13f2f6138eb63401579279139e226dc3165162d4 (patch)
tree9cba6e061c3c078c66e53a8ae4610bd25e224bed /src/CMakeLists.txt
parentafb5c81d35e007c25e566bb0b8b57cc95a6cf38d (diff)
downloadlibkolabxml-13f2f6138eb63401579279139e226dc3165162d4.tar.gz
Revamp of buildsystem to use cmake config files and avoid several other quirks.
- Find files should never be installed, that is what configure files are for. - Variables which should be configurable should be added using the CACHE option, making the available in the cmake cache. They can still be overridden as ususal. - The libdir suffix can now be specified using -DLIB_INSTALL_DIR_SUFFIX=64. - The builddirectory is no longer hardcoded.
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt27
1 files changed, 8 insertions, 19 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fe43652..4410575 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,5 @@
+#This property is not available anymore here, although present in the parent file.
SET_SOURCE_FILES_PROPERTIES(${SCHEMA_SOURCEFILES} PROPERTIES GENERATED 1)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wp,-D_FORTIFY_SOURCE=2 -O2" ) #always generate shared libraries with -fPIC, -D_FORTIFY_SOURCE=2 enables some extra checking
@@ -17,9 +18,13 @@ else() #then normal case
set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wconversion -Wl,--no-undefined")
endif()
-set_target_properties(kolabxml PROPERTIES VERSION ${KOLABXML_VERSION} SOVERSION 0)
+set_target_properties(kolabxml PROPERTIES VERSION ${Libkolabxml_VERSION} SOVERSION ${Libkolabxml_VERSION_MAJOR})
-install(TARGETS kolabxml ${KOLAB_INSTALL_DIRECTORIES})
+install(TARGETS kolabxml EXPORT LibkolabxmlExport
+ RUNTIME DESTINATION ${BIN_INSTALL_DIR}
+ LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
+)
install( FILES
kolabformat.h
@@ -30,23 +35,7 @@ install( FILES
kolabnote.h
kolabcontainers.h
global_definitions.h
- DESTINATION ${KOLAB_HEADER_INSTALL_DIR} COMPONENT Devel)
-
-#----- The following makes sure libkolabxml is found in the install directory for installed files and not in the build directory (for libraries which link to libkolabxml)
-
-# use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH FALSE)
-# when building, don't use the install RPATH already(but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-SET(CMAKE_INSTALL_RPATH "${KOLAB_LIB_INSTALL_DIR}")
-# add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-# the RPATH to be used when installing, but only if it's not a system directory
-LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${KOLAB_LIB_INSTALL_DIR}" isSystemDir)
-IF("${isSystemDir}" STREQUAL "-1")
- SET(CMAKE_INSTALL_RPATH "${KOLAB_LIB_INSTALL_DIR}")
-ENDIF("${isSystemDir}" STREQUAL "-1")
+ DESTINATION ${INCLUDE_INSTALL_DIR})
#-----------------------SWIG--------------------
# Building of the bindings can be controlled using the switches along the lines of: cmake -DPHP_BINDINGS=TRUE -DCSHARP_BINDINGS=FALSE ..