Changeset 305 in flair-src


Ignore:
Timestamp:
Feb 28, 2019, 3:42:07 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

gcs resources

Location:
trunk
Files:
3 added
2 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
  • trunk/tools/FlairGCS/CMakeLists.txt

    r302 r305  
    7272)
    7373
    74 ADD_EXECUTABLE(${PROJECT_NAME} ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
     74SET(SRC_FILES ${PROJECT_SOURCE_FILES} ${MOC_SOURCES} ${RCC_SOURCES})
     75FLAIR_NRT_TOOL(${PROJECT_NAME} "${SRC_FILES}" COPY_RESOURCES)
    7576TARGET_LINK_LIBRARIES(${PROJECT_NAME} ${QT_LIBRARIES} GL qwt QwtDataViewer udt QtLocation FileLib z)
    7677
    77 INSTALL(
    78         TARGETS ${PROJECT_NAME}
    79         RUNTIME DESTINATION $ENV{FLAIR_ROOT}/flair-install/bin/tools/${ARCH_DIR}
    80 )
    8178
    8279add_custom_target(
     
    8784add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_compile_info)
    8885
    89 SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
    90 
    9186else()
    9287warn("${PROJECT_NAME} will not be built for ${CMAKE_SYSTEM_PROCESSOR} architecture")
Note: See TracChangeset for help on using the changeset viewer.