forked from Ymagis/EclairLooks
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
73 lines (54 loc) · 2.38 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
cmake_minimum_required(VERSION 3.0)
project(ELook VERSION 0.2.6)
# -----------------------------------------------------------------------------
# Settings
# -----------------------------------------------------------------------------
option(USE_CCACHE "Use ccache if found" ON)
# -----------------------------------------------------------------------------
# Global
# -----------------------------------------------------------------------------
set(QT_PREFIX /usr/local/opt/qt)
set(LLVM_ROOT /usr/local/opt/llvm)
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
set(CMAKE_PREFIX_PATH ${QT_PREFIX}/lib/cmake)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_COMPILER "${LLVM_ROOT}/bin/clang++")
set(CMAKE_CXX_FLAGS "-fcolor-diagnostics -Wall -Werror -Wfatal-errors -stdlib=libc++")
set(CMAKE_CXX_FLAGS_DEBUG "-g -fno-omit-frame-pointer -Wno-unused-variable -Wno-unused-private-field -fsanitize=address -fsanitize=undefined")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
set(CMAKE_EXE_LINKER_FLAGS "-L${LLVM_ROOT}/lib")
#set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk")
#set(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# -----------------------------------------------------------------------------
# Build
# -----------------------------------------------------------------------------
set(INSTALL_DIR "${CMAKE_BINARY_DIR}/ext/dist")
set(CMAKE_BUILD_RPATH "${INSTALL_DIR}/lib")
add_subdirectory(ext)
add_subdirectory(src)
# -----------------------------------------------------------------------------
# Packaging
# -----------------------------------------------------------------------------
add_custom_target(bundle
COMMAND ${QT_PREFIX}/bin/macdeployqt src/ELook.app -dmg
DEPENDS ${PROJECT_NAME}
)
# -----------------------------------------------------------------------------
# Checks
# -----------------------------------------------------------------------------
set(RUN_CLANG_TIDY_BIN ${LLVM_ROOT}/share/clang/run-clang-tidy.py)
add_custom_target(
tidy
COMMAND ${RUN_CLANG_TIDY_BIN}
COMMENT "Running clang tidy"
)