From: Ingo Ruhnke Date: Sun, 3 Aug 2014 18:42:33 +0000 (+0200) Subject: Use TARGET_INCLUDE_DIRECTORIES instead of INCLUDE_DIRECTORIES for SDL2, fixed MARK_AS... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=963fb96f4ab81e543d83b3ec0e23ffd4e9b1e6e2;p=supertux.git Use TARGET_INCLUDE_DIRECTORIES instead of INCLUDE_DIRECTORIES for SDL2, fixed MARK_AS_ADVANCED() --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e82c27a6..676d2a422 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,10 +68,7 @@ LINK_DIRECTORIES(${Boost_LIBRARY_DIRS}) INCLUDE(FindPkgConfig) PKG_SEARCH_MODULE(SDL2 REQUIRED sdl2) -INCLUDE_DIRECTORIES(${SDL2_INCLUDE_DIRS}) - PKG_SEARCH_MODULE(SDL2IMAGE REQUIRED SDL2_image>=2.0.0) -INCLUDE_DIRECTORIES(${SDL2IMAGE_INCLUDE_DIRS}) SET(HAVE_SDL TRUE) OPTION(ENABLE_OPENGL "Enable OpenGL support" ON) @@ -342,9 +339,12 @@ ADD_DEPENDENCIES(supertux2 gitversion) ## Link supertux binary with squirrel and other libraries -TARGET_LINK_LIBRARIES(supertux2 squirrel) +TARGET_INCLUDE_DIRECTORIES(supertux2 PUBLIC ${SDL2_INCLUDE_DIRS}) +TARGET_INCLUDE_DIRECTORIES(supertux2 PUBLIC ${SDL2IMAGE_INCLUDE_DIRS}) TARGET_LINK_LIBRARIES(supertux2 ${SDL2_LIBRARIES}) TARGET_LINK_LIBRARIES(supertux2 ${SDL2IMAGE_LIBRARIES}) + +TARGET_LINK_LIBRARIES(supertux2 squirrel) TARGET_LINK_LIBRARIES(supertux2 ${OPENAL_LIBRARY}) TARGET_LINK_LIBRARIES(supertux2 ${OGGVORBIS_LIBRARIES}) TARGET_LINK_LIBRARIES(supertux2 ${PHYSFS_LIBRARY}) @@ -475,14 +475,13 @@ MARK_AS_ADVANCED( ) MARK_AS_ADVANCED( - SDLMAIN_LIBRARY - SDL_INCLUDE_DIR - SDL_LIBRARY + SDL2_INCLUDE_DIRS + SDL2_LIBRARIES ) MARK_AS_ADVANCED( - SDLIMAGE_INCLUDE_DIR - SDLIMAGE_LIBRARY + SDL2IMAGE_INCLUDE_DIRS + SDL2IMAGE_LIBRARIES ) MARK_AS_ADVANCED(