Spaces:
Sleeping
Sleeping
Download app_cpppy/CMakeLists.txt from bitterapricot/xtools: direct link, hf CLI and curl.
- Browser
- Download file 551 Bytes
-
https://huggingface.co/spaces/bitterapricot/xtools/resolve/main/app_cpppy/CMakeLists.txt
- Command line
-
hf download hf://spaces/bitterapricot/xtools/app_cpppy/CMakeLists.txt
-
curl -L -o CMakeLists.txt https://huggingface.co/spaces/bitterapricot/xtools/resolve/main/app_cpppy/CMakeLists.txt
551 Bytes
| cmake_minimum_required(VERSION 3.10) | |
| project(cpp_extension) | |
| # 查找 Python | |
| find_package(Python3 COMPONENTS Development REQUIRED) | |
| # 添加 pybind11 | |
| add_subdirectory(pybind11) | |
| pybind11_add_module(cpp_extension cpp_module.cpp) | |
| # 设置编译选项 | |
| set_target_properties(cpp_extension PROPERTIES | |
| CXX_STANDARD 11 | |
| CXX_STANDARD_REQUIRED ON | |
| POSITION_INDEPENDENT_CODE ON | |
| ) | |
| # 链接库 | |
| target_link_libraries(cpp_extension PRIVATE pybind11::module) | |
| # 安装目标 | |
| install(TARGETS cpp_extension | |
| LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | |
| ) | |