[CMake] Invoking an script from the link command.

Óscar Fuentes ofv at wanadoo.es
Mon Aug 11 18:55:41 EDT 2008


We have a shell script that computes the list of libraries that shall
appear on the link comand for every executable. The command looks like
this:

g++ ...flags... object-files... -o myexe `/path/to/script arg1 arg2`

Trying to replicate this with CMake is difficult. My first try was to
put the backquoted script invocation on the LINK_FLAGS property, but its
contents appears before the object-files part and so it is not
effective.

My second try was target_link_libraries:

target_link_libraries(myexe `/path/to/script arg1 arg2`)

but this results on:

g++ ... `/path/to/script -larg1 -larg2`

Suggestions appreciated.

-- 
Oscar



More information about the CMake mailing list