Table of Contents
-CMake 3.17+
-C++14+
The file tree below illustrate how you develop using this cmake project structure
.
├── .vscode ### Config for dev-env with vscode
├── cmake ### Use this if you want to define something with CMake
│ └── clang.cmake ### is used for clang build
├── common ### is useful when you want to place header-only library
├── data ### is useful when you want to load data from your application
├── src
│ ├── AAA ### An application for "AAA"
│ │ ├── main.cpp ### Codes for AAA
│ │ └── CMakeLists.txt ### Edit this to link external libraries to AAA
│ └── BBB ### An application for "BBB"
│ │ ├── main.cpp ### Codes for BBB
│ │ └── CMakeLists.txt
│ └── CMakeLists.txt ### is used when there are dependencies between, for example, "AAA" and "BBB".
├── CMakePresets.json ### CMake configuration presets (will be used to build this project with command)
├── CMakeLists.txt ### Global setting for all applications
:
First, clone this with submodule
git clone --recursive git@github.com:daichi-ishida/geogram_example.git
vcpkg
is recommended to install/find library- (Optional) if you make use of
preset
likewin-x64-release
in cmake, Ninja build system is required, which makes your building faster
Using CMake GUI will be easiest choice because simply select the appropriate settings for your environment will automatically resolve Path for Visual C++ Compiler or toolchain.
Open with Visual Studio Code and choose win-x64-Release
preset and execute
Other option is using Visual Studio 2022 Developer Command Prompt and run commands below
# in Visual Studio 2022 Developer Command Prompt
cd geogram_example
cmake --preset win-x64-release
cd build\win-x64-release
cmake --build .
cd ..\..\bin\release
point_check.exe
- if you use
gcc/g++
, choosegcc-linux-release
as CMake preset - if you prefer to use
clang++
, be sure to have installed Ninja and chooseclang-linux
as CMake preset
The preset name for gcc/g++
is gcc-linux-release
run commands below
cd geogram_example
cmake --preset gcc-linux-release
cd build/gcc-linux-release
cmake --build .
cd ../../bin/release
./point_check
The preset name for clang++
is clang-linux
run commands below
cd geogram_example
cmake --preset clang-linux
cmake --build --preset release
./bin/release/point_check