Changeset 97 in flair-dev for trunk


Ignore:
Timestamp:
Jan 30, 2019, 3:06:32 PM (6 years ago)
Author:
Sanahuja Guillaume
Message:

going to out of source build

Location:
trunk/cmake-modules
Files:
2 edited

Legend:

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

    r83 r97  
     1if(DEFINED FLAIRUSEFILE_INCLUDED)
     2    return()
     3endif()
     4
     5SET(FLAIRUSEFILE_INCLUDED true)
     6
    17find_package(LibXml2 REQUIRED)
    28find_package(Xenomai QUIET)
     
    2026
    2127#check if we have a flair-hds directory
    22 if (IS_DIRECTORY $ENV{FLAIR_ROOT}/flair-hds )
    23         message("found flair-hds directory")
    24         SET(FOUND_HDS_DIR TRUE)
    25   SET(FLAIRHDS_LIBRARY_DIR
     28if (DEFINED FOUND_HDS_DIR)
     29    SET(FLAIRHDS_LIBRARY_DIR
    2630                $ENV{FLAIR_ROOT}/flair-hds/bin/lib/${ARCH_DIR}
    2731        )
     
    6367IF (FLAIR_USE_VISION_FILTER)
    6468    if(FOUND_HDS_DIR AND ("${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE}" MATCHES "armv7a-neon" OR "${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE}" MATCHES "core2-64"))
    65         message("using libdspcv_gpp.a for vision filter")
     69        message(${PROJECT_NAME} ": using libdspcv_gpp.a for vision filter")
    6670                SET(FLAIR_INCLUDE_DIR ${FLAIR_INCLUDE_DIR} $ENV{FLAIR_ROOT}/flair-hds/dev/include/VisionFilter)
    6771                SET(FLAIR_LIBRARIES ${FLAIRHDS_LIBRARY_DIR}/libVisionFilter.a ${FLAIRHDS_LIBRARY_DIR}/libdspcv_gpp.a ${FLAIR_LIBRARIES})
  • trunk/cmake-modules/GlobalCmakeFlair.cmake

    r81 r97  
     1if(DEFINED GLOBALCMAKEFLAIR_INCLUDED)
     2    return()
     3endif()
     4
     5SET(GLOBALCMAKEFLAIR_INCLUDED true)
     6
     7include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/ColoredMessage.cmake)
     8
     9#check if we have a flair-hds directory
     10if (IS_DIRECTORY $ENV{FLAIR_ROOT}/flair-hds )
     11        info("found flair-hds directory")
     12        SET(FOUND_HDS_DIR TRUE)
     13endif()
     14
    115if(NOT DEFINED ENV{FLAIR_ROOT})
    216        message(FATAL_ERROR  "variable FLAIR_ROOT not defined")
    317endif()
    4 
    5 include($ENV{FLAIR_ROOT}/flair-dev/cmake-modules/ColoredMessage.cmake)
    618
    719if(NOT DEFINED ENV{FLAIR_ROOT})
     
    5769#reimplement add executable to add a custom target for delivery (only on ARM)
    5870#delivery are read from ssh config file
     71#also add a message to display architecture
    5972function(ADD_EXECUTABLE)
    6073        if("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "arm" AND EXISTS "$ENV{HOME}/.ssh/config")
     
    6982                        if(${POS} GREATER -1)
    7083                                string(FIND ${f} "192.168." POS)#cherche addresse
    71                                 if(${POS} GREATER 0)#garde que les adresses en 192.168.6.x
     84                                if(${POS} GREATER 0)#garde que les adresses en 192.168.x.x
    7285                                        string(REPLACE HostName "" ADDRESS ${f})#enleve Hostname
    7386                                        string(STRIP ${ADDRESS} ADDRESS)#enleve les espaces
    74                                         message("adding delivery target for " ${ARGV0} " (" ${ADDRESS} ")")
     87                                        #message("adding delivery target for " ${ARGV0} " (" ${ADDRESS} ")")
    7588                                        string(REPLACE "/" "_" TARGET_PATH ${TARGET_EXECUTABLE_OUTPUT_PATH})#les / ne sont pas acceptés
    7689                                        add_custom_target(
     
    8396                endforeach(f)
    8497        endif()
    85         #call original function
     98
     99    #call original function
    86100        _ADD_EXECUTABLE(${ARGV})
     101
     102    #add a message to display architecture
     103    string(SUBSTRING ${ARGV0} 0 5 TESTNAME) #check if it is qt4 internal target
     104    if(NOT ${TESTNAME} MATCHES "Qt4::")
     105        add_custom_command(TARGET ${ARGV0} POST_BUILD
     106            COMMENT "${ARGV0} built for ${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE} architecture")
     107    endif()
     108
     109    #add a dependance to FlairLibs and FlairHdsLibs if we use the top level CMakeLists.txt and we need flairlibs
     110    if(TARGET FlairLibs AND DEFINED FLAIRUSEFILE_INCLUDED)
     111        add_dependencies(${ARGV0} FlairLibs)
     112    endif()
     113    if(TARGET FlairHdsLibs AND DEFINED FLAIRUSEFILE_INCLUDED)
     114        add_dependencies(${ARGV0} FlairHdsLibs)
     115    endif()
    87116endfunction()
     117
     118
     119#reimplement add library to add a message to display architecture
     120function(ADD_LIBRARY)
     121    #call original function
     122        _ADD_LIBRARY(${ARGV})
     123    string(SUBSTRING ${ARGV0} 0 5 TESTNAME) #check if it is qt4 internal target
     124    if(NOT ${TESTNAME} MATCHES "Qt4::")
     125        add_custom_command(TARGET ${ARGV0} POST_BUILD
     126            COMMENT "${ARGV0} built for ${CMAKE_SYSTEM_PROCESSOR_DEFAULTTUNE} architecture")
     127    endif()
     128endfunction()
Note: See TracChangeset for help on using the changeset viewer.