diff --git a/CMakeLists.txt b/CMakeLists.txt index e6d9562..2f2c7d6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -62,6 +62,7 @@ if (LIBECPINT_BUILD_TESTS) include(external/ImportGTest.cmake) enable_testing() add_subdirectory(tests) + add_subdirectory(example) endif() option(LIBECPINT_BUILD_DOCS "Enables Libecpint documentation." ON) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 1d77253..e00f4a7 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -6,9 +6,12 @@ project( LibecpintExample LANGUAGES CXX) add_executable(example example.cpp) -target_link_libraries(example PRIVATE ecpint Faddeeva pugixml) +target_link_libraries(example PRIVATE ecpint) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/iodine.bas DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/hydrogen.bas DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) +add_test(NAME example + COMMAND example + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4da25e3..33c49d6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -87,6 +87,10 @@ endif() # ========= install(TARGETS ecpint EXPORT ecpintTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}) +if (LIBECPINT_USE_PUGIXML) + # used in api.h + target_compile_definitions(ecpint PUBLIC HAS_PUGIXML) +endif() include(CMakePackageConfigHelpers) # Version file write_basic_package_version_file(