[CMake] Internal vs system version of a library

Hendrik Sattler post at hendrik-sattler.de
Thu Aug 6 06:04:06 EDT 2009


Zitat von Antonio Valentino <antonio.valentino at tiscali.it>:
> I would like allow the user to choose whenever to use the system
> version of a library or the developer provided one.
>
> In the code snippet below the library is FFTW and its source archive is
> bundled together with the project source in the COTS/FFTW sub-folder.
>
> The problem is how to reset the cache variables once the user switches
> between USE_INTERNAL_FFTW and NOT USE_INTERNAL_FFTW.

unset()

> In the following code snippet there is my tentative solution.
> It seems to work but it doesn't looks good to me.

The guard is good to detect a change in the user variable (which could  
be given using option().

HS




More information about the CMake mailing list