summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt64
1 files changed, 20 insertions, 44 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b40eab7b..695fef36 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,9 +1,10 @@
-FIND_PACKAGE(SDL REQUIRED)
-FIND_PACKAGE(SDL_image REQUIRED)
-FIND_PACKAGE(SDL_mixer REQUIRED)
-FIND_PACKAGE(SDL_net REQUIRED)
-FIND_PACKAGE(SDL_ttf REQUIRED)
-FIND_PACKAGE(SDL_gfx REQUIRED)
+include(FindPkgConfig)
+pkg_check_modules(SDL2 REQUIRED sdl2>=2.0.1)
+pkg_check_modules(SDL2IMAGE REQUIRED SDL2_image)
+pkg_check_modules(SDL2MIXER REQUIRED SDL2_mixer)
+pkg_check_modules(SDL2NET REQUIRED SDL2_net)
+pkg_check_modules(SDL2TTF REQUIRED SDL2_ttf)
+pkg_check_modules(SDL2GFX REQUIRED SDL2_gfx)
FIND_PACKAGE(CURL REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PhysFS REQUIRED)
@@ -34,11 +35,6 @@ ENDIF()
SET(FLAGS "-DPACKAGE_VERSION=\\\"${VERSION}\\\"")
SET(FLAGS "${FLAGS} -DPKG_DATADIR=\\\"${PKG_DATADIR}/\\\"")
SET(FLAGS "${FLAGS} -DLOCALEDIR=\\\"${LOCALEDIR}/\\\"")
-IF (ENABLE_CPP0X)
- SET(FLAGS "${FLAGS} -std=c++0x -DENABLE_CPP0X=1")
-ELSE()
- INCLUDE_DIRECTORIES("cpp0x_compat")
-ENDIF()
IF (ENABLE_NLS)
SET(FLAGS "${FLAGS} -DENABLE_NLS=1")
@@ -69,8 +65,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL SunOS)
SET(EXTRA_LIBRARIES intl)
ENDIF()
-SET(GUICHAN_COMPONENTS "SDL")
-FIND_PACKAGE(Guichan REQUIRED ${GUICHAN_COMPONENTS})
+FIND_PACKAGE(Guichan REQUIRED)
IF (WITH_OPENGL)
FIND_PACKAGE(OpenGL REQUIRED)
@@ -79,20 +74,14 @@ IF (WITH_OPENGL)
MESSAGE(STATUS "OpenGL support enabled")
ENDIF (WITH_OPENGL)
-IF (USE_X11)
- FIND_PACKAGE(X11 REQUIRED)
- INCLUDE_DIRECTORIES(${X11_INCLUDE_DIR})
- SET(FLAGS "${FLAGS} -DUSE_X11")
-ENDIF (USE_X11)
-
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
- ${SDL_INCLUDE_DIR}
- ${SDLIMAGE_INCLUDE_DIR}
- ${SDLMIXER_INCLUDE_DIR}
- ${SDLNET_INCLUDE_DIR}
- ${SDLTTF_INCLUDE_DIR}
- ${SDLGFX_INCLUDE_DIR}
+ ${SDL2_INCLUDE_DIRS}
+ ${SDL2IMAGE_INCLUDE_DIRS}
+ ${SDL2MIXER_INCLUDE_DIRS}
+ ${SDL2NET_INCLUDE_DIRS}
+ ${SDL2TTF_INCLUDE_DIRS}
+ ${SDL2GFX_INCLUDE_DIRS}
${PNG_INCLUDE_DIR}
${PHYSFS_INCLUDE_DIR}
${CURL_INCLUDE_DIR}
@@ -116,19 +105,6 @@ IF (MINGW)
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> -O coff -o <OBJECT> <SOURCE>")
ENDIF()
-# Fix some stuff that gets not hidden by mainline modules
-MARK_AS_ADVANCED(PHYSFS_INCLUDE_DIR)
-MARK_AS_ADVANCED(PHYSFS_LIBRARY)
-MARK_AS_ADVANCED(SDLIMAGE_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLIMAGE_LIBRARY)
-MARK_AS_ADVANCED(SDLMAIN_LIBRARY)
-MARK_AS_ADVANCED(SDLMIXER_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLMIXER_LIBRARY)
-MARK_AS_ADVANCED(SDLNET_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDLNET_LIBRARY)
-MARK_AS_ADVANCED(SDL_INCLUDE_DIR)
-MARK_AS_ADVANCED(SDL_LIBRARY)
-
SET(SRCS
gui/widgets/avatarlistbox.cpp
gui/widgets/avatarlistbox.h
@@ -679,12 +655,12 @@ ENDIF(ENABLE_MANASERV)
TARGET_LINK_LIBRARIES(mana
${INTERNAL_LIBRARIES}
- ${SDLGFX_LIBRARIES}
- ${SDL_LIBRARY}
- ${SDLIMAGE_LIBRARY}
- ${SDLMIXER_LIBRARY}
- ${SDLNET_LIBRARY}
- ${SDLTTF_LIBRARY}
+ ${SDL2_LIBRARIES}
+ ${SDL2GFX_LIBRARIES}
+ ${SDL2IMAGE_LIBRARIES}
+ ${SDL2MIXER_LIBRARIES}
+ ${SDL2NET_LIBRARIES}
+ ${SDL2TTF_LIBRARIES}
${PNG_LIBRARIES}
${PHYSFS_LIBRARY}
${CURL_LIBRARIES}