diff --git a/deps/CMakeLists.txt b/deps/CMakeLists.txt index 25c49960..9ac49757 100644 --- a/deps/CMakeLists.txt +++ b/deps/CMakeLists.txt @@ -17,7 +17,8 @@ include(external_dependency.cmake) # to locate the package in the system. # Skip this step if Build_Deps option is set. # 2. Try to find a directory containing the sources -# at ${PROJECT_SOURCE_DIR}/deps/name. If found +# at ${CMAKE_CURRENT_SOURCE_DIR}/name and +# ${CMAKE_SOURCE_DIR}/deps/name. If found # build it as a cmake sub-project. # 3. If GIT_REPO is provided, git clone the sources, # and build them as a cmake sub-project. diff --git a/deps/external_dependency.cmake b/deps/external_dependency.cmake index e7cc44ea..7ba1b7ad 100644 --- a/deps/external_dependency.cmake +++ b/deps/external_dependency.cmake @@ -51,6 +51,9 @@ function(external_dependency) if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}) message(STATUS "Found sources for dependency ${ARGV0} at ${CMAKE_CURRENT_SOURCE_DIR}/${ARGV0}") add_subdirectory(${ARGV0} ${subdir_opts}) + elseif(IS_DIRECTORY ${CMAKE_SOURCE_DIR}/deps/${ARGV0}) + message(STATUS "Found sources for dependency ${ARGV0} at ${CMAKE_SOURCE_DIR}/deps/${ARGV0}") + add_subdirectory(${ARGV0} ${subdir_opts}) elseif(ARG_GIT_REPO) set(bin_dir ${CMAKE_CURRENT_BINARY_DIR}/${ARGV0}) set(src_dir ${bin_dir}_src)