From 37f796438847041e96c134638b531f929623cacc Mon Sep 17 00:00:00 2001 From: King_DuckZ Date: Tue, 24 Oct 2017 20:25:01 +0100 Subject: [PATCH] Fix build error about SDL_platform.h not found. --- lib/clooneljump | 2 +- src/gamelib/CMakeLists.txt | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/clooneljump b/lib/clooneljump index 8669e5e..a1b66e9 160000 --- a/lib/clooneljump +++ b/lib/clooneljump @@ -1 +1 @@ -Subproject commit 8669e5e67476a1e6c6e6582e2fd46b1a29100b0c +Subproject commit a1b66e99f0fee32f72cb39676e1fc9c957cba96d diff --git a/src/gamelib/CMakeLists.txt b/src/gamelib/CMakeLists.txt index a004f95..140d7aa 100644 --- a/src/gamelib/CMakeLists.txt +++ b/src/gamelib/CMakeLists.txt @@ -1,7 +1,7 @@ project(mycurry_gamelib CXX) -PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) -PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0) +PKG_SEARCH_MODULE(SDL2 REQUIRED IMPORTED_TARGET sdl2) +PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED IMPORTED_TARGET SDL2_image>=2.0.0) find_package(PNG REQUIRED) add_library(${PROJECT_NAME} @@ -22,13 +22,12 @@ add_library(${PROJECT_NAME} drawable.cpp drawing_queue.cpp world_moveable.cpp + collider.cpp ) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 14) set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD_REQUIRED ON) target_include_directories(${PROJECT_NAME} SYSTEM - PRIVATE ${SDL2_INCLUDE_DIR} - PRIVATE ${SDL2IMAGE_INCLUDE_DIRS} PRIVATE ${PNG_INCLUDE_DIRS} PRIVATE ${Boost_INCLUDE_DIRS} ) @@ -38,8 +37,8 @@ target_include_directories(${PROJECT_NAME} ) target_link_libraries(${PROJECT_NAME} - PRIVATE ${SDL2_LIBRARIES} - PRIVATE ${SDL2IMAGE_LIBRARIES} + PRIVATE PkgConfig::SDL2 + PRIVATE PkgConfig::SDL2IMAGE PRIVATE ${PNG_LIBRARIES} PUBLIC mycurry_toplevel PUBLIC cloonelgraphics