Skip to content

Commit 134eca9

Browse files
committed
Make: Consistent binary paths
1 parent 41385b7 commit 134eca9

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.github/workflows/prerelease.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ jobs:
5959
cmake --build build_artifacts --config RelWithDebInfo
6060
- name: Test C++
6161
run: |
62-
build_artifacts/scripts/fork_union_test_cpp17
63-
build_artifacts/scripts/fork_union_test_cpp20
62+
build_artifacts/fork_union_test_cpp17
63+
build_artifacts/fork_union_test_cpp20
6464
6565
# Rust
6666
- name: Set up Rust
@@ -94,8 +94,8 @@ jobs:
9494
cmake --build build_artifacts --config RelWithDebInfo
9595
- name: Test C++
9696
run: |
97-
build_artifacts/scripts/fork_union_test_cpp17
98-
build_artifacts/scripts/fork_union_test_cpp20
97+
build_artifacts/fork_union_test_cpp17
98+
build_artifacts/fork_union_test_cpp20
9999
100100
# Rust
101101
- name: Set up Rust
@@ -125,8 +125,8 @@ jobs:
125125
cmake --build build_artifacts --config RelWithDebInfo
126126
- name: Test C++
127127
run: |
128-
build_artifacts/scripts/fork_union_test_cpp17
129-
build_artifacts/scripts/fork_union_test_cpp20
128+
build_artifacts/fork_union_test_cpp17
129+
build_artifacts/fork_union_test_cpp20
130130
131131
# Rust
132132
- name: Set up Rust
@@ -152,6 +152,8 @@ jobs:
152152
choco install cmake
153153
cmake -B build_artifacts -D CMAKE_BUILD_TYPE=RelWithDebInfo
154154
cmake --build build_artifacts --config RelWithDebInfo
155+
- name: List build artifacts
156+
run: Get-ChildItem -Recurse .\build_artifacts
155157
- name: Test C++
156158
run: |
157159
.\build_artifacts\fork_union_test_cpp17.exe

.vscode/launch.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"type": "cppdbg",
1010
"request": "launch",
1111
"preLaunchTask": "Build: Debug with GDB",
12-
"program": "${workspaceFolder}/build_debug/scripts/fork_union_test_cpp20",
12+
"program": "${workspaceFolder}/build_debug/fork_union_test_cpp20",
1313
"cwd": "${workspaceFolder}",
1414
"args": [],
1515
"setupCommands": [
@@ -49,7 +49,7 @@
4949
"type": "cppdbg",
5050
"request": "launch",
5151
"preLaunchTask": "Build: Debug with LLDB",
52-
"program": "${workspaceFolder}/build_debug/scripts/fork_union_test_cpp20",
52+
"program": "${workspaceFolder}/build_debug/fork_union_test_cpp20",
5353
"cwd": "${workspaceFolder}",
5454
"args": [],
5555
"setupCommands": [
@@ -78,7 +78,7 @@
7878
"type": "cppdbg",
7979
"request": "launch",
8080
"preLaunchTask": "Build: Debug with GDB",
81-
"program": "${workspaceFolder}/build_debug/scripts/fork_union_nbody",
81+
"program": "${workspaceFolder}/build_debug/fork_union_nbody",
8282
"cwd": "${workspaceFolder}",
8383
"args": [],
8484
"setupCommands": [

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ set_target_properties(
3434
target_link_libraries(fork_union_dynamic PUBLIC fork_union)
3535
target_link_libraries(fork_union_static PUBLIC fork_union)
3636

37+
# Set the output directory for all executables - on Windows requires more boilerplate:
38+
# https://stackoverflow.com/a/25328001
39+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
40+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
41+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
42+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR})
43+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR})
44+
3745
# Tests & benchmarking scripts
3846
include(CTest)
3947
if (BUILD_TESTING)

scripts/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ foreach (STD IN LISTS CXX_STANDARDS)
4848
PROPERTIES CXX_STANDARD ${STD}
4949
CXX_STANDARD_REQUIRED ON
5050
CXX_EXTENSIONS OFF
51+
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
5152
)
5253

5354
# register it as a CTest test
@@ -72,7 +73,6 @@ set_target_properties(
7273
PROPERTIES CXX_STANDARD 20
7374
CXX_STANDARD_REQUIRED ON
7475
CXX_EXTENSIONS OFF
75-
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}
7676
)
7777
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
7878
message(STATUS "Enabling OpenMP for fork_union_nbody on GCC")

0 commit comments

Comments
 (0)