Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#150] Restore CMake binaries to Windows package only
- Loading branch information
1 parent
0dcbb77
commit 3a598c5
Showing
4 changed files
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
if (PACKAGE_WIN32) | ||
set(CMAKE_DOWNLOAD_VERSION 3.13.3) | ||
|
||
# These variables are needed at install time | ||
set(CMAKE_BINARY_SHORT_VERSION 3.13) | ||
set(CMAKE_UNZIP_DIR "${CMAKE_BINARY_DIR}/CMakeBinary/unzipped") | ||
set(CMAKE_BINARY_INSTALLABLE_DIRECTORY "${CMAKE_UNZIP_DIR}/cmake-${CMAKE_DOWNLOAD_VERSION}-win64-x64/") | ||
|
||
set(CMAKE_BIN_FILE "${CMAKE_BINARY_DIR}/CMakeBinary/zipped/cmake-${CMAKE_DOWNLOAD_VERSION}-win64-x64.zip") | ||
if (NOT EXISTS "${CMAKE_BIN_FILE}") | ||
file(DOWNLOAD https://github.com/Kitware/CMake/releases/download/v${CMAKE_DOWNLOAD_VERSION}/cmake-${CMAKE_DOWNLOAD_VERSION}-win64-x64.zip | ||
"${CMAKE_BIN_FILE}" | ||
SHOW_PROGRESS | ||
) | ||
execute_process(COMMAND "${CMAKE_COMMAND}" -E remove_directory "${CMAKE_UNZIP_DIR}") | ||
endif () | ||
|
||
add_custom_target(win_cmake ALL DEPENDS "${CMAKE_BINARY_INSTALLABLE_DIRECTORY}/bin/cmake.exe") | ||
add_custom_command(OUTPUT "${CMAKE_UNZIP_DIR}" | ||
COMMAND "${CMAKE_COMMAND}" -E make_directory "${CMAKE_UNZIP_DIR}" | ||
) | ||
add_custom_command(OUTPUT "${CMAKE_BINARY_INSTALLABLE_DIRECTORY}/bin/cmake.exe" | ||
COMMAND "${CMAKE_COMMAND}" -E tar -xf "${CMAKE_BIN_FILE}" | ||
DEPENDS "${CMAKE_BIN_FILE}" "${CMAKE_UNZIP_DIR}" | ||
WORKING_DIRECTORY "${CMAKE_UNZIP_DIR}" | ||
) | ||
endif () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters