forked from sparkfun/SparkFun_ICM-20948_ArduinoLibrary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
executable file
·40 lines (31 loc) · 1.09 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
if(NOT DEFINED CMAKE_MINIMUM_REQUIRED_VERSION)
cmake_minimum_required(VERSION 3.7)
endif()
project(icm20948 VERSION 0.1.0 LANGUAGES CXX)
add_compile_options(-Wall -Wextra -fstack-protector)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/util/ ${CMAKE_CURRENT_SOURCE_DIR}/include)
link_directories(${CMAKE_CURRENT_SOURCE_DIR}/include/ ${CMAKE_CURRENT_SOURCE_DIR}/util/)
file (GLOB SRC
"src/*.cpp"
"util/*.cpp"
)
file (GLOB EG_SRC
"examples/main.cpp"
)
file (GLOB DMP_SRC
"examples/DMPtest.cpp"
)
add_library(${PROJECT_NAME} ${SRC} )
target_include_directories(${PROJECT_NAME}
PUBLIC
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}
)
# target_include_directories(${PROJECT_NAME} PUBLIC include/ )
target_link_libraries(${PROJECT_NAME} -li2c)
add_executable(${PROJECT_NAME}_example ${EG_SRC} )
target_link_libraries(${PROJECT_NAME}_example ${PROJECT_NAME} -li2c)
add_executable(${PROJECT_NAME}_DMP_example ${DMP_SRC} )
target_link_libraries(${PROJECT_NAME}_DMP_example ${PROJECT_NAME} -li2c)