在 linux 平台下使用 cmake 生成 makefile 並編譯的流程如下:
編寫 cmake 配置檔案 cmakelists.txt 。
執行命令cmake path
或者ccmake path
生成 makefile
1。其中,path
是 cmakelists.txt 所在的目錄。
使用make
命令進行編譯。
1ccmake
和cmake
的區別在於前者提供了乙個互動式的介面。
option(build_shared_libs "build shared instead of static library" off)設定動態庫還是靜態庫的 flagoption(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()
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...