On 9 July 2012 08:17, Petr Kmoch <[email protected]> wrote: > [...] > You have to create a custom command (using the OUTPUT signature) to > actually do the preprocessing. If you're targetting gcc and Visual > Studio, the command could look something like this: > > add_custom_command( > OUTPUT myfile.sql > COMMAND "${CMAKE_C_COMPILER}" -E myfile.sql.in -I ../common > MAIN_DEPENDENCY myfile.sql.in > COMMENT "Preprocessing myfile.sql.in" > VERBATIM > ) > > [..] > Now you need something to "drive" this command. > [...] > > add_custom_target( > ProcessSQL ALL > DEPENDS myfile.sql > COMMENT "Preprocessing SQL files" > VERBATIM > )
Hi Petr, Your solution is perfect fit for my problem. Thank you for the great explanation! Best regards, -- Mateusz Loskot, http://mateusz.loskot.net -- 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
