mirror of https://github.com/Nheko-Reborn/nheko
parent
00549e0ec5
commit
3afc76dbaa
@ -0,0 +1,25 @@ |
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU") |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ |
||||
-Wall \ |
||||
-Wextra \ |
||||
-Werror \ |
||||
-pipe \ |
||||
-pedantic \ |
||||
-Wunreachable-code") |
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") |
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION) |
||||
|
||||
if (GCC_VERSION VERSION_GREATER 4.9) |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" ) |
||||
endif() |
||||
endif() |
||||
|
||||
if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fdiagnostics-color=always" ) |
||||
endif() |
||||
endif() |
||||
|
||||
if(NOT APPLE AND NOT MSVC) |
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") |
||||
endif() |
@ -0,0 +1,29 @@ |
||||
# |
||||
# Find the lmdb library & include dir. |
||||
# Build lmdb on Appveyor. |
||||
# |
||||
|
||||
if(APPVEYOR_BUILD) |
||||
set(LMDB_VERSION "LMDB_0.9.21") |
||||
set(NTDLIB "C:/WINDDK/7600.16385.1/lib/win7/amd64/ntdll.lib") |
||||
|
||||
execute_process( |
||||
COMMAND git clone --depth=1 --branch ${LMDB_VERSION} https://github.com/LMDB/lmdb) |
||||
|
||||
set(LMDB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/lmdb/libraries/liblmdb) |
||||
|
||||
add_library(lmdb |
||||
${CMAKE_SOURCE_DIR}/lmdb/libraries/liblmdb/lmdb.h |
||||
${CMAKE_SOURCE_DIR}/lmdb/libraries/liblmdb/mdb.c |
||||
${CMAKE_SOURCE_DIR}/lmdb/libraries/liblmdb/midl.h |
||||
${CMAKE_SOURCE_DIR}/lmdb/libraries/liblmdb/midl.c) |
||||
|
||||
set(LMDB_LIBRARY lmdb) |
||||
else() |
||||
find_path (LMDB_INCLUDE_DIR NAMES lmdb.h PATHS "$ENV{LMDB_DIR}/include") |
||||
find_library (LMDB_LIBRARY NAMES lmdb PATHS "$ENV{LMDB_DIR}/lib" ) |
||||
include(FindPackageHandleStandardArgs) |
||||
find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARY) |
||||
endif() |
||||
|
||||
include_directories(${LMDB_INCLUDE_DIR}) |
@ -0,0 +1,23 @@ |
||||
# |
||||
# Generate the translation resource file |
||||
# |
||||
|
||||
FILE(GLOB LANG_TS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/resources/langs/*.ts") |
||||
|
||||
qt5_add_translation(QM_SRC ${LANG_TS_SRC}) |
||||
add_custom_target(LANG_QRC ALL DEPENDS ${QM_SRC}) |
||||
|
||||
# Generate a qrc file for the translations |
||||
set(_qrc ${CMAKE_CURRENT_BINARY_DIR}/translations.qrc) |
||||
|
||||
if(NOT EXISTS ${_qrc}) |
||||
file(WRITE ${_qrc} "<RCC> <qresource prefix=\"/translations\">") |
||||
foreach(_lang ${QM_SRC}) |
||||
get_filename_component(_filename ${_lang} NAME) |
||||
file(APPEND ${_qrc} "<file>${_filename}</file>") |
||||
endforeach(_lang) |
||||
file(APPEND ${_qrc} "</qresource> </RCC>") |
||||
endif() |
||||
|
||||
qt5_add_resources(LANG_QRC ${_qrc}) |
||||
qt5_add_resources(QRC resources/res.qrc) |
Loading…
Reference in new issue