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)
|
cmake_minimum_required(VERSION 3.20)
|
||||||
project(PomodoroTimer VERSION 0.1.1 LANGUAGES CXX)
|
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 C++ standard
|
||||||
set(CMAKE_CXX_STANDARD 17)
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
@ -10,11 +16,7 @@ set(CMAKE_CXX_EXTENSIONS OFF)
|
|||||||
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
|
find_package(Qt6 REQUIRED COMPONENTS Core Widgets)
|
||||||
qt6_standard_project_setup()
|
qt6_standard_project_setup()
|
||||||
|
|
||||||
# Include directories
|
# Include directories will be set as target properties below
|
||||||
include_directories(src/core)
|
|
||||||
include_directories(src/ui)
|
|
||||||
include_directories(src/system)
|
|
||||||
include_directories(src/utils)
|
|
||||||
|
|
||||||
# Define source files with new structure
|
# Define source files with new structure
|
||||||
set(CORE_HEADERS
|
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})
|
set(ALL_SOURCES main.cpp ${CORE_SOURCES} ${UI_SOURCES} ${SYSTEM_SOURCES})
|
||||||
|
|
||||||
# Create executable
|
# 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
|
# Link Qt libraries
|
||||||
target_link_libraries(${PROJECT_NAME} PRIVATE
|
target_link_libraries(${PROJECT_NAME} PRIVATE
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user