cmake: Add DATA_EXCLUDE_REGEX variable to configure exclusions in data dir installation

This commit is contained in:
Sebastian Krzyszkowiak 2020-03-22 07:49:54 +01:00
parent 6d6112e12e
commit e0192420f6
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF

View file

@ -20,12 +20,17 @@ if(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID)
endif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${LIBSUPERDERPY_GAMENAME}.6)
endif(UNIX AND NOT APPLE AND NOT EMSCRIPTEN AND NOT ANDROID)
if (NOT DATA_EXCLUDE_REGEX)
set(DATA_EXCLUDE_REGEX "^$")
endif()
install(DIRECTORY . DESTINATION ${DATADIR}
PATTERN "stuff" EXCLUDE
PATTERN ".git" EXCLUDE
PATTERN ".gitignore" EXCLUDE
PATTERN ".directory" EXCLUDE
PATTERN "CMakeLists.txt" EXCLUDE)
PATTERN "CMakeLists.txt" EXCLUDE
REGEX "${DATA_EXCLUDE_REGEX}" EXCLUDE)
file(GLOB_RECURSE RES_FILES CONFIGURE_DEPENDS *)
add_custom_target(data SOURCES ${RES_FILES})