[cmake-developers] Building executables as libraries

Stephen Kelly steveire at gmail.com
Fri Mar 28 04:32:31 EDT 2014


Stephen Kelly wrote:

> There would probably need to be some properties to control it

Bill and J Decker seem to have arrived at almost this point in a subthread 
discussion.

In a 'executables are linked as libraries' environment, there needs to be 
some property to say 'really build an executable'. For android, that is only 
for console executables (and I think on BB10). The KDE macro accepts NOGUI 
to set WIN32_EXECUTABLE to OFF.

I think calling the property ANDROID (as equivalent to WIN32_EXECUTABLE) is 
not the right move. Maybe creating a EXECUTABLE_NONGUI or EXECUTABLE_CONSOLE 
property instead is the right move. 

There could also be a 

 add_executable(foo CONSOLE main.cpp)

signature, but that's optional porcelain, and the discussion now should not 
center on it.

For context, here's a thread where the opposite was considered:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/2920

Thanks,

Steve.





More information about the cmake-developers mailing list