Skip to content

Commit

Permalink
Format all CMake files
Browse files Browse the repository at this point in the history
  • Loading branch information
y-guyon authored and wantehchang committed Apr 13, 2022
1 parent bceac50 commit 0f85943
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 115 deletions.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@ Use [cmake-format](https://github.com/cheshirekow/cmake_format) to format the
CMakeLists.txt files from the top-level folder:

```sh
cmake-format -i CMakeLists.txt tests/CMakeLists.txt
cmake-format -i \
CMakeLists.txt \
tests/CMakeLists.txt \
cmake/Modules/Find*.cmake \
contrib/CMakeLists.txt \
contrib/gdk-pixbuf/CMakeLists.txt \
android_jni/avifandroidjni/src/main/jni/CMakeLists.txt
```

---
Expand Down
28 changes: 11 additions & 17 deletions cmake/Modules/Findaom.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,23 @@
#

find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_AOM aom)
endif (PKG_CONFIG_FOUND)
endif(PKG_CONFIG_FOUND)

find_path(AOM_INCLUDE_DIR
NAMES aom/aom.h
PATHS ${_AOM_INCLUDEDIR}
)
find_path(AOM_INCLUDE_DIR NAMES aom/aom.h PATHS ${_AOM_INCLUDEDIR})

find_library(AOM_LIBRARY
NAMES aom
PATHS ${_AOM_LIBDIR})
find_library(AOM_LIBRARY NAMES aom PATHS ${_AOM_LIBDIR})

set(AOM_LIBRARIES
${AOM_LIBRARIES}
${AOM_LIBRARY}
${_AOM_LDFLAGS})
set(AOM_LIBRARIES ${AOM_LIBRARIES} ${AOM_LIBRARY} ${_AOM_LDFLAGS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(aom
FOUND_VAR AOM_FOUND
REQUIRED_VARS AOM_LIBRARY AOM_LIBRARIES AOM_INCLUDE_DIR
VERSION_VAR _AOM_VERSION)
find_package_handle_standard_args(
aom
FOUND_VAR AOM_FOUND
REQUIRED_VARS AOM_LIBRARY AOM_LIBRARIES AOM_INCLUDE_DIR
VERSION_VAR _AOM_VERSION
)

# show the AOM_INCLUDE_DIR, AOM_LIBRARY and AOM_LIBRARIES variables only
# in the advanced view
Expand Down
31 changes: 13 additions & 18 deletions cmake/Modules/Finddav1d.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,25 @@
#

find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_DAV1D dav1d)
endif (PKG_CONFIG_FOUND)
endif(PKG_CONFIG_FOUND)

find_path(DAV1D_INCLUDE_DIR
NAMES dav1d/dav1d.h
PATHS ${_DAV1D_INCLUDEDIR}
)
find_path(DAV1D_INCLUDE_DIR NAMES dav1d/dav1d.h PATHS ${_DAV1D_INCLUDEDIR})

find_library(DAV1D_LIBRARY
NAMES dav1d
PATHS ${_DAV1D_LIBDIR})
find_library(DAV1D_LIBRARY NAMES dav1d PATHS ${_DAV1D_LIBDIR})

if (DAV1D_LIBRARY)
set(DAV1D_LIBRARIES
${DAV1D_LIBRARIES}
${DAV1D_LIBRARY})
endif (DAV1D_LIBRARY)
if(DAV1D_LIBRARY)
set(DAV1D_LIBRARIES ${DAV1D_LIBRARIES} ${DAV1D_LIBRARY})
endif(DAV1D_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(dav1d
FOUND_VAR DAV1D_FOUND
REQUIRED_VARS DAV1D_LIBRARY DAV1D_LIBRARIES DAV1D_INCLUDE_DIR
VERSION_VAR _DAV1D_VERSION)
find_package_handle_standard_args(
dav1d
FOUND_VAR DAV1D_FOUND
REQUIRED_VARS DAV1D_LIBRARY DAV1D_LIBRARIES DAV1D_INCLUDE_DIR
VERSION_VAR _DAV1D_VERSION
)

# show the DAV1D_INCLUDE_DIR, DAV1D_LIBRARY and DAV1D_LIBRARIES variables only
# in the advanced view
Expand Down
31 changes: 13 additions & 18 deletions cmake/Modules/Findlibgav1.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,25 @@
#

find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_LIBGAV1 libgav1)
endif (PKG_CONFIG_FOUND)
endif(PKG_CONFIG_FOUND)

find_path(LIBGAV1_INCLUDE_DIR
NAMES gav1/decoder.h
PATHS ${_LIBGAV1_INCLUDEDIR}
)
find_path(LIBGAV1_INCLUDE_DIR NAMES gav1/decoder.h PATHS ${_LIBGAV1_INCLUDEDIR})

find_library(LIBGAV1_LIBRARY
NAMES gav1
PATHS ${_LIBGAV1_LIBDIR})
find_library(LIBGAV1_LIBRARY NAMES gav1 PATHS ${_LIBGAV1_LIBDIR})

if (LIBGAV1_LIBRARY)
set(LIBGAV1_LIBRARIES
${LIBGAV1_LIBRARIES}
${LIBGAV1_LIBRARY})
endif (LIBGAV1_LIBRARY)
if(LIBGAV1_LIBRARY)
set(LIBGAV1_LIBRARIES ${LIBGAV1_LIBRARIES} ${LIBGAV1_LIBRARY})
endif(LIBGAV1_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libgav1
FOUND_VAR LIBGAV1_FOUND
REQUIRED_VARS LIBGAV1_LIBRARY LIBGAV1_LIBRARIES LIBGAV1_INCLUDE_DIR
VERSION_VAR _LIBGAV1_VERSION)
find_package_handle_standard_args(
libgav1
FOUND_VAR LIBGAV1_FOUND
REQUIRED_VARS LIBGAV1_LIBRARY LIBGAV1_LIBRARIES LIBGAV1_INCLUDE_DIR
VERSION_VAR _LIBGAV1_VERSION
)

# show the LIBGAV1_INCLUDE_DIR, LIBGAV1_LIBRARY and LIBGAV1_LIBRARIES variables
# only in the advanced view
Expand Down
35 changes: 15 additions & 20 deletions cmake/Modules/Findlibyuv.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,12 @@
#

find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_LIBYUV libyuv)
endif (PKG_CONFIG_FOUND)
endif(PKG_CONFIG_FOUND)

if (NOT LIBYUV_INCLUDE_DIR)
find_path(LIBYUV_INCLUDE_DIR
NAMES libyuv.h
PATHS ${_LIBYUV_INCLUDEDIR}
)
if(NOT LIBYUV_INCLUDE_DIR)
find_path(LIBYUV_INCLUDE_DIR NAMES libyuv.h PATHS ${_LIBYUV_INCLUDEDIR})
endif()

if(LIBYUV_INCLUDE_DIR AND NOT LIBYUV_VERSION)
Expand All @@ -43,23 +40,21 @@ if(LIBYUV_INCLUDE_DIR AND NOT LIBYUV_VERSION)
endif()
endif()

if (NOT LIBYUV_LIBRARY)
find_library(LIBYUV_LIBRARY
NAMES yuv
PATHS ${_LIBYUV_LIBDIR})
if(NOT LIBYUV_LIBRARY)
find_library(LIBYUV_LIBRARY NAMES yuv PATHS ${_LIBYUV_LIBDIR})
endif()

if (LIBYUV_LIBRARY)
set(LIBYUV_LIBRARIES
${LIBYUV_LIBRARIES}
${LIBYUV_LIBRARY})
endif (LIBYUV_LIBRARY)
if(LIBYUV_LIBRARY)
set(LIBYUV_LIBRARIES ${LIBYUV_LIBRARIES} ${LIBYUV_LIBRARY})
endif(LIBYUV_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libyuv
FOUND_VAR LIBYUV_FOUND
REQUIRED_VARS LIBYUV_LIBRARY LIBYUV_LIBRARIES LIBYUV_INCLUDE_DIR
VERSION_VAR _LIBYUV_VERSION)
find_package_handle_standard_args(
libyuv
FOUND_VAR LIBYUV_FOUND
REQUIRED_VARS LIBYUV_LIBRARY LIBYUV_LIBRARIES LIBYUV_INCLUDE_DIR
VERSION_VAR _LIBYUV_VERSION
)

# show the LIBYUV_INCLUDE_DIR, LIBYUV_LIBRARY and LIBYUV_LIBRARIES variables only
# in the advanced view
Expand Down
38 changes: 18 additions & 20 deletions cmake/Modules/Findrav1e.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,32 @@
#

find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_RAV1E rav1e)
endif (PKG_CONFIG_FOUND)
endif(PKG_CONFIG_FOUND)

if (NOT RAV1E_INCLUDE_DIR)
find_path(RAV1E_INCLUDE_DIR
NAMES rav1e.h
PATHS ${_RAV1E_INCLUDEDIR}
PATH_SUFFIXES rav1e
)
if(NOT RAV1E_INCLUDE_DIR)
find_path(
RAV1E_INCLUDE_DIR
NAMES rav1e.h
PATHS ${_RAV1E_INCLUDEDIR}
PATH_SUFFIXES rav1e
)
endif()

if (NOT RAV1E_LIBRARY)
find_library(RAV1E_LIBRARY
NAMES rav1e
PATHS ${_RAV1E_LIBDIR})
if(NOT RAV1E_LIBRARY)
find_library(RAV1E_LIBRARY NAMES rav1e PATHS ${_RAV1E_LIBDIR})
endif()

set(RAV1E_LIBRARIES
${RAV1E_LIBRARIES}
${RAV1E_LIBRARY}
${_RAV1E_LDFLAGS})
set(RAV1E_LIBRARIES ${RAV1E_LIBRARIES} ${RAV1E_LIBRARY} ${_RAV1E_LDFLAGS})

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(rav1e
FOUND_VAR RAV1E_FOUND
REQUIRED_VARS RAV1E_LIBRARY RAV1E_LIBRARIES RAV1E_INCLUDE_DIR
VERSION_VAR _RAV1E_VERSION)
find_package_handle_standard_args(
rav1e
FOUND_VAR RAV1E_FOUND
REQUIRED_VARS RAV1E_LIBRARY RAV1E_LIBRARIES RAV1E_INCLUDE_DIR
VERSION_VAR _RAV1E_VERSION
)

# show the RAV1E_INCLUDE_DIR, RAV1E_LIBRARY and RAV1E_LIBRARIES variables only
# in the advanced view
Expand Down
31 changes: 13 additions & 18 deletions cmake/Modules/Findsvt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,25 @@
#

find_package(PkgConfig QUIET)
if (PKG_CONFIG_FOUND)
if(PKG_CONFIG_FOUND)
pkg_check_modules(_SVT SvtAv1Enc)
endif (PKG_CONFIG_FOUND)
endif(PKG_CONFIG_FOUND)

find_path(SVT_INCLUDE_DIR
NAMES svt-av1/EbSvtAv1Enc.h
PATHS ${_SVT_INCLUDEDIR}
)
find_path(SVT_INCLUDE_DIR NAMES svt-av1/EbSvtAv1Enc.h PATHS ${_SVT_INCLUDEDIR})

find_library(SVT_LIBRARY
NAMES SvtAv1Enc
PATHS ${_SVT_LIBDIR})
find_library(SVT_LIBRARY NAMES SvtAv1Enc PATHS ${_SVT_LIBDIR})

if (SVT_LIBRARY)
set(SVT_LIBRARIES
${SVT_LIBRARIES}
${SVT_LIBRARY})
endif (SVT_LIBRARY)
if(SVT_LIBRARY)
set(SVT_LIBRARIES ${SVT_LIBRARIES} ${SVT_LIBRARY})
endif(SVT_LIBRARY)

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(svt
FOUND_VAR SVT_FOUND
REQUIRED_VARS SVT_LIBRARY SVT_LIBRARIES SVT_INCLUDE_DIR
VERSION_VAR _SVT_VERSION)
find_package_handle_standard_args(
svt
FOUND_VAR SVT_FOUND
REQUIRED_VARS SVT_LIBRARY SVT_LIBRARIES SVT_INCLUDE_DIR
VERSION_VAR _SVT_VERSION
)

# show the SVT_INCLUDE_DIR, SVT_LIBRARY and SVT_LIBRARIES variables only
# in the advanced view
Expand Down
4 changes: 1 addition & 3 deletions contrib/gdk-pixbuf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@ if(AVIF_BUILD_GDK_PIXBUF)
if(PKG_CONFIG_FOUND)
pkg_search_module(GDK_PIXBUF gdk-pixbuf-2.0)
if(GDK_PIXBUF_FOUND)
set(GDK_PIXBUF_SRCS
loader.c
)
set(GDK_PIXBUF_SRCS loader.c)
add_library(pixbufloader-avif ${GDK_PIXBUF_SRCS})

# This is required because glib stupidly uses invalid #define names, such as __G_LIB_H__…
Expand Down

0 comments on commit 0f85943

Please sign in to comment.