|
|
|
@ -1,17 +1,33 @@ |
|
|
|
|
cmake_minimum_required(VERSION 3.1) |
|
|
|
|
|
|
|
|
|
project(nheko CXX) |
|
|
|
|
project(nheko C CXX) |
|
|
|
|
|
|
|
|
|
option(BUILD_TESTS "Build all tests" OFF) |
|
|
|
|
option(APPVEYOR_BUILD "Build on appveyor" OFF) |
|
|
|
|
|
|
|
|
|
# |
|
|
|
|
# LMDB |
|
|
|
|
# |
|
|
|
|
find_path (LMDB_INCLUDE_DIR NAMES lmdb.h PATHS "$ENV{LMDB_DIR}/include") |
|
|
|
|
find_library (LMDB_LIBRARY NAMES lmdb PATHS "$ENV{LMDB_DIR}/lib" ) |
|
|
|
|
if(APPVEYOR_BUILD) |
|
|
|
|
set(LMDB_VERSION "LMDB_0.9.21") |
|
|
|
|
set(NTDLIB "C:/WINDDK/7600.16385.1/lib/win7/amd64/ntdll.lib") |
|
|
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs) |
|
|
|
|
find_package_handle_standard_args(LMDB DEFAULT_MSG LMDB_INCLUDE_DIR LMDB_LIBRARY) |
|
|
|
|
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) |
|
|
|
|
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() |
|
|
|
|
|
|
|
|
|
if (NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/lmdbxx/.git" ) |
|
|
|
|
message(WARNING "The git submodules are not available.") |
|
|
|
@ -298,7 +314,12 @@ else() |
|
|
|
|
# |
|
|
|
|
# Build the executable. |
|
|
|
|
# |
|
|
|
|
if(APPVEYOR_BUILD) |
|
|
|
|
set (NHEKO_LIBS matrix_events Qt5::Widgets Qt5::Network lmdb) |
|
|
|
|
else() |
|
|
|
|
set (NHEKO_LIBS matrix_events Qt5::Widgets Qt5::Network ${LMDB_LIBRARY}) |
|
|
|
|
endif() |
|
|
|
|
|
|
|
|
|
set (NHEKO_DEPS ${OS_BUNDLE} ${SRC_FILES} ${UI_HEADERS} ${MOC_HEADERS} ${QRC} ${LANG_QRC} ${QM_SRC}) |
|
|
|
|
|
|
|
|
|
if(APPLE) |
|
|
|
@ -306,7 +327,7 @@ else() |
|
|
|
|
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::MacExtras) |
|
|
|
|
elseif(WIN32) |
|
|
|
|
add_executable (nheko ${ICON_FILE} ${NHEKO_DEPS}) |
|
|
|
|
target_link_libraries (nheko ${NHEKO_LIBS} Qt5::WinMain) |
|
|
|
|
target_link_libraries (nheko ${NTDLIB} ${NHEKO_LIBS} Qt5::WinMain) |
|
|
|
|
else() |
|
|
|
|
add_executable (nheko ${NHEKO_DEPS}) |
|
|
|
|
target_link_libraries (nheko ${NHEKO_LIBS}) |
|
|
|
|