-
Notifications
You must be signed in to change notification settings - Fork 14
/
CMakeLists.txt
112 lines (86 loc) · 3.36 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# Copyright 2019 SwitchPy Team. All rights reserved.
# Licensed under the MIT license.
# Refer to the LICENSE file included.
#
# libnx CMake template for Nintendo Switch homebrew development.
cmake_minimum_required(VERSION 3.1)
project(SimpleModManager)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(options)
include(utils)
include(devkita64-libnx)
# needed by tesla lib
set( CMAKE_CXX_STANDARD 20 )
find_package(LIBNX REQUIRED)
if (NOT LIBNX_FOUND)
cmake_panic("Unable to detect libnx on this system.")
endif ()
find_package(ZLIB REQUIRED)
if (${ZLIB_FOUND})
message("ZLIB found : ${ZLIB_VERSION_STRING}")
message("ZLIB_INCLUDE_DIRS = ${ZLIB_INCLUDE_DIRS}")
message("ZLIB_LIBRARIES = ${ZLIB_LIBRARIES}")
else()
message(FATAL_ERROR "ZLIB has not been found.")
endif ()
find_package(Freetype REQUIRED)
if (${FREETYPE_FOUND})
message("Freetype found : ${FREETYPE_VERSION_STRING}")
message("FREETYPE_INCLUDE_DIRS = ${FREETYPE_INCLUDE_DIRS}")
message("FREETYPE_LIBRARIES = ${FREETYPE_LIBRARIES}")
else()
message(FATAL_ERROR "FREETYPE has not been found.")
endif ()
find_package(BZip2 REQUIRED)
if (${BZIP2_FOUND})
message("BZIP2 found : ${BZIP2_VERSION_STRING}")
message("BZIP2_INCLUDE_DIRS = ${BZIP2_INCLUDE_DIRS}")
message("BZIP2_LIBRARIES = ${BZIP2_LIBRARIES}")
else()
message(FATAL_ERROR "BZIP2 has not been found.")
endif ()
#find_package(SDL2 REQUIRED)
#message("SDL2_INCLUDE_DIRS = ${SDL2_INCLUDE_DIRS}")
#message("SDL2_LIBRARIES = ${SDL2_LIBRARIES}")
include_directories(${PROJECT_BINARY_DIR})
include_directories("${PORTLIBS}/include")
include_directories("${LIBNX}/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
include_directories("${ZLIB_INCLUDE_DIRS}")
include_directories("${FREETYPE_INCLUDE_DIRS}")
#include_directories("${SDL2_INCLUDE_DIRS}")
set(VERSION_MAJOR 2)
set(VERSION_MINOR 1)
set(VERSION_MICRO 3)
set(VERSION_TAG "\"\"")
set(APP_VERSION
"${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_MICRO}")
add_definitions( -DVERSION_APP=${APP_VERSION} )
add_definitions( -DVERSION_MAJOR_APP=${VERSION_MAJOR} )
add_definitions( -DVERSION_MINOR_APP=${VERSION_MINOR} )
add_definitions( -DVERSION_MICRO_APP=${VERSION_MICRO} )
if (NOT DEFINED CMAKE_BUILD_TYPE_INIT)
set(CMAKE_BUILD_TYPE_INIT Release)
endif ()
include(nx-utils)
cmake_info("Building ${APP_TITLE} version ${APP_VERSION}.")
# SimpleModManager Core
set(SMM_CORE_DIR ${PROJECT_SOURCE_DIR}/core)
set(SMM_CORE_SOURCE_DIR ${SMM_CORE_DIR}/source)
set(SMM_CORE_INCLUDE_DIR ${SMM_CORE_DIR}/include)
include_directories(${SMM_CORE_INCLUDE_DIR})
# Submodules
set( SUBMODULES_DIR ${PROJECT_SOURCE_DIR}/submodules )
include_directories( ${SUBMODULES_DIR}/cpp-generic-toolbox/include )
include_directories( ${SUBMODULES_DIR}/simple-cpp-logger/include )
add_definitions( -D LOGGER_MAX_LOG_LEVEL_PRINTED=6 )
add_definitions( -D LOGGER_PREFIX_LEVEL=3 )
add_definitions( -D LOGGER_ENABLE_COLORS_ON_USER_HEADER=1 )
add_definitions( -D LOGGER_TIME_FORMAT="\\\"%d/%m/%Y %H:%M:%S"\\\" )
add_definitions( -D LOGGER_PREFIX_FORMAT="\\\"{TIME} {USER_HEADER} {FILELINE}"\\\" )
# Auto Generated
configure_file( version_config.h.in ${CMAKE_BINARY_DIR}/generated/version_config.h )
include_directories( ${CMAKE_BINARY_DIR}/generated/ )
include( ${CMAKE_CURRENT_SOURCE_DIR}/cmake/borealisLib.cmake )
# This project
add_subdirectory( ${CMAKE_CURRENT_SOURCE_DIR}/src )