Update CMake configuration for Qt path and restructure include directories
This commit is contained in:
parent
9f1c60b356
commit
f346982e12
@ -1,6 +1,12 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
project(PomodoroTimer VERSION 0.1.1 LANGUAGES CXX)
|
||||
|
||||
# --- CONFIGURATION: QT PATH ---
|
||||
# If CMake cannot find Qt automatically, uncomment the line below and set the path
|
||||
# to your Qt installation folder (the folder containing 'bin', 'include', 'lib').
|
||||
# Example: set(CMAKE_PREFIX_PATH "C:/Qt/6.7.0/mingw_64")
|
||||
set(CMAKE_PREFIX_PATH "C:/Qt/6.10.1/mingw_64")
|
||||
|
||||
# Set C++ standard
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
@ -10,11 +16,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
|
||||
qt6_standard_project_setup()
|
||||
|
||||
# Include directories
|
||||
include_directories(src/core)
|
||||
include_directories(src/ui)
|
||||
include_directories(src/system)
|
||||
include_directories(src/utils)
|
||||
# Include directories will be set as target properties below
|
||||
|
||||
# Define source files with new structure
|
||||
set(CORE_HEADERS
|
||||
@ -59,7 +61,15 @@ set(ALL_HEADERS ${CORE_HEADERS} ${UI_HEADERS} ${SYSTEM_HEADERS})
|
||||
set(ALL_SOURCES main.cpp ${CORE_SOURCES} ${UI_SOURCES} ${SYSTEM_SOURCES})
|
||||
|
||||
# Create executable
|
||||
qt6_add_executable(${PROJECT_NAME} ${ALL_SOURCES} ${ALL_HEADERS})
|
||||
qt6_add_executable(${PROJECT_NAME} ${ALL_SOURCES})
|
||||
|
||||
# Set include directories for the target
|
||||
target_include_directories(${PROJECT_NAME} PRIVATE
|
||||
src/core
|
||||
src/ui
|
||||
src/system
|
||||
src/utils
|
||||
)
|
||||
|
||||
# Link Qt libraries
|
||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||
|
||||
Loading…
Reference in New Issue
Block a user