From 13a82b3d671c9d84eca941b4bac570dda1de59b5 Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sun, 10 Apr 2022 00:18:11 +0200 Subject: [PATCH] CMake: Fix building tests and sample after making target includes private --- build/cmake/functions.cmake | 1 + build/cmake/samples/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/build/cmake/functions.cmake b/build/cmake/functions.cmake index f08c9f09c1..79893cc71b 100644 --- a/build/cmake/functions.cmake +++ b/build/cmake/functions.cmake @@ -836,6 +836,7 @@ function(wx_add name group) elseif(group STREQUAL Tests) target_include_directories(${target_name} PRIVATE ${wxSOURCE_DIR}/tests) target_include_directories(${target_name} PRIVATE ${wxSOURCE_DIR}/3rdparty/catch/include) + target_include_directories(${target_name} PRIVATE ${wxTOOLKIT_INCLUDE_DIRS}) endif() if(APP_DATA) diff --git a/build/cmake/samples/CMakeLists.txt b/build/cmake/samples/CMakeLists.txt index 9e86778b18..015f171a6c 100644 --- a/build/cmake/samples/CMakeLists.txt +++ b/build/cmake/samples/CMakeLists.txt @@ -218,6 +218,8 @@ wx_list_add_prefix(WIDGETS_RC_FILES icons/ wx_add_sample(widgets IMPORTANT ${SAMPLE_WIDGETS_SRC} DATA ${WIDGETS_RC_FILES} textctrl.cpp ../image/toucan.png:toucan.png ) +# includes needed by the native widget (like gtk.h) +target_include_directories(widgets PRIVATE ${wxTOOLKIT_INCLUDE_DIRS}) wx_add_sample(wizard DATA wiztest.svg wiztest2.svg DEPENDS wxUSE_WIZARDDLG) wx_add_sample(wrapsizer)