File: IncludeUrl_script.cmake

package info (click to toggle)
ycm-cmake-modules 0.13.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,640 kB
  • sloc: python: 319; sh: 181; makefile: 22
file content (14 lines) | stat: -rw-r--r-- 567 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake" "set(FOO 1)\n")
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/script.cmake" "set(CMAKE_MODULE_PATH \"${YCM_SOURCE_DIR}/modules\")
include(IncludeUrl)
unset(FOO)
include_url(\"file://${CMAKE_CURRENT_BINARY_DIR}/foo.cmake\" DOWNLOAD_ALWAYS)
if(NOT FOO)
  message(FATAL_ERROR \"include_url: failed\")
endif()
")
execute_process(COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_BINARY_DIR}/script.cmake"
                RESULT_VARIABLE _res)
if(_res)
  message(FATAL_ERROR "include_url: ERROR (script returned an error)")
endif()