-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
32 lines (23 loc) · 991 Bytes
/
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
cmake_minimum_required(VERSION 2.8)
project(tstr)
set(tstr_version 0.0.1)
option (BUILD_TESTS "Build unit tests." TRUE)
find_package(CURL REQUIRED)
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
add_definitions(-D_CRT_SECURE_NO_WARNINGS -DCURL_STATICLIB)
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
file(GLOB parse_sources tsparse/*.c)
file(GLOB parse_headers tsparse/*.h)
file(GLOB arg_parse_sources argparse/argparse.c)
file(GLOB arg_parse_headers argparse/argparse.h)
include_directories(jsmn)
include_directories(tsparse)
include_directories(argparse)
include_directories(${CURL_INCLUDE_DIRS})
add_executable(tstr ${parse_headers} ${parse_sources} ${arg_parse_headers} ${arg_parse_sources} tstran.c jsmn/jsmn.c jsmn/jsmn.h)
target_link_libraries(tstr ${CURL_LIBRARIES})
if (BUILD_TESTS)
include_directories(jsmn/test)
add_executable(tests ${parse_headers} ${parse_sources} test/tests.c jsmn/test/test.h)
endif(BUILD_TESTS)
message(STATUS "BUILD_TESTS = ${BUILD_TESTS}")