Changeset 102 in flair-dev for trunk/cmake-modules/GlobalCmakeFlair.cmake


Ignore:
Timestamp:
Feb 7, 2019, 4:27:03 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

modifs for demos resources

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cmake-modules/GlobalCmakeFlair.cmake

    r97 r102  
    127127    endif()
    128128endfunction()
     129
     130#copy resources (ex: demos scripts and xml)
     131function(INSTALL)
     132    if(COPY_RESOURCE_FILES)
     133        FILE(GLOB RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/${ARCH_DIR}/*")
     134        foreach(item IN LISTS RESOURCE_FILES)
     135            get_filename_component(filename ${item} NAME)
     136            #do not overwrite: user can change xml or scripts
     137            _INSTALL(CODE "
     138                if (NOT EXISTS \"$ENV{FLAIR_ROOT}/flair-bin/demos/${ARCH_DIR}/${PROJECT_NAME}/${filename}\")
     139                    file(INSTALL \"${item}\" DESTINATION \"$ENV{FLAIR_ROOT}/flair-bin/demos/${ARCH_DIR}/${PROJECT_NAME}\")
     140                endif()
     141            ")
     142        endforeach()
     143
     144    endif()
     145    #call original function
     146        _INSTALL(${ARGV})
     147endfunction()
Note: See TracChangeset for help on using the changeset viewer.