1
0
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:
2020-09-11 21:10:50 -03:00
parent 6528d44e20
commit 79acebad79
3 changed files with 12 additions and 2 deletions

View File

@@ -55,7 +55,7 @@ function(import_dependencies_from_json json)
endif()
include(${cmake_dep_file})
list(APPEND CMAKE_CONFIGURE_DEPENDS ${json_dep_file})
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${json_dep_file})
endfunction()
list(APPEND CMAKE_CONFIGURE_DEPENDS ${CMDEP_GENERATOR_SCRIPT})

View File

@@ -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.")
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})
# To prevent other concurrent CMake instances from trying to download or extract

View File

@@ -215,6 +215,14 @@ for (name, dep_info) in j.items():
for (var_name, value) in target_info["cache"].items():
if isinstance(value, bool):
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})")
elif target_type == "cmake":
print("include(${PROJECT_SOURCE_DIR}/" + target_info["file"] + ")")