forked from agateau/nanonote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (53 loc) · 1.7 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
cmake_minimum_required(VERSION 3.17)
project(nanonote
VERSION 1.3.91
DESCRIPTION "Minimalist note taking application for short-lived notes"
HOMEPAGE_URL "https://github.com/agateau/nanonote"
)
include(CTest)
set(AUTHOR_NAME "Aurélien Gâteau")
set(AUTHOR_EMAIL "[email protected]")
set(ORGANIZATION_NAME "agateau.com")
set(INVERSE_ORGANIZATION_NAME "com.agateau")
set(APP_HUMAN_NAME "Nanonote")
set(APP_NAME ${PROJECT_NAME})
set(APPLIB_NAME ${PROJECT_NAME}lib)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
# Dependencies
find_package(Qt5 CONFIG REQUIRED Core Widgets Test LinguistTools)
find_package(ECM REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
include(third-party/qpropgen/cmake/qpropgen.cmake)
# Installation directories
if (UNIX AND NOT APPLE)
include(GNUInstallDirs)
set(DATA_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/${APP_NAME}")
set(BIN_INSTALL_DIR "bin")
set(BIN_TO_DATA_DIR "../${DATA_INSTALL_DIR}")
endif()
if (WIN32)
set(DATA_INSTALL_DIR ".")
set(BIN_INSTALL_DIR ".")
set(BIN_TO_DATA_DIR ".")
endif()
if (APPLE)
set(DATA_INSTALL_DIR "${APP_NAME}.app/Contents/Resources")
set(BIN_INSTALL_DIR "${APP_NAME}.app/Contents/MacOS")
set(BIN_TO_DATA_DIR "../Resources")
endif()
# Build flags
if (CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
add_compile_options(-Wall -Woverloaded-virtual)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
# Source dirs
add_subdirectory(third-party)
add_subdirectory(src)
if (BUILD_TESTING)
enable_testing() # must come *before* adding tests directory
add_subdirectory(tests)
endif()
add_subdirectory(packaging)