chore: update cmake build scripts

- update cmake build scripts
- the install part of build scripts may still have issues.
This commit is contained in:
2024-06-03 14:24:05 +08:00
parent 67bd445885
commit 642db411f5
4 changed files with 108 additions and 20 deletions

View File

@ -1,6 +1,9 @@
# Create executable testbench
add_executable(Testbench
main.cpp
add_executable(Testbench "")
# Setup testbench sources
target_sources(Testbench
PRIVATE
${CMAKE_CURRENT_LIST_DIR}/main.cpp
)
# Add YYCC as its library
target_include_directories(Testbench
@ -23,3 +26,12 @@ target_compile_options(Testbench
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
)
# Install binary
install(TARGETS Testbench
EXPORT TestbenchTargets
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
RUNTIME DESTINATION bin
INCLUDES DESTINATION include
)