[cmake-developers] [CMake 0012379]: EXCLUDE_FROM_DEFAULT_BUILD in MSVC breaks with dependencies

Mantis Bug Tracker mantis at public.kitware.com
Mon Aug 1 12:59:40 EDT 2011


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=12379 
====================================================================== 
Reported By:                Johan Björk
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   12379
Category:                   CMake
Reproducibility:            always
Severity:                   major
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2011-08-01 12:59 EDT
Last Modified:              2011-08-01 12:59 EDT
====================================================================== 
Summary:                    EXCLUDE_FROM_DEFAULT_BUILD in MSVC breaks with
dependencies
Description: 
There won't be any dependency created for the executable to the library it must
link to.

1>------ Skipped Build: Project: foo, Configuration: Debug Win32 ------
1>Project not selected to build for this solution configuration 
2>------ Build started: Project: foobar, Configuration: Debug Win32 ------
2>Compiling...
2>foobar.c
2>Compiling manifest to resources...
2>Microsoft (R) Windows (R) Resource Compiler Version 6.0.5724.0
2>Copyright (C) Microsoft Corporation.  All rights reserved.
2>Linking...
2>LINK : fatal error LNK1104: cannot open file 'Debug\foo.lib'
2>Build log was saved at "file://c:\Users\Felix Bruns\Documents\Visual Studio
2008\Projects\a'\foobar.dir\Debug\BuildLog.htm"
2>foobar - 1 error(s), 0 warning(s)
3>------ Skipped Build: Project: ALL_BUILD, Configuration: Debug Win32 ------
3>Project not selected to build for this solution configuration 
========== Build: 0 succeeded, 1 failed, 1 up-to-date, 2 skipped ==========


Steps to Reproduce: 
Run the following cmakelists in MSVC.

FILE(WRITE foo.c "")
add_library(foo EXCLUDE_FROM_ALL foo.c)
set_target_properties(foo PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD 1)
FILE(WRITE foobar.c "")
add_executable(foobar foobar.c)
target_link_libraries(foobar foo)
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-08-01 12:59 Johan Björk    New Issue                                    
======================================================================




More information about the cmake-developers mailing list