From 257e1fefff52e4f22a98c47ea87b15d7abb2074a Mon Sep 17 00:00:00 2001 From: Lance Wallis Date: Mon, 17 Jun 2024 21:06:35 -0500 Subject: [PATCH] Make sure 'config.h' doesn't stay in the public include DIR. --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 18151b2..7a9b4c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -43,7 +43,7 @@ endif() # For now assume inline on. option(inline "Enable inline function support." ON) -configure_file(cmakeconfig.h.in ${CMAKE_CURRENT_SOURCE_DIR}/config.h +configure_file(cmakeconfig.h.in config.h @ONLY ) @@ -64,9 +64,11 @@ set(MXML_PRIVATE set(MXML_PUBLIC mxml.h - config.h # TODO: Cmake configure. + ${CMAKE_CURRENT_BINARY_DIR}/config.h ) +message(STATUS ${CMAKE_CURRENT_BINARY_DIR}) + set(MXML_COLLECTIVE ${MXML_PRIVATE} ${MXML_PUBLIC} @@ -76,7 +78,10 @@ add_library(${PROJECT_NAME} ${MXML_COLLECTIVE} ) -# Dfine the header(s) for this library and add to build path. +# For config.h +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +# Define the header(s) for this library and add to build path. target_include_directories(${PROJECT_NAME} PUBLIC $ )