1c902230fe
* Bulk replaced tabs with spaces * Bulk removed trailing whitespace from lines * Replaced c-style comments with c++-style comments in file banners * Replace nested namespace definitions with single concise definitions (C++17), this keeps the indentation more manageable * Cleanup ordering and spacing of include directives * Bulk renaming of header file extensions from '.h' to '.hpp'. * Update CODING-STYLE.md * Update target_compile_features from cxx_std_11 to cxx_std_20. * Refresh .clang-format file. Still needs a lot of tweaking.
125 lines
2.3 KiB
CMake
125 lines
2.3 KiB
CMake
project (Model LANGUAGES CXX)
|
|
|
|
#=======================================
|
|
# Handle optional dependencies
|
|
#=======================================
|
|
if (${ZLIB_FOUND})
|
|
add_definitions (-DHAVE_ZLIB=1)
|
|
set (OPTIONAL_ZLIB ZLIB::ZLIB)
|
|
else ()
|
|
set (OPTIONAL_ZLIB "")
|
|
endif ()
|
|
|
|
#=======================================
|
|
# Sources
|
|
#=======================================
|
|
# Auto-generated files
|
|
configure_file (Version.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/Version.hpp @ONLY)
|
|
configure_file (Config.hpp.in ${CMAKE_CURRENT_BINARY_DIR}/Config.hpp @ONLY)
|
|
|
|
set (Model_sources
|
|
Category.cpp
|
|
ColorNode.cpp
|
|
DataCache.cpp
|
|
Db.cpp
|
|
Distance.cpp
|
|
FileUtil.cpp
|
|
Frame.cpp
|
|
FrameCd.cpp
|
|
FrameContinuous.cpp
|
|
FrameEllipse.cpp
|
|
FramePath.cpp
|
|
FrameRect.cpp
|
|
FrameRound.cpp
|
|
Handle.cpp
|
|
Layout.cpp
|
|
Markup.cpp
|
|
Model.cpp
|
|
ModelObject.cpp
|
|
ModelBarcodeObject.cpp
|
|
ModelBoxObject.cpp
|
|
ModelEllipseObject.cpp
|
|
ModelImageObject.cpp
|
|
ModelLineObject.cpp
|
|
ModelShapeObject.cpp
|
|
ModelTextObject.cpp
|
|
Outline.cpp
|
|
PageRenderer.cpp
|
|
Paper.cpp
|
|
ParserState.cpp
|
|
Point.cpp
|
|
RawText.cpp
|
|
Region.cpp
|
|
Settings.cpp
|
|
Size.cpp
|
|
StrUtil.cpp
|
|
SubstitutionField.cpp
|
|
Template.cpp
|
|
TextNode.cpp
|
|
Units.cpp
|
|
Variable.cpp
|
|
Variables.cpp
|
|
Version.cpp
|
|
Vendor.cpp
|
|
XmlCategoryParser.cpp
|
|
XmlLabelCreator.cpp
|
|
XmlLabelParser.cpp
|
|
XmlLabelParser_3.cpp
|
|
XmlPaperParser.cpp
|
|
XmlTemplateCreator.cpp
|
|
XmlTemplateParser.cpp
|
|
XmlUtil.cpp
|
|
XmlVendorParser.cpp
|
|
)
|
|
|
|
set (Model_qobject_headers
|
|
Model.hpp
|
|
ModelObject.hpp
|
|
ModelBarcodeObject.hpp
|
|
ModelBoxObject.hpp
|
|
ModelEllipseObject.hpp
|
|
ModelImageObject.hpp
|
|
ModelLineObject.hpp
|
|
ModelShapeObject.hpp
|
|
ModelTextObject.hpp
|
|
PageRenderer.hpp
|
|
Settings.hpp
|
|
Variables.hpp
|
|
)
|
|
|
|
qt6_wrap_cpp (Model_moc_sources ${Model_qobject_headers})
|
|
|
|
#=====================================
|
|
# Target
|
|
#=====================================
|
|
add_library (Model STATIC
|
|
${Model_sources}
|
|
${Model_moc_sources}
|
|
)
|
|
|
|
target_compile_features (Model
|
|
PUBLIC cxx_std_20
|
|
)
|
|
|
|
target_include_directories (Model
|
|
PUBLIC .. ${CMAKE_CURRENT_BINARY_DIR}/..
|
|
PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
|
|
)
|
|
|
|
target_link_libraries (Model
|
|
Barcode
|
|
Merge
|
|
Qt6::Core
|
|
Qt6::PrintSupport
|
|
Qt6::Xml
|
|
Qt6::Svg
|
|
${OPTIONAL_ZLIB}
|
|
)
|
|
|
|
#=======================================
|
|
# Subdirectories
|
|
#=======================================
|
|
add_subdirectory (unit_tests)
|
|
|
|
|