Project
Write CMakeLists.txt To Build Release Executable File With Debug Info
Add the following code snippet to make your executable file run on windows and has debug information.
Add the following code snippet to make your executable file run on windows and has debug information.
We need to configure project in the project file CMakeLists.txt to support to use shared library or static library.Here is an example to build a project based on the library uchardet. Use shared library Use static library
Download cryptography library and build for wasm Download cryptography source code at GitHub, cryptopp. Go to cryptopp folder which contains GNUmakefile. Build it to generate C++ library and execute file. make static dynamic cryptest.exe Create a new folder build and move all generated files into it. mv *.o *.so *.a Read more…
Initial developing environment: “C:Program Files (x86)Microsoft Visual Studio 12.0VCvcvarsall.bat” x86 Use cmake to generate a project file. E:projectprivatedoubleView2>cmake ./ — Building for: Visual Studio 16 2019 — Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134. — The C compiler identification is MSVC 19.21.27702.2 — The CXX compiler identification is Read more…
It’s weird to show console in GUI application for no matter what platform. For the qmake project, the relevant setting is: CONFIG += console CONFIG -= app_bundle We have to remove the console and keep app_bundle for qmake variable CONFIG if we want to hide console when running the program. Read more…
We have an example which uses cmake to build the qt5 project: use-vtk-in-qt-widget-example But that workflow seems a cheat, I used Qt Creator to create a qmake project and wrote CMakeLists.txt later, regards it as a project file and reopen that project again. I read the introduction of cmake in Read more…
We can use qmake to configure a project for different platforms after reading qt document, Qt 5 > qmake manual > Getting Started. The qmake syntax: macx{ message(“compile for mac os x”) ICON = Images/logo.icns } win32{ message(“compile for windows”) RC_ICONS = Images/logo.ico } Similarly, we can read the target Read more…
For Unix system, we always use the command make install to put executables or existing files in the right directory. Cmake uses different variables to identify targets which will be installed. Target Variable executables RUNTIME dynamic link libraries LIBRARY static link libraries ARCHIVE macosx_bundle BUNDLE For install results of building project, relevant Read more…