1

You can get a property of a CMake target that was built using ExternalProject_add using something like this:

ExternalProject_Get_property(zipper SOURCE_DIR)
message("Source dir of myExtProj = ${SOURCE_DIR}")

How would I save this to another variable, i.e. not SOURCE_DIR?

CiaranWelsh
  • 7,014
  • 10
  • 53
  • 106

1 Answers1

2

If you can use ${SOURCE_DIR} to print its value, you can use it set another variable, using the set() command:

ExternalProject_Get_property(zipper SOURCE_DIR)
message("Source dir of myExtProj = ${SOURCE_DIR}")

# Set the variable zipper_SOURCE_DIR.
set(zipper_SOURCE_DIR ${SOURCE_DIR})
Kevin
  • 16,549
  • 8
  • 60
  • 74