Skip to content

Commit

Permalink
Merge pull request #43 from itzurabhi/feature/cmake-build
Browse files Browse the repository at this point in the history
Feature : Add CMake build
  • Loading branch information
alex-spataru authored Aug 22, 2024
2 parents 518b873 + 84d3827 commit 791c8e2
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
26 changes: 26 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
cmake_minimum_required(VERSION 3.3)
project(QSimpleUpdater
LANGUAGES CXX
)

set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOMOC ON)

find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network)
find_package(Qt${QT_VERSION_MAJOR} CONFIG REQUIRED COMPONENTS Widgets Network)

add_library(QSimpleUpdater STATIC
etc/resources/qsimpleupdater.qrc
include/QSimpleUpdater.h
src/Downloader.cpp
src/Downloader.h
src/Downloader.ui
src/QSimpleUpdater.cpp
src/Updater.cpp
src/Updater.h
)
target_include_directories(QSimpleUpdater PUBLIC include)
target_link_libraries(QSimpleUpdater PUBLIC Qt${QT_VERSION_MAJOR}::Core Qt${QT_VERSION_MAJOR}::Widgets PRIVATE Qt${QT_VERSION_MAJOR}::Network)

add_subdirectory(tutorial)
12 changes: 12 additions & 0 deletions tutorial/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
project(QSU_Tutorial
LANGUAGES CXX
)

add_executable(QSU_Tutorial WIN32 MACOSX_BUNDLE EXCLUDE_FROM_ALL
src/Window.ui
src/Window.h
src/Window.cpp
src/main.cpp
)
target_compile_definitions(QSimpleUpdater PUBLIC QSU_INCLUDE_MOC)
target_link_libraries(QSU_Tutorial QSimpleUpdater)

0 comments on commit 791c8e2

Please sign in to comment.