Skip to content

Commit

Permalink
update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
jared2020 committed Nov 11, 2020
1 parent ea59e84 commit a9eb3ca
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
12 changes: 8 additions & 4 deletions cmake/taoQuick.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
9 changes: 5 additions & 4 deletions cmake/taoVersion.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand All @@ -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}")
5 changes: 3 additions & 2 deletions examples/TaoQuickShow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a9eb3ca

Please sign in to comment.