diff --git a/cmake/taoQuick.cmake b/cmake/taoQuick.cmake index 578bae93..280ee00a 100644 --- a/cmake/taoQuick.cmake +++ b/cmake/taoQuick.cmake @@ -2,12 +2,16 @@ set(TaoQuickPath ${CMAKE_SOURCE_DIR}/src/TaoQuick/imports) if (CMAKE_BUILD_TYPE MATCHES "Release") set(TaoQuickRes ${TaoQuickPath}/TaoQuick/TaoQuick.qrc CACHE STRING "tao quick res path") - add_compile_definitions(TaoQuickImportPath="qrc:///") - add_compile_definitions(TaoQuickImagePath="qrc:/TaoQuick/Images/") + set(TaoQuickImportPath "qrc:///" CACHE STRING "tao quick import path") + set(TaoQuickImagePath "qrc:/TaoQuick/Images/" CACHE STRING "tao quick image path") + else() - add_compile_definitions(TaoQuickImportPath="file:///${TaoQuickPath}") - add_compile_definitions(TaoQuickImagePath="file:///${TaoQuickPath}/TaoQuick/Images/") + set(TaoQuickImportPath "file:///${TaoQuickPath}" CACHE STRING "tao quick import path") + set(TaoQuickImagePath "file:///${TaoQuickPath}/TaoQuick/Images/" CACHE STRING "tao quick image path") endif() +add_compile_definitions(TaoQuickImportPath="${TaoQuickImportPath}") +add_compile_definitions(TaoQuickImagePath="${TaoQuickImagePath}") + add_compile_definitions(QML_IMPORT_PATH="${TaoQuickPath}") add_compile_definitions(QML2_IMPORT_PATH="${TaoQuickPath}") add_compile_definitions(QML_DESIGNER_IMPORT_PATH="${TaoQuickPath}") diff --git a/cmake/taoVersion.cmake b/cmake/taoVersion.cmake index 414ce8ca..0f7f0370 100644 --- a/cmake/taoVersion.cmake +++ b/cmake/taoVersion.cmake @@ -8,19 +8,20 @@ execute_process( COMMAND ${GIT_EXECUTABLE} rev-parse HEAD WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} OUTPUT_VARIABLE OUTPUT) - if (OUTPUT) string(SUBSTRING ${OUTPUT} 0 10 REVISION) endif() message("REVISION ${REVISION}") -add_compile_definitions(TaoREVISION=${REVISION}) add_compile_definitions(TaoREVISIONSTR="${REVISION}") set (TAG "0.0.0.0") execute_process( COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - OUTPUT_VARIABLE TAG) + OUTPUT_VARIABLE OUTPUT) +if(OUTPUT) + string(STRIP ${OUTPUT} TAG) +endif() message("TAG ${TAG}") add_compile_definitions(TaoVer="${TAG}") string(REPLACE "." ";" VERSION_LIST ${TAG}) @@ -31,6 +32,6 @@ add_compile_definitions(TaoMAJ=${TAG_VERSION_MAJOR}) add_compile_definitions(TaoMIN=${TAG_VERSION_MINOR}) add_compile_definitions(TaoPAT=${TAG_VERSION_PATCH}) -string(TIMESTAMP DateTime "%Y-%m-%d %H:%M") +string(TIMESTAMP DateTime "%Y-%m-%d %H:%M:%S") add_compile_definitions(TaoDATETIME="${DateTime}") add_compile_definitions(CXX_COMPILER_ID="${CMAKE_CXX_COMPILER_ID}") diff --git a/examples/TaoQuickShow/CMakeLists.txt b/examples/TaoQuickShow/CMakeLists.txt index 5097ad89..2d82444c 100644 --- a/examples/TaoQuickShow/CMakeLists.txt +++ b/examples/TaoQuickShow/CMakeLists.txt @@ -7,8 +7,9 @@ if (QT_VERSION VERSION_LESS 5.9.0) message(FATAL_ERROR "TaoQuick minimum supported Qt5 version is 5.9.0") endif() -aux_source_directory(./Src SRC1) -aux_source_directory(./Src/DeviceAddTable SRC2) +aux_source_directory(Src SRC1) +aux_source_directory(Src/DeviceAddTable SRC2) + include(taoVersion) add_compile_definitions(TaoCommon_NO_LIB)