-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (32 loc) · 1.34 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
cmake_minimum_required(VERSION 3.22)
include(ERBuild NO_POLICY_SCOPE)
set(picprogrammer_ver 0.3.0)
project(picprogrammer VERSION ${picprogrammer_ver} DESCRIPTION "This project can be used to program the onboard PIC microcontroller")
set(CMAKE_COMPILE_WARNING_AS_ERROR ON)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
ER_DEPS()
ER_ADD_EXECUTABLE(picprogrammer SOURCES src/main.cpp src/prog_utils.cpp )
find_package(fmt REQUIRED)
find_package(Catch2 REQUIRED)
# fetch latest argparse
include(FetchContent)
FetchContent_Declare(
argparse
GIT_REPOSITORY https://github.com/p-ranav/argparse.git
)
FetchContent_MakeAvailable(argparse)
add_subdirectory(igpio)
add_subdirectory(icsp)
add_subdirectory(mockgpio)
add_subdirectory(pigpio)
target_link_libraries(picprogrammer fmt::fmt argparse )
target_include_directories(picprogrammer PRIVATE include)
target_compile_definitions(picprogrammer PRIVATE -DPICPROG_VER="${picprogrammer_ver}" FMT_HEADER_ONLY)
add_executable(icsp_test test/test_ICSP.cpp test/test_utils.cpp test/test_intelhex.cpp test/test_PICProgrammer.cpp test/test_mockimpl.cpp)
target_link_libraries(icsp_test PRIVATE Catch2::Catch2WithMain mockgpio icsp fmt::fmt)
target_compile_definitions(icsp_test PRIVATE FMT_HEADER_ONLY)
ER_ENABLE_TEST()
add_test(test_icsp icsp_test )
ER_PACK()