1
0

build: write binaries to bin folder

This commit is contained in:
mandlm 2023-10-22 12:58:19 +02:00
parent 49427ef8cd
commit 03756b0429
Signed by: mandlm
GPG Key ID: 4AA25D647AA54CC7
6 changed files with 12 additions and 5 deletions

3
.gitignore vendored
View File

@ -1,2 +1,3 @@
/build /.build
/.cache /.cache
/bin

View File

@ -21,7 +21,7 @@ repos:
hooks: hooks:
- id: clang-format - id: clang-format
- id: clang-tidy - id: clang-tidy
args: [-p=build] args: [-p=.build]
- repo: https://github.com/cheshirekow/cmake-format-precommit - repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.13 rev: v0.6.13

View File

@ -31,6 +31,12 @@ target_include_directories(
target_link_libraries(book_exercises PRIVATE chapter_02) 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) if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
add_subdirectory(tests) add_subdirectory(tests)
endif() endif()

View File

@ -1,3 +1,3 @@
#!/usr/bin/env sh #!/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

View File

@ -1,3 +1,3 @@
#!/usr/bin/env sh #!/usr/bin/env sh
cmake --build build cmake --build .build

View File

@ -1,3 +1,3 @@
#!/usr/bin/env sh #!/usr/bin/env sh
cmake --build build && cmake --build build --target test cmake --build .build && cmake --build .build --target test