toxcore/CMakeLists.txt

32 lines
773 B
CMake
Raw Normal View History

2013-06-25 08:55:30 +08:00
cmake_minimum_required(VERSION 2.6.0)
2013-06-26 13:03:35 +08:00
project(TOX C)
2013-07-13 06:31:57 +08:00
set(exe_name toxMessengerTest)
2013-06-25 08:55:30 +08:00
set(core_sources
core/DHT.c
core/network.c
core/Lossless_UDP.c
core/net_crypto.c
core/Messenger.c)
2013-07-13 06:31:57 +08:00
2013-06-25 08:55:30 +08:00
set(test_sources
testing/Messenger_test.c)
2013-06-26 13:03:35 +08:00
add_executable(${exe_name}
2013-07-13 06:31:57 +08:00
${core_sources}
${test_sources})
2013-06-25 08:55:30 +08:00
if(WIN32)
2013-07-13 06:31:57 +08:00
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)
endif()
2013-06-26 13:03:35 +08:00
if(CMAKE_COMPILER_IS_GNUCC)
2013-07-13 06:31:57 +08:00
message(STATUS "==== GCC detected - Adding compiler flags ====")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
endif()