From 331c178bd824bd7b0aa984ea47aeb839559b8f1e Mon Sep 17 00:00:00 2001 From: Bryan Bernhart Date: Tue, 14 Jun 2022 12:31:28 -0700 Subject: [PATCH] Fix non-standalone Windows CMake build. Fixes: cannot open "gpgmm_d3d12.h" and min/max defintion errors when compiling with CMake. --- CMakeLists.txt | 13 +++++++++---- src/gpgmm/CMakeLists.txt | 6 +++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a1542c0d7..3a4c15321 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,12 +120,17 @@ endif() ################################################################################ # GPGMM's public and common "configs" ################################################################################ +set(GPGMM_INCLUDE_DIRS + "${GPGMM_ROOT_DIR}/src" + "${GPGMM_INCLUDE_DIR}" +) + +# Where GPGMM public .h files can be found. +# Sets directory for header files to be searched. +include_directories(${GPGMM_INCLUDE_DIRS}) add_library(gpgmm_public_config INTERFACE) -target_include_directories(gpgmm_public_config INTERFACE - "${GPGMM_ROOT_DIR}/src" - "${GPGMM_ROOT_DIR}/src/include" -) +target_include_directories(gpgmm_public_config INTERFACE "${GPGMM_INCLUDE_DIRS}") add_library(gpgmm_common_config INTERFACE) target_link_libraries(gpgmm_common_config INTERFACE gpgmm_public_config) diff --git a/src/gpgmm/CMakeLists.txt b/src/gpgmm/CMakeLists.txt index df5610ca4..51ae91757 100644 --- a/src/gpgmm/CMakeLists.txt +++ b/src/gpgmm/CMakeLists.txt @@ -21,9 +21,9 @@ if (BUILD_SHARED_LIBS) endif() target_link_libraries(gpgmm - PRIVATE gpgmm_utils - gpgmm_common - gpgmm_common_config + PUBLIC gpgmm_utils + gpgmm_common + gpgmm_common_config ) # Only win32 app needs to link with user32.lib