mirror of
https://github.com/Rogiel/CMakeDependency
synced 2025-12-05 21:22:46 +00:00
Fixed DOWNLOAD_NAME variable
This commit is contained in:
@@ -55,7 +55,7 @@ function(import_dependencies_from_json json)
|
|||||||
endif()
|
endif()
|
||||||
include(${cmake_dep_file})
|
include(${cmake_dep_file})
|
||||||
|
|
||||||
list(APPEND CMAKE_CONFIGURE_DEPENDS ${json_dep_file})
|
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${json_dep_file})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
list(APPEND CMAKE_CONFIGURE_DEPENDS ${CMDEP_GENERATOR_SCRIPT})
|
list(APPEND CMAKE_CONFIGURE_DEPENDS ${CMDEP_GENERATOR_SCRIPT})
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ set(@DEPENDENCY_NAME@_SOURCE_DIR
|
|||||||
"A path that points to a @DEPENDENCY_NAME@ source directory. If manually set, no downloading or extraction will take place and this will be used instead.")
|
"A path that points to a @DEPENDENCY_NAME@ source directory. If manually set, no downloading or extraction will take place and this will be used instead.")
|
||||||
set(@DEPENDENCY_NAME@_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/@DEPENDENCY_NAME@)
|
set(@DEPENDENCY_NAME@_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/@DEPENDENCY_NAME@)
|
||||||
|
|
||||||
get_filename_component(@DEPENDENCY_NAME@_DOWNLOAD_NAME "${@DEPENDENCY_NAME@_URL}" NAME)
|
if(NOT @DEPENDENCY_NAME@_DOWNLOAD_NAME)
|
||||||
|
get_filename_component(@DEPENDENCY_NAME@_DOWNLOAD_NAME "${@DEPENDENCY_NAME@_URL}" NAME)
|
||||||
|
endif()
|
||||||
set(@DEPENDENCY_NAME@_ZIP ${CMDEP_ZIP_DIR}/${@DEPENDENCY_NAME@_DOWNLOAD_NAME})
|
set(@DEPENDENCY_NAME@_ZIP ${CMDEP_ZIP_DIR}/${@DEPENDENCY_NAME@_DOWNLOAD_NAME})
|
||||||
|
|
||||||
# To prevent other concurrent CMake instances from trying to download or extract
|
# To prevent other concurrent CMake instances from trying to download or extract
|
||||||
|
|||||||
@@ -215,6 +215,14 @@ for (name, dep_info) in j.items():
|
|||||||
for (var_name, value) in target_info["cache"].items():
|
for (var_name, value) in target_info["cache"].items():
|
||||||
if isinstance(value, bool):
|
if isinstance(value, bool):
|
||||||
print("set(" + var_name + " " + ("ON" if value else "OFF") + " CACHE INTERNAL \"\" FORCE)")
|
print("set(" + var_name + " " + ("ON" if value else "OFF") + " CACHE INTERNAL \"\" FORCE)")
|
||||||
|
|
||||||
|
project_name = target_info['project_name'] if "project_name" in target_info else None
|
||||||
|
if project_name is not None:
|
||||||
|
if "include" in target_info:
|
||||||
|
print("set(CMAKE_PROJECT_" + project_name + "_INCLUDE " + to_cmake_datatype(target_relative_path(target_info['include'], name)) + ")")
|
||||||
|
if "include_before" in target_info:
|
||||||
|
print("set(CMAKE_PROJECT_" + project_name + "_INCLUDE_BEFORE " + to_cmake_datatype(target_relative_path(target_info['include_before'], name)) + ")")
|
||||||
|
|
||||||
print("add_subdirectory(${" + target_name + "_SOURCE_DIR} ${" + target_name + "_BINARY_DIR})")
|
print("add_subdirectory(${" + target_name + "_SOURCE_DIR} ${" + target_name + "_BINARY_DIR})")
|
||||||
elif target_type == "cmake":
|
elif target_type == "cmake":
|
||||||
print("include(${PROJECT_SOURCE_DIR}/" + target_info["file"] + ")")
|
print("include(${PROJECT_SOURCE_DIR}/" + target_info["file"] + ")")
|
||||||
|
|||||||
Reference in New Issue
Block a user