[CMake] Fixes for TBB tmp location (#3997)
* fixes for TBB tmp location: - DL_SDK_TEMP path is not normalized, that leads to paths check mismatch in CMake conditions - TBB is not downloaded again in a case tmp location is cleaned up and build restarted (TBB_DIR and TBBROOT are cache variables) * use reset_deps_cache & update_deps_cache for TBB_DIR var. * single reset_deps_cache call
This commit is contained in:
parent
cb266db570
commit
ce0537bd1f
@ -46,13 +46,7 @@ endif()
|
|||||||
function(set_temp_directory temp_variable source_tree_dir)
|
function(set_temp_directory temp_variable source_tree_dir)
|
||||||
if (DEFINED ENV{DL_SDK_TEMP} AND NOT $ENV{DL_SDK_TEMP} STREQUAL "")
|
if (DEFINED ENV{DL_SDK_TEMP} AND NOT $ENV{DL_SDK_TEMP} STREQUAL "")
|
||||||
message(STATUS "DL_SDK_TEMP environment is set : $ENV{DL_SDK_TEMP}")
|
message(STATUS "DL_SDK_TEMP environment is set : $ENV{DL_SDK_TEMP}")
|
||||||
|
file(TO_CMAKE_PATH $ENV{DL_SDK_TEMP} temp)
|
||||||
if (WIN32)
|
|
||||||
string(REPLACE "\\" "\\\\" temp $ENV{DL_SDK_TEMP})
|
|
||||||
else()
|
|
||||||
set(temp $ENV{DL_SDK_TEMP})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (ENABLE_ALTERNATIVE_TEMP)
|
if (ENABLE_ALTERNATIVE_TEMP)
|
||||||
set(ALTERNATIVE_PATH ${source_tree_dir}/temp)
|
set(ALTERNATIVE_PATH ${source_tree_dir}/temp)
|
||||||
endif()
|
endif()
|
||||||
|
@ -136,9 +136,9 @@ endif ()
|
|||||||
|
|
||||||
## TBB package
|
## TBB package
|
||||||
if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
||||||
reset_deps_cache(TBBROOT)
|
|
||||||
|
|
||||||
if(NOT DEFINED TBB_DIR AND NOT DEFINED ENV{TBB_DIR})
|
reset_deps_cache(TBBROOT TBB_DIR)
|
||||||
|
|
||||||
if (WIN32 AND X86_64)
|
if (WIN32 AND X86_64)
|
||||||
#TODO: add target_path to be platform specific as well, to avoid following if
|
#TODO: add target_path to be platform specific as well, to avoid following if
|
||||||
RESOLVE_DEPENDENCY(TBB
|
RESOLVE_DEPENDENCY(TBB
|
||||||
@ -172,15 +172,9 @@ if (THREADING STREQUAL "TBB" OR THREADING STREQUAL "TBB_AUTO")
|
|||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "TBB is not available on current platform")
|
message(FATAL_ERROR "TBB is not available on current platform")
|
||||||
endif()
|
endif()
|
||||||
else()
|
|
||||||
if(DEFINED TBB_DIR)
|
|
||||||
get_filename_component(TBB ${TBB_DIR} DIRECTORY)
|
|
||||||
else()
|
|
||||||
get_filename_component(TBB $ENV{TBB_DIR} DIRECTORY)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
|
update_deps_cache(TBBROOT "${TBB}" "Path to TBB root folder")
|
||||||
|
update_deps_cache(TBB_DIR "${TBB}/cmake" "Path to TBB cmake folder")
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
log_rpath_from_dir(TBB "${TBB}/bin")
|
log_rpath_from_dir(TBB "${TBB}/bin")
|
||||||
|
Loading…
Reference in New Issue
Block a user