2024-08-15 22:20:51 +08:00
|
|
|
# Create static library
|
|
|
|
add_library(LibCmo STATIC "")
|
|
|
|
# Setup static library sources
|
|
|
|
target_sources(LibCmo
|
|
|
|
PRIVATE
|
|
|
|
# Assistant source files
|
2023-08-31 10:20:10 +08:00
|
|
|
VTEncoding.cpp
|
2023-09-24 23:27:20 +08:00
|
|
|
VTImage.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# CK2
|
2023-09-24 23:27:20 +08:00
|
|
|
CK2/CKBitmapData.cpp
|
2023-08-31 10:20:10 +08:00
|
|
|
CK2/CKContext.cpp
|
|
|
|
CK2/CKFileOthers.cpp
|
|
|
|
CK2/CKFileReader.cpp
|
|
|
|
CK2/CKFileWriter.cpp
|
|
|
|
CK2/CKGlobals.cpp
|
2023-09-24 23:27:20 +08:00
|
|
|
CK2/CKStateChunkOthers.cpp
|
|
|
|
CK2/CKStateChunkReader.cpp
|
|
|
|
CK2/CKStateChunkWriter.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# CK2 Data Handler
|
2023-09-24 23:27:20 +08:00
|
|
|
CK2/DataHandlers/CKBitmapHandler.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# CK2 Manager
|
2023-08-31 10:20:10 +08:00
|
|
|
CK2/MgrImpls/CKBaseManager.cpp
|
2023-09-24 23:27:20 +08:00
|
|
|
CK2/MgrImpls/CKObjectManager.cpp
|
|
|
|
CK2/MgrImpls/CKPathManager.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# CK2 Object
|
2023-09-24 23:27:20 +08:00
|
|
|
CK2/ObjImpls/CK3dEntity.cpp
|
|
|
|
CK2/ObjImpls/CKBeObject.cpp
|
|
|
|
CK2/ObjImpls/CKGroup.cpp
|
|
|
|
CK2/ObjImpls/CKMaterial.cpp
|
|
|
|
CK2/ObjImpls/CKMesh.cpp
|
2023-08-31 10:20:10 +08:00
|
|
|
CK2/ObjImpls/CKObject.cpp
|
2023-09-24 23:27:20 +08:00
|
|
|
CK2/ObjImpls/CKTexture.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# VxMath
|
2023-08-31 10:20:10 +08:00
|
|
|
VxMath/VxMemoryMappedFile.cpp
|
2023-09-24 23:27:20 +08:00
|
|
|
VxMath/VxMath.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# X Container
|
2023-09-24 23:27:20 +08:00
|
|
|
XContainer/XTypes.cpp
|
2023-03-01 10:48:50 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup static library headers
|
|
|
|
target_sources(LibCmo
|
|
|
|
PUBLIC
|
|
|
|
FILE_SET HEADERS
|
|
|
|
FILES
|
|
|
|
# Asststant header files
|
2024-08-17 20:43:27 +08:00
|
|
|
VTInternal.hpp
|
2024-08-15 22:20:51 +08:00
|
|
|
VTEncoding.hpp
|
|
|
|
VTUtils.hpp
|
2024-08-17 20:43:27 +08:00
|
|
|
VTAll.hpp
|
2024-08-15 22:20:51 +08:00
|
|
|
# CK2
|
|
|
|
CK2/CKDefines.hpp
|
|
|
|
CK2/CKEnums.hpp
|
|
|
|
CK2/CKGlobals.hpp
|
|
|
|
CK2/CKIdentifiers.hpp
|
|
|
|
CK2/CKTypes.hpp
|
|
|
|
CK2/CKBitmapData.hpp
|
|
|
|
CK2/CKContext.hpp
|
|
|
|
CK2/CKFile.hpp
|
|
|
|
CK2/CKStateChunk.hpp
|
|
|
|
# CK2 Data Handler
|
|
|
|
CK2/DataHandlers/CKBitmapHandler.hpp
|
|
|
|
# CK2 Manager
|
|
|
|
CK2/MgrImpls/CKBaseManager.hpp
|
|
|
|
CK2/MgrImpls/CKObjectManager.hpp
|
|
|
|
CK2/MgrImpls/CKPathManager.hpp
|
|
|
|
# CK2 Object
|
|
|
|
CK2/ObjImpls/CK3dEntity.hpp
|
|
|
|
CK2/ObjImpls/CKBeObject.hpp
|
|
|
|
CK2/ObjImpls/CKGroup.hpp
|
|
|
|
CK2/ObjImpls/CKMaterial.hpp
|
|
|
|
CK2/ObjImpls/CKMesh.hpp
|
|
|
|
CK2/ObjImpls/CKObject.hpp
|
|
|
|
CK2/ObjImpls/CKTexture.hpp
|
|
|
|
CK2/ObjImpls/CK3dObject.hpp
|
|
|
|
CK2/ObjImpls/CKRenderObject.hpp
|
|
|
|
CK2/ObjImpls/CKSceneObject.hpp
|
|
|
|
# VxMath
|
|
|
|
VxMath/VxTypes.hpp
|
|
|
|
VxMath/VxMath.hpp
|
|
|
|
VxMath/VxEnums.hpp
|
|
|
|
VxMath/VxMemoryMappedFile.hpp
|
|
|
|
# X Container
|
|
|
|
XContainer/XTypes.hpp
|
2023-03-01 10:48:50 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup include infomation
|
2023-03-01 10:48:50 +08:00
|
|
|
target_include_directories(LibCmo
|
|
|
|
PUBLIC
|
2024-08-15 22:20:51 +08:00
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
|
|
|
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
2023-03-01 10:48:50 +08:00
|
|
|
PRIVATE
|
2024-08-17 23:29:08 +08:00
|
|
|
YYCC::YYCCommonplace
|
2024-08-15 22:20:51 +08:00
|
|
|
ZLIB::ZLIB
|
|
|
|
stb::stb-image
|
|
|
|
$<$<NOT:$<BOOL:${WIN32}>>:Iconv::Iconv>
|
2023-03-01 10:48:50 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup linked library infomation
|
|
|
|
target_link_libraries(LibCmo
|
|
|
|
PRIVATE
|
|
|
|
YYCC::YYCCommonplace
|
|
|
|
ZLIB::ZLIB
|
|
|
|
stb::stb-image
|
|
|
|
$<$<NOT:$<BOOL:${WIN32}>>:Iconv::Iconv>
|
|
|
|
)
|
|
|
|
# Setup C++ standard
|
2023-09-25 21:45:53 +08:00
|
|
|
set_target_properties(LibCmo
|
|
|
|
PROPERTIES
|
2024-08-15 22:20:51 +08:00
|
|
|
CXX_STANDARD 20
|
|
|
|
CXX_STANDARD_REQUIRED 20
|
|
|
|
CXX_EXTENSION OFF
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2023-09-24 23:27:20 +08:00
|
|
|
target_compile_definitions(LibCmo
|
2024-08-17 23:29:08 +08:00
|
|
|
# Expose LibCmo build type
|
2023-09-24 23:27:20 +08:00
|
|
|
PUBLIC
|
2024-08-15 22:20:51 +08:00
|
|
|
"$<$<CONFIG:Debug>:LIBCMO_BUILD_DEBUG>"
|
|
|
|
"$<$<CONFIG:Release,RelWithDebInfo,MinSize>:LIBCMO_BUILD_RELEASE>"
|
|
|
|
# Unicode charset for private using
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
|
|
|
)
|
|
|
|
target_compile_options(LibCmo
|
|
|
|
# Order build as UTF-8 in MSVC
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install binary and headers
|
|
|
|
install(TARGETS LibCmo
|
|
|
|
EXPORT LibCmoTargets
|
|
|
|
LIBRARY DESTINATION ${NEMO_INSTALL_LIB_PATH}
|
|
|
|
ARCHIVE DESTINATION ${NEMO_INSTALL_LIB_PATH}
|
|
|
|
INCLUDES DESTINATION ${NEMO_INSTALL_INCLUDE_PATH}
|
|
|
|
FILE_SET HEADERS DESTINATION ${NEMO_INSTALL_INCLUDE_PATH}
|
2023-09-24 23:27:20 +08:00
|
|
|
)
|