summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-xCMakeLists.txt67
1 files changed, 0 insertions, 67 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
deleted file mode 100755
index 73e89171..00000000
--- a/CMakeLists.txt
+++ /dev/null
@@ -1,67 +0,0 @@
1cmake_minimum_required(VERSION 2.6.0)
2
3set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
4
5option(SHARED_TOXCORE "Build Core as a shared library")
6
7if(WIN32)
8 option(SHARED_LIBSODIUM "Links libsodium as a shared library")
9else()
10 option(USE_NACL "Use NaCl library instead of libsodium")
11 option(NO_WIDECHAR "Do not use wide char, even if supported")
12endif()
13
14#OS X specific
15if(APPLE)
16 set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /opt/local/lib)
17 set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH} /opt/local/include)
18 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -I/opt/local/include" )
19 set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/opt/local/lib")
20endif()
21
22if(UNIX)
23 find_package(Cursesw REQUIRED)
24endif()
25
26if(USE_NACL)
27 find_package(NaCl REQUIRED)
28
29 include_directories(${NACL_INCLUDE_DIR})
30 add_definitions(-DVANILLA_NACL)
31
32 set(LINK_CRYPTO_LIBRARY ${NACL_LIBRARIES})
33else()
34 find_package(SODIUM REQUIRED)
35
36 include_directories(${SODIUM_INCLUDE_DIR})
37
38 set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARIES})
39endif()
40
41#MinGW prints more warnings for -Wall than gcc does, thus causing build to fail
42if(NOT WIN32)
43 if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
44 message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
45 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
46 endif()
47endif()
48
49macro(linkCoreLibraries exe_name)
50 add_dependencies(${exe_name} toxcore)
51 target_link_libraries(${exe_name} toxcore
52 ${LINK_CRYPTO_LIBRARY})
53
54 if(WIN32)
55 target_link_libraries(${exe_name} ws2_32)
56 endif()
57endmacro()
58
59cmake_policy(SET CMP0011 NEW)
60
61add_subdirectory(toxcore)
62add_subdirectory(testing)
63add_subdirectory(other)
64add_subdirectory(docs)
65if(UNIX)
66 add_subdirectory(auto_tests)
67endif()