-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
58 lines (45 loc) · 1.5 KB
/
CMakeLists.txt
File metadata and controls
58 lines (45 loc) · 1.5 KB
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
# Copyright lowRISC contributors.
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 4.1)
project(ftditool LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(argparse QUIET)
find_package(magic_enum QUIET)
find_package(picosha2 QUIET)
# Check if nix is not providing these dependencies.
if (NOT argparse_FOUND)
include(FetchContent)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
)
FetchContent_MakeAvailable(argparse)
FetchContent_Declare(
magic_enum
GIT_REPOSITORY https://github.com/neargye/magic_enum.git
)
FetchContent_MakeAvailable(magic_enum)
FetchContent_Declare(
picosha2
GIT_REPOSITORY https://github.com/okdshin/PicoSHA2
GIT_TAG v1.0.1
)
FetchContent_MakeAvailable(picosha2)
else()
# This is a hack becase picosha2 does not define an install phase in CMakefile.
add_library(picosha2 INTERFACE)
target_include_directories(picosha2 INTERFACE
${CMAKE_PREFIX_PATH}/include
)
endif()
add_subdirectory(lib/embeddedpp)
add_subdirectory(lib/ftdi)
add_subdirectory(lib/flash)
add_subdirectory(lib/visuals)
add_executable(ftditool app/main.cc)
target_include_directories(ftditool PUBLIC "./src/lib" "./src/")
target_link_libraries(ftditool PRIVATE visuals picosha2 argparse::argparse flash ftdipp)
install(TARGETS ftditool DESTINATION bin)