summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-03-28 15:00:46 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-03-28 15:00:46 (GMT)
commitd9cd309ff6d2c7ad2c497a1d12fb8b5e05505fda (patch)
treeb216cd8c8bac4f972dd194f24a7f56097ae57373 /src/CMakeLists.txt
parent1288bf09e5f92b5123d4e5b127b904353bceba80 (diff)
downloadlibkolabxml-d9cd309ff6d2c7ad2c497a1d12fb8b5e05505fda.tar.gz
Renamed lib to src
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..90f31f0
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,52 @@
+
+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
+
+#Library with serialization/deserialization code and kolab-containers
+add_library(kolabxml SHARED kolabformat.cpp kolabcontainers.cpp kolabnote.cpp kolabevent.cpp kolabtodo.cpp kolabjournal.cpp kolabcontact.cpp utils.cpp base64.cpp ../compiled/XMLParserWrapper.cpp ../compiled/grammar-input-stream.cxx ${SCHEMA_SOURCEFILES})
+
+target_link_libraries(kolabxml ${XERCES_C} ${Boost_LIBRARIES} ${UUID})
+
+#For the core library we can be stricter when compiling. This doesn't work with the auto generated code though.
+set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wl,--no-undefined")
+set_target_properties(kolabxml PROPERTIES VERSION 3.0.0 SOVERSION 0)
+
+install(TARGETS kolabxml ${KOLAB_INSTALL_DIRECTORIES})
+
+install( FILES
+ kolabformat.h
+ kolabevent.h
+ kolabtodo.h
+ kolabjournal.h
+ kolabcontact.h
+ 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")
+
+#-----------------------SWIG--------------------
+
+if (SWIG_FOUND)
+ add_subdirectory(python)
+ add_subdirectory(php)
+else()
+ message(WARNING "Could not build SWIG bindings, because SWIG is missing.")
+endif()
+