include(GNUInstallDirs)
+#
+# Configuration defaults
+#
if(WINCE)
set(BUILD_tools_default OFF)
else()
set(MSVC_USE_STATIC_CRT OFF CACHE BOOL "Use /MT flag (static CRT) when compiling in MSVC")
endif()
+#
+# Environment checks
+#
if(USE_libbsd)
find_library(LIB_BSD NAMES bsd)
if(NOT LIB_BSD)
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Add a suffix, usually d on Windows")
endif(WIN32)
+#
+# C library
+#
set(expat_SRCS
lib/xmlparse.c
lib/xmlrole.c
expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+#
+# pkg-config file
+#
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
configure_file(expat.pc.in ${CMAKE_CURRENT_BINARY_DIR}/expat.pc @ONLY)
expat_install(FILES ${CMAKE_CURRENT_BINARY_DIR}/expat.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+#
+# C command line tool xmlwf
+#
if(BUILD_tools)
set(xmlwf_SRCS
xmlwf/xmlwf.c
endif()
endif()
+#
+# C code examples
+#
if(BUILD_examples)
add_executable(elements examples/elements.c)
set_property(TARGET elements PROPERTY RUNTIME_OUTPUT_DIRECTORY examples)
target_link_libraries(outline expat)
endif(BUILD_examples)
+#
+# C/C++ test runners
+#
if(BUILD_tests)
## these are unittests that can be run on any platform
set(test_SRCS