forked from net64-mod/net64-coop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (50 loc) · 2.26 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.12)
project(net64-coop)
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/externals/cmake-modules/")
set(CMAKE_INSTALL_MESSAGE LAZY)
add_compile_definitions(NOMINMAX _WINSOCKAPI_ _SILENCE_CXX17_RESULT_OF_DEPRECATION_WARNING)
include(CompilerFlags)
# Generate revision information
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REF_SPEC GIT_REV)
git_describe(GIT_DESC --always --long --dirty)
git_branch_name(GIT_BRANCH)
git_get_exact_tag(GIT_TAG)
set(GIT_REVISION_FILE "${CMAKE_CURRENT_BINARY_DIR}/src/build_info.cpp")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/build_info.cpp.in" "${GIT_REVISION_FILE}" @ONLY)
include_directories(src externals/mem64/include externals/spdlog-lib externals/m64plus-headers)
option(BUILD_CORE "Build core library" ON)
option(BUILD_QT_FRONTEND "Build the Qt5 userinterface" ON)
option(INSTALL_MUPEN64PLUS "Wether to include a Mupen64Plus installation with the build" ON)
if(WIN32)
set(MUPEN64PLUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/mupen-builds/win32" CACHE PATH "The Mupen64Plus installation to include")
elseif(UNIX)
set(MUPEN64PLUS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/externals/mupen-builds/linux-amd64" CACHE PATH "The Mupen64Plus installation to include")
else()
set(MUPEN64PLUS_DIR "MUPEN64PLUS_DIR-NOT-SPECIFIED" CACHE PATH "The Mupen64Plus installation to include")
set(INSTALL_MUPEN64PLUS OFF)
endif()
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install")
if(BUILD_CORE)
include_directories(externals/cereal/include)
add_subdirectory(src/net64)
endif()
if(BUILD_QT_FRONTEND)
add_subdirectory(src/qt_gui)
# Make the Qt GUI the startup project for Visual Studio
if(MSVC_IDE)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT net64_qt_gui)
endif()
if(MSVC)
add_compile_options("/Zc:__cplusplus")
endif()
add_subdirectory(externals/open-vcdiff EXCLUDE_FROM_ALL)
endif()
# Installation
if(INSTALL_MUPEN64PLUS)
install(DIRECTORY "${MUPEN64PLUS_DIR}/"
DESTINATION ${CMAKE_INSTALL_PREFIX}/usr/share/net64/mupen64plus)
endif()