[CMake] Passing properties between External Projects

Borchers, Henry Samuel hborcher at illinois.edu
Tue Oct 24 13:19:18 EDT 2017


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20171024/5c4e1ca5/attachment.html>


More information about the CMake mailing list