diff options
author | Rechi <Rechi@users.noreply.github.com> | 2018-03-18 20:05:00 +0100 |
---|---|---|
committer | Rechi <Rechi@users.noreply.github.com> | 2018-03-18 20:05:00 +0100 |
commit | eb59376472d55a4006a98635a2f98990e4fb4cb1 (patch) | |
tree | 6716cad91a5bac0fda5ca45832e65ed7423e5f6c | |
parent | 7f79587bf74c039651fce16a4c960a61dc1175f6 (diff) |
[cmake][addons] make package-<ADDON-ID> multi config aware
-rw-r--r-- | cmake/addons/CMakeLists.txt | 8 | ||||
-rw-r--r-- | cmake/scripts/common/AddonHelpers.cmake | 9 |
2 files changed, 13 insertions, 4 deletions
diff --git a/cmake/addons/CMakeLists.txt b/cmake/addons/CMakeLists.txt index fd1d44879b..5fc798b545 100644 --- a/cmake/addons/CMakeLists.txt +++ b/cmake/addons/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(kodi-addons) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) @@ -403,8 +403,12 @@ foreach(addon ${addons}) endif() # create a forwarding target to the addon-package target + get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) + if(_isMultiConfig) + set(config --config $<CONFIG>) + endif() add_custom_target(package-${id} - COMMAND ${CMAKE_COMMAND} --build ${id}-prefix/src/${id}-build --target addon-package + COMMAND ${CMAKE_COMMAND} --build ${id}-prefix/src/${id}-build ${config} --target addon-package DEPENDS ${id}) add_dependencies(package-addons package-${id}) diff --git a/cmake/scripts/common/AddonHelpers.cmake b/cmake/scripts/common/AddonHelpers.cmake index f6d79a40c0..5470940420 100644 --- a/cmake/scripts/common/AddonHelpers.cmake +++ b/cmake/scripts/common/AddonHelpers.cmake @@ -6,8 +6,13 @@ # Sadly we cannot extend the 'package' target, as it is a builtin target, see # http://public.kitware.com/Bug/view.php?id=8438 # Thus, we have to add an 'addon-package' target. -add_custom_target(addon-package - COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) +get_property(_isMultiConfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +if(_isMultiConfig) + add_custom_target(addon-package DEPENDS PACKAGE) +else() + add_custom_target(addon-package + COMMAND ${CMAKE_COMMAND} --build ${CMAKE_BINARY_DIR} --target package) +endif() macro(add_cpack_workaround target version ext) if(NOT PACKAGE_DIR) |