Chris Johnson wrote:

> Yes, by adding another directory between my top-level ./src/ directory and
> ./mylib, I can cause the example to fail.  I understand now that the
> include_directory() directive really has no hidden intelligence to it at
> all, as I had mistakenly believed.  It's just a path.

I'm curious: What hidden intelligence did you expect?

> However, I don't really want to have to go around to all my executables
> and add a bunch of relative paths based on which libraries they use, and
> where they are located in the tree.

Use PUBLIC or INTERFACE target_include_directories for that.

And please really go ahead and read 

 http://www.cmake.org/cmake/help/v3.1/manual/cmake-buildsystem.7.html

> 
> Is there some way that I can instead do something like force the install
> of the libraries to happen before the build of the programs which depend
> upon them?

Instead, use target_include_directories, as your initial example did to use 
different directories for the build and install locations.

Thanks,

Steve.


-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to