From 977994765cad82657ab33628e4cd919c31c59729 Mon Sep 17 00:00:00 2001 From: David Capello Date: Wed, 15 Dec 2021 17:47:44 -0300 Subject: [PATCH] Normalize some cmake options from WITH_* to ENABLE_* --- CMakeLists.txt | 9 ++++----- src/CMakeLists.txt | 2 +- src/app/CMakeLists.txt | 6 +++--- src/app/file/file_formats_manager.cpp | 4 ++-- src/desktop/linux/CMakeLists.txt | 2 +- third_party/CMakeLists.txt | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b5bcd64fb..3a0af4815 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,10 +52,6 @@ enable_testing() # Options (these can be specified in cmake command line or modifying # CMakeCache.txt) -option(WITH_WEBP_SUPPORT "Enable support to load/save .webp files" on) -option(WITH_DESKTOP_INTEGRATION "Enable desktop integration modules" off) -option(WITH_QT_THUMBNAILER "Enable kde5/qt5 thumnailer" off) - option(USE_SHARED_CMARK "Use your installed copy of cmark" off) option(USE_SHARED_CURL "Use your installed copy of curl" off) option(USE_SHARED_GIFLIB "Use your installed copy of giflib" off) @@ -82,6 +78,9 @@ option(FULLSCREEN_PLATFORM "Enable fullscreen by default" off) option(ENABLE_CLANG_TIDY "Enable static analysis" off) option(ENABLE_CCACHE "Use CCache to improve recompilation speed (optional)" on) option(ENABLE_SENTRY "Use Sentry SDK to report crashes" off) +option(ENABLE_WEBP "Enable support to load/save .webp files" on) +option(ENABLE_DESKTOP_INTEGRATION "Enable desktop integration modules" off) +option(ENABLE_QT_THUMBNAILER "Enable kde5/qt5 thumnailer" off) set(CUSTOM_WEBSITE_URL "" CACHE STRING "Enable custom local webserver to check updates") if(ENABLE_SENTRY) @@ -235,7 +234,7 @@ include_directories(${PNG_INCLUDE_DIRS}) add_definitions(-DPNG_NO_MMX_CODE) # Do not use MMX optimizations in PNG code # libwebp -if(WITH_WEBP_SUPPORT) +if(ENABLE_WEBP) set(WEBP_LIBRARIES webp webpdemux libwebpmux) set(WEBP_INCLUDE_DIR ${LIBWEBP_DIR}/src) include_directories(${WEBP_INCLUDE_DIR}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cb25aeac6..321f7b91d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,7 +130,7 @@ if(ENABLE_STEAM) add_subdirectory(steam) endif() -if(WITH_DESKTOP_INTEGRATION) +if(ENABLE_DESKTOP_INTEGRATION) add_subdirectory(desktop) endif() diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 8a4a36a26..09b44f64c 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -87,8 +87,8 @@ add_custom_command( DEPENDS ${GEN_DEP} ${widget_files} ${string_files} "${SOURCE_DATA_DIR}/gui.xml") list(APPEND generated_files ${output_fn}) -if(WITH_WEBP_SUPPORT) - add_definitions(-DASEPRITE_WITH_WEBP_SUPPORT) +if(ENABLE_WEBP) + add_definitions(-DENABLE_WEBP) endif() # libarchive definitions @@ -134,7 +134,7 @@ set(file_formats file/png_format.cpp file/svg_format.cpp file/tga_format.cpp) -if(WITH_WEBP_SUPPORT) +if(ENABLE_WEBP) list(APPEND file_formats file/webp_format.cpp) endif() diff --git a/src/app/file/file_formats_manager.cpp b/src/app/file/file_formats_manager.cpp index 22d91ae8a..5f1dff08f 100644 --- a/src/app/file/file_formats_manager.cpp +++ b/src/app/file/file_formats_manager.cpp @@ -32,7 +32,7 @@ extern FileFormat* CreatePngFormat(); extern FileFormat* CreateSvgFormat(); extern FileFormat* CreateTgaFormat(); -#ifdef ASEPRITE_WITH_WEBP_SUPPORT +#ifdef ENABLE_WEBP extern FileFormat* CreateWebPFormat(); #endif @@ -68,7 +68,7 @@ FileFormatsManager::FileFormatsManager() registerFormat(CreateSvgFormat()); registerFormat(CreateTgaFormat()); -#ifdef ASEPRITE_WITH_WEBP_SUPPORT +#ifdef ENABLE_WEBP registerFormat(CreateWebPFormat()); #endif } diff --git a/src/desktop/linux/CMakeLists.txt b/src/desktop/linux/CMakeLists.txt index b34c4d31d..cdeeb31db 100644 --- a/src/desktop/linux/CMakeLists.txt +++ b/src/desktop/linux/CMakeLists.txt @@ -10,6 +10,6 @@ install(PROGRAMS aseprite-thumbnailer DESTINATION bin) install(FILES gnome/aseprite.thumbnailer DESTINATION share/thumbnailers) # Qt Thumbnailer -if(WITH_QT_THUMBNAILER) +if(ENABLE_QT_THUMBNAILER) add_subdirectory(kde) endif() diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index d13d44c2c..dde9c1de1 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -33,7 +33,7 @@ if(NOT USE_SHARED_GIFLIB) add_subdirectory(giflib) endif() -if(WITH_WEBP_SUPPORT) +if(ENABLE_WEBP) set(WEBP_BUILD_EXTRAS OFF CACHE BOOL "Build extras.") set(WEBP_BUILD_ANIM_UTILS OFF CACHE BOOL "Build animation utilities.") set(WEBP_BUILD_CWEBP OFF CACHE BOOL "Build the cwebp command line tool.")