mirror of
https://github.com/triqs/dft_tools
synced 2025-01-05 10:59:34 +01:00
Minor refactoring in external_dependency.cmake
This commit is contained in:
parent
c99ee1820e
commit
a619870f92
3
deps/external_dependency.cmake
vendored
3
deps/external_dependency.cmake
vendored
@ -20,7 +20,6 @@ function(external_dependency)
|
|||||||
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0})
|
if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0})
|
||||||
message(STATUS "Found sources for dependency ${ARGV0} at ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.")
|
message(STATUS "Found sources for dependency ${ARGV0} at ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}.")
|
||||||
add_subdirectory(${ARGV0} ${subdir_opts})
|
add_subdirectory(${ARGV0} ${subdir_opts})
|
||||||
set(${ARGV0}_FOUND TRUE CACHE BOOL "Was dependency ${ARGV0} found?")
|
|
||||||
elseif(ARG_GIT_REPO)
|
elseif(ARG_GIT_REPO)
|
||||||
set(bin_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGV0})
|
set(bin_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGV0})
|
||||||
set(src_dir ${bin_dir}_src)
|
set(src_dir ${bin_dir}_src)
|
||||||
@ -31,9 +30,9 @@ function(external_dependency)
|
|||||||
execute_process(COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir})
|
execute_process(COMMAND git clone ${ARG_GIT_REPO} --depth 1 ${clone_opts} ${src_dir})
|
||||||
endif()
|
endif()
|
||||||
add_subdirectory(${src_dir} ${bin_dir} ${subdir_opts})
|
add_subdirectory(${src_dir} ${bin_dir} ${subdir_opts})
|
||||||
set(${ARGV0}_FOUND TRUE CACHE BOOL "Was dependency ${ARGV0} found?")
|
|
||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Could not find dependency ${ARGV0}")
|
message(FATAL_ERROR "Could not find dependency ${ARGV0}")
|
||||||
endif()
|
endif()
|
||||||
|
set(${ARGV0}_FOUND TRUE CACHE BOOL "Was dependency ${ARGV0} found?")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Loading…
Reference in New Issue
Block a user