2009/9/21 <th....@gmx.de>: > Hi, > > I have the following CMakeLists.txt: > > --------- > cmake_minimum_required(VERSION 2.6) > MESSAGE (" CMAKE TEST ") > > ADD_CUSTOM_COMMAND (TARGET Hello PRE_BUILD > COMMAND ${CMAKE_COMMAND} -E echo "Prebuild execution" > COMMENT "Information string for prebuild execution" > ) > > ADD_EXECUTABLE ( Hello abc.cpp ) > --------- > > Why is the custom command not executed? Is it meat different?
>From my testing side (CMake 2.6.4 / Unix Makefile / Linux ) it looks like you need to put your ADD_CUSTOM_COMMAND definition AFTER the ADD_EXECUTABLE statement. May be this deserves a bug report since when you write it before it behaves as silently ignored. Note that on Linux the doc is right: "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." -- Erk Membre de l'April - « promouvoir et défendre le logiciel libre » - http://www.april.org _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake