summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2017-05-29 15:12:21 -0700
committerGravatar GitHub2017-05-29 15:12:21 -0700
commita4f88c7d7c94107df6bfada31617ff553bb5e89e (patch)
treecb0d3adbbe115604051300ae451a22a4de751b27
parentMerge pull request #2729 from yuriks/quaternion-fix (diff)
parentCMake: Re-organize root CMakeLists.txt file (diff)
downloadyuzu-a4f88c7d7c94107df6bfada31617ff553bb5e89e.tar.gz
yuzu-a4f88c7d7c94107df6bfada31617ff553bb5e89e.tar.xz
yuzu-a4f88c7d7c94107df6bfada31617ff553bb5e89e.zip
Merge pull request #2734 from yuriks/cmake-imported-libs
CMake: Use CMake target properties for all libraries
-rwxr-xr-x.travis-deps.sh2
-rw-r--r--CMakeLists.txt180
-rw-r--r--externals/CMakeLists.txt52
-rw-r--r--externals/cryptopp/CMakeLists.txt6
-rw-r--r--externals/glad/CMakeLists.txt3
-rw-r--r--externals/inih/CMakeLists.txt1
-rw-r--r--src/audio_core/CMakeLists.txt5
-rw-r--r--src/citra/CMakeLists.txt6
-rw-r--r--src/citra_qt/CMakeLists.txt2
-rw-r--r--src/common/CMakeLists.txt1
-rw-r--r--src/core/CMakeLists.txt6
-rw-r--r--src/input_common/CMakeLists.txt3
-rw-r--r--src/tests/CMakeLists.txt6
-rw-r--r--src/video_core/CMakeLists.txt7
14 files changed, 160 insertions, 120 deletions
diff --git a/.travis-deps.sh b/.travis-deps.sh
index 1404fe19f..451886984 100755
--- a/.travis-deps.sh
+++ b/.travis-deps.sh
@@ -11,7 +11,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" -o -z "$TRAVIS_OS_NAME" ]; then
11 11
12 if [ ! -e $HOME/.local/bin/cmake ]; then 12 if [ ! -e $HOME/.local/bin/cmake ]; then
13 echo "CMake not found in the cache, get and extract it..." 13 echo "CMake not found in the cache, get and extract it..."
14 curl -L http://www.cmake.org/files/v3.2/cmake-3.2.0-Linux-i386.tar.gz \ 14 curl -L http://www.cmake.org/files/v3.6/cmake-3.6.3-Linux-x86_64.tar.gz \
15 | tar -xz -C $HOME/.local --strip-components=1 15 | tar -xz -C $HOME/.local --strip-components=1
16 else 16 else
17 echo "Using cached CMake" 17 echo "Using cached CMake"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 121b0f2f8..1f0af2d41 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,20 +1,25 @@
1# CMake 3.2 required for cmake to know the right flags for CXX standard on OSX 1# CMake 3.6 required for FindBoost to define IMPORTED libs properly on unknown Boost versions
2cmake_minimum_required(VERSION 3.2) 2cmake_minimum_required(VERSION 3.6)
3set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/CMakeModules) 3list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules")
4list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules")
4 5
5function(download_bundled_external remote_path lib_name prefix_var) 6project(citra)
6 set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}") 7
7 if (NOT EXISTS "${prefix}") 8option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
8 message(STATUS "Downloading binaries for ${lib_name}...") 9option(CITRA_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF)
9 file(DOWNLOAD 10
10 https://github.com/citra-emu/ext-windows-bin/raw/master/${remote_path}${lib_name}.7z 11option(ENABLE_QT "Enable the Qt frontend" ON)
11 "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" SHOW_PROGRESS) 12option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF)
12 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" 13
13 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals") 14if(NOT EXISTS ${CMAKE_SOURCE_DIR}/.git/hooks/pre-commit)
14 endif() 15 message(STATUS "Copying pre-commit hook")
15 message(STATUS "Using bundled binaries at ${prefix}") 16 file(COPY hooks/pre-commit
16 set(${prefix_var} "${prefix}" PARENT_SCOPE) 17 DESTINATION ${CMAKE_SOURCE_DIR}/.git/hooks)
17endfunction() 18endif()
19
20
21# Detect current compilation architecture and create standard definitions
22# =======================================================================
18 23
19include(CheckSymbolExists) 24include(CheckSymbolExists)
20function(detect_architecture symbol arch) 25function(detect_architecture symbol arch)
@@ -33,20 +38,6 @@ function(detect_architecture symbol arch)
33 endif() 38 endif()
34endfunction() 39endfunction()
35 40
36project(citra)
37
38option(ENABLE_SDL2 "Enable the SDL2 frontend" ON)
39option(CITRA_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF)
40
41option(ENABLE_QT "Enable the Qt frontend" ON)
42option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF)
43
44if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks/pre-commit)
45 message(STATUS "Copying pre-commit hook")
46 file(COPY hooks/pre-commit
47 DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/.git/hooks)
48endif()
49
50if (MSVC) 41if (MSVC)
51 detect_architecture("_M_AMD64" x86_64) 42 detect_architecture("_M_AMD64" x86_64)
52 detect_architecture("_M_IX86" x86) 43 detect_architecture("_M_IX86" x86)
@@ -63,6 +54,10 @@ if (NOT DEFINED ARCHITECTURE)
63endif() 54endif()
64message(STATUS "Target architecture: ${ARCHITECTURE}") 55message(STATUS "Target architecture: ${ARCHITECTURE}")
65 56
57
58# Configure compilation flags
59# ===========================
60
66set(CMAKE_CXX_STANDARD 14) 61set(CMAKE_CXX_STANDARD 14)
67set(CMAKE_CXX_STANDARD_REQUIRED ON) 62set(CMAKE_CXX_STANDARD_REQUIRED ON)
68 63
@@ -130,28 +125,44 @@ add_definitions(-DSINGLETHREADED)
130set_property(DIRECTORY APPEND PROPERTY 125set_property(DIRECTORY APPEND PROPERTY
131 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>) 126 COMPILE_DEFINITIONS $<$<CONFIG:Debug>:_DEBUG> $<$<NOT:$<CONFIG:Debug>>:NDEBUG>)
132 127
128
129# System imported libraries
130# ======================
131
132# This function downloads a binary library package from our external repo.
133# Params:
134# remote_path: path to the file to download, relative to the remote repository root
135# prefix_var: name of a variable which will be set with the path to the extracted contents
136function(download_bundled_external remote_path lib_name prefix_var)
137 set(prefix "${CMAKE_BINARY_DIR}/externals/${lib_name}")
138 if (NOT EXISTS "${prefix}")
139 message(STATUS "Downloading binaries for ${lib_name}...")
140 file(DOWNLOAD
141 https://github.com/citra-emu/ext-windows-bin/raw/master/${remote_path}${lib_name}.7z
142 "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z" SHOW_PROGRESS)
143 execute_process(COMMAND ${CMAKE_COMMAND} -E tar xf "${CMAKE_BINARY_DIR}/externals/${lib_name}.7z"
144 WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/externals")
145 endif()
146 message(STATUS "Using bundled binaries at ${prefix}")
147 set(${prefix_var} "${prefix}" PARENT_SCOPE)
148endfunction()
149
133find_package(PNG QUIET) 150find_package(PNG QUIET)
134if (PNG_FOUND) 151if (NOT PNG_FOUND)
135 add_definitions(-DHAVE_PNG)
136else()
137 message(STATUS "libpng not found. Some debugging features have been disabled.") 152 message(STATUS "libpng not found. Some debugging features have been disabled.")
138endif() 153endif()
139 154
140find_package(Boost 1.57.0 QUIET) 155find_package(Boost 1.63.0 QUIET)
141if (NOT Boost_FOUND) 156if (NOT Boost_FOUND)
142 message(STATUS "Boost 1.57.0 or newer not found, falling back to externals") 157 message(STATUS "Boost 1.63.0 or newer not found, falling back to externals")
143 set(Boost_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/externals/boost")
144endif()
145include_directories(${Boost_INCLUDE_DIR})
146
147# Include bundled CMake modules
148list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules")
149 158
150find_package(OpenGL REQUIRED) 159 set(BOOST_ROOT "${CMAKE_SOURCE_DIR}/externals/boost")
151include_directories(${OPENGL_INCLUDE_DIR}) 160 set(Boost_NO_SYSTEM_PATHS OFF)
161 find_package(Boost QUIET REQUIRED)
162endif()
152 163
153# Prefer the -pthread flag on Linux. 164# Prefer the -pthread flag on Linux.
154set (THREADS_PREFER_PTHREAD_FLAG ON) 165set(THREADS_PREFER_PTHREAD_FLAG ON)
155find_package(Threads REQUIRED) 166find_package(Threads REQUIRED)
156 167
157if (ENABLE_SDL2) 168if (ENABLE_SDL2)
@@ -174,10 +185,43 @@ if (ENABLE_SDL2)
174 else() 185 else()
175 find_package(SDL2 REQUIRED) 186 find_package(SDL2 REQUIRED)
176 endif() 187 endif()
188
189 if (SDL2_FOUND)
190 # TODO(yuriks): Make FindSDL2.cmake export an IMPORTED library instead
191 add_library(SDL2 INTERFACE)
192 target_link_libraries(SDL2 INTERFACE "${SDL2_LIBRARY}")
193 target_include_directories(SDL2 INTERFACE "${SDL2_INCLUDE_DIR}")
194 endif()
177else() 195else()
178 set(SDL2_FOUND NO) 196 set(SDL2_FOUND NO)
179endif() 197endif()
180 198
199if (ENABLE_QT)
200 if (CITRA_USE_BUNDLED_QT)
201 if (MSVC14 AND ARCHITECTURE_x86_64)
202 set(QT_VER qt-5.7-msvc2015_64)
203 else()
204 message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable CITRA_USE_BUNDLED_QT and provide your own.")
205 endif()
206
207 if (DEFINED QT_VER)
208 download_bundled_external("qt/" ${QT_VER} QT_PREFIX)
209 endif()
210
211 set(QT_PREFIX_HINT HINTS "${QT_PREFIX}")
212 else()
213 # Passing an empty HINTS seems to cause default system paths to get ignored in CMake 2.8 so
214 # make sure to not pass anything if we don't have one.
215 set(QT_PREFIX_HINT)
216 endif()
217
218 find_package(Qt5 REQUIRED COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT})
219endif()
220
221
222# Platform-specific library requirements
223# ======================================
224
181IF (APPLE) 225IF (APPLE)
182 FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related 226 FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related
183 set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY}) 227 set(PLATFORM_LIBRARIES ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY})
@@ -206,28 +250,9 @@ if (UNIX OR MINGW)
206 endif() 250 endif()
207endif() 251endif()
208 252
209if (ENABLE_QT)
210 if (CITRA_USE_BUNDLED_QT)
211 if (MSVC14 AND ARCHITECTURE_x86_64)
212 set(QT_VER qt-5.7-msvc2015_64)
213 else()
214 message(FATAL_ERROR "No bundled Qt binaries for your toolchain. Disable CITRA_USE_BUNDLED_QT and provide your own.")
215 endif()
216
217 if (DEFINED QT_VER)
218 download_bundled_external("qt/" ${QT_VER} QT_PREFIX)
219 endif()
220 253
221 set(QT_PREFIX_HINT HINTS "${QT_PREFIX}") 254# Include source code
222 else() 255# ===================
223 # Passing an empty HINTS seems to cause default system paths to get ignored in CMake 2.8 so
224 # make sure to not pass anything if we don't have one.
225 set(QT_PREFIX_HINT)
226 endif()
227
228 find_package(Qt5 REQUIRED COMPONENTS Widgets OpenGL ${QT_PREFIX_HINT})
229 set(CITRA_QT_LIBS Qt5::Widgets Qt5::OpenGL)
230endif()
231 256
232# This function should be passed a list of all files in a target. It will automatically generate 257# This function should be passed a list of all files in a target. It will automatically generate
233# file groups following the directory hierarchy, so that the layout of the files in IDEs matches the 258# file groups following the directory hierarchy, so that the layout of the files in IDEs matches the
@@ -251,30 +276,13 @@ get_git_head_revision(GIT_REF_SPEC GIT_REV)
251git_describe(GIT_DESC --always --long --dirty) 276git_describe(GIT_DESC --always --long --dirty)
252git_branch_name(GIT_BRANCH) 277git_branch_name(GIT_BRANCH)
253 278
254set(INI_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/externals/inih")
255include_directories(${INI_PREFIX})
256add_subdirectory(${INI_PREFIX})
257
258add_subdirectory(externals) 279add_subdirectory(externals)
259 280add_subdirectory(src)
260option(DYNARMIC_TESTS OFF)
261set(DYNARMIC_NO_BUNDLED_FMT ON)
262add_subdirectory(externals/dynarmic)
263
264add_subdirectory(externals/glad)
265include_directories(externals/microprofile)
266include_directories(externals/nihstro/include)
267
268if (MSVC)
269 add_subdirectory(externals/getopt)
270endif()
271
272# process subdirectories
273add_subdirectory(externals/soundtouch)
274
275enable_testing() 281enable_testing()
276 282
277add_subdirectory(src) 283
284# Installation instructions
285# =========================
278 286
279# Install freedesktop.org metadata files, following those specifications: 287# Install freedesktop.org metadata files, following those specifications:
280# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html 288# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt
index 57fc5d566..1e04931ee 100644
--- a/externals/CMakeLists.txt
+++ b/externals/CMakeLists.txt
@@ -1,12 +1,52 @@
1# Definitions for all external bundled libraries
2
3# Catch
4add_library(catch-single-include INTERFACE)
5target_include_directories(catch-single-include INTERFACE catch/single_include)
6
7# Crypto++
8add_subdirectory(cryptopp)
9
10# Dynarmic
11# Dynarmic will skip defining xbyak if it's already defined, we then define it below
12add_library(xbyak INTERFACE)
13option(DYNARMIC_TESTS OFF)
14set(DYNARMIC_NO_BUNDLED_FMT ON)
15add_subdirectory(dynarmic)
16
17# libfmt
18add_subdirectory(fmt)
19
20# getopt
21if (MSVC)
22 add_subdirectory(getopt)
23endif()
24
25# Glad
26add_subdirectory(glad)
27
28# inih
29add_subdirectory(inih)
30
31# MicroProfile
32add_library(microprofile INTERFACE)
33target_include_directories(microprofile INTERFACE ./microprofile)
34
35# Nihstro
36add_library(nihstro-headers INTERFACE)
37target_include_directories(nihstro-headers INTERFACE ./nihstro/include)
38
39# SoundTouch
40add_subdirectory(soundtouch)
41# The SoundTouch target doesn't export the necessary include paths as properties by default
42target_include_directories(SoundTouch INTERFACE ./soundtouch/include)
43
1# Xbyak 44# Xbyak
2if (ARCHITECTURE_x86_64) 45if (ARCHITECTURE_x86_64)
3 add_library(xbyak INTERFACE) 46 # Defined before "dynarmic" above
4 target_include_directories(xbyak INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/xbyak/xbyak) 47 # add_library(xbyak INTERFACE)
48 target_include_directories(xbyak INTERFACE ./xbyak/xbyak)
5 if (NOT MSVC) 49 if (NOT MSVC)
6 target_compile_options(xbyak INTERFACE -fno-operator-names) 50 target_compile_options(xbyak INTERFACE -fno-operator-names)
7 endif() 51 endif()
8endif() 52endif()
9
10add_subdirectory(cryptopp)
11
12add_subdirectory(fmt)
diff --git a/externals/cryptopp/CMakeLists.txt b/externals/cryptopp/CMakeLists.txt
index 653af1e4b..864de18bb 100644
--- a/externals/cryptopp/CMakeLists.txt
+++ b/externals/cryptopp/CMakeLists.txt
@@ -10,6 +10,7 @@
10# - disabled installation 10# - disabled installation
11# - disabled documentation 11# - disabled documentation
12# - configured to build a static library only 12# - configured to build a static library only
13# - adds include directories to the library target
13 14
14include(TestBigEndian) 15include(TestBigEndian)
15include(CheckCXXCompilerFlag) 16include(CheckCXXCompilerFlag)
@@ -148,14 +149,15 @@ endif()
148# Compile targets 149# Compile targets
149#============================================================================ 150#============================================================================
150add_library(cryptopp STATIC ${cryptopp_SOURCES}) 151add_library(cryptopp STATIC ${cryptopp_SOURCES})
152target_include_directories(cryptopp INTERFACE .)
151 153
152#============================================================================ 154#============================================================================
153# Third-party libraries 155# Third-party libraries
154#============================================================================ 156#============================================================================
155 157
156if(WIN32) 158if(WIN32)
157 target_link_libraries(cryptopp ws2_32) 159 target_link_libraries(cryptopp PRIVATE ws2_32)
158endif() 160endif()
159 161
160find_package(Threads) 162find_package(Threads)
161target_link_libraries(cryptopp ${CMAKE_THREAD_LIBS_INIT}) 163target_link_libraries(cryptopp PRIVATE ${CMAKE_THREAD_LIBS_INIT})
diff --git a/externals/glad/CMakeLists.txt b/externals/glad/CMakeLists.txt
index a97d4aa73..6d35a844b 100644
--- a/externals/glad/CMakeLists.txt
+++ b/externals/glad/CMakeLists.txt
@@ -9,6 +9,7 @@ set(HEADERS
9create_directory_groups(${SRCS} ${HEADERS}) 9create_directory_groups(${SRCS} ${HEADERS})
10add_library(glad STATIC ${SRCS} ${HEADERS}) 10add_library(glad STATIC ${SRCS} ${HEADERS})
11target_include_directories(glad PUBLIC "include/") 11target_include_directories(glad PUBLIC "include/")
12
12if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux") 13if ("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
13 target_link_libraries(glad dl) 14 target_link_libraries(glad PRIVATE dl)
14endif() 15endif()
diff --git a/externals/inih/CMakeLists.txt b/externals/inih/CMakeLists.txt
index c87f78bfc..cff36a581 100644
--- a/externals/inih/CMakeLists.txt
+++ b/externals/inih/CMakeLists.txt
@@ -9,3 +9,4 @@ set(HEADERS
9 9
10create_directory_groups(${SRCS} ${HEADERS}) 10create_directory_groups(${SRCS} ${HEADERS})
11add_library(inih ${SRCS} ${HEADERS}) 11add_library(inih ${SRCS} ${HEADERS})
12target_include_directories(inih INTERFACE .)
diff --git a/src/audio_core/CMakeLists.txt b/src/audio_core/CMakeLists.txt
index c571213fc..0ad86bb7a 100644
--- a/src/audio_core/CMakeLists.txt
+++ b/src/audio_core/CMakeLists.txt
@@ -27,12 +27,9 @@ set(HEADERS
27 time_stretch.h 27 time_stretch.h
28 ) 28 )
29 29
30include_directories(../../externals/soundtouch/include)
31
32if(SDL2_FOUND) 30if(SDL2_FOUND)
33 set(SRCS ${SRCS} sdl2_sink.cpp) 31 set(SRCS ${SRCS} sdl2_sink.cpp)
34 set(HEADERS ${HEADERS} sdl2_sink.h) 32 set(HEADERS ${HEADERS} sdl2_sink.h)
35 include_directories(${SDL2_INCLUDE_DIR})
36endif() 33endif()
37 34
38create_directory_groups(${SRCS} ${HEADERS}) 35create_directory_groups(${SRCS} ${HEADERS})
@@ -42,6 +39,6 @@ target_link_libraries(audio_core PUBLIC common core)
42target_link_libraries(audio_core PRIVATE SoundTouch) 39target_link_libraries(audio_core PRIVATE SoundTouch)
43 40
44if(SDL2_FOUND) 41if(SDL2_FOUND)
45 target_link_libraries(audio_core PRIVATE ${SDL2_LIBRARY}) 42 target_link_libraries(audio_core PRIVATE SDL2)
46 target_compile_definitions(audio_core PRIVATE HAVE_SDL2) 43 target_compile_definitions(audio_core PRIVATE HAVE_SDL2)
47endif() 44endif()
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt
index 9eddb342b..d72d2b5f4 100644
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@ -15,15 +15,13 @@ set(HEADERS
15 15
16create_directory_groups(${SRCS} ${HEADERS}) 16create_directory_groups(${SRCS} ${HEADERS})
17 17
18include_directories(${SDL2_INCLUDE_DIR})
19
20add_executable(citra ${SRCS} ${HEADERS}) 18add_executable(citra ${SRCS} ${HEADERS})
21target_link_libraries(citra PRIVATE common core input_common) 19target_link_libraries(citra PRIVATE common core input_common)
22target_link_libraries(citra PRIVATE ${SDL2_LIBRARY} ${OPENGL_gl_LIBRARY} inih glad) 20target_link_libraries(citra PRIVATE inih glad)
23if (MSVC) 21if (MSVC)
24 target_link_libraries(citra PRIVATE getopt) 22 target_link_libraries(citra PRIVATE getopt)
25endif() 23endif()
26target_link_libraries(citra PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) 24target_link_libraries(citra PRIVATE ${PLATFORM_LIBRARIES} SDL2 Threads::Threads)
27 25
28if(UNIX AND NOT APPLE) 26if(UNIX AND NOT APPLE)
29 install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin") 27 install(TARGETS citra RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt
index 809e0b938..4841cbf05 100644
--- a/src/citra_qt/CMakeLists.txt
+++ b/src/citra_qt/CMakeLists.txt
@@ -92,7 +92,7 @@ else()
92 add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) 92 add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS})
93endif() 93endif()
94target_link_libraries(citra-qt PRIVATE audio_core common core input_common video_core) 94target_link_libraries(citra-qt PRIVATE audio_core common core input_common video_core)
95target_link_libraries(citra-qt PRIVATE ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS} glad) 95target_link_libraries(citra-qt PRIVATE Boost::boost glad nihstro-headers Qt5::OpenGL Qt5::Widgets)
96target_link_libraries(citra-qt PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) 96target_link_libraries(citra-qt PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads)
97 97
98if(UNIX AND NOT APPLE) 98if(UNIX AND NOT APPLE)
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt
index a33a8cdbe..7e83e64b0 100644
--- a/src/common/CMakeLists.txt
+++ b/src/common/CMakeLists.txt
@@ -95,6 +95,7 @@ endif()
95create_directory_groups(${SRCS} ${HEADERS}) 95create_directory_groups(${SRCS} ${HEADERS})
96 96
97add_library(common STATIC ${SRCS} ${HEADERS}) 97add_library(common STATIC ${SRCS} ${HEADERS})
98target_link_libraries(common PUBLIC Boost::boost microprofile)
98if (ARCHITECTURE_x86_64) 99if (ARCHITECTURE_x86_64)
99 target_link_libraries(common PRIVATE xbyak) 100 target_link_libraries(common PRIVATE xbyak)
100endif() 101endif()
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 7aa81e885..3cdb2b817 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -374,11 +374,7 @@ set(HEADERS
374 telemetry_session.h 374 telemetry_session.h
375 ) 375 )
376 376
377include_directories(../../externals/dynarmic/include)
378include_directories(../../externals/cryptopp)
379
380create_directory_groups(${SRCS} ${HEADERS}) 377create_directory_groups(${SRCS} ${HEADERS})
381
382add_library(core STATIC ${SRCS} ${HEADERS}) 378add_library(core STATIC ${SRCS} ${HEADERS})
383target_link_libraries(core PUBLIC common PRIVATE audio_core video_core) 379target_link_libraries(core PUBLIC common PRIVATE audio_core video_core)
384target_link_libraries(core PRIVATE cryptopp dynarmic) 380target_link_libraries(core PUBLIC Boost::boost PRIVATE cryptopp dynarmic)
diff --git a/src/input_common/CMakeLists.txt b/src/input_common/CMakeLists.txt
index 5b306e42e..e3e36ada7 100644
--- a/src/input_common/CMakeLists.txt
+++ b/src/input_common/CMakeLists.txt
@@ -13,7 +13,6 @@ set(HEADERS
13if(SDL2_FOUND) 13if(SDL2_FOUND)
14 set(SRCS ${SRCS} sdl/sdl.cpp) 14 set(SRCS ${SRCS} sdl/sdl.cpp)
15 set(HEADERS ${HEADERS} sdl/sdl.h) 15 set(HEADERS ${HEADERS} sdl/sdl.h)
16 include_directories(${SDL2_INCLUDE_DIR})
17endif() 16endif()
18 17
19create_directory_groups(${SRCS} ${HEADERS}) 18create_directory_groups(${SRCS} ${HEADERS})
@@ -22,6 +21,6 @@ add_library(input_common STATIC ${SRCS} ${HEADERS})
22target_link_libraries(input_common PUBLIC core PRIVATE common) 21target_link_libraries(input_common PUBLIC core PRIVATE common)
23 22
24if(SDL2_FOUND) 23if(SDL2_FOUND)
25 target_link_libraries(input_common PRIVATE ${SDL2_LIBRARY}) 24 target_link_libraries(input_common PRIVATE SDL2)
26 target_compile_definitions(input_common PRIVATE HAVE_SDL2) 25 target_compile_definitions(input_common PRIVATE HAVE_SDL2)
27endif() 26endif()
diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt
index 85f2f2985..00d7c636a 100644
--- a/src/tests/CMakeLists.txt
+++ b/src/tests/CMakeLists.txt
@@ -10,11 +10,9 @@ set(HEADERS
10 10
11create_directory_groups(${SRCS} ${HEADERS}) 11create_directory_groups(${SRCS} ${HEADERS})
12 12
13include_directories(../../externals/catch/single_include/)
14
15add_executable(tests ${SRCS} ${HEADERS}) 13add_executable(tests ${SRCS} ${HEADERS})
16target_link_libraries(tests PRIVATE common core) 14target_link_libraries(tests PRIVATE common core)
17target_link_libraries(tests PRIVATE glad) # To support linker work-around 15target_link_libraries(tests PRIVATE glad) # To support linker work-around
18target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} Threads::Threads) 16target_link_libraries(tests PRIVATE ${PLATFORM_LIBRARIES} catch-single-include Threads::Threads)
19 17
20add_test(NAME tests COMMAND $<TARGET_FILE:tests>) 18add_test(NAME tests COMMAND tests)
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt
index e455f03bd..0961a3251 100644
--- a/src/video_core/CMakeLists.txt
+++ b/src/video_core/CMakeLists.txt
@@ -80,14 +80,13 @@ create_directory_groups(${SRCS} ${HEADERS})
80 80
81add_library(video_core STATIC ${SRCS} ${HEADERS}) 81add_library(video_core STATIC ${SRCS} ${HEADERS})
82target_link_libraries(video_core PUBLIC common core) 82target_link_libraries(video_core PUBLIC common core)
83target_link_libraries(video_core PRIVATE glad) 83target_link_libraries(video_core PRIVATE glad nihstro-headers)
84 84
85if (ARCHITECTURE_x86_64) 85if (ARCHITECTURE_x86_64)
86 target_link_libraries(video_core PRIVATE xbyak) 86 target_link_libraries(video_core PRIVATE xbyak)
87endif() 87endif()
88 88
89if (PNG_FOUND) 89if (PNG_FOUND)
90 target_link_libraries(video_core PRIVATE ${PNG_LIBRARIES}) 90 target_link_libraries(video_core PRIVATE PNG::PNG)
91 target_include_directories(video_core PRIVATE ${PNG_INCLUDE_DIRS}) 91 target_compile_definitions(video_core PRIVATE HAVE_PNG)
92 target_compile_definitions(video_core PRIVATE ${PNG_DEFINITIONS})
93endif() 92endif()