mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
Add ENABLE_NEWS and disable curl if it's not needed
This commit is contained in:
parent
44a713a693
commit
1b5fd7ccef
@ -68,18 +68,25 @@ option(USE_SHARED_TINYXML "Use your installed copy of tinyxml" off)
|
|||||||
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
|
option(USE_SHARED_PIXMAN "Use your installed copy of pixman" off)
|
||||||
option(USE_SHARED_FREETYPE "Use shared FreeType library" off)
|
option(USE_SHARED_FREETYPE "Use shared FreeType library" off)
|
||||||
option(USE_SHARED_HARFBUZZ "Use shared HarfBuzz library" off)
|
option(USE_SHARED_HARFBUZZ "Use shared HarfBuzz library" off)
|
||||||
option(ENABLE_MEMLEAK "Enable memory-leaks detector (only for developers)" off)
|
option(ENABLE_MEMLEAK "Enable memory-leaks detector (only for developers)" off)
|
||||||
option(ENABLE_UPDATER "Enable automatic check for updates" on)
|
option(ENABLE_NEWS "Enable the news in Home tab" on)
|
||||||
option(ENABLE_SCRIPTING "Compile with scripting support" on)
|
option(ENABLE_UPDATER "Enable automatic check for updates" on)
|
||||||
option(ENABLE_TESTS "Compile unit tests" off)
|
option(ENABLE_SCRIPTING "Compile with scripting support" on)
|
||||||
option(ENABLE_BENCHMARKS "Compile benchmarks" off)
|
option(ENABLE_TESTS "Compile unit tests" off)
|
||||||
option(ENABLE_TRIAL_MODE "Compile the trial version" off)
|
option(ENABLE_BENCHMARKS "Compile benchmarks" off)
|
||||||
option(ENABLE_STEAM "Compile with Steam library" off)
|
option(ENABLE_TRIAL_MODE "Compile the trial version" off)
|
||||||
option(ENABLE_DEVMODE "Compile vesion for developers" off)
|
option(ENABLE_STEAM "Compile with Steam library" off)
|
||||||
option(ENABLE_UI "Compile UI (turn off to compile CLI-only version)" on)
|
option(ENABLE_DEVMODE "Compile vesion for developers" off)
|
||||||
|
option(ENABLE_UI "Compile UI (turn off to compile CLI-only version)" on)
|
||||||
option(FULLSCREEN_PLATFORM "Enable fullscreen by default" off)
|
option(FULLSCREEN_PLATFORM "Enable fullscreen by default" off)
|
||||||
set(CUSTOM_WEBSITE_URL "" CACHE STRING "Enable custom local webserver to check updates")
|
set(CUSTOM_WEBSITE_URL "" CACHE STRING "Enable custom local webserver to check updates")
|
||||||
|
|
||||||
|
if(ENABLE_NEWS OR ENABLE_UPDATER)
|
||||||
|
set(REQUIRE_CURL ON)
|
||||||
|
else()
|
||||||
|
set(REQUIRE_CURL OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(NOT ENABLE_UI)
|
if(NOT ENABLE_UI)
|
||||||
set(LAF_OS_BACKEND "none") # Without UI, we use the none backend
|
set(LAF_OS_BACKEND "none") # Without UI, we use the none backend
|
||||||
else()
|
else()
|
||||||
@ -288,13 +295,15 @@ else()
|
|||||||
include_directories(${CMAKE_BINARY_DIR}/third_party/cmark)
|
include_directories(${CMAKE_BINARY_DIR}/third_party/cmark)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(USE_SHARED_CURL)
|
if(REQUIRE_CURL)
|
||||||
find_package(CURL REQUIRED)
|
if(USE_SHARED_CURL)
|
||||||
else()
|
find_package(CURL REQUIRED)
|
||||||
set(CURL_LIBRARIES libcurl)
|
else()
|
||||||
set(CURL_INCLUDE_DIRS ${CURL_DIR}/include)
|
set(CURL_LIBRARIES libcurl)
|
||||||
|
set(CURL_INCLUDE_DIRS ${CURL_DIR}/include)
|
||||||
|
endif()
|
||||||
|
include_directories(${CURL_INCLUDE_DIRS})
|
||||||
endif()
|
endif()
|
||||||
include_directories(${CURL_INCLUDE_DIRS})
|
|
||||||
|
|
||||||
# simpleini
|
# simpleini
|
||||||
include_directories(${SIMPLEINI_DIR})
|
include_directories(${SIMPLEINI_DIR})
|
||||||
|
@ -24,6 +24,10 @@ if(MSVC)
|
|||||||
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
|
||||||
endif(MSVC)
|
endif(MSVC)
|
||||||
|
|
||||||
|
if(ENABLE_NEWS)
|
||||||
|
add_definitions(-DENABLE_NEWS)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_UPDATER)
|
if(ENABLE_UPDATER)
|
||||||
add_definitions(-DENABLE_UPDATER)
|
add_definitions(-DENABLE_UPDATER)
|
||||||
endif()
|
endif()
|
||||||
@ -43,7 +47,7 @@ endif()
|
|||||||
######################################################################
|
######################################################################
|
||||||
# With static libcurl
|
# With static libcurl
|
||||||
|
|
||||||
if(NOT USE_SHARED_CURL AND CURL_STATICLIB)
|
if(REQUIRE_CURL AND NOT USE_SHARED_CURL AND CURL_STATICLIB)
|
||||||
add_definitions(-DCURL_STATICLIB)
|
add_definitions(-DCURL_STATICLIB)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -94,11 +98,14 @@ add_subdirectory(doc)
|
|||||||
add_subdirectory(filters)
|
add_subdirectory(filters)
|
||||||
add_subdirectory(fixmath)
|
add_subdirectory(fixmath)
|
||||||
add_subdirectory(flic)
|
add_subdirectory(flic)
|
||||||
add_subdirectory(net)
|
|
||||||
add_subdirectory(render)
|
add_subdirectory(render)
|
||||||
add_subdirectory(dio)
|
add_subdirectory(dio)
|
||||||
add_subdirectory(ui)
|
add_subdirectory(ui)
|
||||||
|
|
||||||
|
if(REQUIRE_CURL)
|
||||||
|
add_subdirectory(net)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(GEN_EXE)
|
if(GEN_EXE)
|
||||||
add_executable(gen IMPORTED)
|
add_executable(gen IMPORTED)
|
||||||
set_target_properties(gen PROPERTIES IMPORTED_LOCATION ${GEN_EXE})
|
set_target_properties(gen PROPERTIES IMPORTED_LOCATION ${GEN_EXE})
|
||||||
|
@ -361,7 +361,6 @@ if(ENABLE_UI)
|
|||||||
ui/keyboard_shortcuts.cpp
|
ui/keyboard_shortcuts.cpp
|
||||||
ui/main_menu_bar.cpp
|
ui/main_menu_bar.cpp
|
||||||
ui/main_window.cpp
|
ui/main_window.cpp
|
||||||
ui/news_listbox.cpp
|
|
||||||
ui/notifications.cpp
|
ui/notifications.cpp
|
||||||
ui/optional_alert.cpp
|
ui/optional_alert.cpp
|
||||||
ui/palette_popup.cpp
|
ui/palette_popup.cpp
|
||||||
@ -395,6 +394,12 @@ if(ENABLE_UI)
|
|||||||
util/clipboard.cpp
|
util/clipboard.cpp
|
||||||
util/clipboard_native.cpp
|
util/clipboard_native.cpp
|
||||||
widget_loader.cpp)
|
widget_loader.cpp)
|
||||||
|
if(ENABLE_NEWS)
|
||||||
|
set(ui_app_files
|
||||||
|
res/http_loader.cpp
|
||||||
|
ui/news_listbox.cpp
|
||||||
|
${ui_app_files})
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_library(app-lib
|
add_library(app-lib
|
||||||
@ -530,7 +535,6 @@ add_library(app-lib
|
|||||||
pref/preferences.cpp
|
pref/preferences.cpp
|
||||||
project.cpp
|
project.cpp
|
||||||
recent_files.cpp
|
recent_files.cpp
|
||||||
res/http_loader.cpp
|
|
||||||
res/palettes_loader_delegate.cpp
|
res/palettes_loader_delegate.cpp
|
||||||
res/resources_loader.cpp
|
res/resources_loader.cpp
|
||||||
resource_finder.cpp
|
resource_finder.cpp
|
||||||
@ -575,7 +579,6 @@ target_link_libraries(app-lib
|
|||||||
fixmath-lib
|
fixmath-lib
|
||||||
flic-lib
|
flic-lib
|
||||||
laf-gfx
|
laf-gfx
|
||||||
net-lib
|
|
||||||
render-lib
|
render-lib
|
||||||
laf-ft
|
laf-ft
|
||||||
laf-os
|
laf-os
|
||||||
@ -595,6 +598,10 @@ target_link_libraries(app-lib
|
|||||||
fmt
|
fmt
|
||||||
tinyexpr)
|
tinyexpr)
|
||||||
|
|
||||||
|
if(REQUIRE_CURL)
|
||||||
|
target_link_libraries(app-lib net-lib)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(ENABLE_SCRIPTING)
|
if(ENABLE_SCRIPTING)
|
||||||
target_link_libraries(app-lib lua lauxlib lualib)
|
target_link_libraries(app-lib lua lauxlib lualib)
|
||||||
endif()
|
endif()
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include "app/i18n/strings.h"
|
#include "app/i18n/strings.h"
|
||||||
#include "app/ui/data_recovery_view.h"
|
#include "app/ui/data_recovery_view.h"
|
||||||
#include "app/ui/main_window.h"
|
#include "app/ui/main_window.h"
|
||||||
#include "app/ui/news_listbox.h"
|
|
||||||
#include "app/ui/recent_listbox.h"
|
#include "app/ui/recent_listbox.h"
|
||||||
#include "app/ui/skin/skin_theme.h"
|
#include "app/ui/skin/skin_theme.h"
|
||||||
#include "app/ui/workspace.h"
|
#include "app/ui/workspace.h"
|
||||||
@ -32,6 +31,10 @@
|
|||||||
#include "ui/textbox.h"
|
#include "ui/textbox.h"
|
||||||
#include "ui/view.h"
|
#include "ui/view.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_NEWS
|
||||||
|
#include "app/ui/news_listbox.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|
||||||
using namespace ui;
|
using namespace ui;
|
||||||
@ -40,7 +43,9 @@ using namespace app::skin;
|
|||||||
HomeView::HomeView()
|
HomeView::HomeView()
|
||||||
: m_files(new RecentFilesListBox)
|
: m_files(new RecentFilesListBox)
|
||||||
, m_folders(new RecentFoldersListBox)
|
, m_folders(new RecentFoldersListBox)
|
||||||
|
#ifdef ENABLE_NEWS
|
||||||
, m_news(new NewsListBox)
|
, m_news(new NewsListBox)
|
||||||
|
#endif
|
||||||
, m_dataRecovery(nullptr)
|
, m_dataRecovery(nullptr)
|
||||||
, m_dataRecoveryView(nullptr)
|
, m_dataRecoveryView(nullptr)
|
||||||
{
|
{
|
||||||
@ -50,7 +55,9 @@ HomeView::HomeView()
|
|||||||
|
|
||||||
filesView()->attachToView(m_files);
|
filesView()->attachToView(m_files);
|
||||||
foldersView()->attachToView(m_folders);
|
foldersView()->attachToView(m_folders);
|
||||||
|
#ifdef ENABLE_NEWS
|
||||||
newsView()->attachToView(m_news);
|
newsView()->attachToView(m_news);
|
||||||
|
#endif
|
||||||
|
|
||||||
checkUpdate()->setVisible(false);
|
checkUpdate()->setVisible(false);
|
||||||
recoverSpritesPlaceholder()->setVisible(false);
|
recoverSpritesPlaceholder()->setVisible(false);
|
||||||
@ -128,7 +135,11 @@ void HomeView::onResize(ui::ResizeEvent& ev)
|
|||||||
{
|
{
|
||||||
headerPlaceholder()->setVisible(ev.bounds().h > 200*ui::guiscale());
|
headerPlaceholder()->setVisible(ev.bounds().h > 200*ui::guiscale());
|
||||||
foldersPlaceholder()->setVisible(ev.bounds().h > 150*ui::guiscale());
|
foldersPlaceholder()->setVisible(ev.bounds().h > 150*ui::guiscale());
|
||||||
|
#ifdef ENABLE_NEWS
|
||||||
newsPlaceholder()->setVisible(ev.bounds().w > 200*ui::guiscale());
|
newsPlaceholder()->setVisible(ev.bounds().w > 200*ui::guiscale());
|
||||||
|
#else
|
||||||
|
newsPlaceholder()->setVisible(false);
|
||||||
|
#endif
|
||||||
|
|
||||||
ui::VBox::onResize(ev);
|
ui::VBox::onResize(ev);
|
||||||
}
|
}
|
||||||
|
2
third_party/CMakeLists.txt
vendored
2
third_party/CMakeLists.txt
vendored
@ -42,7 +42,7 @@ if(NOT USE_SHARED_TINYXML)
|
|||||||
add_subdirectory(tinyxml)
|
add_subdirectory(tinyxml)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(NOT USE_SHARED_CURL)
|
if(REQUIRE_CURL AND NOT USE_SHARED_CURL)
|
||||||
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
|
set(BUILD_RELEASE_DEBUG_DIRS ON BOOL)
|
||||||
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
set(CMAKE_USE_OPENSSL OFF CACHE BOOL "Use OpenSSL code. Experimental")
|
||||||
add_subdirectory(curl)
|
add_subdirectory(curl)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user