diff --git a/CMakeLists.txt b/CMakeLists.txt index 0588260..7375566 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.2) -project(bubbles C CXX) +project({{__NAME__}} C CXX) set(CXX_STANDARD 20) set(CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_FLAGS "-std=c++20") @@ -16,11 +16,11 @@ FetchContent_MakeAvailable(googletest) enable_testing() include_directories(src/) -add_executable(bubbles_test test/main.cpp) -target_link_libraries(bubbles_test gtest_main) +add_executable({{__NAME__}}_test test/main.cpp) +target_link_libraries({{__NAME__}}_test gtest_main) include(GoogleTest) -gtest_discover_tests(bubbles_test) +gtest_discover_tests({{__NAME__}}_test) find_package(Boost 1.76.0 COMPONENTS program_options REQUIRED) @@ -28,8 +28,8 @@ include_directories(${Boost_INCLUDE_DIR}) include_directories(include/) aux_source_directory(src/ SRC) -add_executable(bubbles ${SRC}) +add_executable({{__NAME__}} ${SRC}) -target_include_directories(bubbles PUBLIC include/) -target_include_directories(bubbles PUBLIC ${Boost_LIBRARIES}) +target_include_directories({{__NAME__}} PUBLIC include/) +target_include_directories({{__NAME__}} PUBLIC ${Boost_LIBRARIES}) diff --git a/README.md b/README.md index 8b08619..b77b4c1 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,27 @@ # Bubbles: A simple and expandable C++ project template with [Googletest](https://github.com/google/googletest) and [Boost](https://www.boost.org/) included. -## Initializing Project +## Setup -```bash -python3 initproject.py "project_name" +```console +$ git clone https://willdoescode/bubbles +$ pwd ``` -## Building && Testing +Copy pwd output to your [ctp](https://github.com/willdoescode/ctp) config. + +```toml +[templates] +cpp = "" -```bash -cmake -S . -B build +[commands-before] +[commands-after] +cpp = "rm .git" +``` + +## Building && Testing -cmake --build build +```console +$ cmake -S . -B build -./build/bubbles_test && ./build/bubbles +$ cmake --build build ``` diff --git a/initproject.py b/initproject.py deleted file mode 100644 index dc65e1e..0000000 --- a/initproject.py +++ /dev/null @@ -1,21 +0,0 @@ -import sys - -def main(args): - if not args: - print('Please enter a project name') - exit(1) - - if " " in args[0]: - print('Please remove spaces and special characters from the project name') - exit(1) - - with open('./CMakeLists.txt', 'r+') as f: - print(f'Changing project name to {args[0]}') - contents = f.read().replace('bubbles', args[0]) - f.seek(0) - f.write(contents) - f.truncate() - -if __name__ == '__main__': - main(sys.argv[1::]) -