From d736cca848a12788652e366b5554063c99f06cca Mon Sep 17 00:00:00 2001
From: Yuri Kunde Schlesner <yuriks@yuriks.net>
Date: Sat, 27 May 2017 22:34:52 -0700
Subject: [PATCH] CMake: Create INTERFACE targets for microprofile and nihstro

---
 CMakeLists.txt                | 8 ++++++--
 src/citra_qt/CMakeLists.txt   | 2 +-
 src/common/CMakeLists.txt     | 2 +-
 src/video_core/CMakeLists.txt | 2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7f099fd34..9e586633c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -263,8 +263,12 @@ set(DYNARMIC_NO_BUNDLED_FMT ON)
 add_subdirectory(externals/dynarmic)
 
 add_subdirectory(externals/glad)
-include_directories(externals/microprofile)
-include_directories(externals/nihstro/include)
+
+add_library(microprofile INTERFACE)
+target_include_directories(microprofile INTERFACE externals/microprofile)
+
+add_library(nihstro-headers INTERFACE)
+target_include_directories(nihstro-headers INTERFACE externals/nihstro/include)
 
 if (MSVC)
     add_subdirectory(externals/getopt)
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index a70686286..4841cbf05 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -92,7 +92,7 @@ else()
     add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS})
 endif()
 target_link_libraries(citra-qt PRIVATE audio_core common core input_common video_core)
-target_link_libraries(citra-qt PRIVATE Boost::boost glad Qt5::OpenGL Qt5::Widgets)
+target_link_libraries(citra-qt PRIVATE Boost::boost glad nihstro-headers Qt5::OpenGL Qt5::Widgets)
 target_link_libraries(citra-qt PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
 
 if(UNIX AND NOT APPLE)
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index 3899007fe..7e83e64b0 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -95,7 +95,7 @@ endif()
 create_directory_groups(${SRCS} ${HEADERS})
 
 add_library(common STATIC ${SRCS} ${HEADERS})
-target_link_libraries(common PUBLIC Boost::boost)
+target_link_libraries(common PUBLIC Boost::boost microprofile)
 if (ARCHITECTURE_x86_64)
     target_link_libraries(common PRIVATE xbyak)
 endif()
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index 45f4ad2d5..0961a3251 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -80,7 +80,7 @@ create_directory_groups(${SRCS} ${HEADERS})
 
 add_library(video_core STATIC ${SRCS} ${HEADERS})
 target_link_libraries(video_core PUBLIC common core)
-target_link_libraries(video_core PRIVATE glad)
+target_link_libraries(video_core PRIVATE glad nihstro-headers)
 
 if (ARCHITECTURE_x86_64)
     target_link_libraries(video_core PRIVATE xbyak)