Page MenuHomePhorge

No OneTemporary

Authored By
Unknown
Size
9 KB
Referenced Files
None
Subscribers
None
diff --git a/.gitignore b/.gitignore
index 99bb8e6..2325ff8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,21 +1,20 @@
*~
CMakeFiles
CMakeCache.txt
moc_*
*.moc
-*.cmake
*.pyc
.*.swp
configure
config.status
config.log
Makefile
Makefile.in
ChangeLog
autom4te.cache
aclocal.m4
libkolabxml-*.tar.gz
libkolabxml-*.*/
libkolabxml.spec
build
*kdev4*
diff --git a/c++/CMakeLists.txt b/c++/CMakeLists.txt
index 0fb586e..c76f992 100644
--- a/c++/CMakeLists.txt
+++ b/c++/CMakeLists.txt
@@ -1,125 +1,127 @@
project(kolabxmlbindings)
cmake_minimum_required(VERSION 2.6)
# only available from cmake-2.8.0
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7)
cmake_policy(SET CMP0012 NEW)
endif()
# only available from cmake-2.8.4
if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND
${CMAKE_PATCH_VERSION} GREATER 3)
cmake_policy(SET CMP0017 NEW)
endif()
+include( ../cmake/modules/FindKolabInternal.cmake )
+
find_package(Boost COMPONENTS thread REQUIRED)
if (${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.42)
find_library(UUID NAMES uuid)
if(UUID)
message("uuid found")
else (UUID)
message(FATAL_ERROR "uuid NOT found!")
endif(UUID)
endif()
find_package(Qt4)
find_program( XSDCXX xsdcxx /usr/bin/)
if(XSDCXX)
message("xsd code generator found")
else (XSDCXX)
message(FATAL_ERROR
"xsd code generator NOT found!")
endif(XSDCXX)
find_library(XERCES_C NAMES xerces-c xerces-c_2)
if(XERCES_C)
message("xerces found")
else (XERCES_C)
message(FATAL_ERROR
"xerces NOT found!")
endif(XERCES_C)
find_program(SWIG swig /usr/bin/)
if(SWIG)
set(SWIG_FOUND ON)
message("SWIG found")
endif(SWIG)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall" )
# set( CMAKE_VERBOSE_MAKEFILE on )
set(CMAKE_BUILD_TYPE Debug)
set(CMAKE_BUILD_DIR ${CMAKE_SOURCE_DIR}/build)
file(MAKE_DIRECTORY ${CMAKE_BUILD_DIR}/bindings)
set( SCHEMA_DIR ${CMAKE_SOURCE_DIR}/../schemas )
# Generate bindings
set( SCHEMAS
${SCHEMA_DIR}/ical/kolabformat-xcal.xsd
${SCHEMA_DIR}/ical/iCalendar-params.xsd
${SCHEMA_DIR}/ical/iCalendar-props.xsd
${SCHEMA_DIR}/ical/iCalendar-valtypes.xsd
${SCHEMA_DIR}/xCard.xsd
${SCHEMA_DIR}/kolabformat-xcard.xsd
${SCHEMA_DIR}/kolabformat.xsd
)
set( SCHEMA_SOURCEFILES
${CMAKE_BUILD_DIR}/bindings/kolabformat.cxx
${CMAKE_BUILD_DIR}/bindings/xCard.cxx
${CMAKE_BUILD_DIR}/bindings/kolabformat-xcal.cxx
${CMAKE_BUILD_DIR}/bindings/kolabformat-xcard.cxx
${CMAKE_BUILD_DIR}/bindings/iCalendar-params.cxx
${CMAKE_BUILD_DIR}/bindings/iCalendar-props.cxx
${CMAKE_BUILD_DIR}/bindings/iCalendar-valtypes.cxx
# bindings/iCalendar-link-extension.cxx
# bindings/iCalendar-bw-extensions.cxx
# bindings/iCalendar-ms-extensions.cxx
)
#xsdcxx cxx-tree --generate-xml-schema --generate-serialization --custom-type date_time --hxx-epilogue '#include "bindings/customtypes/xml-schema-custom.hxx"' xml-schema.xsd
# --generate-inline --extern-xml-schema xml-schema.xsd
# --cxx-suffix .cpp --hxx-suffix .h
add_custom_command(OUTPUT ${SCHEMA_SOURCEFILES}
COMMAND ${XSDCXX} cxx-tree --generate-polymorphic --generate-serialization --namespace-map http://kolab.org=KolabXSD --root-element icalendar --root-element vcards --root-element note --output-dir ${CMAKE_BUILD_DIR}/bindings ${SCHEMAS}
COMMENT "Generating XSD bindings"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${SCHEMAS}
VERBATIM
)
# Compile Schemas
add_executable(xsdbin compiled/xsdbin.cxx)
target_link_libraries(xsdbin ${XERCES_C})
add_custom_command(OUTPUT kolabformat-xcal-schema.cxx
COMMAND ${CMAKE_BUILD_DIR}/xsdbin --verbose --array-name iCalendar_schema --output-dir ${CMAKE_BUILD_DIR} ${SCHEMAS}
COMMENT "Compiling Kolab XSD schema"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
DEPENDS ${SCHEMAS} xsdbin
VERBATIM
)
set( SCHEMA_SOURCEFILES ${SCHEMA_SOURCEFILES} ${CMAKE_BUILD_DIR}/kolabformat-xcal-schema.cxx)
# ---------
SET_SOURCE_FILES_PROPERTIES(${SCHEMA_SOURCEFILES} PROPERTIES GENERATED 1)
ADD_CUSTOM_TARGET(generate_bindings ALL DEPENDS ${SCHEMA_SOURCEFILES})
include_directories( ./ )
include_directories( compiled )
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
add_subdirectory(lib)
if (${QT_FOUND})
add_subdirectory(tests)
endif()
diff --git a/c++/lib/CMakeLists.txt b/c++/lib/CMakeLists.txt
index 7b7e163..90f31f0 100644
--- a/c++/lib/CMakeLists.txt
+++ b/c++/lib/CMakeLists.txt
@@ -1,51 +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 LIBRARY DESTINATION lib)
+
+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 include/kolab COMPONENT Devel)
+ 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 "${CMAKE_INSTALL_PREFIX}/lib")
+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 "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${KOLAB_LIB_INSTALL_DIR}" isSystemDir)
IF("${isSystemDir}" STREQUAL "-1")
- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ 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()
diff --git a/cmake/modules/FindKolabInternal.cmake b/cmake/modules/FindKolabInternal.cmake
new file mode 100644
index 0000000..1ccf0d5
--- /dev/null
+++ b/cmake/modules/FindKolabInternal.cmake
@@ -0,0 +1,44 @@
+
+# The install directory is defined by the CMAKE_INSTALL_PREFIX which defaults to /usr/local if not specified.
+# To install i.e. to /usr use "cmake -DCMAKE_INSTALL_PREFIX=/usr ."
+#
+# The library directory suffix (64/32) is detected automatically based on the available directories in CMAKE_INSTALL_PREFIX
+# The Result of this can be overridden by setting KOLAB_LIB_INSTALL_DIR "cmake -DKOLAB_LIB_INSTALL_DIR=/usr/lib64/ ."
+#
+# The runtime install is controlled by KOLAB_BIN_INSTALL_DIR
+#
+# KOLAB_INSTALL_DIRECTORIES contains the determined install directories and should be used with install commands
+
+get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+
+if (${LIB64} STREQUAL "TRUE")
+ find_path(LIB32FOUND "${CMAKE_INSTALL_PREFIX}/lib32")
+ find_path(LIB64FOUND "${CMAKE_INSTALL_PREFIX}/lib64")
+ if (LIB64FOUND)
+ set(LIBSUFFIX 64)
+ else()
+ set(LIBSUFFIX "")
+ endif()
+else()
+ set(LIBSUFFIX "")
+endif()
+
+if(KOLAB_LIB_INSTALL_DIR)
+ message("KOLAB_LIB_INSTALL_DIR specified manually")
+else()
+ set(KOLAB_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}")
+endif()
+message("KOLAB_LIB_INSTALL_DIR: ${KOLAB_LIB_INSTALL_DIR}")
+
+if(KOLAB_BIN_INSTALL_DIR)
+ message("KOLAB_BIN_INSTALL_DIR specified manually")
+else()
+ set(KOLAB_BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif()
+message("KOLAB_BIN_INSTALL_DIR: ${KOLAB_BIN_INSTALL_DIR}")
+
+set(KOLAB_INSTALL_DIRECTORIES RUNTIME DESTINATION "${KOLAB_BIN_INSTALL_DIR}"
+ LIBRARY DESTINATION "${KOLAB_LIB_INSTALL_DIR}"
+ ARCHIVE DESTINATION "${KOLAB_LIB_INSTALL_DIR}" COMPONENT Devel )
+
+set(KOLAB_HEADER_INSTALL_DIR "${INCLUDE_INSTALL_DIR}/kolab")

File Metadata

Mime Type
text/x-diff
Expires
Sat, Apr 4, 6:43 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
18822877
Default Alt Text
(9 KB)

Event Timeline