I solved this problem by discovering that found libraries are one of the things cached between runs of cmake. Deleting CMakeCache.txt solves the problem. Hopefully this serves as a warning to people having the same issue.
> On Apr 21, 2018, at 7:53 PM, Andrew Brownsword > <andrew.e.brownsw...@gmail.com> wrote: > > I’m using this command: > > find_library(LIBPQXX_LIBRARY > NAMES libpqxx.a libpqxx > PATHS ${LIBPQXX_DEPS_DIR}/src/src > PATH_SUFFIXES .libs > NO_DEFAULT_PATH) > message(STATUS "libpqxx @ " ${LIBPQXX_LIBRARY}) > > This prints a path to where an older version is installed in /usr/local/lib/. > My understanding is that NO_DEFAULT_PATH should limit the search to the > supplied PATHS. What am I doing wrong? > -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: https://cmake.org/mailman/listinfo/cmake