[CMake] on find_package and building dependencies

Eric Noulard eric.noulard at gmail.com
Fri Dec 30 07:32:51 EST 2011


2011/12/30 Ryan Lewis <me at ryanlewis.net>:
> Hi, yes, this is all that I can't figure out if I type the define
> without a type, it fails, but I can't figure out this variables type.
> I tried STRING and FILEPATH and even BOOL.

This is a PATH, so;
cmake -DCMAKE_FIND_ROOT_PATH:PATH="/path/to/custom/install"

but I think this is not the problem, since it works for me here
(even if I do not provide the PATH type) so to answer your previous
question:

> Is there a way to hand this to cmake on the command line (i.e. an
> ExternalProject_Add), when I test on the command line with: cmake
> -DCMAKE_FIND_ROOT_PATH=... it gives me the warning that it is ignoring
> my define.

CMake warns you because some values in cache (the one found in CMakeCache.txt)
make cmake not using the value provided on the command line.

Most probably because
ZLIB_INCLUDE_DIR and ZLIB_LIBRARY have been cached so that
CMAKE_FIND_ROOT_PATH is not used because there is no need to.

Basically this also means your build tree wasn't clean when you did run CMake.
Please:
  1) clean-up your source tree from any CMake generated file leftover
  2) use out-of-source build
      http://www.cmake.org/Wiki/CMake_FAQ#Out-of-source_build_trees

Then try again.

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org


More information about the CMake mailing list