91视频专区

91精选在线观看,91热爆在线精品,91夜夜人人揉人人捏人人添,国内...

夏季的陇南,气温"刚刚好",在20℃-30℃之间,是避暑的"绝佳之选"。官鹅沟,被誉为"西北小九寨",这里的瀑布"千姿百态"。文县天池,像一颗"蓝宝石",被"镶嵌"在崇山峻岭之间。千坝牧场"犹如云中草甸",隐没在层峦迭嶂的大山尽头。

2025年01月13日,正所谓知己知彼,百战不殆,要想治好土地里的蛴螬虫害,就得看看蛴螬这种虫子怕什么,知道了它的生活习性和天敌之后,再对症下药,就能够一击制胜,将蛴螬赶出自家的土地了。

91精选在线观看,91热爆在线精品,91夜夜人人揉人人捏人人添,国内...

据此前消息称拜仁3500万欧的报价被雷恩拒绝而巴黎则提出了4000万欧外加1000万欧浮动的报价

柯尔山社区上半年全球自然灾害致经济损失或达1940亿美元

锄丑颈辩颈苍驳谤别苍蝉丑颈蝉丑耻辞,迟颈肠丑耻濒别驳耻补苍虫耻丑补苍驳濒颈肠丑别苍驳驳耻箩颈诲别锄丑颈濒颈苍驳濒补颈锄颈迟别蝉颈濒补蝉丑辞耻虫颈锄丑颈虫颈苍驳驳耻补苍尘补蝉颈办别。尘耻辩颈补苍飞耻蹿补辩耻别诲颈苍驳迟别蝉颈濒补蝉丑颈蹿辞耻谤别苍驳锄补颈蝉丑颈测辞苍驳迟颈驳补辞虫耻丑补苍驳濒颈肠丑别苍驳驳耻箩颈锄丑颈诲别蝉耻补苍蹿补。1、测颈苍驳飞别颈诲补箩颈苍箩颈诲颈苍驳诲补苍诲补濒颈补苍驳测辞苍驳谤耻,锄丑别濒别颈肠丑补苍辫颈苍肠丑颈虫耻辩耻别丑耻辞锄丑补苍驳箩颈补

该(骋补颈)铁(罢颈别)路(尝耻)建(闯颈补苍)成(颁丑别苍驳)运(驰耻苍)营(驰颈苍驳)后(贬辞耻),杭(贬补苍驳)州(窜丑辞耻)、金(闯颈苍)华(贬耻补)、台(罢补颈)州(窜丑辞耻)、温(奥别苍)州(窜丑辞耻)等(顿别苍驳)地(顿颈)丰(贵别苍驳)富(贵耻)的(顿别)旅(尝惫)游(驰辞耻)资(窜颈)源(驰耻补苍)将(闯颈补苍驳)串(颁丑耻补苍)联(尝颈补苍)成(颁丑别苍驳)线(齿颈补苍),沿(驰补苍)线(齿颈补苍)仙(齿颈补苍)居(闯耻)、磐(笔补苍)安(础苍)、东(顿辞苍驳)阳(驰补苍驳)、浦(笔耻)江(闯颈补苍驳)等(顿别苍驳)地(顿颈)将(闯颈补苍驳)正(窜丑别苍驳)式(厂丑颈)迈(惭补颈)入(搁耻)高(骋补辞)铁(罢颈别)时(厂丑颈)代(顿补颈),对(顿耻颈)于(驰耻)完(奥补苍)善(厂丑补苍)区(蚕耻)域(驰耻)路(尝耻)网(奥补苍驳)布(叠耻)局(闯耻),促(颁耻)进(闯颈苍)长(颁丑补苍驳)叁(厂补苍)角(闯颈补辞)城(颁丑别苍驳)市(厂丑颈)群(蚕耻苍)联(尝颈补苍)动(顿辞苍驳)发(贵补)展(窜丑补苍)等(顿别苍驳)具(闯耻)有(驰辞耻)重(窜丑辞苍驳)要(驰补辞)意(驰颈)义(驰颈)。

CMakegoujianMakefileshendujiexi:congdicengyuanlidaofuzaxiangmu2023-06-10 21:24·linuxjishuzhanyi、CMakegoujianhoudexiangmujiegoujiexi(Analysis of the Project Structure After CMake Build)1.1 CMakegoujianhoudemulujiegou(Directory Structure After CMake Build)CMakegoujianwanchenghou,huizaixiangmudegenmuluxiashengchengyigemingweibuilddemulu。zhegemulushiCMakegoujianguochengzhongsuoyouzhongjianwenjianhezuizhongshengchengdemubiaowenjiandecunfangdi。xiamianwomenjiangxiangxijiexizhegemuludejiegou。shouxian,womenlaikanyixiabuildmuludeyijizimulu:CMakeFiles:zhegemuluzhongcunfangdeshiCMakezaigoujianguochengzhongshengchengdelinshiwenjian,baokuobianyiqijianchadejieguo、Findmokuai(Find Modules)chazhaodejieguodeng。zhexiewenjianzhuyaoyongyuCMakezishendexuqiu,yibanqingkuangxia,womenbuxuyaoguanzhuzhegemuludeneirong。Testing:ruguonidexiangmuzhongbaohanliaoCTestceshi,namezhegemulujianghuibeishengcheng。tabaohanliaosuoyouCTestceshidejieguo。bin:zhegemuluzhongbaohanliaosuoyoudekezhixingwenjian(Executable Files)。ruguonideCMakexiangmuzhongbaohanliaoduogekezhixingwenjian,nametamenduhuibeifangzaizhegemuluzhong。lib:zhegemuluzhongbaohanliaosuoyoudekuwenjian(Library Files)。wulunshijingtaiku(Static Libraries)huanshidongtaiku(Dynamic Libraries),duhuibeifangzaizhegemuluzhong。jiexialai,womenzaishenrudaoCMakeFilesmuluzhong,kanyixiatadeerjizimulu:project.dir:zhegemuluzhongbaohanliaoxiangmugoujianguochengzhongdelinshiwenjian,ru.owenjianhe.dwenjian。zhexiewenjianshibianyiqizaibianyiyuandaimashishengchengde。CMakeOutput.log:zhegewenjianjiluliaoCMakezaipeizhiguochengzhongdeshuchuxinxi,baokuobianyiqijianchadejieguo、Findmokuaichazhaodejieguodeng。CMakeError.log:zhegewenjianjiluliaoCMakezaipeizhiguochengzhongyudaodecuowuxinxi。yishangjiushiCMakegoujianhoudemulujiegoudejibenqingkuang。zaishijidexiangmuzhong,kenenghuigenjuxiangmudejutixuqiu,shengchenggengduodezimuluhewenjian。danshi,zhexiejibendemuluhewenjianshinizairenheyigeshiyongCMakegoujiandexiangmuzhongdunengkandaode。1.2 goujianshengchengdewenjianleixingjiqizuoyong(Types of Files Generated by the Build and Their Functions)CMakegoujianguochengzhonghuishengchengduozhongleixingdewenjian,meizhongwenjianduyouqitedingdezuoyong。xiamianwomenjiangxiangxijiexizhexiewenjiandeleixinghezuoyong。CMakeFilesmulu:zhegemuluzhongcunfangdeshiCMakezaigoujianguochengzhongshengchengdelinshiwenjian,baokuobianyiqijianchadejieguo、Findmokuai(Find Modules)chazhaodejieguodeng。zhexiewenjianzhuyaoyongyuCMakezishendexuqiu,yibanqingkuangxia,womenbuxuyaoguanzhuzhegemuludeneirong。project.dirmulu:zhegemuluzhongbaohanliaoxiangmugoujianguochengzhongdelinshiwenjian,ru.owenjianhe.dwenjian。zhexiewenjianshibianyiqizaibianyiyuandaimashishengchengde。CMakeOutput.logwenjian:zhegewenjianjiluliaoCMakezaipeizhiguochengzhongdeshuchuxinxi,baokuobianyiqijianchadejieguo、Findmokuaichazhaodejieguodeng。CMakeError.logwenjian:zhegewenjianjiluliaoCMakezaipeizhiguochengzhongyudaodecuowuxinxi。Testingmulu:ruguonidexiangmuzhongbaohanliaoCTestceshi,namezhegemulujianghuibeishengcheng。tabaohanliaosuoyouCTestceshidejieguo。binmulu:zhegemuluzhongbaohanliaosuoyoudekezhixingwenjian(Executable Files)。ruguonideCMakexiangmuzhongbaohanliaoduogekezhixingwenjian,nametamenduhuibeifangzaizhegemuluzhong。libmulu:zhegemuluzhongbaohanliaosuoyoudekuwenjian(Library Files)。wulunshijingtaiku(Static Libraries)huanshidongtaiku(Dynamic Libraries),duhuibeifangzaizhegemuluzhong。yishangjiushiCMakegoujianguochengzhongshengchengdezhuyaowenjianleixingjiqizuoyong。lijiezhexiewenjiandezuoyong,keyibangzhuwomengenghaodilijieCMakedegoujianguocheng。1.3 CMakeLists.txtyushengchengdeMakefiledeguanxi(The Relationship Between CMakeLists.txt and the Generated Makefile)zaiCMakegoujianxitongzhong,CMakeLists.txtwenjianheshengchengdeMakefilewenjianzhijiancunzaizhuomiqiedeguanxi。xiamianwomenjiangxiangxijiexizhezhongguanxi。CMakeLists.txtshiCMakegoujianxitongdehexinwenjian,tadingyiliaoxiangmudegoujianguizeheyilaiguanxi。zaizhixingCMakeminglingshi,CMakehuiduquCMakeLists.txtwenjian,jiexiqizhongdegoujianguizeheyilaiguanxi,ranhoushengchengxiangyingdeMakefilewenjian。MakefilewenjianshiyouCMakegenjuCMakeLists.txtwenjianshengchengde,tashiMakegoujiangongjukeyizhijieduqudegoujianjiaoben。Makefilewenjianzhongbaohanliaojutidebianyiminglinghelianjiemingling,yijiyuanwenjianhemubiaowenjianzhijiandeyilaiguanxi。zaiyigeCMakexiangmuzhong,tongchanghuiyouduogeCMakeLists.txtwenjian,meigemuluxiadukeyiyouyigeCMakeLists.txtwenjian。zhexieCMakeLists.txtwenjianzhongdingyidegoujianguizeheyilaiguanxi,huibeiCMakehebingdaoyiqi,shengchengyigehuoduogeMakefilewenjian。ruguoyigeCMakexiangmuzhongzhiyouyigeCMakeLists.txtwenjian,nameCMakehuishengchengyigeMakefilewenjian。ruguoyigeCMakexiangmuzhongyouduogeCMakeLists.txtwenjian,nameCMakehuizaimeigeCMakeLists.txtwenjiansuozaidemuluxiashengchengyigeMakefilewenjian。zhexieMakefilewenjianzhong,dingcengmuluxiadeMakefilewenjianshizhuMakefilewenjian,tahuidiaoyongqitamuluxiadeMakefilewenjian。zongdelaishuo,CMakeLists.txtwenjianheshengchengdeMakefilewenjianzhijiandeguanxishi:CMakeLists.txtwenjiandingyiliaoxiangmudegoujianguizeheyilaiguanxi,CMakegenjuCMakeLists.txtwenjianshengchengMakefilewenjian,ranhouMakegenjuMakefilewenjianzhixingjutidegoujianrenwu。xiangguanshipintuijiancongchengxubianyidaozhangwo cmake xiangmugoujiangongju2023jiuyexingqingyipiancandan,ruhenadaozijilixiangdeoffer?2023nianzuixinjishutupu,c++houduande8gejishuweidu,zhulinikuaisuchengweidaniuxuyaoC/C++ Linuxfuwuqijiagoushixuexiziliaojiaqun812855908huoqu(ziliaobaokuoC/C++,Linux,golangjishu,Nginx,ZeroMQ,MySQL,Redis,fastdfs,MongoDB,ZK,liumeiti,CDN,P2P,K8S,Docker,TCP/IP,xiecheng,DPDK,ffmpegdeng),mianfeifenxianger、shenrulijieCMakeshengchengdeMakefile2.1 MakefiledejibenjiegouheyuanliMakefileshiGNU makegongjudepeizhiwenjian,tadingyiliaoyizuguizelaizhidingnaxiewenjianxuyaobeigengxin,yijiruhegengxinzhexiewenjian。zaiC++xiangmuzhong,Makefiletongchangyongyubianyiyuandaimabingshengchengkezhixingwenjian。Makefiledejibenjiegoubaokuosangebufen:mubiao(Target)、yilai(Dependencies)hemingling(Commands)。mubiao(Target):zheshixuyaoshengchengdewenjianming。takeyishiyigeduixiangwenjian(Object File),yekeyishiyigekezhixingwenjian(Executable File)。yilai(Dependencies):zhexieshimubiaowenjianxuyaodeyuanwenjian。ruguorenheyigeyilaiwenjianbimubiaowenjiangengxin,namemubiaowenjianjiuxuyaobeizhongxinshengcheng。mingling(Commands):zhexieshishengchengmubiaowenjiansuoxuyaozhixingdeshellmingling。zhexieminglingbixuyiTabzifukaishi。xiamianshiyigejiandandeMakefileshili:target: dependencies commandszaiCMakezhong,CMakeLists.txtwenjianzhongdezhilinghuibeizhuanhuanweiMakefilezhongdemubiao、yilaihemingling。liru,add_executablezhilinghuishengchengyigemubiao,target_link_librarieszhilinghuishengchengyilai,ershijidebianyihelianjieminglingzeyouCMakezidongshengcheng。lijieMakefiledejibenjiegouheyuanli,duiyushenrulijieCMakeshengchengdeMakefileyouzhuozhongyaodezuoyong。zaixiayijiezhong,womenjiangjinyibutantaoduogeCMakeLists.txtshengchengdeMakefiledejiexi。2.2 duogeCMakeLists.txtshengchengdeMakefilejiexizaidaxingdeC++xiangmuzhong,tongchanghuiyouduogeCMakeLists.txtwenjian,meigemuluxiaduyouyige。zhezhongjiegouyouzhuyubaochixiangmudemokuaihua,shidemeigebufenkeyidulidibeigoujianheceshi。dangyunxingCMakeminglingshi,tahuishouxianchazhaogenmuluxiadeCMakeLists.txtwenjian,ranhoudiguidichulimeigezimuluzhongdeCMakeLists.txtwenjian。meigeCMakeLists.txtwenjianduhuishengchengyigeduiyingdeMakefile。zaizhegeguochengzhong,CMakehuichuliCMakeLists.txtwenjianzhongdezhiling,ruadd_executable、add_library、target_link_librariesdeng,bingjiangzhexiezhilingzhuanhuanweiMakefilezhongdemubiao、yilaihemingling。liru,ruguowomenyouruxiademulujiegou:project/├── CMakeLists.txt├── main.cpp└── module/ ├── CMakeLists.txt └── module.cppzaigenmuludeCMakeLists.txtwenjianzhong,womenkenenghuiyouruxiadezhiling:add_executable(main main.cpp)add_subdirectory(module)target_link_libraries(main module)zaimodulemuludeCMakeLists.txtwenjianzhong,womenkenenghuiyouruxiadezhiling:add_library(module module.cpp)zaizhegelizizhong,CMakehuishengchenglianggeMakefile,yigezaiprojectmulu,yigezaiproject/modulemulu。zaiprojectmuludeMakefilezhong,huiyouyigemingweimaindemubiao,tayilaiyumain.cpphemodulemuludeMakefilezhongshengchengdeku。zaiproject/modulemuludeMakefilezhong,huiyouyigemingweimoduledemubiao,tayilaiyumodule.cpp。tongguozhezhongfangshi,CMakeshidemeigezimulukeyidulidibeigoujian,tongshiyebaozhengliaozhenggexiangmudegoujianshunxu。2.3 CMakeyuMakefilededuiyingguanxiCMakeshiyigekuapingtaidegoujianxitong,tadezhuyaorenwushigenjuyonghudexuqiushengchengshidangdeMakefilewenjian。CMaketongguoduquCMakeLists.txtwenjianlailiaojieyonghudexuqiu,ranhoushengchengduiyingdeMakefilewenjian。zaiCMakeyuMakefilezhijian,cunzaiyizhongmingquededuiyingguanxi。CMakeLists.txtwenjianzhongdemeiyitiaozhiling,duhuizaishengchengdeMakefilewenjianzhongyouyigeduiyingdebiaoxian。xiamianwomenlaikanyixiechangjiandeCMakezhiling,yijitamenzaiMakefilezhongdeduiyingguanxi:add_executable:zhegeCMakezhilingyongyudingyiyigekezhixingwenjiandemubiao。zaishengchengdeMakefilezhong,zhegemubiaohuibeidingyiweiyigeguize,guizedemubiaoshikezhixingwenjian,yilaixiangshiyuanwenjian,minglingshibianyimingling。add_library:zhegeCMakezhilingyongyudingyiyigekuwenjiandemubiao。zaishengchengdeMakefilezhong,zhegemubiaoyehuibeidingyiweiyigeguize,guizedemubiaoshikuwenjian,yilaixiangshiyuanwenjian,minglingshibianyimingling。target_link_libraries:zhegeCMakezhilingyongyudingyimubiaodelianjieku。zaishengchengdeMakefilezhong,zhegezhilinghuiyingxiangdaolianjiemingling,lianjieminglinghuibaohanduiyingdekuwenjian。add_subdirectory:zhegeCMakezhilingyongyutianjiazimulu。zaishengchengdeMakefilezhong,zhegezhilinghuidaozhishengchengyigexindeMakefilewenjianzaiduiyingdezimuluzhong。tongguolijieCMakeyuMakefilededuiyingguanxi,womenkeyigenghaodilijieCMakedegongzuoyuanli,yijiruhebianxieyouxiaodeCMakeLists.txtwenjian。zaixiayizhangjiezhong,womenjiangjinyibutantaoCMakegoujianguochengdedicengyuanli。san、CMakegoujianguochengdedicengyuanli(Underlying Principles of the CMake Build Process)3.1 CMakegoujianguochengdejibenliucheng(Basic Flow of the CMake Build Process)CMakedegoujianguochengkeyifenweisangezhuyaobuzhou:peizhi(Configuration)、shengcheng(Generation)hegoujian(Build)。xiamianwomenjiangxiangxijieximeigebuzhou。1、peizhi(Configuration)peizhijieduanshiCMakejiexiCMakeLists.txtwenjiandeguocheng。zaizhegejieduan,CMakehuiduquCMakeLists.txtwenjian,bingzhixingqizhongdemingling。zhexieminglingzhuyaoyongyujianchaxitonghuanjing(lirubianyiqi、kudeng),shezhigoujianxuanxiang,yijidingyigoujianmubiao(liruku、kezhixingwenjiandeng)。CMakeLists.txtwenjianshiCMakedehexin,tadingyiliaoxiangmudegoujianguizeheyilaiguanxi。meigemulu(baokuozimulu)zhongdukeyiyouyigeCMakeLists.txtwenjian。zaipeizhijieduan,CMakehuicongdingcengmuludeCMakeLists.txtwenjiankaishi,diguidichulimeigezimuluzhongdeCMakeLists.txtwenjian。2、shengcheng(Generation)shengchengjieduanshiCMakegenjupeizhijieduandejieguo,shengchengshijidegoujianwenjiandeguocheng。zhexiegoujianwenjiantongchangshiMakefilewenjian,danyekeyishiqitaleixingdegoujianwenjian,liruNinjagoujianwenjian,huozheVisual Studioxiangmuwenjian,zhequjueyunixuanzedegoujiangongju。zaishengchengjieduan,CMakehuijiangCMakeLists.txtwenjianzhongdingyidegoujianguizeheyilaiguanxi,zhuanhuanweigoujiangongjukeyilijiedexingshi。liru,ruguonixuanzedegoujiangongjushiMake,CMakehuishengchengMakefilewenjian。meigemulu(baokuozimulu)zhongduhuishengchengyigeMakefilewenjian。3、goujian(Build)goujianjieduanshishiyonggoujiangongju(liruMake、NinjahuoVisual Studio)genjushengchengdegoujianwenjian,bianyiyuandaimabinglianjieshengchengmubiaowenjiandeguocheng。zaigoujianjieduan,goujiangongjuhuiduqushengchengdegoujianwenjian,anzhaoqizhongdingyideguizeheyilaiguanxi,zhixingshijidebianyihelianjiecaozuo。goujiangongjuhuizidongchuliyilaiguanxi,quebaozaibianyihelianjieyigemubiaowenjianzhiqian,qisuoyouyilaidemubiaowenjianduyijingbeizhengquedibianyihelianjie。yishangjiushiCMakegoujianguochengdejibenliucheng。zailijieliaozhegeliuchengzhihou,womenjiukeyigengshenruditantaoCMakeruheshengchengMakefile,yijiCMakegoujianguochengzhongdeguanjianbuzhouliao。3.2 CMakeruheshengchengMakefile(How CMake Generates Makefile)CMakeshengchengMakefiledeguochengshizaiqishengchengjieduanwanchengde。zhegeguochengzhuyaoshejidaoCMakedehexinzujian——shengchengqi(Generator)。xiamianwomenjiangxiangxijiexizhegeguocheng。1、xuanzeshengchengqi(Selecting a Generator)zaiCMakedeshengchengjieduankaishishi,shouxianxuyaoxuanzeyigeshengchengqi。shengchengqishiCMakedeyigehexinzujian,tafuzejiangCMakeLists.txtwenjianzhongdegoujianguizeheyilaiguanxi,zhuanhuanweitedinggoujiangongjukeyilijiedexingshi。CMakezhichiduozhongshengchengqi,keyishengchengMakefilewenjian,yekeyishengchengNinjagoujianwenjian,huozheVisual Studioxiangmuwenjiandeng。xuanzeshengchengqidefangshitongchangshizaiyunxingCMakeminglingshi,tongguo-Gxuanxiangzhiding。liru,ruguonixiangshengchengUnixfenggedeMakefilewenjian,keyishiyong"Unix Makefiles"shengchengqi,minglingruxia:cmake -G "Unix Makefiles"ruguomeiyouzhidingshengchengqi,CMakehuixuanzeyigemorendeshengchengqi,zhegemorendeshengchengqitongchangshigenjunidexitonghuanjingzidongxuanzede。2、shengchengMakefilexuanzehaoshengchengqizhihou,CMakejiuhuikaishishengchengMakefilewenjian。zaizhegeguochengzhong,CMakehuibianlixiangmuzhongdemeigemulu(baokuozimulu),duimeigemuluzhongdeCMakeLists.txtwenjianjinxingchuli。duiyumeigeCMakeLists.txtwenjian,CMakehuijiexiqizhongdemingling,genjuzhexieminglingdingyidegoujianguizeheyilaiguanxi,shengchengduiyingdeMakefilewenjian。meigeCMakeLists.txtwenjianduhuishengchengyigeMakefilewenjian,zhegeMakefilewenjianzhongbaohanliaobianyihelianjiegaimuluzhongdemubiaowenjiansuoxuyaodeguizehemingling。zaishengchengMakefilewenjianshi,CMakehuizidongchulimubiaowenjianzhijiandeyilaiguanxi。ruguoyigemubiaowenjianyilaiyuqitamubiaowenjian,CMakehuizaishengchengdeMakefilewenjianzhong,weizhegemubiaowenjiantianjiaxiangyingdeyilaiguize。yishangjiushiCMakeruheshengchengMakefiledeguocheng。lijieliaozhegeguocheng,womenjiukeyigenghaodilijieCMakegoujianguochengzhongdeguanjianbuzhou,yijiCMakeyuMakefilezhijiandeguanxiliao。3.3 CMakegoujianguochengzhongdeguanjianbuzhou(Key Steps in the CMake Build Process)CMakegoujianguochengzhongdeguanjianbuzhouzhuyaobaokuoyixiajigefangmian:1、jiexiCMakeLists.txtwenjian(Parsing CMakeLists.txt Files)zheshiCMakegoujianguochengdediyibu,yeshizuiguanjiandeyibu。CMakeLists.txtwenjianshiCMakedehexin,tadingyiliaoxiangmudegoujianguizeheyilaiguanxi。CMakexuyaojiexizhegewenjian,yihuoqugoujianxiangmusuoxudesuoyouxinxi。2、jianchaxitonghuanjing(Checking System Environment)zaiCMakeLists.txtwenjianzhong,tongchanghuibaohanyixiejianchaxitonghuanjingdemingling,lirujianchabianyiqi、kudeng。zhexieminglingzaiCMakegoujianguochengzhonghuibeizhixing,yiquebaoxitonghuanjingmanzuxiangmudegoujianxuqiu。3、shengchenggoujianwenjian(Generating Build Files)CMakedezhuyaorenwushishengchenggoujianwenjian,zhexiegoujianwenjiantongchangshiMakefilewenjian,danyekeyishiqitaleixingdegoujianwenjian,liruNinjagoujianwenjian,huozheVisual Studioxiangmuwenjian,zhequjueyunixuanzedegoujiangongju。shengchenggoujianwenjiandeguochengshiCMakegoujianguochengzhongdeyigeguanjianbuzhou。4、zhixinggoujianmingling(Executing Build Commands)zaishengchengliaogoujianwenjianzhihou,jiukeyikaishizhixinggoujianminglingliao。zhexiegoujianminglingtongchangshiyougoujiangongju(liruMake、NinjahuoVisual Studio)zhixingde。goujiangongjuhuigenjugoujianwenjianzhongdingyideguizehemingling,bianyiyuandaimabinglianjieshengchengmubiaowenjian。yishangjiushiCMakegoujianguochengzhongdeguanjianbuzhou。lijieliaozhexiebuzhou,womenjiukeyigenghaodilijieCMakedegongzuoyuanli,yijiruheshiyongCMakejinxingxiangmugoujianliao。si、CMakezaifuzaxiangmuzhongdeyingyong(Application of CMake in Complex Projects)4.1 fuzaxiangmuzhongdeCMakegoujiancelue(CMake Build Strategy in Complex Projects)zaifuzadexiangmuzhong,CMakedegoujianceluexuyaogengjiajingxihezhouquan。womenxuyaokaolvdaoxiangmudemokuaihua,yilaiguanxi,yijikenengcunzaidepingtaichayi。yixiashiyixiezaifuzaxiangmuzhongshiyongCMakedeceluehejianyi。4.1.1 mokuaihuadeCMakeLists.txt(Modularized CMakeLists.txt)zaidaxingxiangmuzhong,womentongchanghuikandaoxiangmubeihuafenweiduogemokuaihuozixiangmu,meigemokuaiduyouzijideyuandaimaheyilai。zhezhongqingkuangxia,womenkeyiweimeigemokuaichuangjianyigeCMakeLists.txtwenjian,zheyangkeyishigoujianguochenggengjiaqingxi,yefangbianwomenguanlimeigemokuaidegoujianguize。liru,womenkeyizaimeigemokuaidemuluxiachuangjianyigeCMakeLists.txtwenjian,ranhouzaixiangmudedingjimuluxiadeCMakeLists.txtwenjianzhongshiyongadd_subdirectory()minglinglaitianjiazhexiemokuai。4.1.2 guanliyilaiguanxi(Managing Dependencies)zaifuzadexiangmuzhong,butongdemokuaikenenghuiyougezhongyilaiguanxi。CMaketigongliaoyixieminglinglaibangzhuwomenguanlizhexieyilaiguanxi,lirutarget_link_libraries()minglingkeyiyonglaizhidingyigemubiaoxuyaolianjiedeku。zaichuliyilaiguanxishi,womenxuyaozhuyideyigezhongyaoyuanzeshi:jinliangrangyilaiguanximingquehezhiguan。zheyiweizhuo,ruguoyigemokuaiAyilaiyumokuaiB,namezaimokuaiAdeCMakeLists.txtwenjianzhong,womenyinggaimingquedizhichuzhegeyilaiguanxi。4.1.3 chulipingtaichayi(Handling Platform Differences)zaikuapingtaidexiangmuzhong,womenkenengxuyaochulibutongpingtaidechayi。CMaketigongliaoyixiebianliangheminglinglaibangzhuwomenchulizhexiechayi,liruCMAKE_SYSTEM_NAMEbianliangkeyiyonglaijiancedangqiandecaozuoxitong,if()minglingkeyiyonglaigenjubutongdetiaojianzhixingbutongdemingling。zaichulipingtaichayishi,womenyinggaijinliangbimianyingbianmatedingpingtaidexinxi。xiangfan,womenyinggaijinkenengdishiyongCMaketigongdebianlianghemingling,zheyangkeyishiwomendeCMakeLists.txtwenjiangengjiatongyonghekeweihu。yishangjiushizaifuzaxiangmuzhongshiyongCMakedeyixieceluehejianyi。zaishijiyingyongzhong,womenhuanxuyaogenjuxiangmudejutiqingkuanghexuqiulaidiaozhengheyouhuawomendeCMakegoujiancelue。4.1.4 shiyongxiandaiCMakemingling(Using Modern CMake Commands)xiandaideCMakebanbentigongliaoyixiexindeminglinghetexing,zhexieminglinghetexingkeyishiwomendeCMakeLists.txtwenjiangengjiajianjieheyiyulijie。liru,target_include_directories()minglingkeyiyonglaizhidingyigemubiaodetouwenjiansousuolujing,zhebishiyongjiudeinclude_directories()minglinggengjialinghuohezhiguan。zaishiyongxiandaiCMakeminglingshi,womenxuyaozhuyideyigezhongyaoyuanzeshi:jinliangshiyongmubiaoshuxing(target properties)erbushiquanjubianliang(global variables)。zheshiyinweimubiaoshuxingkeyishiwomendeCMakeLists.txtwenjiangengjiamokuaihua,yegengrongyilijieheweihu。4.1.5 liyongCMakedejiaobengongneng(Leveraging CMake’s Scripting Capabilities)CMakebujinshiyigegoujiangongju,tayeshiyizhongjiaobenyuyan。womenkeyiliyongCMakedejiaobengongnenglaishixianyixiefuzadegoujianluoji,liru,womenkeyishiyongif()、foreach()dengminglinglaibianxiexunhuanhetiaojianyuju。zaishiyongCMakedejiaobengongnengshi,womenxuyaozhuyideyigezhongyaoyuanzeshi:jinliangbimianguodufuzadejiaobenluoji。guodufuzadejiaobenluojikenenghuishiwomendeCMakeLists.txtwenjiannanyilijieheweihu。xiangfan,womenyinggaijinkenengdishiyongCMaketigongdeminglinghetexing,zheyangkeyishiwomendeCMakeLists.txtwenjiangengjiajianjieheyiyulijie。yishangjiushizaifuzaxiangmuzhongshiyongCMakedeyixieceluehejianyi。zaishijiyingyongzhong,womenhuanxuyaogenjuxiangmudejutiqingkuanghexuqiulaidiaozhengheyouhuawomendeCMakegoujiancelue。4.2 duogeCMakeLists.txtzaifuzaxiangmuzhongdeguanli(Management of Multiple CMakeLists.txt in Complex Projects)zaidaxingdefuzaxiangmuzhong,womentongchanghuiyouduogeCMakeLists.txtwenjian,meigezimuluxiadukenengyouyige。zhexieCMakeLists.txtwenjiangongtongdingyiliaozhenggexiangmudegoujianguize。guanlizhexieCMakeLists.txtwenjianshiyigezhongyaoderenwu,yixiashiyixieceluehejianyi。4.2.1 mokuaihuaguanli(Modular Management)meigeCMakeLists.txtwenjianyinggaizhifuzeguanliqisuozaimuluxiadeyuandaimaheyilai。zheyangkeyishimeigeCMakeLists.txtwenjiandeneirongbaochijianjie,yefangbianwomenlijieheweihumeigemokuaidegoujianguize。4.2.2 tongyidegoujianguize(Unified Build Rules)jinguanmeigeCMakeLists.txtwenjianduyouqizijidegoujianguize,danwomenyinggaijinliangshizhexiegoujianguizebaochiyizhi。zheyangkeyishiwomendegoujianguochenggengjiakeyuce,yefangbianwomenguanliheweihuwomendegoujianguize。4.2.3 liyongCMakedebaoguanligongneng(Leveraging CMake’s Package Management Features)CMaketigongliaoyixieminglinghetexinglaibangzhuwomenguanlixiangmudeyilai,lirufind_package()minglingkeyiyonglaichazhaohejiazaiwaibuku。womenyinggaijinliangliyongzhexieminglinghetexing,zheyangkeyishiwomendeCMakeLists.txtwenjiangengjiajianjie,yekeyibimianyixiechangjiandeyilaiwenti。4.2.4 bimianyingbianmalujing(Avoid Hard-Coded Paths)zaiCMakeLists.txtwenjianzhong,womenyinggaijinliangbimianyingbianmalujing。yingbianmadelujingkenenghuishiwomendegoujianguochengyilaiyutedingdemulujiegou,zhehuijiangdiwomendegoujianguizedekeyizhixing。xiangfan,womenyinggaijinkenengdishiyongCMaketigongdebianliangheminglinglaizhidinglujing,zheyangkeyishiwomendeCMakeLists.txtwenjiangengjiatongyonghekeweihu。yishangjiushizaifuzaxiangmuzhongguanliduogeCMakeLists.txtwenjiandeyixieceluehejianyi。zaishijiyingyongzhong,womenhuanxuyaogenjuxiangmudejutiqingkuanghexuqiulaidiaozhengheyouhuawomendeguanlicelue。4.3 CMakezaidaxingxiangmuzhongdezuijiashijian(Best Practices of CMake in Large Projects)zaidaxingxiangmuzhongshiyongCMake,womenxuyaozunxunyixiezuijiashijian,yiquebaogoujianguochengdegaoxiao、wendinghekeweihu。yixiashiyixiezaidaxingxiangmuzhongshiyongCMakedezuijiashijian。4.3.1 shiyongzuixinbanbendeCMake(Use the Latest Version of CMake)jinkenengshiyongzuixinbanbendeCMake。xinbanbendeCMaketongchanghuibaohanyixiexindetexinghegaijin,zhexietexinghegaijinkenenghuishiwomendegoujianguochenggengjiagaoxiaohewending。ciwai,xinbanbendeCMakeyekenenghuixiufuyixiejiubanbenzhongdewentihequexian。4.3.2 bimianzaiCMakeLists.txtwenjianzhongxiugaibianyiqibiaozhi(Avoid Modifying Compiler Flags in CMakeLists.txt Files)zaiCMakeLists.txtwenjianzhongzhijiexiugaibianyiqibiaozhikenenghuidaozhiyixiewenti。liru,zhekenenghuifugaiyonghuzaiminglingxingzhongzhidingdebianyiqibiaozhi,huozhedaozhizaibutongpingtaishangdegoujianxingweibuyizhi。xiangfan,womenyinggaishiyongCMaketigongdeminglinghetexinglaiguanlibianyiqibiaozhi,lirutarget_compile_options()mingling。4.3.3 shiyongCMakedeceshigongneng(Use CMake’s Testing Features)CMaketigongliaoyixieminglinghetexinglaibangzhuwomenguanliheyunxingceshi,liruenable_testing()minglingheadd_test()mingling。womenyinggaijinliangliyongzhexieminglinghetexing,zheyangkeyishiwomendeceshiguochenggengjiazidonghuahekekong。4.3.4 shiyongCMakedeanzhuanggongneng(Use CMake’s Installation Features)CMaketigongliaoyixieminglinghetexinglaibangzhuwomenguanlixiangmudeanzhuangguocheng,liruinstall()mingling。womenyinggaijinliangliyongzhexieminglinghetexing,zheyangkeyishiwomendeanzhuangguochenggengjiazidonghuahekekong。yishangjiushizaidaxingxiangmuzhongshiyongCMakedeyixiezuijiashijian。zaishijiyingyongzhong,womenhuanxuyaogenjuxiangmudejutiqingkuanghexuqiulaidiaozhengheyouhuawomendegoujianguocheng。wu、CMakeshengchengdeMakefilexiangjie5.1 CMakeruhefanyishengchengMakefilezaishenrulijieCMakeruhefanyishengchengMakefilezhiqian,womenshouxianlaikanyixiaCMakeyuMakefiledeguanxi。ruxiatusuoshi,CMaketongguojiexiCMakeLists.txtwenjian,shengchengduiyingdeMakefile,ranhouzhixingMakefilejinxingbianyilianjie,zuihoushengchengkezhixingwenjian。CMakedezhuyaogongzuojiushijiexiCMakeLists.txtwenjian,bingjiangqifanyichengMakefile。CMakeLists.txtwenjianshiCMakedehexin,tadingyiliaoxiangmudegoujianguize,baokuoxiangmudemulujiegou、xuyaobianyideyuanwenjian、yilaiguanxi、bianyicanshudengxinxi。CMaketongguoduquCMakeLists.txtwenjian,lijiezhexiegoujianguize,ranhoushengchengduiyingdeMakefile。zaishengchengMakefiledeguochengzhong,CMakehuijinxingyixiliedefanyicaozuo。zhexiecaozuozhuyaobaokuo:jiexiCMakeLists.txtwenjian:CMakeshouxianhuiduquCMakeLists.txtwenjian,jiexiqizhongdeminglinghecanshu,lijiexiangmudegoujianguize。shengchengMakefile:genjujiexidedaodegoujianguize,CMakehuishengchengduiyingdeMakefile。zhegeMakefilebaohanliaosuoyoudebianyilianjiemingling,yijiyuanwenjianhemubiaowenjianzhijiandeyilaiguanxi。chuliyilaiguanxi:zaishengchengMakefiledeguochengzhong,CMakehuichuliyuanwenjianzhijiandeyilaiguanxi。ruguoyigeyuanwenjianyilaiyulingyigeyuanwenjian,namezaiMakefilezhong,zhegeyuanwenjiandebianyiminglingjiuhuiyilaiyulingyigeyuanwenjiandebianyimingling。shezhibianyicanshu:CMakehuanhuishezhiMakefilezhongdebianyicanshu,baokuobianyiqixuanxiang、lianjieqixuanxiangdeng。zhexiecanshuhuiyingxiangdaobianyilianjiedeguocheng。yishangjiushiCMakeruhefanyishengchengMakefiledejibenguocheng。zaihouxudexiaojiezhong,womenjiangshenrutantaoMakefiledexiangxijiegouheyuanli,yijiruhezaiCMakezhongshiyongwaibuMakefiledenggaojihuati。5.2 MakefiledexiangxijiexiMakefileshiyoumakegongjuzhixingdeyizhongjiaobenwenjian,tamiaoshuliaoyizumubiao(target)yijigoujianzhexiemubiaosuoxudeguize(rule)。zaiCMakeshengchengdeMakefilezhong,meiyigemubiaotongchangduiyingyigehuoduogeyuanwenjian,erguizezemiaoshuliaoruhecongzhexieyuanwenjianshengchengmubiao。yixiashiyigejiandandeMakefileshili:all: hellohello: main.o function.o g++ main.o function.o -o hellomain.o: main.cpp g++ -c main.cppfunction.o: function.cpp g++ -c function.cppclean: rm *.o hellozaizhegeshilizhong,all、hello、main.o、function.ohecleandushimubiao,ermeigemubiaohoumiandeneirongzeshigoujiangaimubiaodeguize。liru,hellomubiaodeguizeshig++ main.o function.o -o hello,zhetiaoguizegaosumakegongjuruhecongmain.ohefunction.ozhelianggeyuanwenjianshengchenghellozhegemubiao。zaiCMakeshengchengdeMakefilezhong,zhexieguizehuigengjiafuza,yinweitamenxuyaochulixiangmuzhongdeyilaiguanxi、bianyicanshudengwenti。danshi,jibendejiegouheyuanlishixiangtongde:meigemubiaoduyouyizuguize,zhexieguizemiaoshuliaoruhecongyuanwenjianshengchengmubiao。5.3 CMakeruhefanyishengchengMakefiledangrankeyi,rangwomengengshenruditantaoyixieCMakeminglingheshengchengdeMakefilezhijiandeguanxi。add_executable:zhegeminglingzaiCMakezhongyongyudingyiyigemubiaokezhixingwenjian。liru,add_executable(hello main.cpp)huidingyiyigemingweihellodemubiao,zhegemubiaoyoumain.cppzhegeyuanwenjianshengcheng。zaishengchengdeMakefilezhong,zhegeminglinghuibeifanyichengyigebianyimingling,ru$(CXX) $(CXXFLAGS) -o hello main.cpp。zhetiaominglinggaosumakegongjushiyongC++bianyiqi(( C X X ) )hebianyixuanxiang( (CXX))hebianyixuanxiang((CXX))hebianyixuanxiang((CXXFLAGS))laibianyimain.cpp,bingjiangshuchuwenjianmingmingweihello。add_library:zhegeminglingzaiCMakezhongyongyudingyiyigemubiaokuwenjian。liru,add_library(mylib mylib.cpp)huidingyiyigemingweimylibdemubiao,zhegemubiaoyoumylib.cppzhegeyuanwenjianshengcheng。zaishengchengdeMakefilezhong,zhegeminglinghuibeifanyichengyigekushengchengmingling,ru$(AR) $(ARFLAGS) mylib mylib.cpp。zhetiaominglinggaosumakegongjushiyongkushengchengqi(( A R ) )hekushengchengxuanxiang( (AR))hekushengchengxuanxiang((AR))hekushengchengxuanxiang((ARFLAGS))laishengchengmylibzhegeku。target_link_libraries:zhegeminglingzaiCMakezhongyongyudingyimubiaodelianjieku。liru,target_link_libraries(hello mylib)huigaosuCMake,hellozhegemubiaoxuyaolianjiemylibzhegeku。zaishengchengdeMakefilezhong,zhegeminglinghuibeifanyichengyigelianjiemingling,ru$(CXX) $(LDFLAGS) -o hello main.cpp -lmylib。zhetiaominglinggaosumakegongjuzailianjiehelloshi,xuyaolianjiemylibzhegeku。yishangjiushiCMakeminglingheshengchengdeMakefilezhijiandeyixiejibenguanxi。zaishijidexiangmuzhong,zhexieguanxikenenghuigengfuza,yinweiCMakeheMakefiledushifeichangqiangdadegongju,tamentigongliaoxuduogaojigongnenglaichulixiangmuzhongdegezhongwenti。danshi,lijiezhexiejibenguanxishilijieCMakeheMakefiledeguanjian。5.4 CMakeshengchengdeMakefilezhongdechangjianwentijijiejuefanganzaishiyongCMakeshengchengMakefiledeguochengzhong,kenenghuiyudaoyixiechangjiandewenti。zhexiewentikenengshejidaoMakefiledeshengcheng、zhixing、yijiyilaiguanxidechulidengfangmian。xiamianwomenjiangxiangxijieshaozhexiewenti,yijixiangyingdejiejuefangan。Makefileshengchengshibai:zheshiyigebijiaochangjiandewenti,tongchangshiyouyuCMakeLists.txtwenjianzhongdecuowudaozhide。jiejuezhegewentidefangfashijianchaCMakeLists.txtwenjian,quebaoqizhongdeminglinghecanshudushizhengquede。Makefilezhixingcuowu:zhegewentitongchangshiyouyuMakefilezhongdeminglingcuowudaozhide。jiejuezhegewentidefangfashijianchaMakefile,quebaoqizhongdebianyilianjieminglingdushizhengquede。yilaiguanxichulicuowu:zhegewentitongchangshiyouyuCMakechuliyuanwenjianzhijiandeyilaiguanxishichucuodaozhide。jiejuezhegewentidefangfashijianchaCMakeLists.txtwenjian,quebaoqizhongdeyilaiguanxidushizhengquede。yishangjiushizaishiyongCMakeshengchengMakefileshikenengyudaodeyixiechangjianwenti,yijixiangyingdejiejuefangan。zaishijishiyongzhong,kenenghuanhuiyudaoqitadewenti,zheshihouxuyaogenjujutidecuowuxinxi,jinxingxiangyingdepaichahejiejue。liu、CMakeyuwaibuMakefiledejiaohu(Interaction Between CMake and External Makefile)6.1 ruhezaiCMakezhongshiyongwaibuMakefile(How to Use External Makefile in CMake)zaiCMakezhongshiyongwaibuMakefile,womenkeyishiyongadd_custom_commandheadd_custom_targetzhelianggemingling。zhelianggeminglingkeyiyonglaizhixingyixiezidingyidegoujianguize,biruyunxingyigejiaoben,chuangjianyigewenjian,huozheyunxingyigeMakefile。6.1.1 add_custom_commandadd_custom_commandminglingyongyudingyiruheshengchengyigewenjian。zhegeminglingyouhenduocanshu,danshizuichangyongdeshiOUTPUT,COMMANDheDEPENDS。OUTPUTcanshuyongyuzhidingshengchengdewenjian。COMMANDcanshuyongyuzhidingshengchengwenjiandemingling,keyishirenheshellmingling。DEPENDScanshuyongyuzhidingshengchengwenjiansuoyilaidewenjian。liru,womenkeyishiyongyixiaminglinglaiyunxingyigewaibuMakefile:add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_file COMMAND make -C ${CMAKE_CURRENT_SOURCE_DIR}/external_project DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/external_project/Makefile)zhegeminglingbiaoshi,ruguogenerated_filebucunzai,huozheexternal_project/Makefileyourenhegaidong,namejiuhuizhixingmake -C external_projectminglinglaishengchenggenerated_file。6.1.2 add_custom_targetraner,add_custom_commandzhiyouzaiqishuchuwenjianbeiqitamubiaoshiyongshi,caihuibeizhixing。ruguowomenxiangyaozaimeicigoujianshiduzhixingmougemingling,namewomenxuyaoshiyongadd_custom_targetmingling。add_custom_targetminglingyongyudingyiyigezidingyidemubiao。zhegemubiaobuhuishengchengrenhewenjian,yebuhuizaigoujianshizidongbeizhixing。womenxuyaoshoudongzhixingzhegemubiao,huozhejiangtatianjiaweiqitamubiaodeyilai。liru,womenkeyishiyongyixiaminglinglaidingyiyigeyunxingwaibuMakefiledemubiao:add_custom_target( run_external_makefile COMMAND make -C ${CMAKE_CURRENT_SOURCE_DIR}/external_project)zhegeminglingdingyiliaoyigemingweirun_external_makefiledemubiao。womenkeyishiyongmake run_external_makefileminglinglaishoudongzhixingzhegemubiao。ruguowomenxiangyaozaimeicigoujianshiduzhixingzhegemubiao,namewomenkeyijiangtatianjiaweiqitamubiaodeyilai。liru,womenkeyishiyongyixiaminglinglaijiangrun_external_makefiletianjiaweimy_targetdeyilai:add_dependencies(my_target run_external_makefile)zheyang,meicigoujianmy_targetshi,duhuixianzhixingrun_external_makefilemubiao。yishangjiushiruhezaiCMakezhongshiyongwaibuMakefiledejibenfangfa。zaishijishiyongzhong,womenkenengxuyaogenjujutidexuqiulaidiaozhengzhexieminglingdecanshu。6.1.3 add_custom_commanddeqitacanshuchuliaoOUTPUT,COMMANDheDEPENDScanshuwai,add_custom_commandminglinghuanyouyixieqitadecanshu,keyiyonglaikongzhiminglingdexingwei。WORKING_DIRECTORYcanshuyongyuzhidingminglingdegongzuomulu。ruguobuzhidingzhegecanshu,nameminglingdegongzuomulujiushidangqiandegoujianmulu。COMMENTcanshuyongyuzhidingyigezhushi,zhegezhushihuizaiminglingzhixingshixianshizaikongzhitaishang。VERBATIMcanshuyongyukongzhiminglingdecanshushifouxuyaozhuanyi。ruguoshezhiweiTRUE,nameminglingdecanshujiuhuibeizhuanyi,zheyangjiukeyianquandichulibaohanteshuzifudecanshu。liru,womenkeyishiyongyixiaminglinglaiyunxingyigewaibuMakefile,bingxianshiyigezhushi:add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated_file COMMAND make -C ${CMAKE_CURRENT_SOURCE_DIR}/external_project DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/external_project/Makefile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMENT "Running external Makefile" VERBATIM)zhegeminglingbiaoshi,ruguogenerated_filebucunzai,huozheexternal_project/Makefileyourenhegaidong,namejiuhuizai${CMAKE_CURRENT_BINARY_DIR}muluxiazhixingmake -C external_projectminglinglaishengchenggenerated_file,bingxianshi"Running external Makefile"dezhushi。yishangjiushizaiCMakezhongshiyongwaibuMakefiledejibenfangfa。zaishijishiyongzhong,womenkenengxuyaogenjujutidexuqiulaidiaozhengzhexieminglingdecanshu。6.2 waibuMakefileruheyingxiangCMakeshengchengdeMakefile(How External Makefile Affects Makefile Generated by CMake)zaiCMakezhong,womenkeyitongguoadd_custom_commandhuoadd_custom_targetminglinglaicharuwaibuMakefile,congeryingxiangCMakeshengchengdeMakefile。xiamianshizhegeguochengdeshiyitu:bianjitianjiatupianzhushi,buchaoguo 140 zi(kexuan)zaizhegeguochengzhong,CMakeshouxianjiexiCMakeLists.txtwenjian,shengchengCMakeCache.txtwenjian。ranhou,CMakegenjuCMakeCache.txtwenjianshengchengMakefile。zaishengchengMakefiledeguochengzhong,CMakehuizhixingadd_custom_commandhuoadd_custom_targetmingling,charuwaibuMakefile。charuwaibuMakefiledezhuyaomudeshiweiliaozengjiayixiezidingyidegoujianguize。liru,womenkenengxuyaozaigoujianguochengzhongzhixingyixieteshudemingling,huozheshengchengyixieteshudewenjian。tongguocharuwaibuMakefile,womenkeyizaiCMakedegoujianguochengzhongzhixingzhexiezidingyidegoujianguize。raner,charuwaibuMakefileyekenenghuidailaiyixiewenti。liru,ruguowaibuMakefilezhongdegoujianguizeyuCMakeshengchengdegoujianguizechongtu,namekenenghuidaozhigoujianshibai。yinci,zaicharuwaibuMakefileshi,womenxuyaoquebaowaibuMakefilezhongdegoujianguizeyuCMakeshengchengdegoujianguizeshijianrongde。zaishijishiyongzhong,womenkenengxuyaogenjujutidexuqiulaidiaozhengcharuwaibuMakefiledefangshi。liru,womenkeyitongguoxiugaiadd_custom_commandhuoadd_custom_targetminglingdecanshu,laikongzhiwaibuMakefiledecharuweizhi,huozhekongzhiwaibuMakefiledezhixingfangshi。6.3 gaojijiqiao:ziyoukongzhiCMakeshengchengguize(Advanced Techniques: Freely Control CMake Generation Rules)CMaketigongliaoyixiliedemingling,keyiyonglaiziyoukongzhishengchengguize。zhexieminglingkeyiyonglaidingyizidingyidemubiao,tianjiayilaiguanxi,shezhibianyixuanxiang,dengdeng。xiamianwomenjiangjieshaoyixiegaojidejiqiao,keyibangzhunigenghaodikongzhiCMakedeshengchengguize。6.3.1 zidingyimubiao(Custom Targets)zaiCMakezhong,womenkeyishiyongadd_custom_targetminglinglaidingyiyigezidingyidemubiao。zhegemubiaobuhuishengchengrenhewenjian,yebuhuizaigoujianshizidongbeizhixing。womenxuyaoshoudongzhixingzhegemubiao,huozhejiangtatianjiaweiqitamubiaodeyilai。liru,womenkeyishiyongyixiaminglinglaidingyiyigeyunxingwaibuMakefiledemubiao:add_custom_target( run_external_makefile COMMAND make -C ${CMAKE_CURRENT_SOURCE_DIR}/external_project)zhegeminglingdingyiliaoyigemingweirun_external_makefiledemubiao。womenkeyishiyongmake run_external_makefileminglinglaishoudongzhixingzhegemubiao。6.3.2 tianjiayilaiguanxi(Adding Dependencies)zaiCMakezhong,womenkeyishiyongadd_dependenciesminglinglaitianjiamubiaozhijiandeyilaiguanxi。zhegeminglingjieshoulianggehuogengduodecanshu,diyigecanshushimubiao,houmiandecanshushitasuoyilaidemubiao。liru,womenkeyishiyongyixiaminglinglaijiangrun_external_makefiletianjiaweimy_targetdeyilai:add_dependencies(my_target run_external_makefile)zheyang,meicigoujianmy_targetshi,duhuixianzhixingrun_external_makefilemubiao。6.3.3 shezhibianyixuanxiang(Setting Compilation Options)zaiCMakezhong,womenkeyishiyongtarget_compile_optionsminglinglaishezhimubiaodebianyixuanxiang。zhegeminglingjieshoulianggecanshu,diyigecanshushimubiao,diergecanshushibianyixuanxiang。liru,womenkeyishiyongyixiaminglinglaiweimy_targetshezhibianyixuanxiang:target_compile_options(my_target PRIVATE -Wall -Wextra)zhegeminglinghuiweimy_targettianjia-Wallhe-Wextrazhelianggebianyixuanxiang。yishangjiushizaiCMakezhongziyoukongzhishengchengguizedeyixiegaojijiqiao。zaishijishiyongzhong,womenkenengxuyaogenjujutidexuqiulaidiaozhengzhexieminglingdecanshu。wangmeilizeciaidikanzhuoerxi,"fangfang,zhenshimafanniliao。"

采(颁补颈)购(骋辞耻)材(颁补颈)料(尝颈补辞)也(驰别)是(厂丑颈)问(奥别苍)题(罢颈)。图(罢耻)纸(窜丑颈)是(厂丑颈)定(顿颈苍驳)制(窜丑颈)的(顿别),没(惭别颈)有(驰辞耻)现(齿颈补苍)成(颁丑别苍驳)的(顿别)零(尝颈苍驳)件(闯颈补苍)可(碍别)以(驰颈)用(驰辞苍驳),朱(窜丑耻)士(厂丑颈)全(蚕耻补苍)只(窜丑颈)能(狈别苍驳)到(顿补辞)加(闯颈补)工(骋辞苍驳)厂(颁丑补苍驳)里(尝颈)请(蚕颈苍驳)别(叠颈别)人(搁别苍)加(闯颈补)工(骋辞苍驳)。定(顿颈苍驳)制(窜丑颈)的(顿别)量(尝颈补苍驳)少(厂丑补辞),工(骋辞苍驳)厂(颁丑补苍驳)不(叠耻)愿(驰耻补苍)承(颁丑别苍驳)接(闯颈别),他(罢补)就(闯颈耻)一(驰颈)家(闯颈补)家(闯颈补)跑(笔补辞)过(骋耻辞)去(蚕耻),花(贬耻补)了(尝颈补辞)好(贬补辞)长(颁丑补苍驳)时(厂丑颈)间(闯颈补苍),才(颁补颈)将(闯颈补苍驳)飞(贵别颈)机(闯颈)零(尝颈苍驳)部(叠耻)件(闯颈补苍)集(闯颈)齐(蚕颈)。

得知这一消息的降央卓玛既兴奋又紧张,因为她清楚自己不是小家碧玉的风格,不管是长相还是说话得声音,都像汉子一样哪家的家长会喜欢呢?夏季光照强烈91精选在线观看,91热爆在线精品,91夜夜人人揉人人捏人人添,国内...

其次就是内饰了别惫辞蝉的内饰一定离不开那块1.1米的大连屏将整车的内饰氛围提升了一个档次但是可惜的是这块大屏并没有使用8199的芯片这里个人感觉是有点可惜了不知道后期是否能够人工升级虽然没有采用8199的芯片但是在燃油车中智能化程度也算是不错的语音交互手势互动影音娱乐都能够满足但是不知道是不是芯片的问题语音交互有时候会显示网络故障或者就是识别错误手势互动也一样但是考虑到在燃油车中智能化的程度个人表示能够接受

发布于:兰溪市
声明:该文观点仅代表作者本人,搜狐号系信息发布平台,搜狐仅提供信息存储空间服务。
意见反馈 合作

Copyright ? 2023 Sohu All Rights Reserved

搜狐公司 版权所有