[CMake] CMAKE_RUNTIME_OUTPUT_DIRECTORY without the extra 'Debug' or 'Release' ?

Erwin Coumans erwin.coumans at gmail.com
Sun Feb 7 22:46:38 EST 2010


By the way, I had a quick look at the source code
in cmLocalVisualStudio7Generator.cxx  for case cmTarget::EXECUTABLE:

replacing
  temp = target.GetDirectory(configName);
by
   temp = target.GetDirectory("");

seems to do the job of removing additional 'Debug' or 'Release'
directories from the OutputFile executable name.

    temp += "/";
    temp += targetNameFull;
    fout << "\t\t\t\tOutputFile=\""
         << this->ConvertToXMLOutputPathSingle(temp.c_str()) << "\"\n";

Is there a better way, or should I write an option/patch
to strip the configuration directory that can go in the cmake release?

Thanks,
Erwin



On 7 February 2010 18:57, Erwin Coumans <erwin.coumans at gmail.com> wrote:

>
> Hi,
>
> How can we specify the actual directory where the executable ends up in
> MSVC, without any messing around by adding 'Debug' or "Release'?
>
> I tried the following lines:
>
> SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BULLET_PHYSICS_SOURCE_DIR})
> SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${BULLET_PHYSICS_SOURCE_DIR})
> SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${BULLET_PHYSICS_SOURCE_DIR})
>
> But the generated MSVC projectfiles still add 'Debug', 'Release' to the
> directory. How can this additional 'Debug' or 'Release' be removed?
>
> http://www.itk.org/Bug/view.php?id=8555 suggests using the following hack:
> if(MSVC)
>    set_target_properties(foo PROPERTIES PREFIX "../")
> endif()
>
> The issue was discussed a few times in the bug tracker, but I couldn't make
> it work with CMake 2.8.
>
> http://www.itk.org/Bug/view.php?id=8243
> http://www.itk.org/Bug/view.php?id=9163
> http://itk.org/Bug/view.php?id=9924
>
> The issue was also brought up without any solution here (I do not want to
> use install targets)
>
> http://stackoverflow.com/questions/543203/cmake-runtimeoutputdirectory-on-windows
>
> Can someone help get rid of this additional 'Debug' or 'Release' appended
> to the CMAKE_RUNTIME_OUTPUT_DIRECTORY in MSVC?
> Thanks,
> Erwin
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20100207/2a4d7fee/attachment.htm>


More information about the CMake mailing list