2021-08-16 16:14:47 +00:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
2019-09-24 11:26:43 +00:00
|
|
|
project(contactlist LANGUAGES CXX)
|
|
|
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
2020-05-15 08:39:51 +00:00
|
|
|
if(NOT DEFINED INSTALL_EXAMPLESDIR)
|
2022-01-20 16:42:48 +00:00
|
|
|
set(INSTALL_EXAMPLESDIR "examples")
|
2020-05-15 08:39:51 +00:00
|
|
|
endif()
|
|
|
|
|
|
|
|
set(INSTALL_EXAMPLEDIR "${INSTALL_EXAMPLESDIR}/quickcontrols2/contactlist")
|
2019-09-24 11:26:43 +00:00
|
|
|
|
2022-01-20 16:42:48 +00:00
|
|
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Quick)
|
2019-09-24 11:26:43 +00:00
|
|
|
|
2020-10-16 14:22:27 +00:00
|
|
|
qt_add_executable(contactlist
|
2019-09-24 11:26:43 +00:00
|
|
|
contactmodel.cpp contactmodel.h
|
|
|
|
main.cpp
|
|
|
|
)
|
2022-01-20 16:42:48 +00:00
|
|
|
|
2020-10-26 16:32:24 +00:00
|
|
|
set_target_properties(contactlist PROPERTIES
|
|
|
|
WIN32_EXECUTABLE TRUE
|
|
|
|
MACOSX_BUNDLE TRUE
|
|
|
|
)
|
2022-01-20 16:42:48 +00:00
|
|
|
|
2019-09-24 11:26:43 +00:00
|
|
|
target_link_libraries(contactlist PUBLIC
|
|
|
|
Qt::Core
|
|
|
|
Qt::Gui
|
|
|
|
Qt::Quick
|
|
|
|
)
|
|
|
|
|
|
|
|
# Resources:
|
|
|
|
set(qmake_immediate_resource_files
|
|
|
|
"ContactDelegate.ui.qml"
|
|
|
|
"ContactDialog.qml"
|
|
|
|
"ContactForm.ui.qml"
|
|
|
|
"ContactView.ui.qml"
|
|
|
|
"SectionDelegate.ui.qml"
|
|
|
|
"contactlist.qml"
|
|
|
|
"designer/Backend/ContactModel.qml"
|
|
|
|
)
|
|
|
|
|
|
|
|
qt6_add_resources(contactlist "qmake_immediate"
|
|
|
|
PREFIX
|
|
|
|
"/"
|
|
|
|
FILES
|
|
|
|
${qmake_immediate_resource_files}
|
|
|
|
)
|
|
|
|
|
|
|
|
install(TARGETS contactlist
|
|
|
|
RUNTIME DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
|
|
BUNDLE DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
|
|
LIBRARY DESTINATION "${INSTALL_EXAMPLEDIR}"
|
|
|
|
)
|