diff options
author | Timo Dritschler <timo.dritschler@kit.edu> | 2014-05-27 15:30:08 +0200 |
---|---|---|
committer | Timo Dritschler <timo.dritschler@kit.edu> | 2014-05-27 15:31:04 +0200 |
commit | 69f57959d50cf08d063484551f15f6990582953d (patch) | |
tree | 5b445bc327ad2da38d26837b8693a16421d2111a | |
parent | 72cb71c99131db200871dac9e17acefdf97292e7 (diff) | |
download | kiro-69f57959d50cf08d063484551f15f6990582953d.tar.gz kiro-69f57959d50cf08d063484551f15f6990582953d.tar.bz2 kiro-69f57959d50cf08d063484551f15f6990582953d.tar.xz kiro-69f57959d50cf08d063484551f15f6990582953d.zip |
Changed build system to CMake
-rw-r--r-- | CMakeLists.txt | 68 | ||||
-rw-r--r-- | Makefile | 41 | ||||
-rw-r--r-- | src/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/kiro-client.c (renamed from kiro-client.c) | 0 | ||||
-rw-r--r-- | src/kiro-client.h (renamed from kiro-client.h) | 0 | ||||
-rw-r--r-- | src/kiro-rdma.h (renamed from kiro-rdma.h) | 0 | ||||
-rw-r--r-- | src/kiro-server.c (renamed from kiro-server.c) | 0 | ||||
-rw-r--r-- | src/kiro-server.h (renamed from kiro-server.h) | 0 | ||||
-rw-r--r-- | src/kiro-trb.c (renamed from kiro-trb.c) | 0 | ||||
-rw-r--r-- | src/kiro-trb.h (renamed from kiro-trb.h) | 0 | ||||
-rw-r--r-- | test/CMakeLists.txt | 8 | ||||
-rw-r--r-- | test/test-client.c (renamed from test-client.c) | 0 | ||||
-rw-r--r-- | test/test-server.c (renamed from test-server.c) | 0 | ||||
-rw-r--r-- | test/test.c (renamed from test.c) | 0 |
14 files changed, 78 insertions, 41 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..2f77f52 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,68 @@ +project(KIRO) + +cmake_minimum_required(VERSION 2.6) +set(CMAKE_INCLUDE_CURRENT_DIR TRUE) + +set(TARNAME "kiro") +set(LIBKIRO_VERSION_MAJOR "0") +set(LIBKIRO_VERSION_MINOR "1") +set(LIBKIRO_VERSION_PATCH "0") +set(LIBKIRO_VERSION_RELEASE "1") +set(LIBKIRO_VERSION_STRING "${LIBKIRO_VERSION_MAJOR}.${LIBKIRO_VERSION_MINOR}.${LIBKIRO_VERSION_PATCH}") +set(VERSION "${LIBKIRO_VERSION_STRING}") +set(LIBKIRO_DESCRIPTION "Tango Device wrapper for an InfiniBand Server and Client") + +set(LIBKIRO_ABI_VERSION "${LIBKIRO_VERSION_MAJOR}.${LIBKIRO_VERSION_MINOR}") + +set(LIBKIRO_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}) + +find_package(PkgConfig) +pkg_check_modules(GLIB2 glib-2.0>=2.24 REQUIRED) +pkg_check_modules(GOBJECT2 gobject-2.0>=2.24 REQUIRED) + +include_directories( + SYSTEM + ${GLIB2_INCLUDE_DIRS} + ${GOBJECT2_INCLUDE_DIRS} +) + +add_definitions(-Wall -Wextra -std=c99) + +# check for 64 bit +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set(LIB_INSTALL_DIR "lib64") +else() + set(LIB_INSTALL_DIR "lib") +endif() + +set(HEADER_INSTALL_DIR include/LIBKIRO) + +add_subdirectory(src) + +add_subdirectory(test) + +set(CPACK_PACKAGE_DESCRIPTION ${LIBKIRO_DESCRIPTION}) +set(CPACK_PACKAGE_NAME ${TARNAME}) +set(CPACK_PACKAGE_CONTACT "Timo Dritschler <timo.dritschler@kit.edu>") +set(CPACK_PACKAGE_VENDOR "Karlsruhe Institute of Technology") +set(CPACK_PACKAGE_VERSION_MAJOR "${LIBKIRO_VERSION_MAJOR}") +set(CPACK_PACKAGE_VERSION_MINOR "${LIBKIRO_VERSION_MINOR}") +set(CPACK_PACKAGE_VERSION_PATCH "${LIBKIRO_VERSION_PATCH}") +set(CPACK_PACKAGE_RELEASE "${LIBKIRO_VERSION_RELEASE}") + +set(CPACK_GENERATOR "TGZ;RPM;") +set(CPACK_SOURCE_GENERATOR "TGZ") +set(CPACK_SOURCE_IGNORE_FILES "tags" ".git") +set(CPACK_PACKAGING_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX}) +set(CPACK_SOURCE_PACKAGE_FILE_NAME "LIBKIRO-${LIBKIRO_VERSION_STRING}" CACHE INTERNAL "tarball basename") +set(CPACK_PACKAGE_FILE_NAME + "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}-${CPACK_PACKAGE_RELEASE}.${CMAKE_SYSTEM_PROCESSOR}") + +set(LIBKIRO_PKG_PREFIX ${CMAKE_INSTALL_PREFIX}) +set(LIBKIRO_PKG_EXEC_PREFIX "${LIBKIRO_PKG_PREFIX}/bin") +set(LIBKIRO_PKG_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}") +set(LIBKIRO_PKG_INCLUDEDIR "${LIBKIRO_PKG_PREFIX}/include") + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/LIBKIRO.pc DESTINATION ${LIB_INSTALL_DIR}/pkgconfig) + +include(CPack) diff --git a/Makefile b/Makefile deleted file mode 100644 index 92f5508..0000000 --- a/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -CC=gcc -CFLAGS=-std=c99 -Wall -g -gdwarf-2 $(shell pkg-config --cflags gobject-2.0) -LDFLAGS=-lSDL -lm -lrdmacm -libverbs -lpthread $(shell pkg-config --libs gobject-2.0) - - -.PHONY : all -all: base - -base: kiro-trb.o kiro-client.o kiro-server.o - -kiro-trb.o: kiro-trb.c kiro-trb.h - $(CC) $(CFLAGS) $(LDFLAGS) -c kiro-trb.c -o kiro-trb.o - -kiro-client.o: kiro-client.c kiro-client.h - $(CC) $(CFLAGS) $(LDFLAGS) -c kiro-client.c -o kiro-client.o - -kiro-server.o: kiro-server.c kiro-server.h - $(CC) $(CFLAGS) $(LDFLAGS) -c kiro-server.c -o kiro-server.o - - -.PHONY : test -test: test-trb client server - -test-trb: kiro-trb.o test.c - $(CC) $(CFLAGS) $(LDFLAGS) test.c kiro-trb.o -o test-trb - -client: kiro-client.o kiro-trb.o test-client.c - $(CC) $(CFLAGS) $(LDFLAGS) test-client.c kiro-client.o kiro-trb.o -o client - -server: kiro-server.o kiro-trb.o test-server.c - $(CC) $(CFLAGS) $(LDFLAGS) test-server.c kiro-server.o kiro-trb.o -o server - - -.PHONY : clean -clean: - rm -f *.o test-trb client server - - -.PHONY : rebuild -rebuild: clean all - diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000..a657e1c --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(kiro kiro-trb.c kiro-client.c kiro-server.c) +target_link_libraries(kiro SDL m rdmacm ibverbs pthread) diff --git a/kiro-client.c b/src/kiro-client.c index 807d7d5..807d7d5 100644 --- a/kiro-client.c +++ b/src/kiro-client.c diff --git a/kiro-client.h b/src/kiro-client.h index e3e60de..e3e60de 100644 --- a/kiro-client.h +++ b/src/kiro-client.h diff --git a/kiro-rdma.h b/src/kiro-rdma.h index fa16fd1..fa16fd1 100644 --- a/kiro-rdma.h +++ b/src/kiro-rdma.h diff --git a/kiro-server.c b/src/kiro-server.c index 52304c8..52304c8 100644 --- a/kiro-server.c +++ b/src/kiro-server.c diff --git a/kiro-server.h b/src/kiro-server.h index cb9b57c..cb9b57c 100644 --- a/kiro-server.h +++ b/src/kiro-server.h diff --git a/kiro-trb.c b/src/kiro-trb.c index e81a4f7..e81a4f7 100644 --- a/kiro-trb.c +++ b/src/kiro-trb.c diff --git a/kiro-trb.h b/src/kiro-trb.h index 5c2b462..5c2b462 100644 --- a/kiro-trb.h +++ b/src/kiro-trb.h diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..849d0b3 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,8 @@ +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) + +add_executable(server test-server.c) +target_link_libraries(server kiro gobject-2.0 glib-2.0) diff --git a/test-client.c b/test/test-client.c index 469aa5e..469aa5e 100644 --- a/test-client.c +++ b/test/test-client.c diff --git a/test-server.c b/test/test-server.c index 63fefaa..63fefaa 100644 --- a/test-server.c +++ b/test/test-server.c |