summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-28 15:26:15 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-28 15:26:15 (GMT)
commit772ef4645c6137ff66973d5b9a6a9d74cfb24105 (patch)
tree58b8feab7dea05549276dc9fa66976b61f77b6c5
parent2a4a3c925d0f5d44f1192440f86412b99cc6ad9a (diff)
downloadlibkolabxml-772ef4645c6137ff66973d5b9a6a9d74cfb24105.tar.gz
Use the system version of the xsdbin executable if available
-rw-r--r--CMakeLists.txt33
1 files changed, 22 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d007252..86ed94e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -105,18 +105,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)
# ---------