How can I build liquidfun library with cmake? - cmake

I am trying to run SFML-LiquidFun-Water-master open source file (https://github.com/alextrevisan/SFML-LiquidFun-Water) on VS2015, but it had some errors (such as there is no proper library "Box2D", "Liquidfun"), I realized that I have to install liquidfun librabry and bring it to the source code which I want to run. I downloaded liquidfun library from https://github.com/google/liquidfun and Cmake from https://cmake.org/ and followed instructions based on here http://google.github.io/liquidfun/Building/html/md__building_windows.html but It keep saying that there is no such command name Cmake whatever.. What am I supposed to do to run source code thank you!!

Related

Running software build in MSYS2 MINGW32 shell

I'm trying to run a piece of software I built in MSYS2 MINGW32 shell. The software is 32bits (don't have time to port it to 64bits) and there is one statically linked executable. Here is how I setup the build environment:
Installed a fresh copy of MSYS2;
$ pacman -Syu
Installed the following packages: git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-SDL mingw-w64-i686-SDL_mixer mingw-w64-i686-zlib mingw-w64-i686-libpng mingw-w64-i686-make
Git checkout the repo
Run the build in CMake
Build runs fine and the exe is generated.
Now the problem starts: the executable can't run and displays an error message about missing DLLs. I copied the missing DLLs to the same folder of the executable, and them another error message pops up complaining about error 0xC000007B, which I tracked down to be missing dependencies. After a while I figured out that the problem was that some of the DLLs is missing a dependency itself. Copied this last dependency to the folder.
Now, the big question: I can run the exe perfectly fine in the MINGW32 shell but I can't run it neither in cmd.exe nor by double-clicking in Windows Explorer and this is a problem (I can't ship a software this way). Is there any way to produce a binary that is able to run from explorer and from cmd.exe? What is the cause of this problem? Can it be mitigated?
I solved my problem!
After a lot of research, I realized that nothing was wrong with my MSYS2 build/setup/dependencies. The real problem was that CMake hide one parameter for the linker: -mwindows. Actually, the CMake find_package routine from one of the libraries I'm using (SDL) added this parameter to the linker command line parameters.
Adding a -mconsole to the linker parameters (using add_link_options("-mconsole")) solved the problem. The CLI now works as expected.
Thank you all for your help.

Cannot configure QtCreator using CMake on Ubuntu 18.04

I am trying to setup a project based on CMake with QtCreator.
In Projects I defined the Build Steps I need.
In the Build setting I get constantly the error message:
Failed to activate protocol version: "CMAKE_GENERATOR" is set but incompatible with configured generator value
I tried to browse on the Internet for this problem but I could not get rid of this error.
If now I however try to build my project specifying a target, my compile steps are not executed, instead, I get the following message:
Running "/usr/local/bin/cmake -E server --pipe=/tmp/cmake-W2VOXm/socket --experimental" in xxxx/.Build/release.
CMake Project parsing failed.
Parsing of CMake project failed: Connection to CMake server lost.
Restarting QtCreator does not help, each time the project is opened the message happens again.
Make sure the build directory it's in the same directory than your projects is, like this:
I got a similar error and have fixed it.
Try to reinstall cmake in Ubuntu by follwing https://cgold.readthedocs.io/en/latest/first-step/installation.html#ubuntu.
Configurate Tools - Options - build & run regarding "cmake" and "kits". Make sure that one of the configurations (auto-detected or maunal) is corrected.
restart qt creator, open project and "run cmake" again.
I have seen and resolved this issue previously by just deleting the build folder, reloading qtcreator and rerunning cmake.

Using cmake-gui with Qt Creator

I started trying to convert a project to use CMake so that I could import the project into QtCreator to make use of the QtCreator IDE for this straight C code. This worked pretty nicely as far as giving me auto completions, code diving, etc etc.
I have had a bit of a time getting CMake to build the code as I expected, mostly because it was the first time I have been using it. I recently discovered that there is a cmake-gui that you can point at your source and it will show you the CMake variables and such. What is the proper way to actually use cmake-gui within QtCreator? When I just manually made my CMakelists.txt files within my project, it was enough to get the project in there. Should I just run Cmake-gui using locator and point it to those files? Should I keep the same build directory in cmake-gui that was created from QtCreator? Any tutorial links or guidance apprecaited - didnt find a whole lot googling.
The way I use cmake-gui with QtCreator is this:
Create a build directory and configure it with cmake-gui, like:
cmake/project$ mkdir build
cmake/project$ cd build
cmake/project/build$ cmake-gui ..
Open the CMakeLists.txt file in QtCreator, and set the build path to where you did the configuration:
Let QtCreator run the configuration by clicking "Run CMake", it will use the values you configured with cmake-gui in step 1:
You are done :)
When you need to reconfigure the CMake build, just fire up the command line, navigate to the build directory and re-run cmake-gui.

How to build yaml-cpp with CMake on Windows?

I can be a real dummy when it comes to following instructions sometimes, pardon me. I'm in a bit of a hurry to get YAML files working with my program. I have downloaded the YAML files from the official site, I have downloaded an installed the latest CMake. What do i do now? I don't understand DLL creation nor the issues that there seem to be.
When I open CMake I put in the path to the extracted yaml-cpp-0.2.7 folder with the yaml-cpp.pc.cmake file and I set up the build path. Is there anything else I should do here? I get this error:
CMake Error: CMake was unable to find a build program corresponding to ""Visual Studio 9 2008"". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Could not find cmake module file:C:/path/yaml-cpp-0.2.7/build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: Could not find cmake module file:C:/path/yaml-cpp-0.2.7/build/CMakeFiles/CMakeCXXCompiler.cmake
Also once i'm done with this what should I do next to be able to launch the example code from the site? Which configuration should I use to be able to launch the file on VS Express 2010? I'm stuck, I can't find answers anywhere.
I have made a mistake here, i tried to get the CMake file going on a computer which didn't have the IDE installed, i installed VC++ 2010 and it works now.
I loaded the yaml-cpp solution into VC++ 2010, bulit it, linked everything and it works fine now.

Any working example of compiling a DLL in wxWidgets

I have found some examples of how to compile a DLL in wxWidgets but none of them compile in wxWidgets 2.8.9
Examples, such as, http://wiki.wxwidgets.org/Creating_A_DLL_Of_An_Application (here some of the download links don't even work, such as, http://www.frogmorecs.com/dl/fromdll.zip). Even the code at this forum http://wxforum.shadonet.com/viewtopic.php?p=5964#5964 does not compile.
Even the latest sample from the official wxWidgets SVN (http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/samples/dll/) does not compile with the latest build of wxWidgets.
someone help!
this is how to do it:
download rapidsvn
create a directory on your computer named "whatever"
start RapidSVN
go to Repository->Checkout...
enter url http://svn.wxwidgets.org/svn/wx/wxWidgets/trunk/
select the folder you created as destination directory
hit ok
once finished, go to the directory and see BuildSVN.txt
now build the samples/DLL
it should all work!