diff options
| author | 2014-08-23 22:22:05 -0300 | |
|---|---|---|
| committer | 2014-09-01 18:06:30 -0300 | |
| commit | 45976da975a21359cfcc9a05c575ed8b07575612 (patch) | |
| tree | ac688d083cd597f12c42b5e424bb7a66cad50c45 | |
| parent | Update GLFW to 3.0.4 and include x64 lib for MSVC (diff) | |
| download | yuzu-45976da975a21359cfcc9a05c575ed8b07575612.tar.gz yuzu-45976da975a21359cfcc9a05c575ed8b07575612.tar.xz yuzu-45976da975a21359cfcc9a05c575ed8b07575612.zip | |
CMake cleanup
Several cleanups to the buildsystem:
- Do better factoring of common libs between platforms.
- Add support to building on Windows.
- Remove Qt4 support.
- Re-sort file lists and add missing headers.
| -rw-r--r-- | .travis-deps.sh | 14 | ||||
| -rw-r--r-- | CMakeLists.txt | 145 | ||||
| -rw-r--r-- | externals/qhexedit/CMakeLists.txt | 15 | ||||
| -rw-r--r-- | src/CMakeLists.txt | 13 | ||||
| -rw-r--r-- | src/citra/CMakeLists.txt | 24 | ||||
| -rw-r--r-- | src/citra_qt/CMakeLists.txt | 39 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 23 | ||||
| -rw-r--r-- | src/core/CMakeLists.txt | 103 | ||||
| -rw-r--r-- | src/video_core/CMakeLists.txt | 39 |
9 files changed, 265 insertions, 150 deletions
diff --git a/.travis-deps.sh b/.travis-deps.sh index 84bddb304..b8e8417b2 100644 --- a/.travis-deps.sh +++ b/.travis-deps.sh | |||
| @@ -8,10 +8,16 @@ if [ "$TRAVIS_OS_NAME" = linux -o -z "$TRAVIS_OS_NAME" ]; then | |||
| 8 | sudo apt-get -qq update | 8 | sudo apt-get -qq update |
| 9 | sudo apt-get -qq install g++-4.8 xorg-dev libglu1-mesa-dev libxcursor-dev | 9 | sudo apt-get -qq install g++-4.8 xorg-dev libglu1-mesa-dev libxcursor-dev |
| 10 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 | 10 | sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 90 |
| 11 | git clone https://github.com/glfw/glfw.git | 11 | ( |
| 12 | mkdir glfw/build && cd glfw/build | 12 | git clone https://github.com/glfw/glfw.git --branch 3.0.4 --depth 1 |
| 13 | cmake .. && make && sudo make install | 13 | mkdir glfw/build && cd glfw/build |
| 14 | cd - | 14 | cmake .. && make -j2 && sudo make install |
| 15 | ) | ||
| 16 | |||
| 17 | sudo apt-get install lib32stdc++6 | ||
| 18 | sudo mkdir -p /usr/local | ||
| 19 | curl http://www.cmake.org/files/v2.8/cmake-2.8.11-Linux-i386.tar.gz \ | ||
| 20 | | sudo tar -xz -C /usr/local --strip-components=1 | ||
| 15 | elif [ "$TRAVIS_OS_NAME" = osx ]; then | 21 | elif [ "$TRAVIS_OS_NAME" = osx ]; then |
| 16 | brew tap homebrew/versions | 22 | brew tap homebrew/versions |
| 17 | brew install qt5 glfw3 pkgconfig | 23 | brew install qt5 glfw3 pkgconfig |
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3461d1555..e1614cd4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -1,78 +1,131 @@ | |||
| 1 | cmake_minimum_required(VERSION 2.8.7) | 1 | # CMake 2.8.11 required for Qt5 settings to be applied automatically on |
| 2 | # dependent libraries. | ||
| 3 | cmake_minimum_required(VERSION 2.8.11) | ||
| 2 | 4 | ||
| 3 | project(citra) | 5 | project(citra) |
| 4 | 6 | ||
| 5 | SET(CXX_COMPILE_FLAGS "-std=c++11") | 7 | if (NOT MSVC) |
| 6 | 8 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-attributes") | |
| 7 | # silence some spam | 9 | else() |
| 8 | add_definitions(-Wno-attributes) | 10 | # Silence deprecation warnings |
| 11 | add_definitions(/D_CRT_SECURE_NO_WARNINGS) | ||
| 12 | endif() | ||
| 9 | add_definitions(-DSINGLETHREADED) | 13 | add_definitions(-DSINGLETHREADED) |
| 10 | add_definitions(${CXX_COMPILE_FLAGS}) | ||
| 11 | 14 | ||
| 12 | find_package(PNG) | 15 | find_package(PNG) |
| 13 | if (PNG_FOUND) | 16 | if (PNG_FOUND) |
| 14 | add_definitions(-DHAVE_PNG) | 17 | add_definitions(-DHAVE_PNG) |
| 15 | endif () | 18 | endif () |
| 16 | 19 | ||
| 17 | # dependency checking | 20 | # Include bundled CMake modules |
| 18 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules/") | 21 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/externals/cmake-modules") |
| 19 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests) | 22 | |
| 20 | include(FindX11 REQUIRED) | ||
| 21 | find_package(PkgConfig REQUIRED) | ||
| 22 | find_package(OpenGL REQUIRED) | 23 | find_package(OpenGL REQUIRED) |
| 23 | pkg_search_module(GLFW REQUIRED glfw3) | 24 | include_directories(${OPENGL_INCLUDE_DIR}) |
| 25 | |||
| 26 | option(ENABLE_GLFW "Enable the GLFW frontend" ON) | ||
| 27 | if (ENABLE_GLFW) | ||
| 28 | if (WIN32) | ||
| 29 | # Detect toolchain and platform | ||
| 30 | if (MSVC) | ||
| 31 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| 32 | set(TMP_ARCH "x64") | ||
| 33 | else() | ||
| 34 | set(TMP_ARCH "Win32") | ||
| 35 | endif() | ||
| 36 | |||
| 37 | if (MSVC11) # Visual C++ 2012 | ||
| 38 | set(TMP_TOOLSET "v110") | ||
| 39 | elseif (MSVC12) # Visual C++ 2013 | ||
| 40 | set(TMP_TOOLSET "v120") | ||
| 41 | else() | ||
| 42 | set(TMP_TOOLSET "UNSUPPORTED") | ||
| 43 | message(SEND_ERROR "We don't supply GLFW binaries for your version of MSVC, you might have to provide them yourself.") | ||
| 44 | endif() | ||
| 45 | |||
| 46 | set(TMP_TOOLSET "msvc_${TMP_TOOLSET}-${TMP_ARCH}") | ||
| 47 | else() | ||
| 48 | # Assume mingw | ||
| 49 | if (CMAKE_SIZEOF_VOID_P EQUAL 8) | ||
| 50 | set(TMP_ARCH "x86_64") | ||
| 51 | else() | ||
| 52 | set(TMP_ARCH "i686") | ||
| 53 | endif() | ||
| 54 | |||
| 55 | set(TMP_TOOLSET "mingw-${TMP_ARCH}") | ||
| 56 | endif() | ||
| 57 | |||
| 58 | set(GLFW_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/externals/glfw-3.0.4.bin") | ||
| 59 | set(GLFW_INCLUDE_DIRS "${GLFW_PREFIX}/include" CACHE PATH "Path to GLFW3 headers") | ||
| 60 | set(GLFW_LIBRARY_DIRS "${GLFW_PREFIX}/lib-${TMP_TOOLSET}" CACHE PATH "Path to GLFW3 libraries") | ||
| 61 | |||
| 62 | # Clean up after ourselves | ||
| 63 | unset(TMP_TOOLSET) | ||
| 64 | unset(TMP_ARCH) | ||
| 65 | |||
| 66 | set(GLFW_LIBRARIES glfw3) | ||
| 67 | else() | ||
| 68 | find_package(X11 REQUIRED) | ||
| 69 | find_package(PkgConfig REQUIRED) | ||
| 70 | pkg_search_module(GLFW REQUIRED glfw3) | ||
| 71 | endif() | ||
| 72 | |||
| 73 | include_directories(${GLFW_INCLUDE_DIRS}) | ||
| 74 | link_directories(${GLFW_LIBRARY_DIRS}) | ||
| 75 | endif() | ||
| 24 | 76 | ||
| 25 | # corefoundation is required only on OSX | ||
| 26 | IF (APPLE) | 77 | IF (APPLE) |
| 78 | # CoreFoundation is required only on OSX | ||
| 27 | FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) | 79 | FIND_LIBRARY(COREFOUNDATION_LIBRARY CoreFoundation) |
| 28 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") | 80 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") |
| 29 | SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") | 81 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++") |
| 30 | ENDIF (APPLE) | 82 | ENDIF (APPLE) |
| 31 | 83 | ||
| 32 | #external includes | 84 | option(ENABLE_QT "Enable the Qt frontend" ON) |
| 33 | include_directories(${GLFW_INCLUDE_DIRS}) | 85 | option(CITRA_FORCE_QT4 "Use Qt4 even if Qt5 is available." OFF) |
| 34 | include_directories(${OPENGL_INCLUDE_DIR}) | 86 | if (ENABLE_QT) |
| 87 | # Set CMAKE_PREFIX_PATH if QTDIR is defined in the environment This allows CMake to | ||
| 88 | # automatically find the Qt packages on Windows | ||
| 89 | if (DEFINED ENV{QTDIR}) | ||
| 90 | list(APPEND CMAKE_PREFIX_PATH "$ENV{QTDIR}") | ||
| 91 | endif() | ||
| 35 | 92 | ||
| 36 | # workaround for GLFW linking on OSX | 93 | if (NOT CITRA_FORCE_QT4) |
| 37 | link_directories(${GLFW_LIBRARY_DIRS}) | 94 | find_package(Qt5 COMPONENTS Widgets OpenGL) |
| 38 | 95 | set(CITRA_QT_LIBS Qt5::Widgets Qt5::OpenGL) | |
| 39 | option(DISABLE_QT "Disable Qt GUI" OFF) | ||
| 40 | option(USE_QT5 "Use Qt5 when available" ON) | ||
| 41 | if (NOT DISABLE_QT) | ||
| 42 | if(USE_QT5) | ||
| 43 | find_package(Qt5Gui) | ||
| 44 | find_package(Qt5Widgets) | ||
| 45 | find_package(Qt5OpenGL) | ||
| 46 | if(NOT Qt5Gui_FOUND OR NOT Qt5Widgets_FOUND OR NOT Qt5OpenGL_FOUND) | ||
| 47 | message("Qt5 libraries not found! Using Qt4 instead.") | ||
| 48 | set(USE_QT5 OFF) | ||
| 49 | endif() | ||
| 50 | endif() | 96 | endif() |
| 51 | if(NOT USE_QT5) | ||
| 52 | include(FindQt4) | ||
| 53 | find_package(Qt4 COMPONENTS QtCore QtGui QtOpenGL) | ||
| 54 | 97 | ||
| 55 | if(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND QT_QTOPENGL_FOUND) | 98 | if (CITRA_FORCE_QT4 OR NOT Qt5_FOUND) |
| 56 | include(${QT_USE_FILE}) | 99 | # Try to fallback to Qt4 |
| 57 | include_directories(${QT_INCLUDES}) | 100 | find_package(Qt4 REQUIRED COMPONENTS QtGui QtOpenGL) |
| 58 | else() | 101 | set(CITRA_QT_LIBS Qt4::QtGui Qt4::QtOpenGL) |
| 59 | message("Qt4 libraries not found! Disabling Qt GUI") | ||
| 60 | set(DISABLE_QT ON) | ||
| 61 | endif() | ||
| 62 | endif() | 102 | endif() |
| 63 | endif() | 103 | endif() |
| 64 | 104 | ||
| 105 | # This function should be passed a list of all files in a target. It will automatically generate | ||
| 106 | # file groups following the directory hierarchy, so that the layout of the files in IDEs matches the | ||
| 107 | # one in the filesystem. | ||
| 108 | function(create_directory_groups) | ||
| 109 | # Place any files that aren't in the source list in a separate group so that they don't get in | ||
| 110 | # the way. | ||
| 111 | source_group("Other Files" REGULAR_EXPRESSION ".") | ||
| 112 | |||
| 113 | foreach(file_name ${ARGV}) | ||
| 114 | get_filename_component(dir_name "${file_name}" PATH) | ||
| 115 | # Group names use '\' as a separator even though the entire rest of CMake uses '/'... | ||
| 116 | string(REPLACE "/" "\\" group_name "${dir_name}") | ||
| 117 | source_group("${group_name}" FILES "${file_name}") | ||
| 118 | endforeach() | ||
| 119 | endfunction() | ||
| 120 | |||
| 65 | # generate git revision information | 121 | # generate git revision information |
| 66 | include(GetGitRevisionDescription) | 122 | include(GetGitRevisionDescription) |
| 67 | get_git_head_revision(GIT_REF_SPEC GIT_REV) | 123 | get_git_head_revision(GIT_REF_SPEC GIT_REV) |
| 68 | git_describe(GIT_DESC --always --long --dirty) | 124 | git_describe(GIT_DESC --always --long --dirty) |
| 69 | git_branch_name(GIT_BRANCH) | 125 | git_branch_name(GIT_BRANCH) |
| 70 | |||
| 71 | # internal includes | ||
| 72 | include_directories(src) | ||
| 73 | 126 | ||
| 74 | # process subdirectories | 127 | # process subdirectories |
| 75 | if(NOT DISABLE_QT) | 128 | if(ENABLE_QT) |
| 76 | include_directories(externals/qhexedit) | 129 | include_directories(externals/qhexedit) |
| 77 | add_subdirectory(externals/qhexedit) | 130 | add_subdirectory(externals/qhexedit) |
| 78 | endif() | 131 | endif() |
diff --git a/externals/qhexedit/CMakeLists.txt b/externals/qhexedit/CMakeLists.txt index b1f631f95..e7470dfe4 100644 --- a/externals/qhexedit/CMakeLists.txt +++ b/externals/qhexedit/CMakeLists.txt | |||
| @@ -5,14 +5,17 @@ set(SRCS | |||
| 5 | commands.cpp | 5 | commands.cpp |
| 6 | qhexedit.cpp | 6 | qhexedit.cpp |
| 7 | qhexedit_p.cpp | 7 | qhexedit_p.cpp |
| 8 | xbytearray.cpp) | 8 | xbytearray.cpp |
| 9 | ) | ||
| 9 | 10 | ||
| 10 | set(HEADERS | 11 | set(HEADERS |
| 12 | commands.h | ||
| 11 | qhexedit.h | 13 | qhexedit.h |
| 12 | qhexedit_p.h) | 14 | qhexedit_p.h |
| 15 | xbytearray.h | ||
| 16 | ) | ||
| 13 | 17 | ||
| 14 | add_library(qhexedit STATIC ${SRCS} ${HEADERS}) | 18 | create_directory_groups(${SRCS} ${HEADERS}) |
| 15 | if(USE_QT5) | ||
| 16 | target_link_libraries(qhexedit Qt5::Core Qt5::Widgets) | ||
| 17 | endif() | ||
| 18 | 19 | ||
| 20 | add_library(qhexedit STATIC ${SRCS} ${HEADERS}) | ||
| 21 | target_link_libraries(qhexedit ${CITRA_QT_LIBS}) | ||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e0227dc53..cb09f3cd1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt | |||
| @@ -1,9 +1,12 @@ | |||
| 1 | # Enable modules to include each other's files | ||
| 2 | include_directories(.) | ||
| 3 | |||
| 1 | add_subdirectory(common) | 4 | add_subdirectory(common) |
| 2 | add_subdirectory(core) | 5 | add_subdirectory(core) |
| 3 | add_subdirectory(video_core) | 6 | add_subdirectory(video_core) |
| 4 | add_subdirectory(citra) | 7 | if (ENABLE_GLFW) |
| 5 | add_subdirectory(citra_qt) | 8 | add_subdirectory(citra) |
| 6 | 9 | endif() | |
| 7 | if(QT4_FOUND AND QT_QTCORE_FOUND AND QT_QTGUI_FOUND AND QT_QTOPENGL_FOUND AND NOT DISABLE_QT4) | 10 | if (ENABLE_QT) |
| 8 | #add_subdirectory(citra_qt) | 11 | add_subdirectory(citra_qt) |
| 9 | endif() | 12 | endif() |
diff --git a/src/citra/CMakeLists.txt b/src/citra/CMakeLists.txt index bd6c4a1a8..f10f3e603 100644 --- a/src/citra/CMakeLists.txt +++ b/src/citra/CMakeLists.txt | |||
| @@ -1,6 +1,13 @@ | |||
| 1 | set(SRCS citra.cpp | 1 | set(SRCS |
| 2 | emu_window/emu_window_glfw.cpp) | 2 | emu_window/emu_window_glfw.cpp |
| 3 | set(HEADERS resource.h) | 3 | citra.cpp |
| 4 | ) | ||
| 5 | set(HEADERS | ||
| 6 | emu_window/emu_window_glfw.h | ||
| 7 | resource.h | ||
| 8 | ) | ||
| 9 | |||
| 10 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 4 | 11 | ||
| 5 | # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) | 12 | # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable) |
| 6 | if (NOT X11_xf86vmode_LIB) | 13 | if (NOT X11_xf86vmode_LIB) |
| @@ -8,11 +15,16 @@ if (NOT X11_xf86vmode_LIB) | |||
| 8 | endif() | 15 | endif() |
| 9 | 16 | ||
| 10 | add_executable(citra ${SRCS} ${HEADERS}) | 17 | add_executable(citra ${SRCS} ${HEADERS}) |
| 18 | target_link_libraries(citra core common video_core) | ||
| 19 | target_link_libraries(citra ${OPENGL_gl_LIBRARY} ${GLFW_LIBRARIES}) | ||
| 11 | 20 | ||
| 12 | if (APPLE) | 21 | if (APPLE) |
| 13 | target_link_libraries(citra core common video_core iconv pthread ${COREFOUNDATION_LIBRARY} ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES}) | 22 | target_link_libraries(citra iconv pthread ${COREFOUNDATION_LIBRARY}) |
| 14 | else() | 23 | elseif (WIN32) |
| 15 | target_link_libraries(citra core common video_core pthread X11 Xxf86vm Xi Xcursor ${OPENGL_LIBRARIES} ${GLFW_LIBRARIES} rt ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB} ${PNG_LIBRARIES}) | 24 | target_link_libraries(citra winmm) |
| 25 | else() # Unix | ||
| 26 | target_link_libraries(citra pthread rt) | ||
| 27 | target_link_libraries(citra ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB}) | ||
| 16 | endif() | 28 | endif() |
| 17 | 29 | ||
| 18 | #install(TARGETS citra RUNTIME DESTINATION ${bindir}) | 30 | #install(TARGETS citra RUNTIME DESTINATION ${bindir}) |
diff --git a/src/citra_qt/CMakeLists.txt b/src/citra_qt/CMakeLists.txt index 055a585a0..426e4ef99 100644 --- a/src/citra_qt/CMakeLists.txt +++ b/src/citra_qt/CMakeLists.txt | |||
| @@ -2,54 +2,61 @@ set(CMAKE_AUTOMOC ON) | |||
| 2 | set(CMAKE_INCLUDE_CURRENT_DIR ON) | 2 | set(CMAKE_INCLUDE_CURRENT_DIR ON) |
| 3 | 3 | ||
| 4 | set(SRCS | 4 | set(SRCS |
| 5 | bootmanager.cpp | 5 | config/controller_config.cpp |
| 6 | config/controller_config_util.cpp | ||
| 6 | debugger/callstack.cpp | 7 | debugger/callstack.cpp |
| 7 | debugger/disassembler.cpp | 8 | debugger/disassembler.cpp |
| 8 | debugger/graphics.cpp | 9 | debugger/graphics.cpp |
| 9 | debugger/graphics_cmdlists.cpp | 10 | debugger/graphics_cmdlists.cpp |
| 10 | debugger/ramview.cpp | 11 | debugger/ramview.cpp |
| 11 | debugger/registers.cpp | 12 | debugger/registers.cpp |
| 13 | bootmanager.cpp | ||
| 12 | hotkeys.cpp | 14 | hotkeys.cpp |
| 13 | main.cpp | 15 | main.cpp |
| 14 | config/controller_config.cpp | 16 | ) |
| 15 | config/controller_config_util.cpp) | ||
| 16 | 17 | ||
| 17 | set(HEADERS | 18 | set(HEADERS |
| 18 | bootmanager.hxx | 19 | config/controller_config.hxx |
| 20 | config/controller_config_util.hxx | ||
| 19 | debugger/callstack.hxx | 21 | debugger/callstack.hxx |
| 20 | debugger/disassembler.hxx | 22 | debugger/disassembler.hxx |
| 23 | debugger/graphics.hxx | ||
| 24 | debugger/graphics_cmdlists.hxx | ||
| 21 | debugger/ramview.hxx | 25 | debugger/ramview.hxx |
| 22 | debugger/registers.hxx | 26 | debugger/registers.hxx |
| 27 | bootmanager.hxx | ||
| 23 | hotkeys.hxx | 28 | hotkeys.hxx |
| 24 | main.hxx | 29 | main.hxx |
| 25 | version.h | 30 | version.h |
| 26 | config/controller_config.hxx | 31 | ) |
| 27 | config/controller_config_util.hxx) | ||
| 28 | 32 | ||
| 29 | set(UIS | 33 | set(UIS |
| 34 | config/controller_config.ui | ||
| 30 | debugger/callstack.ui | 35 | debugger/callstack.ui |
| 31 | debugger/disassembler.ui | 36 | debugger/disassembler.ui |
| 32 | debugger/registers.ui | 37 | debugger/registers.ui |
| 33 | hotkeys.ui | 38 | hotkeys.ui |
| 34 | main.ui | 39 | main.ui |
| 35 | config/controller_config.ui) | 40 | ) |
| 41 | |||
| 42 | create_directory_groups(${SRCS} ${HEADERS} ${UIS}) | ||
| 36 | 43 | ||
| 37 | if(USE_QT5) | 44 | if (Qt5_FOUND) |
| 38 | qt5_wrap_ui(UI_HDRS ${UIS}) | 45 | qt5_wrap_ui(UI_HDRS ${UIS}) |
| 39 | else() | 46 | else() |
| 40 | qt4_wrap_ui(UI_HDRS ${UIS}) | 47 | qt4_wrap_ui(UI_HDRS ${UIS}) |
| 41 | endif() | 48 | endif() |
| 42 | 49 | ||
| 43 | add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) | 50 | add_executable(citra-qt ${SRCS} ${HEADERS} ${UI_HDRS}) |
| 44 | if(APPLE) | 51 | target_link_libraries(citra-qt core common video_core qhexedit) |
| 45 | set(ICONV_LIBRARY iconv) | 52 | target_link_libraries(citra-qt ${OPENGL_gl_LIBRARY} ${CITRA_QT_LIBS}) |
| 46 | else() | ||
| 47 | set(RT_LIBRARY rt) | ||
| 48 | endif() | ||
| 49 | 53 | ||
| 50 | target_link_libraries(citra-qt core common video_core qhexedit ${ICONV_LIBRARY} ${COREFOUNDATION_LIBRARY} ${QT_LIBRARIES} ${OPENGL_LIBRARIES} ${RT_LIBRARY} ${PNG_LIBRARIES}) | 54 | if (APPLE) |
| 51 | if(USE_QT5) | 55 | target_link_libraries(citra-qt iconv ${COREFOUNDATION_LIBRARY}) |
| 52 | target_link_libraries(citra-qt Qt5::Gui Qt5::Widgets Qt5::OpenGL) | 56 | elseif (WIN32) |
| 57 | target_link_libraries(citra-qt winmm) | ||
| 58 | else() # Unix | ||
| 59 | target_link_libraries(citra-qt rt) | ||
| 53 | endif() | 60 | endif() |
| 54 | 61 | ||
| 55 | #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) | 62 | #install(TARGETS citra-qt RUNTIME DESTINATION ${bindir}) |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index aae183393..f8a55c2a7 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | # Generate cpp with Git revision from template | ||
| 1 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) | 2 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) |
| 2 | 3 | ||
| 3 | set(SRCS break_points.cpp | 4 | set(SRCS |
| 5 | break_points.cpp | ||
| 4 | console_listener.cpp | 6 | console_listener.cpp |
| 5 | extended_trace.cpp | 7 | extended_trace.cpp |
| 6 | file_search.cpp | 8 | file_search.cpp |
| @@ -12,23 +14,25 @@ set(SRCS break_points.cpp | |||
| 12 | memory_util.cpp | 14 | memory_util.cpp |
| 13 | misc.cpp | 15 | misc.cpp |
| 14 | msg_handler.cpp | 16 | msg_handler.cpp |
| 15 | string_util.cpp | ||
| 16 | scm_rev.cpp | 17 | scm_rev.cpp |
| 18 | string_util.cpp | ||
| 17 | symbols.cpp | 19 | symbols.cpp |
| 18 | thread.cpp | 20 | thread.cpp |
| 19 | timer.cpp | 21 | timer.cpp |
| 20 | utf8.cpp) | 22 | utf8.cpp |
| 23 | ) | ||
| 21 | 24 | ||
| 22 | set(HEADERS atomic.h | 25 | set(HEADERS |
| 26 | atomic.h | ||
| 23 | atomic_gcc.h | 27 | atomic_gcc.h |
| 24 | atomic_win32.h | 28 | atomic_win32.h |
| 25 | bit_field.h | 29 | bit_field.h |
| 26 | break_points.h | 30 | break_points.h |
| 27 | chunk_file.h | 31 | chunk_file.h |
| 32 | common.h | ||
| 28 | common_funcs.h | 33 | common_funcs.h |
| 29 | common_paths.h | 34 | common_paths.h |
| 30 | common_types.h | 35 | common_types.h |
| 31 | common.h | ||
| 32 | console_listener.h | 36 | console_listener.h |
| 33 | cpu_detect.h | 37 | cpu_detect.h |
| 34 | debug_interface.h | 38 | debug_interface.h |
| @@ -37,10 +41,11 @@ set(HEADERS atomic.h | |||
| 37 | fifo_queue.h | 41 | fifo_queue.h |
| 38 | file_search.h | 42 | file_search.h |
| 39 | file_util.h | 43 | file_util.h |
| 44 | fixed_size_queue.h | ||
| 40 | hash.h | 45 | hash.h |
| 41 | linear_disk_cache.h | 46 | linear_disk_cache.h |
| 42 | log_manager.h | ||
| 43 | log.h | 47 | log.h |
| 48 | log_manager.h | ||
| 44 | math_util.h | 49 | math_util.h |
| 45 | mem_arena.h | 50 | mem_arena.h |
| 46 | memory_util.h | 51 | memory_util.h |
| @@ -54,8 +59,12 @@ set(HEADERS atomic.h | |||
| 54 | swap.h | 59 | swap.h |
| 55 | symbols.h | 60 | symbols.h |
| 56 | thread.h | 61 | thread.h |
| 62 | thread_queue_list.h | ||
| 57 | thunk.h | 63 | thunk.h |
| 58 | timer.h | 64 | timer.h |
| 59 | utf8.h) | 65 | utf8.h |
| 66 | ) | ||
| 67 | |||
| 68 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 60 | 69 | ||
| 61 | add_library(common STATIC ${SRCS} ${HEADERS}) | 70 | add_library(common STATIC ${SRCS} ${HEADERS}) |
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index 207f39707..1f358ec8d 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt | |||
| @@ -1,14 +1,18 @@ | |||
| 1 | set(SRCS core.cpp | 1 | set(SRCS |
| 2 | core_timing.cpp | ||
| 3 | loader/elf.cpp | ||
| 4 | loader/loader.cpp | ||
| 5 | loader/ncch.cpp | ||
| 6 | mem_map.cpp | ||
| 7 | mem_map_funcs.cpp | ||
| 8 | system.cpp | ||
| 9 | arm/disassembler/arm_disasm.cpp | 2 | arm/disassembler/arm_disasm.cpp |
| 10 | arm/disassembler/load_symbol_map.cpp | 3 | arm/disassembler/load_symbol_map.cpp |
| 11 | file_sys/archive_romfs.cpp | 4 | arm/interpreter/mmu/arm1176jzf_s_mmu.cpp |
| 5 | arm/interpreter/mmu/cache.cpp | ||
| 6 | arm/interpreter/mmu/maverick.cpp | ||
| 7 | arm/interpreter/mmu/rb.cpp | ||
| 8 | arm/interpreter/mmu/sa_mmu.cpp | ||
| 9 | arm/interpreter/mmu/tlb.cpp | ||
| 10 | arm/interpreter/mmu/wb.cpp | ||
| 11 | arm/interpreter/mmu/xscale_copro.cpp | ||
| 12 | arm/interpreter/vfp/vfp.cpp | ||
| 13 | arm/interpreter/vfp/vfpdouble.cpp | ||
| 14 | arm/interpreter/vfp/vfpinstr.cpp | ||
| 15 | arm/interpreter/vfp/vfpsingle.cpp | ||
| 12 | arm/interpreter/arm_interpreter.cpp | 16 | arm/interpreter/arm_interpreter.cpp |
| 13 | arm/interpreter/armcopro.cpp | 17 | arm/interpreter/armcopro.cpp |
| 14 | arm/interpreter/armemu.cpp | 18 | arm/interpreter/armemu.cpp |
| @@ -18,22 +22,7 @@ set(SRCS core.cpp | |||
| 18 | arm/interpreter/armsupp.cpp | 22 | arm/interpreter/armsupp.cpp |
| 19 | arm/interpreter/armvirt.cpp | 23 | arm/interpreter/armvirt.cpp |
| 20 | arm/interpreter/thumbemu.cpp | 24 | arm/interpreter/thumbemu.cpp |
| 21 | arm/interpreter/vfp/vfp.cpp | 25 | file_sys/archive_romfs.cpp |
| 22 | arm/interpreter/vfp/vfpdouble.cpp | ||
| 23 | arm/interpreter/vfp/vfpinstr.cpp | ||
| 24 | arm/interpreter/vfp/vfpsingle.cpp | ||
| 25 | arm/interpreter/mmu/arm1176jzf_s_mmu.cpp | ||
| 26 | arm/interpreter/mmu/cache.cpp | ||
| 27 | arm/interpreter/mmu/maverick.cpp | ||
| 28 | arm/interpreter/mmu/rb.cpp | ||
| 29 | arm/interpreter/mmu/sa_mmu.cpp | ||
| 30 | arm/interpreter/mmu/tlb.cpp | ||
| 31 | arm/interpreter/mmu/wb.cpp | ||
| 32 | arm/interpreter/mmu/xscale_copro.cpp | ||
| 33 | hle/hle.cpp | ||
| 34 | hle/config_mem.cpp | ||
| 35 | hle/coprocessor.cpp | ||
| 36 | hle/svc.cpp | ||
| 37 | hle/kernel/address_arbiter.cpp | 26 | hle/kernel/address_arbiter.cpp |
| 38 | hle/kernel/archive.cpp | 27 | hle/kernel/archive.cpp |
| 39 | hle/kernel/event.cpp | 28 | hle/kernel/event.cpp |
| @@ -48,27 +37,26 @@ set(SRCS core.cpp | |||
| 48 | hle/service/ndm.cpp | 37 | hle/service/ndm.cpp |
| 49 | hle/service/service.cpp | 38 | hle/service/service.cpp |
| 50 | hle/service/srv.cpp | 39 | hle/service/srv.cpp |
| 40 | hle/config_mem.cpp | ||
| 41 | hle/coprocessor.cpp | ||
| 42 | hle/hle.cpp | ||
| 43 | hle/svc.cpp | ||
| 51 | hw/gpu.cpp | 44 | hw/gpu.cpp |
| 52 | hw/hw.cpp | 45 | hw/hw.cpp |
| 53 | hw/ndma.cpp) | 46 | hw/ndma.cpp |
| 47 | loader/elf.cpp | ||
| 48 | loader/loader.cpp | ||
| 49 | loader/ncch.cpp | ||
| 50 | core.cpp | ||
| 51 | core_timing.cpp | ||
| 52 | mem_map.cpp | ||
| 53 | mem_map_funcs.cpp | ||
| 54 | system.cpp | ||
| 55 | ) | ||
| 54 | 56 | ||
| 55 | set(HEADERS core.h | 57 | set(HEADERS |
| 56 | core_timing.h | ||
| 57 | loader/elf.h | ||
| 58 | loader/loader.h | ||
| 59 | loader/ncch.h | ||
| 60 | mem_map.h | ||
| 61 | system.h | ||
| 62 | arm/disassembler/arm_disasm.h | 58 | arm/disassembler/arm_disasm.h |
| 63 | arm/disassembler/load_symbol_map.h | 59 | arm/disassembler/load_symbol_map.h |
| 64 | arm/interpreter/arm_interpreter.h | ||
| 65 | arm/interpreter/arm_regformat.h | ||
| 66 | arm/interpreter/armcpu.h | ||
| 67 | arm/interpreter/armdefs.h | ||
| 68 | arm/interpreter/armemu.h | ||
| 69 | arm/interpreter/armmmu.h | ||
| 70 | arm/interpreter/armos.h | ||
| 71 | arm/interpreter/skyeye_defs.h | ||
| 72 | arm/interpreter/mmu/arm1176jzf_s_mmu.h | 60 | arm/interpreter/mmu/arm1176jzf_s_mmu.h |
| 73 | arm/interpreter/mmu/cache.h | 61 | arm/interpreter/mmu/cache.h |
| 74 | arm/interpreter/mmu/rb.h | 62 | arm/interpreter/mmu/rb.h |
| @@ -78,27 +66,48 @@ set(HEADERS core.h | |||
| 78 | arm/interpreter/vfp/asm_vfp.h | 66 | arm/interpreter/vfp/asm_vfp.h |
| 79 | arm/interpreter/vfp/vfp.h | 67 | arm/interpreter/vfp/vfp.h |
| 80 | arm/interpreter/vfp/vfp_helper.h | 68 | arm/interpreter/vfp/vfp_helper.h |
| 69 | arm/interpreter/arm_interpreter.h | ||
| 70 | arm/interpreter/arm_regformat.h | ||
| 71 | arm/interpreter/armcpu.h | ||
| 72 | arm/interpreter/armdefs.h | ||
| 73 | arm/interpreter/armemu.h | ||
| 74 | arm/interpreter/armmmu.h | ||
| 75 | arm/interpreter/armos.h | ||
| 76 | arm/interpreter/skyeye_defs.h | ||
| 77 | arm/arm_interface.h | ||
| 81 | file_sys/archive.h | 78 | file_sys/archive.h |
| 82 | file_sys/archive_romfs.h | 79 | file_sys/archive_romfs.h |
| 83 | hle/config_mem.h | ||
| 84 | hle/coprocessor.h | ||
| 85 | hle/hle.h | ||
| 86 | hle/svc.h | ||
| 87 | hle/kernel/address_arbiter.h | 80 | hle/kernel/address_arbiter.h |
| 88 | hle/kernel/archive.h | 81 | hle/kernel/archive.h |
| 82 | hle/kernel/event.h | ||
| 89 | hle/kernel/kernel.h | 83 | hle/kernel/kernel.h |
| 90 | hle/kernel/mutex.h | 84 | hle/kernel/mutex.h |
| 91 | hle/kernel/shared_memory.h | 85 | hle/kernel/shared_memory.h |
| 92 | hle/kernel/thread.h | 86 | hle/kernel/thread.h |
| 93 | hle/function_wrappers.h | ||
| 94 | hle/service/apt.h | 87 | hle/service/apt.h |
| 95 | hle/service/fs.h | 88 | hle/service/fs.h |
| 96 | hle/service/gsp.h | 89 | hle/service/gsp.h |
| 97 | hle/service/hid.h | 90 | hle/service/hid.h |
| 91 | hle/service/ndm.h | ||
| 98 | hle/service/service.h | 92 | hle/service/service.h |
| 99 | hle/service/srv.h | 93 | hle/service/srv.h |
| 94 | hle/config_mem.h | ||
| 95 | hle/coprocessor.h | ||
| 96 | hle/function_wrappers.h | ||
| 97 | hle/hle.h | ||
| 98 | hle/svc.h | ||
| 100 | hw/gpu.h | 99 | hw/gpu.h |
| 101 | hw/hw.h | 100 | hw/hw.h |
| 102 | hw/ndma.h) | 101 | hw/ndma.h |
| 102 | loader/elf.h | ||
| 103 | loader/loader.h | ||
| 104 | loader/ncch.h | ||
| 105 | core.h | ||
| 106 | core_timing.h | ||
| 107 | mem_map.h | ||
| 108 | system.h | ||
| 109 | ) | ||
| 110 | |||
| 111 | create_directory_groups(${SRCS} ${HEADERS}) | ||
| 103 | 112 | ||
| 104 | add_library(core STATIC ${SRCS} ${HEADERS}) | 113 | add_library(core STATIC ${SRCS} ${HEADERS}) |
diff --git a/src/video_core/CMakeLists.txt b/src/video_core/CMakeLists.txt index 48c5d1424..13c3f7b22 100644 --- a/src/video_core/CMakeLists.txt +++ b/src/video_core/CMakeLists.txt | |||
| @@ -1,29 +1,42 @@ | |||
| 1 | set(SRCS clipper.cpp | 1 | set(SRCS |
| 2 | renderer_opengl/generated/gl_3_2_core.c | ||
| 3 | renderer_opengl/renderer_opengl.cpp | ||
| 4 | renderer_opengl/gl_shader_util.cpp | ||
| 5 | debug_utils/debug_utils.cpp | ||
| 6 | clipper.cpp | ||
| 2 | command_processor.cpp | 7 | command_processor.cpp |
| 3 | primitive_assembly.cpp | 8 | primitive_assembly.cpp |
| 4 | rasterizer.cpp | 9 | rasterizer.cpp |
| 5 | utils.cpp | 10 | utils.cpp |
| 6 | vertex_shader.cpp | 11 | vertex_shader.cpp |
| 7 | video_core.cpp | 12 | video_core.cpp |
| 8 | renderer_opengl/generated/gl_3_2_core.c | 13 | ) |
| 9 | renderer_opengl/renderer_opengl.cpp | ||
| 10 | renderer_opengl/gl_shader_util.cpp | ||
| 11 | debug_utils/debug_utils.cpp) | ||
| 12 | 14 | ||
| 13 | set(HEADERS clipper.h | 15 | set(HEADERS |
| 16 | debug_utils/debug_utils.h | ||
| 17 | renderer_opengl/generated/gl_3_2_core.h | ||
| 18 | renderer_opengl/gl_shader_util.h | ||
| 19 | renderer_opengl/gl_shaders.h | ||
| 20 | renderer_opengl/renderer_opengl.h | ||
| 21 | clipper.h | ||
| 14 | command_processor.h | 22 | command_processor.h |
| 23 | gpu_debugger.h | ||
| 15 | math.h | 24 | math.h |
| 25 | pica.h | ||
| 16 | primitive_assembly.h | 26 | primitive_assembly.h |
| 17 | rasterizer.h | 27 | rasterizer.h |
| 18 | utils.h | ||
| 19 | video_core.h | ||
| 20 | renderer_base.h | 28 | renderer_base.h |
| 29 | utils.h | ||
| 21 | vertex_shader.h | 30 | vertex_shader.h |
| 22 | video_core.h | 31 | video_core.h |
| 23 | renderer_opengl/generated/gl_3_2_core.h | 32 | ) |
| 24 | renderer_opengl/renderer_opengl.h | 33 | |
| 25 | renderer_opengl/gl_shader_util.h | 34 | create_directory_groups(${SRCS} ${HEADERS}) |
| 26 | renderer_opengl/gl_shaders.h | ||
| 27 | debug_utils/debug_utils.h) | ||
| 28 | 35 | ||
| 29 | add_library(video_core STATIC ${SRCS} ${HEADERS}) | 36 | add_library(video_core STATIC ${SRCS} ${HEADERS}) |
| 37 | |||
| 38 | if (PNG_FOUND) | ||
| 39 | target_link_libraries(video_core ${PNG_LIBRARIES}) | ||
| 40 | include_directories(${PNG_INCLUDE_DIRS}) | ||
| 41 | add_definitions(${PNG_DEFINITIONS}) | ||
| 42 | endif() | ||