cmake: Do not install anything as DATA

Since the migration from SVN to Git, the data/ directory was put into a
separate repository, so that the engine repository should never install
anything there.
This commit is contained in:
Xavier Del Campo Romero 2024-12-30 08:43:11 +01:00
parent e93d3a9900
commit 6fb613cc89
Signed by: xavi
GPG key ID: 84FF3612A9BF43F2
4 changed files with 3 additions and 252 deletions

View file

@ -193,13 +193,6 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/config.h.in.cmake
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/cmake/doxygenconfig.in.cmake
${CMAKE_CURRENT_BINARY_DIR}/doxygen_config @ONLY)
# Fictive = no-output target, for having source files available in IDEs.
SET(_SOURCES CHANGES.txt COPYING.txt INSTALL.txt README.txt)
# Install top tree data files
SD_INSTALL_FILES(DATA "/" FILES ${_SOURCES})
# Setup empty GLOBAL lists for robots and modules
SET_PROPERTY(GLOBAL PROPERTY SD_MODULE_LIST "")
SET_PROPERTY(GLOBAL PROPERTY SD_CAR_LIST "")

View file

@ -35,10 +35,9 @@ MACRO(_GET_TARGET_REAL_PATHNAME TGT_NAME VAR_PATHNAME)
ENDMACRO(_GET_TARGET_REAL_PATHNAME TGT_NAME VAR_PATHNAME)
# Data/Lib/Bin/Include files installation (with user settings registration for data files)
# Lib/Bin/Include files installation
# Note: Missing files will be skipped if not there and OPTION_CHECK_CONTENTS is Off.
# Args:
# DATA : Data subdirectory where to install specified data files
# LIB : Lib subdirectory where to install specified files/targets
# BIN : If present, instructs to install specified files/targets in the bin dir
# INCLUDE : Include subdirectory where to install specified files
@ -47,11 +46,6 @@ ENDMACRO(_GET_TARGET_REAL_PATHNAME TGT_NAME VAR_PATHNAME)
# FILES : Files to install (see PREFIX)
# TARGETS : Targets to install
# Examples:
# SD_INSTALL_FILES(DATA drivers/bt FILES bt.xml logo.rgb)
# Installs bt.xml and logo.rgb in ${prefix}/${SD_DATADIR}/drivers/bt
# SD_INSTALL_FILES(DATA config/raceman USER config/raceman FILES quickrace.xml endrace.xml)
# Installs quickrace.xml and endrace.xml in ${prefix}/${SD_DATADIR}/drivers/bt
# and copies the file to the users settings folder ${SD_LOCALDIR}/config/raceman at startup.
# SD_INSTALL_FILES(LIB drivers/bt TARGETS bt.so)
# Installs bt.so in ${prefix}/${SD_LIBDIR}/drivers/bt
# SD_INSTALL_FILES(BIN TARGETS speed-dreams)
@ -60,7 +54,6 @@ ENDMACRO(_GET_TARGET_REAL_PATHNAME TGT_NAME VAR_PATHNAME)
# Installs ${SOURCE_DIR}/doc/man/sd2-menuview.6 in ${prefix}/${SD_MANDIR}/man6
MACRO(SD_INSTALL_FILES)
SET(SD_INSTALL_FILES_SYNTAX "DATA,1,1,IS_DATA,DATA_PATH")
SET(SD_INSTALL_FILES_SYNTAX ${SD_INSTALL_FILES_SYNTAX} "LIB,1,1,IS_LIB,LIB_PATH")
SET(SD_INSTALL_FILES_SYNTAX ${SD_INSTALL_FILES_SYNTAX} "BIN,0,0,IS_BIN,_")
SET(SD_INSTALL_FILES_SYNTAX ${SD_INSTALL_FILES_SYNTAX} "INCLUDE,0,1,IS_INCLUDE,INCLUDE_PATH")
@ -75,9 +68,6 @@ MACRO(SD_INSTALL_FILES)
#MESSAGE(STATUS " SD_INSTALL_FILES: LIB=${IS_LIB}:${LIB_PATH} BIN=${IS_BIN} INCLUDE=${IS_INCLUDE}:${INCLUDE_PATH} DATA=${IS_DATA}:${DATA_PATH} MAN=${IS_MAN}:${MAN_PATH} USER=${IS_USER}:${USER_PATH} TARGETS=${HAS_TARGETS}:${TARGETS} FILES=${HAS_FILES}:${FILES}")
# Fix/Check argument syntax / values
IF(NOT DATA_PATH)
SET(IS_DATA FALSE)
ENDIF()
IF(NOT USER_PATH)
SET(IS_USER FALSE)
ENDIF()
@ -97,29 +87,20 @@ MACRO(SD_INSTALL_FILES)
SET(HAS_TARGETS FALSE)
ENDIF()
IF(IS_DATA OR IS_LIB OR IS_BIN OR IS_INCLUDE OR IS_MAN)
IF(IS_LIB OR IS_BIN OR IS_INCLUDE OR IS_MAN)
IF(HAS_PREFIX)
IF(NOT HAS_FILES)
MESSAGE(FATAL_ERROR "SD_INSTALL_FILES: Expected FILES when PREFIX keyword is present")
ENDIF()
ENDIF()
ELSE()
MESSAGE(FATAL_ERROR "SD_INSTALL_FILES: Expected 1 and only 1 LIB, DATA, BIN, INCLUDE or MAN keyword")
ENDIF()
IF(IS_USER)
IF(NOT IS_DATA)
MESSAGE(FATAL_ERROR "SD_INSTALL_FILES: Expected DATA when USER keyword is present")
ENDIF()
MESSAGE(FATAL_ERROR "SD_INSTALL_FILES: Expected 1 and only 1 LIB, BIN, INCLUDE or MAN keyword")
ENDIF()
# Compute destination sub-dir
IF(IS_LIB)
SET(DEST1 ${SD_LIBDIR})
SET(DEST2 ${LIB_PATH})
ELSEIF(IS_DATA)
SET(DEST1 ${SD_DATADIR})
SET(DEST2 ${DATA_PATH})
ELSEIF(IS_BIN)
SET(DEST1 ${SD_BINDIR})
SET(DEST2 "")
@ -178,126 +159,4 @@ MACRO(SD_INSTALL_FILES)
INSTALL(TARGETS ${TARGETS} DESTINATION ${DEST_ALL})
ENDIF()
# Collect user settings files and target folder for later (see SD_XX_SETTINGS_VERSION above).
IF(IS_USER)
FOREACH(FILE ${FILES})
IF("${FILE}" MATCHES "\\.xml")
GET_FILENAME_COMPONENT(FILE_NAME ${FILE} NAME)
SET_PROPERTY(TARGET settings_versions APPEND PROPERTY XMLVERSION_ARGS
"${DATA_PATH}/${FILE_NAME};${USER_PATH}/${FILE_NAME}")
ENDIF()
ENDFOREACH()
# Debug traces.
#GET_PROPERTY(_XMLVER_ARGS TARGET settings_versions PROPERTY XMLVERSION_ARGS)
#MESSAGE(STATUS "SD_INSTALL_FILES(USER) : XMLVERSION_ARGS=${_XMLVER_ARGS}")
ENDIF(IS_USER)
ENDMACRO(SD_INSTALL_FILES)
# Directory installation with pattern matching on files and user settings registration
# Note: Missing dirs will be skipped if not there and OPTION_CHECK_CONTENTS is Off.
# Args:
# DATA : Data subdirectory where to install specified sub-dirs
# USER : User settings subdirectory where to install/update specified sub-dirs at run-time
# PREFIX : Prefix to use to get source path for dirs specified in DIRECTORIES
# DIRECTORIES : Sub-dirs to recursively install (see PREFIX)
# PATTERNS : Glob patterns to use for seelecting files to install (defaults to *.*)
# Example:
# SD_INSTALL_DIRECTORIES(DATA drivers/human USER drivers/human
# PREFIX pfx DIRECTORIES cars tracks PATTERNS *.xml)
# will recursively install any .xml file from drivers/human/pfx/cars and drivers/human/pfx/tracks
# into drivers/human/cars and drivers/human/pfx/tracks data dirs ;
# these files / sub-dirs will also be scheduled for run-time update/install in user settings dir.
MACRO(SD_INSTALL_DIRECTORIES)
SET(SDID_SYNTAX "DATA,1,1,IS_DATA,DATA_PATH")
SET(SDID_SYNTAX ${SDID_SYNTAX} "USER,1,1,IS_USER,USER_PATH")
SET(SDID_SYNTAX ${SDID_SYNTAX} "PREFIX,0,1,HAS_PREFIX,PREFIX")
SET(SDID_SYNTAX ${SDID_SYNTAX} "DIRECTORIES,0,-1,HAS_DIRECTORIES,DIRECTORIES")
SET(SDID_SYNTAX ${SDID_SYNTAX} "PATTERNS,0,-1,HAS_PATTERNS,PATTERNS")
SPLIT_ARGN(${SDID_SYNTAX} ARGUMENTS ${ARGN})
#MESSAGE(STATUS " SD_INSTALL_DIRECTORIES: DATA=${IS_DATA}:${DATA_PATH} USER=${IS_USER}:${USER_PATH} DIRS=${HAS_DIRECTORIES}:${DIRECTORIES} PATTERNS=${HAS_PATTERNS}:${PATTERNS}")
# Fix/Check argument syntax / values
IF(NOT DATA_PATH)
SET(IS_DATA FALSE)
ENDIF()
IF(NOT USER_PATH)
SET(IS_USER FALSE)
ENDIF()
IF(NOT PREFIX)
SET(HAS_PREFIX FALSE)
ENDIF()
IF(NOT DIRECTORIES)
SET(HAS_DIRECTORIES FALSE)
ENDIF()
IF(NOT PATTERNS)
SET(HAS_PATTERNS TRUE)
SET(PATTERNS "*.*")
ENDIF()
IF(IS_DATA AND HAS_DIRECTORIES)
IF(HAS_PREFIX)
SET(PREFIX "${PREFIX}/")
SET(POSTFIX "/${PREFIX}")
ELSE()
SET(PREFIX "")
SET(POSTFIX "")
ENDIF()
ELSE()
MESSAGE(ERROR ": SD_INSTALL_DIRECTORIES: Expected mandatory DATA and DIRECTORIES keywords")
ENDIF()
# Compute destination sub-dir
IF(DATA_PATH STREQUAL "/")
SET(DEST_ALL "${SD_DATADIR}")
ELSE()
SET(DEST_ALL "${SD_DATADIR}/${DATA_PATH}")
ENDIF()
# Check / filter contents if specified
SET(_DIRECTORIES)
FOREACH(DIRECTORY ${DIRECTORIES})
#MESSAGE(STATUS "SD_INSTALL_DIRS: ${DIRECTORY}")
IF(NOT IS_ABSOLUTE ${DIRECTORY})
SET(_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/${PREFIX}${DIRECTORY}")
ELSE()
SET(_DIRECTORY "${DIRECTORY}")
ENDIF()
IF(EXISTS ${_DIRECTORY} OR OPTION_CHECK_CONTENTS)
LIST(APPEND _DIRECTORIES ${DIRECTORY})
ELSE()
MESSAGE(STATUS "Note : Won't install missing dir. ${PREFIX}${DIRECTORY}")
ENDIF()
ENDFOREACH()
SET(DIRECTORIES ${_DIRECTORIES})
# Install selected files into the data dir.
# And collect user settings files (if any) and target folder for later
# (see SD_XX_SETTINGS_VERSION above).
FOREACH(DIRECTORY ${DIRECTORIES})
SET(FILES)
FOREACH(PATTERN ${PATTERNS})
FILE(GLOB_RECURSE _FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}${POSTFIX}" "${PREFIX}${DIRECTORY}/${PATTERN}")
LIST(APPEND FILES ${_FILES})
ENDFOREACH()
#MESSAGE(STATUS "SD_INSTALL_DIRS: FILES=${FILES}")
FOREACH(FILE ${FILES})
IF(NOT "${FILE}" MATCHES "\\.svn")
GET_FILENAME_COMPONENT(SUBDIR ${FILE} PATH)
INSTALL(FILES ${PREFIX}${FILE} DESTINATION ${DEST_ALL}/${SUBDIR})
IF(IS_USER AND "${FILE}" MATCHES "\\.xml")
SET_PROPERTY(TARGET settings_versions APPEND PROPERTY XMLVERSION_ARGS
"${DATA_PATH}/${FILE};${USER_PATH}/${FILE}")
ENDIF()
ENDIF()
ENDFOREACH()
ENDFOREACH()
ENDMACRO(SD_INSTALL_DIRECTORIES)

View file

@ -167,102 +167,3 @@ MACRO(ROBOT_MODULE)
# Install target robot module shared library
SD_INSTALL_FILES(LIB drivers/${RBM_NAME} TARGETS ${RBM_NAME})
ENDMACRO(ROBOT_MODULE)
# Robot data installation
# Args:
# NAME : Name of the robot (may be a clone)
# PREFIX : Prefix to use to get source path for files/subdirs specified in FILES/SUBDIRS
# FILES : Files to install in the robot's data dir (see PREFIX)
# SUBDIRS : Sub-dirs to recusively install in the robot's data dir (see PREFIX)
# PATTERNS : Files to install from SUBDIRS in the robot's data dir,
# as glob patterns (defaults to *.*)
# USER : If this keyword is present, also mark _any_ above specified XML file
# as a user settings file (installed at run-time is the user settings folders).
#
MACRO(ROBOT_DATA)
SET(RBD_SYNTAX "NAME,1,1,RBD_HAS_NAME,RBD_NAME")
SET(RBD_SYNTAX ${RBD_SYNTAX} "PREFIX,0,1,RBD_HAS_PREFIX,RBD_PREFIX")
SET(RBD_SYNTAX ${RBD_SYNTAX} "FILES,0,-1,RBD_HAS_FILES,RBD_FILES")
SET(RBD_SYNTAX ${RBD_SYNTAX} "SUBDIRS,0,-1,RBD_HAS_SUBDIRS,RBD_SUBDIRS")
SET(RBD_SYNTAX ${RBD_SYNTAX} "PATTERNS,0,-1,RBD_HAS_PATTERNS,RBD_PATTERNS")
SET(RBD_SYNTAX ${RBD_SYNTAX} "USER,0,0,RBD_IS_USER,_")
SPLIT_ARGN(${RBD_SYNTAX} ARGUMENTS ${ARGN})
#MESSAGE(STATUS "ROBOT_DATA(${RBD_NAME}): PREFIX=${RBD_PREFIX} FILES=${RBD_FILES} PATTERNS=${RBD_PATTERNS} SUBDIRS=${RBD_SUBDIRS} USER=${RBD_IS_USER}")
# Check arguments syntax / values
IF(NOT RBD_HAS_NAME OR NOT RBD_NAME)
MESSAGE(FATAL_ERROR "Cannot install data for a robot module with no specified name")
ENDIF()
# Install specified files.
IF(RBD_HAS_FILES AND RBD_FILES)
IF(RBD_IS_USER)
SD_INSTALL_FILES(DATA drivers/${RBD_NAME} USER drivers/${RBD_NAME}
PREFIX ${RBD_PREFIX} FILES ${RBD_FILES})
ELSE()
SD_INSTALL_FILES(DATA drivers/${RBD_NAME}
PREFIX ${RBD_PREFIX} FILES ${RBD_FILES})
ENDIF()
ENDIF()
# Install subdirs if specified.
IF(RBD_HAS_SUBDIRS AND RBD_SUBDIRS)
# Install specified files.
IF(RBD_IS_USER)
SD_INSTALL_DIRECTORIES(DATA drivers/${RBD_NAME} USER drivers/${RBD_NAME}
PREFIX ${RBD_PREFIX} DIRECTORIES ${RBD_SUBDIRS}
PATTERNS ${RBD_PATTERNS})
ELSE()
SD_INSTALL_DIRECTORIES(DATA drivers/${RBD_NAME}
PREFIX ${RBD_PREFIX} DIRECTORIES ${RBD_SUBDIRS}
PATTERNS ${RBD_PATTERNS})
ENDIF()
ENDIF(RBD_HAS_SUBDIRS AND RBD_SUBDIRS)
ENDMACRO(ROBOT_DATA)
# Robot project definition (module build and install, with associated data)
# Args:
# NAME : Name of the robot
# INTERFACE : Robot Windows DLL Interface description (tells about exported symbols)
# See GENERATE_ROBOT_DEF_FILE macro.
# If not specified, defaults to "LEGACY_MIN" ; not used if MODULE used
# SOURCES : List of files to use as build sources if any ; not needed if MODULE used
# PREFIX : Dir. prefix for source files/subdirs to install in the robot's data dir
# FILES : Extra (non default) files to install in the robot's data dir
# SUBDIRS : Data subdirectories to install in the robot's data dir
MACRO(ROBOT)
SET(RB_SYNTAX "NAME,1,1,RB_HAS_NAME,RB_NAME")
SET(RB_SYNTAX ${RB_SYNTAX} "INTERFACE,0,-1,RB_HAS_INTERFACE,RB_INTERFACE")
SET(RB_SYNTAX ${RB_SYNTAX} "SOURCES,0,-1,RB_HAS_SOURCES,RB_SOURCES")
SET(RB_SYNTAX ${RB_SYNTAX} "PREFIX,0,-1,RB_HAS_PREFIX,RB_PREFIX")
SET(RB_SYNTAX ${RB_SYNTAX} "FILES,0,-1,RB_HAS_FILES,RB_FILES")
SET(RB_SYNTAX ${RB_SYNTAX} "SUBDIRS,0,-1,RB_HAS_SUBDIRS,RB_SUBDIRS")
#SET(__DEBUG__ TRUE)
SPLIT_ARGN(${RB_SYNTAX} ARGUMENTS ${ARGN})
#SET(__DEBUG__ FALSE)
#MESSAGE(STATUS "ROBOT(${RB_NAME}): INTERFACE=${RB_INTERFACE} (${RB_HAS_INTERFACE}) SOURCES=${RB_SOURCES} (${RB_HAS_SOURCES}) PREFIX=${RB_PREFIX} (${RB_HAS_PREFIX}) FILES=${RB_FILES} (${RB_HAS_FILES}) SUBDIRS=${RB_SUBDIRS} (${RB_HAS_SUBDIRS})")
IF(NOT RB_HAS_NAME OR NOT RB_NAME)
MESSAGE(FATAL_ERROR "Cannot build a robot with no specified name")
ENDIF()
IF(NOT RB_HAS_SOURCES OR NOT RB_SOURCES)
MESSAGE(FATAL_ERROR "Cannot build a robot without sources")
ENDIF()
ROBOT_MODULE(NAME ${RB_NAME} INTERFACE ${RB_INTERFACE} SOURCES ${RB_SOURCES})
ROBOT_DATA(NAME ${RB_NAME} PREFIX ${RB_PREFIX} FILES ${RB_FILES} SUBDIRS ${RB_SUBDIRS})
ENDMACRO(ROBOT)

View file

@ -59,5 +59,3 @@ ELSE(WIN32)
ENDIF(WIN32)
SD_INSTALL_FILES(INCLUDE FILES ${TGF_HEADERS})
SD_INSTALL_FILES(DATA config FILES params.dtd)