Changeset 305 in flair-src for trunk/cmake-modules


Ignore:
Timestamp:
02/28/19 15:42:07 (3 years ago)
Author:
Sanahuja Guillaume
Message:

gcs resources

File:
1 edited

Legend:

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

    r302 r305  
    155155
    156156function(FLAIR_NRT_TOOL PROJECT_NAME SRC_FILES)
     157    set(options COPY_RESOURCES)
     158    set(oneValueArgs "")#not used
     159    set(multiValueArgs "")#not used
     160    cmake_parse_arguments(PARSE_ARGV 2 TOOL "${options}" "${oneValueArgs}" "${multiValueArgs}")
     161
     162    if(DEFINED TOOL_UNPARSED_ARGUMENTS)
     163        warn("FLAIR_NRT_TOOL function: unparsed arguments (${TOOL_UNPARSED_ARGUMENTS})")
     164    endif()
     165
    157166    #get ${FLAIR_INCLUDE_DIR}, ${FLAIR_LIBRARIES_RT} and ${FLAIR_LIBRARIES_NRT}
    158167    include($ENV{FLAIR_ROOT}/flair-src/cmake-modules/FlairUseFile.cmake)
     
    173182        RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-install/bin/tools/${ARCH_DIR}/
    174183    )
     184
     185    #copy resources if needed
     186    if(${TOOL_COPY_RESOURCES})
     187        FILE(GLOB RESOURCE_FILES "${CMAKE_CURRENT_SOURCE_DIR}/resources/${ARCH_DIR}/*")
     188        foreach(item IN LISTS RESOURCE_FILES)
     189            get_filename_component(filename ${item} NAME)
     190            #do not overwrite: user can change xml or scripts
     191            INSTALL(CODE "
     192                if (NOT EXISTS \"$ENV{FLAIR_ROOT}/flair-install/bin/tools/${ARCH_DIR}/${filename}\")
     193                    file(INSTALL \"${item}\" DESTINATION \"$ENV{FLAIR_ROOT}/flair-install/bin/tools/${ARCH_DIR}\" USE_SOURCE_PERMISSIONS)
     194                else()
     195                    message(\"-- Not installing \" $ENV{FLAIR_ROOT} \"/flair-install/bin/tools/\" ${ARCH_DIR} \"/\" ${filename} \" (file already exists)\")
     196                endif()
     197            ")
     198        endforeach()
     199    endif()
     200
    175201endfunction()
    176202
Note: See TracChangeset for help on using the changeset viewer.