各种关于CMake的note

  1. 在项目文件夹下执行cmake后生成有关cmake的各种临时文件,可以执行cmake -LA 来查看链接到的库文件、各种变量的实际内容。
  2. 关于find_package
    # The code depends on the HDF5 C++ bindings, which are not searched for by CMake's HDF5 module by default. Explicitly add the C/C++ binding to the find_package command
    find_package(HDF5 REQUIRED COMPONENTS C CXX)

有的包可能默认的binding没有你要的,可以指定。比如这里HDF5默认是不会绑定C/C++的,在加COMPONENTS C CXX之前,它链接到了我的python下面。


会不断更新

你可能感兴趣的:(各种关于CMake的note)