Commit 9e9ffb77 authored by Sang Ik Lee's avatar Sang Ik Lee Committed by Robert Kimball

Use uniform naming for external project prefixes (#2455)

* Use uniform naming for external project prefixes and use INSTALL_DIR instead of SOURCE_DIR for referencing prebuilt external libraries.

* TBB: Use single variable to share path across files.
parent 253d4cdf
......@@ -23,6 +23,7 @@ set(HALIDE_LLVM_SHA1_HASH c7db0162fbf4cc32193b6a85f84f4abee3d107b9)
ExternalProject_Add(
ext_halide_llvm
PREFIX halide_llvm
URL ${HALIDE_LLVM_TARBALL_URL}
URL_HASH SHA1=${HALIDE_LLVM_SHA1_HASH}
CONFIGURE_COMMAND ""
......@@ -41,6 +42,7 @@ set(HALIDE_GIT_TAG "ea9c863")
ExternalProject_Add(
ext_halide
PREFIX halide
DEPENDS ext_halide_llvm
GIT_REPOSITORY ${HALIDE_GIT_REPO_URL}
GIT_TAG ${HALIDE_GIT_TAG}
......
This diff is collapsed.
This diff is collapsed.
......@@ -29,6 +29,7 @@ if(MKLDNN_INCLUDE_DIR AND MKLDNN_LIB_DIR)
endif()
ExternalProject_Add(
ext_mkldnn
PREFIX mkldnn
DOWNLOAD_COMMAND ""
UPDATE_COMMAND ""
CONFIGURE_COMMAND ""
......@@ -101,6 +102,7 @@ set(MKLDNN_LIBS ${EXTERNAL_PROJECTS_ROOT}/mkldnn/lib/libmkldnn${CMAKE_SHARED_LIB
if (WIN32)
ExternalProject_Add(
ext_mkldnn
PREFIX mkldnn
DEPENDS ext_mkl
GIT_REPOSITORY ${MKLDNN_GIT_REPO_URL}
GIT_TAG ${MKLDNN_GIT_TAG}
......@@ -136,6 +138,7 @@ if (WIN32)
else()
ExternalProject_Add(
ext_mkldnn
PREFIX mkldnn
DEPENDS ext_mkl
GIT_REPOSITORY ${MKLDNN_GIT_REPO_URL}
GIT_TAG ${MKLDNN_GIT_TAG}
......
......@@ -48,7 +48,7 @@ else()
if (${CMAKE_VERSION} VERSION_LESS 3.6)
ExternalProject_Add(
ext_protobuf
PREFIX ext_protobuf
PREFIX protobuf
GIT_REPOSITORY ${PROTOBUF_GIT_REPO_URL}
GIT_TAG ${PROTOBUF_GIT_BRANCH}
INSTALL_COMMAND ""
......@@ -69,7 +69,7 @@ else()
# To speed things up prefer 'shallow copy' for CMake 3.6 and later
ExternalProject_Add(
ext_protobuf
PREFIX ext_protobuf
PREFIX protobuf
GIT_REPOSITORY ${PROTOBUF_GIT_REPO_URL}
GIT_TAG ${PROTOBUF_GIT_BRANCH}
GIT_SHALLOW TRUE
......
......@@ -22,11 +22,11 @@ if(NGRAPH_TBB_ENABLE)
set(TBB_GIT_REPO_URL https://github.com/01org/tbb)
set(TBB_GIT_TAG "2019_U2")
set(TBB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/tbb/tbb-src)
configure_file(${CMAKE_SOURCE_DIR}/cmake/tbb_fetch.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/tbb/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tbb")
execute_process(COMMAND "${CMAKE_COMMAND}" --build .
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/tbb")
set(TBB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/tbb/tbb-src)
endif()
......@@ -27,6 +27,7 @@ endif()
ExternalProject_Add(
ext_tbb
PREFIX tbb
URL ${TBB_FILE}
URL_HASH SHA1=${TBB_SHA1_HASH}
CONFIGURE_COMMAND ""
......@@ -38,7 +39,7 @@ ExternalProject_Add(
)
ExternalProject_Get_Property(ext_tbb SOURCE_DIR)
set(SOURCE_DIR ${SOURCE_DIR}/${ARCHIVE_FILE_BASE})
set(INSTALL_DIR ${SOURCE_DIR}/${ARCHIVE_FILE_BASE})
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
set(TBB_LIB_NAME tbb_debug)
......@@ -47,14 +48,14 @@ else()
endif()
if (WIN32)
set(TBB_LINK_LIBS ${SOURCE_DIR}/lib/intel64/vc14/${TBB_LIB_NAME}.lib)
set(TBB_LINK_LIBS ${INSTALL_DIR}/lib/intel64/vc14/${TBB_LIB_NAME}.lib)
elseif(APPLE)
set(TBB_LINK_LIBS
${NGRAPH_BUILD_DIR}/${CMAKE_SHARED_LIBRARY_PREFIX}${TBB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
)
add_custom_command(TARGET ext_tbb POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SOURCE_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${TBB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${NGRAPH_BUILD_DIR}
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}${TBB_LIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX} ${NGRAPH_BUILD_DIR}
COMMENT "Move tbb libraries to ngraph build directory"
)
......@@ -65,5 +66,5 @@ endif()
add_library(libtbb INTERFACE)
add_dependencies(libtbb ext_tbb)
target_include_directories(libtbb SYSTEM INTERFACE ${SOURCE_DIR}/include)
target_include_directories(libtbb SYSTEM INTERFACE ${INSTALL_DIR}/include)
target_link_libraries(libtbb INTERFACE ${TBB_LINK_LIBS})
......@@ -22,9 +22,10 @@ project(tbb-fetch NONE)
ExternalProject_Add(
ext_tbb
PREFIX tbb
GIT_REPOSITORY ${TBB_GIT_REPO_URL}
GIT_TAG ${TBB_GIT_TAG}
SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/tbb/tbb-src"
SOURCE_DIR "${TBB_ROOT}"
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
UPDATE_COMMAND ""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment