Skip to content

Commit

Permalink
Use GNUInstallDirs for controlling install destinations
Browse files Browse the repository at this point in the history
This allows proper control over install destinations, especially
when 'bin' has a different prefix than 'share', e.g.:
* /usr/x86_64-pc-linux-gnu/bin/
* /usr/share
  • Loading branch information
hasufell committed May 24, 2016
1 parent aecd4bd commit 93137c8
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ project(BADVPN C)

set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")

include(GNUInstallDirs)
include(TestBigEndian)
include(CheckIncludeFiles)
include(CheckSymbolExists)
Expand Down Expand Up @@ -243,7 +244,7 @@ endif ()
# install man pages
install(
FILES badvpn.7
DESTINATION share/man/man7
DESTINATION ${CMAKE_INSTALL_MANDIR}/man7
)

# reset variables indicating whether we're building various libraries,
Expand Down
4 changes: 2 additions & 2 deletions client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ target_link_libraries(badvpn-client system flow flowextra tuntap server_conectio

install(
TARGETS badvpn-client
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(
FILES badvpn-client.8
DESTINATION share/man/man8
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8
)
2 changes: 1 addition & 1 deletion flooder/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ target_link_libraries(badvpn-flooder system flow server_conection ${NSPR_LIBRARI

install(
TARGETS badvpn-flooder
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
2 changes: 1 addition & 1 deletion ncd-request/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ target_link_libraries(badvpn-ncd-request ncdrequest ncdvalgenerator ncdvalparser

install(
TARGETS badvpn-ncd-request
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
2 changes: 1 addition & 1 deletion ncd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ if (NOT EMSCRIPTEN)

install(
TARGETS badvpn-ncd
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
endif ()

Expand Down
4 changes: 2 additions & 2 deletions server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ target_link_libraries(badvpn-server system flow flowextra nspr_support predicate

install(
TARGETS badvpn-server
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(
FILES badvpn-server.8
DESTINATION share/man/man8
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8
)
4 changes: 2 additions & 2 deletions tun2socks/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ target_link_libraries(badvpn-tun2socks system flow tuntap lwip socksclient udpgw

install(
TARGETS badvpn-tun2socks
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

install(
FILES badvpn-tun2socks.8
DESTINATION share/man/man8
DESTINATION ${CMAKE_INSTALL_MANDIR}/man8
)
2 changes: 1 addition & 1 deletion tunctl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ add_executable(badvpn-tunctl tunctl.c)

install(
TARGETS badvpn-tunctl
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
2 changes: 1 addition & 1 deletion udpgw/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ target_link_libraries(badvpn-udpgw system flow flowextra)

install(
TARGETS badvpn-udpgw
RUNTIME DESTINATION bin
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)

0 comments on commit 93137c8

Please sign in to comment.