Skip to content

Commit

Permalink
Append the module dir if not present
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidAce committed May 31, 2023
1 parent 9e5cedf commit 2289953
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions cmake/SetupPaths.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
cmake_minimum_required(VERSION 3.15)

# Append search paths for find_package and find_library calls
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR}/conan)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules)
list(REMOVE_DUPLICATES CMAKE_MODULE_PATH)

if(NOT "${CMAKE_SOURCE_DIR}/cmake/modules" IN_LIST CMAKE_MODULE_PATH)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
endif()
# Make sure find_library prefers static/shared library depending on BUILD_SHARED_LIBS
# This is important when finding dependencies such as zlib which provides both shared and static libraries.
# Note that we do not force this cache variable, so users can override it
Expand Down
2 changes: 1 addition & 1 deletion cmake/conan_dependency_provider/conan_support.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function(conan_provide_dependency package_name)
message(VERBOSE "CMake-conan: find_package(${package_name}) found, 'conan install' already ran")
endif ()

if (CONAN_GENERATORS_FOLDER)
if (CONAN_GENERATORS_FOLDER AND NOT "${CONAN_GENERATORS_FOLDER}" IN_LIST CMAKE_PREFIX_PATH)
list(PREPEND CMAKE_PREFIX_PATH "${CONAN_GENERATORS_FOLDER}")
endif ()

Expand Down

0 comments on commit 2289953

Please sign in to comment.