[CMake] Building dependency project as static lib and exe.

mike lojkovic mikelojkovic at gmail.com
Sat May 6 22:45:40 EDT 2017


I have a project that uses lua. cmake is able to build lua statically
and shared, without issue. (shared for debug static for releases on
Windows) The only issue is when I'm doing a release build I need to
also build the lua.exe, so I can process and embed my lua scripts in
the exe.

add_custom_command looks like it could be used to build the lua
project twice, but seems like I'd have to be overly specific repeating
things already implied in the lua project. Is there a means of telling
a subproject to compile itself from the main CMakeLists.txt?

I add libraries with add_subdirectory.


More information about the CMake mailing list