diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c16ce6fe..c18d41d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,11 +1,14 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | 1 | cmake_minimum_required(VERSION 2.6.0) |
2 | 2 | ||
3 | set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) | ||
4 | |||
3 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail | 5 | #MinGW prints more warnings for -Wall than gcc does, thus causing build to fail |
4 | if(NOT WIN32) | 6 | if(NOT WIN32) |
5 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) | 7 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) |
6 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | 8 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") |
7 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") | 9 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") |
8 | endif() | 10 | endif() |
11 | find_package(SODIUM REQUIRED) | ||
9 | endif() | 12 | endif() |
10 | 13 | ||
11 | macro(linkCoreLibraries exe_name) | 14 | macro(linkCoreLibraries exe_name) |
@@ -16,8 +19,9 @@ macro(linkCoreLibraries exe_name) | |||
16 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a | 19 | ${CMAKE_SOURCE_DIR}/sodium/lib/libsodium.a |
17 | ws2_32) | 20 | ws2_32) |
18 | else() | 21 | else() |
22 | include_directories(${SODIUM_INCLUDE_DIR}) | ||
19 | target_link_libraries(${exe_name} core | 23 | target_link_libraries(${exe_name} core |
20 | sodium) | 24 | ${SODIUM_LIBRARY}) |
21 | endif() | 25 | endif() |
22 | endmacro() | 26 | endmacro() |
23 | 27 | ||
@@ -25,4 +29,4 @@ cmake_policy(SET CMP0011 NEW) | |||
25 | 29 | ||
26 | add_subdirectory(core) | 30 | add_subdirectory(core) |
27 | add_subdirectory(testing) | 31 | add_subdirectory(testing) |
28 | add_subdirectory(other) \ No newline at end of file | 32 | add_subdirectory(other) |