2020-11-08 22:49:53 +08:00
|
|
|
|
cmake_minimum_required(VERSION 3.14)
|
|
|
|
|
project (TaoQuick LANGUAGES CXX)
|
|
|
|
|
|
2020-11-09 01:16:08 +08:00
|
|
|
|
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
2020-11-08 22:49:53 +08:00
|
|
|
|
|
|
|
|
|
set(CMAKE_AUTOUIC ON)
|
|
|
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
|
set(CMAKE_AUTORCC ON)
|
|
|
|
|
|
|
|
|
|
# use c++11
|
2020-11-09 11:17:06 +08:00
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2020-11-08 22:49:53 +08:00
|
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
|
# use test
|
|
|
|
|
#enable_testing()
|
|
|
|
|
|
|
|
|
|
if (NOT PROJECT_BINARY_DIR)
|
|
|
|
|
set(PROJECT_BINARY_DIR build)
|
|
|
|
|
endif()
|
2020-12-02 08:52:00 +08:00
|
|
|
|
#if (NOT QT_DIR)
|
|
|
|
|
# set(QT_DIR "E:/qt5-install/lib/cmake/Qt6")
|
|
|
|
|
#endif()
|
|
|
|
|
#if (NOT Qt5_DIR)
|
|
|
|
|
# set(Qt5_DIR ${QT_DIR})
|
|
|
|
|
#endif()
|
|
|
|
|
#if (NOT Qt6_DIR)
|
|
|
|
|
# set(Qt6_DIR ${QT_DIR})
|
|
|
|
|
#endif()
|
2020-11-08 22:49:53 +08:00
|
|
|
|
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})
|
|
|
|
|
|
2020-11-10 00:41:40 +08:00
|
|
|
|
|
2020-11-08 22:49:53 +08:00
|
|
|
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
2022-01-05 13:14:14 +08:00
|
|
|
|
|
|
|
|
|
if(MSVC)
|
|
|
|
|
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
|
|
|
|
|
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
|
2022-01-18 11:08:49 +08:00
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D_UNICODE /DUNICODE")
|
2022-01-05 13:14:14 +08:00
|
|
|
|
endif()
|
2020-11-09 01:16:08 +08:00
|
|
|
|
|
2020-11-08 22:49:53 +08:00
|
|
|
|
add_subdirectory(examples)
|
|
|
|
|
|
2020-11-09 01:16:08 +08:00
|
|
|
|
#if (NOT CMAKE_NO_BUILD_TEST)
|
|
|
|
|
# add_subdirectory(test)
|
|
|
|
|
#endif()
|