-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCMakeLists.txt
48 lines (31 loc) · 1.11 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
cmake_minimum_required(VERSION 3.0.2)
project(eoam)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_DEFAULT_STARTUP_PROJECT eoam)
set(CMAKE_BUILD_TYPE Debug)
# googletest
enable_testing()
find_package(GTest REQUIRED)
include_directories(${GTEST_INCLUDE_DIRS})
# vscode cmake tools
include(CMakeToolsHelpers OPTIONAL)
# set output binary folder
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# include
include_directories("./" "./src" "./include" "./src/xutl/include")
include_directories("./external/uthash/include" "./external/getopt/include")
# global flags
SET( GCC_COVERAGE_COMPILE_FLAGS "-g -Wall -Wextra -Werror")
SET( CMAKE_C_FLAGS ${CMAKE_C_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS})
SET( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS})
IF (APPLE)
SET(GCC_COVERAGE_LINK_FLAGS "-lpcap -Wall")
ELSE ()
SET(GCC_COVERAGE_LINK_FLAGS "-lpcap -pthread")
ENDIF()
SET( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${GCC_COVERAGE_LINK_FLAGS}" )
add_subdirectory(./src/xutl)
add_subdirectory(./src/eoamlib)
add_subdirectory(external)
add_subdirectory(./example)
add_subdirectory(./test)