# -*- Mode: CMake -*- # # CMake build file for the OpenGIS GML 3.1.1 schemas. # # # Add directories to use for finding C++ include files # INCLUDE_DIRECTORIES( ${XSD_INCLUDE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) # # Point to the OpenGIS GML schema directory -- files are in subdirectories # (base, smil, etc.) # SET( GML_DIR "${OGC_BINDINGS_DIR}/schemas/net/opengis/gml/3.1.1" ) # # Set common XSD options # SET( XSD_OPTS --generate-polymorphic --generate-serialization --generate-inline --root-element-none --disable-warning F001 --disable-warning B002 # # Flatten the generated GML directory includes so that everything # is found in this directory. NOTE: could cause problems if names # collide, but so far so good... # --include-regex "'@.*/xlinks[.](.+)@xlinks.$$1'@" --include-regex "'@.*/smil20[.](.+)@smil20.$$1'@" --namespace-map ${GMLNS} ) # # Build the SMIL schema files. Due to a circular-dependency in the schema # definitions, we use the --file-per-type XSD option to generate files for each # type found in the schema files. # FILE( GLOB FILES ${GML_DIR}/smil/*.xsd ) IF( NOT FILES ) MESSAGE( FATAL "No SMIL schema files to process" ) ENDIF( NOT FILES ) FOREACH( FILE ${FILES} ) XSD_SCHEMA( GML_SCHEMA_SRCS ${FILE} ${XSD_OPTS} --file-per-type ) ENDFOREACH( FILE ) # # The following is a list of C++ source files generated by the XSD command # using the --file-per-type option. If we were working in a temporary # directory, we could use the FILE( GLOB ... ) CMake command to identify the # generated files... # SET( SMIL_CXX accumulate.cxx additive.cxx animateColorPrototype.cxx animateColorType.cxx animateMotionPrototype.cxx animateMotionType.cxx animatePrototype.cxx animateType.cxx attributeType.cxx calcMode.cxx fillDefaultType.cxx fillTimingAttrsType.cxx nonNegativeDecimalType.cxx restartDefaultType.cxx restartTimingType.cxx setPrototype.cxx setType.cxx space.cxx syncBehaviorDefaultType.cxx syncBehaviorType.cxx ) # # Generate list of header and inline include files from the list of source # files. # STRING( REPLACE "cxx" "hxx" SMIL_HXX ${SMIL_CXX} ) STRING( REPLACE "cxx" "ixx" SMIL_IXX ${SMIL_CXX} ) # # Tell CMake that these are generated files, and that to clean this build # directory, it must remove all of them. # SET( SMIL_FILES ${SMIL_CXX} ${SMIL_HXX} ${SMIL_IXX} ) SET_SOURCE_FILES_PROPERTIES( ${SMIL_FILES} PROPERTIES GENERATED TRUE ) SET_DIRECTORY_PROPERTIES( PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES "${SMIL_FILES}" ) # # Make the SMIL C++ files part of the GML library build # LIST( APPEND GML_SCHEMA_SRCS ${SMIL_CXX} ) # # Obtain the list of schema files for XLINK package, generate C++ files for # them, and build. FILE( GLOB FILES ${OGC_BINDINGS_DIR}/schemas/net/opengis/xlink/1.0.0/*.xsd ) IF( NOT FILES ) MESSAGE( FATAL "No XLINK schema files to process" ) ENDIF( NOT FILES ) FOREACH( FILE ${FILES} ) XSD_SCHEMA( GML_SCHEMA_SRCS ${FILE} ${XSD_OPTS} ) ENDFOREACH( FILE ) # # Obtain the list of schema files for GML base directory, generate C++ files # for them, and build. # FILE( GLOB FILES ${GML_DIR}/base/*.xsd ) IF( NOT FILES ) MESSAGE( FATAL "No GML schema files to process" ) ENDIF( NOT FILES ) FOREACH( FILE ${FILES} ) XSD_SCHEMA( GML_SCHEMA_SRCS ${FILE} ${XSD_OPTS} ) ENDFOREACH( FILE ) # # Generate the libGML shared library # ADD_LIBRARY( GML SHARED ${GML_SCHEMA_SRCS} ) # # Add the Xerces C libraries to the link stage # TARGET_LINK_LIBRARIES( GML ${XERCESC_LIBRARIES} ) # # Set the installation location for the GML library. Install also performs a # link edit with the installation location for the RPATH. # INSTALL( TARGETS GML LIBRARY DESTINATION lib )