Commit e1006919 authored by louiz’'s avatar louiz’

Use louloulibs and fix CMakeLists.txt with it

parent 5c2761c7
[submodule "SteamPP"]
path = SteamPP
url = https://github.com/louiz/SteamPP.git
[submodule "louloulibs"]
path = louloulibs
url = git://git.louiz.org/louloulibs
branch = master
......@@ -15,20 +15,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__FILENAME__='\"$(subst ${CMAKE_SOURCE
#
## Look for external libraries
#
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/SteamPP/cmake/Modules/")
if(WITH_BOTAN)
find_package(BOTAN REQUIRED)
elseif(NOT WITHOUT_BOTAN)
find_package(BOTAN)
endif()
if(WITH_CARES)
find_package(CARES REQUIRED)
elseif(NOT WITHOUT_CARES)
find_package(CARES)
endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")
#
## Get the software version
......@@ -53,7 +40,7 @@ if(${PROJECT_NAME}_VERSION_SUFFIX MATCHES "^~dev$")
endif()
endif()
set(VAPORO_VERSION
set(SOFTWARE_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}${${PROJECT_NAME}_VERSION_SUFFIX})
# To be able to include the config.h file generated by cmake
......@@ -61,63 +48,19 @@ include_directories("${CMAKE_CURRENT_BINARY_DIR}/src/")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/src/")
# Include the Steam++ library headers
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/SteamPP/")
# Include the SteamKit headers generated by the protobuf compiler
include_directories("${CMAKE_CURRENT_BINARY_DIR}/SteamPP/")
if(BOTAN_FOUND)
include_directories(SYSTEM ${BOTAN_INCLUDE_DIRS})
endif()
add_subdirectory("louloulibs")
include_directories("louloulibs")
if(CARES_FOUND)
include_directories(${CARES_INCLUDE_DIRS})
endif()
set(POLLER_DOCSTRING "Choose the poller between POLL and EPOLL (Linux-only)")
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(POLLER "EPOLL" CACHE STRING ${POLLER_DOCSTRING})
else()
set(POLLER "POLL" CACHE STRING ${POLLER_DOCSTRING})
endif()
if((NOT ${POLLER} MATCHES "POLL") AND
(NOT ${POLLER} MATCHES "EPOLL"))
message(FATAL_ERROR "POLLER must be either POLL or EPOLL")
# If they are found in louloulibs CMakeLists.txt, we inherite these values
if(SYSTEMD_FOUND)
include_directories(${SYSTEMD_INCLUDE_DIRS})
endif()
#
## utils
#
file(GLOB source_utils
src/utils/*.[hc]pp)
add_library(utils STATIC ${source_utils})
#
## config
#
file(GLOB source_config
src/config/*.[hc]pp)
add_library(config STATIC ${source_config})
target_link_libraries(config utils)
#
## logger
#
file(GLOB source_logger
src/logger/*.[hc]pp)
add_library(logger STATIC ${source_logger})
target_link_libraries(logger config)
#
## network
#
file(GLOB source_network
src/network/*.[hc]pp)
add_library(network STATIC ${source_network})
target_link_libraries(network logger)
if(BOTAN_FOUND)
target_link_libraries(network ${BOTAN_LIBRARIES})
include_directories(SYSTEM ${BOTAN_INCLUDE_DIRS})
endif()
if(CARES_FOUND)
target_link_libraries(network ${CARES_LIBRARIES})
include_directories(${CARES_INCLUDE_DIRS})
endif()
#
......@@ -131,7 +74,15 @@ add_subdirectory("SteamPP/")
file(GLOB source_steam
src/steam/*[hc]pp)
add_library(steam STATIC ${source_steam})
target_link_libraries(steam network logger)
target_link_libraries(steam network logger steam++)
#
## xmpp
#
file(GLOB source_xmpp
src/xmpp/*.[hc]pp)
add_library(xmpp STATIC ${source_xmpp})
target_link_libraries(xmpp xmpplib network utils logger steam)
#
## Main executable
......@@ -140,6 +91,7 @@ add_executable(${PROJECT_NAME} src/main.cpp)
target_link_libraries(${PROJECT_NAME}
steam
steam++
xmpp
)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/src/config.h)
......
louloulibs @ d1da5131
Subproject commit d1da51310dbab0f0dd41f96782b6457c047c37ad
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment