Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cmake_minimum_required(VERSION 3.16)
- project(treeview VERSION 0.1 LANGUAGES CXX)
- list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
- set(CMAKE_INCLUDE_CURRENT_DIR ON)
- set(CMAKE_AUTOMOC ON)
- set(CMAKE_CXX_STANDARD_REQUIRED ON)
- find_package(Qt6 REQUIRED COMPONENTS Core Qml Quick Widgets)
- qt_add_executable(treeview
- treemodel.h treemodel.cpp
- treeitem.h treeitem.cpp
- main.cpp
- )
- qt_add_qml_module(treeview
- URI TreeViewExample
- VERSION 1.0
- SOURCES
- QML_FILES
- main.qml
- )
- set_target_properties(treeview PROPERTIES
- WIN32_EXECUTABLE TRUE
- )
- target_link_libraries(treeview PRIVATE
- Qt::Widgets
- Qt::Core
- Qt::Qml
- Qt::Quick
- )
- target_compile_definitions(treeview PRIVATE
- APP_NAME=tree_view
- TOP_BUILDDIR=${CMAKE_BINARY_DIR}
- )
- list(APPEND QML_IMPORT_PATH ${CMAKE_CURRENT_BINARY_DIR})
- list(REMOVE_DUPLICATES QML_IMPORT_PATH)
- set(QML_IMPORT_PATH ${QML_IMPORT_PATH} CACHE STRING "Automate QML_IMPORT_PATH for QtCreator" FORCE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement