- CMake Simple Project Link
- CMake + Gtest (via Git Submodule) Link
- CMake + Boost Simple + GTest (via Git Submodule) Link*
- CMake + Boost Http Server Executable (via Git Submodule) Link*
- CMake + Gtest (via FetchContent)
'Link*' means popular project template.
- Google Test
git submodule add https://github.com/google/googletest.git third_party/googletest
git submodule update --init --recursive
- Boost
we noticed that we might need to download whole boost library to include just a subset of boost. We cd into boost and do
--init --recursive
to pull all the submodules inside boost.
git submodule add https://github.com/boostorg/boost.git third_party/boost
cd third_party/boost
git submodule update --init --recursive
# commit or stash your changes b
git submodule deinit -f third_party/googletest
rm -rf .git/modules/third_party/googletest
rm -rf third_party/googletest
git config --file=.gitmodules --remove-section submodule.third_party/googletest
git config --file=.git/config --remove-section submodule.third_party/googletest
git rm --cached third_party/googletest
rm -rf .git/modules/*
rm -rf third_party
rm -rf .gitmodules
- Remove Previous Build (You won't make use of incremental build)
rm -rf build
- Build
third_party
,src
andtest
.
mkdir build && cd build
cmake ..
make -j$(nproc --all)
- Run Unit Test
cd build
./unittest/VectorTest
- Run Executable
./build/src/HttpServer
🚀 Starting HTTP server on http://localhost:8080 ...
curl "http://localhost:8080/split?text=hi,there,test&delim=,"
["hi", "there", "test"]
Remove the .idea folder and reopen the CMake Project.