Passing properties between External Projects

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Passing properties between External Projects

Borchers, Henry Samuel

Is there an easier way to pass properties from one ExternalProject_Add command to another?


The only way I’ve got it to work is..

1)      Use the command “ExternalProject_Add(myExternalDependencyA …)”

2)      Use “add_library(imported_myExternalDependencyA STATIC IMPORTED)”

3)      Get “ExternalProject_Get_Property(myExternalDependencyA install_dir)”

4)      Use “set_target_properties(imported_myExternalDependencyA INCLUDE_DIRECTORIES ${install_dir}/include” and any other properties etc..

5)      Use the command “ExternalProject_Add(myExternalDependencyB … CMAKE_ARGS –DMY_EXTERNAL_DEPENDENCY_A_INCLUDE= $<TARGET_PROPERTY: imported_myExternalDependencyA,INCLUDE_DIRECTORIES>)”



It seems to work but it also seems excessive. Is there a better way that doesn’t require using an imported library? $<TARGET_PROPERTY:TARGET,PROPERTY> doesn’t seem to work with ExternalProjects.


Henry Borchers

Digital Library Technical Coordinator

1408 W Gregory Dr, Room 413

Urbana, IL 61801

(217) 244-2110



Powered by

Please keep messages on-topic and check the CMake FAQ at:

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support:
CMake Consulting:
CMake Training Courses:

Visit other Kitware open-source projects at

Follow this link to subscribe/unsubscribe: