代码拉取完成,页面将自动刷新
# 文心一言生成的,我实在是没有精力写这些东西了
# 啊啊啊啊 啊啊啊啊啊
cmake_minimum_required(VERSION 3.10)
project(smbus-cpp)
# Set the C++ standard
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# Include directories
include_directories(${CMAKE_SOURCE_DIR})
# Source files for the library
set(SOURCE_FILES
SMBus.cpp
)
# Static library
add_library(smbus-cpp STATIC ${SOURCE_FILES})
target_link_libraries(smbus-cpp -li2c)
# Define an option with a default value of OFF
option(TEST "Enable compilation of PCF8591_test executable" OFF)
# Conditional compilation of PCF8591_test executable
if(TEST)
# Source file for the test executable
set(TEST_SOURCE_FILES
PCF8591_test.cpp
)
# Test executable
add_executable(PCF8591_test ${TEST_SOURCE_FILES})
target_link_libraries(PCF8591_test smbus-cpp -li2c)
# Install rule for the test executable (optional)
# install(TARGETS PCF8591_test DESTINATION /usr/local/bin)
endif()
# Install rules for the library and header file
install(TARGETS smbus-cpp DESTINATION /usr/local/lib)
install(FILES SMBus.h DESTINATION /usr/local/include)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。