From 5ec8a69caca440d0cf07c769ff90bd8e26230f3d Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 24 Sep 2012 11:11:51 -0400 Subject: [PATCH] FindBoost: Use PATH_SUFFIXES to look in "Program Files" The CMake find_path command looks under the proper "Program Files" directories on Windows with any of the provided PATH_SUFFIXES. This is simpler and more robust than directly reading ENV{ProgramFiles}. Once Boost_INCLUDE_DIR has been located we already look next to it for the lib directory anyway, so we do not need special help to find Boost libraries under "Program Files". --- Modules/FindBoost.cmake | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index cd5d58697..77a89911a 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -603,8 +603,6 @@ endif() set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM C:/boost/include C:/boost - "$ENV{ProgramFiles}/boost/include" - "$ENV{ProgramFiles}/boost" /sw/local/include ) @@ -697,8 +695,12 @@ if( NOT Boost_INCLUDE_DIR ) _boost_BOOSTIFIED_VERSION ${_boost_VER}) endif() - list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") - list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") + list(APPEND _boost_PATH_SUFFIXES + "boost-${_boost_BOOSTIFIED_VERSION}" + "boost_${_boost_BOOSTIFIED_VERSION}" + "boost/boost-${_boost_BOOSTIFIED_VERSION}" + "boost/boost_${_boost_BOOSTIFIED_VERSION}" + ) endforeach() @@ -861,10 +863,6 @@ set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM C:/boost/lib C:/boost - "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" - "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}/lib" - "$ENV{ProgramFiles}/boost/lib" - "$ENV{ProgramFiles}/boost" /sw/local/lib ) set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS})