-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
62 lines (51 loc) · 1.59 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
cmake_minimum_required(VERSION 3.8.8)
project(Bullock)
include(deps/buildcore/base.cmake)
find_package(Qt6 COMPONENTS Core Network Widgets REQUIRED)
include(address_sanitizer)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_definitions(-DDEBUG)
else()
add_definitions(-DNDEBUG)
endif()
if(NOT MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wsign-compare")
if (CMAKE_BUILD_TYPE STREQUAL "Release")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color")
endif()
if(APPLE)
set(CMAKE_MACOSX_RPATH OFF)
set(CMAKE_INSTALL_NAME_DIR "@executable_path/../Library/Bullock")
set(BULLOCK_DIST_BIN Bullock.app/Contents/MacOS)
set(BULLOCK_DIST_LIB Bullock.app/Contents/Library)
set(BULLOCK_DIST_MODULE Bullock.app/Contents/Plugins)
set(BULLOCK_DIST_RESOURCES Bullock.app/Contents/Resources)
set(BULLOCK_DIST_MAC_APP_CONTENTS Bullock.app/Contents)
else()
set(CMAKE_INSTALL_RPATH "$ORIGIN" "$ORIGIN/../lib/Bullock")
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(BULLOCK_DIST_BIN bin)
set(BULLOCK_DIST_LIB lib)
set(BULLOCK_DIST_RESOURCES share)
endif()
enable_testing()
add_subdirectory($ENV{OX_PATH} $ENV{OX_PATH})
include_directories(
SYSTEM
$ENV{OX_PATH}/src
)
add_subdirectory(src)
install(
FILES
rsrc/icons/bullock128.png
rsrc/icons/bullock512.png
DESTINATION
${BULLOCK_DIST_RESOURCES}/icons
)