2016-03-02 21:26:49 +01:00
|
|
|
# Expat CPP sources to be excluded from globbed SRCS_G
|
|
|
|
# They are added back on the list if POCO_UNBUNDLED is not set
|
|
|
|
set(EXPAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/src/xmlparse.cpp")
|
|
|
|
|
2014-08-22 17:10:24 +02:00
|
|
|
# Sources
|
|
|
|
file(GLOB SRCS_G "src/*.cpp")
|
2016-03-02 21:26:49 +01:00
|
|
|
list(REMOVE_ITEM SRCS_G ${EXPAT_CPP})
|
2014-08-22 17:10:24 +02:00
|
|
|
POCO_SOURCES_AUTO( SRCS ${SRCS_G})
|
|
|
|
|
|
|
|
# Headers
|
|
|
|
file(GLOB_RECURSE HDRS_G "include/*.h" )
|
|
|
|
POCO_HEADERS_AUTO( SRCS ${HDRS_G})
|
2014-07-09 16:04:53 +02:00
|
|
|
|
|
|
|
# If POCO_UNBUNDLED is enabled we try to find the required packages
|
|
|
|
# The configuration will fail if the packages are not found
|
|
|
|
if (POCO_UNBUNDLED)
|
|
|
|
find_package(EXPAT REQUIRED)
|
|
|
|
else()
|
2014-08-22 17:10:24 +02:00
|
|
|
POCO_SOURCES( SRCS expat
|
2014-07-09 16:04:53 +02:00
|
|
|
src/xmlparse.cpp
|
|
|
|
src/xmlrole.c
|
|
|
|
src/xmltok.c
|
|
|
|
src/xmltok_impl.c
|
|
|
|
src/xmltok_ns.c
|
|
|
|
)
|
|
|
|
endif (POCO_UNBUNDLED)
|
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
add_library(XML ${SRCS} )
|
2014-07-09 16:04:53 +02:00
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
add_library(Poco::XML ALIAS XML)
|
|
|
|
set_target_properties( XML
|
2014-08-22 17:10:24 +02:00
|
|
|
PROPERTIES
|
|
|
|
VERSION ${SHARED_LIBRARY_VERSION} SOVERSION ${SHARED_LIBRARY_VERSION}
|
2018-06-03 18:17:50 +02:00
|
|
|
OUTPUT_NAME PocoXML
|
2014-10-09 13:42:51 +02:00
|
|
|
DEFINE_SYMBOL XML_EXPORTS
|
|
|
|
)
|
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
target_link_libraries(XML PUBLIC ${EXPAT_LIBRARIES} Poco::Foundation)
|
|
|
|
target_include_directories(XML
|
2014-10-09 13:42:51 +02:00
|
|
|
PUBLIC
|
|
|
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
|
|
|
$<INSTALL_INTERFACE:include>
|
|
|
|
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
|
|
)
|
2012-11-11 11:28:44 +01:00
|
|
|
|
2018-06-03 18:17:50 +02:00
|
|
|
if (POCO_UNBUNDLED)
|
|
|
|
target_include_directories(XML PUBLIC "${EXPAT_INCLUDE_DIRS}")
|
|
|
|
target_compile_definitions(XML PUBLIC POCO_UNBUNDLED)
|
|
|
|
else()
|
|
|
|
if(WIN32)
|
|
|
|
#TODO: Is XML_STATIC only required with Windows? What does it do?
|
|
|
|
target_compile_definitions(XML PUBLIC XML_STATIC)
|
|
|
|
endif()
|
|
|
|
target_compile_definitions(XML
|
|
|
|
PUBLIC XML_DTD
|
|
|
|
PRIVATE XML_NS HAVE_EXPAT_CONFIG_H)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
POCO_INSTALL(XML)
|
|
|
|
POCO_GENERATE_PACKAGE(XML)
|
2014-10-09 13:42:51 +02:00
|
|
|
|
2012-11-11 11:28:44 +01:00
|
|
|
if (ENABLE_TESTS)
|
2018-06-03 18:17:50 +02:00
|
|
|
add_subdirectory(samples)
|
|
|
|
add_subdirectory(testsuite)
|
2012-11-11 11:28:44 +01:00
|
|
|
endif ()
|
|
|
|
|