summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-08-15 12:53:42 +0200
committerTimo Dritschler <timo.dritschler@kit.edu>2014-08-15 18:28:46 +0200
commit318c12699514f8187ab212a4db8492984f05348b (patch)
tree82953d9a365e7f071576b504eaed138b42862d2c
parentf161b80fb93af73713516267787b1ef41fca68f4 (diff)
downloadkiro-318c12699514f8187ab212a4db8492984f05348b.tar.gz
kiro-318c12699514f8187ab212a4db8492984f05348b.tar.bz2
kiro-318c12699514f8187ab212a4db8492984f05348b.tar.xz
kiro-318c12699514f8187ab212a4db8492984f05348b.zip
Changed CMake build to exclude test binaries if SDL library is not installed
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--test/CMakeLists.txt11
2 files changed, 10 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 395767b..3fe62a0 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -3,7 +3,7 @@ set_target_properties(kiro PROPERTIES
VERSION "${LIBKIRO_VERSION_MAJOR}.${LIBKIRO_VERSION_MINOR}"
SOVERSION ${LIBKIRO_VERSION_PATCH}
)
-target_link_libraries(kiro SDL m rdmacm ibverbs pthread)
+target_link_libraries(kiro m rdmacm ibverbs pthread)
install(FILES kiro-rdma.h kiro-trb.h kiro-client.h kiro-server.h DESTINATION ${HEADER_INSTALL_DIR})
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 849d0b3..aee6c45 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,8 +1,15 @@
include_directories(${KIRO_SOURCE_DIR}/src)
link_directories(${KIRO_BINARY_DIR}/src)
-add_executable(client test-client.c)
-target_link_libraries(client kiro SDL m gobject-2.0 glib-2.0)
+find_package(PkgConfig)
+pkg_check_modules(SDL sdl>=1.2.15)
+
+if (SDL_FOUND)
+ add_executable(client test-client.c)
+ target_link_libraries(client kiro SDL m gobject-2.0 glib-2.0)
+else ()
+ message("SDL not found: Won't build KIRO test-client binary.")
+endif ()
add_executable(server test-server.c)
target_link_libraries(server kiro gobject-2.0 glib-2.0)