-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (48 loc) · 2.14 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#############################################################################
# Name: CMakeListst.txt
# Purpose: Quneiform
# Author: Blake Madden
# Created: 2023-03-12
# Copyright: (c) 2025 Blake Madden
# Licence: 3-Clause BSD licence
#############################################################################
cmake_minimum_required(VERSION 3.12)
set(CMAKE_CXX_STANDARD 20)
project(quneiform)
if(CMAKE_COMPILER_IS_GNUCC)
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "12.2.1")
message(FATAL_ERROR "Insufficient GCC version")
endif()
endif()
add_compile_options("$<$<C_COMPILER_ID:MSVC>:/utf-8>")
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/utf-8>")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(default_build_type "Release")
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release")
endif()
set(FILES src/analyze.cpp src/main.cpp src/i18n_string_util.cpp src/i18n_review.cpp src/input.cpp
src/translation_catalog_review.cpp src/pseudo_translate.cpp
src/cpp_i18n_review.cpp src/csharp_i18n_review.cpp src/info_plist_review.cpp
src/po_file_review.cpp src/rc_file_review.cpp)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin)
add_executable(quneiform ${FILES})
# set up compiler flags
if(MSVC)
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE /Zc:__cplusplus /MP /W3 /WX
$<$<CONFIG:Debug>:/Od> $<$<CONFIG:Release>:/O2>)
else()
target_compile_options(${CMAKE_PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic -Wshadow -Werror
$<$<CONFIG:Debug>:-Og> $<$<CONFIG:Release>:-O2>)
endif()
if(UNIX AND NOT APPLE)
find_package(TBB)
if(TBB_FOUND)
message(STATUS "Intel Threading Building Blocks: ${TBB_VERSION}")
target_link_libraries(${CMAKE_PROJECT_NAME} TBB::tbb)
else()
target_link_libraries(${CMAKE_PROJECT_NAME})
endif()
endif()