From f179e0c02feb7486ef5c177eb3b70efd8943b3e9 Mon Sep 17 00:00:00 2001 From: stivius Date: Wed, 6 Jan 2021 16:02:10 +0200 Subject: [PATCH] build: simplify CMakeLists.txt --- player/CMakeLists.txt | 12 +++++------- player/options/CMakeLists.txt | 4 ---- player/watchdog/CMakeLists.txt | 4 ---- 3 files changed, 5 insertions(+), 15 deletions(-) diff --git a/player/CMakeLists.txt b/player/CMakeLists.txt index 4cb415742..33e6053cc 100644 --- a/player/CMakeLists.txt +++ b/player/CMakeLists.txt @@ -10,6 +10,9 @@ find_package(PkgConfig REQUIRED) pkg_check_modules(GTKMM REQUIRED gtkmm-3.0>=3.22.0) pkg_check_modules(GLIBMM REQUIRED glibmm-2.4>=2.56.0) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/) +set(CMAKE_TESTS_DIRECTORY ${CMAKE_BINARY_DIR}/tests) + set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") add_compile_options( -pthread -Wall -Wno-parentheses -Wno-cast-function-type -W -Wunused-variable -Wunused-parameter -Wunused-function -Wunused -Wno-system-headers -Wno-deprecated -Woverloaded-virtual -Wwrite-strings @@ -42,11 +45,6 @@ if(GTK_UI) add_compile_definitions(USE_GTK) endif(GTK_UI) -if (NOT SNAP_BUILD AND NOT APPIMAGE_BUILD) - set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) -endif() -set(CMAKE_TESTS_DIRECTORY ${CMAKE_BINARY_DIR}/tests) - add_executable(${PROJECT_NAME} main.cpp MainLoop.cpp @@ -68,7 +66,7 @@ target_link_libraries(${PROJECT_NAME} ) if(SNAP_BUILD) - install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) + install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION bin USE_SOURCE_PERMISSIONS) install(FILES resources/ui.glade resources/splash.jpg DESTINATION share/xibo-player) install( FILES snap_run.sh @@ -76,7 +74,7 @@ if(SNAP_BUILD) DESTINATION bin ) elseif(APPIMAGE_BUILD) - install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) + install(DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} DESTINATION bin USE_SOURCE_PERMISSIONS) install(FILES resources/ui.glade resources/splash.jpg DESTINATION share/xibo-player) install(FILES resources/xibo-player.desktop DESTINATION share/applications) install(FILES resources/xibo-player.png DESTINATION share/icons/hicolor/512x512/apps) diff --git a/player/options/CMakeLists.txt b/player/options/CMakeLists.txt index 490a2ad0f..e56f924fc 100644 --- a/player/options/CMakeLists.txt +++ b/player/options/CMakeLists.txt @@ -14,10 +14,6 @@ target_link_libraries(${PROJECT_NAME} ${GTKMM_LINK_LIBRARIES} ) -if (SNAP_BUILD OR APPIMAGE_BUILD) - install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) -endif() - target_include_directories(${PROJECT_NAME} PRIVATE ${GTKMM_INCLUDE_DIRS} ) diff --git a/player/watchdog/CMakeLists.txt b/player/watchdog/CMakeLists.txt index aaeada4ed..575b1f507 100644 --- a/player/watchdog/CMakeLists.txt +++ b/player/watchdog/CMakeLists.txt @@ -8,10 +8,6 @@ add_executable(${PROJECT_NAME} ProcessWatcher.hpp ) -if (SNAP_BUILD OR APPIMAGE_BUILD) - install(TARGETS ${PROJECT_NAME} RUNTIME DESTINATION bin) -endif() - target_link_libraries(${PROJECT_NAME} config Boost::program_options