From 0dfcbe395e0bde35eee2ab5379531cf1c8563e66 Mon Sep 17 00:00:00 2001 From: Colden Cullen Date: Wed, 15 May 2019 15:10:09 -0700 Subject: [PATCH] Allow CMAKE_PREFIX_PATH to be a list --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0674f803..1a752f5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,12 @@ elseif(NOT DEFINED CMAKE_INSTALL_LIBDIR) set(CMAKE_INSTALL_LIBDIR "lib") endif() +# This is required in order to append /lib/cmake to each element in CMAKE_PREFIX_PATH +set(AWS_MODULE_DIR "/${CMAKE_INSTALL_LIBDIR}/cmake") +string(REPLACE ";" "${AWS_MODULE_DIR};" AWS_MODULE_PATH "${CMAKE_PREFIX_PATH}${AWS_MODULE_DIR}") +# Append that generated list to the module search path +list(APPEND CMAKE_MODULE_PATH ${AWS_MODULE_PATH}) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules") -list(APPEND CMAKE_MODULE_PATH "${CMAKE_PREFIX_PATH}/${CMAKE_INSTALL_LIBDIR}/cmake") include(AwsCFlags) include(AwsSharedLibSetup)