Skip to content

Commit

Permalink
for tbb windows build#4
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudeus committed Apr 22, 2024
1 parent 5c189b4 commit adb4da9
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,26 @@ if(WITH_LIBTBB STREQUAL "EXTERNAL")

set(WIN_LIBTBB_INSTALL_DIR "${WINDOWS_EXTERNAL_DIR}/Install/tbb")
file(MAKE_DIRECTORY ${WIN_LIBTBB_INSTALL_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E tar -xf ${WIN_LIBTBB_FILENAME} WORKING_DIRECTORY ${WIN_LIBTBB_INSTALL_DIR})
set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${WIN_LIBTBB_INSTALL_DIR} PARENT_SCOPE)
add_custom_target(${LIBTBB_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo " extract ${WIN_LIBTBB_FILENAME}"
COMMAND ${CMAKE_COMMAND} -E tar -xf ${WIN_LIBTBB_FILENAME} WORKING_DIRECTORY ${WIN_LIBTBB_INSTALL_DIR}
)

execute_process(
#set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${WIN_LIBTBB_INSTALL_DIR} PARENT_SCOPE)

add_custom_target(${LIBTBB_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo " copying ${WIN_LIBTBB_INSTALL_DIR}/include to ${WINDOWS_EXTERNAL_INCLUDE_DIR}"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WIN_LIBTBB_INSTALL_DIR}/include/tbb ${WINDOWS_EXTERNAL_INCLUDE_DIR}/tbb
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WIN_LIBTBB_INSTALL_DIR}/include/oneapi ${WINDOWS_EXTERNAL_INCLUDE_DIR}/oneapi
COMMAND ${CMAKE_COMMAND} -E echo "include copy success"
)

set(LIBTBB_DLL ${WIN_LIBTBB_INSTALL_DIR}/redist/intel64/vc14/tbb12.dll)

add_custom_target(${LIBTBB_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo " copying ${LIBTBB_DLL} to ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/libtbb.dll"
COMMAND ${CMAKE_COMMAND} -E copy ${LIBTBB_DLL} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/libtbb.dll
)

set(LIBTBB_LIBS ${WIN_LIBTBB_INSTALL_DIR}/lib/intel64/vc14/tbb.lib)
set(LIBTBB_INCLUDES ${WINDOWS_EXTERNAL_INCLUDE_DIR}/tbb)
set(LIBTBB_INCLUDES_2 ${WINDOWS_EXTERNAL_INCLUDE_DIR}/oneapi)
Expand Down

0 comments on commit adb4da9

Please sign in to comment.