Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/1010code/make-cpp-library-advance
Find and Link Libraries with CMake
https://github.com/1010code/make-cpp-library-advance
Last synced: 5 days ago
JSON representation
Find and Link Libraries with CMake
- Host: GitHub
- URL: https://github.com/1010code/make-cpp-library-advance
- Owner: 1010code
- Created: 2024-04-04T00:44:45.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2024-04-04T02:00:00.000Z (11 months ago)
- Last Synced: 2024-04-28T05:23:31.270Z (10 months ago)
- Language: CMake
- Homepage:
- Size: 645 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Find and Link Libraries with CMake
本教學將會學習到如何自己製作函式庫並使用 CMake 的 export 指令匯出庫安裝包,使可以在另一個 CMake c++ 專案中使用它。有兩中方法可以在外部專案使用到已寫好的庫,ch1會需要酷的原始碼一起編譯,ch2的方法是將庫先匯出安裝包並手動放在指定資料夾讓專案尋找並連結。- [ch1](./ch1/)方法是透過add_subdirectory將mylib庫與應用程式專案一起編譯。同時會將mylib輸出安裝靜態庫
- [ch2](./ch2/)會介紹如何使用find_package方式將已編譯好的靜態庫與其他專案連結。> 靜態庫和動態庫的構建可以先參考這一個repo教學[make-cpp-library](https://github.com/1010code/make-cpp-library)
## Reference
- [Simple find_package config file example](https://stackoverflow.com/questions/49857596/simple-find-package-config-file-example)