yyc12345
052fa7f4d1
- update CMake build script to make install statement is more legal. - add Windows-only build script for creating CMake used package and MSVC used package on Windows. - documentation will be added in the next commit.
41 lines
881 B
CMake
41 lines
881 B
CMake
# Create executable testbench
|
|
add_executable(YYCCTestbench "")
|
|
# Setup testbench sources
|
|
target_sources(YYCCTestbench
|
|
PRIVATE
|
|
main.cpp
|
|
)
|
|
# Add YYCC as its library
|
|
target_include_directories(YYCCTestbench
|
|
PRIVATE
|
|
YYCCommonplace
|
|
)
|
|
target_link_libraries(YYCCTestbench
|
|
PRIVATE
|
|
YYCCommonplace
|
|
)
|
|
# Setup C++ standard
|
|
set_target_properties(YYCCTestbench
|
|
PROPERTIES
|
|
CXX_STANDARD 17
|
|
CXX_STANDARD_REQUIRED 17
|
|
CXX_EXTENSION OFF
|
|
)
|
|
# Order Unicode charset for private using
|
|
target_compile_definitions(YYCCTestbench
|
|
PRIVATE
|
|
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
|
|
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
|
|
)
|
|
# Order build as UTF-8 in MSVC
|
|
target_compile_options(YYCCTestbench
|
|
PRIVATE
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
)
|
|
|
|
# Install testbench only on Release mode
|
|
install(TARGETS YYCCTestbench
|
|
CONFIGURATIONS Release
|
|
RUNTIME DESTINATION ${YYCC_INSTALL_BIN_PATH}
|
|
)
|