提交 dc3839ab 编写于 作者: J jp9000

cmake: Add function for installing data from abs path

Allows the ability to install extra data from a specific absolute path
rather than a path relative to the cmake current source dir.  Useful if
say I want to generate data files in to the cmake binary folder rather
than put them in the data folder of the cmake source dir.
上级 da819254
...@@ -504,6 +504,23 @@ function(install_obs_data target datadir datadest) ...@@ -504,6 +504,23 @@ function(install_obs_data target datadir datadest)
endif() endif()
endfunction() endfunction()
function(install_obs_data_from_abs_path target datadir datadest)
install(DIRECTORY ${datadir}/
DESTINATION "${OBS_DATA_DESTINATION}/${datadest}"
USE_SOURCE_PERMISSIONS)
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${datadir}" "${OBS_OUTPUT_DIR}/$<CONFIGURATION>/data/${datadest}"
VERBATIM)
if(CMAKE_SIZEOF_VOID_P EQUAL 8 AND DEFINED ENV{obsInstallerTempDir})
add_custom_command(TARGET ${target} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${datadir}" "$ENV{obsInstallerTempDir}/${OBS_DATA_DESTINATION}/${datadest}"
VERBATIM)
endif()
endfunction()
function(install_obs_data_file target datafile datadest) function(install_obs_data_file target datafile datadest)
install(FILES ${datafile} install(FILES ${datafile}
DESTINATION "${OBS_DATA_DESTINATION}/${datadest}") DESTINATION "${OBS_DATA_DESTINATION}/${datadest}")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册