diff --git a/.gitignore b/.gitignore index 65af97a..be9452d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -/build +/.build /.cache +/bin diff --git a/CMakeLists.txt b/CMakeLists.txt index 31c0d68..88fc91b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,12 @@ target_include_directories( target_link_libraries(book_exercises PRIVATE chapter_02) +set_target_properties( + book_exercises + PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin" + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin" + RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin") + if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) add_subdirectory(tests) endif() diff --git a/bootstrap.sh b/bootstrap.sh index abf65d4..ba2fa51 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -cmake -S . -B build -G Ninja -D CMAKE_EXPORT_COMPILE_COMMANDS=ON +cmake -S . -B .build -G Ninja -D CMAKE_EXPORT_COMPILE_COMMANDS=ON diff --git a/build.sh b/build.sh index 6479e4f..d26a5a3 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -cmake --build build +cmake --build .build diff --git a/test.sh b/test.sh index dd1e614..dd961ba 100755 --- a/test.sh +++ b/test.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -cmake --build build && cmake --build build --target test +cmake --build .build && cmake --build .build --target test