diff options
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/msvc.cmake | 1 | ||||
-rw-r--r-- | editor/CMakeLists.txt | 11 |
3 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c92d30f..e9cd6e6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(CMAKE_SKIP_INSTALL_RPATH FALSE) set(CMAKE_SKIP_RPATH FALSE) +set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0068 NEW) + if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT OR CMAKE_INSTALL_PREFIX STREQUAL "") set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install" CACHE PATH "" FORCE) endif() diff --git a/cmake/msvc.cmake b/cmake/msvc.cmake index c9fca955..59dde4fe 100644 --- a/cmake/msvc.cmake +++ b/cmake/msvc.cmake @@ -45,7 +45,6 @@ if(DEFINED CMAKE_TOOLCHAIN_FILE) set(CMAKE_TOOLCHAIN_FILE "${CMAKE_TOOLCHAIN_FILE}}") endif() -set(CMAKE_POLICY_DEFAULT_CMP0069 NEW CACHE INTERNAL "" FORCE) #set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) set(CMAKE_C_EXTENSIONS FALSE) diff --git a/editor/CMakeLists.txt b/editor/CMakeLists.txt index 38db2a04..f1455e32 100644 --- a/editor/CMakeLists.txt +++ b/editor/CMakeLists.txt @@ -10,7 +10,16 @@ else() endif() add_library(${self}_o STATIC "${sources}") -target_link_libraries(${self}_o PUBLIC MagnumIntegration::ImGui SDL2::SDL2 fmt::fmt nlohmann_json::nlohmann_json) +target_link_libraries(${self}_o PUBLIC MagnumIntegration::ImGui fmt::fmt nlohmann_json::nlohmann_json) + +if(NOT SDL2_INCLUDE_DIRS) + if(NOT TARGET SDL2::SDL2) + find_package(SDL2 QUIET REQUIRED) + else() + get_target_property(SDL2_INCLUDE_DIRS SDL2::SDL2 INTERFACE_INCLUDE_DIRECTORIES) + endif() +endif() +target_include_directories(${self}_o SYSTEM PRIVATE "${SDL2_INCLUDE_DIRS}") add_executable(${self} "${res}") target_link_libraries(${self} PUBLIC ${self}_o floormat-main floormat-loader floormat-serialize) |