当前位置:网站首页>[cmake command notes]target_ compile_ options
[cmake command notes]target_ compile_ options
2022-06-23 01:25:00 【Blue area soldier】
compile basalt Encountered this command when ,basalt Third party libraries used pangolin Always report mistakes :
CMake Error at thirdparty/CMakeLists.txt:67 (target_compile_options):
Cannot specify compile options for target "pangolin" which is not built by
this project.
CMake Error at thirdparty/CMakeLists.txt:118 (get_target_property):
get_target_property() called with non-existent target "pangolin".
CMake Error at thirdparty/CMakeLists.txt:134 (get_target_property):
get_target_property() called with non-existent target "pangolin".
CMake Error at thirdparty/CMakeLists.txt:142 (set_target_properties):
set_target_properties Can not find target to add properties to: pangolin
But this has nothing to do with the command , This error seems to be caused by downloading the third-party library , It's not used git clone --recursive, Instead, manually download third-party libraries to thirdparty Under the table of contents , So you may not be aware of pangolin The existence of , Then I am basalt Use... Under the project root directory git submodule init and git submodule update, The problem was happily solved .
Record here target_compile_options command reference
cmake Original document address
This command is to add compilation options for a target that needs to be compiled , For example, the one added above add_executable() perhaps add_library(), These two commands indicate that you want to compile an executable file or a library , This is the compilation target (target).
The parameter options of the command are as follows :
target_compile_options(<target> [BEFORE]
<INTERFACE|PUBLIC|PRIVATE> [items1...]
[<INTERFACE|PUBLIC|PRIVATE> [items2...] ...])
target_compile_options Will add options (options) To COMPILE_OPTIONS perhaps INTERFACE_COMPILE_OPOTIONS Target properties ( This means adding compilation options ). These options are used when compiling a given target (<target>) When using , A given goal must have passed add_executable() perhaps add_library() This command is added to the project , And cannot be an alias target .
Here are the optional parameters
If you specify BEFORE, The options in this command will be placed before all attributes (prepended) Not after (appended).INTERFACE, PUBLIC and PRIVATE Keywords are used to specify the scope of subsequent parameters .PRIVATE and PUBLIC Items will be populated <target> Of COMPILE_OPTIONS attribute .PUBLIC and INTERFACE Items will be populated <target> Of INTERFACE_COMPILE_OPTIONS attribute .
The following parameters are the specified compilation options .
The compilation options are CMAKE Compile parameters when calling the compiler , Every compiler has some compilation parameters , Some are common , Some are compiler related , In fact, I think all the building tools , Compiler tools , It's all about getting a compiler command line , The execution command of this command line is the compiler of the compiler , Command parameters are just these compilation parameters . Use VisualStudio You can view the attribute configuration -C/C+± Command line , It's inside VS Compiler parameters for .
边栏推荐
- The road of architects starts from "storage selection"
- Shell 日志与打印输出
- [initial launch] there are too many requests at once, and the database is in danger
- Requête linq
- office2016+visio2016
- C language student achievement ranking system
- E-R diagram
- [UVM] don't say that your VIP can't use ral model
- Charles garbled code problem solving
- Learn the specific technical learning experience of designing reusable software from the three levels of class, API and framework
猜你喜欢

cadence SPB17.4 - allegro - 优化指定单条电气线折线连接角度 - 折线转圆弧

SAP ui5 application development tutorial 102 - detailed trial version of print function implementation of SAP ui5 application

Autumn move script a

3D printing microstructure

How to refine permissions to buttons?

Charles garbled code problem solving

BGP federal comprehensive experiment

Psychological analysis of the safest spot Silver

cadence SPB17.4 - allegro - 優化指定單條電氣線折線連接角度 - 折線轉圓弧

TiDB VS MySQL
随机推荐
使用aggregation API扩展你的kubernetes API
What aspects of language and database knowledge are needed to build a web Kanban!
E-R图
Software construction course ADT and OOP understanding
Analysis on the wallet system architecture of Baidu trading platform
leetcode 91. Decode Ways 解码方法(中等)
Const defined variables and for of and for in in JS
Shell logs and printouts
Pat class A - 1013 battle over cities
LeetCode 206. Reverse linked list (iteration + recursion)
OSPF comprehensive experiment
Autumn move script C
Pat class a 1016 phone bills (time difference)
Pat a - 1010 radical (thinking + two points)
[sliding window] leetcode992 Subarrays with K Different Integers
Autumn move script a
Phantomjs Usage Summary
How to set the power-off auto start of easycvr hardware box
Big guys, 2.2.1 the CDC monitoring SQLSEVER can only get the full amount of data. Why can't we get the incremental data in the later period
Cadence spb17.4 - Allegro - optimiser la spécification de l'angle de connexion de la polyligne pour une seule ligne électrique - polyligne à arc