aboutsummaryrefslogtreecommitdiffstats
path: root/cmake/modules/FindWSWinLibs.cmake
blob: 3442e84ed0aeddbbd24ee48092f503479cdc85be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# $Id$
#
# - Find WSWin Libs
#  Due to the layout of the Wireshark Win support libs,
#  CMake needs some support to find them
#
#  The function is passed the directory name to search for and the variable
#  to set in the callers scope.

function(FindWSWinLibs _WS_LIB_SEARCH_PATH _LIB_HINT_VAR)
  if (WIN32)
    set( _WS_BASE_DIR $ENV{WIRESHARK_BASE_DIR} )
    set( _WS_TARGET_PLATFORM $ENV{WIRESHARK_TARGET_PLATFORM} )
    set( _PROJECT_LIB_DIR "${_WS_BASE_DIR}/wireshark-${_WS_TARGET_PLATFORM}-libs" )
    file( GLOB _SUBDIR "${_PROJECT_LIB_DIR}/*" )
    foreach( _DIR ${_SUBDIR} )
      if( IS_DIRECTORY ${dir} )
        if( "${_DIR}" matches ".*/${_WS_LIB_SEARCH_PATH}" )
          set( ${_LIB_HINT_VAR} ${_DIR} PARENT_SCOPE )
        endif()
      endif()
    endforeach()
  endif()
endfunction(FindWSWinLibs)