2024-08-15 22:20:51 +08:00
|
|
|
# Create shared library
|
|
|
|
add_library(BMap SHARED "")
|
|
|
|
# Setup sources
|
|
|
|
target_sources(BMap
|
|
|
|
PRIVATE
|
2023-09-25 21:45:53 +08:00
|
|
|
BMap.cpp
|
2024-08-15 22:20:51 +08:00
|
|
|
BMExports.cpp
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup headers
|
|
|
|
target_sources(BMap
|
2023-09-25 21:45:53 +08:00
|
|
|
PRIVATE
|
2024-08-15 22:20:51 +08:00
|
|
|
FILE_SET HEADERS
|
|
|
|
FILES
|
|
|
|
BMap.hpp
|
|
|
|
BMExports.hpp
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup header infomation
|
2023-09-25 21:45:53 +08:00
|
|
|
target_include_directories(BMap
|
|
|
|
PRIVATE
|
2024-08-15 22:20:51 +08:00
|
|
|
"${CMAKE_CURRENT_LIST_DIR}"
|
|
|
|
YYCC::YYCCommonplace
|
|
|
|
LibCmo
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup linked library infomation
|
|
|
|
target_link_libraries(BMap
|
|
|
|
PRIVATE
|
|
|
|
YYCC::YYCCommonplace
|
|
|
|
LibCmo
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
2024-08-15 22:20:51 +08:00
|
|
|
# Setup C++ standard
|
2023-09-25 21:45:53 +08:00
|
|
|
set_target_properties(BMap
|
|
|
|
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
|
|
|
)
|
2024-08-16 22:07:23 +08:00
|
|
|
# Setup project macros
|
2023-09-25 21:45:53 +08:00
|
|
|
target_compile_definitions(BMap
|
2024-08-16 22:07:23 +08:00
|
|
|
# Enable export macro
|
|
|
|
PRIVATE
|
|
|
|
BMAP_EXPORTING
|
|
|
|
# Order Unicode charset for private using
|
2024-08-15 22:20:51 +08:00
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
|
|
|
)
|
|
|
|
# Order build as UTF-8 in MSVC
|
|
|
|
target_compile_options(BMap
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
2023-09-25 21:45:53 +08:00
|
|
|
)
|
|
|
|
|
2024-08-15 22:20:51 +08:00
|
|
|
# Install BMap only on Release mode
|
|
|
|
install(TARGETS BMap
|
|
|
|
CONFIGURATIONS Release
|
|
|
|
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
|
|
|
|
)
|