Commit f9149cc1 authored by Daniel Wortmann's avatar Daniel Wortmann

Added XML tests for the C-part to make sure not only library but also include files are found

parent c2c996d0
#include <libxml/parser.h>
#include <libxml/tree.h>
#include <libxml/xmlschemas.h>
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
int main()
{
return 0;
}
......@@ -17,9 +17,23 @@ try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/te
endif()
endif()
message("XML Library found:${FLEUR_USE_XML}")
message("XML Library found for linking:${FLEUR_USE_XML}")
if (FLEUR_USE_XML)
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c
LINK_LIBRARIES ${FLEUR_LIBRARIES})
if (NOT FLEUR_USE_XML)
find_package(LibXml2)
set(CMAKE_C_FLAGS "-I${LIBXML2_INCLUDE_DIR}")
try_compile(FLEUR_USE_XML ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/cmake/tests/test_XML.c
LINK_LIBRARIES ${FLEUR_LIBRARIES})
endif()
endif()
message("XML Library found for C:${FLEUR_USE_XML}")
if (FLEUR_USE_XML)
set(FLEUR_DEFINITIONS ${FLEUR_DEFINITIONS} "CPP_XML")
set(FLEUR_MPI_DEFINITIONS ${FLEUR_MPI_DEFINITIONS} "CPP_XML")
endif()
\ No newline at end of file
endif()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment