[CMake] EXECUTABLE_OUTPUT_PATH is not just deprecated, it's harmful!

Brad King brad.king at kitware.com
Fri Feb 20 09:12:06 EST 2009


Philip Lowman wrote:
> On Thu, Feb 19, 2009 at 5:25 PM, Brad King <brad.king at kitware.com
> <mailto:brad.king at kitware.com>> wrote:
> 
>     AFAIK the word 'deprecated' does not appear in the documentation for
>     EXECUTABLE_OUTPUT_PATH.  It will be around for a long time.  We just
>     recommend using the new variables because they are more powerful:
> 
>      1.) The new variables actually just initialize target properties
>          so the values can be set on a per-target basis.
> 
>      2.) The new variables distinguish the .dll and .lib parts of a
>          shared library on windows.
> 
>     Also, the new variables should not be put in the cache by convention.
>     If you want the user to be able to edit the path, provide a different
>     cache entry that you use to set the variables.
> 
> 
> Would a CMake Policy of warning the user if both EXECUTABLE_OUTPUT_PATH
> and CMAKE_RUNTIME_OUTPUT_DIRECTORY are defined be a good idea?  (same
> for LIBRARY_OUTPUT_PATH)

Policies are for when we actually change behavior in a way that could
affect existing code.  In this case old projects that don't set the new
variables aren't affected.  There are plenty of use cases where both
variables may be set, such as when a particular subproject sets the new
vars but the main project has not yet been updated.

-Brad



More information about the CMake mailing list