From 7426004700b569862d0714d75016ebdf74ebf0b6 Mon Sep 17 00:00:00 2001 From: Christophe Prud'homme Date: Mon, 8 Jan 2024 19:00:56 +0000 Subject: [PATCH] fix find pugixml via spack install --- cmake/FindPugiXML.cmake | 2 ++ src/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/FindPugiXML.cmake b/cmake/FindPugiXML.cmake index cbbb297..d799fab 100644 --- a/cmake/FindPugiXML.cmake +++ b/cmake/FindPugiXML.cmake @@ -5,6 +5,8 @@ # PUGIXML_INCLUDE_DIR - header location # PUGIXML_LIBRARIES - library to link against # PUGIXML_FOUND - true if pugixml was found. +find_package(PkgConfig REQUIRED) +pkg_search_module(PUGIXML REQUIRED pugixml) find_path (PUGIXML_INCLUDE_DIR NAMES pugixml.hpp PATHS ${PUGIXML_HOME}/include) find_library (PUGIXML_LIBRARY NAMES pugixml PATHS ${PUGIXML_HOME}/lib) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 4ea4546..3eb5dd7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -101,11 +101,12 @@ target_include_directories(fmi4cpp $ PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} + ${PUGIXML_INCLUDE_DIRS} ) target_link_libraries(fmi4cpp PRIVATE - pugixml + ${PUGIXML_LIBRARIES} libzip::libzip )