Hello,

I've used CMake for a while but only recently
discovered several features for better installing a package, and am
trying to update the way I use CMake.

My question as to do with projects which contain
several modules/components/libraries, each of which is in a subdirectory.
Each library may depend on other libraries in other subdirectories.
I've set up two GitHub repos with my current understanding
of how this should be done in CMake:

https://github.com/ibaned/two_libs
https://github.com/ibaned/use_two_libs

This works, but a few things are naggingly sub-optimal, such
as the way include directories are passed from one sub-dir to another:

https://github.com/ibaned/two_libs/blob/master/add_nums/CMakeLists.txt#L8

Is there a better way to carry include dirs across scopes ?

Our real project right now generates Config.cmake files for each
subdirectory
and then other subdirectories use find_package just to get this info across:

https://github.com/SCOREC/core/blob/master/pcu/CMakeLists.txt#L44

Other projects have a whole system atop CMake that manages this.
I'm trying to get a sense of what the "best" setup looks like using pure
CMake.

Any advice about this is much appreciated,

Thank you
-- 

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