[Cmake] Re: Linking libraries in Windows

Karr, David David.Karr at titan.com
Fri, 16 Jan 2004 15:55:44 -0500


Oops, my apologies to everyone for the messed-up email I posted =
yesterday.

Some days words are inadequate to describe how much I hate=20
Microsoft Outlook, especially the Web interface.

Anyway, here is what I meant to post:

>2. in MS Visual Studio - if DEBUG or RELEASE version is chosen, the
>directories Debug and Release are created, respectively. Is there any =
way
>in CMAKE to disable this so that the files were created in the current
>working directory?
>
>David Svoboda

I had a similar problem when converting an existing workspace to CMake.
The workspace had been set up to put all .dll and .exe files in a single
directory named "bin". In order to stop CMake from making a Debug
or Release subdirectory of the bin directory and putting files there
--which would have broken other established development and release=20
processes-- I copied the files from the CMake Templates directory to=20
a directory in the source of the workspace itself. Then I modified=20
the files named ...Header.dsptemplate by removing the strings "Debug"=20
or "Release" from the lines like this:
=20
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATHDebug"
=20
So now that line is just
=20
# PROP Output_Dir "EXECUTABLE_OUTPUT_PATH"
=20
Of course sometimes it says LIBRARY instead of EXECUTABLE,
and so forth. In my case I sometimes changed this too (because .libs
went in the lib directory, .dlls in the bin directory) but it appears
that in your case you would just remove the "Debug" and not
change the rest of the line.
=20
Then, to make CMake use these templates instead of the
default ones, I had to put something like the following in my=20
CMakeLists.txt file:
=20
SET(MSPROJECT_TEMPLATE_DIRECTORY ${yyy_SOURCE_DIR}/CMake/Templates)
=20
I made some other modifications to the templates, but I think these
are all the ones that had to do with Debug and Release directories.
=20
David