[CMake] Invoking an script from the link command.

Óscar Fuentes ofv at wanadoo.es
Mon Aug 11 21:17:35 EDT 2008


Bill Hoffman <bill.hoffman at kitware.com>
writes:

>> I just realized another reason why your proposal is not adequate: the
>> libraries and the script must be built before the executable, so, at
>> cmake time, the libraries and the script does not exists.
>>
>> I know this is not portable, but it is intended for POSIX platforms, GNU
>> toolchains. As far as cmake does not mess too much with the contents
>> passed to target_link_libraries, it should be fine.
>>
> Actually, CMake does not guarantee a shell at all for the link line,
> so back tick stuff make break even on a POSIX platform.  Why does this
> need to be run at build time?

Please see my response to Mike Jackson above.

> I don't even think this will work with cmake 2.6.0, because we use
> link scripts.

It is working with 2.6.1 and MSYS Makefiles. Here you are doing
something like this:

cd ${CMAKE_CURRENT_BINARY_DIR} && /path/to/g++.exe ...args for linking...

-- 
Oscar



More information about the CMake mailing list