Location>code7788 >text

QT creator cmake management project, how to introduce external libraries (introduction of Eigen library as an example)

Popularity:650 ℃/2024-10-29 19:50:50
  1. Download the zip from Eigen's website[Click me to enter]
    image
  2. Unzip to the root directory of the current project (you can of course choose your own directory)
    image
  3. Add this sentence anywhere in the current projectinclude_directories(${CMAKE_SOURCE_DIR}/eigen)
    image
  4. This is the time to test the success of the introduction by adding the#include <Eigen/Dense>If the path appears, then the import is successful and you can use it.
    image

Summary, I initially thought that introducing external libraries was troublesome and difficult, it turns out to be a man of action, in fact, introducing external projects from download to compile successfully is only about 3 minutes, do not think it is difficult and do not take action!!!!