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

Windows CMAKE build only spits out Debug builds #111

Closed
nathanejohnson opened this issue May 9, 2013 · 3 comments
Closed

Windows CMAKE build only spits out Debug builds #111

nathanejohnson opened this issue May 9, 2013 · 3 comments

Comments

@nathanejohnson
Copy link

Using Visual C++ 2008 Express, CMake 2.810, Python 3.3.1. Tagert arch is x86. Build environment is using Windows 7 Pro SP1.

This seems to ignore the -DCMAKE_BUILD_TYPE=Release . No matter what value is put in here, it always builds a Debug build. This also means that it links against debug versions of the MSVC runtime dll's, which don't seem to be present in the redistributable. I was able to overcome this by opening the project within the Microsoft GUI and manually changing the type from Debug to Release and rebuilding. Ideally, however, it would default to a non-debug build.

@alanxz
Copy link
Owner

alanxz commented May 9, 2013

This is a CMake issue.

As far as I can tell CMake ignores CMAKE_BUILD_TYPE when generating project files that allow you to select the build configuration from within whatever builds it (such as Visual Studio, Eclipse, XCode...)

In Visual Studio 2008+ the default configuration is stored in a *.vcxproj.user file which is not generated by CMake.

One option you have: instead of opening VS is to use something like [msbuild](http://msdn.microsoft.com/en-us/library/wea2sca5(v=vs.90\).aspx) to build rabbitmq-c and pass a configuration parameter specifying which build you want:

msbuild rabbitmq-c.sln /t:Build /p:Configuration=Release

@alanxz alanxz closed this as completed May 9, 2013
@nathanejohnson
Copy link
Author

On May 8, 2013, at 9:40 PM, Alan Antonuk notifications@github.com wrote:

This is a CMake issue.

As far as I can tell CMake ignores CMAKE_BUILD_TYPE when generating project files that allow you to select the build configuration from within whatever builds it (such as Visual Studio, Eclipse, XCode…)

I think i might have stumbled onto a solution that doesn't require modifying anything with the Visual Studio settings:

If you do the following, from source directory:

md build
cd build
cmake -DCMAKE_INSTALL_PREFIX=c:/rabbitmq-c

And then issue:

cmake --build . --config Release --target install

This worked for me anyway. This may not be a bug with Rabbitmq-C, but it might not be bad to update the README.

Nathan

@alanxz
Copy link
Owner

alanxz commented May 9, 2013

That'll also work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants