From b235a08edef91266c21117eec094a093b91cdb54 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Thu, 10 Feb 2011 10:25:50 +0100 Subject: [PATCH] skeleton --- CMakeLists.txt | 28 ++++++++++++++++++++++++++++ cmake_modules/cppunitConfig.cmake | 30 ++++++++++++++++++++++++++++++ include/CMakeLists.txt | 1 + src/CMakeLists.txt | 15 +++++++++++++++ src/transport.pc.in | 12 ++++++++++++ 5 files changed, 86 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 cmake_modules/cppunitConfig.cmake create mode 100644 include/CMakeLists.txt create mode 100644 src/CMakeLists.txt create mode 100644 src/transport.pc.in diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 00000000..6118c014 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,28 @@ +project(libtransport) + +set(CMAKE_MODULE_PATH "cmake_modules") + +set(cppunit_DIR "${CMAKE_SOURCE_DIR}/cmake_modules") +find_package(cppunit) + +if(CMAKE_BUILD_TYPE MATCHES Debug) + ADD_DEFINITIONS(-ggdb) + ADD_DEFINITIONS(-DDEBUG) + ADD_DEFINITIONS(-Wall) + ADD_DEFINITIONS(-W) + ADD_DEFINITIONS(-Wcast-align) + ADD_DEFINITIONS(-Wextra -Wno-sign-compare -Wno-unused-parameter) + ADD_DEFINITIONS(-Winit-self) + ADD_DEFINITIONS(-Wmissing-declarations) + ADD_DEFINITIONS(-Wpointer-arith) + ADD_DEFINITIONS(-Wreorder) + ADD_DEFINITIONS(-Woverloaded-virtual) + ADD_DEFINITIONS(-Wsign-promo) + ADD_DEFINITIONS(-Wundef -Wunused) + message(STATUS "Build type is set to Debug") +endif(CMAKE_BUILD_TYPE MATCHES Debug) + +SET(TRANSPORT_VERSION 2.0) + +ADD_SUBDIRECTORY(src) +ADD_SUBDIRECTORY(include) diff --git a/cmake_modules/cppunitConfig.cmake b/cmake_modules/cppunitConfig.cmake new file mode 100644 index 00000000..d1d1832b --- /dev/null +++ b/cmake_modules/cppunitConfig.cmake @@ -0,0 +1,30 @@ +# - Find cppunit +# Find the native cppunit includes and library +# +# CPPUNIT_INCLUDE_DIR - where to find cppunit/Test.h, etc. +# CPPUNIT_LIBRARIES - List of libraries when using cppunit. +# CPPUNIT_FOUND - True if cppunit found. + + +IF (CPPUNIT_INCLUDE_DIR) + # Already in cache, be silent + SET(CPPUNIT_FIND_QUIETLY TRUE) +ENDIF (CPPUNIT_INCLUDE_DIR) + +FIND_PATH(CPPUNIT_INCLUDE_DIR cppunit/Test.h) + +SET(CPPUNIT_NAMES cppunit) +FIND_LIBRARY(CPPUNIT_LIBRARY NAMES ${CPPUNIT_NAMES} ) + +# handle the QUIETLY and REQUIRED arguments and set CPPUNIT_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(CppUnit DEFAULT_MSG CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR) + +IF(CPPUNIT_FOUND) + SET( CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY} ) +ELSE(CPPUNIT_FOUND) + SET( CPPUNIT_LIBRARIES ) +ENDIF(CPPUNIT_FOUND) + +MARK_AS_ADVANCED( CPPUNIT_LIBRARY CPPUNIT_INCLUDE_DIR ) diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt new file mode 100644 index 00000000..b9a3ba43 --- /dev/null +++ b/include/CMakeLists.txt @@ -0,0 +1 @@ +ADD_SUBDIRECTORY(transport) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 00000000..8acced57 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,15 @@ +FILE(GLOB SRC *.cpp *.h) +FILE(GLOB HEADERS ../../include/transport/*.h) + +# SOURCE_GROUP(headers FILES ${HEADERS}) + +ADD_LIBRARY(transport ${HEADERS} ${SRC}) + +TARGET_LINK_LIBRARIES(transport -lSwiften -lresolv -lidn -lz -lpthread -lexpat -lidn -lboost_date_time -lboost_system -lboost_filesystem -lboost_program_options -lboost_regex -lboost_thread-mt -lboost_signals -lz -lssl -lcrypto -lexpat -lresolv -lc -lxml2 -export-dynamic) + + + +CONFIGURE_FILE(transport.pc.in "${CMAKE_CURRENT_BINARY_DIR}/transport.pc") +INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/transport.pc" DESTINATION lib/pkgconfig) + +INSTALL(TARGETS transport LIBRARY DESTINATION lib ARCHIVE DESTINATION lib COMPONENT libraries) diff --git a/src/transport.pc.in b/src/transport.pc.in new file mode 100644 index 00000000..ea83a21c --- /dev/null +++ b/src/transport.pc.in @@ -0,0 +1,12 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: transport +Version: @TRANSPORT_VERSION@ +Description: NeL @TRANSPORT_VERSION@ +Reqiures: +Libs: -L${libdir} +Libs.private: @LIBS@ -lc +Cflags: -I${includedir}