Build: fix make deps TBB on Linux, older versions don't support GCC 7.
[blender.git] / build_files / build_environment / cmake / tbb.cmake
index c4055d55648d1c87bf1bf8e9a752974b4d20f47c..fa5c9029ed06891bb08f39db62600e7ab25e1508 100644 (file)
@@ -23,6 +23,14 @@ set(TBB_EXTRA_ARGS
        -DTBB_BUILD_STATIC=On
 )
 
+if(TBB_VERSION MATCHES 2018)
+       set(TBB_VS_VERSION vs2013)
+elseif(TBB_VERSION MATCHES 2017)
+       set(TBB_VS_VERSION vs2012)
+else()
+       set(TBB_VS_VERSION vs2010)
+endif()
+
 # CMake script for TBB from https://github.com/wjakob/tbb/blob/master/CMakeLists.txt
 ExternalProject_Add(external_tbb
        URL ${TBB_URI}
@@ -30,7 +38,7 @@ ExternalProject_Add(external_tbb
        URL_HASH MD5=${TBB_HASH}
        PREFIX ${BUILD_DIR}/tbb
        PATCH_COMMAND COMMAND ${CMAKE_COMMAND} -E copy ${PATCH_DIR}/cmakelists_tbb.txt ${BUILD_DIR}/tbb/src/external_tbb/CMakeLists.txt &&
-               ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/vs2010/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
+               ${CMAKE_COMMAND} -E copy ${BUILD_DIR}/tbb/src/external_tbb/build/${TBB_VS_VERSION}/version_string.ver ${BUILD_DIR}/tbb/src/external_tbb/src/tbb/version_string.ver
        CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${LIBDIR}/tbb ${DEFAULT_CMAKE_FLAGS} ${TBB_EXTRA_ARGS}
        INSTALL_DIR ${LIBDIR}/tbb
 )