No subject
Mon Dec 15 09:51:36 EST 2008
"Note that the PRE_BUILD option is only supported on Visual Studio 7 or
later. For all other generators PRE_BUILD will be treated as PRE_LINK."
What are you actually trying to do?
If you want to perform some actions before actually build the target, use of
add_custom_target() may be better idea. Something like this:
add_custom_target (thetarget
COMMAND touch
${CMAKE_CURRENT_BINARY_DIR}/helloworld
WORKING_DIRECTORY
${CMAKE_CURRENT_SOURCE_DIR}
COMMENT "Prebuild action before build
MainTarget"
)
add_executable (MainTarget
${SOURCES}
)
add_dependecies (MainTarget thetarget)
On Tue, Dec 23, 2008 at 10:41 PM, Pau Garcia i Quiles
<pgquiles at elpauer.org>wrote:
> Hello,
>
> I'm trying ADD_CUSTOM_COMMAND(TARGET ... PRE_BUILD) but it does not
> work here. This is how I'm using it:
>
> ADD_CUSTOM_COMMAND(TARGET thetarget
> PRE_BUILD
> COMMAND touch
> ${CMAKE_CURRENT_BINARY_DIR}/helloworld
> WORKING_DIRECTORY
> ${CMAKE_CURRENT_SOURCE_DIR}
> COMMENT "Blah"
> )
>
> I've tried with the "NMake Makefiles" and "Visual Studio 9 2008"
> generators, with CMake 2.6.2 and CVS 2.7-20081222 but it does not work
> ('touch' is installed and in the PATH, that's not the problem).
>
> Am I doing anything wrong? :-?
>
> Thank you.
>
> --
> Pau Garcia i Quiles
> http://www.elpauer.org
> (Due to my workload, I may need 10 days to answer)
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
--
No fate, but what we make!
------=_Part_90499_5261297.1230064682226
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
<p>From documentation to CMake 2.6.x:</p><p>"Note that the PRE_BUILD option is only supported on Visual Studio 7 or later. For all other generators PRE_BUILD will be treated as PRE_LINK."</p><p>What are you actually trying to do?<br>
</p><p>If you want to perform some actions before actually build the target, use of add_custom_target() may be better idea. Something like this:</p><p>add_custom_target (thetarget </p><p> COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/helloworld<br>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}</p><p> COMMENT "Prebuild action before build MainTarget"<br>
)</p><p>add_executable (MainTarget</p><p> ${SOURCES}</p><p>)</p><p>add_dependecies (MainTarget thetarget)</p><br><div class="gmail_quote">On Tue, Dec 23, 2008 at 10:41 PM, Pau Garcia i Quiles <span dir="ltr"><<a href="mailto:pgquiles at elpauer.org">pgquiles at elpauer.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hello,<br>
<br>
I'm trying ADD_CUSTOM_COMMAND(TARGET ... PRE_BUILD) but it does not<br>
work here. This is how I'm using it:<br>
<br>
ADD_CUSTOM_COMMAND(TARGET thetarget<br>
PRE_BUILD<br>
COMMAND touch ${CMAKE_CURRENT_BINARY_DIR}/helloworld<br>
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}<br>
COMMENT "Blah"<br>
)<br>
<br>
I've tried with the "NMake Makefiles" and "Visual Studio 9 2008"<br>
generators, with CMake 2.6.2 and CVS 2.7-20081222 but it does not work<br>
('touch' is installed and in the PATH, that's not the problem).<br>
<br>
Am I doing anything wrong? :-?<br>
<br>
Thank you.<br>
<font color="#888888"><br>
--<br>
Pau Garcia i Quiles<br>
<a href="http://www.elpauer.org" target="_blank">http://www.elpauer.org</a><br>
(Due to my workload, I may need 10 days to answer)<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake at cmake.org">CMake at cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br>No fate, but what we make!<br>
------=_Part_90499_5261297.1230064682226--
More information about the CMake
mailing list