[CMake] How To change VS2005 Output directory

LaViolette, Alan ALAVIOLETTE at overwatch.textron.com
Mon Feb 2 19:13:30 EST 2009


I changed the CMAKE_CFG_INTDIR and I don't see any changes in the
project file.

I am setting
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY    
     ${CMAKE_SOURCE_DIR}/bin/${CMAKE_PLATFORM})


The problem is The VS2005 generator always appends the configuration
name so I get
if
	CMAKE_SOURCE_DIR = x:\
	CMAKE_PLATFORM = Win32

X:/bin/Win32/Debug

I would like to have

X:/bin/Win32_Debug

or for plugins

X:/bin/Win32/Debug/Handlers

I would like to have

set (CMAKE_RUNTIME_OUTPUT_DIRECTORY    
     ${CMAKE_SOURCE_DIR}/bin/${CMAKE_PLATFORM}/$(ConfigurationName))

The $(ConfigurationName) is expanded by the IDE to the configuration
like Debug or Release.

Thanks
Alan.

-----Original Message-----
From: Tyler [mailto:tyler at cryptio.net] 
Sent: Monday, February 02, 2009 6:39 PM
To: LaViolette, Alan
Cc: cmake at cmake.org
Subject: Re: [CMake] How To change VS2005 Output directory

On Mon, Feb 02, 2009 at 05:00:13PM -0500, LaViolette, Alan wrote:
> From what I can see the VCLinker OutputFile is set to the value of
> target.GetDirectory(configName).
> (cmLocalVisualStudio7Generator::OutputBuildTool() ~ line 953)
> 
> The cmTarget::GetDirectory() calls
> cmGlobalVisualStudio7Generator::AppendDirectoryForConfig() when a
config
> name is passed in
> 
> The cmGlobalVisualStudio7Generator::AppendDirectoryForConfig()
> implementation always appends the name.
> 
> From what I can see in the source code the VS2005 generator will place
> the config name in the output path always.
> 
> The CMAKE_CFG_INTDIR is only used in cmTarget::NormalGetLocation() the
> VS2005 generator does not call this from what I can tell

By investigate, I just meant read the docs :p:

#  CMAKE_CFG_INTDIR: Build time configuration directory for project.

This is a variable that is used to provide developers access to the
intermediate directory used by Visual Studio IDE projects. For example,
if building Debug all executables and libraries end up in a Debug
directory. On UNIX systems this variable is set to ".". However, with
Visual Studio this variable is set to $(IntDir). $(IntDir) is expanded
by the IDE only. So this variable should only be used in custom commands
that will be run during the build process. This variable should not be
used directly in a CMake command. CMake has no way of knowing if Debug
or Release will be picked by the IDE for a build type. If a program
needs to know the directory it was built in, it can use CMAKE_INTDIR.
CMAKE_INTDIR is a C/C++ preprocessor macro that is defined on the
command line of the compiler. If it has a value, it will be the
intermediate directory used to build the file. This way an executable or
a library can find files that are located in the build directory. 


Maybe I don't understand what you're trying to do?

hth,
tyler


More information about the CMake mailing list