Box2D with cmake won't build a .lib file? - c++

I am trying to use cmake to build the box2d library for visual studio 2012. This is what I have in cmake:
The Box2D/Box2D directory has all of the source files in it and the Box2D/Build directory is where I want to put all of the library things. I selected the visual studio 11 compiler and it compiled and generated without errors. However in the build folder I can't find any .lib file. This is what generates in the build folder:
I went through all of these directories but not one had any box2d.lib file in them. I don't know what I'm doing wrong. Help please?

Cmake only generates the build files so you can build it with the tool you choose in cmake - Visual Studio in your case. It only generated the Visual Studio project files. You have to open those files to build your library.

I fixed it! I built some projects in Project.sln and some .lib files were generated. I was thinking cmake was supposed to do that for you.

Related

Compile GLFW Static Libraries in Windows for Visual Studio 2019

Sorry in advance if this is a really simple question or if this has already been answered somewhere. I searched for myself but couldn't find the exact answer to my problem.
I'm following the GLFW documentation to compile the GLFW libraries using CMake. I managed to make the build files, but then the documentation says "Go ahead and compile the actual GLFW library with these files, as you would with any other project."
Unfortunately, IDK how I would compile the library as I would with any other project since I don't see any files I recognize (like .h header files or .cpp files). Instead, I see a bunch of .vcxproj files and a .sln file. I'm unfamiliar with any of these files lol.
So my question is, how would I proceed from here to build a static .lib? Thank you in advance!
Build Output:
Build Directory:
Compiling GLFW Documentation
The build folder will contain a solution file (has a .sln extension) and all the project files (among other generated files) needed to build GLFW. To build you can open the .sln file in Visual Studio and build the Debug and Release configurations directly from the IDE or you can change directory to the build folder and execute this command:
cmake --build .
to build the debug versions of the library or
cmake --build . --config Release
to build the release version.

How to make lib files available to user in package recipe?

I'm creating a conan package for OpenCV but am at a loss on what to put in package_info. Building OpenCV places .lib and .dll files in the paths x64\vc15\lib and x64\vc15\bin. This means that once I install the package and try to link I get linker errors as Visual C++ cannot find the files.
What is the correct way of making these files available to Visual Studio? Should I add code to the package method to move the bin and lib directories out of x64 and into package_folder or should I add code to package_info to indicate the path to those directories via self.cpp_info.libdirs?

How to compile/build/link - the XLNT library?

I downloaded the xlnt library for working with Excel - https://github.com/tfussell/xlnt. Can you please tell me what to do with it further? Honestly, I still can’t understand how among all the files there are in the downloaded archive, and there are 100 of them .hpp and .cpp files, what should I do with them?
1)As far as I understand, they need to be processed by the Cmake program and it seems that the output should appear .lib file, but I absolutely can’t understand how to do it or maybe something else
2)Or how can they be directly processed by Visual Studio 2017?
PS:When I launch Smack, I select the Source folder, the Cmake generates many incomprehensible files, but among them there is not one file with the .lib extension.
Help me please.
With CMake you can obtain the visual studio 2017 project files
and then compile the xlnt library.
Unzip the archive file
Within the xlnt folder, create a new directory and call it build
Launche CMake (GUI)
Browse for the source code folder
Browse for the build folder xlnt/build
With the Configure button select the tool (IDE/compiler) that you want to use
Pressing the Generate button, CMake will generate (inside the build folder)
the visual studio 2017 project files you need to compile the xlnt library
Building the solution, VS 2017 produces the xlnt.lib, xlnt.exp and xlnt.dll files.
The source path you see in the CMake screenshot is incorrect. You must specify the path that contains the "top level" CMakeLists.txt file.
The correct directory is: C:/Users/Zver/source/repos/XLNT Library/xlnt-master.
The CMakeLists.txt file in the above directory tells CMake all necessary subdirectories.
At this point you will see the static compilation option of the library appear.
If you use the MinGW/GCC compiler you must prevent the path from containing empty spaces.
Then you need to rename the directory from "XLNT Library" to "XLNTLibrary". At this point the path would become:
C:/Users/Zver/source/repos/XLNTLibrary/xlnt-master.

Setting up Aquila for my c++ Project in Visual studio 2012

I want to use Aquila DSP to compute MFCC features in my project and trying to make it work.I followed this tutorial but after mingw32-make install on the source code pulled from Aquila's git repo, it generates only libAquila.a in lib folder. I tried changing my project's include and library dependencies using these generated files after install. Also tried adding FindAquila.cmake and tried building my project with cmake for VS 2012, still no luck. Keep getting "aquila/global.h" no such file or directory when I try to include "aquila/global.h".
I also tried building Aquila with cmake for VS 2012 and able to compile it and it generates .lib files as well, but not sure how to proceed with that.
If anyone knows how to make it work, it will be great help.
So, I made it work with Visual studio 2013. Now what I am doing is I am building Aquila with both Mingw and with VisualStudio. Mingw gives required include files and visual studio build gives required .lib files. I am building Aquila in VS 2013 with configuration type static lib (project properties >> General >> Configuration type) for both debug and release configuration and then I build the project.
For Mingw, first I use cmake GUI with mingw cmakefiles configuration and then run mingw32-make install in the build directory, which will put the include, lib and share files in the installation directory( usually C:\\Programme files\\Aquila.
Now I create a Folder Aquila and put include and share from above path and create a new folder lib with two subfolder debug and release. Here I put two .lib files in each folder (aquila.lib and Ooura_fft.lib) (debug libs in debug and release libs in release folder, they will be VS build folder). Once this is done, in my project setting, I add Additional include directories under C++ >> general, Addiotnal library path under linker >> general and names of libraries under linker >> input for both bebug and release configuration. After doing all these things, now the library works with my project.

Build C++ Projects with Makefile using Visual Studio 2008

I downloaded cpptest from internet, and I want to build it using Visual Studio 2008.
The problem is that instead of .sln and vcproj file, Makefile.am is distributed, and I believe that all the all the necessary included file is included in the Makefile.am.
How to use Makefile.am to generate VS project files? I tried to use Cmake, but there is no CMakeList in the distribution.
Edit: Thanks to all the answers! There is a sln file distributed after all. But I am still interested to know the answer to my original question.
the visual studio project files for cpptest are in the win directory, not in the src directory where the makefile is..
edit
makefiles are meant to be used with GNU make. If you want that on windows, you can look at Mingw, GnuWin32 or Cygwin. But they also require gcc for compiling, so you won't really be using VS.
However, for most projects that do not have external dependencies it's no big deal if you do not have the VS project file: after all a makefile is just a list of the source files and some compilation options. To successfully build projects like cpptest, you could just create an emtpy VS project, add all source files to it, set output type to executable, build it and you're done. Eventually you can tune optimization options, but for the rest the default options will just do fine.
Go to win\VisualStudio.NET and you will find a VS solution file.
I just downloaded the archive and found the .sln file. It is under: /win/VisualStudio.NET. You can open that with VS2008 and update it, it should work.