当前位置:网站首页>[cmake command notes]find_ path
[cmake command notes]find_ path
2022-06-23 01:25:00 【Blue area soldier】
Compiling basalt when ,cmake Tips need to be 3.4.0 Version of Eigen, And in find_package Added in exact Parameters , So it can't be changed .
However, I use apt Installed eigen yes 3.3.7 Version of . So download and install 3.4.0 Version of Eigen, however cmake Still can't find this version Eigen.
see basalt The compiled file found that he was using FindEigen3.cmake File search Eigen Library , That is to say CMakelists.txt of use find_package() Find library , then findpackage Use module Pattern to find , see CMake Search method
So just modify FindEigen3.cmake Files can be searched , stay FindEigen3.cmake There is a use in the document find_path.
There will be find_path The official document of the command is translated as follows
Link to the original text —CMake3.23.1—find_path
find_path
The compact command signature is :
find_path (<VAR> name1 [path1 path2 ...])
The generalized command signature is
find_path (
<VAR>
name | NAMES name1 [name2 ...]
[HINTS [path | ENV var]... ]
[PATHS [path | ENV var]... ]
[PATH_SUFFIXES suffix1 [suffix2 ...]]
[DOC "cache documentation string"]
[NO_CACHE]
[REQUIRED]
[NO_DEFAULT_PATH]
[NO_PACKAGE_ROOT_PATH]
[NO_CMAKE_PATH]
[NO_CMAKE_ENVIRONMENT_PATH]
[NO_SYSTEM_ENVIRONMENT_PATH]
[NO_CMAKE_SYSTEM_PATH]
[CMAKE_FIND_ROOT_PATH_BOTH |
ONLY_CMAKE_FIND_ROOT_PATH |
NO_CMAKE_FIND_ROOT_PATH]
)
The first thing you need to know is Command line syntax parameters <>, [], | What do you mean by them
This command is used to find a directory , This directory contains the named file( It should be in the command parameter name、NAMES These parameters specify the file ), If you choose NO_CACHE Parameters , that <VAR> The specified variable is created to hold the search results of the command . Find success , Then the search results will be saved to <VAR> in , If not found , Then the result will be saved as <VAR>-NOTFOUND.
Options include
NAMES
Here is either directly write name, Or write NAMES name1 [name2 …] It means . Is the file item to be found .
HINTS, PATHS
In addition to the default location , Specify other directories to search .ENV var Sub options read the path from the system environment variable .
PATH_SUFFIXS
Specify additional subdirectories to check under each directory .(otherwise considered I don't know what it means )
NO_DEFAULT_PATH
Do not find the default path
You know that the above parameters are almost complete
Take the following command for example , This is to find EIGEN3 The location of this library ,signature_of_eigen3_matrix_library yes eigen3 A file in this library , The directory where this file is located is the directory where the library is located , Therefore use find_path Find this file and save the results to EIGEN3_INCLUDE_DIR_NAMES.
HINTS Provides a search path , It's a variable. EIGEN_INCLUDE_DIR_HINTS Provided .
NO_DEFAULT_PATH Indicates that the default path is not searched , such as /usr/local/include、/usr/include Wait, path .
find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
HINTS ${EIGEN_INCLUDE_DIR_HINTS}
NO_DEFAULT_PATH
)
边栏推荐
- [launch] redis Series 2: data persistence to improve availability
- Hierarchy selector
- Cadence spb17.4 - Chinese UI settings
- Installing MySQL for Linux
- [Luogu] P2887 Sunscreen G
- 使用aggregation API扩展你的kubernetes API
- Ros2 summer school 2022 transfer-
- 07 project cost management
- Local deployment and problem solving of IIS in ArcGIS JS 4.23
- Pat class A - 1012 the best rank (PIT)
猜你喜欢

A hundred lines of code to realize reliable delay queue based on redis

E-R diagram

Huawei cloud recruits partners in the field of industrial intelligence to provide strong support + commercial realization

How to solve the problem that easycvr does not display the interface when RTMP streaming is used?

Autumn move script B

The devil cold rice # 099 the devil said to travel to the West; The nature of the boss; Answer the midlife crisis again; Specialty selection

I've been outsourcing for four years, but I feel it's useless

three. JS simulated driving tour art exhibition hall - creating super camera controller

Sfod: passive domain adaptation and upgrade optimization, making the detection model easier to adapt to new data

魔王冷饭||#099 魔王说西游;老板的本质;再答中年危机;专业选择
随机推荐
Dig three feet to solve the data consistency problem between redis and MySQL
[hdu] p1466 calculate the number of intersections of straight lines
C#.NET万能数据库访问封装类(ACCESS、SQLServer、Oracle)
Vscade personalization: let a cute girl knock the code with you
Extend your kubernetes API using the aggregation API
OOP multiple storage (class template)
层次选择器
Autumn move script C
Vector 6 (inheritance)
[ZOJ] P3228 Searching the String
使用aggregation API扩展你的kubernetes API
leetcode 91. Decode Ways 解码方法(中等)
Vector 3 (static member)
Yyds dry goods counting tail recursion is better than recursion
Pat class A - 1013 battle over cities
Learn the specific technical learning experience of designing reusable software from the three levels of class, API and framework
Shell logs and printouts
The road of architects starts from "storage selection"
BGP federal comprehensive experiment
E-R diagram