MantisBT - CMake
View Issue Details
0015480CMakeCMakepublic2015-03-27 17:072015-11-02 09:13
Felix Schwitzer 
 
normalminorhave not tried
closedfixed 
 
 
0015480: UseSWIG.cmake warns about CMP0057
When calling swig_add_module (from module UseSWIG) with the same interface file for different scripting languages, cmake emits a warning about CMP0057 as swig_add_module adds the interface file as MAIN_DEPENDENCY to the generated wrapper file.
This happens with an actual cmake from master (7910cb7);
see http://article.gmane.org/gmane.comp.programming.tools.cmake.devel/12835 [^]

I added a minimal example to reproduce and a patch
unpack the attached example tst.tgz and change into the directory tst, then
    mkdir build && cd build && cmake ..

Without patching cmake fails as CMP0057 is set to new. With the patch the command runs fine.

On a system with swig, ruby-dev and python-dev installed, compilation should run fine and also the dependencies are kept right:
    make
-> runs swig and compiles the wrappers
    touch ../ltt.i && make
-> runs swig again and compiles the wrappers
No tags attached.
tgz tst.tgz (1,463) 2015-03-27 17:07
https://public.kitware.com/Bug/file/5415/tst.tgz
patch 0001-UseSWIG-fix-warning-about-CMP0057.patch (1,101) 2015-03-27 17:08
https://public.kitware.com/Bug/file/5416/0001-UseSWIG-fix-warning-about-CMP0057.patch
Issue History
2015-03-27 17:07Felix SchwitzerNew Issue
2015-03-27 17:07Felix SchwitzerFile Added: tst.tgz
2015-03-27 17:08Felix SchwitzerFile Added: 0001-UseSWIG-fix-warning-about-CMP0057.patch
2015-03-30 09:39Brad KingNote Added: 0038362
2015-03-30 09:39Brad KingStatusnew => resolved
2015-03-30 09:39Brad KingResolutionopen => fixed
2015-03-30 09:39Brad KingFixed in Version => CMake 3.3
2015-03-30 09:39Brad KingTarget Version => CMake 3.3
2015-04-30 10:33Brad KingNote Added: 0038659
2015-04-30 10:33Brad KingFixed in VersionCMake 3.3 =>
2015-04-30 10:33Brad KingTarget VersionCMake 3.3 =>
2015-11-02 09:13Robert MaynardNote Added: 0039798
2015-11-02 09:13Robert MaynardStatusresolved => closed

Notes
(0038362)
Brad King   
2015-03-30 09:39   
Applied, thanks:

 UseSWIG: Do not use MAIN_DEPENDENCY on custom commands
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=b372a99a [^]
(0038659)
Brad King   
2015-04-30 10:33   
It turns out that the original CMP0057 addressing MAIN_DEPENDENCY was not correct and has been reverted along with the change linked in 0015480:0038362, so this is now a non-issue:

 Revert "add_custom_command: Diagnose MAIN_DEPENDENCY limitation."
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=32a2f414 [^]

(There is a new CMP0057 that means something else.)
(0039798)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.