From b2f6fab6f49f1ed32e40e565bf911ead79dde0c2 Mon Sep 17 00:00:00 2001 From: Nadia Holmquist Pedersen Date: Mon, 11 Nov 2024 12:05:08 +0100 Subject: [PATCH] cmake: use interface include directories properly and fix an indent I guess --- src/CMakeLists.txt | 4 +++- src/frontend/qt_sdl/CMakeLists.txt | 11 +++++------ src/net/CMakeLists.txt | 6 +++--- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1f947d11..6df0e82e 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -127,6 +127,8 @@ if (ENABLE_JIT) endif() endif() +target_include_directories(core INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}") + set(MELONDS_VERSION_SUFFIX "$ENV{MELONDS_VERSION_SUFFIX}" CACHE STRING "Suffix to add to displayed melonDS version") option(MELONDS_EMBED_BUILD_INFO "Embed detailed build info into the binary" OFF) set(MELONDS_GIT_BRANCH "$ENV{MELONDS_GIT_BRANCH}" CACHE STRING "The Git branch used for this build") @@ -184,7 +186,7 @@ elseif(NOT APPLE AND NOT HAIKU) target_link_libraries(core PRIVATE rt) endif() elseif(HAIKU) - target_link_libraries(core PRIVATE network) + target_link_libraries(core PRIVATE network) endif() if (ENABLE_JIT_PROFILING) diff --git a/src/frontend/qt_sdl/CMakeLists.txt b/src/frontend/qt_sdl/CMakeLists.txt index 54888c49..fa1fafd8 100644 --- a/src/frontend/qt_sdl/CMakeLists.txt +++ b/src/frontend/qt_sdl/CMakeLists.txt @@ -91,8 +91,7 @@ add_compile_definitions(ARCHIVE_SUPPORT_ENABLED) add_executable(melonDS ${SOURCES_QT_SDL}) add_subdirectory("../../net" - "${CMAKE_BINARY_DIR}/net" -) + ${CMAKE_BINARY_DIR}/net) target_link_libraries(melonDS PRIVATE net-utils) @@ -171,10 +170,10 @@ if (BUILD_STATIC) endif() endif() -target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") -target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..") -target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../../net") +target_include_directories(melonDS PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/..") + if (USE_QT6) target_include_directories(melonDS PUBLIC ${Qt6Gui_PRIVATE_INCLUDE_DIRS}) else() diff --git a/src/net/CMakeLists.txt b/src/net/CMakeLists.txt index 6ca24de6..657aa9fd 100644 --- a/src/net/CMakeLists.txt +++ b/src/net/CMakeLists.txt @@ -11,9 +11,9 @@ add_library(net-utils STATIC MPInterface.cpp ) -target_include_directories(net-utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}") -target_include_directories(net-utils PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..") - +target_include_directories(net-utils PUBLIC + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_CURRENT_SOURCE_DIR}/..") option(USE_SYSTEM_LIBSLIRP "Use system libslirp instead of the bundled version" OFF) if (USE_SYSTEM_LIBSLIRP)