cmake dependency

Posted by idimba on Stack Overflow See other posts from Stack Overflow or by idimba
Published on 2010-05-30T21:03:04Z Indexed on 2010/05/30 22:12 UTC
Read the original article Hit count: 250

Filed under:

I'm trying to create a cmake equivalent to the following make:

all: run_demo
demo: main.cpp
   gcc -o demo main.cpp
run_demo: demo

demo is executed whenever demo is created.

This what I came to, but demo is not executed as I want:

add_executable(demo main.cpp)
add_custom_target(run_demo demo)

This is actually equivalent to:

all: demo
demo: main.cpp
   gcc -o demo main.cpp
run_demo:demo

What do I miss?

© Stack Overflow or respective owner

Related posts about cmake