diff options
author | h.udo <hudokkow@gmail.com> | 2016-09-08 16:42:58 +0100 |
---|---|---|
committer | h.udo <hudokkow@gmail.com> | 2016-12-21 10:04:18 +0000 |
commit | b0cad85adb045b88347cf8cded6770c7dd349406 (patch) | |
tree | 1a0b452f530dd2aa4e139c8e6de3f18b01a66bf2 | |
parent | a18701e7b2fe03780f90502d5d51e09cdc3ad718 (diff) |
[cmake] Move to root folder: Update paths
41 files changed, 359 insertions, 349 deletions
diff --git a/.gitignore b/.gitignore index d6305916d2..6dfd93fae2 100644 --- a/.gitignore +++ b/.gitignore @@ -208,15 +208,15 @@ lib/cpluff/stamp-h1 /project/obj /project/output -# /project/cmake -/project/cmake/KodiConfig.cmake -/project/cmake/addons/*.error -/project/cmake/addons/.failure -/project/cmake/addons/.success -/project/cmake/addons/addons -/project/cmake/addons/build -/project/cmake/addons/depends/build -/project/cmake/addons/output +# /cmake +/cmake/KodiConfig.cmake +/cmake/addons/*.error +/cmake/addons/.failure +/cmake/addons/.success +/cmake/addons/addons +/cmake/addons/build +/cmake/addons/depends/build +/cmake/addons/output # /project/Win32BuildSetup/ /project/Win32BuildSetup/*.log diff --git a/.travis.yml b/.travis.yml index 2dd1d0c4e3..b1922533eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,14 +90,14 @@ before_script: cd $TRAVIS_BUILD_DIR/build; fi - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" && "$CXX" == "g++" ]]; then - cmake -DCMAKE_BUILD_TYPE=Debug ../project/cmake; + cmake -DCMAKE_BUILD_TYPE=Debug ..; fi - if [[ "$TRAVIS_OS_NAME" == "linux" && "$BUILD" == "Kodi" && "$CXX" == "clang++" ]]; then - cmake -DCMAKE_CXX_FLAGS="-Qunused-arguments" ../project/cmake; + cmake -DCMAKE_CXX_FLAGS="-Qunused-arguments" ..; fi - if [[ "$BUILD" != "Kodi" ]] && [[ "$ADDONS" == "adsp" || "$ADDONS" == "audiodecoder" || "$ADDONS" == "audioencoder" || "$ADDONS" == "pvr" || "$ADDONS" == "screensaver" || "$ADDONS" == "visualization" ]]; then - cd $TRAVIS_BUILD_DIR/project/cmake/addons && + cd $TRAVIS_BUILD_DIR/cmake/addons && mkdir -p build && cd build/ && cmake ../bootstrap -DCMAKE_BUILD_TYPE=Debug && @@ -115,7 +115,7 @@ script: "$ADDONS" == "pvr" || "$ADDONS" == "screensaver" || "$ADDONS" == "visualization" ]]; then cd $TRAVIS_BUILD_DIR/ && mkdir -p build && - cmake -DADDONS_TO_BUILD="$ADDONS".* -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../addons $TRAVIS_BUILD_DIR/project/cmake/addons && + cmake -DADDONS_TO_BUILD="$ADDONS".* -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=../addons $TRAVIS_BUILD_DIR/cmake/addons && make -j4; fi diff --git a/CMakeLists.txt b/CMakeLists.txt index 861c3d5f1b..e1ceff5fbe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,18 +1,17 @@ cmake_minimum_required(VERSION 3.1) project(kodi LANGUAGES CXX C ASM) -list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/modules) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) if(DEPENDS_DIR) list(APPEND CMAKE_PREFIX_PATH ${DEPENDS_DIR}) endif() -# Set CORE_SOURCE_DIR and CORE_BUILD_DIR -get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../.. ABSOLUTE) +# Set CORE_BUILD_DIR set(CORE_BUILD_DIR build) -message(STATUS "Source directory: ${CORE_SOURCE_DIR}") +message(STATUS "Source directory: ${CMAKE_SOURCE_DIR}") message(STATUS "Build directory: ${CMAKE_BINARY_DIR}") -if(CMAKE_BINARY_DIR STREQUAL CORE_SOURCE_DIR) +if(CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) message(WARNING "In-source build detected. It is recommended to build out-of-source.") endif() @@ -22,13 +21,13 @@ if(NOT VERBOSE) endif() # Includes -include(modules/extra/ECMEnableSanitizers.cmake) -include(scripts/common/GeneratorSetup.cmake) -include(scripts/common/AddOptions.cmake) -include(scripts/common/ArchSetup.cmake) -include(scripts/common/Macros.cmake) -include(scripts/common/ProjectMacros.cmake) -include(scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake) +include(cmake/modules/extra/ECMEnableSanitizers.cmake) +include(cmake/scripts/common/GeneratorSetup.cmake) +include(cmake/scripts/common/AddOptions.cmake) +include(cmake/scripts/common/ArchSetup.cmake) +include(cmake/scripts/common/Macros.cmake) +include(cmake/scripts/common/ProjectMacros.cmake) +include(cmake/scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake) include(ExternalProject) # Languages and global compiler settings @@ -84,12 +83,12 @@ add_custom_target(${APP_NAME_LC}-libraries) set(LIBRARY_FILES "" CACHE STRING "" FORCE) mark_as_advanced(LIBRARY_FILES) -set(INCLUDES ${CORE_SOURCE_DIR} - ${CORE_SOURCE_DIR}/lib - ${CORE_SOURCE_DIR}/lib/gtest/include - ${CORE_SOURCE_DIR}/xbmc - ${CORE_SOURCE_DIR}/xbmc/${PLATFORM_DIR} - ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer +set(INCLUDES ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/lib + ${CMAKE_SOURCE_DIR}/lib/gtest/include + ${CMAKE_SOURCE_DIR}/xbmc + ${CMAKE_SOURCE_DIR}/xbmc/${PLATFORM_DIR} + ${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}) find_package(PkgConfig) @@ -235,18 +234,18 @@ endif() add_custom_command(OUTPUT ${CORE_BUILD_DIR}/xbmc/CompileInfo.cpp ${CMAKE_BINARY_DIR}/addons/xbmc.addon/addon.xml ${CMAKE_BINARY_DIR}/addons/kodi.guilib/addon.xml - COMMAND ${CMAKE_COMMAND} -DCORE_SOURCE_DIR=${CORE_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} -DCORE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} -DCORE_BUILD_DIR=${CORE_BUILD_DIR} -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR} -DARCH_DEFINES="${ARCH_DEFINES}" -DAPP_SCMID=${APP_SCMID} -Dprefix=${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR} - -P ${PROJECT_SOURCE_DIR}/scripts/common/GenerateVersionedFiles.cmake - DEPENDS ${CORE_SOURCE_DIR}/version.txt - ${CORE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in - ${CORE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in - ${CORE_SOURCE_DIR}/xbmc/CompileInfo.cpp.in) + -P ${CMAKE_SOURCE_DIR}/cmake/scripts/common/GenerateVersionedFiles.cmake + DEPENDS ${CMAKE_SOURCE_DIR}/version.txt + ${CMAKE_SOURCE_DIR}/addons/xbmc.addon/addon.xml.in + ${CMAKE_SOURCE_DIR}/addons/kodi.guilib/addon.xml.in + ${CMAKE_SOURCE_DIR}/xbmc/CompileInfo.cpp.in) list(APPEND install_data addons/xbmc.addon/addon.xml) list(APPEND install_data addons/xbmc.json/addon.xml) list(APPEND install_data addons/kodi.guilib/addon.xml) @@ -256,11 +255,11 @@ target_compile_options(compileinfo PRIVATE "${SYSTEM_DEFINES}") # RC File if(WIN32) - configure_file(${CORE_SOURCE_DIR}/xbmc/platform/win32/XBMC_PC.rc.in + configure_file(${CMAKE_SOURCE_DIR}/xbmc/platform/win32/XBMC_PC.rc.in ${CORE_BUILD_DIR}/xbmc/platform/win32/XBMC_PC.rc @ONLY) add_library(resources OBJECT ${CORE_BUILD_DIR}/xbmc/platform/win32/XBMC_PC.rc) set_target_properties(resources PROPERTIES FOLDER "Build Utilities") - target_include_directories(resources PRIVATE ${CORE_SOURCE_DIR}/tools/windows/packaging/media) + target_include_directories(resources PRIVATE ${CMAKE_SOURCE_DIR}/tools/windows/packaging/media) set(RESOURCES $<TARGET_OBJECTS:resources>) endif() @@ -274,15 +273,15 @@ mark_as_advanced(core_DEPENDS) mark_as_advanced(test_archives) mark_as_advanced(test_sources) -add_subdirectory(${CORE_SOURCE_DIR}/lib/gtest ${CORE_BUILD_DIR}/gtest EXCLUDE_FROM_ALL) +add_subdirectory(${CMAKE_SOURCE_DIR}/lib/gtest ${CORE_BUILD_DIR}/gtest EXCLUDE_FROM_ALL) set_target_properties(gtest PROPERTIES FOLDER "External Projects") # copy files to build tree -copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/common/*.txt - ${PROJECT_SOURCE_DIR}/installdata/${CORE_SYSTEM_NAME}/*.txt) +copy_files_from_filelist_to_buildtree(${CMAKE_SOURCE_DIR}/cmake/installdata/common/*.txt + ${CMAKE_SOURCE_DIR}/cmake/installdata/${CORE_SYSTEM_NAME}/*.txt) -list(APPEND SKINS "${CORE_SOURCE_DIR}/addons/skin.estuary\;${CORE_SOURCE_DIR}") -list(APPEND SKINS "${CORE_SOURCE_DIR}/addons/skin.estouchy\;${CORE_SOURCE_DIR}") +list(APPEND SKINS "${CMAKE_SOURCE_DIR}/addons/skin.estuary\;${CMAKE_SOURCE_DIR}") +list(APPEND SKINS "${CMAKE_SOURCE_DIR}/addons/skin.estouchy\;${CMAKE_SOURCE_DIR}") # These are skins that are copied into place from the source tree foreach(skin ${SKINS}) @@ -299,10 +298,10 @@ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/system/players/VideoPlayer) set(LIBCEC_SONAME "${CEC_SONAME}") if(NOT CORE_SYSTEM_NAME STREQUAL windows AND NOT CORE_SYSTEM_NAME STREQUAL android) - configure_file(${CORE_SOURCE_DIR}/xbmc/DllPaths_generated.h.in + configure_file(${CMAKE_SOURCE_DIR}/xbmc/DllPaths_generated.h.in ${CORE_BUILD_DIR}/DllPaths_generated.h @ONLY) elseif(CORE_SYSTEM_NAME STREQUAL android) - configure_file(${CORE_SOURCE_DIR}/xbmc/DllPaths_generated_android.h.in + configure_file(${CMAKE_SOURCE_DIR}/xbmc/DllPaths_generated_android.h.in ${CORE_BUILD_DIR}/DllPaths_generated_android.h @ONLY) endif() @@ -312,22 +311,22 @@ set_target_properties(lib${APP_NAME_LC} PROPERTIES PREFIX "") add_dependencies(lib${APP_NAME_LC} libcpluff ffmpeg dvdnav crossguid) # Codegen -add_subdirectory(${CORE_SOURCE_DIR}/xbmc/interfaces/swig build/swig) +add_subdirectory(${CMAKE_SOURCE_DIR}/xbmc/interfaces/swig build/swig) # Other files (IDE) -set(OTHER_FILES README.md) +set(OTHER_FILES cmake/README.md) # Subdirs -core_add_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/common/*.txt - ${PROJECT_SOURCE_DIR}/treedata/${CORE_SYSTEM_NAME}/*.txt) -core_add_optional_subdirs_from_filelist(${PROJECT_SOURCE_DIR}/treedata/optional/common/*.txt - ${PROJECT_SOURCE_DIR}/treedata/optional/${CORE_SYSTEM_NAME}/*.txt) +core_add_subdirs_from_filelist(${CMAKE_SOURCE_DIR}/cmake/treedata/common/*.txt + ${CMAKE_SOURCE_DIR}/cmake/treedata/${CORE_SYSTEM_NAME}/*.txt) +core_add_optional_subdirs_from_filelist(${CMAKE_SOURCE_DIR}/cmake/treedata/optional/common/*.txt + ${CMAKE_SOURCE_DIR}/cmake/treedata/optional/${CORE_SYSTEM_NAME}/*.txt) target_link_libraries(lib${APP_NAME_LC} PUBLIC ${core_DEPENDS} ${SYSTEM_LDFLAGS} ${DEPLIBS} ${CMAKE_DL_LIBS}) set_target_properties(lib${APP_NAME_LC} PROPERTIES PROJECT_LABEL "xbmc") -source_group_by_folder(lib${APP_NAME_LC} RELATIVE ${CORE_SOURCE_DIR}/xbmc) +source_group_by_folder(lib${APP_NAME_LC} RELATIVE ${CMAKE_SOURCE_DIR}/xbmc) if(WIN32) - add_precompiled_header(lib${APP_NAME_LC} pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) + add_precompiled_header(lib${APP_NAME_LC} pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) set_language_cxx(lib${APP_NAME_LC}) endif() @@ -346,25 +345,25 @@ unset(_MAIN_LIBRARIES) if(WIN32) set_target_properties(${APP_NAME_LC} PROPERTIES WIN32_EXECUTABLE ON) set_property(DIRECTORY PROPERTY VS_STARTUP_PROJECT ${APP_NAME_LC}) - target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/win32/app.manifest) + target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/app.manifest) elseif(CORE_SYSTEM_NAME STREQUAL android) # Nothing elseif(CORE_SYSTEM_NAME STREQUAL ios) set_target_properties(${APP_NAME_LC} PROPERTIES OUTPUT_NAME ${APP_NAME} - MACOSX_BUNDLE_INFO_PLIST ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in) + MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Info.plist.in) else() set_target_properties(${APP_NAME_LC} PROPERTIES SUFFIX ".bin") endif() # testing -copy_files_from_filelist_to_buildtree(${PROJECT_SOURCE_DIR}/installdata/test-reference-data.txt NO_INSTALL) -add_executable(${APP_NAME_LC}-test EXCLUDE_FROM_ALL ${CORE_SOURCE_DIR}/xbmc/test/xbmc-test.cpp ${test_sources}) +copy_files_from_filelist_to_buildtree(${CMAKE_SOURCE_DIR}/cmake/installdata/test-reference-data.txt NO_INSTALL) +add_executable(${APP_NAME_LC}-test EXCLUDE_FROM_ALL ${CMAKE_SOURCE_DIR}/xbmc/test/xbmc-test.cpp ${test_sources}) whole_archive(_TEST_LIBRARIES ${core_DEPENDS} gtest) target_link_libraries(${APP_NAME_LC}-test PRIVATE ${SYSTEM_LDFLAGS} ${_TEST_LIBRARIES} lib${APP_NAME_LC} ${DEPLIBS} ${CMAKE_DL_LIBS}) unset(_TEST_LIBRARIES) add_dependencies(${APP_NAME_LC}-test ${APP_NAME_LC}-libraries export-files) if(WIN32) - add_precompiled_header(${APP_NAME_LC}-test pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) + add_precompiled_header(${APP_NAME_LC}-test pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) endif() # Enable unit-test related targets @@ -385,14 +384,14 @@ if(CORE_HOST_IS_TARGET) endif() # For testing commit series - add_custom_target(check-commits ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/CheckCommits.cmake + add_custom_target(check-commits ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/cmake/scripts/common/CheckCommits.cmake -DCMAKE_BINARY_DIR=${CMAKE_BINARY_DIR}) set_target_properties(check-commits PROPERTIES FOLDER "Build Utilities") # code coverage if(CMAKE_BUILD_TYPE STREQUAL Coverage) - if(EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake) - include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake) + if(EXISTS ${CMAKE_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake) + include(${CMAKE_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/CodeCoverage.cmake) else() message(FATAL_ERROR "Code coverage not (yet) implemented for platform ${CORE_SYSTEM_NAME}") endif() @@ -402,9 +401,9 @@ if(CORE_HOST_IS_TARGET) find_package(Doxygen) if(DOXYGEN_FOUND) add_custom_target(doc - COMMAND ${DOXYGEN_EXECUTABLE} ${CORE_SOURCE_DIR}/doxygen_resources/Doxyfile.doxy - COMMAND ${CMAKE_COMMAND} -E echo "Documentation built to: file://${CORE_SOURCE_DIR}/docs/html/index.html" - WORKING_DIRECTORY ${CORE_SOURCE_DIR}/doxygen_resources + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_SOURCE_DIR}/doxygen_resources/Doxyfile.doxy + COMMAND ${CMAKE_COMMAND} -E echo "Documentation built to: file://${CMAKE_SOURCE_DIR}/docs/html/index.html" + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/doxygen_resources COMMENT "Generating Doxygen documentation" VERBATIM) endif() endif() @@ -418,15 +417,15 @@ if(FFMPEG_CREATE_SHARED_LIBRARY) endif() # Platform specific additional extra targets -if(EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake) - include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake) +if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake) + include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ExtraTargets.cmake) endif() -include(scripts/${CORE_SYSTEM_NAME}/Install.cmake) +include(cmake/scripts/${CORE_SYSTEM_NAME}/Install.cmake) # Add uninstall target if(CMAKE_GENERATOR MATCHES Makefile) - add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/scripts/common/Uninstall.cmake) + add_custom_target(uninstall COMMAND ${CMAKE_COMMAND} -P ${CMAKE_SOURCE_DIR}/scripts/common/Uninstall.cmake) set_target_properties(uninstall PROPERTIES FOLDER "Build Utilities") endif() @@ -443,31 +442,31 @@ if(CMAKE_GENERATOR STREQUAL "Unix Makefiles") set(_prefix ${CMAKE_INSTALL_PREFIX}) endif() add_custom_target(binary-addons - COMMAND $(MAKE) -C ${CORE_SOURCE_DIR}/tools/depends/target/binary-addons clean - COMMAND $(MAKE) -C ${CORE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99 + COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons clean + COMMAND $(MAKE) -C ${CMAKE_SOURCE_DIR}/tools/depends/target/binary-addons VERBOSE=1 V=99 PREFIX=${_prefix} INSTALL_PREFIX=${_prefix} ${_cross_args} ${_extra}) unset(_cross_args) unset(_prefix) endif() # Prepare add-on build env -core_file_read_filtered(bindings ${CORE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk) +core_file_read_filtered(bindings ${CMAKE_SOURCE_DIR}/xbmc/addons/addon-bindings.mk) foreach(binding ${bindings}) string(REPLACE " =" ";" binding "${binding}") string(REPLACE "+=" ";" binding "${binding}") list(GET binding 1 header) get_filename_component(file ${header} NAME) - configure_file(${CORE_SOURCE_DIR}/${header} ${CORE_BUILD_DIR}/include/${APP_NAME_LC}/${file} COPYONLY) + configure_file(${CMAKE_SOURCE_DIR}/${header} ${CORE_BUILD_DIR}/include/${APP_NAME_LC}/${file} COPYONLY) endforeach() set(APP_LIB_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${APP_NAME_LC}) set(APP_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include/${APP_NAME_LC}) set(CXX11_SWITCH "-std=c++11") -configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in +configure_file(${CMAKE_SOURCE_DIR}/cmake/KodiConfig.cmake.in ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/${APP_NAME}Config.cmake @ONLY) -configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddonHelpers.cmake +configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/common/AddonHelpers.cmake ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddonHelpers.cmake COPYONLY) -configure_file(${PROJECT_SOURCE_DIR}/scripts/common/AddOptions.cmake +configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake ${CORE_BUILD_DIR}/lib/${APP_NAME_LC}/AddOptions.cmake COPYONLY) # Status diff --git a/appveyor.yml b/appveyor.yml index 21881ac0f8..f91c1e840a 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -59,7 +59,7 @@ build_script: # Build mkdir $env:APPVEYOR_BUILD_FOLDER\kodi-build cd $env:APPVEYOR_BUILD_FOLDER\kodi-build - cmd /c 'cmake -G "Visual Studio 14" ..\project\cmake 2>&1' + cmd /c 'cmake -G "Visual Studio 14" .. 2>&1' cmd /c 'cmake --build . --target all_build --config RelWithDebInfo 2>&1' } @@ -80,7 +80,7 @@ build_script: -G "NMake Makefiles" ` -DCMAKE_BUILD_TYPE="$env:CONFIG" ` -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER"\addons ` - $env:APPVEYOR_BUILD_FOLDER\project\cmake\addons + $env:APPVEYOR_BUILD_FOLDER\cmake\addons # Build selected addons one by one $addons_success="" $addons_failed="" diff --git a/cmake/README.md b/cmake/README.md index f3d727e548..75ea2677fe 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -82,7 +82,7 @@ mkdir kodi-build && cd kodi-build ### Linux with GNU Makefiles ``` -cmake <KODI_SRC>/project/cmake/ +cmake <KODI_SRC> cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) ./kodi.bin ``` @@ -108,14 +108,14 @@ Generated packages can be found in <BUILD_DIR>/packages. ### Raspberry Pi with GNU Makefiles ``` -cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC>/project/cmake/ +cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC> cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) ``` ### Windows with Visual Studio project files ``` -cmake -G "Visual Studio 14" <KODI_SRC>/project/cmake/ +cmake -G "Visual Studio 14" <KODI_SRC> cmake --build . --config "Debug" # or: Build solution with Visual Studio Debug\kodi.exe ``` @@ -128,7 +128,7 @@ builds an installable package for Windows. ### Windows with NMake Makefiles ``` -cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release <KODI_SRC>/project/cmake/ +cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release <KODI_SRC> cmake --build . # or: nmake kodi.exe ``` @@ -136,7 +136,7 @@ kodi.exe ### macOS with GNU Makefiles ``` -cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC>/project/cmake/ +cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC> cmake --build . -- VERBOSE=1 -j$(sysctl -n hw.ncpu) # or: make VERBOSE=1 -j$(sysctl -n hw.ncpu) ./kodi.bin ``` @@ -144,7 +144,7 @@ cmake --build . -- VERBOSE=1 -j$(sysctl -n hw.ncpu) # or: make VERBOSE=1 -j$(sy ### macOS with Xcode project files ``` -cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake -G "Xcode" <KODI_SRC>/project/cmake/ +cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake -G "Xcode" <KODI_SRC> cmake --build . --config "Release" -- -verbose -jobs $(sysctl -n hw.ncpu) # or: Build solution with Xcode ./Release/kodi.bin ``` @@ -168,7 +168,7 @@ make deb ### Android with GNU Makefiles ``` -cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC>/project/cmake/ +cmake -DCMAKE_TOOLCHAIN_FILE=<KODI_SRC>/tools/depends/target/Toolchain.cmake <KODI_SRC> cmake --build . -- VERBOSE=1 -j$(nproc) # or: make VERBOSE=1 -j$(nproc) ``` @@ -203,7 +203,7 @@ cmake ... -DFFMPEG_PATH=/opt/ffmpeg -DENABLE_INTERNAL_FFMPEG=OFF ... ``` For more information and an updated list of option, please check the -main [project/cmake/CMakeLists.txt](https://github.com/xbmc/xbmc/tree/master/project/cmake/CMakeLists.txt). +main [CMakeLists.txt](https://github.com/xbmc/xbmc/tree/master/CMakeLists.txt). ## Tests @@ -261,7 +261,7 @@ paths are used, they are considered relative to the build directory in which Both methods work only for already existing addons. See this [forum thread](http://forum.kodi.tv/showthread.php?tid=219166&pid=1934922#pid1934922) -and [addons/README.md](https://github.com/xbmc/xbmc/blob/master/project/cmake/addons/README.md) +and [addons/README.md](https://github.com/xbmc/xbmc/blob/master/cmake/addons/README.md) for addon development and detailed documentation about the addon build system. ## Sanitizers @@ -269,7 +269,7 @@ for addon development and detailed documentation about the addon build system. Clang and GCC support different kinds of Sanitizers. To enable a Sanitizer call CMake with the option `-DECM_ENABLE_SANITIZERS=’san1;san2;...'`. For more information about enabling the Sanitizers read the documentation in -[modules/extra/ECMEnableSanitizers.cmake](https://github.com/xbmc/xbmc/tree/master/project/cmake/modules/extra/ECMEnableSanitizers.cmake). +[modules/extra/ECMEnableSanitizers.cmake](https://github.com/xbmc/xbmc/tree/master/cmake/modules/extra/ECMEnableSanitizers.cmake). It is also recommended to read the sections about the Sanitizers in the [Clang documentation](http://clang.llvm.org/docs/). diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt index 96e544bb44..f1e2fce04a 100644 --- a/cmake/addons/CMakeLists.txt +++ b/cmake/addons/CMakeLists.txt @@ -31,7 +31,7 @@ if(APP_ROOT) message(WARNING "APP_ROOT is deprecated. Please use CORE_SOURCE_DIR instead.") endif() if(NOT CORE_SOURCE_DIR) - set(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../..) + set(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../..) else() file(TO_CMAKE_PATH "${CORE_SOURCE_DIR}" CORE_SOURCE_DIR) endif() @@ -52,7 +52,7 @@ endif() get_filename_component(ADDON_DEPENDS_PATH "${ADDON_DEPENDS_PATH}" ABSOLUTE) if(NOT PLATFORM_DIR) - set(PLATFORM_DIR ${CORE_SOURCE_DIR}/project/cmake/platform/${CORE_SYSTEM_NAME}) + set(PLATFORM_DIR ${CORE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}) file(TO_CMAKE_PATH "${PLATFORM_DIR}" PLATFORM_DIR) endif() @@ -155,7 +155,7 @@ if(EXISTS ${PLATFORM_DIR}/defines.txt) endif() # include check_target_platform() function -include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake) +include(${CORE_SOURCE_DIR}/cmake/scripts/common/CheckTargetPlatform.cmake) set(ADDON_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}) if(NOT WIN32) @@ -171,7 +171,7 @@ endif() ### prepare the build environment for the binary addons # copy the PrepareEnv.cmake script to the depends path so that we can include it -file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake DESTINATION ${APP_LIB_DIR}) +file(COPY ${CORE_SOURCE_DIR}/cmake/scripts/common/PrepareEnv.cmake DESTINATION ${APP_LIB_DIR}) # add the location of PrepareEnv.cmake to CMAKE_MODULE_PATH so that it is found list(APPEND CMAKE_MODULE_PATH ${APP_LIB_DIR}) @@ -371,7 +371,7 @@ foreach(addon ${addons}) set(${id}_DEPENDS_DIR ${SOURCE_DIR}/depends) if(EXISTS ${${id}_DEPENDS_DIR}) - include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake) + include(${CORE_SOURCE_DIR}/cmake/scripts/common/HandleDepends.cmake) add_addon_depends(${id} ${${id}_DEPENDS_DIR}) if(${id}_DEPS AND NOT "${${id}_DEPS}" STREQUAL "") message(STATUS "${id} DEPENDENCIES: ${${id}_DEPS}") diff --git a/cmake/addons/depends/CMakeLists.txt b/cmake/addons/depends/CMakeLists.txt index 622701de79..831e0ed74c 100644 --- a/cmake/addons/depends/CMakeLists.txt +++ b/cmake/addons/depends/CMakeLists.txt @@ -29,7 +29,7 @@ endif() get_filename_component(BUILD_DIR "${BUILD_DIR}" ABSOLUTE) ## use add_addon_depends to handle the cmake based dependencies -include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake) +include(${CORE_SOURCE_DIR}/cmake/scripts/common/HandleDepends.cmake) add_addon_depends(depends "${PROJECT_SOURCE_DIR}") ## if there's a platform-specific sub-directory containing a CMakeLists.txt, add it to the build as well diff --git a/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt b/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt index 2c2c4b8e3f..bb854053de 100644 --- a/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt +++ b/cmake/addons/depends/windows/cmake/mingw/CMakeLists.txt @@ -6,7 +6,7 @@ function(generate_mingw32_wrapper cmd) configure_file(${PROJECT_SOURCE_DIR}/mingw32-cmd.bat.in ${MINGW_PATH}/bin/${CMD}.bat @ONLY) endfunction() -get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../../.. REALPATH) +get_filename_component(CORE_SOURCE_DIR ${PROJECT_SOURCE_DIR}/../../../../../.. REALPATH) set(MSYS_PATH "${CORE_SOURCE_DIR}/project/BuildDependencies/msys64") set(MINGW_PATH "${MSYS_PATH}/mingw32") diff --git a/cmake/cpack/CPackConfigDEB.cmake b/cmake/cpack/CPackConfigDEB.cmake index cb8e59e840..b7b4d8c048 100644 --- a/cmake/cpack/CPackConfigDEB.cmake +++ b/cmake/cpack/CPackConfigDEB.cmake @@ -1,5 +1,5 @@ # include Macros.cmake to automate generation of time/date stamps, maintainer, etc. -include(${PROJECT_SOURCE_DIR}/scripts/common/Macros.cmake) +include(${CMAKE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake) # find stuff we need find_program(LSB_RELEASE_CMD lsb_release) @@ -73,7 +73,6 @@ endif() # package name string(TIMESTAMP PACKAGE_TIMESTAMP "%Y%m%d.%H%M" UTC) set(PACKAGE_NAME_VERSION ${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${RELEASE_IDENTIFIER}-${DISTRO_CODENAME}) -unset(RELEASE_IDENTIFIER) # package version if(DEBIAN_PACKAGE_EPOCH) @@ -102,7 +101,7 @@ endif() # package description common to all packages if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION) - file(STRINGS ${PROJECT_SOURCE_DIR}/cpack/deb/package-description.txt DESC_LINES) + file(STRINGS ${CMAKE_SOURCE_DIR}/cmake/cpack/deb/package-description.txt DESC_LINES) foreach(LINE IN LISTS DESC_LINES) set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "${CPACK_DEBIAN_PACKAGE_DESCRIPTION} ${LINE}\n") endforeach() @@ -119,10 +118,10 @@ rfc2822stamp() # two spaces between maintainer and timestamp is NOT a mistake set(CHANGELOG_FOOTER " -- ${CPACK_DEBIAN_PACKAGE_MAINTAINER} ${RFC2822_TIMESTAMP}") -if(GIT_FOUND AND GZIP_CMD AND EXISTS ${CORE_SOURCE_DIR}/.git) +if(GIT_FOUND AND GZIP_CMD AND EXISTS ${CMAKE_SOURCE_DIR}/.git) execute_process(COMMAND ${GIT_EXECUTABLE} log --no-merges --pretty=format:"%n [%an]%n * %s" --since="last month" OUTPUT_VARIABLE CHANGELOG - WORKING_DIRECTORY ${CORE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE) string(REPLACE "\"" "" CHANGELOG ${CHANGELOG}) file(WRITE ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian ${CHANGELOG_HEADER}\n${CHANGELOG}\n\n${CHANGELOG_FOOTER}) @@ -135,7 +134,7 @@ else() endif() # Generate NEWS.Debian -configure_file(${PROJECT_SOURCE_DIR}/cpack/deb/NEWS.Debian +configure_file(${CMAKE_SOURCE_DIR}/cmake/cpack/deb/NEWS.Debian ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian @ONLY) if(GZIP_CMD) execute_process(COMMAND ${GZIP_CMD} -f -9 -n ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian) @@ -144,18 +143,18 @@ else() endif() # Generate man pages -configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi.bin.1 +configure_file(${CMAKE_SOURCE_DIR}/docs/manpages/kodi.bin.1 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.1 COPYONLY) -configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi.bin.1 +configure_file(${CMAKE_SOURCE_DIR}/docs/manpages/kodi.bin.1 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi.bin.1 COPYONLY) -configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-standalone.1 +configure_file(${CMAKE_SOURCE_DIR}/docs/manpages/kodi-standalone.1 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-standalone.1 COPYONLY) if(ENABLE_EVENTCLIENTS) - configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-ps3remote.1 + configure_file(${CMAKE_SOURCE_DIR}/docs/manpages/kodi-ps3remote.1 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-ps3remote.1 COPYONLY) - configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-send.1 + configure_file(${CMAKE_SOURCE_DIR}/docs/manpages/kodi-send.1 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-send.1 COPYONLY) - configure_file(${CORE_SOURCE_DIR}/docs/manpages/kodi-wiiremote.1 + configure_file(${CMAKE_SOURCE_DIR}/docs/manpages/kodi-wiiremote.1 ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1 COPYONLY) endif() @@ -190,7 +189,7 @@ install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/kodi-wiiremote.1.gz endif() # configure package metadata files -file(GLOB DEBIAN_PACKAGE_FILES ${PROJECT_SOURCE_DIR}/cpack/deb/packages/*.txt.in) +file(GLOB DEBIAN_PACKAGE_FILES ${CMAKE_SOURCE_DIR}/cmake/cpack/deb/packages/*.txt.in) foreach(file ${DEBIAN_PACKAGE_FILES}) get_filename_component(package ${file} NAME_WE) # filter eventclients so we don't have to support two more deps @@ -304,18 +303,18 @@ ${DEB_PACKAGE_DESCRIPTION_FOOTER}") install(FILES ${CPACK_PACKAGE_DIRECTORY}/deb/changelog.Debian.gz ${CPACK_PACKAGE_DIRECTORY}/deb/NEWS.Debian.gz - ${PROJECT_SOURCE_DIR}/cpack/deb/copyright + ${CMAKE_SOURCE_DIR}/cmake/cpack/deb/copyright DESTINATION share/doc/${file} COMPONENT ${file}) # kodi package exclusive files if(CPACK_DEBIAN_KODI_PACKAGE_NAME) set(CPACK_DEBIAN_KODI_PACKAGE_CONTROL_EXTRA - "${PROJECT_SOURCE_DIR}/cpack/deb/postinst;${PROJECT_SOURCE_DIR}/cpack/deb/postrm") - install(FILES ${PROJECT_SOURCE_DIR}/cpack/deb/lintian/overrides/kodi + "${CMAKE_SOURCE_DIR}/cmake/cpack/deb/postinst;${CMAKE_SOURCE_DIR}/cmake/cpack/deb/postrm") + install(FILES ${CMAKE_SOURCE_DIR}/cmake/cpack/deb/lintian/overrides/kodi DESTINATION share/lintian/overrides COMPONENT kodi) - install(FILES ${PROJECT_SOURCE_DIR}/cpack/deb/menu/kodi + install(FILES ${CMAKE_SOURCE_DIR}/cmake/cpack/deb/menu/kodi DESTINATION share/menu COMPONENT kodi) endif() @@ -327,10 +326,8 @@ unset(DEBIAN_PACKAGES) set(CPACK_SOURCE_GENERATOR TGZ) # source package name -set(CPACK_SOURCE_PACKAGE_FILE_NAME ${APP_NAME_LC}_${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${GIT_HASH}.orig) - -# source dir -set(CMAKE_SOURCE_DIR ${CORE_SOURCE_DIR}) +set(CPACK_SOURCE_PACKAGE_FILE_NAME ${APP_NAME_LC}_${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}~git${PACKAGE_TIMESTAMP}-${RELEASE_IDENTIFIER}.orig) +unset(RELEASE_IDENTIFIER) # ignore files for source package set(CPACK_SOURCE_IGNORE_FILES diff --git a/cmake/cpack/deb/copyright b/cmake/cpack/deb/copyright index a79cf54f63..ba82f18883 100644 --- a/cmake/cpack/deb/copyright +++ b/cmake/cpack/deb/copyright @@ -1,7 +1,7 @@ Kodi is downloaded from http://kodi.tv/. Orig tarballs are generated from the script located at -https://github.com/Kodi/Kodi/tree/master/project/cmake. The -orig tarball is generated using the sources in https://github.com/Kodi/Kodi. +https://github.com/xbmc/xbmc/. The orig tarball is +generated using the sources in https://github.com/xbmc/xbmc/. Main Contact: "Team-Kodi" <team at kodi dot tv> diff --git a/cmake/modules/FindCpluff.cmake b/cmake/modules/FindCpluff.cmake index ce6c127cb5..3705bd8196 100644 --- a/cmake/modules/FindCpluff.cmake +++ b/cmake/modules/FindCpluff.cmake @@ -17,10 +17,10 @@ if(NOT WIN32) set(cppflags "-arch ${CPU}") endif() - ExternalProject_Add(libcpluff SOURCE_DIR ${CORE_SOURCE_DIR}/lib/cpluff + ExternalProject_Add(libcpluff SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/cpluff BUILD_IN_SOURCE 1 PREFIX ${CORE_BUILD_DIR}/cpluff - CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CORE_SOURCE_DIR}/lib/cpluff/configure + CONFIGURE_COMMAND CC=${CMAKE_C_COMPILER} ${CMAKE_SOURCE_DIR}/lib/cpluff/configure --disable-nls --enable-static --disable-shared diff --git a/cmake/modules/FindCrossGUID.cmake b/cmake/modules/FindCrossGUID.cmake index ba2823a7ae..0f0d72099a 100644 --- a/cmake/modules/FindCrossGUID.cmake +++ b/cmake/modules/FindCrossGUID.cmake @@ -1,6 +1,6 @@ if(ENABLE_INTERNAL_CROSSGUID) include(ExternalProject) - file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/Makefile VER) + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/Makefile VER) string(REGEX MATCH "VERSION=[^ ]*" CGUID_VER "${VER}") list(GET CGUID_VER 0 CGUID_VER) string(SUBSTRING "${CGUID_VER}" 8 -1 CGUID_VER) @@ -30,13 +30,13 @@ if(ENABLE_INTERNAL_CROSSGUID) -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE} "${EXTRA_ARGS}" PATCH_COMMAND ${CMAKE_COMMAND} -E copy - ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/CMakeLists.txt + ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/CMakeLists.txt <SOURCE_DIR> && ${CMAKE_COMMAND} -E copy - ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake + ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindUUID.cmake <SOURCE_DIR> && ${CMAKE_COMMAND} -E copy - ${CORE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake + ${CMAKE_SOURCE_DIR}/tools/depends/target/crossguid/FindCXX11.cmake <SOURCE_DIR> BUILD_BYPRODUCTS ${CROSSGUID_LIBRARY}) set_target_properties(crossguid PROPERTIES FOLDER "External Projects") diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index 3d7fcc8ca3..d38fba503b 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -211,7 +211,7 @@ endif() # Internal FFMPEG if(NOT FFMPEG_FOUND) include(ExternalProject) - file(STRINGS ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER) + file(STRINGS ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FFMPEG-VERSION VER) string(REGEX MATCH "VERSION=[^ ]*$.*" FFMPEG_VER "${VER}") list(GET FFMPEG_VER 0 FFMPEG_VER) string(SUBSTRING "${FFMPEG_VER}" 8 -1 FFMPEG_VER) @@ -256,10 +256,10 @@ if(NOT FFMPEG_FOUND) -DCORE_SYSTEM_NAME=${CORE_SYSTEM_NAME} ${CROSS_ARGS} PATCH_COMMAND ${CMAKE_COMMAND} -E copy - ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt + ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/CMakeLists.txt <SOURCE_DIR> && ${CMAKE_COMMAND} -E copy - ${CORE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake + ${CMAKE_SOURCE_DIR}/tools/depends/target/ffmpeg/FindGnuTls.cmake <SOURCE_DIR>) file(WRITE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ffmpeg/ffmpeg-link-wrapper diff --git a/cmake/modules/FindJsonSchemaBuilder.cmake b/cmake/modules/FindJsonSchemaBuilder.cmake index 3bffb4831c..cdaa2d5d7e 100644 --- a/cmake/modules/FindJsonSchemaBuilder.cmake +++ b/cmake/modules/FindJsonSchemaBuilder.cmake @@ -14,7 +14,7 @@ if(NOT TARGET JsonSchemaBuilder::JsonSchemaBuilder) IMPORTED_LOCATION "${NATIVEPREFIX}/bin/JsonSchemaBuilder") set_target_properties(JsonSchemaBuilder::JsonSchemaBuilder PROPERTIES FOLDER Tools) else() - add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) + add_subdirectory(${CMAKE_SOURCE_DIR}/tools/depends/native/JsonSchemaBuilder build/jsonschemabuilder) add_executable(JsonSchemaBuilder::JsonSchemaBuilder ALIAS JsonSchemaBuilder) set_target_properties(JsonSchemaBuilder PROPERTIES FOLDER Tools) endif() diff --git a/cmake/modules/FindLibDvd.cmake b/cmake/modules/FindLibDvd.cmake index 1f02b5f226..cc24e9b56f 100644 --- a/cmake/modules/FindLibDvd.cmake +++ b/cmake/modules/FindLibDvd.cmake @@ -49,7 +49,7 @@ if(NOT WIN32) list(APPEND dvdlibs libdvdcss) endif() foreach(dvdlib ${dvdlibs}) - file(GLOB VERSION_FILE ${CORE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION) + file(GLOB VERSION_FILE ${CMAKE_SOURCE_DIR}/tools/depends/target/${dvdlib}/DVD*-VERSION) file(STRINGS ${VERSION_FILE} VER) string(REGEX MATCH "VERSION=[^ ]*$.*" ${dvdlib}_VER "${VER}") list(GET ${dvdlib}_VER 0 ${dvdlib}_VER) @@ -203,7 +203,7 @@ if(NOT WIN32) endif() else() # Dynamically loaded on Windows - find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h PATHS ${CORE_SOURCE_DIR}/lib/libdvd/include) + find_path(LIBDVD_INCLUDE_DIR dvdcss/dvdcss.h PATHS ${CMAKE_SOURCE_DIR}/lib/libdvd/include) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(LIBDVD REQUIRED_VARS LIBDVD_INCLUDE_DIR) diff --git a/cmake/modules/FindTexturePacker.cmake b/cmake/modules/FindTexturePacker.cmake index 677b4d983b..aa6fd3aea6 100644 --- a/cmake/modules/FindTexturePacker.cmake +++ b/cmake/modules/FindTexturePacker.cmake @@ -19,7 +19,7 @@ if(NOT TARGET TexturePacker::TexturePacker) elseif(WIN32) add_executable(TexturePacker::TexturePacker IMPORTED GLOBAL) set_target_properties(TexturePacker::TexturePacker PROPERTIES - IMPORTED_LOCATION "${CORE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") + IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/tools/TexturePacker/TexturePacker.exe") else() if(WITH_TEXTUREPACKER) get_filename_component(_tppath ${WITH_TEXTUREPACKER} ABSOLUTE) @@ -34,7 +34,7 @@ if(NOT TARGET TexturePacker::TexturePacker) endif() mark_as_advanced(TEXTUREPACKER) else() - add_subdirectory(${CORE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) + add_subdirectory(${CMAKE_SOURCE_DIR}/tools/depends/native/TexturePacker build/texturepacker) add_executable(TexturePacker::TexturePacker ALIAS TexturePacker) endif() endif() diff --git a/cmake/scripts/android/ArchSetup.cmake b/cmake/scripts/android/ArchSetup.cmake index 281f94f869..1337e5a1e3 100644 --- a/cmake/scripts/android/ArchSetup.cmake +++ b/cmake/scripts/android/ArchSetup.cmake @@ -1,5 +1,5 @@ if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${PROJECT_SOURCE_DIR}/README.md") + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for android. See ${CMAKE_SOURCE_DIR}/cmake/README.md") elseif(NOT SDK_PLATFORM) message(FATAL_ERROR "Toolchain did not define SDK_PLATFORM. Possibly outdated depends.") endif() diff --git a/cmake/scripts/android/Install.cmake b/cmake/scripts/android/Install.cmake index 025f194cb5..b1084dfcc1 100644 --- a/cmake/scripts/android/Install.cmake +++ b/cmake/scripts/android/Install.cmake @@ -14,11 +14,11 @@ if(NOT ZIPALIGN_EXECUTABLE) endif() # Configure files into packaging environment. -configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/Makefile.in +configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/Makefile.in ${CMAKE_BINARY_DIR}/tools/android/packaging/Makefile @ONLY) -configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/apksign +configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/apksign ${CMAKE_BINARY_DIR}/tools/android/packaging/apksign COPYONLY) -configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh +configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/make_symbols.sh ${CMAKE_BINARY_DIR}/tools/android/packaging/make_symbols.sh COPYONLY) file(WRITE ${CMAKE_BINARY_DIR}/tools/depends/Makefile.include "$(PREFIX)/lib/${APP_NAME_LC}/lib${APP_NAME_LC}.so: ;\n") @@ -35,15 +35,15 @@ set(package_files strings.xml src/org/xbmc/kodi/Splash.java src/org/xbmc/kodi/XBMCBroadcastReceiver.java) foreach(file IN LISTS package_files) - configure_file(${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in + configure_file(${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/${file}.in ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/${file} @ONLY) endforeach() # Copy files to the location expected by the Android packaging scripts. add_custom_target(bundle - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/media + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/android/packaging/media ${CMAKE_BINARY_DIR}/tools/android/packaging/media - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/android/packaging/xbmc/res + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/android/packaging/xbmc/res ${CMAKE_BINARY_DIR}/tools/android/packaging/xbmc/res COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/lib/python2.7 ${libdir}/python2.7 COMMAND ${CMAKE_COMMAND} -E copy_directory ${DEPENDS_PATH}/share/${APP_NAME_LC} ${datadir}/${APP_NAME_LC} @@ -101,7 +101,7 @@ foreach(target apk obb apk-unsigned apk-obb apk-obb-unsigned apk-noobb apk-clean add_custom_target(${target} COMMAND PATH=${NATIVEPREFIX}/bin:$ENV{PATH} ${CMAKE_MAKE_PROGRAM} -C ${CMAKE_BINARY_DIR}/tools/android/packaging - CORE_SOURCE_DIR=${CORE_SOURCE_DIR} + CMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} CC=${CMAKE_C_COMPILER} CPU=${CPU} ARCH=${ARCH} diff --git a/cmake/scripts/common/ArchSetup.cmake b/cmake/scripts/common/ArchSetup.cmake index 4b862c8b50..58b2cfe44b 100644 --- a/cmake/scripts/common/ArchSetup.cmake +++ b/cmake/scripts/common/ArchSetup.cmake @@ -82,17 +82,17 @@ else() endif() # Main cpp -set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp) +set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/posix/main.cpp) # system specific arch setup -if(NOT EXISTS ${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) +if(NOT EXISTS ${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) message(FATAL_ERROR "Couldn't find configuration for '${CORE_SYSTEM_NAME}' " "Either the platform is not (yet) supported " "or a toolchain file has to be specified. " - "Consult ${CMAKE_SOURCE_DIR}/README.md for instructions. " + "Consult ${CMAKE_SOURCE_DIR}/cmake/README.md for instructions. " "Note: Specifying a toolchain requires a clean build directory!") endif() -include(${PROJECT_SOURCE_DIR}/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) +include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/ArchSetup.cmake) message(STATUS "Core system type: ${CORE_SYSTEM_NAME}") message(STATUS "Platform: ${PLATFORM}") diff --git a/cmake/scripts/common/GenerateVersionedFiles.cmake b/cmake/scripts/common/GenerateVersionedFiles.cmake index e105b277e8..6062362fd5 100644 --- a/cmake/scripts/common/GenerateVersionedFiles.cmake +++ b/cmake/scripts/common/GenerateVersionedFiles.cmake @@ -1,4 +1,4 @@ -include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake) +include(${CORE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake) core_find_versions() file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/addons/xbmc.addon) diff --git a/cmake/scripts/common/HandleDepends.cmake b/cmake/scripts/common/HandleDepends.cmake index adc105bf31..85d2cf43e9 100644 --- a/cmake/scripts/common/HandleDepends.cmake +++ b/cmake/scripts/common/HandleDepends.cmake @@ -1,4 +1,4 @@ -include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake) +include(${CORE_SOURCE_DIR}/cmake/scripts/common/CheckTargetPlatform.cmake) # handle addon depends function(add_addon_depends addon searchpath) diff --git a/cmake/scripts/common/Macros.cmake b/cmake/scripts/common/Macros.cmake index 62dfb873b5..6846ab00ac 100644 --- a/cmake/scripts/common/Macros.cmake +++ b/cmake/scripts/common/Macros.cmake @@ -1,7 +1,12 @@ # This script holds the main functions used to construct the build system -# include system specific macros -include(${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/Macros.cmake) +# Include system specific macros but only if this file is included from +# kodi main project. It's not needed for kodi-addons project +# If CORE_SOURCE_DIR is set, it was called from kodi-addons project +# TODO: drop check if we ever integrate kodi-addons into kodi project +if(NOT CORE_SOURCE_DIR) + include(${CMAKE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/Macros.cmake) +endif() # IDEs: Group source files in target in folders (file system hierarchy) # Source: http://blog.audio-tk.com/2015/09/01/sorting-source-files-and-projects-in-folders-with-cmake-and-visual-studioxcode/ @@ -72,7 +77,7 @@ function(core_add_library name) # Add precompiled headers to Kodi main libraries if(CORE_SYSTEM_NAME STREQUAL windows) - add_precompiled_header(${name} pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) + add_precompiled_header(${name} pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) set_language_cxx(${name}) target_link_libraries(${name} PUBLIC effects11) endif() @@ -118,8 +123,8 @@ function(core_add_addon_library name) set_target_properties(${name} PROPERTIES FOLDER addons) target_include_directories(${name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi - ${CORE_SOURCE_DIR}/xbmc) + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi + ${CMAKE_SOURCE_DIR}/xbmc) endfunction() # Add an dl-loaded shared library @@ -191,7 +196,7 @@ endfunction() # Optional Arguments: # NO_INSTALL: exclude file from installation target (only mirror) # DIRECTORY: directory where the file should be mirrored to -# (default: preserve tree structure relative to CORE_SOURCE_DIR) +# (default: preserve tree structure relative to CMAKE_SOURCE_DIR) # On return: # Files is mirrored to the build tree and added to ${install_data} # (if NO_INSTALL is not given). @@ -202,7 +207,7 @@ function(copy_file_to_buildtree file) get_filename_component(outfile ${file} NAME) set(outfile ${outdir}/${outfile}) else() - string(REPLACE "${CORE_SOURCE_DIR}/" "" outfile ${file}) + string(REPLACE "${CMAKE_SOURCE_DIR}/" "" outfile ${file}) get_filename_component(outdir ${outfile} DIRECTORY) endif() @@ -243,7 +248,7 @@ endfunction() # Optional Arguments: # NO_INSTALL: exclude files from installation target # Implicit arguments: -# CORE_SOURCE_DIR - root of source tree +# CMAKE_SOURCE_DIR - root of source tree # On return: # Files are mirrored to the build tree and added to ${install_data} # (if NO_INSTALL is not given). @@ -273,17 +278,17 @@ function(copy_files_from_filelist_to_buildtree pattern) # If the full path to an existing file is specified then add that single file. # Don't recursively add all files with the given name. - if(EXISTS ${CORE_SOURCE_DIR}/${src} AND NOT IS_DIRECTORY ${CORE_SOURCE_DIR}/${src}) + if(EXISTS ${CMAKE_SOURCE_DIR}/${src} AND NOT IS_DIRECTORY ${CMAKE_SOURCE_DIR}/${src}) set(files ${src}) else() - file(GLOB_RECURSE files RELATIVE ${CORE_SOURCE_DIR} ${CORE_SOURCE_DIR}/${src}) + file(GLOB_RECURSE files RELATIVE ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/${src}) endif() foreach(file ${files}) if(arg_NO_INSTALL) - copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} DIRECTORY ${dest} NO_INSTALL) + copy_file_to_buildtree(${CMAKE_SOURCE_DIR}/${file} DIRECTORY ${dest} NO_INSTALL) else() - copy_file_to_buildtree(${CORE_SOURCE_DIR}/${file} DIRECTORY ${dest}) + copy_file_to_buildtree(${CMAKE_SOURCE_DIR}/${file} DIRECTORY ${dest}) endif() endforeach() endforeach() @@ -427,9 +432,9 @@ function(core_add_subdirs_from_filelist files) list(GET subdir 0 subdir_src) list(GET subdir -1 subdir_dest) if(VERBOSE) - message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") + message(STATUS " core_add_subdirs_from_filelist - adding subdir: ${CMAKE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") endif() - add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) + add_subdirectory(${CMAKE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) endforeach() endforeach() endfunction() @@ -466,9 +471,9 @@ macro(core_add_optional_subdirs_from_filelist pattern) foreach(opt ${opts}) if(ENABLE_${opt}) if(VERBOSE) - message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CORE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") + message(STATUS " core_add_optional_subdirs_from_filelist - adding subdir: ${CMAKE_SOURCE_DIR}/${subdir_src} -> ${CORE_BUILD_DIR}/${subdir_dest}") endif() - add_subdirectory(${CORE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) + add_subdirectory(${CMAKE_SOURCE_DIR}/${subdir_src} ${CORE_BUILD_DIR}/${subdir_dest}) else() if(VERBOSE) message(STATUS " core_add_optional_subdirs_from_filelist: OPTION ${opt} not enabled for ${subdir_src}, skipping subdir") @@ -496,14 +501,14 @@ endfunction() # if no git tree is found, value is set to "nobody <nobody@example.com>" function(userstamp) find_package(Git) - if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) + if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) execute_process(COMMAND ${GIT_EXECUTABLE} config user.name OUTPUT_VARIABLE username - WORKING_DIRECTORY ${CORE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process(COMMAND ${GIT_EXECUTABLE} config user.email OUTPUT_VARIABLE useremail - WORKING_DIRECTORY ${CORE_SOURCE_DIR} + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_STRIP_TRAILING_WHITESPACE) set(PACKAGE_MAINTAINER "${username} <${useremail}>" PARENT_SCOPE) else() @@ -528,29 +533,29 @@ function(core_find_git_rev stamp) set(${stamp} ${GIT_VERSION} PARENT_SCOPE) else() find_package(Git) - if(GIT_FOUND AND EXISTS ${CORE_SOURCE_DIR}/.git) + if(GIT_FOUND AND EXISTS ${CMAKE_SOURCE_DIR}/.git) execute_process(COMMAND ${GIT_EXECUTABLE} diff-files --ignore-submodules --quiet -- RESULT_VARIABLE status_code - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) if(NOT status_code) execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --ignore-submodules --quiet HEAD -- RESULT_VARIABLE status_code - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) endif() if(status_code) execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h-dirty" HEAD OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) string(SUBSTRING ${HASH} 1 13 HASH) else() execute_process(COMMAND ${GIT_EXECUTABLE} log -n 1 --pretty=format:"%h" HEAD OUTPUT_VARIABLE HASH - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) string(SUBSTRING ${HASH} 1 7 HASH) endif() execute_process(COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:"%cd" --date=short HEAD OUTPUT_VARIABLE DATE - WORKING_DIRECTORY ${CORE_SOURCE_DIR}) + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) string(SUBSTRING ${DATE} 1 10 DATE) string(REPLACE "-" "" DATE ${DATE}) else() @@ -586,6 +591,15 @@ endfunction() # guilib_version - current ADDONGUI API version # guilib_version_min - minimal ADDONGUI API version macro(core_find_versions) + # kodi-addons project also calls this macro and uses CORE_SOURCE_DIR + # to point to core base dir + # Set CORE_SOURCE_DIR here, otherwise kodi main project fails + # TODO: drop this code block and refactor the rest to use CMAKE_SOURCE_DIR + # if we ever integrate kodi-addons into kodi project + if(NOT CORE_SOURCE_DIR) + set(CORE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) + endif() + include(CMakeParseArguments) core_file_read_filtered(version_list ${CORE_SOURCE_DIR}/version.txt) string(REPLACE " " ";" version_list "${version_list}") diff --git a/cmake/scripts/common/PrepareEnv.cmake b/cmake/scripts/common/PrepareEnv.cmake index 51be7395a8..1f68fdccae 100644 --- a/cmake/scripts/common/PrepareEnv.cmake +++ b/cmake/scripts/common/PrepareEnv.cmake @@ -1,5 +1,5 @@ # parse version.txt and libKODI_guilib.h to get the version and API info -include(${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake) +include(${CORE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake) core_find_versions() # in case we need to download something, set KODI_MIRROR to the default if not alread set @@ -33,11 +33,11 @@ if(NOT WIN32) endif() # generate the proper KodiConfig.cmake file -configure_file(${CORE_SOURCE_DIR}/project/cmake/KodiConfig.cmake.in ${APP_LIB_DIR}/KodiConfig.cmake @ONLY) +configure_file(${CORE_SOURCE_DIR}/cmake/KodiConfig.cmake.in ${APP_LIB_DIR}/KodiConfig.cmake @ONLY) # copy cmake helpers to lib/kodi -file(COPY ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake +file(COPY ${CORE_SOURCE_DIR}/cmake/scripts/common/AddonHelpers.cmake + ${CORE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake DESTINATION ${APP_LIB_DIR}) ### copy all the addon binding header files to include/kodi @@ -52,8 +52,8 @@ foreach(binding ${bindings}) endforeach() ### processing additional tools required by the platform -if(EXISTS ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) - file(GLOB platform_tools ${CORE_SOURCE_DIR}/project/cmake/scripts/${CORE_SYSTEM_NAME}/tools/*.cmake) +if(EXISTS ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/) + file(GLOB platform_tools ${CORE_SOURCE_DIR}/cmake/scripts/${CORE_SYSTEM_NAME}/tools/*.cmake) foreach(platform_tool ${platform_tools}) get_filename_component(platform_tool_name ${platform_tool} NAME_WE) message(STATUS "Processing ${CORE_SYSTEM_NAME} specific tool: ${platform_tool_name}") diff --git a/cmake/scripts/common/ProjectMacros.cmake b/cmake/scripts/common/ProjectMacros.cmake index e73ef903ed..89ecca4e9e 100644 --- a/cmake/scripts/common/ProjectMacros.cmake +++ b/cmake/scripts/common/ProjectMacros.cmake @@ -33,7 +33,7 @@ function(copy_skin_to_buildtree skin) copy_file_to_buildtree(${file}) endforeach() file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${dest}/media) - string(REPLACE "${CORE_SOURCE_DIR}/" "" dest ${skin}) + string(REPLACE "${CMAKE_SOURCE_DIR}/" "" dest ${skin}) pack_xbt(${skin}/media ${CMAKE_BINARY_DIR}/${dest}/media/Textures.xbt) file(GLOB THEMES RELATIVE ${skin}/themes ${skin}/themes/*) diff --git a/cmake/scripts/ios/ArchSetup.cmake b/cmake/scripts/ios/ArchSetup.cmake index f3e8590d4f..bdd2656c1b 100644 --- a/cmake/scripts/ios/ArchSetup.cmake +++ b/cmake/scripts/ios/ArchSetup.cmake @@ -1,8 +1,8 @@ if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios. See ${PROJECT_SOURCE_DIR}/README.md") + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for ios. See ${CMAKE_SOURCE_DIR}/cmake/README.md") endif() -set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplication.m) +set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/XBMCApplication.m) set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_IOS) set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE diff --git a/cmake/scripts/ios/Install.cmake b/cmake/scripts/ios/Install.cmake index c49fcd581b..b23e9e58bd 100644 --- a/cmake/scripts/ios/Install.cmake +++ b/cmake/scripts/ios/Install.cmake @@ -1,23 +1,23 @@ # IOS packaging -set(BUNDLE_RESOURCES ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png - ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) +set(BUNDLE_RESOURCES ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-568h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-667h@2x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-736h@3x.png + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/Default-Landscape-736h@3x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon29x29@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon40x40@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon50x50@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon57x57@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon60x60@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon72x72@2x.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76.png + ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/ios/rounded/AppIcon76x76@2x.png) if(CMAKE_GENERATOR STREQUAL Xcode) set(RESOURCE_LOCATION ${APP_NAME}.app) @@ -30,8 +30,8 @@ foreach(file IN LISTS BUNDLE_RESOURCES) set_source_files_properties(${file} PROPERTIES MACOSX_PACKAGE_LOCATION ${RESOURCE_LOCATION}) endforeach() -target_sources(${APP_NAME_LC} PRIVATE ${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings) -set_source_files_properties(${CORE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "${RESOURCE_LOCATION}/English.lproj") +target_sources(${APP_NAME_LC} PRIVATE ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings) +set_source_files_properties(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/ios/English.lproj/InfoPlist.strings PROPERTIES MACOSX_PACKAGE_LOCATION "${RESOURCE_LOCATION}/English.lproj") # Options for code signing propagated as env vars to Codesign.command via Xcode set(IOS_CODE_SIGN_IDENTITY "" CACHE STRING "Code Sign Identity") @@ -54,7 +54,7 @@ add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD "PRODUCT_NAME=${APP_NAME}" "WRAPPER_EXTENSION=app" "SRCROOT=${CMAKE_BINARY_DIR}" - ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-ios.command COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" "TARGET_BUILD_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.." "TARGET_NAME=${APP_NAME}.app" @@ -63,23 +63,24 @@ add_custom_command(TARGET ${APP_NAME_LC} POST_BUILD "FULL_PRODUCT_NAME=${APP_NAME}.app" "WRAPPER_EXTENSION=app" "SRCROOT=${CMAKE_BINARY_DIR}" - ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-ios.command COMMAND "XBMC_DEPENDS_ROOT=${NATIVEPREFIX}/.." "PLATFORM_NAME=${PLATFORM}" "CODESIGNING_FOLDER_PATH=$<TARGET_FILE_DIR:${APP_NAME_LC}>" "BUILT_PRODUCTS_DIR=$<TARGET_FILE_DIR:${APP_NAME_LC}>/.." "WRAPPER_NAME=${APP_NAME}.app" "APP_NAME=${APP_NAME}" - ${CORE_SOURCE_DIR}/tools/darwin/Support/Codesign.command + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/Codesign.command ) set(DEPENDS_ROOT_FOR_XCODE ${NATIVEPREFIX}/..) -configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in +configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh.in ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios/mkdeb-ios.sh @ONLY) -configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.in +configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh.in ${CMAKE_BINARY_DIR}/tools/darwin/packaging/migrate_to_kodi_ios.sh @ONLY) add_custom_target(deb COMMAND sh ./mkdeb-ios.sh ${CORE_BUILD_CONFIG} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/ios) add_dependencies(deb ${APP_NAME_LC}) + diff --git a/cmake/scripts/linux/ArchSetup.cmake b/cmake/scripts/linux/ArchSetup.cmake index bcd70df74f..20342ee76c 100644 --- a/cmake/scripts/linux/ArchSetup.cmake +++ b/cmake/scripts/linux/ArchSetup.cmake @@ -35,7 +35,7 @@ include(LDGOLD) # Code Coverage if(CMAKE_BUILD_TYPE STREQUAL Coverage) set(COVERAGE_TEST_BINARY ${APP_NAME_LC}-test) - set(COVERAGE_SOURCE_DIR ${CORE_SOURCE_DIR}) + set(COVERAGE_SOURCE_DIR ${CMAKE_SOURCE_DIR}) set(COVERAGE_DEPENDS "\${APP_NAME_LC}" "\${APP_NAME_LC}-test") set(COVERAGE_EXCLUDES */test/* lib/* */lib/*) endif() diff --git a/cmake/scripts/linux/ExtraTargets.cmake b/cmake/scripts/linux/ExtraTargets.cmake index 2bb5f6fa01..4698c2ac68 100644 --- a/cmake/scripts/linux/ExtraTargets.cmake +++ b/cmake/scripts/linux/ExtraTargets.cmake @@ -2,11 +2,11 @@ if(ENABLE_X11 AND X_FOUND AND XRANDR_FOUND) find_package(X QUIET) find_package(XRandR QUIET) - add_executable(${APP_NAME_LC}-xrandr ${CORE_SOURCE_DIR}/xbmc-xrandr.c) + add_executable(${APP_NAME_LC}-xrandr ${CMAKE_SOURCE_DIR}/xbmc-xrandr.c) target_link_libraries(${APP_NAME_LC}-xrandr ${SYSTEM_LDFLAGS} ${X_LIBRARIES} m ${XRANDR_LIBRARIES}) endif() # WiiRemote if(ENABLE_EVENTCLIENTS) - add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote) + add_subdirectory(${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/WiiRemote build/WiiRemote) endif() diff --git a/cmake/scripts/linux/Install.cmake b/cmake/scripts/linux/Install.cmake index 75c37dc860..7f8a2f8dba 100644 --- a/cmake/scripts/linux/Install.cmake +++ b/cmake/scripts/linux/Install.cmake @@ -22,25 +22,25 @@ set(APP_INCLUDE_DIR ${includedir}/${APP_NAME_LC}) set(CXX11_SWITCH "-std=c++11") # Set XBMC_STANDALONE_SH_PULSE so we can insert PulseAudio block into kodi-standalone -if(EXISTS ${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) +if(EXISTS ${CMAKE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse) if(ENABLE_PULSEAUDIO AND PULSEAUDIO_FOUND) - file(READ "${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content) + file(READ "${CMAKE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.pulse" pulse_content) set(XBMC_STANDALONE_SH_PULSE ${pulse_content}) endif() endif() # Configure startup scripts -configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi.sh.in +configure_file(${CMAKE_SOURCE_DIR}/tools/Linux/kodi.sh.in ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC} @ONLY) -configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in +configure_file(${CMAKE_SOURCE_DIR}/tools/Linux/kodi-standalone.sh.in ${CORE_BUILD_DIR}/scripts/${APP_NAME_LC}-standalone @ONLY) # Configure cmake files -configure_file(${PROJECT_SOURCE_DIR}/KodiConfig.cmake.in +configure_file(${CMAKE_SOURCE_DIR}/cmake/KodiConfig.cmake.in ${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake @ONLY) # Configure xsession entry -configure_file(${CORE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in +configure_file(${CMAKE_SOURCE_DIR}/tools/Linux/kodi-xsession.desktop.in ${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop @ONLY) # Install app @@ -83,53 +83,53 @@ install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/${APP_NAME_LC}.desktop COMPONENT kodi) # Install desktop entry -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/kodi.desktop +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/kodi.desktop DESTINATION ${datarootdir}/applications COMPONENT kodi) # Install icons -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon16x16.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/16x16/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon22x22.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/22x22/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon24x24.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/24x24/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon32x32.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/32x32/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon48x48.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/48x48/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon64x64.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/64x64/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon128x128.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/128x128/apps COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png +install(FILES ${CMAKE_SOURCE_DIR}/tools/Linux/packaging/media/icon256x256.png RENAME ${APP_NAME_LC}.png DESTINATION ${datarootdir}/icons/hicolor/256x256/apps COMPONENT kodi) # Install docs -install(FILES ${CORE_SOURCE_DIR}/copying.txt - ${CORE_SOURCE_DIR}/LICENSE.GPL - ${CORE_SOURCE_DIR}/version.txt - ${CORE_SOURCE_DIR}/docs/README.linux +install(FILES ${CMAKE_SOURCE_DIR}/copying.txt + ${CMAKE_SOURCE_DIR}/LICENSE.GPL + ${CMAKE_SOURCE_DIR}/version.txt + ${CMAKE_SOURCE_DIR}/docs/README.linux DESTINATION ${docdir} COMPONENT kodi) -install(FILES ${CORE_SOURCE_DIR}/privacy-policy.txt +install(FILES ${CMAKE_SOURCE_DIR}/privacy-policy.txt DESTINATION ${datarootdir}/${APP_NAME_LC} COMPONENT kodi) @@ -141,127 +141,127 @@ if(NOT WITH_TEXTUREPACKER) endif() # Install kodi-addon-dev headers -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h - ${CORE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h - ${CORE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h - ${CORE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_vfs_utils.hpp + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_adsp.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_audioengine.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_guilib.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_inputstream.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_peripheral.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_addon.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_codec.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libXBMC_pvr.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/libKODI_game.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_codec_types.h + ${CMAKE_SOURCE_DIR}/xbmc/cores/VideoPlayer/DVDDemuxers/DVDDemuxPacket.h + ${CMAKE_SOURCE_DIR}/xbmc/filesystem/IFileTypes.h + ${CMAKE_SOURCE_DIR}/xbmc/input/XBMC_vkeys.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-addon-dev) # Install kodi-addon-dev add-on bindings install(FILES ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/scripts/${APP_NAME}Config.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddonHelpers.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/AddOptions.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ArchSetup.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckCommits.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/CheckTargetPlatform.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GenerateVersionedFiles.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/GeneratorSetup.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/HandleDepends.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/Macros.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/PrepareEnv.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/common/ProjectMacros.cmake - ${CORE_SOURCE_DIR}/project/cmake/scripts/linux/PathSetup.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/AddonHelpers.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/AddOptions.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/ArchSetup.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/CheckCommits.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/CheckTargetPlatform.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/GenerateVersionedFiles.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/GeneratorSetup.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/HandleDepends.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/PrepareEnv.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/common/ProjectMacros.cmake + ${CMAKE_SOURCE_DIR}/cmake/scripts/linux/PathSetup.cmake DESTINATION ${datarootdir}/${APP_NAME_LC}/cmake COMPONENT kodi-addon-dev) # Install kodi-audio-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/cores/AudioEngine/Utils/AEChannelData.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_adsp_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audiodec_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_audioenc_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_audioengine_types.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-audio-dev) if(ENABLE_EVENTCLIENTS) # Install kodi-eventclients-common BT python files - install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py + install(PROGRAMS ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/bt/__init__.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/bt/bt.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/bt/hid.py DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/bt COMPONENT kodi-eventclients-common) # Install kodi-eventclients-common PS3 python files - install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py + install(PROGRAMS ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/__init__.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/keymaps.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixaxis.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixpair.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/ps3/sixwatch.py DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC}/ps3 COMPONENT kodi-eventclients-common) # Install kodi-eventclients-common python files file(WRITE ${CMAKE_BINARY_DIR}/packages/deb/defs.py ICON_PATH="usr/share/pixmaps/${APP_NAME_LC}/") install(PROGRAMS ${CMAKE_BINARY_DIR}/packages/deb/defs.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py - "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py - ${CORE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/__init__.py + "${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/xbmcclient.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/python/zeroconf.py DESTINATION lib/python2.7/dist-packages/${APP_NAME_LC} COMPONENT kodi-eventclients-common) # Install kodi-eventclients-common icons - install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png - ${CORE_SOURCE_DIR}/tools/EventClients/icons/phone.png - ${CORE_SOURCE_DIR}/tools/EventClients/icons/mail.png - ${CORE_SOURCE_DIR}/tools/EventClients/icons/mouse.png + install(FILES ${CMAKE_SOURCE_DIR}/tools/EventClients/icons/bluetooth.png + ${CMAKE_SOURCE_DIR}/tools/EventClients/icons/phone.png + ${CMAKE_SOURCE_DIR}/tools/EventClients/icons/mail.png + ${CMAKE_SOURCE_DIR}/tools/EventClients/icons/mouse.png DESTINATION ${datarootdir}/pixmaps/${APP_NAME_LC} COMPONENT kodi-eventclients-common) # Install kodi-eventclients-dev headers - install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h + install(FILES ${CMAKE_SOURCE_DIR}/tools/EventClients/lib/c++/xbmcclient.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-eventclients-dev) # Install kodi-eventclients-dev C# examples - install(FILES "${CORE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs" + install(FILES "${CMAKE_SOURCE_DIR}/tools/EventClients/examples/c#/XBMCDemoClient1.cs" DESTINATION "${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C#" COMPONENT kodi-eventclients-dev) # Install kodi-eventclients-dev C++ examples - install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp - ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp - ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp - ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp - ${CORE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp + install(FILES ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/c++/example_notification.cpp + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/c++/example_log.cpp + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button1.cpp + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/c++/example_mouse.cpp + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/c++/example_button2.cpp DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/C++ COMPONENT kodi-eventclients-dev) # Install kodi-eventclients-dev java examples - install(FILES ${CORE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java + install(FILES ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/java/XBMCDemoClient1.java DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/java COMPONENT kodi-eventclients-dev) # Install kodi-eventclients-dev python examples - install(PROGRAMS ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py - ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py - ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py - ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py - ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py - ${CORE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py + install(PROGRAMS ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/python/example_mouse.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/python/example_button1.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/python/example_notification.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/python/example_action.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/python/example_button2.py + ${CMAKE_SOURCE_DIR}/tools/EventClients/examples/python/example_simple.py DESTINATION ${docdir}/${APP_NAME_LC}-eventclients-dev/examples/python COMPONENT kodi-eventclients-dev) # Install kodi-eventclients-ps3 - install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" + install(PROGRAMS "${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/PS3 BD Remote/ps3_remote.py" RENAME ${APP_NAME_LC}-ps3remote DESTINATION ${bindir} COMPONENT kodi-eventclients-ps3) @@ -272,51 +272,50 @@ if(ENABLE_EVENTCLIENTS) COMPONENT kodi-eventclients-wiiremote) # Install kodi-eventclients-xbmc-send - install(PROGRAMS "${CORE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py" + install(PROGRAMS "${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/Kodi Send/kodi-send.py" RENAME ${APP_NAME_LC}-send DESTINATION ${bindir} COMPONENT kodi-eventclients-xbmc-send) endif() # Install kodi-inputstream-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_inputstream_types.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-inputstream-dev) # Install kodi-pvr-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_epg_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_pvr_types.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-pvr-dev) # Install kodi-screensaver-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_scr_types.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-screensaver-dev) # Install kodi-visualization-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_vis_types.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-visualization-dev) # Install kodi-peripheral-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_types.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_peripheral_utils.hpp DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-peripheral-dev) # Install kodi-game-dev -install(FILES ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h - ${CORE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h +install(FILES ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_dll.h + ${CMAKE_SOURCE_DIR}/xbmc/addons/kodi-addon-dev-kit/include/kodi/kodi_game_types.h DESTINATION ${includedir}/${APP_NAME_LC} COMPONENT kodi-game-dev) - # Install XBT skin files foreach(texture ${XBT_FILES}) string(REPLACE "${CMAKE_BINARY_DIR}/" "" dir ${texture}) @@ -355,7 +354,7 @@ if(CPACK_GENERATOR) if(CMAKE_BUILD_TYPE STREQUAL Debug) message(STATUS "DEB Generator: Build type is set to 'Debug'. Packaged binaries will be unstripped.") endif() - include(${PROJECT_SOURCE_DIR}/cpack/CPackConfigDEB.cmake) + include(${CMAKE_SOURCE_DIR}/cmake/cpack/CPackConfigDEB.cmake) else() message(FATAL_ERROR "DEB Generator: Can't configure CPack to generate Debian packages on non-linux systems.") endif() diff --git a/cmake/scripts/osx/ArchSetup.cmake b/cmake/scripts/osx/ArchSetup.cmake index 30478636e6..6d43c4ee54 100644 --- a/cmake/scripts/osx/ArchSetup.cmake +++ b/cmake/scripts/osx/ArchSetup.cmake @@ -1,10 +1,10 @@ if(NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for osx. See ${PROJECT_SOURCE_DIR}/README.md") + message(FATAL_ERROR "CMAKE_TOOLCHAIN_FILE required for osx. See ${CMAKE_SOURCE_DIR}/cmake/README.md") endif() -set(CORE_MAIN_SOURCE ${CORE_SOURCE_DIR}/xbmc/platform/posix/main.cpp - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm - ${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) +set(CORE_MAIN_SOURCE ${CMAKE_SOURCE_DIR}/xbmc/platform/posix/main.cpp + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.mm + ${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/SDLMain.h) set(ARCH_DEFINES -D_LINUX -DTARGET_POSIX -DTARGET_DARWIN -DTARGET_DARWIN_OSX) set(SYSTEM_DEFINES -D_REENTRANT -D_FILE_DEFINED -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE diff --git a/cmake/scripts/osx/ExtraTargets.cmake b/cmake/scripts/osx/ExtraTargets.cmake index ed9c089144..28c1e742f7 100644 --- a/cmake/scripts/osx/ExtraTargets.cmake +++ b/cmake/scripts/osx/ExtraTargets.cmake @@ -1,3 +1,3 @@ # XBMCHelper -add_subdirectory(${CORE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper) +add_subdirectory(${CMAKE_SOURCE_DIR}/tools/EventClients/Clients/OSXRemote build/XBMCHelper) add_dependencies(${APP_NAME_LC} XBMCHelper) diff --git a/cmake/scripts/osx/Install.cmake b/cmake/scripts/osx/Install.cmake index 3924ccf032..77c771c9e1 100644 --- a/cmake/scripts/osx/Install.cmake +++ b/cmake/scripts/osx/Install.cmake @@ -2,7 +2,7 @@ set(PACKAGE_OUTPUT_DIR ${CMAKE_BINARY_DIR}/build/${CORE_BUILD_CONFIG}) -configure_file(${CORE_SOURCE_DIR}/xbmc/platform/darwin/osx/Info.plist.in +configure_file(${CMAKE_SOURCE_DIR}/xbmc/platform/darwin/osx/Info.plist.in ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist @ONLY) execute_process(COMMAND perl -p -i -e "s/r####/${APP_SCMID}/" ${CMAKE_BINARY_DIR}/xbmc/platform/darwin/osx/Info.plist) @@ -15,24 +15,24 @@ add_custom_target(bundle "TARGET_NAME=${APP_NAME}.app" "APP_NAME=${APP_NAME}" "SRCROOT=${CMAKE_BINARY_DIR}" - ${CORE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-osx.command + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/CopyRootFiles-osx.command COMMAND "XBMC_DEPENDS=${DEPENDS_PATH}" "TARGET_BUILD_DIR=${PACKAGE_OUTPUT_DIR}" "TARGET_NAME=${APP_NAME}.app" "APP_NAME=${APP_NAME}" "FULL_PRODUCT_NAME=${APP_NAME}.app" "SRCROOT=${CMAKE_BINARY_DIR}" - ${CORE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command) + ${CMAKE_SOURCE_DIR}/tools/darwin/Support/copyframeworks-osx.command) set_target_properties(bundle PROPERTIES FOLDER "Build Utilities") add_dependencies(bundle ${APP_NAME_LC}) -configure_file(${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh.in +configure_file(${CMAKE_SOURCE_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh.in ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/mkdmg-osx.sh @ONLY) add_custom_target(dmg - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/osx/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/osx/ ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx/ - COMMAND ${CMAKE_COMMAND} -E copy_directory ${CORE_SOURCE_DIR}/tools/darwin/packaging/media/osx/ + COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/tools/darwin/packaging/media/osx/ ${CMAKE_BINARY_DIR}/tools/darwin/packaging/media/osx/ COMMAND ./mkdmg-osx.sh ${CORE_BUILD_CONFIG} WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/tools/darwin/packaging/osx) diff --git a/cmake/scripts/windows/ArchSetup.cmake b/cmake/scripts/windows/ArchSetup.cmake index d1c81a2541..aca803e2fa 100644 --- a/cmake/scripts/windows/ArchSetup.cmake +++ b/cmake/scripts/windows/ArchSetup.cmake @@ -11,12 +11,12 @@ set(PLATFORM_DIR platform/win32) set(PRECOMPILEDHEADER_DIR ${PROJECT_BINARY_DIR}/${CORE_BUILD_CONFIG}/objs) set(CMAKE_SYSTEM_NAME Windows) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg) -list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin) -list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${PROJECT_SOURCE_DIR}/../BuildDependencies) +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/lib/win32) +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/lib/win32/ffmpeg) +list(APPEND CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SOURCE_DIR}/lib/win32/ffmpeg/bin) +list(APPEND CMAKE_SYSTEM_PREFIX_PATH ${CMAKE_SOURCE_DIR}/project/BuildDependencies) -set(PYTHON_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/../BuildDependencies/include/python) +set(PYTHON_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/project/BuildDependencies/include/python) # -------- Compiler options --------- @@ -44,8 +44,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") # For #pragma comment(lib X) # TODO: It would certainly be better to handle these libraries via CMake modules. -link_directories(${PROJECT_SOURCE_DIR}/../../lib/win32/ffmpeg/bin - ${PROJECT_SOURCE_DIR}/../BuildDependencies/lib) +link_directories(${CMAKE_SOURCE_DIR}/lib/win32/ffmpeg/bin + ${CMAKE_SOURCE_DIR}/project/BuildDependencies/lib) # Additional libraries list(APPEND DEPLIBS d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib diff --git a/tools/EventClients/Clients/OSXRemote/CMakeLists.txt b/tools/EventClients/Clients/OSXRemote/CMakeLists.txt index 10b824356a..4c6ed45948 100644 --- a/tools/EventClients/Clients/OSXRemote/CMakeLists.txt +++ b/tools/EventClients/Clients/OSXRemote/CMakeLists.txt @@ -1,4 +1,4 @@ -list(APPEND CMAKE_MODULE_PATH ${CORE_SOURCE_DIR}/project/cmake/modules) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) set(SOURCES xbmchelper_main.mm XBMCHelper.m diff --git a/tools/EventClients/Clients/WiiRemote/CMakeLists.txt b/tools/EventClients/Clients/WiiRemote/CMakeLists.txt index 2442d61265..1f1f75d1fa 100644 --- a/tools/EventClients/Clients/WiiRemote/CMakeLists.txt +++ b/tools/EventClients/Clients/WiiRemote/CMakeLists.txt @@ -1,4 +1,4 @@ -list(APPEND CMAKE_MODULE_PATH ${CORE_SOURCE_DIR}/project/cmake/modules) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) find_package(Bluetooth REQUIRED) find_package(CWiid REQUIRED) diff --git a/tools/depends/native/TexturePacker/CMakeLists.txt b/tools/depends/native/TexturePacker/CMakeLists.txt index de4205745a..de3b228aea 100644 --- a/tools/depends/native/TexturePacker/CMakeLists.txt +++ b/tools/depends/native/TexturePacker/CMakeLists.txt @@ -1,4 +1,4 @@ -list(APPEND CMAKE_MODULE_PATH ${CORE_SOURCE_DIR}/project/cmake/modules) +list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) if(APPLE) set(CMAKE_FIND_ROOT_PATH ${NATIVEPREFIX}) diff --git a/xbmc/addons/addon-bindings.mk b/xbmc/addons/addon-bindings.mk index 55eb97cae5..0144a5b2a9 100644 --- a/xbmc/addons/addon-bindings.mk +++ b/xbmc/addons/addon-bindings.mk @@ -1,4 +1,4 @@ -# Please also update bindings in ../../project/cmake/scripts/linux/Install.cmake +# Please also update bindings in ../../cmake/scripts/linux/Install.cmake # TODO: Cleanup file after autotools is gone BINDINGS =xbmc/addons/kodi-addon-dev-kit/include/kodi/xbmc_addon_cpp_dll.h diff --git a/xbmc/guilib/CMakeLists.txt b/xbmc/guilib/CMakeLists.txt index 98589425e9..80dbc0d79f 100644 --- a/xbmc/guilib/CMakeLists.txt +++ b/xbmc/guilib/CMakeLists.txt @@ -220,8 +220,8 @@ if(CORE_SYSTEM_NAME STREQUAL windows) get_filename_component(file ${shader} NAME_WE) add_custom_command(OUTPUT ${file}.h COMMAND ${FXC} /Fh ${file}.h /E VS /T vs_4_0_level_9_1 /Vn ${file} /Qstrip_reflect - ${CORE_SOURCE_DIR}/system/shaders/${shader} - DEPENDS ${CORE_SOURCE_DIR}/system/shaders/${shader} + ${CMAKE_SOURCE_DIR}/system/shaders/${shader} + DEPENDS ${CMAKE_SOURCE_DIR}/system/shaders/${shader} COMMENT "FX compile vertex shader ${shader}" VERBATIM) list(APPEND SHADERS ${file}.h) @@ -230,8 +230,8 @@ if(CORE_SYSTEM_NAME STREQUAL windows) get_filename_component(file ${shader} NAME_WE) add_custom_command(OUTPUT ${file}.h COMMAND ${FXC} /Fh ${file}.h /E PS /T ps_4_0_level_9_1 /Vn ${file} /Qstrip_reflect - ${CORE_SOURCE_DIR}/system/shaders/${shader} - DEPENDS ${CORE_SOURCE_DIR}/system/shaders/${shader} + ${CMAKE_SOURCE_DIR}/system/shaders/${shader} + DEPENDS ${CMAKE_SOURCE_DIR}/system/shaders/${shader} COMMENT "FX compile pixel shader ${shader}" VERBATIM) list(APPEND SHADERS ${file}.h) diff --git a/xbmc/interfaces/json-rpc/schema/CMakeLists.txt b/xbmc/interfaces/json-rpc/schema/CMakeLists.txt index 7e219fe5d0..aa6142bc77 100644 --- a/xbmc/interfaces/json-rpc/schema/CMakeLists.txt +++ b/xbmc/interfaces/json-rpc/schema/CMakeLists.txt @@ -12,11 +12,11 @@ add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/ServiceDescripti add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/addons/xbmc.json/addon.xml COMMAND ${CMAKE_COMMAND} - -DCORE_SOURCE_DIR=${CORE_SOURCE_DIR} + -DCMAKE_SOURCE_DIR=${CMAKE_SOURCE_DIR} -DCORE_BINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/GenerateAddonXml.cmake WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} - DEPENDS ${JSON_SRCS} ${CORE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in + DEPENDS ${JSON_SRCS} ${CMAKE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in COMMENT "Generating xbmc.json/addon.xml") add_custom_target(generate_json_header ALL diff --git a/xbmc/interfaces/json-rpc/schema/GenerateAddonXml.cmake b/xbmc/interfaces/json-rpc/schema/GenerateAddonXml.cmake index 5365adac7c..53afaf8272 100644 --- a/xbmc/interfaces/json-rpc/schema/GenerateAddonXml.cmake +++ b/xbmc/interfaces/json-rpc/schema/GenerateAddonXml.cmake @@ -1,5 +1,5 @@ -file(STRINGS ${CORE_SOURCE_DIR}/xbmc/interfaces/json-rpc/schema/version.txt jsonrpc_version) +file(STRINGS ${CMAKE_SOURCE_DIR}/xbmc/interfaces/json-rpc/schema/version.txt jsonrpc_version) execute_process(COMMAND ${CMAKE_COMMAND} -E remove ${CORE_BINARY_DIR}/addons/xbmc.json/addon.xml) -configure_file(${CORE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in +configure_file(${CMAKE_SOURCE_DIR}/addons/xbmc.json/addon.xml.in ${CORE_BINARY_DIR}/addons/xbmc.json/addon.xml @ONLY) diff --git a/xbmc/interfaces/swig/CMakeLists.txt b/xbmc/interfaces/swig/CMakeLists.txt index 6e676159eb..26297e7231 100644 --- a/xbmc/interfaces/swig/CMakeLists.txt +++ b/xbmc/interfaces/swig/CMakeLists.txt @@ -1,7 +1,7 @@ function(generate_file file) set(classpath ${GROOVY_DIR}/groovy-all-${GROOVY_VER}.jar ${GROOVY_DIR}/commons-lang-${COMMONS_VER}.jar - ${CORE_SOURCE_DIR}/tools/codegenerator + ${CMAKE_SOURCE_DIR}/tools/codegenerator ${CMAKE_CURRENT_SOURCE_DIR}/../python) if(NOT CORE_SYSTEM_NAME STREQUAL windows) set(devnull "/dev/null") @@ -13,9 +13,9 @@ function(generate_file file) set(CPP_FILE ${file}.cpp) add_custom_command(OUTPUT ${CPP_FILE} COMMAND ${SWIG_EXECUTABLE} - ARGS -w401 -c++ -o ${file}.xml -xml -I${CORE_SOURCE_DIR}/xbmc -xmllang python ${CMAKE_CURRENT_SOURCE_DIR}/../swig/${file} + ARGS -w401 -c++ -o ${file}.xml -xml -I${CMAKE_SOURCE_DIR}/xbmc -xmllang python ${CMAKE_CURRENT_SOURCE_DIR}/../swig/${file} COMMAND ${Java_JAVA_EXECUTABLE} - ARGS -cp "${classpath}" groovy.ui.GroovyMain ${CORE_SOURCE_DIR}/tools/codegenerator/Generator.groovy ${file}.xml ${CMAKE_CURRENT_SOURCE_DIR}/../python/PythonSwig.cpp.template ${file}.cpp > ${devnull} + ARGS -cp "${classpath}" groovy.ui.GroovyMain ${CMAKE_SOURCE_DIR}/tools/codegenerator/Generator.groovy ${file}.xml ${CMAKE_CURRENT_SOURCE_DIR}/../python/PythonSwig.cpp.template ${file}.cpp > ${devnull} DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../swig/${file}) set(SOURCES ${SOURCES} "${CPP_FILE}" PARENT_SCOPE) endfunction() @@ -31,7 +31,7 @@ set(INPUTS AddonModuleXbmcaddon.i AddonModuleXbmcvfs.i AddonModuleXbmcwsgi.i) -set(GROOVY_DIR ${CORE_SOURCE_DIR}/tools/codegenerator/groovy) +set(GROOVY_DIR ${CMAKE_SOURCE_DIR}/tools/codegenerator/groovy) set(GROOVY_VER 2.4.4) set(COMMONS_VER 2.6) @@ -45,5 +45,5 @@ set_target_properties(python_binding PROPERTIES POSITION_INDEPENDENT_CODE TRUE FOLDER "Build Utilities") set(core_DEPENDS python_binding ${core_DEPENDS} CACHE STRING "" FORCE) if(WIN32) - add_precompiled_header(python_binding pch.h ${CORE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) + add_precompiled_header(python_binding pch.h ${CMAKE_SOURCE_DIR}/xbmc/platform/win32/pch.cpp PCH_TARGET kodi) endif() |