1 Star 0 Fork 0

梅花三弄再回首/smbus-cpp

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
梅花三弄再回首 提交于 2024-10-10 00:59 . 提交了代码文件
# 文心一言生成的,我实在是没有精力写这些东西了
# 啊啊啊啊 啊啊啊啊啊
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)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/PlumBlossomMaid/smbus-cpp.git
git@gitee.com:PlumBlossomMaid/smbus-cpp.git
PlumBlossomMaid
smbus-cpp
smbus-cpp
master

搜索帮助