diff options
author | bsolonenko <bsolonenko@luxoft.com> | 2018-11-21 14:10:14 +0200 |
---|---|---|
committer | Alexander Kutsan (GitHub) <akutsan@luxoft.com> | 2018-11-22 14:52:02 +0200 |
commit | c984f87604506620c1379e1a77bd616365a777c8 (patch) | |
tree | 0d14967008fb1a655da8ad3d5beff9ad3c256738 | |
parent | 0dfab1bc5b80410b76d88935d8ca2d5cc5569c7b (diff) | |
download | sdl_core-c984f87604506620c1379e1a77bd616365a777c8.tar.gz |
answer to review comment
-rw-r--r-- | CMakeLists.txt | 40 | ||||
-rw-r--r-- | src/components/media_manager/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/cmake/helpers/git_commit_information.cmake | 68 |
3 files changed, 70 insertions, 39 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a75b05adb2..d98e5438cd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,43 +54,7 @@ set(CMAKE_CXX_EXTENSIONS ON) # Enable PIC as static libraries may be linked to shared objects set(CMAKE_POSITION_INDEPENDENT_CODE TRUE) - -if(IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/.git") - find_package(Git) - if(GIT_FOUND) - execute_process( - COMMAND "${GIT_EXECUTABLE}" rev-parse --verify -q --short=8 HEAD - WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" - OUTPUT_VARIABLE head - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(head) - set(GIT_COMMIT "${head}") - execute_process( - COMMAND ${GIT_EXECUTABLE} update-index -q --refresh - WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" - ) - execute_process( - COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD -- - OUTPUT_VARIABLE dirty - OUTPUT_STRIP_TRAILING_WHITESPACE - WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" - ) - if(dirty) - set(GIT_COMMIT "${GIT_COMMIT}-dirty") - endif() - set_property(GLOBAL PROPERTY SDL_VERSION_GIT_COMMIT "${GIT_COMMIT}") - message(STATUS "Git commit was set to ${GIT_COMMIT}") - unset(GIT_COMMIT) - unset(head) - else() - message(WARNING "Failed to get git commit number from HEAD") - endif() - else(GIT_FOUND) - message(WARNING "Git package was not found in the system") - endif(GIT_FOUND) -endif() +include("${CMAKE_CURRENT_LIST_DIR}/tools/cmake/helpers/git_commit_information.cmake") #Jenkins integration section #dont modify this section if you dont know details about integration with Jenkins!!! @@ -287,7 +251,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_INSTALL_PREFIX ${CMAKE_CURRENT_BINARY_DIR}) set(ARCHIVE_OUTPUT_DIRECTORY ./bin) -set(CMAKE_CXX_FLAGS "-fPIC -std=gnu++11 -Wall -Werror -Wuninitialized -Wvla") +set(CMAKE_CXX_FLAGS "-fPIC -Wall -Werror -Wuninitialized -Wvla") if (USE_CCACHE) # Configure CCache if available diff --git a/src/components/media_manager/CMakeLists.txt b/src/components/media_manager/CMakeLists.txt index 3fe3005d66..7b0915b52c 100644 --- a/src/components/media_manager/CMakeLists.txt +++ b/src/components/media_manager/CMakeLists.txt @@ -57,7 +57,6 @@ target_sources(${PROJECT_NAME} "${CMAKE_CURRENT_LIST_DIR}/src/video/file_video_streamer_adapter.cc" "${CMAKE_CURRENT_LIST_DIR}/src/video/pipe_video_streamer_adapter.cc" "${CMAKE_CURRENT_LIST_DIR}/src/video/socket_video_streamer_adapter.cc" - #"${CMAKE_CURRENT_LIST_DIR}/src/video/video_stream_to_file_adapter.cc" ) if(EXTENDED_MEDIA_MODE) diff --git a/tools/cmake/helpers/git_commit_information.cmake b/tools/cmake/helpers/git_commit_information.cmake new file mode 100644 index 0000000000..783a397233 --- /dev/null +++ b/tools/cmake/helpers/git_commit_information.cmake @@ -0,0 +1,68 @@ +# Copyright (c) 2018, Ford Motor Company +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following +# disclaimer in the documentation and/or other materials provided with the +# distribution. +# +# Neither the name of the Ford Motor Company nor the names of its contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. + + +set(PROJECT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR}/../../../) +if(IS_DIRECTORY "${PROJECT_LIST_DIR}/.git") + find_package(Git) + if(GIT_FOUND) + execute_process( + COMMAND "${GIT_EXECUTABLE}" rev-parse --verify -q --short=8 HEAD + WORKING_DIRECTORY "${PROJECT_LIST_DIR}" + OUTPUT_VARIABLE head + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(head) + set(GIT_COMMIT "${head}") + execute_process( + COMMAND ${GIT_EXECUTABLE} update-index -q --refresh + WORKING_DIRECTORY "${PROJECT_LIST_DIR}" + ) + execute_process( + COMMAND ${GIT_EXECUTABLE} diff-index --name-only HEAD -- + OUTPUT_VARIABLE dirty + OUTPUT_STRIP_TRAILING_WHITESPACE + WORKING_DIRECTORY "${PROJECT_LIST_DIR}" + ) + if(dirty) + set(GIT_COMMIT "${GIT_COMMIT}-dirty") + endif() + set_property(GLOBAL PROPERTY SDL_VERSION_GIT_COMMIT "${GIT_COMMIT}") + message(STATUS "Git commit was set to ${GIT_COMMIT}") + unset(GIT_COMMIT) + unset(head) + else() + message(WARNING "Failed to get git commit number from HEAD") + endif() + else(GIT_FOUND) + message(WARNING "Git package was not found in the system") + endif(GIT_FOUND) +endif() |