Commit 6bb1818d authored by Pawel Sznajder's avatar Pawel Sznajder
Browse files

update version and improve CMake.file

parent efc46172
......@@ -22,25 +22,22 @@ file(READ ${CMAKE_SOURCE_DIR}/data/version.txt VERSION_STR)
# strip spaces
string(STRIP ${VERSION_STR} VERSION_STR)
# get major and minor versions
string(REGEX REPLACE "\\.[0-9]*" "" ELEMENTARY_UTILS_VERSION_MAJOR ${VERSION_STR})
string(REGEX REPLACE "[0-9]*\\." "" ELEMENTARY_UTILS_VERSION_MINOR ${VERSION_STR})
# get major, minor and patch versions
string(REGEX MATCH "^[0-9]*\\." TMP_STR ${VERSION_STR})
string(REGEX REPLACE "\\." "" ELEMENTARY_UTILS_VERSION_MAJOR ${TMP_STR})
# configure
configure_file(${CMAKE_SOURCE_DIR}/cmake/Version/ElementaryUtilsVersion.h_in ${CMAKE_SOURCE_DIR}/include/ElementaryUtils/ElementaryUtilsVersion.h)
string(REGEX MATCH "\\.[0-9]*\\." TMP_STR ${VERSION_STR})
string(REGEX REPLACE "\\." "" ELEMENTARY_UTILS_VERSION_MINOR ${TMP_STR})
# AUTOMOC ==================================================================================
string(REGEX MATCH "\\.[0-9]*$" TMP_STR ${VERSION_STR})
string(REGEX REPLACE "\\." "" ELEMENTARY_UTILS_VERSION_PATCH ${TMP_STR})
# tell cmake to run Qt moc when necessary
set(CMAKE_AUTOMOC ON)
# as moc files are generated in the binary dir, tell cmake to always look for includes there
set(CMAKE_INCLUDE_CURRENT_DIR ON)
message("-- ElementaryUtils version is: " ${ELEMENTARY_UTILS_VERSION_MAJOR} "." ${ELEMENTARY_UTILS_VERSION_MINOR} "." ${ELEMENTARY_UTILS_VERSION_PATCH})
# FIND LIBRARIES ===========================================================================
# configure
configure_file(${CMAKE_SOURCE_DIR}/cmake/Version/ElementaryUtilsVersion.h_in ${CMAKE_SOURCE_DIR}/include/ElementaryUtils/ElementaryUtilsVersion.h)
# find libraries: Qt
find_package(Qt5 COMPONENTS Core)
# FIND LIBRARIES ===========================================================================
# find libraries: additional modules
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment