diff options
Diffstat (limited to 'CMakeLists.txt')
| -rw-r--r-- | CMakeLists.txt | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index b8a981711..d6a4a915a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -35,8 +35,8 @@ endfunction() | |||
| 35 | 35 | ||
| 36 | project(citra) | 36 | project(citra) |
| 37 | 37 | ||
| 38 | option(ENABLE_GLFW "Enable the GLFW frontend" ON) | 38 | option(ENABLE_SDL2 "Enable the SDL2 frontend" ON) |
| 39 | option(CITRA_USE_BUNDLED_GLFW "Download bundled GLFW binaries" OFF) | 39 | option(CITRA_USE_BUNDLED_SDL2 "Download bundled SDL2 binaries" OFF) |
| 40 | 40 | ||
| 41 | option(ENABLE_QT "Enable the Qt frontend" ON) | 41 | option(ENABLE_QT "Enable the Qt frontend" ON) |
| 42 | option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) | 42 | option(CITRA_USE_BUNDLED_QT "Download bundled Qt binaries" OFF) |
| @@ -135,34 +135,29 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") | |||
| 135 | find_package(OpenGL REQUIRED) | 135 | find_package(OpenGL REQUIRED) |
| 136 | include_directories(${OPENGL_INCLUDE_DIR}) | 136 | include_directories(${OPENGL_INCLUDE_DIR}) |
| 137 | 137 | ||
| 138 | if (ENABLE_GLFW) | 138 | if (ENABLE_SDL2) |
| 139 | if (CITRA_USE_BUNDLED_GLFW) | 139 | if (CITRA_USE_BUNDLED_SDL2) |
| 140 | # Detect toolchain and platform | 140 | # Detect toolchain and platform |
| 141 | if (MSVC14 AND ARCHITECTURE_x86_64) | 141 | if (MSVC14 AND ARCHITECTURE_x86_64) |
| 142 | set(GLFW_VER "glfw-3.1.1-msvc2015_64") | 142 | set(SDL2_VER "SDL2-2.0.4") |
| 143 | elseif (MSVC12 AND ARCHITECTURE_x86_64) | ||
| 144 | set(GLFW_VER "glfw-3.1.1-msvc2013_64") | ||
| 145 | else() | 143 | else() |
| 146 | message(FATAL_ERROR "No bundled GLFW binaries for your toolchain. Disable CITRA_USE_BUNDLED_GLFW and provide your own.") | 144 | message(FATAL_ERROR "No bundled SDL2 binaries for your toolchain. Disable CITRA_USE_BUNDLED_SDL2 and provide your own.") |
| 147 | endif() | 145 | endif() |
| 148 | 146 | ||
| 149 | if (DEFINED GLFW_VER) | 147 | if (DEFINED SDL2_VER) |
| 150 | download_bundled_external("glfw/" ${GLFW_VER} GLFW_PREFIX) | 148 | download_bundled_external("sdl2/" ${SDL2_VER} SDL2_PREFIX) |
| 151 | endif() | 149 | endif() |
| 152 | 150 | ||
| 153 | set(GLFW_INCLUDE_DIRS "${GLFW_PREFIX}/include" CACHE PATH "Path to GLFW3 headers") | 151 | set(SDL2_INCLUDE_DIR "${SDL2_PREFIX}/include" CACHE PATH "Path to SDL2 headers") |
| 154 | set(GLFW_LIBRARY_DIRS "${GLFW_PREFIX}/lib" CACHE PATH "Path to GLFW3 libraries") | 152 | set(SDL2_LIBRARY "${SDL2_PREFIX}/lib/x64/SDL2.lib" CACHE PATH "Path to SDL2 library") |
| 155 | set(GLFW_LIBRARIES glfw3) | 153 | set(SDL2_DLL_DIR "${SDL2_PREFIX}/lib/x64/" CACHE PATH "Path to SDL2.dll") |
| 156 | else() | 154 | else() |
| 157 | find_package(PkgConfig REQUIRED) | 155 | find_package(SDL2 REQUIRED) |
| 158 | pkg_search_module(GLFW REQUIRED glfw3) | ||
| 159 | endif() | 156 | endif() |
| 160 | endif() | 157 | endif() |
| 161 | 158 | ||
| 162 | IF (APPLE) | 159 | IF (APPLE) |
| 163 | FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related | 160 | FIND_LIBRARY(COCOA_LIBRARY Cocoa) # Umbrella framework for everything GUI-related |
| 164 | FIND_LIBRARY(IOKIT_LIBRARY IOKit) # GLFW dependency | ||
| 165 | FIND_LIBRARY(COREVIDEO_LIBRARY CoreVideo) # GLFW dependency | ||
| 166 | set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY}) | 161 | set(PLATFORM_LIBRARIES iconv ${COCOA_LIBRARY} ${IOKIT_LIBRARY} ${COREVIDEO_LIBRARY}) |
| 167 | 162 | ||
| 168 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") | 163 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") |