[CMake] CMake 2.8.2 going crazy on my 'Superbuild Project'

kent williams nkwmailinglists at gmail.com
Tue Aug 24 15:57:07 EDT 2010


I have a CMakeLists.txt file that builds a bunch of prerequisite
library, and then my application I'm working on.

This is done all with External_Project macros.  Once everything I need
is built, I build my code as an external project:

set(proj BRAINSTracerQT)
ExternalProject_Add(${proj}
  URL file://${CMAKE_CURRENT_SOURCE_DIR}/${proj}
  SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${proj}
  DOWNLOAD_COMMAND ""
  DEPENDS  ${VTK_DEPEND} ${SEM_DEPEND}
  CMAKE_GENERATOR ${gen}
  CMAKE_ARGS
    ${LOCAL_CMAKE_BUILD_OPTIONS}
    -DModuleDescriptionParser_DIR:PATH=${MDP_DIR}
    -DITK_DIR:PATH=${ITK_DIR}
    -DVTK_DIR:PATH=${VTK_DIR}
    -DQT_QMAKE_EXECUTABLE:FILEPATH=${QT_QMAKE_EXECUTABLE}
 INSTALL_DIR ${BRAINSTracer_BINARY_DIR}
 UPDATE_COMMAND ""
)

Everything worked in CMake 2.8.1, now I get the errors below.  Very weird.


CMake Error at CMakeLists.txt:139 (add_subdirectory):
  The binary directory

    /scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/vtkRenderingAddOn

  is already used to build a source directory.  It cannot be used to build
  source directory

    /scratch/kent/newbuild/BRAINSTracerQT/BRAINSTracerQT/vtkRenderingAddOn

  Specify a unique binary directory name.


CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_BTMainWindow.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QVtkImageViewer.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_qtcolorpicker.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QVtkPropertyDialog.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QModuleParameterWidget.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QImageParameterWidget.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QFileBrowserParameterWidget.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QImageTransformDialog.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_MyQTreeWidget.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QImageSaveFileDialog.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QRunProgramDialog.cxx.rule"
which already has a custom rule.
CMake Error: Attempt to add a custom rule to output
"/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/moc_QEnumSpinBox.cxx.rule"
which already has a custom rule.
-- ITK LIBRARIES
ITKAlgorithms;ITKStatistics;ITKFEM;itkNetlibSlatec;itkv3p_lsqr;ITKEXPAT;itksys
-- FIXUP_BUNDLE_DIRS =
/opt/Qt4.6.3/lib;/scratch/kent/newbuild/BT-build/lib/InsightToolkit;/scratch/kent/newbuild/BT-build/lib/vtk-5.6;/scratch/kent/newbuild/BT-build/lib;/scratch/kent/newbuild/BT-build/lib/ModuleDescriptionParser;/lib;/scratch/kent/newbuild/BT-build/BRAINSTracerQT-prefix/src/BRAINSTracerQT-build/vtkRenderingAddOn;/opt/Qt4.6.3/plugins/imageformats
-- ITK LIBRARIES
ITKAlgorithms;ITKStatistics;ITKFEM;itkNetlibSlatec;itkv3p_lsqr;ITKEXPAT;itksys;itkNetlibSlatec;itkv3p_lsqr;ITKEXPAT;itksys
CMake Error at CMakeLists.txt:328 (add_executable):
  add_executable cannot create target "BRAINSTracerQT" because another target
  with the same name already exists.  The existing target is an executable
  created in source directory
  "/scratch/kent/newbuild/BRAINSTracerQT/BRAINSTracerQT".  See documentation
  for policy CMP0002 for more details.


More information about the CMake mailing list