Skip to content

Commit

Permalink
build: simplify CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
stivius committed Jan 6, 2021
1 parent 202d818 commit f179e0c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
12 changes: 5 additions & 7 deletions player/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -68,15 +66,15 @@ 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
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
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)
Expand Down
4 changes: 0 additions & 4 deletions player/options/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}
)
4 changes: 0 additions & 4 deletions player/watchdog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f179e0c

Please sign in to comment.