MantisBT - CMake
View Issue Details
0013869CMakeCMakepublic2013-01-23 04:012013-06-03 09:05
Albert A 
Brad King 
normalmajoralways
closedfixed 
PCWindows7
CMake 2.8.10 
CMake 2.8.11CMake 2.8.11 
0013869: Transitive external project dependency won't compile under VS2012
I have an external project defined as:

ExternalProject_Add(
    LibExternal
    ...
    )

add_library(libexternal STATIC IMPORTED GLOBAL)
set_property(TARGET libexternal PROPERTY
    IMPORTED_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/libexternal.a)
add_dependencies(libexternal LibExternal)

Which I link to other project as:
target_link_libraries(lib1 libexternal)

And then to another:
target_link_libraries(lib2 lib1)

As expected the *.sln created for lib1 compiles LibExternal.

The *.sln created for lib2 has LibExternal in the build tree but it is not checked for build in the Configuration Manager and therefore skipped during build.
No tags attached.
zip cmake_bug.zip (1,421) 2013-01-24 11:22
https://public.kitware.com/Bug/file/4624/cmake_bug.zip
Issue History
2013-01-23 04:01Albert ANew Issue
2013-01-24 08:59Brad KingNote Added: 0032147
2013-01-24 11:22Albert AFile Added: cmake_bug.zip
2013-01-24 11:23Albert ANote Added: 0032150
2013-01-24 13:00Brad KingNote Added: 0032151
2013-01-24 15:02Albert ANote Added: 0032152
2013-01-24 15:21Brad KingNote Added: 0032153
2013-01-24 15:21Brad KingAssigned To => Brad King
2013-01-24 15:21Brad KingStatusnew => resolved
2013-01-24 15:21Brad KingResolutionopen => fixed
2013-01-24 15:21Brad KingFixed in Version => CMake 2.8.11
2013-01-24 15:21Brad KingTarget Version => CMake 2.8.11
2013-06-03 09:05Robert MaynardNote Added: 0033191
2013-06-03 09:05Robert MaynardStatusresolved => closed

Notes
(0032147)
Brad King   
2013-01-24 08:59   
I cannot reproduce this. Please provide a complete example in a tarball or zip attachment to this issue.
(0032150)
Albert A   
2013-01-24 11:23   
See uploaded file. After running cmake open `Lib2.sln` .

Although `MyExternal` is in the solution. It is excluded from the build in visual studio configuration manager.
(0032151)
Brad King   
2013-01-24 13:00   
Please test with a recent nightly binary from here:

 http://www.cmake.org/files/dev/?C=M;O=D [^]
(0032152)
Albert A   
2013-01-24 15:02   
Works like magic. 10x.
(0032153)
Brad King   
2013-01-24 15:21   
Great, thanks for reporting back. There have been several changes affecting VS 11 generation recently. I don't know off the top of my head which one fixed this but it will be in 2.8.11.
(0033191)
Robert Maynard   
2013-06-03 09:05   
Closing resolved issues that have not been updated in more than 4 months.