File: IncludeUrl_DESTINATION.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 (12 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
include(IncludeUrl)
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/foo.cmake" "set(FOO 1)\n")
unset(FOO)
include_url("file://${CMAKE_CURRENT_BINARY_DIR}/foo.cmake"
            DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/bar.cmake"
            RESULT_VARIABLE BAR)
if(NOT FOO)
  message(FATAL_ERROR "include_url ERROR (not included or unexpected content)")
endif()
if(NOT "${BAR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}/bar.cmake")
  message(FATAL_ERROR "include_url: ERROR (wrong file included)")
endif()