find and use libudis86 properly in l4-sys experiment
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1393 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
21
cmake/FindLibUdis86.cmake
Normal file
21
cmake/FindLibUdis86.cmake
Normal file
@ -0,0 +1,21 @@
|
||||
# - Try to find udis86 library (udis86.sourceforge.net)
|
||||
# Once done this will define
|
||||
#
|
||||
# LIBUDIS86_FOUND - system has libudis86
|
||||
# LIBUDIS86_INCLUDE_DIRS - the libudis86 include directory
|
||||
# LIBUDIS86_LIBRARIES - Link these to use libudis86
|
||||
# LIBUDIS86_DEFINITIONS - Compiler switches required for using libudis86
|
||||
|
||||
FIND_PATH(LIBUDIS86_INCLUDE_DIRS udis86.h)
|
||||
|
||||
FIND_LIBRARY(LIBUDIS86_LIBRARIES NAMES udis86
|
||||
PATHS /usr/lib /usr/local/lib /opt/local/lib
|
||||
ENV LIBRARY_PATH # PATH and LIB will also work
|
||||
ENV LD_LIBRARY_PATH)
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBUDIS86_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libudis86 DEFAULT_MSG LIBUDIS86_LIBRARIES LIBUDIS86_INCLUDE_DIRS)
|
||||
|
||||
MARK_AS_ADVANCED(LIBUDIS86_INCLUDE_DIRS LIBUDIS86_LIBRARIES)
|
||||
@ -27,7 +27,11 @@ PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${MY_PROTOS})
|
||||
|
||||
## Build library
|
||||
add_library(${EXPERIMENT_NAME} ${PROTO_SRCS} ${PROTO_HDRS} ${MY_CAMPAIGN_SRCS})
|
||||
target_link_libraries(${EXPERIMENT_NAME} udis86)
|
||||
|
||||
find_package(LibUdis86 REQUIRED)
|
||||
include_directories(${LIBUDIS86_INCLUDE_DIRS})
|
||||
link_directories(${LIBUDIS86_LINK_DIRS})
|
||||
target_link_libraries(${EXPERIMENT_NAME} ${LIBUDIS86_LIBRARIES})
|
||||
|
||||
## This is the example's campaign server distributing experiment parameters
|
||||
add_executable(${EXPERIMENT_NAME}-server main.cc)
|
||||
|
||||
@ -20,6 +20,10 @@
|
||||
|
||||
#include "l4sys.pb.h"
|
||||
|
||||
// FIXME libudis86 test -- remove me
|
||||
#include <udis86.h>
|
||||
void foo() { ud_t x; ud_init(&x); }
|
||||
|
||||
using namespace std;
|
||||
using namespace fail;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user