cmake 執行步驟

2021-08-13 14:46:12 字數 839 閱讀 6951

在 linux 平台下使用 cmake 生成 makefile 並編譯的流程如下:

編寫 cmake 配置檔案 cmakelists.txt 。

執行命令cmake path或者ccmake path生成 makefile 

1。其中,path是 cmakelists.txt 所在的目錄。

使用make命令進行編譯。

1ccmakecmake的區別在於前者提供了乙個互動式的介面。

option(build_shared_libs "build shared instead of static library" off)

set(headers src/pugixml.hpp src/pugiconfig.hpp)

set(sources $ src/pugixml.cpp)

if(build_shared_libs)

add_library(pugixml shared $)

else()

add_library(pugixml static $)

endif()

option(build_shared_libs "build shared instead of static library" off)設定動態庫還是靜態庫的 flag

cmake 編寫步驟

最低cmake版本 cmake minimum required version 2.6 工程名 project websocket 新增頭檔案目錄 include directories include 源檔案目錄 aux source directory src dir srcs 頭檔案目錄 s...

CMake如何執行shell命令

我在cmake編譯後想執行一些特定的shell命令 執行 lcov收集 覆蓋報告等 我又不想寫到xx.sh的shell指令碼中,如何直接通過cmake執行shell命令呢?在網上翻江倒海了一下,找到了乙個老外寫的cmake指令碼,參考他,自己寫了下,終於實現了我的目標,主要是用add custom ...

ORACLE SQL執行步驟

以前理解的 oracle sql 的處理過程大致如下 1.運用hash演算法,得到乙個hash值,這個值可以通過v sqlarea.hash value 檢視 2.到shared pool 中的 library cache 中查詢是否有相同的hash值,如果存在,則無需硬解析,進行軟解析 3.如果s...