#-----------------------------------------------------------------------------
set(MODULE_NAME RigidAlignmentModule)

#-----------------------------------------------------------------------------
set(${MODULE_NAME}_TITLE "Rigid Alignment Module" CACHE STRING "Module title")
set(${MODULE_NAME}_CATEGORY "Groups" CACHE STRING "Module category")

set(MODULE_METADATA_SCRIPT
  ${CMAKE_CURRENT_BINARY_DIR}/../${MODULE_NAME}Metadata/__init__.py
  )

set(TITLE_CONFIG ${${MODULE_NAME}_TITLE})
set(CATEGORY_CONFIG ${${MODULE_NAME}_CATEGORY})
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/../${MODULE_NAME}Metadata/__init__.py.in
  ${MODULE_METADATA_SCRIPT}
  @ONLY
  )

slicerMacroBuildScriptedModule(
  NAME ${MODULE_NAME}Metadata
  SCRIPTS ${MODULE_METADATA_SCRIPT}
  WITH_SUBDIR
  )

#-----------------------------------------------------------------------------
set(MODULE_PYTHON_SCRIPTS
  ${MODULE_NAME}.py
  )

set(MODULE_PYTHON_RESOURCES
  Resources/Icons/${MODULE_NAME}.png
  Resources/UI/${MODULE_NAME}.ui
  )

#-----------------------------------------------------------------------------
slicerMacroBuildScriptedModule(
  NAME ${MODULE_NAME}
  SCRIPTS ${MODULE_PYTHON_SCRIPTS}
  RESOURCES ${MODULE_PYTHON_RESOURCES}
  WITH_GENERIC_TESTS
  )

#-----------------------------------------------------------------------------
if(BUILD_TESTING)

  # Register the unittest subclass in the main script as a ctest.
  # Note that the test will also be available at runtime.
  slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py)

  # Additional build-time testing
  add_subdirectory(Testing)
endif()

#-----------------------------------------------------------------------------
set(MODULE_NAME RigidAlignmentModule)

#-----------------------------------------------------------------------------
set(${MODULE_NAME}_TITLE "Rigid Alignment Module" CACHE STRING "Module title")
set(${MODULE_NAME}_CATEGORY "Groups" CACHE STRING "Module category")

set(MODULE_METADATA_SCRIPT
  ${CMAKE_CURRENT_BINARY_DIR}/../${MODULE_NAME}Metadata/__init__.py
  )

set(TITLE_CONFIG ${${MODULE_NAME}_TITLE})
set(CATEGORY_CONFIG ${${MODULE_NAME}_CATEGORY})
configure_file(
  ${CMAKE_CURRENT_SOURCE_DIR}/../${MODULE_NAME}Metadata/__init__.py.in
  ${MODULE_METADATA_SCRIPT}
  @ONLY
  )

slicerMacroBuildScriptedModule(
  NAME ${MODULE_NAME}Metadata
  SCRIPTS ${MODULE_METADATA_SCRIPT}
  )

#-----------------------------------------------------------------------------
set(MODULE_PYTHON_SCRIPTS
  ${MODULE_NAME}.py
  )

set(MODULE_PYTHON_RESOURCES
  Resources/Icons/${MODULE_NAME}.png
  Resources/UI/${MODULE_NAME}.ui
  )

#-----------------------------------------------------------------------------
slicerMacroBuildScriptedModule(
  NAME ${MODULE_NAME}
  SCRIPTS ${MODULE_PYTHON_SCRIPTS}
  RESOURCES ${MODULE_PYTHON_RESOURCES}
  WITH_GENERIC_TESTS
  )

#-----------------------------------------------------------------------------
if(BUILD_TESTING)

  # Register the unittest subclass in the main script as a ctest.
  # Note that the test will also be available at runtime.
  slicer_add_python_unittest(SCRIPT ${MODULE_NAME}.py)

  # Additional build-time testing
  add_subdirectory(Testing)
endif()

Fix packaging of RigidAlignmentModuleMetadata on windows
COMP: Fix packaging of RigidAlignmentModuleMetadata on windows

This commit fixes a regression introduced in 37c1a3003 (COMP: Support
customization of RigidAlignmentModule title and category).

It removes the use of WITH_SUBDIR which generated an incorrect install
rules attempting to install the non-existent directory
"/path/to/lib/Slicer-4.13/qt-scripted-modules/RigidAlignmentModule".

It turns out only the windows packaging was failing because it seems
to be the only platform where attempting to use the following install
command specifying a nonexistent directory is failing:

  file(
    INSTALL DESTINATION "/path/to/install/lib/Slicer-4.13/qt-scripted-modules"
    TYPE DIRECTORY FILES
      "/path/to/build/SPHARM-PDM-build/lib/Slicer-4.13/qt-scripted-modules/RigidAlignmentModule" USE_SOURCE_PERMISSIONS)
