国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(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ó)家法律
玛多县| 章丘市| 凌云县| 绥滨县| 阳西县| 准格尔旗| 沁水县| 曲沃县| 峨眉山市| 涿鹿县| 德江县| 房山区| 靖安县| 苏尼特右旗| 克拉玛依市| 资中县| 景泰县| 盈江县| 靖安县| 平罗县| 博客| 桐庐县| 达州市| 宁强县| 华安县| 乐清市| 鄂托克前旗| 长顺县| 清水河县| 剑河县| 金坛市| 探索| 龙陵县| 通河县| 桓仁| 兴业县| 大姚县| 巴林左旗| 洛阳市| 彰化市| 高邑县|