From 39d7c47f041ac0401e9dcd39638af2327f5982c5 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 18 Apr 2023 22:49:33 -0600 Subject: [PATCH] Ensure public header path gets propagated to downstream targets --- CMakeLists.txt | 3 --- cmake/Macros.cmake | 3 +++ 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0acaf52..a797fd9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,9 +18,6 @@ project(CSFML VERSION 2.5.1) # include the configuration file include(${PROJECT_SOURCE_DIR}/cmake/Config.cmake) -# add the CSFML header path -include_directories(${PROJECT_SOURCE_DIR}/include) - # add an option for choosing the build type (shared or static) csfml_set_option(BUILD_SHARED_LIBS TRUE BOOL "TRUE to build CSFML as shared libraries, FALSE to build it as static libraries") diff --git a/cmake/Macros.cmake b/cmake/Macros.cmake index 5f4072e..9d86aec 100644 --- a/cmake/Macros.cmake +++ b/cmake/Macros.cmake @@ -12,6 +12,9 @@ macro(csfml_add_library target) # create the target add_library(${target} ${THIS_SOURCES}) + # add the CSFML header path + target_include_directories(${target} PUBLIC ${PROJECT_SOURCE_DIR}/include) + # define the export symbol of the module string(REPLACE "-" "_" NAME_UPPER "${target}") string(TOUPPER "${NAME_UPPER}" NAME_UPPER)