1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-16 04:42:53 +08:00

Update docs

This commit is contained in:
Alexey Sokolov 2022-10-15 14:29:30 +01:00 committed by Daniel Nicoletti
parent ab2a4e1346
commit 6899b68adb
5 changed files with 23 additions and 116 deletions

View File

@ -9,75 +9,16 @@ project(HelloWorld LANGUAGES CXX)
# TODO: Set Your C++ version
set(CMAKE_CXX_STANDARD 11) # C++ 11
##########################
# bolier-plate code (1) {{
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Gui REQUIRED)
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Gui REQUIRED)
if(NOT DEFINED ${QXLSX_PARENTPATH})
set(QXLSX_PARENTPATH ${CMAKE_CURRENT_SOURCE_DIR}/../)
endif(NOT DEFINED ${QXLSX_PARENTPATH})
if(NOT DEFINED ${QXLSX_HEADERPATH})
set(QXLSX_HEADERPATH ${CMAKE_CURRENT_SOURCE_DIR}/../QXlsx/header/)
endif(NOT DEFINED ${QXLSX_HEADERPATH})
if(NOT DEFINED ${QXLSX_SOURCEPATH})
set(QXLSX_SOURCEPATH ${CMAKE_CURRENT_SOURCE_DIR}/../QXlsx/source/)
endif(NOT DEFINED ${QXLSX_SOURCEPATH})
message("Current Path of QXlsx")
message(${QXLSX_PARENTPATH})
message(${QXLSX_HEADERPATH})
message(${QXLSX_SOURCEPATH})
include_directories(${QXLSX_HEADERPATH})
file(GLOB QXLSX_CPP "${QXLSX_SOURCEPATH}/*.cpp")
file(GLOB QXLSX_H "${QXLSX_HEADERPATH}/*.h")
set(SRC_FILES ${QXLSX_CPP})
list(APPEND SRC_FILES ${QXLSX_H})
# bolier-plate code (1) }}
###########################
add_subdirectory(QXlsx)
#########################
# Console Application {{
# TODO: set your source code
set(APP_SRC_FILES
main.cpp)
list(APPEND SRC_FILES ${APP_SRC_FILES})
add_executable(${PROJECT_NAME} ${SRC_FILES})
add_executable(HelloWorld main.cpp)
target_link_libraries(HelloWorld PRIVATE QXlsx::QXlsx)
# Console Application }}
########################
##########################
# bolier-plate code (2) {{
target_include_directories(${PROJECT_NAME} PRIVATE
${QXLSX_HEADERPATH}
${CMAKE_CURRENT_SOURCE_DIR} )
target_link_libraries(${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::GuiPrivate
)
set(CMAKE_WIN32_EXECUTABLE OFF)
# bolier-plate code (2) }}
##########################

1
HelloWorld/QXlsx Symbolic link
View File

@ -0,0 +1 @@
../QXlsx

View File

@ -2,68 +2,32 @@
> *Read this in other languages: [English](HowToSetProject-cmake.md), :kr: [한국어](HowToSetProject-cmake.ko.md)*
- Enter the command as shown below.
### To install QXlsx
:one: Using MingW
Enter the command as shown below.
- QXlsx library
```
```sh
mkdir build
cd build
cmake -G "MinGW Makefiles" ..\QXlsx\
mingw32-make
cmake ../QXlsx/ -DCMAKE_INSTALL_PREFIX=... -DCMAKE_BUILD_TYPE=Release
cmake --build .
cmake --install .
```
- HelloWorld
### To use in your application
```
mkdir build2
cd build2
cmake -G "MinGW Makefiles" ..\HelloWorld\
mingw32-make
In your CMakeLists.txt:
```cmake
find_package(QXlsxQt5 REQUIRED) # or QXlsxQt6
target_link_libraries(myapp PRIVATE QXlsx::QXlsx)
```
:two: Using Visual Studio
### To use in your application without installation
- QXlsx library (Release Build)
In your CMakeLists.txt:
```cmake
add_subdirectory(QXlsx)
target_link_libraries(myapp PRIVATE QXlsx::QXlsx)
```
mkdir build
cd build
cmake -G "Visual Studio 16 2019" ..\QXlsx\
MSBuild /nologo /t:Build /p:Configuration=Release QXlsx.vcxproj
```
- HelloWorld (Release Build)
```
mkdir build2
cd build2
cmake -G "Visual Studio 16 2019" ..\HelloWorld\
MSBuild /nologo /t:Build /p:Configuration=Release HelloWorld.vcxproj
```
- Or, You may open *.sln/*.vcxproj files in Visual Studio IDE.
:three: Using Linux/Mac/Unix
- QXlsx library
```
mkdir build
cd build
cmake -G "Unix Makefiles" ../QXlsx/
make
```
- HelloWorld
```
mkdir build2
cd build2
cmake -G "Unix Makefiles" ../HelloWorld/
make
```

View File

@ -4,6 +4,7 @@
> *Read this in other languages: [English](HowToSetProject.md), :kr: [한국어](HowToSetProject.ko.md)*
- Here's an easy way to apply QXlsx.
- This works only with qmake, for cmake look at [the other doc](HowToSetProject-cmake.md).
- Describes when to apply to Windows.
- The method of applying it on Linux or Mac is similar, and I will write help if there is an additional request.
- * Hi! I'm j2doll. My native language is not English and my English is not fluent. Please understand. :-)

View File

@ -17,7 +17,7 @@
## How to set up (Installation)
- :Recommended: See [how to setup QXlsx project (qmake)](HowToSetProject.md)
- See [how to setup QXlsx project (qmake)](HowToSetProject.md)
- See [how to setup QXlsx project (cmake)](HowToSetProject-cmake.md)
## Tested environment