From: Nehal J Wani Date: Mon, 15 Feb 2021 20:19:14 +0000 (-0500) Subject: common: CMake: specify include directory of expat X-Git-Tag: 2.50.0~56^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b53c3dda7bff02907a0daa8757f378237fff2a6e;p=graphviz 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. --- 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)