diff --git a/1k/fetch.cmake b/1k/fetch.cmake index 499adf699ee2..c5c5d7a73686 100644 --- a/1k/fetch.cmake +++ b/1k/fetch.cmake @@ -19,6 +19,14 @@ function(_1kfetch_init) list(GET _1kdist_url 1 _1kdist_ver) set(_1kdist_base_url "${_1kdist_base_url}/v${_1kdist_ver}" PARENT_SCOPE) set(_1kdist_ver ${_1kdist_ver} PARENT_SCOPE) + if(NOT _1kfetch_cache_dir) + file(REAL_PATH "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../cache" _1kfetch_cache_dir) + set(_1kfetch_cache_dir "${_1kfetch_cache_dir}" CACHE STRING "" FORCE) + endif() + if(NOT _1kfetch_manifest) + file(REAL_PATH "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../manifest.json" _1kfetch_manifest) + set(_1kfetch_manifest "${_1kfetch_manifest}" CACHE STRING "" FORCE) + endif() endfunction() # fetch prebuilt from 1kdist @@ -97,10 +105,11 @@ function(_1kcm_add_pkg uri) endforeach() set(binary_dir "") if(IS_ABSOLUTE ${source_dir}) - string(LENGTH "${_AX_ROOT}/cache/" _offset) - string(LENGTH ${source_dir} _len) - math(EXPR _len "${_len} - ${_offset}" OUTPUT_FORMAT DECIMAL) - string(SUBSTRING ${source_dir} ${_offset} ${_len} _path) + # string(LENGTH "${_1kfetch_cache_dir}/" _offset) + # string(LENGTH "${source_dir}" _len) + # math(EXPR _len "${_len} - ${_offset}" OUTPUT_FORMAT DECIMAL) + # string(SUBSTRING ${source_dir} ${_offset} ${_len} _path) + get_filename_component(_path ${source_dir} NAME) set(binary_dir "${CMAKE_BINARY_DIR}/1kiss/${_path}") endif()