chore: initialize project structure with CMake

This commit is contained in:
BlackAngelTV committed 2026-08-24 21:13:41 +02:00
commit 6743d0b5e7
2 files changed
+63

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
build/
.cache/
*.o
*.so
*.a
*.dylib
CMakeCache.txt
CMakeFiles/
cmake_install.cmake
Makefile
compile_commands.json
.vscode/
.idea/
*.swp
*~
.DS_Store
+47
View File
@@ -0,0 +1,47 @@
cmake_minimum_required(VERSION 3.20)
project(PackageManager VERSION 1.0.0 LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
# Find Qt6
find_package(Qt6 REQUIRED COMPONENTS Widgets)
# Main executable
set(SOURCES
src/main.cpp
src/MainWindow.cpp
src/PluginManager.cpp
src/HistoryManager.cpp
src/PackageModel.cpp
)
set(HEADERS
include/IPackageManager.h
include/MainWindow.h
include/PluginManager.h
include/HistoryManager.h
include/PackageModel.h
)
add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
target_include_directories(${PROJECT_NAME} PRIVATE include)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Widgets)
# Plugins
add_subdirectory(plugins/pacman)
add_subdirectory(plugins/apt)
add_subdirectory(plugins/pkg)
add_subdirectory(plugins/universal)
# Install
install(TARGETS ${PROJECT_NAME} DESTINATION bin)
install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})
# Plugin install directory
set(PLUGIN_DIR "${CMAKE_INSTALL_PREFIX}/lib/${PROJECT_NAME}/plugins")
install(CODE "file(MAKE_DIRECTORY \"\${PLUGIN_DIR}\")")