Skip to content

Commit 532ad06

Browse files
committed
build: allow adding a program prefix for ds2
This new option emulates `--program-prefix` from autotools. This is intended to help with installation of cross-compiled binaries for ds2.
1 parent 08816bd commit 532ad06

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ cmake_policy(SET CMP0054 NEW)
1414
project(DebugServer2
1515
LANGUAGES C CXX)
1616

17+
set(DS2_PROGRAM_PREFIX "" CACHE STRING "Prefix to apply to the ds2 binary")
18+
1719
set(CMAKE_CXX_STANDARD 17)
1820
set(CMAKE_CXX_EXTENSIONS NO)
1921
set(CMAKE_CXX_STANDARD_REQUIRED YES)
@@ -351,6 +353,9 @@ target_include_directories(ds2 PUBLIC
351353
Headers
352354
${CMAKE_CURRENT_BINARY_DIR}/Headers)
353355

356+
set_target_properties(ds2 PROPERTIES
357+
OUTPUT_NAME "${DS2_PROGRAM_PREFIX}ds2")
358+
354359
execute_process(COMMAND git rev-parse --short HEAD
355360
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
356361
OUTPUT_VARIABLE DS2_GIT_HASH

0 commit comments

Comments
 (0)