From 1fdc37b7ad51571d2a1d8b349b9a9033b2489e96 Mon Sep 17 00:00:00 2001 From: LAGNEAU Romain Date: Thu, 19 Dec 2024 11:08:17 +0100 Subject: [PATCH] [CLEAN] Removed commented CMake lines --- cmake/OgreTools.cmake | 150 +++++++++++++++++++----------------------- 1 file changed, 69 insertions(+), 81 deletions(-) diff --git a/cmake/OgreTools.cmake b/cmake/OgreTools.cmake index fefc0374c8..9a240e9d9d 100644 --- a/cmake/OgreTools.cmake +++ b/cmake/OgreTools.cmake @@ -275,105 +275,93 @@ function(vp_set_ogre_media) # Here we copy all the minimal media files # - media/materials/... # - media/models/... - # if(OGRE_MEDIA_NOT_AVAILABLE) - file(COPY modules/ar/data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator) - # endif() + file(COPY modules/ar/data/ogre-simulator/media DESTINATION ${VISP_BINARY_DIR}/data/ogre-simulator) # Initialize the variable set(VISP_HAVE_OGRE_RESOURCES_PATH "" CACHE INTERNAL "Ogre resources location") if(ogre_resources_cfg_exists) set(VISP_HAVE_OGRE_RESOURCES_PATH "${ogre_resources_cfg_exists};" CACHE INTERNAL "Ogre resources location") endif() - # else() - # Here we create a resources.cfg if it was not found - - # we create a resources.cfg file for vpAROgre.cpp - # case 1: normal case - # If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use - # the minimal requested media to run the examples - #-------------- - set(OGRE_DATA_ROOT_DIR "${VISP_BINARY_DIR}/data/ogre-simulator") - set(VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}${OGRE_DATA_ROOT_DIR}" CACHE INTERNAL "Ogre resources location") - - # if(OGRE_MEDIA_NOT_AVAILABLE) - set(OGRE_VISP_MEDIA_DIR "${VISP_BINARY_DIR}/data/ogre-simulator/media") - # endif() - - # Here we add all the subdirs in @OGRE_VISP_MEDIA_DIR@/* as resource location. - vp_get_relative_subdirs(media_subdirs ${OGRE_VISP_MEDIA_DIR}) - set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_VISP_MEDIA_DIR}\n") - foreach(m ${media_subdirs}) - set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_VISP_MEDIA_DIR}/${m}\n") - endforeach() + # Here we create a resources.cfg if it was not found + + # we create a resources.cfg file for vpAROgre.cpp + # case 1: normal case + # If OGRE_MEDIA_DIR is not found, we set it to VISP_HAVE_OGRE_RESOURCES_PATH in order to use + # the minimal requested media to run the examples + #-------------- + set(OGRE_DATA_ROOT_DIR "${VISP_BINARY_DIR}/data/ogre-simulator") + set(VISP_HAVE_OGRE_RESOURCES_PATH "${VISP_HAVE_OGRE_RESOURCES_PATH}${OGRE_DATA_ROOT_DIR}" CACHE INTERNAL "Ogre resources location") + + set(OGRE_VISP_MEDIA_DIR "${VISP_BINARY_DIR}/data/ogre-simulator/media") + + # Here we add all the subdirs in @OGRE_VISP_MEDIA_DIR@/* as resource location. + vp_get_relative_subdirs(media_subdirs ${OGRE_VISP_MEDIA_DIR}) + set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_VISP_MEDIA_DIR}\n") + foreach(m ${media_subdirs}) + set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_VISP_MEDIA_DIR}/${m}\n") + endforeach() - configure_file( - ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in - ${OGRE_DATA_ROOT_DIR}/resources.cfg - IMMEDIATE @ONLY - ) + configure_file( + ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in + ${OGRE_DATA_ROOT_DIR}/resources.cfg + IMMEDIATE @ONLY + ) - # case 2: install or packaging case - # If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use - # the minimal requested media to run the examples - #-------------- - set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator") + # case 2: install or packaging case + # If OGRE_MEDIA_DIR is not found, we set it to VISP_INSTALL_DIR_OGRE_RESOURCES in order to use + # the minimal requested media to run the examples + #-------------- + set(VISP_INSTALL_DIR_OGRE_RESOURCES "${CMAKE_INSTALL_PREFIX}/${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator") - # make the var global - set(VISP_INSTALL_DIR_OGRE_RESOURCES ${VISP_INSTALL_DIR_OGRE_RESOURCES} CACHE INTERNAL "Ogre media install dir") + # make the var global + set(VISP_INSTALL_DIR_OGRE_RESOURCES ${VISP_INSTALL_DIR_OGRE_RESOURCES} CACHE INTERNAL "Ogre media install dir") - # if(OGRE_MEDIA_NOT_AVAILABLE) - set(OGRE_VISP_INSTALL_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media) - # endif() + set(OGRE_VISP_INSTALL_MEDIA_DIR ${VISP_INSTALL_DIR_OGRE_RESOURCES}/media) - # Here we add all the subdirs in @OGRE_VISP_INSTALL_MEDIA_DIR@/* as resource location. - set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_VISP_INSTALL_MEDIA_DIR}\n") - foreach(m ${media_subdirs}) - set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_VISP_INSTALL_MEDIA_DIR}/${m}\n") - endforeach() + # Here we add all the subdirs in @OGRE_VISP_INSTALL_MEDIA_DIR@/* as resource location. + set(OGRE_RESOURCES_FileSystem "FileSystem=${OGRE_VISP_INSTALL_MEDIA_DIR}\n") + foreach(m ${media_subdirs}) + set(OGRE_RESOURCES_FileSystem "${OGRE_RESOURCES_FileSystem}FileSystem=${OGRE_VISP_INSTALL_MEDIA_DIR}/${m}\n") + endforeach() - # install rule for resources.cfg and Ogre media if they are not available: - if(UNIX) - configure_file( - ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in - ${VISP_BINARY_DIR}/unix-install/resources.cfg - IMMEDIATE @ONLY - ) - install(FILES - ${VISP_BINARY_DIR}/unix-install/resources.cfg + # install rule for resources.cfg and Ogre media if they are not available: + if(UNIX) + configure_file( + ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in + ${VISP_BINARY_DIR}/unix-install/resources.cfg + IMMEDIATE @ONLY + ) + install(FILES + ${VISP_BINARY_DIR}/unix-install/resources.cfg + DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + install(DIRECTORY + ${VISP_BINARY_DIR}/data/ogre-simulator/media DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) - # if(OGRE_MEDIA_NOT_AVAILABLE) - install(DIRECTORY - ${VISP_BINARY_DIR}/data/ogre-simulator/media - DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT dev - ) - # endif() - else() - configure_file( - ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in - ${VISP_BINARY_DIR}/win-install/resources.cfg - IMMEDIATE @ONLY - ) - install(FILES - ${VISP_BINARY_DIR}/win-install/resources.cfg + else() + configure_file( + ${VISP_SOURCE_DIR}/cmake/templates/resources.cfg.in + ${VISP_BINARY_DIR}/win-install/resources.cfg + IMMEDIATE @ONLY + ) + install(FILES + ${VISP_BINARY_DIR}/win-install/resources.cfg + DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator + PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + COMPONENT dev + ) + install(DIRECTORY + ${VISP_BINARY_DIR}/data/ogre-simulator/media DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator - PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE + FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE COMPONENT dev ) - # if(OGRE_MEDIA_NOT_AVAILABLE) - install(DIRECTORY - ${VISP_BINARY_DIR}/data/ogre-simulator/media - DESTINATION ${VISP_INSTALL_DATAROOTDIR}/data/ogre-simulator - FILE_PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE - COMPONENT dev - ) - # endif() - endif() - # endif() + endif() endfunction() macro(vp_set_ogre_advanced_var)