<commit_before>#add_subdirectory(src)
#add_subdirectory(gui)

include_directories(${CMAKE_BINARY_DIR}/src)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

set( DTIPrep_SRCS
  main.cxx
  GMainWindow.cxx
  Dicom2NrrdPanel.cxx
  IntensityMotionCheckPanel.cxx
  ImageView2DPanelWithControls.cxx
  IntensityMotionCheck.cxx
  IntraGradientRigidRegistration.cxx
  InterGradientRigidRegistration.cxx
  RigidRegistration.cxx
  ThreadIntensityMotionCheck.cxx
  ThreadEddyMotionCorrect.cxx
  ThreadDicomToNrrd.cxx
  ThreadDicomSeriesRead.cxx
  FurtherQCThread.cxx
  XmlStreamReader.cxx
  XmlStreamWriter.cxx
  Protocol.cxx
  QCResult.cxx
  UtilBaselineOptimizedAverage.h
  itkDWIBaselineAverager.h
  itkDWIBaselineAverager.hxx
# Utah
  itkDWIHeadMotionEddyCurrentCorrection.cxx
  itkGradientSteepestDescentBaseOptimizer.cxx
  itkGradientSteepestDescentOptimizer.cxx
# Iowa
  itkVectorImageRegisterAffineFilter.h
# MIT
 itkMultiImageRegistrationFilter.cxx
 GradientDescentLineSearchOptimizer.cxx
 DominantDirectional/DominantDirectional_Detector.cxx
 DominantDirectional/Counter.cxx
 DominantDirectional/Point.cxx
 DominantDirectional/Sphere.cxx
 DominantDirectional/SphereIkosahedron.cxx
 DominantDirectional/Triangle.cxx
 DominantDirectional/Vector.cxx
 DominantDirectional/Geometry_Common.cxx
 #
 UtilRegister.cxx
)

file(READ DTIPrep.xml var)

string(REGEX MATCH "<version>.*</version>" ext "${var}")
string(REPLACE "<version>" "" version_number ${ext} )
string(REPLACE "</version>" "" version_number ${version_number})

ADD_DEFINITIONS(-DDTIPREP_VERSION="${version_number}")

generateclp(DTIPrep_SRCS_CLP DTIPrep.xml )
set( DTIPrep_SRCS ${DTIPrep_SRCS} ${DTIPrep_SRCS_CLP} )

set( DTIPrep_MOC_HDRS
  GMainWindow.h
  Dicom2NrrdPanel.h
  IntensityMotionCheckPanel.h
  ImageView2DPanelWithControls.h
  ThreadIntensityMotionCheck.h
  ThreadEddyMotionCorrect.h
  ThreadDicomToNrrd.h
  ThreadDicomSeriesRead.h
  FurtherQCThread.h
  #Combo_Box.h
)

set( DTIPrep_HDRS
  DominantDirectional/DominantDirectional_Detector.h
  DominantDirectional/Counter.h
  DominantDirectional/SphereIkosahedron.h
  DominantDirectional/Point.h
  DominantDirectional/Sphere.h
  DominantDirectional/Triangle.h
  DominantDirectional/Vector.h
  DominantDirectional/Geometry_Common.h
  )


set( DTIPrep_UIS
  gui/MainWindow.ui
  gui/Dicom2NrrdPanel.ui
  gui/IntensityMotionCheckPanel.ui
  gui/ImageView2DPanelWithControls.ui
)

set(DTIPrep_RCCS gui/DTIPrep.qrc)

# generate rules for building source files from the resources
QT4_ADD_RESOURCES(RCC_SRCS ${DTIPrep_RCCS})

QT4_WRAP_UI( UIHeaders ${DTIPrep_UIS} )
QT4_WRAP_CPP( MOCSrcs ${DTIPrep_MOC_HDRS} )

#add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)

set_source_files_properties(${DTIPrep_SRCS} PROPERTIES
  OBJECT_DEPENDS "${UIHeaders}")


set( DTIPrep_Libs
  ModuleDescriptionParser
  ${QT_LIBRARIES}
  ${QT_QTDBUS_LIBRARY}
  ${ITK_LIBRARIES}
  ${VTK_LIBRARIES}
  BRAINSCommonLib
  ${ANTs_LIBS}
  ITKOptimizersv4
)

if( VTK_MAJOR_VERSION VERSION_LESS 6 )
  list(APPEND DTIPrep_Libs
       QVTK
      )
endif()

#message(STATUS "XXXXXXX ${DTIPrep_Libs}")

if( DTIPrep_BUILD_SLICER_EXTENSION )
  add_executable( DTIPrep
    ${DTIPrep_SRCS}
    ${UISrcs}
    ${MOCSrcs}
    ${RCC_SRCS}
  )
  target_link_libraries( DTIPrep ${DTIPrep_Libs} )
  add_executable( DTIPrepLauncher Launcher.cxx ${DTIPrep_SRCS_CLP} )
  
  set(HIDDEN_CLI_INSTALL_DIR ${Slicer_INSTALL_CLIMODULES_BIN_DIR}/../hidden-cli-modules )
  install(TARGETS DTIPrep DESTINATION ${HIDDEN_CLI_INSTALL_DIR} )
  install(TARGETS DTIPrepLauncher DESTINATION ${Slicer_INSTALL_CLIMODULES_BIN_DIR} )<commit_msg>COMP: Fix link error associated with DTIPrepLauncher<commit_after>#add_subdirectory(src)
#add_subdirectory(gui)

include_directories(${CMAKE_BINARY_DIR}/src)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

set( DTIPrep_SRCS
  main.cxx
  GMainWindow.cxx
  Dicom2NrrdPanel.cxx
  IntensityMotionCheckPanel.cxx
  ImageView2DPanelWithControls.cxx
  IntensityMotionCheck.cxx
  IntraGradientRigidRegistration.cxx
  InterGradientRigidRegistration.cxx
  RigidRegistration.cxx
  ThreadIntensityMotionCheck.cxx
  ThreadEddyMotionCorrect.cxx
  ThreadDicomToNrrd.cxx
  ThreadDicomSeriesRead.cxx
  FurtherQCThread.cxx
  XmlStreamReader.cxx
  XmlStreamWriter.cxx
  Protocol.cxx
  QCResult.cxx
  UtilBaselineOptimizedAverage.h
  itkDWIBaselineAverager.h
  itkDWIBaselineAverager.hxx
# Utah
  itkDWIHeadMotionEddyCurrentCorrection.cxx
  itkGradientSteepestDescentBaseOptimizer.cxx
  itkGradientSteepestDescentOptimizer.cxx
# Iowa
  itkVectorImageRegisterAffineFilter.h
# MIT
 itkMultiImageRegistrationFilter.cxx
 GradientDescentLineSearchOptimizer.cxx
 DominantDirectional/DominantDirectional_Detector.cxx
 DominantDirectional/Counter.cxx
 DominantDirectional/Point.cxx
 DominantDirectional/Sphere.cxx
 DominantDirectional/SphereIkosahedron.cxx
 DominantDirectional/Triangle.cxx
 DominantDirectional/Vector.cxx
 DominantDirectional/Geometry_Common.cxx
 #
 UtilRegister.cxx
)

file(READ DTIPrep.xml var)

string(REGEX MATCH "<version>.*</version>" ext "${var}")
string(REPLACE "<version>" "" version_number ${ext} )
string(REPLACE "</version>" "" version_number ${version_number})

ADD_DEFINITIONS(-DDTIPREP_VERSION="${version_number}")

generateclp(DTIPrep_SRCS_CLP DTIPrep.xml )
set( DTIPrep_SRCS ${DTIPrep_SRCS} ${DTIPrep_SRCS_CLP} )

set( DTIPrep_MOC_HDRS
  GMainWindow.h
  Dicom2NrrdPanel.h
  IntensityMotionCheckPanel.h
  ImageView2DPanelWithControls.h
  ThreadIntensityMotionCheck.h
  ThreadEddyMotionCorrect.h
  ThreadDicomToNrrd.h
  ThreadDicomSeriesRead.h
  FurtherQCThread.h
  #Combo_Box.h
)

set( DTIPrep_HDRS
  DominantDirectional/DominantDirectional_Detector.h
  DominantDirectional/Counter.h
  DominantDirectional/SphereIkosahedron.h
  DominantDirectional/Point.h
  DominantDirectional/Sphere.h
  DominantDirectional/Triangle.h
  DominantDirectional/Vector.h
  DominantDirectional/Geometry_Common.h
  )


set( DTIPrep_UIS
  gui/MainWindow.ui
  gui/Dicom2NrrdPanel.ui
  gui/IntensityMotionCheckPanel.ui
  gui/ImageView2DPanelWithControls.ui
)

set(DTIPrep_RCCS gui/DTIPrep.qrc)

# generate rules for building source files from the resources
QT4_ADD_RESOURCES(RCC_SRCS ${DTIPrep_RCCS})

QT4_WRAP_UI( UIHeaders ${DTIPrep_UIS} )
QT4_WRAP_CPP( MOCSrcs ${DTIPrep_MOC_HDRS} )

#add_definitions(-DQT_GUI_LIBS -DQT_CORE_LIB -DQT3_SUPPORT)

set_source_files_properties(${DTIPrep_SRCS} PROPERTIES
  OBJECT_DEPENDS "${UIHeaders}")


set( DTIPrep_Libs
  ModuleDescriptionParser
  ${QT_LIBRARIES}
  ${QT_QTDBUS_LIBRARY}
  ${ITK_LIBRARIES}
  ${VTK_LIBRARIES}
  BRAINSCommonLib
  ${ANTs_LIBS}
  ITKOptimizersv4
)

if( VTK_MAJOR_VERSION VERSION_LESS 6 )
  list(APPEND DTIPrep_Libs
       QVTK
      )
endif()

#message(STATUS "XXXXXXX ${DTIPrep_Libs}")

if( DTIPrep_BUILD_SLICER_EXTENSION )
  add_executable( DTIPrep
    ${DTIPrep_SRCS}
    ${UISrcs}
    ${MOCSrcs}
    ${RCC_SRCS}
  )
  target_link_libraries( DTIPrep ${DTIPrep_Libs} )
  add_executable( DTIPrepLauncher Launcher.cxx ${DTIPrep_SRCS_CLP} )

  set(launcher_libraries )
  if(DEFINED SlicerExecutionModel_EXTRA_EXECUTABLE_TARGET_LIBRARIES)
    list(APPEND launcher_libraries ${SlicerExecutionModel_EXTRA_EXECUTABLE_TARGET_LIBRARIES})
  endif()
  if(NOT "${DEFAULT_SEM_TARGET_LIBRARIES}" STREQUAL "")
    list(APPEND launcher_libraries ${DEFAULT_SEM_TARGET_LIBRARIES})
  endif()
  if(launcher_libraries)
    target_link_libraries(DTIPrepLauncher ${launcher_libraries})
  endif()
  
  set(HIDDEN_CLI_INSTALL_DIR ${Slicer_INSTALL_CLIMODULES_BIN_DIR}/../hidden-cli-modules )
  install(TARGETS DTIPrep DESTINATION ${HIDDEN_CLI_INSTALL_DIR} )
  install(TARGETS DTIPrepLauncher DESTINATION ${Slicer_INSTALL_CLIMODULES_BIN_DIR} )
{'fraction_non_alphanumeric': 0.07998434237995825, 'fraction_numerical': 0.003131524008350731, 'mean_word_length': 6.5, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3992929', 'n_tokens_mistral': 3134, 'n_tokens_neox': 3014, 'n_words': 360}