[Cmake] how to find one package when I have two

Brad King brad.king at kitware.com
Wed, 18 Feb 2004 11:45:41 -0500


Lucas Lorenzo wrote:
> Hi all,
> 
> I'm using ITK. Usually in my CMakeLists.txt files, I use this in order 
> to find the ITK package:
> 
> # Find ITK.
> FIND_PACKAGE(ITK)
> IF(ITK_FOUND)
>   INCLUDE(${ITK_USE_FILE})
> ELSE(ITK_FOUND)
>   MESSAGE(FATAL_ERROR
>           "Cannot build without ITK.  Please set ITK_DIR.")
> ENDIF(ITK_FOUND)
> 
> Now I have two different versions of ITK installed in my computer. How 
> can I "find" the one I want to use ?

When you run CMake on your project, set ITK_DIR through the GUI 
(CMakeSetup or ccmake) to point at the build tree for the ITK you want 
to use.

-Brad