CMAKE_MINIMUM_REQUIRED (VERSION 2.6) PROJECT (mira-server) INCLUDE ("Dependencies.cmake.in") INCLUDE ("CompilerOptions.cmake.in") # Change this tu whatever you would like the resulting binary to be named SET (SERVER_BINARY_NAME "mira_server") SET ( HEADERS "include/Application.h" "include/ConfigParser.h" "include/field_defs.h" "include/Field.h" "include/Resource.h" "include/ThreadPool.h" "include/tools.h" "include/User.h" "include/Workplace.h" "include/directory/Crypto.h" "include/directory/Directory.h" "include/directory/MD5.h" "include/directory/plaintext/PlainTextDirectory.h" "include/network/Msg.h" "include/network/Server.h" "include/network/TcpConnection.h" "include/asio/AsioServer.h" "include/asio/messages/MsgError.h" "include/asio/messages/MsgJoinGroup.h" "include/asio/messages/MsgListUtilities.h" "include/asio/messages/MsgListworkplaces.h" "include/asio/messages/MsgLogin.h" "include/asio/messages/MsgMessage.h" "include/asio/messages/MsgNewGroup.h" "include/asio/messages/MsgNewUser.h" "include/asio/messages/MsgPing.h" "include/asio/messages/MsgPoing.h" "include/asio/messages/MsgPrivateMessage.h" "include/asio/messages/MsgQuery.h" "include/asio/messages/MsgUtility.h" "include/utilities/UtilityInfo.h" "include/utilities/UtilityManager.h") # This is the full list of all source files to be compiled # TODO: might want to do this in a nicer way in the future SET ( SOURCES "src/Application.cpp" "src/ConfigParser.cpp" "src/main.cpp" "src/directory/Crypto.cpp" "src/directory/MD5.cpp" "src/directory/plaintext/PlainTextDirectory.cpp" "src/network/Msg.cpp" "src/network/TcpConnection.cpp" "src/network/asio/AsioServer.cpp" "src/network/messages/MsgQuery.cpp" ) # add boost include directories INCLUDE_DIRECTORIES (${Boost_INCLUDE_DIRS}) # Set mira-server include directories INCLUDE_DIRECTORIES ("include") # TODO: should the below be included or will the developers #include "gui/something.h" in the code? INCLUDE_DIRECTORIES ("include/directory") INCLUDE_DIRECTORIES ("include/directory/plaintext") INCLUDE_DIRECTORIES ("include/network") INCLUDE_DIRECTORIES ("include/network/asio") INCLUDE_DIRECTORIES ("include/network/messages") INCLUDE_DIRECTORIES ("include/network/messages/outgoing") INCLUDE_DIRECTORIES ("include/utilities") INCLUDE_DIRECTORIES ("include/utilities/files") INCLUDE_DIRECTORIES ("include/utilities/libmira-utilty") # set the generated executable path SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY "bin") SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY "bin") # copy server config files to the directory our binary will be generated to CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/conf/Directory.xml" "${CMAKE_BINARY_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Directory.xml" COPYONLY) CONFIGURE_FILE ("${CMAKE_SOURCE_DIR}/conf/mira.conf" "${CMAKE_BINARY_DIR}/${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/mira.conf" COPYONLY) # add our target ADD_EXECUTABLE (${SERVER_BINARY_NAME} ${SOURCES}) # link libraries #TARGET_LINK_LIBRARIES(${SERVER_BINARY_NAME} ${Boost_LIBRARIES}) IF (WIN32) TARGET_LINK_LIBRARIES(${SERVER_BINARY_NAME} ${Boost_LIBRARIES} mira ws2_32 wsock32) ELSE (WIN32) TARGET_LINK_LIBRARIES(${SERVER_BINARY_NAME} ${Boost_LIBRARIES} mira "-ldl -lpthread") ENDIF(WIN32) # Library for Utility developers to use to access core resources add_library(mira SHARED "src/utilities/libmira-utility/MiraUtility.cpp") # External (Utility) libraries (plugins) #------------------------------------------ # Files Utility SET ( FILES_UTILITY_SOURCES "src/utilities/files/files.cpp" "src/utilities/files/FileUtility.cpp" "src/utilities/files/FileServer.cpp" "src/utilities/files/FileConnection.cpp") add_library(Files-utility SHARED ${FILES_UTILITY_SOURCES}) TARGET_LINK_LIBRARIES ( Files-utility mira )