set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Build/Server/)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/Build)

include(FindThreads)

if (MSVC11)
FIND_PACKAGE(SFML COMPONENTS SYSTEM WINDOW GRAPHICS REQUIRED)
endif ()

FIND_PACKAGE(Boost COMPONENTS system thread REQUIRED)
FIND_PACKAGE(MySQLConnectorCPP)
FIND_PACKAGE(CryptoPP)
FIND_PACKAGE(Threads)

link_directories(${Boost_LIBRARY_DIRS})

include_directories(
${CMAKE_SOURCE_DIR}/Server/
${CMAKE_SOURCE_DIR}/
${Boost_INCLUDE_DIRS}
${MYSQLCONNECTORCPP_INCLUDE_DIR}
${SFML_INCLUDE_DIR}
)

file(
GLOB_RECURSE
SHARED_SRC
${CMAKE_SOURCE_DIR}/Shared/Database.cpp
${CMAKE_SOURCE_DIR}/Shared/Log.cpp
${CMAKE_SOURCE_DIR}/Shared/Packet.cpp
${CMAKE_SOURCE_DIR}/Shared/TCPSession.cpp
)
file(
GLOB_RECURSE
SERVER_SRC
${CMAKE_SOURCE_DIR}/Server/*
)
file(
GLOB
SERVER_LIBS
${Boost_LIBRARIES}
${MYSQLCONNECTORCPP_LIBRARIES}
${CMAKE_THREAD_LIBS_INIT}
${CRYPTOPP_LIBRARIES}
)

add_executable(Server
    ${SERVER_SRC}
    ${SHARED_SRC})
target_link_libraries(Server
    ${SERVER_LIBS})

set (EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Build/Server/)
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/Build)

include(FindThreads)

if (MSVC11)
FIND_PACKAGE(SFML COMPONENTS SYSTEM WINDOW GRAPHICS REQUIRED)
endif ()

FIND_PACKAGE(Boost COMPONENTS system thread REQUIRED)
FIND_PACKAGE(MySQLConnectorCPP)
FIND_PACKAGE(CryptoPP)
FIND_PACKAGE(Threads)

link_directories(${Boost_LIBRARY_DIRS})

include_directories(
${CMAKE_SOURCE_DIR}/Server/
${CMAKE_SOURCE_DIR}/
${Boost_INCLUDE_DIRS}
${MYSQLCONNECTORCPP_INCLUDE_DIR}
${SFML_INCLUDE_DIR}
)

file(
GLOB_RECURSE
SHARED_SRC
${CMAKE_SOURCE_DIR}/Shared/Database.cpp
${CMAKE_SOURCE_DIR}/Shared/Log.cpp
${CMAKE_SOURCE_DIR}/Shared/Packet.cpp
${CMAKE_SOURCE_DIR}/Shared/TCPSession.cpp
)
file(
GLOB_RECURSE
SERVER_SRC
${CMAKE_SOURCE_DIR}/Server/*
)
file(
GLOB
SERVER_LIBS
${Boost_LIBRARIES}
${MYSQLCONNECTORCPP_LIBRARY}
${CMAKE_THREAD_LIBS_INIT}
${CRYPTOPP_LIBRARIES}
)

add_executable(Server
    ${SERVER_SRC}
    ${SHARED_SRC})
target_link_libraries(Server
    ${SERVER_LIBS})

Fix mysql linking on non-win32 platforms
Fix mysql linking on non-win32 platforms
