0

I run cmake in command prompt with:

mkdir build && cd build .. cmake 

But now, I have problem constructing the command to build realease static. I tried:

C:\Users\Kuba\Downloads\rabbitmq-c>cmake --build build --BUILD_STATIC_LIBS=ON 

Which yields the error:

Unknown argument --BUILD_STATIC_LIBS=ON 

How to correct this? Thanks !

2
  • You can also use cmake-gui to set these variables in a GUI. You may want to delete the build folder and try again. Since something was broken in your last comment. ALL_BUILD should always exist in a Visual Studio CMake generated project. Commented Nov 25, 2016 at 14:53
  • @drescherjm thanks , I will try Commented Nov 26, 2016 at 21:36

2 Answers 2

1

You should define the variable using the -D option:

cmake --build build -DBUILD_STATIC_LIBS=ON 

Please read the documentation for more information.

Sign up to request clarification or add additional context in comments.

2 Comments

To have any effect, this would have to be specified when generating, not when building.
Now I try: C:\Users\Kuba\Downloads\rabbitmq-c\build>cmake --build . Microsoft (R) Build Engine version 14.0.25420.1 Copyright (C) Microsoft Corporation. All rights reserved. MSBUILD : error MSB1009: Project file does not exist. Switch: ALL_BUILD.vcxproj
1

Configuring the build is a separate step from building it.

From the source directory create a binary directory:

mkdir build && cd build 

Then configure the build (this is where you can add other build-flags):

cmake -DBUILD_STATIC_LIBS=ON .. 

then build it:

cmake --build . 

4 Comments

@alanxyz I compile rabbit-c in version "-s-mt" and now when I try static compile with wrapper SimpleAmqpClient i get some error when linking c library , could you help me ? I no have idea ... pastebin.com/DqNiaUVz
@JakubJańczak-Zarycki - SimpleAmqpClient cannot currently be built statically on Win32.
@alanxyz , future ?
@JakubJańczak-Zarycki perhaps.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.