MantisBT - CMake
View Issue Details
0015313CMakeCMakepublic2014-12-17 11:262016-05-02 08:30
Egor P. 
 
normalminoralways
closedfixed 
MSVCWindows8.1
CMake 3.0.2 
CMake 3.5CMake 3.5 
0015313: .def files are not visible in Visual Studio project tree
When using .def files to set public symbols in libraries it is important to edit .def file (sometimes frequently).
But now they are just consumed by CMake, added to project building (/DEF:...) and not visible in solution.

Is it possible to add .def files to project file tree in Visual Studio?
a.cpp:
void a(){}

a.def:
EXPORTS a

CMakeLists.txt
add_library(a SHARED a.cpp a.def)
def, msvc
Issue History
2014-12-17 11:26Egor P.New Issue
2014-12-17 11:27Egor P.Tag Attached: def
2014-12-17 11:27Egor P.Tag Attached: msvc
2014-12-17 11:35Brad KingNote Added: 0037475
2015-11-04 09:16Brad KingNote Added: 0039833
2015-11-04 09:17Brad KingNote Added: 0039834
2015-11-04 09:17Brad KingStatusnew => resolved
2015-11-04 09:17Brad KingResolutionopen => fixed
2015-11-04 09:17Brad KingFixed in Version => CMake 3.5
2015-11-04 09:17Brad KingTarget Version => CMake 3.5
2016-05-02 08:30Robert MaynardNote Added: 0040955
2016-05-02 08:30Robert MaynardStatusresolved => closed

Notes
(0037475)
Brad King   
2014-12-17 11:35   
cmGeneratorTarget::GetModuleDefinitionFile needs to be refactored to return a cmSourceFile* instead of just the path to the source, and its caller(s) updated. Then cmVisualStudio10TargetGenerator::WriteAllSources can use it to call WriteSource("None", defsrc).
(0039833)
Brad King   
2015-11-04 09:16   
Relevant mailing list thread:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/14846 [^]
(0039834)
Brad King   
2015-11-04 09:17   
These commits fix this:

 Refactor `.def` file lookup
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=247c168b [^]

 VS: Add module definition `.def` files to .vcxproj files
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=e7e713cc [^]
(0040955)
Robert Maynard   
2016-05-02 08:30   
Closing resolved issues that have not been updated in more than 4 months.