diff options
Diffstat (limited to 'CMakeLists.txt')
-rwxr-xr-x | CMakeLists.txt | 67 |
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 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | ||
2 | |||
3 | set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
4 | |||
5 | option(SHARED_TOXCORE "Build Core as a shared library") | ||
6 | |||
7 | if(WIN32) | ||
8 | option(SHARED_LIBSODIUM "Links libsodium as a shared library") | ||
9 | else() | ||
10 | option(USE_NACL "Use NaCl library instead of libsodium") | ||
11 | option(NO_WIDECHAR "Do not use wide char, even if supported") | ||
12 | endif() | ||
13 | |||
14 | #OS X specific | ||
15 | if(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") | ||
20 | endif() | ||
21 | |||
22 | if(UNIX) | ||
23 | find_package(Cursesw REQUIRED) | ||
24 | endif() | ||
25 | |||
26 | if(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}) | ||
33 | else() | ||
34 | find_package(SODIUM REQUIRED) | ||
35 | |||
36 | include_directories(${SODIUM_INCLUDE_DIR}) | ||
37 | |||
38 | set(LINK_CRYPTO_LIBRARY ${SODIUM_LIBRARIES}) | ||
39 | endif() | ||
40 | |||
41 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail | ||
42 | if(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() | ||
47 | endif() | ||
48 | |||
49 | macro(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() | ||
57 | endmacro() | ||
58 | |||
59 | cmake_policy(SET CMP0011 NEW) | ||
60 | |||
61 | add_subdirectory(toxcore) | ||
62 | add_subdirectory(testing) | ||
63 | add_subdirectory(other) | ||
64 | add_subdirectory(docs) | ||
65 | if(UNIX) | ||
66 | add_subdirectory(auto_tests) | ||
67 | endif() | ||