I have a CMake project with a number of targets, and a Lua wrapper generated through tolua++ which is included by several of them, so that it is compiled with the target-specific make flags per-target.

Global make flags: -O0 -ggdb3 -Wall -Werror ... etc
Target1 make flags: -DAS_DB_PROXY ...
Target2 make flags: -DAS_GAME_SERVER ...
Target3 make flags: -DAS_CLIENT
<etc - there are 10 targets in total>
LuaTarget make flags: -Wno-unused

The LuaTarget is "luapkg.cc" generated from "lua.pkg" via "tolua++ -n game -o luapkg.cc luapkg.pkg"

If I add "luapkg.cc" to the list of sources for any given target, CMake barfs because luapkg.cc doesn't exist.

I've tried variations of add_custom_target and add_custom_command to no avail.

Is there a way to do this with CMake 2.6 or 2.8?

And it occurs to me that if I can find a solution to this, I can probably use the same solution for adding a precompiled header to each target (for my limited subset of platforms).

- Oliver

_______________________________________________
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

Reply via email to