当前位置:网站首页>[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 .
边栏推荐
- [launch] redis Series 2: data persistence to improve availability
- How to calculate the position of gold ETF
- three. JS simulated driving tour art exhibition hall - creating super camera controller
- Add expiration time for localstorage
- Time complexity
- It's still like this
- cadence SPB17.4 - allegro - 优化指定单条电气线折线连接角度 - 折线转圆弧
- JMeter associated login 302 type interface
- How to solve the problem that easycvr does not display the interface when RTMP streaming is used?
- C#.NET万能数据库访问封装类(ACCESS、SQLServer、Oracle)
猜你喜欢

Wallys/DR7915-wifi6-MT7915-MT7975-2T2R-support-OpenWRT-802.11AX-supporting-MiniPCIe

Dig three feet to solve the data consistency problem between redis and MySQL

SAP mm transaction code vl04 create outbound delivery for sto

Day367: valid complete square

SQL programming task05 job -sql advanced processing

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

How to calculate the position of gold ETF

office2016+visio2016

E-R图

62. different paths
随机推荐
Char[], char *, conversion between strings
Pat a - 1010 radical (thinking + two points)
Node fetch download file
Installation record of ros1noetic in Win 11
JS image resolution compression
Charles garbled code problem solving
Project directory navigation
Software construction course ADT and OOP understanding
Js--- SVG to png
Add expiration time for localstorage
[hdu] P6964 I love counting
BGP联邦综合实验
Development status of full color LED display
E-R图
SAP mm me27 create intra company sto order
[launch] redis Series 2: data persistence to improve availability
Ros2 summer school 2022 transfer-
Prevent others from using the browser to debug
office2016+visio2016
How to solve the problem that easycvr does not display the interface when RTMP streaming is used?