Adding install for working with yocto
This commit is contained in:
parent
92c42d5675
commit
71f4eb2c71
|
|
@ -1,12 +1,12 @@
|
|||
cmake_minimum_required(VERSION 3.0)
|
||||
project(EnvironmentSensor)
|
||||
project(environmentsensor)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
|
||||
find_library(I2C_LIBRARY NAMES i2c REQUIRED)
|
||||
find_path(I2C_INCLUDE_DIR NAMES linux/i2c-dev.h REQUIRED)
|
||||
|
||||
add_executable(EnvironmentSensor main.cpp
|
||||
add_executable(environmentsensor main.cpp
|
||||
bme68x.c
|
||||
bme68x.c
|
||||
common.c
|
||||
|
|
@ -16,9 +16,11 @@ if(I2C_LIBRARY AND I2C_INCLUDE_DIR)
|
|||
message(STATUS "Found I2C library: ${I2C_LIBRARY}")
|
||||
message(STATUS "Found I2C include directory: ${I2C_INCLUDE_DIR}")
|
||||
# Add to your target
|
||||
target_link_libraries(EnvironmentSensor PRIVATE ${I2C_LIBRARY})
|
||||
target_include_directories(EnvironmentSensor PRIVATE ${I2C_INCLUDE_DIR})
|
||||
target_link_libraries(environmentsensor PRIVATE ${I2C_LIBRARY})
|
||||
target_include_directories(environmentsensor PRIVATE ${I2C_INCLUDE_DIR})
|
||||
else()
|
||||
message(FATAL_ERROR "Could not find I2C library or include directory.")
|
||||
endif()
|
||||
|
||||
install(TARGETS environmentsensor
|
||||
RUNTIME DESTINATION bin)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user