forked from makestuff/fpgalink
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (33 loc) · 1.1 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
cmake_minimum_required(VERSION 3.10)
project(cmake-test)
# Use a single output directory for everything
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# Turn warning level up, use C++17 and C99
if(MSVC)
add_compile_options(/W4 /WX /DBYTE_ORDER=1234 /D_CRT_SECURE_NO_WARNINGS)
elseif (MINGW)
add_compile_options(-Wall -Wextra -pedantic -Werror -DBYTE_ORDER=1234 -DWIN32 -D_WIN32)
else()
add_compile_options(-Wall -Wextra -pedantic -Werror -DBYTE_ORDER=1234)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_EXTENSIONS 0)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_EXTENSIONS 0)
# Maybe build GoogleTest
if(BUILD_TESTING)
include(CTest)
set(GOOGLETEST_VERSION 1.10.0)
add_subdirectory("googletest/googlemock")
endif()
# Build components
add_subdirectory("common")
add_subdirectory("libargtable2")
add_subdirectory("liberror")
add_subdirectory("libdump")
add_subdirectory("libusbwrap")
add_subdirectory("libbuffer")
add_subdirectory("libfx2loader")
add_subdirectory("libfpgalink")