forked from ETLCPP/etl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
65 lines (56 loc) · 1.8 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
61
62
63
64
#######################################################################
# The Embedded Template Library (https://www.etlcpp.com/)
#######################################################################
cmake_minimum_required(VERSION 3.5.0)
project(etl)
#######################################################################
# Define an option to allow consumers of the library to
# specify the profile they would like to compile to. If
# not explicitly set CMake will attempt to choose an appropriate
# profile based on the compiler
#######################################################################
set(ETL_PROFILE "DEFAULT" CACHE STRING "Defines what profile header to include. See https://www.etlcpp.com/setup.html"
)
add_library(etl
src/binary.cpp
src/crc16_ccitt.cpp
src/crc16_kermit.cpp
src/crc32.cpp
src/crc64_ecma.cpp
src/crc8_ccitt.cpp
src/error_handler.cpp
src/pearson.cpp
src/random.cpp
src/private
src/private/pvoidvector.cpp
)
target_include_directories(etl
PUBLIC
include/etl/
include/etl/atomic
include/etl/profiles
PRIVATE
include/etl/private
)
if (${ETL_PROFILE} STREQUAL DEFAULT)
if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
set(ETL_PROFILE "PROFILE_GCC_GENERIC")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
set(ETL_PROFILE "PROFILE_MSVC")
elseif (CMAKE_CXX_COMPILER_ID MATCHES "ARMCC")
if (CXX_STANDARD EQUAL 11)
set(ETL_PROFILE "PROFILE_ARMV6")
else ()
set(ETL_PROFILE "PROFILE_ARMV5")
endif()
elseif (CMAKE_CXX_COMPILER_ID MATCHES "TI")
set(ETL_PROFILE "PROFILE_TICC")
else()
message(FATAL_ERROR "Can't generate default profile for compiler: ${CMAKE_CXX_COMPILER_ID}")
endif()
endif()
message(STATUS "Compiling with ETL profile set to: ${ETL_PROFILE}")
target_compile_definitions(etl
PUBLIC
${ETL_PROFILE}
)