Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "_d" suffix to game executable on Windows. #995

Merged
merged 2 commits into from Oct 21, 2015

Conversation

Projects
None yet
5 participants
@knight666
Copy link

commented Oct 20, 2015

One thing that bugged me while working in Visual Studio was that while the output directory had direct links to the media folders (which is great!), the game's executable would be output to "Debug" and "Release" folders. This meant I had to copy the required DLLs to both Debug and Release folders.

My fix is to always output the executable to the same build directory, but differentiate between debug and release builds using a "_d" suffix.

I copied this change from CEGUI, take that as you will. ;)

@akien-mga

This comment has been minimized.

Copy link

commented on CMakeLists.txt in aaa68df Oct 20, 2015

Do we really need all these definitions? It's a lot of clutter for nothing, AFAIK our buildsystem only builds the opendungeons/OpenDungeons.exe binary, we don't need to define a ./lib path. Or I'm missing something about the Win32 platform?

This comment has been minimized.

Copy link
Owner

replied Oct 20, 2015

Hmm, no, you're right. I'll remove the lib definitions.

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

if(WIN32 OR APPLE)

This comment has been minimized.

Copy link
@hwoarangmy

hwoarangmy Oct 20, 2015

Contributor

Do you have an apple computer ? That would be interesting as none of us have

This comment has been minimized.

Copy link
@knight666

knight666 Oct 20, 2015

Author

Unfortunately, I do not. This line was copied from CEGUI.

@hwoarangmy

This comment has been minimized.

Copy link
Contributor

commented Oct 20, 2015

looks good. I will try that tonight

@akien-mga

This comment has been minimized.

Copy link

commented on aaa68df Oct 20, 2015

I wonder about the other properties defined here. Do we really need to redefine CMAKE_RUNTIME_OUTPUT_DIRECTORY* and both CMAKE_DEBUG_POSTFIX and OUTPUT_NAME_DEBUG, or are some of them redundant? It looks like a lot of added code just to append "_d" to the debug build on Windows and Apple.


if(OD_BUILD_SUFFIX)
set(OD_HAS_BUILD_SUFFIX TRUE)
set(CMAKE_DEBUG_POSTFIX ${OD_BUILD_SUFFIX})

This comment has been minimized.

Copy link
@hwoarangmy

hwoarangmy Oct 20, 2015

Contributor

Is CMAKE_DEBUG_POSTFIX used ?

This comment has been minimized.

Copy link
@knight666

knight666 Oct 20, 2015

Author

Yes, that's the variable used by CMake for actually setting the suffix.

endif()

if(OD_BUILD_SUFFIX)
set(OD_HAS_BUILD_SUFFIX TRUE)

This comment has been minimized.

Copy link
@hwoarangmy

hwoarangmy Oct 20, 2015

Contributor

FMI, why do you use a boolean here after testing OD_BUILD_SUFFIX ? Why don't you test OD_BUILD_SUFFIX later instead of the boolean ?

@hwoarangmy

This comment has been minimized.

Copy link
Contributor

commented Oct 20, 2015

Do we really need to redefine CMAKE_RUNTIME_OUTPUT_DIRECTORY*

I've faced the same problem for another open source project. By default, MSVS outputs binaries to "PROJECT/BUILD_TYPE". For example, OD/Release/OpenDungeons.exe.

And if you want to force the binary output directory to be in OD, you need to set it for every build type (there is no way to do that once and for all).

@hwoarangmy

This comment has been minimized.

Copy link
Contributor

commented Oct 20, 2015

Good to merge for me. Nice work

Bertram25 added a commit that referenced this pull request Oct 21, 2015

Merge pull request #995 from knight666/cleanup-cmake
Add "_d" suffix to game executable on Windows.

@Bertram25 Bertram25 merged commit 74eb095 into OpenDungeons:development Oct 21, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.