diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2013-07-21 20:41:08 -0400 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2013-07-21 20:41:08 -0400 |
commit | 533f136d0e79d3a6f50080baaa434c5ee546c2ee (patch) | |
tree | e07115598a75b0192a483d7fed81632740f3773a | |
parent | d35ddc161860610aec25517ba78a65647ff97169 (diff) |
Made a cmake project for Core
-rw-r--r-- | CMakeLists.txt | 21 | ||||
-rw-r--r-- | core/CMakeLists.txt | 15 |
2 files changed, 21 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 505983f2..187c0794 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,5 +1,6 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | 1 | cmake_minimum_required(VERSION 2.6.0) |
2 | 2 | ||
3 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail | ||
3 | if(NOT WIN32) | 4 | if(NOT WIN32) |
4 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) | 5 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) |
5 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | 6 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") |
@@ -7,21 +8,10 @@ if(NOT WIN32) | |||
7 | endif() | 8 | endif() |
8 | endif() | 9 | endif() |
9 | 10 | ||
10 | if(WIN32) | ||
11 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | ||
12 | endif() | ||
13 | |||
14 | set(core_sources | ||
15 | core/DHT.c | ||
16 | core/network.c | ||
17 | core/Lossless_UDP.c | ||
18 | core/net_crypto.c | ||
19 | core/Messenger.c) | ||
20 | |||
21 | add_library(core ${core_sources}) | ||
22 | |||
23 | macro(linkCoreLibraries exe_name) | 11 | macro(linkCoreLibraries exe_name) |
12 | add_dependencies(${exe_name} core) | ||
24 | if(WIN32) | 13 | if(WIN32) |
14 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | ||
25 | target_link_libraries(${exe_name} core | 15 | target_link_libraries(${exe_name} core |
26 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a | 16 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a |
27 | ws2_32) | 17 | ws2_32) |
@@ -33,5 +23,6 @@ endmacro() | |||
33 | 23 | ||
34 | cmake_policy(SET CMP0011 NEW) | 24 | cmake_policy(SET CMP0011 NEW) |
35 | 25 | ||
36 | ADD_SUBDIRECTORY(testing) | 26 | add_subdirectory(core) |
37 | ADD_SUBDIRECTORY(other) \ No newline at end of file | 27 | add_subdirectory(testing) |
28 | add_subdirectory(other) \ No newline at end of file | ||
diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt new file mode 100644 index 00000000..51f30e17 --- /dev/null +++ b/core/CMakeLists.txt | |||
@@ -0,0 +1,15 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | ||
2 | project(core C) | ||
3 | |||
4 | if(WIN32) | ||
5 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | ||
6 | endif() | ||
7 | |||
8 | set(core_sources | ||
9 | DHT.c | ||
10 | network.c | ||
11 | Lossless_UDP.c | ||
12 | net_crypto.c | ||
13 | Messenger.c) | ||
14 | |||
15 | add_library(core ${core_sources}) | ||