From b53c3dda7bff02907a0daa8757f378237fff2a6e Mon Sep 17 00:00:00 2001 From: Nehal J Wani Date: Mon, 15 Feb 2021 15:19:14 -0500 Subject: [PATCH] common: CMake: specify include directory of expat A build system should not rely on the existence of 3rd party library/header files in standard prefixes as one might want to compile and link against a patched build or a custom install in some non-standard location. This is also helpful for developers who rely on package managers like Conda or Spack for their daily development. If expat is a dep, we need to pass -I/path/containing/expat.h to the compiler while compiling the source files of the target 'common_obj', without which, one can face the following issue: graphviz/lib/common/htmllex.c:28:10: fatal error: expat.h: No such file or directory 28 | #include | ^~~~~~~~~ compilation terminated. --- lib/common/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/common/CMakeLists.txt b/lib/common/CMakeLists.txt index b858ededa..f39a32157 100644 --- a/lib/common/CMakeLists.txt +++ b/lib/common/CMakeLists.txt @@ -106,6 +106,7 @@ target_include_directories(common_obj PRIVATE ${GRAPHVIZ_LIB_DIR}/pack ${GRAPHVIZ_LIB_DIR}/pathplan ${GRAPHVIZ_LIB_DIR}/xdot + ${EXPAT_INCLUDE_DIRS} ) if (WIN32) -- 2.40.0