diff --git a/CMakeLists.txt b/CMakeLists.txt index f187a62160..d8110b8b79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1262,16 +1262,7 @@ vp_system_information(NUMBER_OF_LOGICAL_CORES NUMBER_OF_PHYSICAL_CORES TOTAL_PHY find_host_package(Git QUIET) if(NOT DEFINED VISP_VCSVERSION AND GIT_FOUND) - execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "v[0-9].[0-9].[0-9]*" - WORKING_DIRECTORY "${VISP_SOURCE_DIR}" - OUTPUT_VARIABLE VISP_VCSVERSION - RESULT_VARIABLE GIT_RESULT - ERROR_QUIET - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - if(NOT GIT_RESULT EQUAL 0) - set(VISP_VCSVERSION "unknown") - endif() + vp_git_describe(VISP_VCSVERSION "${VISP_SOURCE_DIR}") elseif(NOT DEFINED VISP_VCSVERSION) # We don't have git: set(VISP_VCSVERSION "unknown") @@ -1322,11 +1313,12 @@ endif() # ========================== build platform ========================== status("") status(" Platform:") -if(NOT CMAKE_VERSION VERSION_LESS 2.8.11) - string(TIMESTAMP TIMESTAMP "" UTC) - if(TIMESTAMP) - status(" Timestamp:" ${TIMESTAMP}) - endif() +if(NOT DEFINED VISP_TIMESTAMP AND NOT BUILD_INFO_SKIP_TIMESTAMP) + string(TIMESTAMP VISP_TIMESTAMP "" UTC) + set(VISP_TIMESTAMP "${VISP_TIMESTAMP}" CACHE STRING "Timestamp of ViSP build configuration" FORCE) +endif() +if(VISP_TIMESTAMP) + status(" Timestamp:" ${VISP_TIMESTAMP}) endif() status(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR}) if(CMAKE_CROSSCOMPILING) diff --git a/cmake/VISPModule.cmake b/cmake/VISPModule.cmake index eee1761ba1..0089104ad9 100644 --- a/cmake/VISPModule.cmake +++ b/cmake/VISPModule.cmake @@ -590,11 +590,6 @@ macro(vp_target_include_modules target) if(d MATCHES "^visp_" AND HAVE_${d}) if (EXISTS "${VISP_MODULE_${d}_LOCATION}/include") vp_target_include_directories(${target} "${VISP_MODULE_${d}_LOCATION}/include") - # Work around to be able to build the modules without INTERFACE_INCLUDE_DIRECTORIES - # that was only introduces since CMake 2.8.12 - if (CMAKE_VERSION VERSION_LESS 2.8.12) - vp_target_include_directories(${target} "${VISP_MODULE_${d}_INC_DEPS}") - endif() endif() elseif(EXISTS "${d}") # FS keep external deps inc @@ -992,11 +987,6 @@ macro(vp_add_tests) foreach(d ${VISP_TEST_${the_module}_DEPS}) list(APPEND test_deps ${d}) list(APPEND test_deps ${VISP_MODULE_${d}_DEPS}) - # Work around to be able to build the modules without INTERFACE_INCLUDE_DIRECTORIES - # that was only introduces since CMake 2.8.12 - if(CMAKE_VERSION VERSION_LESS 2.8.12) - list(APPEND test_deps "${VISP_MODULE_${__m}_INC_DEPS}") - endif() endforeach() vp_check_dependencies(${test_deps}) diff --git a/cmake/VISPUtils.cmake b/cmake/VISPUtils.cmake index 3fa45576b3..3b8eebf23c 100644 --- a/cmake/VISPUtils.cmake +++ b/cmake/VISPUtils.cmake @@ -195,15 +195,11 @@ function(vp_target_include_directories target) endif() endforeach() if(__params) - if(CMAKE_VERSION VERSION_LESS 2.8.11) - include_directories(${__params}) + if(TARGET ${target}) + target_include_directories(${target} PRIVATE ${__params}) else() - if(TARGET ${target}) - target_include_directories(${target} PRIVATE ${__params}) - else() - set(__new_inc "${VP_TARGET_INCLUDE_DIRS_${target}};${__params}") - set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") - endif() + set(__new_inc "${VP_TARGET_INCLUDE_DIRS_${target}};${__params}") + set(VP_TARGET_INCLUDE_DIRS_${target} "${__new_inc}" CACHE INTERNAL "") endif() endif() endfunction() @@ -1969,3 +1965,26 @@ macro(vp_list_replace_string list_in list_out regular_expression replacement_exp endforeach() set(${list_out} ${__list_out}) endmacro() + +macro(vp_git_describe var_name path) + if(GIT_FOUND) + execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --exact-match --dirty + WORKING_DIRECTORY "${path}" + OUTPUT_VARIABLE ${var_name} + RESULT_VARIABLE GIT_RESULT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if(NOT GIT_RESULT EQUAL 0) + execute_process(COMMAND "${GIT_EXECUTABLE}" describe --tags --always --dirty --match "[0-9].[0-9].[0-9]*" + WORKING_DIRECTORY "${path}" + OUTPUT_VARIABLE ${var_name} + RESULT_VARIABLE GIT_RESULT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + endif() + else() + set(${var_name} "unknown") + endif() +endmacro() diff --git a/platforms/android/android.toolchain.cmake b/platforms/android/android.toolchain.cmake index 6645af3d1a..0096a29c99 100644 --- a/platforms/android/android.toolchain.cmake +++ b/platforms/android/android.toolchain.cmake @@ -1156,9 +1156,6 @@ if( NOT CMAKE_C_COMPILER ) endif() set( _CMAKE_TOOLCHAIN_PREFIX "${ANDROID_TOOLCHAIN_MACHINE_NAME}-" ) -if( CMAKE_VERSION VERSION_LESS 2.8.5 ) - set( CMAKE_ASM_COMPILER_ARG1 "-c" ) -endif() if( APPLE ) find_program( CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool ) if( NOT CMAKE_INSTALL_NAME_TOOL )