Install files form extras-standard subdirs

pull/3/head
Hleb Valoshka 2019-02-07 17:31:52 +03:00
parent aea55f500c
commit 58d8742156
7 changed files with 21 additions and 5 deletions

View File

@ -65,6 +65,7 @@ list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(GNUInstallDirs)
include(CheckIncludeFiles)
include(rpath)
include(install_to_extras_subdir)
if (NOT MSVC)
include(cotire)
else()

View File

@ -0,0 +1,15 @@
macro(install_to_extras_subdir)
if(${ARGC} LESS 3)
message(FATAL_ERROR "install_to_extras_subdir requires at least 3 arguments")
endif()
set(__datadir ${ARGV0})
set(__subsubdir ${ARGV1})
set(__sources ${ARGV})
list(REMOVE_AT __sources 0 1)
foreach(file ${__sources})
get_filename_component(dir ${file} DIRECTORY)
install(FILES ${file} DESTINATION "${__datadir}/extras-standard/${__subsubdir}/${dir}" )
endforeach()
endmacro()

View File

@ -8,4 +8,4 @@ set(CASSINI_SOURCES
models/huygens.3ds
)
install(FILES ${CASSINI_SOURCES} DESTINATION "${DATADIR}/extras-standard/cassini")
install_to_extras_subdir("${DATADIR}" cassini ${CASSINI_SOURCES})

View File

@ -5,4 +5,4 @@ set(GALILEO_SOURCES
models/galileo.3ds
)
install(FILES ${GALILEO_SOURCES} DESTINATION "${DATADIR}/extras-standard/galileo")
install_to_extras_subdir("${DATADIR}" galileo ${GALILEO_SOURCES})

View File

@ -3,4 +3,4 @@ set(HUBBLE_SOURCES
models/hubble.cmod
)
install(FILES ${HUBBLE_SOURCES} DESTINATION "${DATADIR}/extras-standard/hubble")
install_to_extras_subdir("${DATADIR}" hubble ${HUBBLE_SOURCES})

View File

@ -39,4 +39,4 @@ set(ISS_SOURCES
models/iss.cmod
)
install(FILES ${ISS_SOURCES} DESTINATION "${DATADIR}/extras-standard/iss")
install_to_extras_subdir("${DATADIR}" iss ${ISS_SOURCES})

View File

@ -3,4 +3,4 @@ set(MIR_SOURCES
mir.ssc
)
install(FILES ${EXTRA_MIR_SOURCES} DESTINATION "${DATADIR}/extras-standard/mir")
install_to_extras_subdir("${DATADIR}" mir ${MIR_SOURCES})