diff options
Diffstat (limited to 'project/cmake/scripts/linux')
| -rw-r--r-- | project/cmake/scripts/linux/ArchSetup.cmake | 41 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/CodeCoverage.cmake | 97 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/ExtraTargets.cmake | 12 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/Install.cmake | 355 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/Macros.cmake (renamed from project/cmake/scripts/linux/macros.cmake) | 40 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/PathSetup.cmake (renamed from project/cmake/scripts/linux/pathsetup.cmake) | 15 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/archsetup.cmake | 21 | ||||
| -rw-r--r-- | project/cmake/scripts/linux/install.cmake | 146 |
8 files changed, 543 insertions, 184 deletions
diff --git a/project/cmake/scripts/linux/ArchSetup.cmake b/project/cmake/scripts/linux/ArchSetup.cmake new file mode 100644 index 0000000..cae0bb8 --- /dev/null +++ b/project/cmake/scripts/linux/ArchSetup.cmake | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX) | ||
| 2 | set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED | ||
| 3 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) | ||
| 4 | set(PLATFORM_DIR linux) | ||
| 5 | set(CMAKE_SYSTEM_NAME Linux) | ||
| 6 | if(WITH_ARCH) | ||
| 7 | set(ARCH ${WITH_ARCH}) | ||
| 8 | else() | ||
| 9 | if(CPU STREQUAL x86_64) | ||
| 10 | set(ARCH x86_64-linux) | ||
| 11 | set(NEON False) | ||
| 12 | elseif(CPU MATCHES "i.86") | ||
| 13 | set(ARCH i486-linux) | ||
| 14 | set(NEON False) | ||
| 15 | add_options(CXX ALL_BUILDS "-msse") | ||
| 16 | elseif(CPU MATCHES arm) | ||
| 17 | set(ARCH arm) | ||
| 18 | set(NEON True) | ||
| 19 | elseif(CPU MATCHES aarch64 OR CPU MATCHES arm64) | ||
| 20 | set(ARCH aarch64) | ||
| 21 | set(NEON False) | ||
| 22 | else() | ||
| 23 | message(SEND_ERROR "Unknown CPU: ${CPU}") | ||
| 24 | endif() | ||
| 25 | endif() | ||
| 26 | |||
| 27 | # Make sure we strip binaries in Release build | ||
| 28 | if(CMAKE_BUILD_TYPE STREQUAL Release AND CMAKE_COMPILER_IS_GNUCXX) | ||
| 29 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s") | ||
| 30 | endif() | ||
| 31 | |||
| 32 | find_package(CXX11 REQUIRED) | ||
| 33 | include(LDGOLD) | ||
| 34 | |||
| 35 | # Code Coverage | ||
| 36 | if(CMAKE_BUILD_TYPE STREQUAL Coverage) | ||
| 37 | set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test) | ||
| 38 | set(COVERAGE_SOURCE_DIR ${CORE_SOURCE_DIR}) | ||
| 39 | set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") | ||
| 40 | set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) | ||
| 41 | endif() | ||
diff --git a/project/cmake/scripts/linux/CodeCoverage.cmake b/project/cmake/scripts/linux/CodeCoverage.cmake new file mode 100644 index 0000000..efc2208 --- /dev/null +++ b/project/cmake/scripts/linux/CodeCoverage.cmake | |||
| @@ -0,0 +1,97 @@ | |||
| 1 | # - CodeCoverage | ||
| 2 | # Generate code coverage reports with LCOV and GCovr. | ||
| 3 | # | ||
| 4 | # Configuration: | ||
| 5 | # COVERAGE_SOURCE_DIR - Source root directory (default ${CMAKE_SOURCE_DIR}). | ||
| 6 | # COVERAGE_BINARY_DIR - Directory where the coverage reports (and intermediate files) | ||
| 7 | # are generated to. | ||
| 8 | # COVERAGE_EXCLUDES - List of exclude patterns (for example '*/tests/*'). | ||
| 9 | # | ||
| 10 | # The following targets will be generated: | ||
| 11 | # coverage - Builds an html report. Requires LCOV. | ||
| 12 | # coverage_xml - Builds an xml report (in Cobertura format for Jenkins). | ||
| 13 | # Requires Gcovr. | ||
| 14 | # | ||
| 15 | # Inspired by https://github.com/bilke/cmake-modules/blob/master/CodeCoverage.cmake | ||
| 16 | |||
| 17 | # Comiler and linker setup | ||
| 18 | set(CMAKE_C_FLAGS_COVERAGE "-g -O0 --coverage" CACHE STRING | ||
| 19 | "Flags used by the C compiler during coverage builds." FORCE) | ||
| 20 | set(CMAKE_CXX_FLAGS_COVERAGE "-g -O0 --coverage" CACHE STRING | ||
| 21 | "Flags used by the C++ compiler during coverage builds." FORCE) | ||
| 22 | set(CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING | ||
| 23 | "Flags used for linking binaries during coverage builds." FORCE) | ||
| 24 | set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage" CACHE STRING | ||
| 25 | "Flags used by the shared libraries linker during coverage builds." FORCE) | ||
| 26 | mark_as_advanced( | ||
| 27 | CMAKE_C_FLAGS_COVERAGE CMAKE_CXX_FLAGS_COVERAGE CMAKE_EXE_LINKER_FLAGS_COVERAGE | ||
| 28 | CMAKE_SHARED_LINKER_FLAGS_COVERAGE CMAKE_STATIC_LINKER_FLAGS_COVERAGE | ||
| 29 | ) | ||
| 30 | |||
| 31 | find_program(LCOV_EXECUTABLE lcov) | ||
| 32 | find_program(GENINFO_EXECUTABLE geninfo) | ||
| 33 | find_program(GENHTML_EXECUTABLE genhtml) | ||
| 34 | find_program(GCOVR_EXECUTABLE gcovr) | ||
| 35 | mark_as_advanced(LCOV_EXECUTABLE GENINFO_EXECUTABLE GENHTML_EXECUTABLE GCOVR_EXECUTABLE) | ||
| 36 | |||
| 37 | # Default options | ||
| 38 | if(NOT COVERAGE_SOURCE_DIR) | ||
| 39 | set(COVERAGE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) | ||
| 40 | endif() | ||
| 41 | if(NOT COVERAGE_BINARY_DIR) | ||
| 42 | set(COVERAGE_BINARY_DIR ${CMAKE_BINARY_DIR}/coverage) | ||
| 43 | endif() | ||
| 44 | if(NOT COVERAGE_EXCLUDES) | ||
| 45 | set(COVERAGE_EXCLUDES) | ||
| 46 | endif() | ||
| 47 | |||
| 48 | # Allow variables in COVERAGE_DEPENDS that are not evaluated before this file is included. | ||
| 49 | string(CONFIGURE "${COVERAGE_DEPENDS}" COVERAGE_DEPENDS) | ||
| 50 | |||
| 51 | # Add coverage target that generates an HTML report using LCOV | ||
| 52 | if(LCOV_EXECUTABLE AND GENINFO_EXECUTABLE AND GENHTML_EXECUTABLE) | ||
| 53 | file(MAKE_DIRECTORY ${COVERAGE_BINARY_DIR}) | ||
| 54 | add_custom_target(coverage | ||
| 55 | COMMAND ${CMAKE_COMMAND} -E make_directory ${COVERAGE_BINARY_DIR} | ||
| 56 | COMMAND ${LCOV_EXECUTABLE} -z -q -d ${CMAKE_BINARY_DIR} | ||
| 57 | COMMAND ${LCOV_EXECUTABLE} -c -q -i -d ${CMAKE_BINARY_DIR} -b ${COVERAGE_SOURCE_DIR} | ||
| 58 | -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_base.info | ||
| 59 | COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test || true | ||
| 60 | COMMAND ${LCOV_EXECUTABLE} -c -q -d ${CMAKE_BINARY_DIR} -b ${COVERAGE_SOURCE_DIR} | ||
| 61 | -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_test.info | ||
| 62 | COMMAND ${LCOV_EXECUTABLE} -a ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_base.info | ||
| 63 | -a ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage_test.info | ||
| 64 | -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info -q | ||
| 65 | COMMAND ${LCOV_EXECUTABLE} -q -r ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info | ||
| 66 | /usr/include/* ${CMAKE_BINARY_DIR}/* ${COVERAGE_EXCLUDES} | ||
| 67 | -o ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info | ||
| 68 | COMMAND ${GENHTML_EXECUTABLE} ${COVERAGE_BINARY_DIR}/${PROJECT_NAME}.coverage.info | ||
| 69 | -o ${COVERAGE_BINARY_DIR}/html -s --legend --highlight --demangle-cpp | ||
| 70 | COMMAND ${CMAKE_COMMAND} -E echo "Coverage report: file://${COVERAGE_BINARY_DIR}/html/index.html" | ||
| 71 | WORKING_DIRECTORY ${COVERAGE_BINARY_DIR} | ||
| 72 | VERBATIM | ||
| 73 | DEPENDS ${COVERAGE_DEPENDS} | ||
| 74 | COMMENT "Generate code coverage html report" | ||
| 75 | ) | ||
| 76 | else() | ||
| 77 | message(WARNING "Target coverage not available (lcov, geninfo and genhtml needed).") | ||
| 78 | endif() | ||
| 79 | |||
| 80 | # Add coverage target that generates an XML report using Gcovr | ||
| 81 | if(GCOVR_EXECUTABLE) | ||
| 82 | file(MAKE_DIRECTORY ${COVERAGE_BINARY_DIR}) | ||
| 83 | string(REGEX REPLACE "([^;]+)" "--exclude=\"\\1\"" _gcovr_excludes "${COVERAGE_EXCLUDES}") | ||
| 84 | string(REPLACE "*" ".*" _gcovr_excludes "${_gcovr_excludes}") | ||
| 85 | add_custom_target(coverage_xml | ||
| 86 | COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target test || true | ||
| 87 | COMMAND ${GCOVR_EXECUTABLE} -x -r ${COVERAGE_SOURCE_DIR} -o ${COVERAGE_BINARY_DIR}/coverage.xml | ||
| 88 | --object-directory ${CMAKE_BINARY_DIR} ${_gcovr_excludes} ${CMAKE_BINARY_DIR} | ||
| 89 | COMMAND ${CMAKE_COMMAND} -E echo "Coverage report: file://${COVERAGE_BINARY_DIR}/coverage.xml" | ||
| 90 | WORKING_DIRECTORY ${COVERAGE_BINARY_DIR} | ||
| 91 | DEPENDS ${COVERAGE_DEPENDS} | ||
| 92 | COMMENT "Generate code coverage xml report" | ||
| 93 | ) | ||
| 94 | unset(_gcovr_excludes) | ||
| 95 | else() | ||
| 96 | message(WARNING "Target coverage_xml not available (gcovr needed).") | ||
| 97 | endif() | ||
diff --git a/project/cmake/scripts/linux/ExtraTargets.cmake b/project/cmake/scripts/linux/ExtraTargets.cmake new file mode 100644 index 0000000..2bb5f6f --- /dev/null +++ b/project/cmake/scripts/linux/ExtraTargets.cmake | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | # xrandr | ||
| 2 | if(ENABLE_X11 AND X_FOUND AND XRANDR_FOUND) | ||
| 3 | find_package(X QUIET) | ||
| 4 | find_package(XRandR QUIET) | ||
| 5 | add_executable(${APP_NAME_LC}-xrandr ${CORE_SOURCE_DIR}/xbmc-xrandr.c) | ||
| 6 | target_link_libraries(${APP_NAME_LC}-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES}) | ||
| 7 | endif() | ||
| 8 | |||
| 9 | # WiiRemote | ||
| 10 | if(ENABLE_EVENTCLIENTS) | ||
| 11 | add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote) | ||
| 12 | endif() | ||
diff --git a/project/cmake/scripts/linux/Install.cmake b/project/cmake/scripts/linux/Install.cmake new file mode 100644 index 0000000..5458707 --- /dev/null +++ b/project/cmake/scripts/linux/Install.cmake | |||
| @@ -0,0 +1,355 @@ | |||
| 1 | if(X_FOUND) | ||
| 2 | set(USE_X11 1) | ||
| 3 | else() | ||
| 4 | set(USE_X11 0) | ||
| 5 | endif() | ||
| 6 | if(OPENGL_FOUND) | ||
| 7 | set(USE_OPENGL 1) | ||
| 8 | else() | ||
| 9 | set(USE_OPENGL 0) | ||
| 10 | endif() | ||
| 11 | if(OPENGLES_FOUND) | ||
| 12 | set(USE_OPENGLES 1) | ||
| 13 | else() | ||
| 14 | set(USE_OPENGLES 0) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | # CMake config | ||
| 18 | set(APP_PREFIX ${prefix}) | ||
| 19 | set(APP_LIB_DIR ${libdir}/${APP_NAME_LC}) | ||
| 20 | set(APP_DATA_DIR ${datarootdir}/${APP_NAME_LC}) | ||
| 21 | set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC}) | ||
| 22 | set(CXX11_SWITCH "-std=c++11") | ||
| 23 | |||
| 24 | # Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone | ||
| 25 | if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) | ||
| 26 | if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND) | ||
| 27 | file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content) | ||
| 28 | set(XBMC_STANDALONE_SH_PULSE ${pulse_content}) | ||
| 29 | endif() | ||
| 30 | endif() | ||
| 31 | |||
| 32 | # Configure startup scripts | ||
| 33 | configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in | ||
| 34 | ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) | ||
| 35 | configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in | ||
| 36 | ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY) | ||
| 37 | |||
| 38 | # Configure cmake files | ||
| 39 | configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in | ||
| 40 | ${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY) | ||
| 41 | |||
| 42 | # Configure xsession entry | ||
| 43 | configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in | ||
| 44 | ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY) | ||
| 45 | |||
| 46 | # Install app | ||
| 47 | install(TARGETS ${APP_NAME_LC} | ||
| 48 | DESTINATION ${libdir}/${APP_NAME_LC} | ||
| 49 | COMPONENT kodi-bin) | ||
| 50 | if(ENABLE_X11 AND XRANDR_FOUND) | ||
| 51 | install(TARGETS ${APP_NAME_LC}-xrandr | ||
| 52 | DESTINATION ${libdir}/${APP_NAME_LC} | ||
| 53 | COMPONENT kodi-bin) | ||
| 54 | endif() | ||
| 55 | |||
| 56 | # Install scripts | ||
| 57 | install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} | ||
| 58 | ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone | ||
| 59 | DESTINATION ${bindir} | ||
| 60 | COMPONENT kodi-bin) | ||
| 61 | |||
| 62 | # Install libraries | ||
| 63 | foreach(library ${LIBRARY_FILES}) | ||
| 64 | get_filename_component(dir ${library} DIRECTORY) | ||
| 65 | string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${dir}) | ||
| 66 | install(PROGRAMS ${library} | ||
| 67 | DESTINATION ${libdir}/${APP_NAME_LC}/${dir} | ||
| 68 | COMPONENT kodi-bin) | ||
| 69 | endforeach() | ||
| 70 | |||
| 71 | # Install add-ons, fonts, icons, keyboard maps, keymaps, etc | ||
| 72 | # (addons, media, system, userdata folders in share/kodi/) | ||
| 73 | foreach(file ${install_data}) | ||
| 74 | get_filename_component(dir ${file} DIRECTORY) | ||
| 75 | install(FILES ${CMAKE_BINARY_DIR}/${file} | ||
| 76 | DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir} | ||
| 77 | COMPONENT kodi) | ||
| 78 | endforeach() | ||
| 79 | |||
| 80 | # Install xsession entry | ||
| 81 | install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop | ||
| 82 | DESTINATION ${datarootdir}/xsessions | ||
| 83 | COMPONENT kodi) | ||
| 84 | |||
| 85 | # Install desktop entry | ||
| 86 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop | ||
| 87 | DESTINATION ${datarootdir}/applications | ||
| 88 | COMPONENT kodi) | ||
| 89 | |||
| 90 | # Install icons | ||
| 91 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png | ||
| 92 | RENAME ${APP_NAME_LC}.png | ||
| 93 | DESTINATION ${datarootdir}/icons/hicolor/16x16/apps | ||
| 94 | COMPONENT kodi) | ||
| 95 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png | ||
| 96 | RENAME ${APP_NAME_LC}.png | ||
| 97 | DESTINATION ${datarootdir}/icons/hicolor/22x22/apps | ||
| 98 | COMPONENT kodi) | ||
| 99 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png | ||
| 100 | RENAME ${APP_NAME_LC}.png | ||
| 101 | DESTINATION ${datarootdir}/icons/hicolor/24x24/apps | ||
| 102 | COMPONENT kodi) | ||
| 103 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png | ||
| 104 | RENAME ${APP_NAME_LC}.png | ||
| 105 | DESTINATION ${datarootdir}/icons/hicolor/32x32/apps | ||
| 106 | COMPONENT kodi) | ||
| 107 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png | ||
| 108 | RENAME ${APP_NAME_LC}.png | ||
| 109 | DESTINATION ${datarootdir}/icons/hicolor/48x48/apps | ||
| 110 | COMPONENT kodi) | ||
| 111 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png | ||
| 112 | RENAME ${APP_NAME_LC}.png | ||
| 113 | DESTINATION ${datarootdir}/icons/hicolor/64x64/apps | ||
| 114 | COMPONENT kodi) | ||
| 115 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png | ||
| 116 | RENAME ${APP_NAME_LC}.png | ||
| 117 | DESTINATION ${datarootdir}/icons/hicolor/128x128/apps | ||
| 118 | COMPONENT kodi) | ||
| 119 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png | ||
| 120 | RENAME ${APP_NAME_LC}.png | ||
| 121 | DESTINATION ${datarootdir}/icons/hicolor/256x256/apps | ||
| 122 | COMPONENT kodi) | ||
| 123 | install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t | ||
| 124 | $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)" | ||
| 125 | COMPONENT kodi) | ||
| 126 | |||
| 127 | # Install docs | ||
| 128 | install(FILES ${CORE_SOURCE_DIR}/copying.txt | ||
| 129 | ${CORE_SOURCE_DIR}/LICENSE.GPL | ||
| 130 | ${CORE_SOURCE_DIR}/version.txt | ||
| 131 | ${CORE_SOURCE_DIR}/docs/README.linux | ||
| 132 | DESTINATION ${datarootdir}/doc/${APP_NAME_LC} | ||
| 133 | COMPONENT kodi) | ||
| 134 | |||
| 135 | install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt | ||
| 136 | DESTINATION ${datarootdir}/${APP_NAME_LC} | ||
| 137 | COMPONENT kodi) | ||
| 138 | |||
| 139 | # Install kodi-tools-texturepacker | ||
| 140 | install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/texturepacker/TexturePacker | ||
| 141 | DESTINATION ${bindir} | ||
| 142 | COMPONENT kodi-tools-texturepacker) | ||
| 143 | |||
| 144 | # Install kodi-addon-dev headers | ||
| 145 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h | ||
| 146 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp | ||
| 147 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h | ||
| 148 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h | ||
| 149 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h | ||
| 150 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h | ||
| 151 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h | ||
| 152 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h | ||
| 153 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h | ||
| 154 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h | ||
| 155 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h | ||
| 156 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h | ||
| 157 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h | ||
| 158 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h | ||
| 159 | ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h | ||
| 160 | ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h | ||
| 161 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 162 | COMPONENT kodi-addon-dev) | ||
| 163 | |||
| 164 | # Install kodi-addon-dev add-on bindings | ||
| 165 | install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake | ||
| 166 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake | ||
| 167 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake | ||
| 168 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ArchSetup.cmake | ||
| 169 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckCommits.cmake | ||
| 170 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake | ||
| 171 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GenerateVersionedFiles.cmake | ||
| 172 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GeneratorSetup.cmake | ||
| 173 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake | ||
| 174 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake | ||
| 175 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake | ||
| 176 | ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ProjectMacros.cmake | ||
| 177 | ${CORE_SOURCE_DIR}/project/cmake/scripts/linux/PathSetup.cmake | ||
| 178 | DESTINATION ${datarootdir}/${APP_NAME_LC}/cmake | ||
| 179 | COMPONENT kodi-addon-dev) | ||
| 180 | |||
| 181 | # Install kodi-audio-dev | ||
| 182 | install(FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h | ||
| 183 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h | ||
| 184 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h | ||
| 185 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h | ||
| 186 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h | ||
| 187 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h | ||
| 188 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h | ||
| 189 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h | ||
| 190 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 191 | COMPONENT kodi-audio-dev) | ||
| 192 | |||
| 193 | if(ENABLE_EVENTCLIENTS) | ||
| 194 | # Install kodi-eventclients-common BT python files | ||
| 195 | install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py | ||
| 196 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py | ||
| 197 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py | ||
| 198 | DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/bt | ||
| 199 | COMPONENT kodi-eventclients-common) | ||
| 200 | |||
| 201 | # Install kodi-eventclients-common PS3 python files | ||
| 202 | install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py | ||
| 203 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py | ||
| 204 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py | ||
| 205 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py | ||
| 206 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py | ||
| 207 | DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/ps3 | ||
| 208 | COMPONENT kodi-eventclients-common) | ||
| 209 | |||
| 210 | # Install kodi-eventclients-common python files | ||
| 211 | file(WRITE ${CMAKE_BINARY_DIR}/packages/deb/defs.py ICON_PATH="usr/share/pixmaps/${APP_NAME_LC}/") | ||
| 212 | install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/deb/defs.py | ||
| 213 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py | ||
| 214 | "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" | ||
| 215 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py | ||
| 216 | ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py | ||
| 217 | DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC} | ||
| 218 | COMPONENT kodi-eventclients-common) | ||
| 219 | |||
| 220 | # Install kodi-eventclients-common icons | ||
| 221 | install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png | ||
| 222 | ${CORE_SOURCE_DIR}/tools/EventClients/icons/phone.png | ||
| 223 | ${CORE_SOURCE_DIR}/tools/EventClients/icons/mail.png | ||
| 224 | ${CORE_SOURCE_DIR}/tools/EventClients/icons/mouse.png | ||
| 225 | DESTINATION ${datarootdir}/pixmaps/${APP_NAME_LC} | ||
| 226 | COMPONENT kodi-eventclients-common) | ||
| 227 | |||
| 228 | # Install kodi-eventclients-dev headers | ||
| 229 | install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h | ||
| 230 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 231 | COMPONENT kodi-eventclients-dev) | ||
| 232 | |||
| 233 | # Install kodi-eventclients-dev C# examples | ||
| 234 | install(FILES "${CORE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs" | ||
| 235 | DESTINATION "${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C#" | ||
| 236 | COMPONENT kodi-eventclients-dev) | ||
| 237 | |||
| 238 | # Install kodi-eventclients-dev C++ examples | ||
| 239 | install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp | ||
| 240 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp | ||
| 241 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp | ||
| 242 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp | ||
| 243 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp | ||
| 244 | DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C++ | ||
| 245 | COMPONENT kodi-eventclients-dev) | ||
| 246 | |||
| 247 | # Install kodi-eventclients-dev java examples | ||
| 248 | install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java | ||
| 249 | DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/java | ||
| 250 | COMPONENT kodi-eventclients-dev) | ||
| 251 | |||
| 252 | # Install kodi-eventclients-dev python examples | ||
| 253 | install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py | ||
| 254 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py | ||
| 255 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py | ||
| 256 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py | ||
| 257 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py | ||
| 258 | ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py | ||
| 259 | DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/python | ||
| 260 | COMPONENT kodi-eventclients-dev) | ||
| 261 | |||
| 262 | # Install kodi-eventclients-ps3 | ||
| 263 | install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" | ||
| 264 | RENAME ${APP_NAME_LC}-ps3remote | ||
| 265 | DESTINATION ${bindir} | ||
| 266 | COMPONENT kodi-eventclients-ps3) | ||
| 267 | |||
| 268 | # Install kodi-eventclients-wiiremote | ||
| 269 | install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/WiiRemote/${APP_NAME_LC}-wiiremote | ||
| 270 | DESTINATION ${bindir} | ||
| 271 | COMPONENT kodi-eventclients-wiiremote) | ||
| 272 | |||
| 273 | # Install kodi-eventclients-xbmc-send | ||
| 274 | install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py" | ||
| 275 | RENAME ${APP_NAME_LC}-send | ||
| 276 | DESTINATION ${bindir} | ||
| 277 | COMPONENT kodi-eventclients-xbmc-send) | ||
| 278 | endif() | ||
| 279 | |||
| 280 | # Install kodi-inputstream-dev | ||
| 281 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h | ||
| 282 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h | ||
| 283 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 284 | COMPONENT kodi-inputstream-dev) | ||
| 285 | |||
| 286 | # Install kodi-pvr-dev | ||
| 287 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h | ||
| 288 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h | ||
| 289 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h | ||
| 290 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 291 | COMPONENT kodi-pvr-dev) | ||
| 292 | |||
| 293 | # Install kodi-screensaver-dev | ||
| 294 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h | ||
| 295 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h | ||
| 296 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 297 | COMPONENT kodi-screensaver-dev) | ||
| 298 | |||
| 299 | # Install kodi-visualization-dev | ||
| 300 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h | ||
| 301 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h | ||
| 302 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 303 | COMPONENT kodi-visualization-dev) | ||
| 304 | |||
| 305 | # Install kodi-peripheral-dev | ||
| 306 | install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_callbacks.h | ||
| 307 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h | ||
| 308 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h | ||
| 309 | ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp | ||
| 310 | DESTINATION ${includedir}/${APP_NAME_LC} | ||
| 311 | COMPONENT kodi-peripheral-dev) | ||
| 312 | |||
| 313 | # Install XBT skin files | ||
| 314 | foreach(texture ${XBT_FILES}) | ||
| 315 | string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) | ||
| 316 | get_filename_component(dir ${dir} DIRECTORY) | ||
| 317 | install(FILES ${texture} | ||
| 318 | DESTINATION ${datarootdir}/${APP_NAME_LC}/${dir} | ||
| 319 | COMPONENT kodi) | ||
| 320 | endforeach() | ||
| 321 | |||
| 322 | # Install extra stuff if it exists | ||
| 323 | if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs) | ||
| 324 | install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs) | ||
| 325 | foreach(dir \${dirs}) | ||
| 326 | file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*) | ||
| 327 | foreach(file \${FILES}) | ||
| 328 | get_filename_component(dir \${file} DIRECTORY) | ||
| 329 | file(INSTALL \${file} DESTINATION ${datarootdir}/${APP_NAME_LC}/\${dir}) | ||
| 330 | endforeach() | ||
| 331 | endforeach()") | ||
| 332 | endif() | ||
| 333 | |||
| 334 | if(NOT "$ENV{DESTDIR}" STREQUAL "") | ||
| 335 | set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR}) | ||
| 336 | endif() | ||
| 337 | foreach(subdir ${build_dirs}) | ||
| 338 | if(NOT subdir MATCHES kodi-platform) | ||
| 339 | string(REPLACE " " ";" subdir ${subdir}) | ||
| 340 | list(GET subdir 0 id) | ||
| 341 | install(CODE "execute_process(COMMAND ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})") | ||
| 342 | endif() | ||
| 343 | endforeach() | ||
| 344 | |||
| 345 | # generate packages? yes please, if everything checks out | ||
| 346 | if(CPACK_GENERATOR) | ||
| 347 | if(CPACK_GENERATOR STREQUAL DEB AND CORE_SYSTEM_NAME STREQUAL linux) | ||
| 348 | if(CMAKE_BUILD_TYPE STREQUAL Debug) | ||
| 349 | message(STATUS "DEB Generator: Build type is set to 'Debug'. Packaged binaries will be unstripped.") | ||
| 350 | endif() | ||
| 351 | include(${PROJECT_SOURCE_DIR}/cpack/CPackConfigDEB.cmake) | ||
| 352 | else() | ||
| 353 | message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.") | ||
| 354 | endif() | ||
| 355 | endif() | ||
diff --git a/project/cmake/scripts/linux/macros.cmake b/project/cmake/scripts/linux/Macros.cmake index 7453a1c..72e9d5c 100644 --- a/project/cmake/scripts/linux/macros.cmake +++ b/project/cmake/scripts/linux/Macros.cmake | |||
| @@ -5,7 +5,7 @@ function(core_link_library lib wraplib) | |||
| 5 | set(check_arg "") | 5 | set(check_arg "") |
| 6 | if(TARGET ${lib}) | 6 | if(TARGET ${lib}) |
| 7 | set(target ${lib}) | 7 | set(target ${lib}) |
| 8 | set(link_lib ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${lib}/${lib}.a) | 8 | set(link_lib $<TARGET_FILE:${lib}>) |
| 9 | set(check_arg ${ARGV2}) | 9 | set(check_arg ${ARGV2}) |
| 10 | set(data_arg ${ARGV3}) | 10 | set(data_arg ${ARGV3}) |
| 11 | else() | 11 | else() |
| @@ -14,28 +14,42 @@ function(core_link_library lib wraplib) | |||
| 14 | set(check_arg ${ARGV3}) | 14 | set(check_arg ${ARGV3}) |
| 15 | set(data_arg ${ARGV4}) | 15 | set(data_arg ${ARGV4}) |
| 16 | endif() | 16 | endif() |
| 17 | |||
| 18 | # wrapper has to be adapted in order to support coverage. | ||
| 19 | if(CMAKE_BUILD_TYPE STREQUAL Coverage) | ||
| 20 | set(export "") | ||
| 21 | endif() | ||
| 22 | |||
| 17 | if(check_arg STREQUAL export) | 23 | if(check_arg STREQUAL export) |
| 18 | set(export ${export} | 24 | set(export ${export} |
| 19 | -Wl,--version-script=${ARGV3}) | 25 | -Wl,--version-script=${ARGV3}) |
| 20 | elseif(check_arg STREQUAL nowrap) | ||
| 21 | set(export ${data_arg}) | ||
| 22 | elseif(check_arg STREQUAL extras) | 26 | elseif(check_arg STREQUAL extras) |
| 23 | foreach(arg ${data_arg}) | 27 | foreach(arg ${data_arg}) |
| 24 | list(APPEND export ${arg}) | 28 | list(APPEND export ${arg}) |
| 25 | endforeach() | 29 | endforeach() |
| 30 | elseif(check_arg STREQUAL archives) | ||
| 31 | set(extra_libs ${data_arg}) | ||
| 26 | endif() | 32 | endif() |
| 27 | get_filename_component(dir ${wraplib} PATH) | 33 | |
| 28 | add_custom_command(OUTPUT ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} | 34 | string(REGEX REPLACE "[ ]+" ";" _flags ${CMAKE_SHARED_LINKER_FLAGS}) |
| 29 | COMMAND cmake -E make_directory ${dir} | 35 | get_filename_component(dir ${wraplib} DIRECTORY) |
| 36 | add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} | ||
| 37 | COMMAND ${CMAKE_COMMAND} -E make_directory ${dir} | ||
| 30 | COMMAND ${CMAKE_C_COMPILER} | 38 | COMMAND ${CMAKE_C_COMPILER} |
| 31 | ARGS -Wl,--whole-archive | 39 | ARGS ${_flags} -Wl,--whole-archive |
| 32 | ${link_lib} | 40 | "${link_lib}" ${extra_libs} |
| 33 | -Wl,--no-whole-archive -lm | 41 | -Wl,--no-whole-archive -lm |
| 42 | -Wl,-soname,${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} | ||
| 34 | -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} | 43 | -shared -o ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} |
| 35 | ${export} | 44 | ${export} |
| 36 | DEPENDS ${target} wrapper.def wrapper) | 45 | DEPENDS ${target} wrapper.def wrapper) |
| 37 | list(APPEND WRAP_FILES ${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) | 46 | |
| 38 | set(WRAP_FILES ${WRAP_FILES} PARENT_SCOPE) | 47 | get_filename_component(libname ${wraplib} NAME_WE) |
| 48 | add_custom_target(wrap_${libname} ALL DEPENDS ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX}) | ||
| 49 | set_target_properties(wrap_${libname} PROPERTIES FOLDER lib/wrapped) | ||
| 50 | add_dependencies(${APP_NAME_LC}-libraries wrap_${libname}) | ||
| 51 | |||
| 52 | set(LIBRARY_FILES ${LIBRARY_FILES} ${CMAKE_BINARY_DIR}/${wraplib}-${ARCH}${CMAKE_SHARED_MODULE_SUFFIX} CACHE STRING "" FORCE) | ||
| 39 | endfunction() | 53 | endfunction() |
| 40 | 54 | ||
| 41 | function(find_soname lib) | 55 | function(find_soname lib) |
| @@ -70,7 +84,9 @@ function(find_soname lib) | |||
| 70 | OUTPUT_VARIABLE ${lib}_SONAME) | 84 | OUTPUT_VARIABLE ${lib}_SONAME) |
| 71 | string(REPLACE "SONAME " "" ${lib}_SONAME ${${lib}_SONAME}) | 85 | string(REPLACE "SONAME " "" ${lib}_SONAME ${${lib}_SONAME}) |
| 72 | string(STRIP ${${lib}_SONAME} ${lib}_SONAME) | 86 | string(STRIP ${${lib}_SONAME} ${lib}_SONAME) |
| 73 | message(STATUS "${lib} soname: ${${lib}_SONAME}") | 87 | if(VERBOSE) |
| 88 | message(STATUS "${lib} soname: ${${lib}_SONAME}") | ||
| 89 | endif() | ||
| 74 | set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) | 90 | set(${lib}_SONAME ${${lib}_SONAME} PARENT_SCOPE) |
| 75 | endif() | 91 | endif() |
| 76 | if(arg_REQUIRED AND NOT ${lib}_SONAME) | 92 | if(arg_REQUIRED AND NOT ${lib}_SONAME) |
diff --git a/project/cmake/scripts/linux/pathsetup.cmake b/project/cmake/scripts/linux/PathSetup.cmake index 8550616..f69711e 100644 --- a/project/cmake/scripts/linux/pathsetup.cmake +++ b/project/cmake/scripts/linux/PathSetup.cmake | |||
| @@ -1,3 +1,5 @@ | |||
| 1 | include(GNUInstallDirs) | ||
| 2 | |||
| 1 | if(NOT prefix) | 3 | if(NOT prefix) |
| 2 | set(prefix ${CMAKE_INSTALL_PREFIX}) | 4 | set(prefix ${CMAKE_INSTALL_PREFIX}) |
| 3 | else() | 5 | else() |
| @@ -7,19 +9,22 @@ if(NOT exec_prefix) | |||
| 7 | set(exec_prefix ${prefix}) | 9 | set(exec_prefix ${prefix}) |
| 8 | endif() | 10 | endif() |
| 9 | if(NOT libdir) | 11 | if(NOT libdir) |
| 10 | set(libdir ${prefix}/lib) | 12 | set(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) |
| 11 | endif() | 13 | endif() |
| 12 | if(NOT bindir) | 14 | if(NOT bindir) |
| 13 | set(bindir ${prefix}/bin) | 15 | set(bindir ${CMAKE_INSTALL_FULL_BINDIR}) |
| 14 | endif() | 16 | endif() |
| 15 | if(NOT includedir) | 17 | if(NOT includedir) |
| 16 | set(includedir ${prefix}/include) | 18 | set(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) |
| 17 | endif() | 19 | endif() |
| 18 | if(NOT datarootdir) | 20 | if(NOT datarootdir) |
| 19 | set(datarootdir ${prefix}/share) | 21 | set(datarootdir ${CMAKE_INSTALL_FULL_DATAROOTDIR}) |
| 20 | endif() | 22 | endif() |
| 21 | if(NOT datadir) | 23 | if(NOT datadir) |
| 22 | set(datadir ${datarootdir}) | 24 | set(datadir ${CMAKE_INSTALL_FULL_DATADIR}) |
| 25 | endif() | ||
| 26 | if(NOT docdir) | ||
| 27 | set(docdir ${CMAKE_INSTALL_FULL_DOCDIR}) | ||
| 23 | endif() | 28 | endif() |
| 24 | 29 | ||
| 25 | list(APPEND final_message "-- PATH config --") | 30 | list(APPEND final_message "-- PATH config --") |
diff --git a/project/cmake/scripts/linux/archsetup.cmake b/project/cmake/scripts/linux/archsetup.cmake deleted file mode 100644 index e193768..0000000 --- a/project/cmake/scripts/linux/archsetup.cmake +++ /dev/null | |||
| @@ -1,21 +0,0 @@ | |||
| 1 | set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_LINUX) | ||
| 2 | set(SYSTEM_DEFINES -D__STDC_CONSTANT_MACROS -D_FILE_DEFINED | ||
| 3 | -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64) | ||
| 4 | set(PLATFORM_DIR linux) | ||
| 5 | set(CMAKE_SYSTEM_NAME Linux) | ||
| 6 | if(WITH_ARCH) | ||
| 7 | set(ARCH ${WITH_ARCH}) | ||
| 8 | else() | ||
| 9 | if(CPU STREQUAL x86_64) | ||
| 10 | set(ARCH x86_64-linux) | ||
| 11 | elseif(CPU MATCHES "i.86") | ||
| 12 | set(ARCH i486-linux) | ||
| 13 | else() | ||
| 14 | message(SEND_ERROR "Unknown CPU: ${CPU}") | ||
| 15 | endif() | ||
| 16 | endif() | ||
| 17 | |||
| 18 | find_package(CXX11 REQUIRED) | ||
| 19 | |||
| 20 | set(LIRC_DEVICE "\"/dev/lircd\"" CACHE STRING "LIRC device to use") | ||
| 21 | set(DEP_DEFINES -DLIRC_DEVICE=${LIRC_DEVICE}) | ||
diff --git a/project/cmake/scripts/linux/install.cmake b/project/cmake/scripts/linux/install.cmake deleted file mode 100644 index 962a816..0000000 --- a/project/cmake/scripts/linux/install.cmake +++ /dev/null | |||
| @@ -1,146 +0,0 @@ | |||
| 1 | if(X_FOUND) | ||
| 2 | set(USE_X11 1) | ||
| 3 | else() | ||
| 4 | set(USE_X11 0) | ||
| 5 | endif() | ||
| 6 | if(OPENGL_FOUND) | ||
| 7 | set(USE_OPENGL 1) | ||
| 8 | else() | ||
| 9 | set(USE_OPENGL 0) | ||
| 10 | endif() | ||
| 11 | if(OPENGLES_FOUND) | ||
| 12 | set(USE_OPENGLES 1) | ||
| 13 | else() | ||
| 14 | set(USE_OPENGLES 0) | ||
| 15 | endif() | ||
| 16 | |||
| 17 | configure_file(${CORE_SOURCE_DIR}/project/cmake/${APP_NAME_LC}-config.cmake.in | ||
| 18 | ${CORE_BUILD_DIR}/${APP_NAME_LC}-config.cmake @ONLY) | ||
| 19 | |||
| 20 | configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in | ||
| 21 | ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) | ||
| 22 | |||
| 23 | # Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone | ||
| 24 | if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) | ||
| 25 | if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND) | ||
| 26 | file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content) | ||
| 27 | set(XBMC_STANDALONE_SH_PULSE ${pulse_content}) | ||
| 28 | endif() | ||
| 29 | endif() | ||
| 30 | |||
| 31 | configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in | ||
| 32 | ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY) | ||
| 33 | |||
| 34 | install(TARGETS ${APP_NAME_LC} DESTINATION ${libdir}/kodi) | ||
| 35 | if(ENABLE_X11 AND XRANDR_FOUND) | ||
| 36 | install(TARGETS ${APP_NAME_LC}-xrandr DESTINATION ${libdir}/${APP_NAME_LC}) | ||
| 37 | endif() | ||
| 38 | |||
| 39 | if(NOT EXISTS ${libdir}/xbmc) | ||
| 40 | install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${libdir})") | ||
| 41 | endif() | ||
| 42 | install(FILES ${addon_bindings} DESTINATION ${includedir}/kodi) | ||
| 43 | if(NOT EXISTS ${includedir}/xbmc) | ||
| 44 | install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${includedir})") | ||
| 45 | endif() | ||
| 46 | |||
| 47 | install(FILES ${cmake_files} | ||
| 48 | DESTINATION ${libdir}/kodi) | ||
| 49 | install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}-config.cmake | ||
| 50 | DESTINATION ${libdir}/${APP_NAME_LC}) | ||
| 51 | install(FILES ${CORE_SOURCE_DIR}/project/cmake/xbmc-config.cmake.in | ||
| 52 | RENAME xbmc-config.cmake | ||
| 53 | DESTINATION ${libdir}/${APP_NAME_LC}) | ||
| 54 | |||
| 55 | install(PROGRAMS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} | ||
| 56 | ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone | ||
| 57 | DESTINATION ${bindir}) | ||
| 58 | install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC} xbmc WORKING_DIRECTORY ${bindir})") | ||
| 59 | install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}-standalone xbmc-standalone WORKING_DIRECTORY ${bindir})") | ||
| 60 | |||
| 61 | configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in | ||
| 62 | ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop) | ||
| 63 | install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop | ||
| 64 | DESTINATION ${datarootdir}/xsessions) | ||
| 65 | install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}.desktop xbmc.desktop WORKING_DIRECTORY ${datarootdir}/xsessions/)") | ||
| 66 | |||
| 67 | if(NOT EXISTS ${datarootdir}/xbmc) | ||
| 68 | install(CODE "execute_process (COMMAND ln -sf ${APP_NAME_LC}/ xbmc WORKING_DIRECTORY ${datarootdir})") | ||
| 69 | endif() | ||
| 70 | |||
| 71 | install(FILES ${CORE_SOURCE_DIR}/copying.txt | ||
| 72 | ${CORE_SOURCE_DIR}/LICENSE.GPL | ||
| 73 | ${CORE_SOURCE_DIR}/version.txt | ||
| 74 | ${CORE_SOURCE_DIR}/docs/README.linux | ||
| 75 | DESTINATION ${datarootdir}/doc/kodi) | ||
| 76 | |||
| 77 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop | ||
| 78 | DESTINATION ${datarootdir}/applications) | ||
| 79 | |||
| 80 | foreach(texture ${XBT_FILES}) | ||
| 81 | string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) | ||
| 82 | get_filename_component(dir ${dir} PATH) | ||
| 83 | install(FILES ${texture} | ||
| 84 | DESTINATION ${datarootdir}/kodi/${dir}) | ||
| 85 | endforeach() | ||
| 86 | |||
| 87 | foreach(wraplib ${WRAP_FILES}) | ||
| 88 | get_filename_component(dir ${wraplib} PATH) | ||
| 89 | install(PROGRAMS ${CMAKE_BINARY_DIR}/${wraplib} | ||
| 90 | DESTINATION ${libdir}/kodi/${dir}) | ||
| 91 | endforeach() | ||
| 92 | |||
| 93 | foreach(file ${install_data}) | ||
| 94 | get_filename_component(dir ${file} PATH) | ||
| 95 | install(FILES ${CMAKE_BINARY_DIR}/${file} | ||
| 96 | DESTINATION ${datarootdir}/kodi/${dir}) | ||
| 97 | endforeach() | ||
| 98 | |||
| 99 | if(EXISTS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs) | ||
| 100 | install(CODE "file(STRINGS ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/extra-installs dirs) | ||
| 101 | foreach(dir \${dirs}) | ||
| 102 | file(GLOB_RECURSE FILES RELATIVE ${CMAKE_BINARY_DIR} \${dir}/*) | ||
| 103 | foreach(file \${FILES}) | ||
| 104 | get_filename_component(dir \${file} PATH) | ||
| 105 | file(INSTALL \${file} DESTINATION ${datarootdir}/kodi/\${dir}) | ||
| 106 | endforeach() | ||
| 107 | endforeach()") | ||
| 108 | endif() | ||
| 109 | |||
| 110 | if(NOT "$ENV{DESTDIR}" STREQUAL "") | ||
| 111 | set(DESTDIR ${CMAKE_BINARY_DIR}/$ENV{DESTDIR}) | ||
| 112 | endif() | ||
| 113 | foreach(subdir ${build_dirs}) | ||
| 114 | if(NOT subdir MATCHES kodi-platform) | ||
| 115 | string(REPLACE " " ";" subdir ${subdir}) | ||
| 116 | list(GET subdir 0 id) | ||
| 117 | install(CODE "execute_process(COMMAND make -C ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${id}/src/${id}-build install DESTDIR=${DESTDIR})") | ||
| 118 | endif() | ||
| 119 | endforeach() | ||
| 120 | |||
| 121 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png | ||
| 122 | RENAME ${APP_NAME_LC}.png | ||
| 123 | DESTINATION ${datarootdir}/icons/hicolor/16x16/apps) | ||
| 124 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png | ||
| 125 | RENAME ${APP_NAME_LC}.png | ||
| 126 | DESTINATION ${datarootdir}/icons/hicolor/22x22/apps) | ||
| 127 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png | ||
| 128 | RENAME ${APP_NAME_LC}.png | ||
| 129 | DESTINATION ${datarootdir}/icons/hicolor/24x24/apps) | ||
| 130 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png | ||
| 131 | RENAME ${APP_NAME_LC}.png | ||
| 132 | DESTINATION ${datarootdir}/icons/hicolor/32x32/apps) | ||
| 133 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png | ||
| 134 | RENAME ${APP_NAME_LC}.png | ||
| 135 | DESTINATION ${datarootdir}/icons/hicolor/48x48/apps) | ||
| 136 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png | ||
| 137 | RENAME ${APP_NAME_LC}.png | ||
| 138 | DESTINATION ${datarootdir}/icons/hicolor/64x64/apps) | ||
| 139 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png | ||
| 140 | RENAME ${APP_NAME_LC}.png | ||
| 141 | DESTINATION ${datarootdir}/icons/hicolor/128x128/apps) | ||
| 142 | install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png | ||
| 143 | RENAME ${APP_NAME_LC}.png | ||
| 144 | DESTINATION ${datarootdir}/icons/hicolor/256x256/apps) | ||
| 145 | |||
| 146 | install(CODE "execute_process(COMMAND gtk-update-icon-cache -f -q -t $ENV{DESTDIR}${datarootdir}/icons/hicolor ERROR_QUIET)") | ||
