The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14859 
====================================================================== 
Reported By:                Felix Schwitzer
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14859
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-04-01 17:53 EDT
Last Modified:              2014-04-01 17:53 EDT
====================================================================== 
Summary:                    UseSWIG rebuilds source even when the the
dependencies have not changed (again)
Description: 
This reopens 0010080, as I'm not the original reporter and therefore can't
reopen the bug.

The fix provided in
http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=63ebb1
does not solve the problem of recompiling the python-module again and again, if
the module name is passed via

  set_source_files_properties(
    ${_interfacefile} PROPERTIES
    CPLUSPLUS ON
    SWIG_FLAGS "-DMODULENAME=${_modulename}")

The original, reverted, change
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f0111deb
worked for me.

Steps to Reproduce: 
See attached example

Additional Information: 
I build the bindings almost always for different script languages, iterating
over the languages and passing a modified modulname appropriate to the
selected language in the way mentioned above. A cmake fragment would look
like

set(_iffile "ltt.i")
set(_languages "ruby" "python")
foreach(_lang ${_languages})
  if(_lang STREQUAL "ruby")
    set(_modulename "rltt")
    set(_libs ${RUBY_LIBRARY})
  elseif(_lang STREQUAL "python")
    set(_modulename "pyltt")
    set(_libs ${PYTHON_LIBRARY})
  endif()
  set_source_files_properties(
    ${_iffile} PROPERTIES
    CPLUSPLUS ON
    SWIG_FLAGS "-DMODULENAME=${_modulename}")
  swig_add_module(${_modulename} ${_lang} ${_iffile})
  swig_link_libraries(${_modulename} ltt ${_libs})
endforeach()

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-04-01 17:53 Felix SchwitzerNew Issue                                    
2014-04-01 17:53 Felix SchwitzerFile Added: ltt.zip                          
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to