Merge pull request #102 from Shatur95/update_cmake_examples

Update CMake examples
This commit is contained in:
Itay Grudev 2020-05-15 16:52:10 +01:00 committed by GitHub
commit 3a7d48f173
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 14 deletions

View File

@ -1,15 +1,13 @@
cmake_minimum_required(VERSION 3.1.0) cmake_minimum_required(VERSION 3.1.0)
project(basic) project(basic LANGUAGES CXX)
# SingleApplication base class # SingleApplication base class
set(QAPPLICATION_CLASS QCoreApplication CACHE STRING "Inheritance class for SingleApplication") set(QAPPLICATION_CLASS QCoreApplication)
add_executable(basic add_executable(basic main.cpp)
main.cpp
)
find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Qt5 COMPONENTS Core REQUIRED)
add_subdirectory(../.. SingleApplication) add_subdirectory(../.. SingleApplication)
target_link_libraries(${PROJECT_NAME} Qt5::Core SingleApplication) target_link_libraries(${PROJECT_NAME} SingleApplication)

View File

@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.1.0) cmake_minimum_required(VERSION 3.1.0)
project(calculator) project(calculator LANGUAGES CXX)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
# SingleApplication base class # SingleApplication base class
set(QAPPLICATION_CLASS QApplication CACHE STRING "Inheritance class for SingleApplication") set(QAPPLICATION_CLASS QApplication)
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
button.h button.h
@ -13,8 +13,8 @@ add_executable(${PROJECT_NAME}
button.cpp button.cpp
calculator.cpp calculator.cpp
main.cpp main.cpp
) )
find_package(Qt5 COMPONENTS Widgets REQUIRED) find_package(Qt5 COMPONENTS Widgets REQUIRED)
add_subdirectory(../.. SingleApplication) add_subdirectory(../.. SingleApplication)
target_link_libraries(${PROJECT_NAME} Qt5::Widgets SingleApplication) target_link_libraries(${PROJECT_NAME} SingleApplication)

View File

@ -1,19 +1,19 @@
cmake_minimum_required(VERSION 3.1.0) cmake_minimum_required(VERSION 3.1.0)
project(sending_arguments) project(sending_arguments LANGUAGES CXX)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
# SingleApplication base class # SingleApplication base class
set(QAPPLICATION_CLASS QCoreApplication CACHE STRING "Inheritance class for SingleApplication") set(QAPPLICATION_CLASS QCoreApplication)
add_executable(${PROJECT_NAME} add_executable(${PROJECT_NAME}
main.cpp main.cpp
messagereceiver.cpp messagereceiver.cpp
messagereceiver.h messagereceiver.h
main.cpp main.cpp
) )
find_package(Qt5 COMPONENTS Core REQUIRED) find_package(Qt5 COMPONENTS Core REQUIRED)
add_subdirectory(../.. SingleApplication) add_subdirectory(../.. SingleApplication)
target_link_libraries(${PROJECT_NAME} Qt5::Core SingleApplication) target_link_libraries(${PROJECT_NAME} SingleApplication)