summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2012-03-28 18:20:42 (GMT)
committerChristian Mollekopf <chrigi_1@fastmail.fm>2012-03-28 18:20:42 (GMT)
commitf24bfc50d0b3015e27338847a1ae414ce63630d4 (patch)
tree19e24f940f2f1738bf545eab061330e8321b7afd
parentedad5da5eef5b49457905f1ee525a3584e244d40 (diff)
parente583a03639161c795c443a082df1c815396ab203 (diff)
downloadlibkolabxml-f24bfc50d0b3015e27338847a1ae414ce63630d4.tar.gz
Merge remote-tracking branch 'remotes/origin/master'
-rw-r--r--CMakeLists.txt33
-rwxr-xr-xautogen-mingw32.sh9
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/php/CMakeLists.txt44
-rw-r--r--src/python/CMakeLists.txt36
5 files changed, 77 insertions, 49 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ac07b71..5f67c32 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -116,18 +116,29 @@ add_custom_command(OUTPUT ${SCHEMA_SOURCEFILES}
)
# Compile Schemas
-add_executable(xsdbin compiled/xsdbin.cxx)
-target_link_libraries(xsdbin ${XERCES_C})
+find_program(XSDBIN_FOUND xsdbin)
+
+if (XSDBIN_FOUND)
+ add_custom_command(OUTPUT kolabformat-xcal-schema.cxx
+ COMMAND ${XSDBIN_FOUND} --verbose --array-name iCalendar_schema --output-dir ${CMAKE_BUILD_DIR} ${SCHEMAS}
+ COMMENT "Compiling Kolab XSD schema"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ DEPENDS ${SCHEMAS}
+ VERBATIM
+ )
+else (XSDBIN_FOUND)
+ 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
+ )
+endif (XSDBIN_FOUND)
-
-
-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)
# ---------
diff --git a/autogen-mingw32.sh b/autogen-mingw32.sh
new file mode 100755
index 0000000..0f61c5a
--- /dev/null
+++ b/autogen-mingw32.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+# Rebuilds the entire foo in one go. One shot, one kill.
+
+rm -rf build/
+mkdir -p build
+cd build
+mingw32-cmake ..
+make
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index cc6c0ed..53ca792 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,12 +3,12 @@ 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
+# 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})
add_dependencies(kolabxml generate_bindings)
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.
+# 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 ${KOLABXML_VERSION} SOVERSION 0)
diff --git a/src/php/CMakeLists.txt b/src/php/CMakeLists.txt
index 7cfc5c7..31ea9c6 100644
--- a/src/php/CMakeLists.txt
+++ b/src/php/CMakeLists.txt
@@ -19,23 +19,27 @@ if (APPLE)
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flat_namespace -undefined suppress" )
endif()
-find_package(PHP4)
-include_directories(${PHP4_INCLUDE_PATH})
-add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
-target_link_libraries(phpbindings kolabxml ${PHP_LIBRARIES})
-SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
-SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
-
-configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
-
-if (KOLAB_PHP_INSTALL_DIR)
- set(PHP_INSTALL_DIR ${KOLAB_PHP_INSTALL_DIR})
-else (KOLAB_PHP_INSTALL_DIR)
- set(PHP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
-endif (KOLAB_PHP_INSTALL_DIR)
-
-install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
-
-install( FILES
- ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
- DESTINATION ${PHP_INSTALL_DIR}) \ No newline at end of file
+find_package(PHP)
+
+if (PHP_FOUND)
+ include_directories(${PHP_INCLUDE_PATH})
+ add_library(phpbindings SHARED ${KOLAB_SWIG_PHP_SOURCE_FILE})
+ target_link_libraries(phpbindings kolabxml ${PHP_LIBRARIES})
+ SET_TARGET_PROPERTIES(phpbindings PROPERTIES OUTPUT_NAME "kolabformat")
+ SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
+
+ configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+
+ if (KOLAB_PHP_INSTALL_DIR)
+ set(PHP_INSTALL_DIR ${KOLAB_PHP_INSTALL_DIR})
+ else (KOLAB_PHP_INSTALL_DIR)
+ set(PHP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
+ endif (KOLAB_PHP_INSTALL_DIR)
+
+ install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
+
+ install( FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
+ DESTINATION ${PHP_INSTALL_DIR}
+ )
+endif (PHP_FOUND)
diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt
index 7f0cdd1..ac5deed 100644
--- a/src/python/CMakeLists.txt
+++ b/src/python/CMakeLists.txt
@@ -15,25 +15,29 @@ ADD_CUSTOM_TARGET(generate_python_bindings ALL DEPENDS ${KOLAB_SWIG_PYTHON_SOURC
# Compile Python Bindings
find_package(PythonLibs)
-include_directories(${PYTHON_INCLUDE_DIRS})
-# python_add_module(kolabformat ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
+if (PythonLibs_FOUND)
+ include_directories(${PYTHON_INCLUDE_DIRS})
-add_library(pythonbindings SHARED ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
-target_link_libraries(pythonbindings kolabxml ${PYTHON_LIBRARY})
-SET_TARGET_PROPERTIES(pythonbindings PROPERTIES OUTPUT_NAME "_kolabformat")
-SET_TARGET_PROPERTIES(pythonbindings PROPERTIES PREFIX "")
+ # python_add_module(kolabformat ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
-configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
+ add_library(pythonbindings SHARED ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
+ target_link_libraries(pythonbindings kolabxml ${PYTHON_LIBRARY})
+ SET_TARGET_PROPERTIES(pythonbindings PROPERTIES OUTPUT_NAME "_kolabformat")
+ SET_TARGET_PROPERTIES(pythonbindings PROPERTIES PREFIX "")
-if (KOLAB_PYTHON_INSTALL_DIR)
- set(PYTHON_INSTALL_DIR ${KOLAB_PYTHON_INSTALL_DIR})
-else (KOLAB_PYTHON_INSTALL_DIR)
- set(PYTHON_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
-endif (KOLAB_PYTHON_INSTALL_DIR)
+ configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
-install(TARGETS pythonbindings LIBRARY DESTINATION ${PYTHON_INSTALL_DIR})
+ if (KOLAB_PYTHON_INSTALL_DIR)
+ set(PYTHON_INSTALL_DIR ${KOLAB_PYTHON_INSTALL_DIR})
+ else (KOLAB_PYTHON_INSTALL_DIR)
+ set(PYTHON_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
+ endif (KOLAB_PYTHON_INSTALL_DIR)
-install( FILES
- ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.py
- DESTINATION ${PYTHON_INSTALL_DIR}) \ No newline at end of file
+ install(TARGETS pythonbindings LIBRARY DESTINATION ${PYTHON_INSTALL_DIR})
+
+ install( FILES
+ ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.py
+ DESTINATION ${PYTHON_INSTALL_DIR}
+ )
+endif (PythonLibs_FOUND)