Le jeu. 4 oct. 2018 à 18:59, Marc CHEVRIER <marc.chevr...@gmail.com> a
écrit :

> I am afraid that you cannot mix "optimized" or "debug" keywords with
> "generator expressions" because keywords handling is done during evaluation
> of command "target_link_libraries" and "generator expressions" are
> evaluated during generation.
>
> And target_link_libraries expect following pattern: [<keyword>] <library>
> [<library> ...], so specifying a generator expression wrapping this breaks
> the parsing of the arguments: keyword is no longer at the beginning of the
> sequence so it is no longer  recognized as is...
>
> So, The most efficient way to work-around this problem is to transform
> your list of libraries in valid generator expressions:
>
>    - INITIAL: optimized foo debug food_d
>    - RESULT: $<$<CONFIG:RELEASE>:foo> $<$<CONFIG:DEBUG>:foo_d>
>
> For that purpose, an helper function can do the trick...
>

I agree with you Marc but I nevertheless think the handling of list in
genex has something unexpected.

See my previous example with custom target.

-- 
Eric
-- 

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:
https://cmake.org/mailman/listinfo/cmake

Reply via email to