[CMake] Fwd: Adding custom directories to PATH enviroment

Gabriele Greco gabriele.greco at darts.it
Wed Apr 13 11:52:25 EDT 2011


>
> Then you haven't read or understood my message ;-) Instead of calling
> idlcc directly in the add_custom_command, you call a wrapper script,
> that sets the PATH environment variable, and *then* invokes idlcc.
>

Ok, I implemented your solution and it works, thanks!

One additional comment: Creating output in the source tree is a *very*
> bad habit. Some people (including me) consider it to be obscene... ;-)
> Unless you are doing an in-source build (which you shouldn't, for the
> same reasons you shouldn't create output in the source tree), a build
> system should *never* modify the source tree.
>

Yeah, you are right, I didn't like that too, I've changed the system to
output the interfaces in ${PROJECT_BINARY_DIR}/inc/intf,
the only thing I don't like is that to make this work, inside the
"interface" CMakeLists.txt I've had to insert this:

execute_process(
COMMAND cp -r "${PROJECT_SOURCE_DIR}/inc/intf" "${PROJECT_BINARY_DIR}/inc/"
)

To copy the interface files that are actually hand written and then
committed to the repository in the binary path.

It works, but I suppose I should add a mechanism to copy one of these files
again if the user changes it... And i fear the only way to do it is to add a
list of all these files by hand to the interfaces CMakeLists.txt and make
the copy process a custom target that depends from the file in the source
tree

-- 
Bye,
 Gabry
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110413/8ff6e4af/attachment.htm>


More information about the CMake mailing list