2015-04-28 10:57 GMT+02:00 Gregor Jasny <[email protected]>:
> Hello Nils,
>
> thank you for the pointers.
>
> On 24/04/15 21:30, Nils Gladitz wrote:
>
>> On 24.04.2015 20:55, Gregor Jasny wrote:
>>
>>> Hello,
>>>
>>> would it be possible to add generator expression support to CPack
>>> so that I can use $<CONFIG> within CPACK_PACKAGE_FILE_NAME? I'm
>>> using the CPack module from within my CMakeLists.txt.
>>>
>>
>From my understanding $<CONFIG> is a build time value.
evaluating $<CONFIG> at CPack time may be hard because
one can simply call:
cpack -G <generator>
then <CONFIG> definition is implicit and only known when the build tool is
called...
>
>>> I'm trying to generate unique file names per architecture and
>>> configuration but multi config generators like Xcode make this
>>> harder than expected.
>>>
>>
>> You should be able to do this without generator expressions and just
>> CPACK_PROJECT_CONFIG_FILE [1] and CPACK_BUILD_CONFIG [2].
>> If you really do require/want generator expressions you should be able
>> to combine that with file(GENERATE) and include().
>>
>
> Unfortunately the CPACK_BUILD_CONFIG approach does only work for
> multi-config generators. As far as I understand CPACK_BUILD_CONFIG gets
> only set if the -C command line option was given to cpack. But this option
> is only added conditionally and omitted for Makefile builds:
>
> void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
>> ...
>> if ( cmakeCfgIntDir && *cmakeCfgIntDir && cmakeCfgIntDir[0] != '.' )
>> {
>> singleLine.push_back("-C");
>> singleLine.push_back(cmakeCfgIntDir);
>> }
>>
>
> Now I'm just wondering if conditionally setting -C / CPACK_BUILD_CONFIG is
> the right thing to do?
>
If it is possible to always define it may be it could be done.
Beware of backward compatibility issue though.
--
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:
http://public.kitware.com/mailman/listinfo/cmake-developers