[CMake] Some issues with visual studio

Renato Utsch renatoutsch at gmail.com
Sun Jan 8 16:24:12 EST 2012


No, it is perfectly valid and I understand you, but the problem is
that I'm rewriting a broken CMake script from the eAthena project (a
ragnarök online emulator), and it has a very old basis that would
cause a lot of trouble to change.

The executables _have_ to be on the ${CMAKE_SOURCE_DIR} when built,
because of a lot of files and dependencies... The original Visual
Studio project from eAthena already generates the executables _at_ the
${CMAKE_SOURCE_DIR} folder, I only want to make this happen.

If wasn't this I would do exactly what you said, but I can't. Maybe I
will have to create a separate build system for Visual Studio, but I
prefer to try fixing these problems with CMake than doing this.

Oh, and incredibly I have to force CMake to make an in-source build,
because of that I mixed ${CMAKE_SOURCE_DIR} and ${CMAKE_BINARY_DIR}
when explaining my situation here :P

That stackoverflow page seems promising. I will look at it, thanks!

Renato

2012/1/8 Michael Jackson <mike.jackson at bluequartz.net>:
> This is going to sound either harsh or "flame bait" but is written in all seriousness and with a lot of practical experience.
>
>  When coming from a "makefile" based system like Unix and going to Visual Studio there are a few things you need to "give up on" (In my opinion). Visual Studio (And Xcode) both like to separate build types into Debug/Release/Others and put those items compiled into those subfolders. If you try to have your output files put anywhere else you are endlessly "fighting the system" and in the you will waste more time trying to fight the system rather then working on your code. Unless you have a very valid reason why your built items MUST be in the binary folder then I wouldn't really worry where they land. Let Visual Studio or Xcode put them where they want. You only need to realize that there _are_ Debug and Release subfolders and it is in there that you will find your executables and libraries. This is said with about 3 or 4 years of working with Linux, OS X, Windows, Visual Studio, Xcode, Makefiles. Don't fight the system, just adapt to it and move on.
>
>  I guess that was harsh. Sorry. Having said that I am very interested in knowing the specific reasons why you need your executables in the CMAKE_BINARY_DIRECTORY and can not have them in a subfolder.
> --
> Mike Jackson <www.bluequartz.net>
>
> On Jan 8, 2012, at 1:28 PM, Renato Utsch wrote:
>
>> Ok, I will look at that so.
>>
>> But and the second problem? How can I redirect from the debug/release
>> folder to the / folder of the project?
>>
>>
>> Renato
>>
>> 2012/1/8 Mateusz Loskot <mateusz at loskot.net>:
>>> On 8 January 2012 16:04, Eric Noulard <eric.noulard at gmail.com> wrote:
>>>> 2012/1/8 Renato Utsch <renatoutsch at gmail.com>:
>>>>> So I can do this by adding a command line parameter to do that. But
>>>>> can't I simply set an option that behaves exactly as --config Debug ?
>>>>
>>>> May be you could try to find out how Visual Studio
>>>> is choosing the default built type?
>>>
>>> Eric, spot on!
>>>
>>> Renato, if you create new project from within Visual Studio,
>>> what build configuration is used as default? Debug.
>>> Your problem has nothing to do with CMake.
>>>
>>> Best regards,
>>> --
>>> Mateusz Loskot, http://mateusz.loskot.net
>> --
>>
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake


More information about the CMake mailing list