最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

cmake

2023-03-21 10:52 作者:米諾斯人  | 我要投稿

|CMAKE_SOURCE_DIR |The root source directory

|CMAKE_CURRENT_SOURCE_DIR |The current source directory if using
sub-projects and directories.

|PROJECT_SOURCE_DIR |The source directory of the current cmake project.

|CMAKE_BINARY_DIR |The root binary / build directory. This is the
directory where you ran the cmake command.

|CMAKE_CURRENT_BINARY_DIR |The build directory you are currently in.

|PROJECT_BINARY_DIR |The build directory for the current project.

—————————————————————————————————————————

file(GLOB SOURCES ${PROJECT_SOURCE_DIR}/src/*.cpp)????//file代替set添加變量

target_include_directories(hello_library
PUBLIC
${PROJECT_SOURCE_DIR}/include
)

include目錄下有headers或者h(yuǎn)eader_dir/headers(用作namespace)

  • +PRIVATE+ - the directory is added to this target's include directories:庫(kù)的src.cc自己gcc -I headers_include_path

  • +INTERFACE+ - the directory is added to the include directories for any targets that link this library. :任何link這個(gè)庫(kù)的編譯單元(如main.cc) gcc -I headers_include_path

  • +PUBLIC+ - As above, it is included in this library and also any targets that link this library. :上面兩條取并集


For public headers it is often a good idea to have your include folder be "namespaced"
with sub-directories.

The directory passed to +target_include_directories+ will be the root of your
include directory tree and your C++ files should include the path from there to your header.

For this example you can see that we do it as follows:
[source,cpp]


include "static/Hello.h"

static是include下一個(gè)目錄。用目錄的方式實(shí)現(xiàn)namespace


動(dòng)態(tài)庫(kù)區(qū)別不是很大,把static換成shared

add_library(hello::library ALIAS hello_library)

hello::libary是hello_library的引用別名。

——————————————————以上為lib和基礎(chǔ)編譯部分——————

————————————————



cmake的評(píng)論 (共 條)

分享到微博請(qǐng)遵守國(guó)家法律
普定县| 阳东县| 色达县| 陇南市| 西安市| 兴隆县| 江安县| 台北市| 洛阳市| 双峰县| 宁陵县| 郯城县| 龙南县| 手游| 皋兰县| 凤山市| 疏勒县| 子长县| 上饶市| 苏尼特右旗| 昭觉县| 濮阳县| 集安市| 离岛区| 延安市| 乡宁县| 阳谷县| 莱州市| 仪征市| 新源县| 府谷县| 三台县| 嵊泗县| 温泉县| 五华县| 锡林浩特市| 安仁县| 建昌县| 南川市| 南京市| 六枝特区|