summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorTimo Dritschler <timo.dritschler@kit.edu>2014-05-27 15:30:08 +0200
committerTimo Dritschler <timo.dritschler@kit.edu>2014-05-27 15:31:04 +0200
commit69f57959d50cf08d063484551f15f6990582953d (patch)
tree5b445bc327ad2da38d26837b8693a16421d2111a /CMakeLists.txt
parent72cb71c99131db200871dac9e17acefdf97292e7 (diff)
downloadkiro-69f57959d50cf08d063484551f15f6990582953d.tar.gz
kiro-69f57959d50cf08d063484551f15f6990582953d.tar.bz2
kiro-69f57959d50cf08d063484551f15f6990582953d.tar.xz
kiro-69f57959d50cf08d063484551f15f6990582953d.zip
Changed build system to CMake
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt68
1 files changed, 68 insertions, 0 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)