Skip to content

Commit

Permalink
change openssl, cares install path
Browse files Browse the repository at this point in the history
Former-commit-id: 86c49d1
  • Loading branch information
poohRui committed Sep 13, 2020
1 parent 8064be2 commit 6c6dfcc
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 39 deletions.
4 changes: 0 additions & 4 deletions cmake/third_party.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,6 @@ set(oneflow_third_party_dependencies
half_copy_headers_to_destination
re2
json_copy_headers_to_destination
cares_copy_headers_to_destination
cares_copy_libs_to_destination
openssl_copy_headers_to_destination
openssl_copy_libs_to_destination
)


Expand Down
19 changes: 1 addition & 18 deletions cmake/third_party/cares.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(ExternalProject)
set(CARES_TAR_URL https://github.com/c-ares/c-ares/releases/download/cares-1_15_0/c-ares-1.15.0.tar.gz)
set(CARES_URL_HASH d2391da274653f7643270623e822dff7)
set(CARES_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/cares/install)
set(CARES_INSTALL ${THIRD_PARTY_DIR}/cares)
SET(CARES_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/cares/src/cares)

set(CARES_INCLUDE_DIR ${THIRD_PARTY_DIR}/cares/include)
Expand Down Expand Up @@ -38,21 +38,4 @@ ExternalProject_Add(cares
-DCMAKE_CXX_FLAGS_DEBUG:STRING=${CMAKE_CXX_FLAGS_DEBUG}
)

add_custom_target(cares_create_library_dir
COMMAND ${CMAKE_COMMAND} -E make_directory ${CARES_LIBRARY_DIR}
DEPENDS cares)

add_custom_target(cares_copy_headers_to_destination
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CARES_INSTALL}/include ${CARES_INCLUDE_DIR}
DEPENDS cares_create_library_dir)

add_custom_target(cares_copy_libs_to_destination
DEPENDS cares_create_library_dir)

foreach(LIBRARY_NAME ${CARES_LIBRARY_NAMES})
add_custom_command(TARGET cares_copy_libs_to_destination
COMMAND ${CMAKE_COMMAND} -E create_symlink ${CARES_BUILD_LIBRARY_DIR}/${LIBRARY_NAME}
${CARES_LIBRARY_DIR}/${LIBRARY_NAME})
endforeach()

endif()
18 changes: 1 addition & 17 deletions cmake/third_party/openssl.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
include (ExternalProject)

set(OPENSSL_INSTALL ${CMAKE_CURRENT_BINARY_DIR}/openssl/install)
set(OPENSSL_INSTALL ${THIRD_PARTY_DIR}/openssl)
set(OPENSSL_INCLUDE_DIR ${THIRD_PARTY_DIR}/openssl/include)
set(OPENSSL_LIBRARY_DIR ${THIRD_PARTY_DIR}/openssl/lib)

Expand Down Expand Up @@ -35,20 +35,4 @@ ExternalProject_Add(openssl
INSTALL_COMMAND make install
)

add_custom_target(openssl_create_library_dir
COMMAND ${CMAKE_COMMAND} -E make_directory ${OPENSSL_LIBRARY_DIR}
DEPENDS openssl)

add_custom_target(openssl_copy_headers_to_destination
COMMAND ${CMAKE_COMMAND} -E create_symlink ${OPENSSL_INSTALL}/include ${OPENSSL_INCLUDE_DIR}
DEPENDS openssl_create_library_dir)

add_custom_target(openssl_copy_libs_to_destination
DEPENDS openssl_create_library_dir)

foreach(LIBRARY_NAME ${CARES_LIBRARY_NAMES})
add_custom_command(TARGET openssl_copy_libs_to_destination
COMMAND ${CMAKE_COMMAND} -E create_symlink ${OPENSSL_BUILD_LIBRARY_DIR}/${LIBRARY_NAME}
${OPENSSL_LIBRARY_DIR}/${LIBRARY_NAME})
endforeach()
endif(THIRD_PARTY)

0 comments on commit 6c6dfcc

Please sign in to comment.