CMake Module Detailed Explanation: Mastering Usage and Custom Modules

CMake Module Detailed Explanation: Mastering Usage and Custom Modules

1. Introduction This article will focus on the usage of system-defined Find modules and how to write your own Find modules. The system provides various other modules, which generally need to be explicitly called using the INCLUDE directive. The FIND_PACKAGE directive is a special case that can directly invoke predefined modules. In fact, managing a … Read more

Advanced CMake Practices and Common Issues

Advanced CMake Practices and Common Issues

Today, we will delve into two heavyweight topics: package management installation configuration and best practices along with common issues. Have you also encountered these situations: Wrote a fantastic library but don’t know how to let others use it elegantly; After sharing the project, others always complain about “missing dependencies”; Clearly configured CMakeLists.txt, yet still falls … Read more

CMake Template for Simple Projects

CMake Template for Simple Projects

CMake can be seen as a tool for automatically generating Makefiles, but it is actually a programming language with a scripting style: Cross-platform support: CMake supports multiple operating systems and compilers, allowing the same build configuration to be used in different environments. Simplified configuration: Through the CMakeLists.txt file, users can define project structure, dependencies, compilation … Read more

CMake Practical Guide (Part One)

CMake Practical Guide (Part One)

Click the blue text above to follow us Introduction Previously, we introduced the use of Autotools; today we will look at how to use CMake. CMake is a project build tool, similar to Autotools. It can be simply understood as a tool that helps us generate Makefiles for easier compilation. Usage Example (1) Create main.c, … Read more

Getting Started with CMake Build Tool

Getting Started with CMake Build Tool

Getting Started with CMake Build Tool Hello everyone, today I want to share with you a very practical tool – CMake. As a programmer, I understand the importance of managing and building code when developing large projects. CMake is like a project management assistant that helps us handle complex issues such as code compilation and … Read more

CMake Learning Summary (Part 1)

CMake Learning Summary (Part 1)

Good evening everyone, and I wish you all a happy Dragon Boat Festival. Today, I would like to share with you the project management tool CMake. There is no prior introduction to the Makefile project management tool (to be honest, these two are quite similar; CMake ultimately generates a Makefile, but the syntax of CMake … Read more

Introduction to CMake Basics

Introduction to CMake Basics

This article mainly refers to this link. 1. CMake Compilation Principles CMake is a cross-platform build tool that is more advanced than make and much easier to use. CMake primarily involves writing a CMakeLists.txt file and then using the cmake command to convert it into a makefile required by make. Finally, the make command compiles … Read more

Compile OpenCV in Linux and Generate opencv_java.so File

Compile OpenCV in Linux and Generate opencv_java.so File

1. Introduction In a Java project using OpenCV, in addition to needing to introduce the relevant POM dependencies, you also need to load the library files: * On Windows, it is opencv_java451.dll * On Linux, it is opencv_java451.so This article mainly introduces how to compile OpenCV to obtain the relevant library files; 2. Environment Description … Read more

CLion Tutorial – Boost.Test

CLion Tutorial - Boost.Test

Boost unit testing framework (Boost.Test) is part of the Boost library. It is a fully-featured and extensible framework with various assertion macros, XML output, and more. Boost.Test itself does not include mocking capabilities but can be used in conjunction with standalone mocking frameworks (like gmock). If you are not familiar with Boost.Test, here is a … Read more

CLion Tutorial – Remote GDB Server Configuration

CLion Tutorial - Remote GDB Server Configuration

Local Operating System: macOS / Linux / Windows Remote Operating System: Any system that supports gdbserver, SSH, and SFTP Required Tools: gdbserver on the target machine Binary File Synchronization: Automatic Client Debugger: Bundled GDB / GDB from Toolchain / Custom GDB Build Targets: CMake / Makefile / Custom Build Targets Configuring the Remote GDB server … Read more