[CMake] custom build

Lev leventelist at gmail.com
Fri Jul 29 06:45:09 EDT 2016


Dear cmake users,


Could you please help me how to make cmake to produce a generic build system?

What I want to do is running simple shell command on files. Namely, I want to
generate sqlite database from a sql file. It all works from the command line,
I just can't figure out how to make cmake to do the right thing.

I started to do something like this:

add_custom_target(foo.sqlite foo.sql)

add_custom_command(OUTPUT foo.sqlite
						MAIN_DEPENDENCY foo.sql
						COMMAND "cat foo.sql | sqlite3 -batch foo.sqlite")

but it doesn't do anything when I issue "make".

Any help appreciated. 

Levente

-- 
73 de HA5OGL
Op.: Levente


More information about the CMake mailing list