VirtoolsTranslation/NlpCodec/CMakeLists.txt

46 lines
937 B
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.23)
project(NlpCodec LANGUAGES CXX)
2023-06-26 22:00:10 +08:00
# Find ZLib packages
2023-06-26 22:00:10 +08:00
find_package(ZLIB REQUIRED)
# Build executable
add_executable(NlpCodec "")
# Setup sources file and no need to setup headers
target_sources(NlpCodec
PRIVATE
NlpCodec.cpp
)
# Link with ZLib
target_link_libraries(NlpCodec
2023-06-26 22:00:10 +08:00
PRIVATE
${ZLIB_LIBRARIES}
)
# Setup standard
set_target_properties(NlpCodec
PROPERTIES
CXX_STANDARD 20
CXX_STANDARD_REQUIRED 20
CXX_EXTENSION OFF
)
# Extra options for MSVC
# Unicode charset
target_compile_definitions(NlpCodec
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:UNICODE>
$<$<CXX_COMPILER_ID:MSVC>:_UNICODE>
)
# Order UTF-8 in both runtime and source environment
target_compile_options(NlpCodec
2023-06-26 22:00:10 +08:00
PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
2023-06-26 22:00:10 +08:00
)
# Install built artifact
include(GNUInstallDirs)
install(TARGETS NlpCodec
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)