summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
blob: 23bfdcdb004242626febd173c3f0457f70e7fd46 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
cmake_minimum_required(VERSION 2.6.0)
project(TOX C)

set(exe_name toxMessengerTest)

set(core_sources
        core/DHT.c
        core/network.c
        core/Lossless_UDP.c
        core/net_crypto.c
        core/Messenger.c)

set(test_sources
        testing/nTox.c)

add_executable(${exe_name}
        ${core_sources}
        ${test_sources})

if(WIN32)
        include_directories(${TOX_SOURCE_DIR}/sodium/include/)
        target_link_libraries(${exe_name} ws2_32 
                ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a)
else()
        target_link_libraries(${exe_name} sodium)
        target_link_libraries(${exe_name} ncurses)
endif()

if(CMAKE_COMPILER_IS_GNUCC)
        message(STATUS "==== GCC detected - Adding compiler flags ====")
        set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
endif()