Skip to content

Commit

Permalink
add CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jared2020 committed Nov 8, 2020
1 parent 9d09e37 commit 00897e8
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ bin
*.cbt
debug
*.ipch
*qmlcache.qrc
*qmlcache.qrc
build
bin
.vc
.vscode
36 changes: 36 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.14)
project (TaoQuick LANGUAGES CXX)

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules)

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

# use c++11
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# use test
#enable_testing()

if (NOT PROJECT_BINARY_DIR)
set(PROJECT_BINARY_DIR build)
endif()

set (EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
set (LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
message("Build Type " ${CMAKE_BUILD_TYPE})

include_directories(${PROJECT_SOURCE_DIR})

set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_subdirectory(examples)

if (NOT CMAKE_NO_BUILD_TEST)
add_subdirectory(test)
endif()
1 change: 1 addition & 0 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add_subdirectory(TaoQuickShow)
18 changes: 18 additions & 0 deletions examples/TaoQuickShow/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
set(TargetName TaoQuickShow)


file(GLOB_RECURSE CURRENT_HEADERS *.h *.hpp)

aux_source_directory(./Src SRC1)
aux_source_directory(./Src/DeviceAddTable SRC2)

find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Quick QuickControls2 REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Quick QuickControls2 REQUIRED)


add_executable(${TargetName}
${SRC1}
${SRC2}
Qml.qrc
Contents.qrc
)

0 comments on commit 00897e8

Please sign in to comment.