-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
44 lines (39 loc) · 1.29 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
cmake_minimum_required(VERSION 3.10)
project(fpgalink)
# Platform-specific settings
if(MSVC)
set(CMAKE_INSTALL_BINDIR bin)
set(CMAKE_INSTALL_LIBDIR bin)
add_compile_options(/W4 /WX /DBYTE_ORDER=1234 /D_CRT_SECURE_NO_WARNINGS)
elseif (MINGW)
set(CMAKE_INSTALL_BINDIR bin)
set(CMAKE_INSTALL_LIBDIR bin)
add_compile_options(-Wall -Wextra -pedantic -Werror -DBYTE_ORDER=1234 -DWIN32 -D_WIN32)
else()
include(GNUInstallDirs)
add_compile_options(-Wall -Wextra -pedantic -Werror -DBYTE_ORDER=1234)
endif()
# Set output directories
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
# Use C++17 and C99
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")