[Cmake] Automatic dependency building under Unix

Amitha Perera perera at cs.rpi.edu
Wed May 9 14:57:33 EDT 2001


The problem with this approach is that if the variable jpeg:INTERNAL
exists in the cache, then there will be a dependency for
.../libjpeg.a. Now, if HAS_NATIVE_JPEG is set, then SUBDIRS(jpeg)
would not be executed, jpeg:INTERNAL would not be set, and everything
would be fine. However, if you delete your CMakeCache.txt and do a
"make rebuild_cache", the order in which the cache entries are added
makes a difference. In particular, if v3p/CMakeLists.txt is executed
before the FindJPEG (which it is), then jpeg:INTERNAL is set _and_
HAS_NATIVE_JPEG is set.

A solution is to run FindJPEG before every check of
HAS_NATIVE_JPEG. That's a hack! There must be a better way.




More information about the CMake mailing list