在win10系统上,帮我 写一个cmaklists文件,编译qxlsx的源文件
时间: 2023-07-16 08:14:49 浏览: 99
好的,以下是一个简单的CMakeLists.txt文件,用于编译qxlsx的源文件:
```
cmake_minimum_required(VERSION 3.5)
project(qxlsx)
set(CMAKE_CXX_STANDARD 11)
# Locate Qt5Core and Qt5Gui
find_package(Qt5Core REQUIRED)
find_package(Qt5Gui REQUIRED)
# Define the sources
set(SOURCES
src/qxlsxabstractooxmlfile.cpp
src/qxlsxcell.cpp
src/qxlsxcellrange.cpp
src/qxlsxchart.cpp
src/qxlsxchartsheet.cpp
src/qxlsxconditionalformatting.cpp
src/qxlsxdatavalidation.cpp
src/qxlsxdocument.cpp
src/qxlsxdrawing.cpp
src/qxlsxformat.cpp
src/qxlsxglobal.h
src/qxlsxrichstring.cpp
src/qxlsxworkbook.cpp
src/qxlsxworksheet.cpp
src/qxlsxzipwriter.cpp
)
# Define the headers
set(HEADERS
src/qxlsxabstractooxmlfile.h
src/qxlsxcell.h
src/qxlsxcellrange.h
src/qxlsxchart.h
src/qxlsxchartsheet.h
src/qxlsxconditionalformatting.h
src/qxlsxdatavalidation.h
src/qxlsxdocument.h
src/qxlsxdrawing.h
src/qxlsxformat.h
src/qxlsxrichstring.h
src/qxlsxworkbook.h
src/qxlsxworksheet.h
src/qxlsxzipwriter_p.h
src/qxlsxzipwriter.h
)
# Add the include directories
include_directories(include)
# Add the target
add_library(${PROJECT_NAME} SHARED ${SOURCES} ${HEADERS})
# Link the libraries
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Gui)
```
请注意,这个CMakeLists.txt文件可能需要根据你的项目结构和依赖库进行修改。此外,你还需要安装Qt5开发环境并将其配置到你的系统中,才能成功编译qxlsx。
阅读全文