-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathCMakeLists.txt
executable file
·66 lines (52 loc) · 1.72 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
### Configuration
cmake_minimum_required(VERSION 2.8)
project(libOL)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Werror -Wextra -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin" AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -Wno-deprecated-declarations")
endif()
include_directories("${PROJECT_SOURCE_DIR}/src")
### libOL
set(LIBOL_SOURCES
src/libOL/Blowfish/Blowfish.cpp
src/libOL/ChunkHeader.cpp
src/libOL/Chunks.cpp
src/libOL/Header.cpp
src/libOL/PayloadHeader.cpp
src/libOL/Rofl.cpp
src/libOL/Block.cpp
src/libOL/Value.cpp
src/libOL/Packet.cpp
src/libOL/ParseException.cpp
)
if(CMAKE_GENERATOR MATCHES "Xcode")
FILE(GLOB_RECURSE LIBOL_INC "src/libOL/*.h")
SET(LIBOL_SOURCES ${LIBOL_SOURCES} ${LIBOL_INC})
endif()
add_library(OL ${LIBOL_SOURCES})
### zlib
find_package(ZLIB REQUIRED)
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
target_link_libraries(OL ${ZLIB_LIBRARIES})
endif(ZLIB_FOUND)
### OpenSSL
find_package(OpenSSL REQUIRED)
if (OPENSSL_FOUND)
include_directories(${OPENSSL_INCLUDE_DIRS})
target_link_libraries(OL ${OPENSSL_LIBRARIES})
endif(OPENSSL_FOUND)
### Test libOL
set(LIBOL_TEST_SOURCES
src/libOL_test/main.cpp
)
if(CMAKE_GENERATOR MATCHES "Xcode")
FILE(GLOB_RECURSE LIBOL_TEST_INC "src/libOL_test/*.h")
SET(LIBOL_TEST_SOURCES ${LIBOL_TEST_SOURCES} ${LIBOL_TEST_INC})
endif()
add_executable(libOL_test ${LIBOL_TEST_SOURCES})
target_link_libraries(libOL_test OL)