I have a library and use the "UseSWIG"-module to generate bindings for different scripting languages from an interface file (ltt.i in the example below). To get the bindings for more than one language, my CMakeLists.txt looks somehow like
add_library(ltt <sources>) include(UseSWIG) foreach(_lang "ruby" "python") if(_lang STREQUAL "ruby") set(_modulename "rltt") else() set(_modulename "pltt") endif() swig_add_module(${_modulename} ${_lang} ltt.i) swig_link_libraries(${_modulename} ltt) endif() Running this with cmake built from master (version 3.2.20150326-g5d1d99) now gives the warning about Policy CMP0057 is not set: Disallow multiple MAIN_DEPENDENCY specifications Is this a bug in UseSWIG or is my use case invalid? If the latter, who can I workaround it? The warning comes from UseSWIG in line 193; the interface file is added as a MAIN_DEPENDENCY to the swig-generated wrapper file, and because of the loop, it is added twice, to the lttPYTHON_warp.cxx and lttRUBY_warp.cxx, the two swig-generated files. Fixing this would be simple by adding the interface file as a normal dependency to the wrapper-files, the only drawback is backward compatibility. regards Felix -- 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/mailman/listinfo/cmake-developers