-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
50 lines (41 loc) · 1.15 KB
/
CMakeLists.txt
File metadata and controls
50 lines (41 loc) · 1.15 KB
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
# CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(TodoApp VERSION 1.0.0 LANGUAGES CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
# Compiler flags
if(MSVC)
add_compile_options(/W4)
else()
add_compile_options(-Wall -Wextra -O2)
endif()
# Include directories
include_directories(include)
# Source files
set(SOURCES
src/Task.cpp
src/TaskManager.cpp
src/FileHandler.cpp
src/UIManager.cpp
src/Utils.cpp
src/main.cpp
)
# Create executable
add_executable(todo-app ${SOURCES})
# Platform-specific settings
if(WIN32)
target_compile_definitions(todo-app PRIVATE _WIN32)
else()
target_compile_definitions(todo-app PRIVATE UNIX)
endif()
# Installation rules
install(TARGETS todo-app DESTINATION bin)
# Create data directory during installation
install(DIRECTORY DESTINATION ${CMAKE_INSTALL_PREFIX}/share/todo-app/data)
# Print build information
message(STATUS "Building Todo App v${PROJECT_VERSION}")
message(STATUS "C++ Standard: ${CMAKE_CXX_STANDARD}")
message(STATUS "Build Type: ${CMAKE_BUILD_TYPE}")
message(STATUS "Install Prefix: ${CMAKE_INSTALL_PREFIX}")