The following is the configuration method for controlling the activation status of compilation macros (using the WITH_PTCS_USE macro as an example).
- Enter the build directory:
cd build - Run the CMake command:
or
cmake .. -DWITH_PTCS_USE=true # Enable macrocmake .. -DWITH_PTCS_USE=false # Disable macro - Error Handling:
If the configuration fails, please clear the build directory and try again:
Then re-run the CMake command.
rm -rf ./* # Warning: This operation will permanently delete all files in the build directory
- Install the tool:
sudo apt install cmake-gui
- Run the tool:
cmake-gui
- Set project paths:
- Source path: Select the
HesaiLidar_SDK_2.0directory - Build path: Select the
HesaiLidar_SDK_2.0/builddirectory
- Source path: Select the
- Configure macro status:
Find the
WITH_PTCS_USEoption in the interface and set its value to enable or disable (usually located under theWITHsection):- ✅ Checked: Enable macro
- ⬜ Unchecked: Disable macro
- Manually add the macro (optional):
If this option is not found, click
Add Entryto add it:- Key:
WITH_PTCS_USE - Type:
BOOL
- Key:
- Generate project:
Click the
Configure→Generatebuttons in sequence to generate the configuration project.
Refer to How to Compile the SDK on Windows specifically the section2 CMake Configuration, for configuring using the CMake GUI tool.
- In the parameter list, find the
WITH_PTCS_USEoption:- ✅ Checked: Enable macro
- ⬜ Unchecked: Disable macro
- Manually add the macro (optional):
If this option is not found, you can add it under
Add Entry:- Key:
WITH_PTCS_USE - Type:
BOOL
- Key: