File: CMP0180.cmake

package info (click to toggle)
cmake 4.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 152,344 kB
  • sloc: ansic: 403,894; cpp: 303,807; sh: 4,097; python: 3,582; yacc: 3,106; lex: 1,279; f90: 538; asm: 471; lisp: 375; cs: 270; java: 266; fortran: 239; objc: 215; perl: 213; xml: 198; makefile: 108; javascript: 83; pascal: 63; tcl: 55; php: 25; ruby: 22
file content (17 lines) | stat: -rw-r--r-- 989 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
add_subdirectory(subdir1)

# Simulate a situation that FetchContent_MakeAvailable() used to be able to
# create, but that should no longer be possible. If depname_SOURCE_DIR and
# depname_BINARY_DIR variables are defined as non-cache variables before the
# project(depname) call, those non-cache variables used to prevent project()
# from setting those variables itself due to CMP0126 (if set to NEW). This only
# showed up if the project(depname) call was not in the dependency's top level
# CMakeLists.txt file, but rather in a subdirectory (googletest is one example
# that used to do this). Since CMake 3.30.3, the dependency's project() call
# should set non-cache variables that will make the variable values visible
# and avoid any masking from variables set before the project() call. We want
# to verify this 3.30.3+ behavior here and in subdir2.
set(sub2proj_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(sub2proj_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

add_subdirectory(subdir2)