Commit 754fdc45 authored by Hans-Christian Ebke's avatar Hans-Christian Ebke

Attempt at reducing the path length of INSTALLDATA targets.


git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@19378 383ad7c9-94d9-4d36-a494-682f7c89f535
parent db2288a0
......@@ -44,9 +44,55 @@ function (of_add_plugins)
foreach (_plugin ${_plugins_in})
get_filename_component (_plugin_dir ${_plugin} PATH)
# In INSTALLDATA_DIRS the resource directories will be handed down.
set(INSTALLDATA_DIRS)
add_subdirectory (${CMAKE_SOURCE_DIR}/${_plugin_dir})
# Add targets for data dirs
if (INSTALLDATA_DIRS)
# Extract plugin name
string (REGEX MATCH "Plugin-.+[/\\]?$" _dir ${_plugin_dir})
string (REPLACE "Plugin-" "" _plugin ${_dir})
# Crawl for resoruce files
set(DATA_FILES)
foreach (_dir ${INSTALLDATA_DIRS})
set(dst "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/${_dir}")
set(src "${CMAKE_SOURCE_DIR}/${_plugin_dir}/${_dir}")
acg_unset (_files)
acg_get_files_in_dir (_files ${src})
foreach (_file ${_files})
add_custom_command(OUTPUT "${dst}/${_file}"
DEPENDS "${src}/${_file}"
COMMAND ${CMAKE_COMMAND} -E copy "${src}/${_file}" "${dst}/${_file}"
)
# Collect command targets
list(APPEND DATA_FILES "${dst}/${_file}")
endforeach ()
endforeach ()
# Add custom target that will copy the files and make it a
# dependency of the plugin target.
add_custom_target(RSRC-${_plugin} DEPENDS ${DATA_FILES})
add_dependencies(Plugin-${_plugin} RSRC-${_plugin})
endif()
endforeach ()
# Hand down loaded packages to caller.
set(LOADED_PACKAGES ${LOADED_PACKAGES} PARENT_SCOPE)
# #acg_copy_after_build (Plugin-${plugin} "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/${_dir}")
#
# set(OUTPUT_FILES "")
# add_custom_command(OUTPUT "${dst}/${_file}"
# DEPENDS "${src}/${_file}"
# COMMAND ${CMAKE_COMMAND} -E copy "${src}/${_file}" "${dst}/${_file}"
# )
# list(APPEND OUTPUT_FILES "${dst}/${_file}")
# get_filename_component(BASENAME "${dst}" NAME)
# add_custom_target("${target}_CPY_${BASENAME}" DEPENDS ${OUTPUT_FILES})
# add_dependencies(${target} "${target}_CPY_${BASENAME}")
endfunction ()
macro(_get_plugin_name _path _name)
......
......@@ -624,12 +624,14 @@ function (_build_openflipper_plugin plugin)
)
endif ()
set(INSTALLDATA_DIRS)
foreach (_dir ${${_PLUGIN}_INSTALLDATA})
acg_copy_after_build (Plugin-${plugin} "${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" "${CMAKE_BINARY_DIR}/Build/${ACG_PROJECT_DATADIR}/${_dir}")
list(APPEND INSTALLDATA_DIRS "${_dir}")
if (NOT APPLE)
acg_install_dir ("${CMAKE_CURRENT_SOURCE_DIR}/${_dir}" "${ACG_PROJECT_DATADIR}/${_dir}")
endif ()
endforeach ()
set(INSTALLDATA_DIRS ${INSTALLDATA_DIRS} PARENT_SCOPE)
#============================================================================================
# CUDA Integration
......@@ -719,8 +721,9 @@ macro (openflipper_plugin)
if (NOT DISABLE_PLUGIN_${_PLUGIN})
_build_openflipper_plugin (${_plugin} ${ARGN})
set(LOADED_PACKAGES ${LOADED_PACKAGES} PARENT_SCOPE)
set(INSTALLDATA_DIRS ${INSTALLDATA_DIRS} PARENT_SCOPE)
endif ()
set(LOADED_PACKAGES ${LOADED_PACKAGES} PARENT_SCOPE)
endmacro ()
# No stupid abundance of "Boost version" messages, please.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment