2024-05-29 23:11:52 +08:00
|
|
|
# Create executable testbench
|
2024-06-06 13:16:55 +08:00
|
|
|
add_executable(YYCCTestbench "")
|
2024-06-03 14:24:05 +08:00
|
|
|
# Setup testbench sources
|
2024-06-06 13:16:55 +08:00
|
|
|
target_sources(YYCCTestbench
|
2024-06-03 14:24:05 +08:00
|
|
|
PRIVATE
|
|
|
|
${CMAKE_CURRENT_LIST_DIR}/main.cpp
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
|
|
|
# Add YYCC as its library
|
2024-06-06 13:16:55 +08:00
|
|
|
target_include_directories(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
2024-05-30 16:22:03 +08:00
|
|
|
YYCCommonplace
|
2024-05-29 23:11:52 +08:00
|
|
|
)
|
2024-06-06 13:16:55 +08:00
|
|
|
target_link_libraries(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
|
|
|
YYCCommonplace
|
|
|
|
)
|
|
|
|
# Setup C++ standard
|
2024-06-06 13:16:55 +08:00
|
|
|
set_target_properties(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PROPERTIES
|
|
|
|
CXX_STANDARD 17
|
|
|
|
CXX_STANDARD_REQUIRED 17
|
|
|
|
CXX_EXTENSION OFF
|
|
|
|
)
|
2024-06-09 21:34:28 +08:00
|
|
|
# Order Unicode charset for private using
|
|
|
|
target_compile_definitions(YYCCTestbench
|
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
|
|
|
)
|
2024-05-29 23:11:52 +08:00
|
|
|
# Order build as UTF-8 in MSVC
|
2024-06-06 13:16:55 +08:00
|
|
|
target_compile_options(YYCCTestbench
|
2024-05-29 23:11:52 +08:00
|
|
|
PRIVATE
|
|
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
|
|
)
|
2024-06-03 14:24:05 +08:00
|
|
|
|
|
|
|
# Install binary
|
2024-06-06 13:16:55 +08:00
|
|
|
install(TARGETS YYCCTestbench
|
|
|
|
EXPORT YYCCTestbenchTargets
|
2024-06-03 14:24:05 +08:00
|
|
|
LIBRARY DESTINATION lib
|
|
|
|
ARCHIVE DESTINATION lib
|
|
|
|
RUNTIME DESTINATION bin
|
|
|
|
INCLUDES DESTINATION include
|
|
|
|
)
|