From: Alexander Alekhin Date: Mon, 11 Dec 2017 12:22:48 +0000 (+0300) Subject: cmake: generate tbb version file X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~304^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8d4777c81de19454a0bc627a324d5bd6f13ffb22;p=platform%2Fupstream%2Fopencv.git cmake: generate tbb version file --- diff --git a/3rdparty/tbb/CMakeLists.txt b/3rdparty/tbb/CMakeLists.txt index f7c3154..f2b7b28 100644 --- a/3rdparty/tbb/CMakeLists.txt +++ b/3rdparty/tbb/CMakeLists.txt @@ -9,10 +9,11 @@ set(tbb_filename "2018_U1.tar.gz") set(tbb_subdir "tbb-2018_U1") set(tbb_md5 "b2f2fa09adf44a22f4024049907f774b") -set(tbb_version_file "version_string.ver") -ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702) -ocv_warnings_disable(CMAKE_CXX_FLAGS -Wshadow) -ocv_warnings_disable(CMAKE_CXX_FLAGS -Wunused-parameter) +ocv_warnings_disable(CMAKE_CXX_FLAGS /wd4702 + -Wshadow + -Wunused-parameter + -Wmissing-prototypes # MacOSX +) set(tbb_src_dir "${OpenCV_BINARY_DIR}/3rdparty/tbb") ocv_download(FILENAME ${tbb_filename} @@ -94,11 +95,15 @@ if (ARM AND NOT WIN32) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -include \"${CMAKE_CURRENT_SOURCE_DIR}/android_additional.h\"") endif() -set(TBB_SOURCE_FILES ${TBB_SOURCE_FILES} "${CMAKE_CURRENT_SOURCE_DIR}/${tbb_version_file}") +set(tbb_version_file "version_string.ver") +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${tbb_version_file}.cmakein" "${CMAKE_CURRENT_BINARY_DIR}/${tbb_version_file}" @ONLY) +list(APPEND TBB_SOURCE_FILES "${CMAKE_CURRENT_BINARY_DIR}/${tbb_version_file}") add_library(tbb ${TBB_SOURCE_FILES}) target_compile_definitions(tbb PUBLIC TBB_USE_GCC_BUILTINS=1 __TBB_GCC_BUILTIN_ATOMICS_PRESENT=1) -target_include_directories(tbb SYSTEM PUBLIC $) +target_include_directories(tbb SYSTEM PUBLIC $ + PRIVATE "${CMAKE_CURRENT_BINARY_DIR}" +) if (WIN32) if (ARM) diff --git a/3rdparty/tbb/version_string.tmp b/3rdparty/tbb/version_string.tmp deleted file mode 100644 index 81e5e22..0000000 --- a/3rdparty/tbb/version_string.tmp +++ /dev/null @@ -1,9 +0,0 @@ -#define __TBB_VERSION_STRINGS \ -"TBB: BUILD_HOST Unknown" ENDL \ -"TBB: BUILD_OS Android" ENDL \ -"TBB: BUILD_KERNEL Unknown" ENDL \ -"TBB: BUILD_GCC gcc version 4.4.3" ENDL \ -"TBB: BUILD_GLIBC Unknown" ENDL \ -"TBB: BUILD_LD Unknown" ENDL \ -"TBB: BUILD_TARGET Unknown" ENDL \ -"TBB: BUILD_COMMAND use cv::getBuildInformation() for details" ENDL diff --git a/3rdparty/tbb/version_string.ver b/3rdparty/tbb/version_string.ver deleted file mode 100644 index 8704849..0000000 --- a/3rdparty/tbb/version_string.ver +++ /dev/null @@ -1,9 +0,0 @@ -#define __TBB_VERSION_STRINGS(N) \ -#N": BUILD_HOST Unknown" ENDL \ -#N": BUILD_OS Android" ENDL \ -#N": BUILD_KERNEL Unknown" ENDL \ -#N": BUILD_GCC gcc version 4.4.3" ENDL \ -#N": BUILD_GLIBC Unknown" ENDL \ -#N": BUILD_LD Unknown" ENDL \ -#N": BUILD_TARGET Unknown" ENDL \ -#N": BUILD_COMMAND use cv::getBuildInformation() for details" ENDL diff --git a/3rdparty/tbb/version_string.ver.cmakein b/3rdparty/tbb/version_string.ver.cmakein new file mode 100644 index 0000000..1f8f0b8 --- /dev/null +++ b/3rdparty/tbb/version_string.ver.cmakein @@ -0,0 +1,6 @@ +#define __TBB_VERSION_STRINGS(N) \ +#N": BUILD_PACKAGE OpenCV @OPENCV_VERSION@" ENDL \ +#N": BUILD_HOST @CMAKE_HOST_SYSTEM_NAME@ @CMAKE_HOST_SYSTEM_VERSION@ @CMAKE_HOST_SYSTEM_PROCESSOR@" ENDL \ +#N": BUILD_TARGET @CMAKE_SYSTEM_NAME@ @CMAKE_SYSTEM_VERSION@ @CMAKE_SYSTEM_PROCESSOR@" ENDL \ +#N": BUILD_COMPILER @CMAKE_CXX_COMPILER@ (ver @CMAKE_CXX_COMPILER_VERSION@)" ENDL \ +#N": BUILD_COMMAND use cv::getBuildInformation() for details" ENDL