2024-05-29 23:11:52 +08:00
|
|
|
# Create static library
|
2024-06-03 14:24:05 +08:00
|
|
|
add_library(YYCCommonplace STATIC "")
|
|
|
|
# Setup static library sources
|
|
|
|
target_sources(YYCCommonplace
|
|
|
|
PRIVATE
|
2024-06-15 21:53:45 +08:00
|
|
|
# Sources
|
2024-06-17 12:46:32 +08:00
|
|
|
COMHelper.cpp
|
2024-07-28 22:42:16 +08:00
|
|
|
ArgParser.cpp
|
2024-07-02 10:52:24 +08:00
|
|
|
ConfigManager.cpp
|
2024-06-15 21:53:45 +08:00
|
|
|
ConsoleHelper.cpp
|
|
|
|
DialogHelper.cpp
|
|
|
|
EncodingHelper.cpp
|
|
|
|
ExceptionHelper.cpp
|
2024-08-13 09:38:12 +08:00
|
|
|
StdPatch.cpp
|
2024-06-15 21:53:45 +08:00
|
|
|
IOHelper.cpp
|
|
|
|
StringHelper.cpp
|
|
|
|
WinFctHelper.cpp
|
2024-07-15 22:47:49 +08:00
|
|
|
# Natvis (only for MSVC)
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:YYCC.natvis>
|
2024-06-15 21:53:45 +08:00
|
|
|
)
|
|
|
|
target_sources(YYCCommonplace
|
|
|
|
PUBLIC
|
|
|
|
FILE_SET HEADERS
|
|
|
|
FILES
|
2024-06-03 14:24:05 +08:00
|
|
|
# Headers
|
|
|
|
# Common headers
|
2024-07-28 22:42:16 +08:00
|
|
|
Constraints.hpp
|
2024-06-17 12:46:32 +08:00
|
|
|
COMHelper.hpp
|
2024-07-28 22:42:16 +08:00
|
|
|
ArgParser.hpp
|
2024-07-02 10:52:24 +08:00
|
|
|
ConfigManager.hpp
|
2024-06-15 21:53:45 +08:00
|
|
|
ConsoleHelper.hpp
|
|
|
|
DialogHelper.hpp
|
|
|
|
EncodingHelper.hpp
|
2024-11-02 17:10:55 +08:00
|
|
|
EnumHelper.hpp
|
2024-06-15 21:53:45 +08:00
|
|
|
ExceptionHelper.hpp
|
2024-08-13 09:38:12 +08:00
|
|
|
StdPatch.hpp
|
2024-06-15 21:53:45 +08:00
|
|
|
IOHelper.hpp
|
|
|
|
ParserHelper.hpp
|
|
|
|
StringHelper.hpp
|
|
|
|
WinFctHelper.hpp
|
2024-06-03 14:24:05 +08:00
|
|
|
# Windows including guard pair
|
2024-06-15 21:53:45 +08:00
|
|
|
WinImportPrefix.hpp
|
|
|
|
WinImportSuffix.hpp
|
2024-06-03 14:24:05 +08:00
|
|
|
# Misc
|
2024-06-15 21:53:45 +08:00
|
|
|
YYCCInternal.hpp
|
|
|
|
YYCCommonplace.hpp
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
|
|
|
# Setup header infomations
|
|
|
|
target_include_directories(YYCCommonplace
|
|
|
|
PUBLIC
|
2024-06-03 14:24:05 +08:00
|
|
|
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}>"
|
|
|
|
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
2024-06-17 15:10:45 +08:00
|
|
|
# Link with DbgHelp.lib on Windows
|
|
|
|
target_link_libraries(YYCCommonplace
|
|
|
|
PRIVATE
|
|
|
|
$<$<BOOL:${WIN32}>:DbgHelp.lib>
|
|
|
|
)
|
2024-05-29 23:11:52 +08:00
|
|
|
# Setup C++ standard
|
2024-08-26 11:58:20 +08:00
|
|
|
target_compile_features(YYCCommonplace PUBLIC cxx_std_17)
|
|
|
|
set_target_properties(YYCCommonplace PROPERTIES CXX_EXTENSION OFF)
|
|
|
|
# Setup macros
|
2024-05-29 23:11:52 +08:00
|
|
|
target_compile_definitions(YYCCommonplace
|
2024-07-31 20:32:11 +08:00
|
|
|
# Debug macro should populate to child projects
|
|
|
|
PUBLIC
|
|
|
|
$<$<BOOL:${YYCC_DEBUG_UE_FILTER}>:YYCC_DEBUG_UE_FILTER>
|
|
|
|
# Unicode charset for private using
|
2024-06-09 21:34:28 +08:00
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
|
|
|
target_compile_options(YYCCommonplace
|
2024-08-13 09:38:12 +08:00
|
|
|
# Order build as UTF-8 in MSVC
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
|
|
)
|
2024-06-03 14:24:05 +08:00
|
|
|
|
2024-06-20 15:47:15 +08:00
|
|
|
# Install binary and headers
|
2024-06-03 14:24:05 +08:00
|
|
|
install(TARGETS YYCCommonplace
|
|
|
|
EXPORT YYCCommonplaceTargets
|
2024-07-22 13:56:00 +08:00
|
|
|
LIBRARY DESTINATION ${YYCC_INSTALL_LIB_PATH}
|
|
|
|
ARCHIVE DESTINATION ${YYCC_INSTALL_LIB_PATH}
|
|
|
|
INCLUDES DESTINATION ${YYCC_INSTALL_INCLUDE_PATH}
|
|
|
|
FILE_SET HEADERS DESTINATION ${YYCC_INSTALL_INCLUDE_PATH}
|
2024-06-03 14:24:05 +08:00
|
|
|
)
|