diff options
author | fuzzard <fuzzard@kodi.tv> | 2022-04-30 07:36:54 +1000 |
---|---|---|
committer | fuzzard <fuzzard@kodi.tv> | 2022-04-30 19:50:32 +1000 |
commit | 30730ac5e4b6d5e746c33f053893bff278cc5445 (patch) | |
tree | 52d6fb7b633cbb4b7c8916cb0e4930fab92b32d6 /cmake/scripts | |
parent | 93fa1b5c0ee4fe74fc541d90eefbd9a25763271b (diff) |
[cmake] refactor CMAKE_INSTALL_PREFIX into BUILD_DEP_TARGET macro
set CMAKE_INSTALL_PREFIX in BUILD_DEP_TARGET, and use DEPENDS_PATH for location
Diffstat (limited to 'cmake/scripts')
-rw-r--r-- | cmake/scripts/common/ModuleHelpers.cmake | 10 | ||||
-rw-r--r-- | cmake/scripts/common/PathSetup.cmake | 7 |
2 files changed, 13 insertions, 4 deletions
diff --git a/cmake/scripts/common/ModuleHelpers.cmake b/cmake/scripts/common/ModuleHelpers.cmake index b2273c5688..ab6357116c 100644 --- a/cmake/scripts/common/ModuleHelpers.cmake +++ b/cmake/scripts/common/ModuleHelpers.cmake @@ -65,13 +65,13 @@ function(get_versionfile_data module_name) endif() # Set Debug and Release library names - set(${UPPER_MODULE_NAME}_LIBRARY_DEBUG ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${${UPPER_MODULE_NAME}_BYPRODUCT_DEBUG} PARENT_SCOPE) - set(${UPPER_MODULE_NAME}_LIBRARY_RELEASE ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${${UPPER_MODULE_NAME}_BYPRODUCT} PARENT_SCOPE) + set(${UPPER_MODULE_NAME}_LIBRARY_DEBUG ${DEPENDS_PATH}/lib/${${UPPER_MODULE_NAME}_BYPRODUCT_DEBUG} PARENT_SCOPE) + set(${UPPER_MODULE_NAME}_LIBRARY_RELEASE ${DEPENDS_PATH}/lib/${${UPPER_MODULE_NAME}_BYPRODUCT} PARENT_SCOPE) endif() - set(${UPPER_MODULE_NAME}_LIBRARY ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/lib/${${UPPER_MODULE_NAME}_BYPRODUCT} PARENT_SCOPE) + set(${UPPER_MODULE_NAME}_LIBRARY ${DEPENDS_PATH}/lib/${${UPPER_MODULE_NAME}_BYPRODUCT} PARENT_SCOPE) endif() - set(${UPPER_MODULE_NAME}_INCLUDE_DIR ${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}/include PARENT_SCOPE) + set(${UPPER_MODULE_NAME}_INCLUDE_DIR ${DEPENDS_PATH}/include PARENT_SCOPE) set(${UPPER_MODULE_NAME}_VER ${${UPPER_MODULE_NAME}_VER} PARENT_SCOPE) if (${UPPER_MODULE_NAME}_BASE_URL) @@ -131,6 +131,7 @@ macro(BUILD_DEP_TARGET) if(CMAKE_ARGS) set(CMAKE_ARGS CMAKE_ARGS ${CMAKE_ARGS} + -DCMAKE_INSTALL_PREFIX=${DEPENDS_PATH} -DCMAKE_INSTALL_LIBDIR=lib) if(CMAKE_TOOLCHAIN_FILE) list(APPEND CMAKE_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") @@ -186,6 +187,7 @@ macro(BUILD_DEP_TARGET) DOWNLOAD_DIR ${TARBALL_DIR} DOWNLOAD_NAME ${${MODULE}_ARCHIVE} PREFIX ${CORE_BUILD_DIR}/${MODULE_LC} + INSTALL_DIR ${DEPENDS_PATH} ${CMAKE_ARGS} ${PATCH_COMMAND} ${CONFIGURE_COMMAND} diff --git a/cmake/scripts/common/PathSetup.cmake b/cmake/scripts/common/PathSetup.cmake new file mode 100644 index 0000000000..4948eb1d1e --- /dev/null +++ b/cmake/scripts/common/PathSetup.cmake @@ -0,0 +1,7 @@ +# Platform path setup +include(cmake/scripts/${CORE_SYSTEM_NAME}/PathSetup.cmake) + +# Fallback install location for dependencies built +if(NOT DEPENDS_PATH) + set(DEPENDS_PATH "${CMAKE_BINARY_DIR}/${CORE_BUILD_DIR}") +endif() |