yyc12345
52ea2745dd
- move gitignore in individual directories. - change some directory layout. - refactor NlpCodec but not finished.
46 lines
937 B
CMake
46 lines
937 B
CMake
cmake_minimum_required(VERSION 3.23)
|
|
project(NlpCodec LANGUAGES CXX)
|
|
|
|
# Find ZLib packages
|
|
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
|
|
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
|
|
PRIVATE
|
|
$<$<CXX_COMPILER_ID:MSVC>:/utf-8>
|
|
)
|
|
|
|
# Install built artifact
|
|
include(GNUInstallDirs)
|
|
install(TARGETS NlpCodec
|
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
|
)
|
|
|