Skip to content

Commit

Permalink
Merge pull request #7 from proydakov/dev
Browse files Browse the repository at this point in the history
Get my changes
  • Loading branch information
aurusov committed Apr 6, 2014
2 parents afd3588 + 26f93fe commit 9f255b1
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 21 deletions.
62 changes: 43 additions & 19 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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} )

#==============================================================================

Expand All @@ -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)
Expand Down Expand Up @@ -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}")
Expand Down
2 changes: 1 addition & 1 deletion app/rdo_console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion app/rdo_studio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ ENDFOREACH()

ADD_EXECUTABLE(rdo_studio
${RDO_STUDIO_SOURCE_FILES}
${DOC_FILES}
${TEXT_FILES}
)

ADD_LIBRARY(rdo_application STATIC
Expand Down
5 changes: 5 additions & 0 deletions scripts/env/linux.clang.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

export CC=/usr/bin/clang
export CXX=/usr/bin/clang++

0 comments on commit 9f255b1

Please sign in to comment.