View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013173CMakeCMakepublic2012-04-27 04:332014-06-02 08:37
ReporterGaleazzi 
Assigned Tojschueller 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformWindowsOSOS Version
Product VersionCMake 2.8.8 
Target VersionFixed in VersionCMake 3.0 
Summary0013173: Swig module can't handle absolute path
DescriptionWhen you have an out-of-source project like the following structure:
C:\MyFolder\CMakeList.txt
D:\SourceFolder\wrapper.i
it generates this error:
CMake Error in CMakeLists.txt:
  Cannot find source file:
C:/MyFolder/D:/SourceFolder/wrapper.i
TagsNo tags attached.
Attached Files

 Relationships
related to 0013772closedjschueller UseSWIG.cmake does not handle relative paths with parent directories 
has duplicate 0014459closedjschueller SWIG_ADD_MODULE does not create sub directory 

  Notes
(0029353)
Rolf Eike Beer (developer)
2012-04-27 05:01

Please also provide a stripped down version of your CMakeLists.txt.
(0029356)
Galeazzi (reporter)
2012-04-27 05:21

project (MyProject)
  set(SourcesList D:/SourceFolder/wrapper.i
                  D:/SourceFolder/example.cpp
          D:/SourceFolder/example.h
                  D:/SourceFolder/DLLMacros.h
                 )
  include_directories(C:/Tools/Libs
                      C:/Include)
  set(COMPILE_DEF DLLEXPORT;__TOOLS__)
  
  #SWIG Section
  FIND_PACKAGE(SWIG REQUIRED)
  INCLUDE(${SWIG_USE_FILE})

  SET(CMAKE_SWIG_FLAGS "")

  SET_SOURCE_FILES_PROPERTIES(D:/SourceFolder/wrapper.i PROPERTIES CPLUSPLUS ON)
  SWIG_ADD_MODULE(MyProject csharp ${SourcesList})
  
  set_property(TARGET MyProject APPEND PROPERTY COMPILE_DEFINITIONS ${COMPILE_DEF} )
(0029357)
Rolf Eike Beer (developer)
2012-04-27 06:46

Thank you.

AFAICS this happens because of the fiddling with the source and binary paths in SWIG_ADD_SOURCE_TO_MODULE. I don't understand what is happening there and why it doesn't just use get_filename_component(ABSOLUTE).

As a workaround you could put the source file as a relative path to your source dir into the CMakeLists.txt, that should work for the moment.
(0034546)
jschueller (developer)
2013-11-25 09:08

http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=276e3735 [^]
(0036027)
Robert Maynard (manager)
2014-06-02 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-04-27 04:33 Galeazzi New Issue
2012-04-27 05:01 Rolf Eike Beer Note Added: 0029353
2012-04-27 05:21 Galeazzi Note Added: 0029356
2012-04-27 06:46 Rolf Eike Beer Note Added: 0029357
2012-04-27 06:46 Rolf Eike Beer Assigned To => Mathieu Malaterre
2012-04-27 06:46 Rolf Eike Beer Status new => assigned
2013-11-25 08:28 Brad King Assigned To Mathieu Malaterre => jschueller
2013-11-25 08:28 Brad King Relationship added related to 0013772
2013-11-25 08:28 Brad King Relationship added related to 0014459
2013-11-25 09:08 jschueller Note Added: 0034546
2013-11-25 09:08 jschueller Status assigned => resolved
2013-11-25 09:08 jschueller Fixed in Version => CMake 3.0
2013-11-25 09:08 jschueller Resolution open => fixed
2013-11-25 09:11 jschueller Relationship replaced has duplicate 0014459
2014-06-02 08:37 Robert Maynard Note Added: 0036027
2014-06-02 08:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team