diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f4428356..cb8cfe0f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -578,26 +578,24 @@ if (BUILD_TESTS) endif() if (${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD" OR ${CMAKE_SYSTEM_NAME} STREQUAL "DragonFly") - install(TARGETS fastnetmon DESTINATION bin) - install(TARGETS fastnetmon_client DESTINATION bin) - - install(FILES fastnetmon.conf DESTINATION etc) - - # Install blank files for networks list and whitelist - install(FILES networks_list DESTINATION etc) - install(FILES networks_whitelist DESTINATION etc) + set(CMAKE_INSTALL_BINDIR "bin") + set(CMAKE_INSTALL_SBINDIR "bin") + set(CMAKE_INSTALL_SYSCONFDIR "etc") else() - # Linux - install(TARGETS fastnetmon DESTINATION /usr/sbin) - install(TARGETS fastnetmon_client DESTINATION /usr/bin) - - install(FILES fastnetmon.conf DESTINATION /etc) - - # Install blank files for networks list and whitelist - install(FILES networks_list DESTINATION /etc) - install(FILES networks_whitelist DESTINATION /etc) + set(CMAKE_INSTALL_BINDIR "/usr/bin") + set(CMAKE_INSTALL_SBINDIR "/usr/sbin") + set(CMAKE_INSTALL_SYSCONFDIR "/etc") endif() +install(TARGETS fastnetmon DESTINATION "${CMAKE_INSTALL_SBINDIR}") +install(TARGETS fastnetmon_client DESTINATION "${CMAKE_INSTALL_BINDIR}") + +install(FILES fastnetmon.conf DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") + +# Install blank files for networks list and whitelist +install(FILES networks_list DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") +install(FILES networks_whitelist DESTINATION "${CMAKE_INSTALL_SYSCONFDIR}") + # man pages install(FILES man/fastnetmon.1 DESTINATION /usr/share/man/man1) install(FILES man/fastnetmon_client.1 DESTINATION /usr/share/man/man1)