From 475154255ace3212087b9b3492c1cd8e51bfde61 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Mon, 17 Nov 2014 18:09:21 -0500 Subject: [PATCH] msys: look in msys' directory for files This tells find_path and find_library to look under this directory first which is what we want on msys2. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75b7bf60f..b8bc83a07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -95,6 +95,11 @@ else() endif() option(STATIC "Link libraries statically" ${DEFAULT_STATIC}) +if(MINGW) + get_filename_component(msys2_install_path "[HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS2 64bit;InstallLocation]" ABSOLUTE) + set(CMAKE_INCLUDE_PATH "${msys2_install_path}/mingw64/include") +endif() + if(STATIC) if(MSVC) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES})