[CMake] Errors when building from project root

Wade Williams wadesworld at mac.com
Sun Feb 15 16:05:58 EST 2009


I have a project that looks like:

project_root/lib/util

In util is the CMakeLists.txt file that contains all the necessary  
commands to build the util lib.

In the lib dir is a CMakeLists.txt file that simply has  
add_subdirectory(util).

In the project_root dir is a CMakeLists.txt file that simply has  
add_subdirectory(lib).

If I enter the util directory and issue:

cmake .
make

then the library builds fine.

If I enter lib and do the same, the library builds fine.

but if I enter the project root and do the same, I get errors about a  
header not being found.  I'm confused as to how that can be the case  
if the two dependent directories built fine?

Any thoughts as to why this might be happening?

Thanks,

Wade


More information about the CMake mailing list