cmake_with_add_subdirectory
cmake_with_add_subdirectory copied to clipboard
How to use static library instead of source for the external directory.
I came across your stack overflow post and that got me here. First, thank you for putting it together it is amazing!
My follow-up question is how would the setup change if under external you had a precompiled third-party library with .a or .so files and an include directory with header files for the library? What would the CMakeLists.txt file look like with the following external directory structure?
Many thanks in advance!
.
├── CMakeLists.txt
├── external //We simulate that code is provided by an "external" library outside of src
│ ├── CMakeLists.txt
│ ├── libfoo.so
│ ├── include
│ └── foo-a.h
│ └── foo-b.h
├── src
│ ├── CMakeLists.txt
│ ├── evolution //propagates the system in a time step
│ │ ├── CMakeLists.txt
│ │ ├── evolution.cpp
│ │ └── evolution.hpp
│ ├── initial //produces the initial state
│ │ ├── CMakeLists.txt
│ │ ├── initial.cpp
│ │ └── initial.hpp
│ ├── io //contains a function to print a row
│ │ ├── CMakeLists.txt
│ │ ├── io.cpp
│ │ └── io.hpp
│ ├── main.cpp //the main function
│ └── parser //parses the command-line input
│ ├── CMakeLists.txt
│ ├── parser.cpp
│ └── parser.hpp
└── tests //contains two unit tests using the Catch2 library
├── catch.hpp
├── CMakeLists.txt
└── test.cpp