diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..6118c014a5d6ae8dfc7ac0020270e0881747b791 --- /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 0000000000000000000000000000000000000000..d1d1832b775415e74b3e4f9e32ec9edb3122f00e --- /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 0000000000000000000000000000000000000000..b9a3ba4382e16538c9f36cdc63318db1c61d9d0f --- /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 0000000000000000000000000000000000000000..8acced579150459ca88217ecc0cc6c71ecd8a666 --- /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 0000000000000000000000000000000000000000..ea83a21ce51a0eb4a89bf2f95fa56ae2ed29bf5b --- /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}