MantisBT - CMake
View Issue Details
0015915CMakeCMakepublic2016-01-13 11:252016-06-10 14:21
Bryan Koch 
 
lowminoralways
closedno change required 
All Platforms
CMake 3.4.1 
 
0015915: add_subdirectory(directory EXPORT_VARIABLES VAR_1 VAR_2) gives "add_subdirectory called with incorrect number of arguments"
As per, https://cmake.org/pipermail/cmake/2005-September/007204.html [^]

ADD_SUBDIRECTORY(directory EXPORT VARIABLES VAR_FOO1 VAR_FOO2) should export variables from the child scope into the parent scope.

It was implemented by Ken Martin as per below
https://cmake.org/Bug/bug_relationship_graph.php?bug_id=2221&graph=relation [^]
No tags attached.
Issue History
2016-01-13 11:25Bryan KochNew Issue
2016-01-13 11:37Brad KingNote Added: 0040219
2016-01-13 11:55Bryan KochNote Added: 0040220
2016-01-13 11:56Bryan KochNote Edited: 0040220bug_revision_view_page.php?bugnote_id=40220#r1996
2016-01-13 13:19Brad KingNote Added: 0040221
2016-01-13 13:19Brad KingStatusnew => resolved
2016-01-13 13:19Brad KingResolutionopen => no change required
2016-06-10 14:21Kitware RobotNote Added: 0041291
2016-06-10 14:21Kitware RobotStatusresolved => closed

Notes
(0040219)
Brad King   
2016-01-13 11:37   
The add_subdirectory command documentation does not specify this signature (and never has):

 https://cmake.org/cmake/help/v3.4/command/add_subdirectory.html [^]

According to 0002221:0003028 the capability was added in the get_directory_property command:

 https://cmake.org/cmake/help/v3.4/command/get_directory_property.html [^]

It is the "DEFINITION" signature.

However, I've never needed to use this in practice. What are you trying to accomplish?
(0040220)
Bryan Koch   
2016-01-13 11:55   
(edited on: 2016-01-13 11:56)
I'm looking to add several smaller projects git repo's to be built by my project and I was looking for a way to retrieve some of the variables that each smaller projects use so that I can automate building them.

EDIT: Forgot to mention that I need everything in one binary.

(0040221)
Brad King   
2016-01-13 13:19   
Re 0015915:0040220: Okay, the get_directory_property approach could work for that if the projects happen to store the information you need in variables to avoid having to make modifications to their sources.
(0041291)
Kitware Robot   
2016-06-10 14:21   
This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.