Skip to content

Commit

Permalink
CMake: minor fix to export extra libraries for pcap
Browse files Browse the repository at this point in the history
  • Loading branch information
adeguet1 committed Aug 2, 2017
1 parent 1238c3f commit 610f8c9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Amp1394Config.cmake.in
Expand Up @@ -15,7 +15,7 @@ set (Amp1394_INCLUDE_DIR "@CONF_INCLUDE_DIR@")
set (Amp1394_LIBRARY_DIR "@CONF_LIBRARY_DIR@")

# Libraries to link against
set (Amp1394_LIBRARIES @CONF_LIBRARIES@)
set (Amp1394_LIBRARIES "@CONF_LIBRARIES@")

# FireWire/Ethernet support
set (Amp1394_HAS_RAW1394 "@Amp1394_HAS_RAW1394@")
Expand Down
23 changes: 12 additions & 11 deletions CMakeLists.txt
@@ -1,5 +1,5 @@
#
# (C) Copyright 2011-2016 Johns Hopkins University (JHU), All Rights Reserved.
# (C) Copyright 2011-2017 Johns Hopkins University (JHU), All Rights Reserved.
#
# --- begin cisst license - do not edit ---
#
Expand Down Expand Up @@ -33,22 +33,23 @@ set (Amp1394_LIBRARIES Amp1394)
if (WIN32)

# On Windows, can build with winpcap (Ethernet support)
option (Amp1394_HAS_PCAP "Build Amp1394 with Ethernet support (winpcap)" ON)
option (Amp1394_HAS_PCAP "Build Amp1394 with Ethernet support (winpcap)" ON)

# Need to specify where WinPcap Developer's Pack is installed
find_path(PCAP_INCLUDE_DIR pcap.h)
find_path (PCAP_INCLUDE_DIR pcap.h)
# In addition to wpcap, need Packet library for PacketOpenAdapter and PacketReqest
find_path(PCAP_LIBRARY_DIR "wpcap.lib" DOC "Path to WinPcap wpcap and Packet libraries")
set(PCAP_LIBRARIES "wpcap" "Packet")
find_path (PCAP_LIBRARY_DIR "wpcap.lib" DOC "Path to WinPcap wpcap and Packet libraries")
set (PCAP_LIBRARIES "wpcap" "Packet")

else (WIN32)

# On other platforms (mostly Linux), can build with pcap and/or libraw1394
option (Amp1394_HAS_PCAP "Build Amp1394 with Ethernet support (pcap)" OFF)
option (Amp1394_HAS_RAW1394 "Build Amp1394 with FireWire support (libraw1394)" ON)
option (Amp1394_HAS_PCAP "Build Amp1394 with Ethernet support (pcap)" OFF)
option (Amp1394_HAS_RAW1394 "Build Amp1394 with FireWire support (libraw1394)" ON)

# For now, assume pcap is installed somewhere standard
set(PCAP_INCLUDE_DIR "")
set(PCAP_LIBRARIES "pcap")
set (PCAP_INCLUDE_DIR "")
set (PCAP_LIBRARIES "pcap")

endif (WIN32)

Expand Down Expand Up @@ -76,7 +77,7 @@ endif (Amp1394_HAS_PCAP)
# Generate Amp1394Config.cmake
set (CONF_INCLUDE_DIR ${Amp1394_INCLUDE_DIR})
set (CONF_LIBRARY_DIR ${Amp1394_LIBRARY_DIR} ${Amp1394_EXTRA_LIBRARY_DIR})
set (CONF_LIBRARIES ${Amp1394_LIBRARIES} ${AMP_EXTRA_LIBRARIES})
set (CONF_LIBRARIES ${Amp1394_LIBRARIES} ${Amp1394_EXTRA_LIBRARIES})
configure_file (Amp1394Config.cmake.in
"${Mechatronics_BINARY_DIR}/Amp1394Config.cmake" @ONLY)

Expand Down Expand Up @@ -108,7 +109,7 @@ endif (Amp1394_HAS_RAW1394)
add_subdirectory (lib)

# Test programs (some use curses for text based display)
add_subdirectory(tests)
add_subdirectory (tests)

# Utility to flash/test board
add_subdirectory (programmer)

0 comments on commit 610f8c9

Please sign in to comment.