mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-24 04:34:47 +08:00
It is unneeded to do it by target, using the globale property CMAKE_CXX_STANDARD instead. Also with CMAKE_CXX_STANDARD_REQUIRED, I make this a strong requirement. The documentation indeed states that the CXX_STANDARD "is treated as optional and may “decay” to a previous standard if the requested is not available". This means that uchardet will likely not be buildable with a compiler with no C++11 support. But I assume this is not a common situation, and probably we should not care about outdated compilers. I remain open to suggestions and disagreement on the topic obviously.
24 lines
286 B
CMake
24 lines
286 B
CMake
set(
|
|
UCHARDET_SOURCES
|
|
uchardet.cpp
|
|
)
|
|
|
|
set(UCHARDET_BINARY uchardet)
|
|
|
|
add_executable(
|
|
${UCHARDET_BINARY}
|
|
${UCHARDET_SOURCES}
|
|
)
|
|
|
|
target_link_libraries(
|
|
${UCHARDET_BINARY}
|
|
${UCHARDET_LIBRARY}
|
|
)
|
|
|
|
install(
|
|
TARGETS
|
|
${UCHARDET_BINARY}
|
|
RUNTIME DESTINATION
|
|
${CMAKE_INSTALL_BINDIR}
|
|
)
|