-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CMake; Spaces to tabs; Fix build with Qt 6; Default to x86_64 but det…
…ect arm64 (drop 32bit support)
- Loading branch information
1 parent
5ea713b
commit dd90379
Showing
15 changed files
with
396 additions
and
364 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
IndentWidth: 4 | ||
TabWidth: 4 | ||
UseTab: ForIndentation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# http://editorconfig.org/ | ||
root = yes | ||
# https://editorconfig.org/ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
2015 Tino Didriksen <mail@tinodidriksen.com> | ||
2015-2023 Tino Didriksen <mail@tinodidriksen.com> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
cmake_minimum_required(VERSION 3.11 FATAL_ERROR) | ||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}) | ||
project(apertium-simpleton | ||
VERSION 0.2.0 | ||
LANGUAGES CXX | ||
) | ||
|
||
# Release or Debug | ||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE "Release") | ||
endif() | ||
|
||
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) | ||
set(CMAKE_POSITION_INDEPENDENT_CODE ON) | ||
set(CMAKE_MACOSX_RPATH ON) | ||
|
||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
|
||
include(GNUInstallDirs) | ||
|
||
if(MSVC) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /utf-8 /std:c++latest /Zc:__cplusplus /permissive- /W4 /MP") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2") | ||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LTCG") | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-deprecated") | ||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g3") | ||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG") | ||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -s") | ||
|
||
include(CheckCXXCompilerFlag) | ||
|
||
# Require latest possible C++ standard | ||
foreach(flag "-std=c++23" "-std=c++2b" "-std=c++20" "-std=c++2a" "-std=c++17") | ||
string(REGEX REPLACE "[^a-z0-9]" "-" _flag ${flag}) | ||
CHECK_CXX_COMPILER_FLAG(${flag} COMPILER_SUPPORTS_${_flag}) | ||
if(COMPILER_SUPPORTS_${_flag}) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}") | ||
set(_ENABLED_CXX ${flag}) | ||
break() | ||
endif() | ||
endforeach() | ||
if(NOT _ENABLED_CXX) | ||
message(FATAL_ERROR "Could not enable at least C++17 - upgrade your compiler") | ||
endif() | ||
endif() | ||
|
||
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/CMake" ${CMAKE_MODULE_PATH}) | ||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
|
||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets Network) | ||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets Network) | ||
set(QT_LIBS Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network) | ||
|
||
if(QT_VERSION_MAJOR GREATER_EQUAL 6) | ||
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Core5Compat) | ||
set(QT_LIBS ${QT_LIBS} Qt${QT_VERSION_MAJOR}::Core5Compat) | ||
endif() | ||
|
||
add_definitions(-DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x051100) | ||
|
||
if(WIN32) | ||
add_definitions(-DUNICODE -D_UNICODE -D_SECURE_SCL=0 -D_ITERATOR_DEBUG_LEVEL=0 -D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -DVC_EXTRALEAN -DNOMINMAX) | ||
else() | ||
add_definitions(-D_POSIX_C_SOURCE=200112) | ||
endif() | ||
|
||
add_subdirectory(src) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
add_executable(apertium-simpleton | ||
common.hpp | ||
installer.cpp | ||
installer.hpp | ||
installer.ui | ||
main.cpp | ||
simpleton.cpp | ||
simpleton.hpp | ||
simpleton.ui | ||
) | ||
|
||
target_link_libraries(apertium-simpleton ${QT_LIBS}) | ||
|
||
install(TARGETS apertium-simpleton RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.