1
0
mirror of https://github.com/QtExcel/QXlsx.git synced 2025-01-30 05:02:52 +08:00
QXlsx/QXlsx/CMakeLists.txt

53 lines
1.3 KiB
CMake
Raw Normal View History

# CMakeLists.txt for QXlsx Library
2021-02-11 21:19:27 +09:00
cmake_minimum_required(VERSION 3.14)
project(QXlsx LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
2021-02-11 21:19:27 +09:00
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
2021-02-11 21:19:27 +09:00
set(CMAKE_CXX_STANDARD 11)
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})
2021-02-11 21:19:27 +09:00
if(NOT DEFINED ${QXLSX_SOURCEPATH})
set(QXLSX_SOURCEPATH ${CMAKE_CURRENT_SOURCE_DIR}/../QXlsx/source/)
endif(NOT DEFINED ${QXLSX_SOURCEPATH})
2021-02-11 21:19:27 +09:00
message("Current Path of QXlsx")
message(${QXLSX_PARENTPATH})
message(${QXLSX_HEADERPATH})
message(${QXLSX_SOURCEPATH})
file(GLOB QXLSX_CPP "${QXLSX_SOURCEPATH}/*.cpp")
file(GLOB QXLSX_H "${QXLSX_HEADERPATH}/*.h")
2021-02-11 21:19:27 +09:00
set(SRC_FILES ${QXLSX_CPP})
list(APPEND SRC_FILES ${QXLSX_H})
add_library(QXlsx STATIC
${SRC_FILES} )
2021-02-11 21:19:27 +09:00
target_include_directories(QXlsx PRIVATE ${QXLSX_HEADERPATH})
target_link_libraries(${PROJECT_NAME}
Qt${QT_VERSION_MAJOR}::Core
Qt${QT_VERSION_MAJOR}::GuiPrivate
)
2021-02-11 21:19:27 +09:00
target_compile_definitions(QXlsx PRIVATE QXLSX_LIBRARY)