Massive CMake refactoring... No code changes. (0.37.55)
This commit is contained in:
parent
a63aff3daa
commit
501be417e8
22 changed files with 513 additions and 568 deletions
25
cmake/Extensions/XML2.cmake
Normal file
25
cmake/Extensions/XML2.cmake
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# XML (libxml2)
|
||||
option(FUN_WITH_XML2 "Enable XML (libxml2) support" OFF)
|
||||
set(LIBXML2_INCLUDE_DIRS "")
|
||||
set(LIBXML2_LINK_LIBS "")
|
||||
if(FUN_WITH_XML2)
|
||||
add_definitions(-DFUN_WITH_XML2)
|
||||
find_package(PkgConfig QUIET)
|
||||
if(PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(LIBXML2 QUIET libxml-2.0)
|
||||
endif()
|
||||
if(LIBXML2_FOUND)
|
||||
list(APPEND LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIRS})
|
||||
list(APPEND LIBXML2_LINK_LIBS ${LIBXML2_LINK_LIBS} ${LIBXML2_LIBRARIES})
|
||||
else()
|
||||
find_library(LIBXML2_LIB NAMES xml2 libxml2)
|
||||
if(LIBXML2_LIB)
|
||||
list(APPEND LIBXML2_LINK_LIBS ${LIBXML2_LIB})
|
||||
if(EXISTS "/usr/include/libxml2")
|
||||
list(APPEND LIBXML2_INCLUDE_DIRS "/usr/include/libxml2")
|
||||
endif()
|
||||
else()
|
||||
message(FATAL_ERROR "libxml2 not found. Install libxml2 (dev headers) or disable FUN_WITH_XML2.")
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
Loading…
Add table
Add a link
Reference in a new issue