[cmake-developers] Generator Expressions and packages (Was: target_link_libraries and --start-group/--end-group ?)

Robert Goulet Robert.Goulet at autodesk.com
Wed Jan 14 11:20:52 EST 2015


To be honest I haven't spent much time trying to learn 'imported' libraries with CMake. It was already difficult to deal with commands that don't support generator expressions versus those that does. It wasn't clear which commands we should not try to use because of that, and in the end we had to rewrite part of the CMakeLists.txt file because we wanted to use generator expressions and packages.

Talking about that, what is the correct way to use generator expressions in a context of packages? find_library does not support generator expressions, so right now in our Find files we don't use it, we just set variables instead.

For example, consider the following external library setup:

root/lib/vs2012/x86/debug/foo.lib
root/lib/vs2012/x64/debug/foo.lib
root/lib/vs2012/x86/release/foo.lib
root/lib/vs2012/x64/release/foo.lib
root/lib/ios/debug/foo.a
root/lib/ios/release/foo.a
root/lib/android/debug/foo.a
root/lib/android/release/foo.a
etc...

How does one deal with such a setup, when all versions of the library use the same name, but in different paths, within a package context? It would have been nice if find_library supported generator expressions. But maybe I misunderstood how to properly deal with that?

Thanks.

-----Original Message-----
From: cmake-developers [mailto:cmake-developers-bounces at cmake.org] On Behalf Of Stephen Kelly
Sent: Tuesday, January 13, 2015 5:49 PM
To: cmake-developers at cmake.org
Subject: [cmake-developers] Generator Expressions and packages (Was: target_link_libraries and --start-group/--end-group ?)

Robert Goulet wrote:

> Using Brad's method of link multiplicity is too much work because we 
> make use of packages and heavy generator expressions, making it a lot 
> more difficult and much less elegant.

Hi Robert,

We have not had much external feedback from the generator expressions and IMPORTED targets in packages features, so this is interesting to me.

Can you say what you rely on those features for? Which generator expressions you use? Limitations you hit? Experience learning to use the features?

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-developers


More information about the cmake-developers mailing list