aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
blob: ffc77c7039788df834bc6e1026635252389586da (plain)
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
find_package(Libcurl REQUIRED)
find_package(JsonC REQUIRED)
add_subdirectory(hash)
add_subdirectory(vdf)

set(CFLAGS
    -Wall -Wextra -pedantic
    -Wconversion -Wshadow -Wstrict-aliasing
    -Winit-self -Wcast-align -Wpointer-arith
    -Wmissing-declarations -Wmissing-include-dirs
    -Wno-unused-parameter -Wuninitialized
    ${LIBCURL_CFLAGS}
    ${JSONC_CFLAGS}
)

list(APPEND
    CORE_SOURCES
    ${CMAKE_CURRENT_SOURCE_DIR}/fs.c
    ${CMAKE_CURRENT_SOURCE_DIR}/fs.h
    ${CMAKE_CURRENT_SOURCE_DIR}/net.c
    ${CMAKE_CURRENT_SOURCE_DIR}/net.h
    ${CMAKE_CURRENT_SOURCE_DIR}/steam.c
    ${CMAKE_CURRENT_SOURCE_DIR}/steam.h
    ${CMAKE_CURRENT_SOURCE_DIR}/toast.c
    ${CMAKE_CURRENT_SOURCE_DIR}/toast.h
)

add_library(tvn STATIC ${CORE_SOURCES})
target_compile_options(tvn PUBLIC ${CFLAGS})

target_include_directories(tvn PUBLIC ${LIBCURL_INCLUDE_DIRS})
target_include_directories(tvn PUBLIC ${JSONC_INCLUDE_DIRS})
target_include_directories(tvn PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(tvn LINK_PUBLIC ${LIBCURL_LIBRARIES})
target_link_libraries(tvn LINK_PUBLIC ${JSONC_LIBRARIES})
target_link_libraries(tvn LINK_PUBLIC md5)
target_link_libraries(tvn LINK_PUBLIC vdf)
if (WIN32)
    target_link_libraries(tvn LINK_PUBLIC shlwapi)
endif()

# frontends are included last so they will be
# put in the root of the build directory
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

if(BUILD_CLI)
    add_subdirectory(cli)
endif()

if(BUILD_QT)
    add_subdirectory(qt)
endif()