The following issue has been SUBMITTED. ====================================================================== http://public.kitware.com/Bug/view.php?id=14811 ====================================================================== Reported By: Yew Kurabayashi Assigned To: ====================================================================== Project: CMake Issue ID: 14811 Category: CMake Reproducibility: always Severity: feature Priority: high Status: new ====================================================================== Date Submitted: 2014-03-18 13:27 JST Last Modified: 2014-03-18 13:27 JST ====================================================================== Summary: Too many include paths are set to AM_MOC_INCLUDES in AutomocInfo.cmake then the build fails. Description: I want to use following classes in ITK and ParaView for image conversion between ITK and Qt through VTK.
itk::ImageToVTKImageFilter< TInputImage > http://www.itk.org/Doxygen/html/classitk_1_1ImageToVTKImageFilter.html itk::VTKImageToImageFilter< TOutputImage > http://www.itk.org/Doxygen/html/classitk_1_1VTKImageToImageFilter.html pqCoreUtilities http://www.paraview.org/ParaView/Doc/Nightly/www/cxx-doc/classpqCoreUtilities.html So, I wrote a CmakeLists.txt as below and generated a solution for Visual Studio 11(MSVC 2012) Win64 with Cmake GUI successfully, but subsequent build process with MSVC fails every time. I found out that the build stop is caused from moc failure via too many include paths set to AM_MOC_INCLUDES in the file “(build directory)/CmakeFiles/(project name)_automoc.dir/AutomocInfo.cmake”. I can finish build process by deleting some paths in AM_MOC_INCLUDES, but I think it's very hard task and there is no guarantee for right build in this way. I know that it might not be a bug in Cmake, and be a limitation of moc. But it's a critical limitation in the development together with ITK, VTK, ParaView, and Qt. So, I appreciate if you show a solution or some workarounds for this problem. Thank you in advance. Steps to Reproduce: Generate a solution for MSVC 2012 Win64 with following CmakeLists.txt, then build it by Visual Studio. CmakeLists.txt: cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) if(POLICY CMP0020) cmake_policy(SET CMP0020 NEW) endif() project(MocTest.1.0) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_AUTOMOC ON) find_package(Qt5Widgets REQUIRED) find_package(ITK REQUIRED NO_MODULE) include(${ITK_USE_FILE}) FIND_PACKAGE(ParaView REQUIRED) INCLUDE(${PARAVIEW_USE_FILE}) file(GLOB CXX_FILES *.cxx) file(GLOB CPP_FILES *.cpp) add_executable( MocTest.1.0 ${CXX_FILES} ${CPP_FILES} ) target_link_libraries( MocTest.1.0 Qt5::Widgets ${ITK_LIBRARIES} ${PARAVIEW_LIBRARIES} ) Additional Information: List of softwares, libraries: Microsoft Visual Studio Express 2013 for Windows Desktop (Solution generated with CMake is for MSVC 2012) Solution Platform: x64 ITK 4.5.1 ParaView 4.1.0 Qt 5.2.1 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-03-18 13:27 Yew Kurabayashi New Issue 2014-03-18 13:27 Yew Kurabayashi File Added: sampleProject.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