Skip to content

Commit

Permalink
[CLEAN] Removed commented CMake lines
Browse files Browse the repository at this point in the history
  • Loading branch information
LAGNEAU Romain committed Dec 19, 2024
1 parent 213589e commit 1fdc37b
Showing 1 changed file with 69 additions and 81 deletions.
150 changes: 69 additions & 81 deletions cmake/OgreTools.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1fdc37b

Please sign in to comment.