diff --git a/CMakeLists.txt b/CMakeLists.txt index 080b8fb21..f4a8c5efc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,29 +108,60 @@ IF(MSVC OR MINGW) ENDIF() ENDIF() +#============================================================================== + +SET(SCRIPTS_DIRECTORY ${RDO_BASE_DIRECTORY}/scripts) + +FILE(GLOB_RECURSE SCRIPT_FILES ${SCRIPTS_DIRECTORY}/*) + FILE(GLOB DOC_FILES ${RDO_BASE_DIRECTORY}/doc/*.txt) LIST(APPEND DOC_FILES ${RDO_BASE_DIRECTORY}/doc/rdodoc-src-html.doxyfile) +SET(TEXT_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/README.md + ${SCRIPT_FILES} + ${DOC_FILES} + ) + +#============================================================================== +#----------------------------- get git version -------------------------------- #============================================================================== -FIND_PACKAGE(Subversion) +FIND_PACKAGE(Git) -IF(NOT SUBVERSION_FOUND) - MESSAGE(FATAL_ERROR "SUBVERSION NOT FOUND") +IF(NOT GIT_FOUND) + MESSAGE(FATAL_ERROR "GIT NOT FOUND") ENDIF() -SET(SVN_RES TRUE) +SET(GIT_RES_LONG FALSE) +SET(GIT_RES_SHORT FALSE) + +SET(GIT_FILE_VERSION_LONG "${CMAKE_CURRENT_BINARY_DIR}/git.version.long") +SET(GIT_FILE_VERSION_SHORT "${CMAKE_CURRENT_BINARY_DIR}/git.version.short") -SET(FILE_VERSION "${CMAKE_CURRENT_BINARY_DIR}/svn.version.txt") -EXECUTE_PROCESS(COMMAND svnversion -n ${RDO_BASE_DIRECTORY} RESULT_VARIABLE ${SVN_RES} OUTPUT_FILE ${FILE_VERSION}) +EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ${GIT_RES_LONG} OUTPUT_FILE ${GIT_FILE_VERSION_LONG}) +EXECUTE_PROCESS(COMMAND ${GIT_EXECUTABLE} describe --abbrev=0 --tags WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} RESULT_VARIABLE ${GIT_RES_SHORT} OUTPUT_FILE ${GIT_FILE_VERSION_SHORT}) -FILE(READ ${FILE_VERSION} READ_DATA) -STRING(REPLACE "\n" "" CMAKE_SVN_VERSION ${READ_DATA}) +FILE(READ ${GIT_FILE_VERSION_LONG} READ_DATA_LONG) +STRING(REPLACE "\n" "" GIT_VERSION_LONG ${READ_DATA_LONG}) -MESSAGE(STATUS "SVN VERSION: ${CMAKE_SVN_VERSION}") +FILE(READ ${GIT_FILE_VERSION_SHORT} READ_DATA_SHORT) +STRING(REPLACE "\n" "" GIT_VERSION_SHORT ${READ_DATA_SHORT}) -SET(PROJECT_VERSION ${CMAKE_SVN_VERSION}) -SET(PROJECT_VERSION_LONG ${CMAKE_SVN_VERSION}) +MESSAGE(STATUS "Git version : ${GIT_VERSION_LONG}") + +STRING(LENGTH "${GIT_VERSION_LONG}" TEMP_LENGTH) +STRING(SUBSTRING "${GIT_VERSION_LONG}" 1 -1 GIT_VERSION_LONG_NUM) + +STRING(LENGTH "${GIT_VERSION_SHORT}" TEMP_LENGTH) +STRING(SUBSTRING "${GIT_VERSION_SHORT}" 1 -1 GIT_VERSION_SHORT_NUM) + +SET(GIT_VERSION ${GIT_VERSION_SHORT}) + +#============================================================================== + +SET(PROJECT_VERSION ${GIT_VERSION_SHORT}) +SET(PROJECT_VERSION_LONG ${GIT_VERSION_LONG} ) #============================================================================== @@ -157,13 +188,6 @@ ENDIF() #============================================================================== -SET(SCRIPTS_DIRECTORY ${RDO_BASE_DIRECTORY}/scripts) - -SET(SCRIPT_FILES - ${SCRIPTS_DIRECTORY}/python/executor_of_system_tests.py - ${SCRIPTS_DIRECTORY}/statistics/statistics.sh -) - IF(MSVC OR MINGW) SET(BISON_FLEX_DIRECTORY ${RDO_BASE_DIRECTORY}/thirdparty/bison_flex) SET(ENV{BISON_PKGDATADIR} ${BISON_FLEX_DIRECTORY}/share/bison) @@ -217,7 +241,7 @@ MESSAGE(STATUS ${NOOP_STRING}) MESSAGE(STATUS ${BUILD_INFO_BAR}) MESSAGE(STATUS "Summary of the build:") MESSAGE(STATUS ${BUILD_INFO_BAR}) -MESSAGE(STATUS "APP VERSION: ${CMAKE_SVN_VERSION}") +MESSAGE(STATUS "APP VERSION: ${PROJECT_VERSION_LONG}") MESSAGE(STATUS ${BUILD_INFO_BAR}) MESSAGE(STATUS "BUILD rdo console: ${BUILD_RDO_CONSOLE}") MESSAGE(STATUS "BUILD rdo studio: ${BUILD_RDO_STUDIO}") diff --git a/app/rdo_console/CMakeLists.txt b/app/rdo_console/CMakeLists.txt index b356448a7..5e577fa54 100644 --- a/app/rdo_console/CMakeLists.txt +++ b/app/rdo_console/CMakeLists.txt @@ -19,7 +19,7 @@ SET(RESOURCES_FILES ) FILE(GLOB_RECURSE SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp) -ADD_EXECUTABLE(rdo ${SOURCE_FILES}) +ADD_EXECUTABLE(rdo ${SOURCE_FILES} ${TEXT_FILES}) ADD_DEPENDENCIES(rdo rdo_utils) ADD_DEPENDENCIES(rdo rdo_kernel) diff --git a/app/rdo_studio/CMakeLists.txt b/app/rdo_studio/CMakeLists.txt index 01627a003..70fbca8e8 100644 --- a/app/rdo_studio/CMakeLists.txt +++ b/app/rdo_studio/CMakeLists.txt @@ -512,7 +512,7 @@ ENDFOREACH() ADD_EXECUTABLE(rdo_studio ${RDO_STUDIO_SOURCE_FILES} - ${DOC_FILES} + ${TEXT_FILES} ) ADD_LIBRARY(rdo_application STATIC diff --git a/scripts/env/linux.clang.sh b/scripts/env/linux.clang.sh new file mode 100755 index 000000000..87b767233 --- /dev/null +++ b/scripts/env/linux.clang.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +export CC=/usr/bin/clang +export CXX=/usr/bin/clang++ +