- update cmake to 3.11 for compatibility with latest cmake
- make mysql required to build, simplify linking a bit
This commit is contained in:
@@ -6,8 +6,9 @@
|
|||||||
# ░███ ░░█████ ░░███ ███ ░░███ ░░███ ░░███ ░░███ ░███ ░███ ░███ ░███ ░███ ░ █ ░███ ███
|
# ░███ ░░█████ ░░███ ███ ░░███ ░░███ ░░███ ░░███ ░███ ░███ ░███ ░███ ░███ ░ █ ░███ ███
|
||||||
# █████ ░░█████ ░░░███████░ ░░█████████ ░░█████████ █████ █████ █████ █████ ██████████ ██████████
|
# █████ ░░█████ ░░░███████░ ░░█████████ ░░█████████ █████ █████ █████ █████ ██████████ ██████████
|
||||||
#░░░░░ ░░░░░ ░░░░░░░ ░░░░░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░ ░░░░░░░░░░
|
#░░░░░ ░░░░░ ░░░░░░░ ░░░░░░░░░ ░░░░░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░ ░░░░░░░░░░ ░░░░░░░░░░
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 3.3)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.11)
|
||||||
CMAKE_POLICY(SET CMP0057 NEW) # "Support new IN_LIST if() operator."
|
CMAKE_POLICY(SET CMP0057 NEW) # "Support new IN_LIST if() operator."
|
||||||
|
cmake_policy(SET CMP0135 NEW)
|
||||||
SET(CMAKE_CXX_STANDARD 20)
|
SET(CMAKE_CXX_STANDARD 20)
|
||||||
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
SET(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ SET(LIBARY_OUTPUT_PATH bin)
|
|||||||
SET(EXTERNAL_SOURCE_DIR src/external)
|
SET(EXTERNAL_SOURCE_DIR src/external)
|
||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
OPTION(USE_SQL "Enable sql uid save ? (require mysql installed)" OFF)
|
# OPTION(USE_SQL "Enable sql uid save ? (require mysql installed)" OFF)
|
||||||
OPTION(VALIDATE_OPENGL_PROGRAMS "Validate Opengl programs" OFF)
|
OPTION(VALIDATE_OPENGL_PROGRAMS "Validate Opengl programs" OFF)
|
||||||
|
|
||||||
IF(VALIDATE_OPENGL_PROGRAMS)
|
IF(VALIDATE_OPENGL_PROGRAMS)
|
||||||
@@ -116,7 +117,7 @@ FetchContent_MakeAvailable(FastNoise2)
|
|||||||
FIND_PACKAGE(Sol2 REQUIRED)
|
FIND_PACKAGE(Sol2 REQUIRED)
|
||||||
FIND_PACKAGE(Qt5 COMPONENTS Widgets OpenGLExtensions Gui Network Xml Multimedia REQUIRED)
|
FIND_PACKAGE(Qt5 COMPONENTS Widgets OpenGLExtensions Gui Network Xml Multimedia REQUIRED)
|
||||||
|
|
||||||
IF(USE_SQL)
|
# IF(USE_SQL)
|
||||||
FIND_LIBRARY(MYSQL_LIBRARY NAMES libmysql
|
FIND_LIBRARY(MYSQL_LIBRARY NAMES libmysql
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/../Noggit3libs/mysql")
|
HINTS "${CMAKE_SOURCE_DIR}/../Noggit3libs/mysql")
|
||||||
FIND_LIBRARY(MYSQLCPPCONN_LIBRARY NAMES mysqlcppconn
|
FIND_LIBRARY(MYSQLCPPCONN_LIBRARY NAMES mysqlcppconn
|
||||||
@@ -124,6 +125,13 @@ IF(USE_SQL)
|
|||||||
FIND_PATH(MYSQLCPPCONN_INCLUDE NAMES cppconn/driver.h
|
FIND_PATH(MYSQLCPPCONN_INCLUDE NAMES cppconn/driver.h
|
||||||
HINTS "${CMAKE_SOURCE_DIR}/../Noggit3libs/mysql/connector")
|
HINTS "${CMAKE_SOURCE_DIR}/../Noggit3libs/mysql/connector")
|
||||||
|
|
||||||
|
# Ensure we always include the parent of 'cppconn' folder
|
||||||
|
if(EXISTS "${MYSQLCPPCONN_INCLUDE}/cppconn")
|
||||||
|
set(MYSQLCPPCONN_INCLUDE "${MYSQLCPPCONN_INCLUDE}")
|
||||||
|
elseif(EXISTS "${MYSQLCPPCONN_INCLUDE}/driver.h")
|
||||||
|
get_filename_component(MYSQLCPPCONN_INCLUDE "${MYSQLCPPCONN_INCLUDE}" DIRECTORY)
|
||||||
|
endif()
|
||||||
|
|
||||||
IF(MYSQL_LIBRARY AND MYSQLCPPCONN_LIBRARY AND MYSQLCPPCONN_INCLUDE)
|
IF(MYSQL_LIBRARY AND MYSQLCPPCONN_LIBRARY AND MYSQLCPPCONN_INCLUDE)
|
||||||
ADD_DEFINITIONS(-DUSE_MYSQL_UID_STORAGE)
|
ADD_DEFINITIONS(-DUSE_MYSQL_UID_STORAGE)
|
||||||
SET (mysql_sources src/mysql/mysql.cpp)
|
SET (mysql_sources src/mysql/mysql.cpp)
|
||||||
@@ -132,7 +140,7 @@ IF(USE_SQL)
|
|||||||
ELSE()
|
ELSE()
|
||||||
MESSAGE(FATAL_ERROR "MySQL lib or connector not found")
|
MESSAGE(FATAL_ERROR "MySQL lib or connector not found")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
# ENDIF()
|
||||||
|
|
||||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/qt-color-widgets")
|
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/qt-color-widgets")
|
||||||
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/framelesshelper")
|
ADD_SUBDIRECTORY("${EXTERNAL_SOURCE_DIR}/framelesshelper")
|
||||||
|
|||||||
@@ -57,14 +57,14 @@ recent version).
|
|||||||
* build INSTALL
|
* build INSTALL
|
||||||
* Repeat for both release and debug.
|
* Repeat for both release and debug.
|
||||||
|
|
||||||
### MySQL (Optional) ###
|
### MySQL ###
|
||||||
Optional, required for MySQL GUID Storage builds.
|
Required for MySQL GUID Storage builds.
|
||||||
download MySQL server https://dev.mysql.com/downloads/installer/
|
download MySQL server https://dev.mysql.com/downloads/installer/
|
||||||
and MySQL C++ Connector https://dev.mysql.com/downloads/connector/cpp/
|
and MySQL C++ Connector https://dev.mysql.com/downloads/connector/cpp/
|
||||||
* open CMake GUI
|
* open CMake GUI
|
||||||
* enable `USE_SQL`
|
|
||||||
* set `MYSQL_LIBRARY` (path) to `libmysql.lib` from your MYSQL server install.
|
* set `MYSQL_LIBRARY` (path) to `libmysql.lib` from your MYSQL server install.
|
||||||
e.g `"C:/Program Files/MySQL/MySQL Server 8.0/lib/libmysql.lib"`
|
e.g `"C:/Program Files/MySQL/MySQL Server 8.0/lib/libmysql.lib"`
|
||||||
|
Note : In new connector versions, developments components aren't included by default anymore in the "Typical" setting, you need to enable `Legacy JDBC API->Development Components` during installation.
|
||||||
* set `MYSQLCPPCONN_INCLUDE` (path) to the folder containing `cppconn/driver.h` from your MYSQL Connector C++ install.
|
* set `MYSQLCPPCONN_INCLUDE` (path) to the folder containing `cppconn/driver.h` from your MYSQL Connector C++ install.
|
||||||
e.g `"C:/Program Files/MySQL/Connector C++ 8.0/include/jdbc"`
|
e.g `"C:/Program Files/MySQL/Connector C++ 8.0/include/jdbc"`
|
||||||
* set `MYSQLCPPCONN_LIBRARY` (path) to `mysqlcppconn.lib` from your MYSQL Connector C++ install.
|
* set `MYSQLCPPCONN_LIBRARY` (path) to `mysqlcppconn.lib` from your MYSQL Connector C++ install.
|
||||||
|
|||||||
2
cmake
2
cmake
Submodule cmake updated: 7a5741adae...32da4c01dc
2
src/external/NodeEditor/CMakeLists.txt
vendored
2
src/external/NodeEditor/CMakeLists.txt
vendored
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.2)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
# version 3.4 is required as other do not work with C++14 and clang
|
# version 3.4 is required as other do not work with C++14 and clang
|
||||||
|
|
||||||
project(NodeEditor CXX)
|
project(NodeEditor CXX)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
|
||||||
include(GetGitRevisionDescription)
|
include(GetGitRevisionDescription)
|
||||||
git_describe(GitTagVersion --tags)
|
git_describe(GitTagVersion --tags)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT})
|
project(QtAdvancedDockingSystem LANGUAGES CXX VERSION ${VERSION_SHORT})
|
||||||
find_package(Qt5 5.5 COMPONENTS Core Gui Widgets REQUIRED)
|
find_package(Qt5 5.5 COMPONENTS Core Gui Widgets REQUIRED)
|
||||||
if (UNIX AND NOT APPLE)
|
if (UNIX AND NOT APPLE)
|
||||||
|
|||||||
2
src/external/libnoise/CMakeLists.txt
vendored
2
src/external/libnoise/CMakeLists.txt
vendored
@@ -1,6 +1,6 @@
|
|||||||
# http://www.linux-magazin.de/Heft-Abo/Ausgaben/2007/02/Mal-ausspannen
|
# http://www.linux-magazin.de/Heft-Abo/Ausgaben/2007/02/Mal-ausspannen
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.0)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
|
|
||||||
set ( LIBNOISE_VERSION "1.0.0-cmake" )
|
set ( LIBNOISE_VERSION "1.0.0-cmake" )
|
||||||
|
|
||||||
|
|||||||
7
src/external/qt-color-widgets/CMakeLists.txt
vendored
7
src/external/qt-color-widgets/CMakeLists.txt
vendored
@@ -32,7 +32,7 @@ src/color_preview.cpp
|
|||||||
src/color_selector.cpp
|
src/color_selector.cpp
|
||||||
src/color_utils.cpp
|
src/color_utils.cpp
|
||||||
src/color_wheel.cpp
|
src/color_wheel.cpp
|
||||||
src/color_widgets.qrc
|
# src/color_widgets.qrc
|
||||||
src/gradient_slider.cpp
|
src/gradient_slider.cpp
|
||||||
src/hue_slider.cpp
|
src/hue_slider.cpp
|
||||||
src/swatch.cpp
|
src/swatch.cpp
|
||||||
@@ -59,10 +59,11 @@ qt-color-widgets/swatch.hpp
|
|||||||
|
|
||||||
qt5_wrap_cpp(SOURCES ${HEADERS})
|
qt5_wrap_cpp(SOURCES ${HEADERS})
|
||||||
qt5_wrap_ui(SOURCES src/color_dialog.ui src/color_palette_widget.ui)
|
qt5_wrap_ui(SOURCES src/color_dialog.ui src/color_palette_widget.ui)
|
||||||
qt5_add_resources(SOURCES src/color_widgets.qrc)
|
# qt5_add_resources(SOURCES src/color_widgets.qrc)
|
||||||
|
qt5_add_resources(QRC_SOURCES src/color_widgets.qrc)
|
||||||
|
|
||||||
# Library
|
# Library
|
||||||
add_library(ColorWidgets-qt5 ${SOURCES})
|
add_library(ColorWidgets-qt5 ${SOURCES} ${QRC_SOURCES})
|
||||||
target_link_libraries(ColorWidgets-qt5 Qt5::Widgets)
|
target_link_libraries(ColorWidgets-qt5 Qt5::Widgets)
|
||||||
target_include_directories (ColorWidgets-qt5 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories (ColorWidgets-qt5 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
target_include_directories (ColorWidgets-qt5 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
target_include_directories (ColorWidgets-qt5 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
|
||||||
|
|||||||
2
src/external/rapidfuzz-cpp/CMakeLists.txt
vendored
2
src/external/rapidfuzz-cpp/CMakeLists.txt
vendored
@@ -1,5 +1,5 @@
|
|||||||
# Cmake config largely taken from catch2
|
# Cmake config largely taken from catch2
|
||||||
cmake_minimum_required(VERSION 3.5)
|
cmake_minimum_required(VERSION 3.11)
|
||||||
|
|
||||||
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.24)
|
||||||
cmake_policy(SET CMP0135 NEW)
|
cmake_policy(SET CMP0135 NEW)
|
||||||
|
|||||||
@@ -5,10 +5,9 @@
|
|||||||
|
|
||||||
#include <QtCore/QSettings>
|
#include <QtCore/QSettings>
|
||||||
|
|
||||||
#include <driver.h>
|
#include <cppconn/driver.h>
|
||||||
#include <prepared_statement.h>
|
#include <cppconn/prepared_statement.h>
|
||||||
// #include <cppconn/driver.h>
|
#include <cppconn/exception.h>
|
||||||
// #include <cppconn/prepared_statement.h>
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
@@ -18,10 +17,10 @@ namespace
|
|||||||
|
|
||||||
// if using release SQL binaries in debug mode it will crash https://bugs.mysql.com/bug.php?id=91238 unless using sql strings
|
// if using release SQL binaries in debug mode it will crash https://bugs.mysql.com/bug.php?id=91238 unless using sql strings
|
||||||
// tcp://127.0.0.1:3306
|
// tcp://127.0.0.1:3306
|
||||||
sql::SQLString hostname = "tcp://" + settings.value("project/mysql/server").toString().toStdString() + ":" + settings.value("project/mysql/port", "3306").toString().toStdString();
|
const sql::SQLString hostname = "tcp://" + settings.value("project/mysql/server").toString().toStdString() + ":" + settings.value("project/mysql/port", "3306").toString().toStdString();
|
||||||
sql::SQLString userName = settings.value("project/mysql/user").toString().toStdString();
|
const sql::SQLString userName = settings.value("project/mysql/user").toString().toStdString();
|
||||||
sql::SQLString password = settings.value("project/mysql/pwd").toString().toStdString();
|
const sql::SQLString password = settings.value("project/mysql/pwd").toString().toStdString();
|
||||||
sql::SQLString schema = settings.value("project/mysql/db").toString().toStdString();
|
const sql::SQLString schema = settings.value("project/mysql/db").toString().toStdString();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -49,6 +48,11 @@ namespace
|
|||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "SQL Other exception: " << e.what() << std::endl;
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,17 +62,17 @@ namespace mysql
|
|||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
// if using release SQL binaries in debug mode it will crash https://bugs.mysql.com/bug.php?id=91238 unless using sql strings
|
// if using release SQL binaries in debug mode it will crash https://bugs.mysql.com/bug.php?id=91238 unless using sql strings
|
||||||
sql::SQLString hostname = "tcp://" + settings.value("project/mysql/server").toString().toStdString() + ":" + settings.value("project/mysql/port", "3306").toString().toStdString();
|
const sql::SQLString hostname = "tcp://" + settings.value("project/mysql/server").toString().toStdString() + ":" + settings.value("project/mysql/port", "3306").toString().toStdString();
|
||||||
sql::SQLString userName = settings.value("project/mysql/user").toString().toStdString();
|
const sql::SQLString userName = settings.value("project/mysql/user").toString().toStdString();
|
||||||
sql::SQLString password = settings.value("project/mysql/pwd").toString().toStdString();
|
const sql::SQLString password = settings.value("project/mysql/pwd").toString().toStdString();
|
||||||
sql::SQLString schema = settings.value("project/mysql/db").toString().toStdString();
|
|
||||||
|
|
||||||
|
|
||||||
QMessageBox prompt;
|
QMessageBox prompt;
|
||||||
prompt.setWindowFlag(Qt::WindowStaysOnTopHint);
|
prompt.setWindowFlag(Qt::WindowStaysOnTopHint);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
std::unique_ptr<sql::Connection> Con(get_driver_instance()->connect(hostname, userName, password));
|
sql::Driver* driver = get_driver_instance();
|
||||||
|
sql::Connection* connection = driver->connect(hostname, userName, password);
|
||||||
|
std::unique_ptr<sql::Connection> Con(connection);
|
||||||
|
|
||||||
prompt.setIcon(QMessageBox::Information);
|
prompt.setIcon(QMessageBox::Information);
|
||||||
prompt.setText("Succesfully connected to MySQL database.");
|
prompt.setText("Succesfully connected to MySQL database.");
|
||||||
@@ -97,6 +101,11 @@ namespace mysql
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
catch (std::exception& e)
|
||||||
|
{
|
||||||
|
std::cerr << "SQL Other exception: " << e.what() << std::endl;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool hasMaxUIDStoredDB(std::size_t mapID)
|
bool hasMaxUIDStoredDB(std::size_t mapID)
|
||||||
|
|||||||
Reference in New Issue
Block a user