forked from toeb/cmakepp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.cmake
27 lines (20 loc) · 916 Bytes
/
install.cmake
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## download a stable cmakepp release
set(git_uri "https://github.com/AnotherFoxGuy/cmakepp")
set(installation_dir "${CMAKE_CURRENT_BINARY_DIR}/cmakepp")
set(cmakepp_uri "${git_uri}/releases/download/v2022.09/cmakepp.cmake")
set(target_file "${CMAKE_BINARY_DIR}/cmakepp.cmake")
message(STATUS "Installing CMake++")
## downloads an old stable version of cmakepp
## includes it and deletes the file.
file(DOWNLOAD "${cmakepp_uri}" "${target_file}" STATUS status)
if (NOT "${status}" MATCHES "0;")
message(FATAL_ERROR "failed to download cmakepp")
endif ()
include("${target_file}")
message(STATUS "\n installation_dir: ${installation_dir}")
## sets up the environment for cmakepp
## (adds path, export, aliases,... (not too intrusive - just a bit))
pushd("${installation_dir}")
cmake(-P cmakepp.cmake cmakepp_setup_environment)
popd()
message(STATUS "Install Complete - re-login for changes to take effect")