Skip to content

Commit 5179e4c

Browse files
committed
Set CMAKE_INSTALL_BINDIR if undefined
1 parent f2bb4fc commit 5179e4c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ if(NOT CMAKE_BUILD_TYPE)
2121
message(STATUS "Setting build type to '${CMAKE_BUILD_TYPE}' as none was specified.")
2222
endif()
2323

24+
if (NOT CMAKE_INSTALL_BINDIR)
25+
set(CMAKE_INSTALL_BINDIR bin)
26+
endif()
27+
2428
set(CMAKE_C_FLAGS "-Wall -Wextra --pedantic -Wno-strict-aliasing -Wno-variadic-macros")
2529
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG")
2630
set(CMAKE_C_FLAGS_RELEASE "-O2")
@@ -98,7 +102,7 @@ endif()
98102

99103
# INSTALL
100104

101-
install(TARGETS ${TARGET_NAME} DESTINATION bin)
105+
install(TARGETS ${TARGET_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
102106

103107
set(SERVICE_EXTRA_OPTIONS "")
104108
if(IS_DIRECTORY "/etc/munin/plugins" AND

0 commit comments

Comments
 (0)