CMake: Rename "config_package" function to "package_status"

The latter name is more consistent with what it does:
indicates the status/purpose/options of the package to
the user.
This commit is contained in:
Sam Edwards 2018-11-08 21:15:00 -07:00
parent 98fde4f7e0
commit 2b1554a44c
2 changed files with 49 additions and 49 deletions

View File

@ -35,12 +35,12 @@
# variables provided by find_package() # variables provided by find_package()
# #
# #
# Function: config_package # Function: package_status
# Usage: # Usage:
# config_package(package_name "Package description" ["Config summary"]) # package_status(package_name "Package description" ["Config summary"])
# Examples: # Examples:
# config_package(OpenAL "OpenAL Audio Output") # package_status(OpenAL "OpenAL Audio Output")
# config_package(ROCKET "Rocket" "without Python bindings") # package_status(ROCKET "Rocket" "without Python bindings")
# #
# #
# Function: show_packages # Function: show_packages
@ -48,7 +48,7 @@
# show_packages() # show_packages()
# #
# This prints the package usage report using the information provided in # This prints the package usage report using the information provided in
# calls to config_package above. # calls to package_status above.
# #
# #
@ -214,22 +214,22 @@ endfunction(package_option)
set(_ALL_CONFIG_PACKAGES CACHE INTERNAL "Internal variable") set(_ALL_CONFIG_PACKAGES CACHE INTERNAL "Internal variable")
# #
# config_package # package_status
# #
function(config_package name desc) function(package_status name desc)
set(note "") set(note "")
foreach(arg ${ARGN}) foreach(arg ${ARGN})
set(note "${arg}") set(note "${arg}")
endforeach() endforeach()
if(NOT PANDA_DID_SET_OPTION_${name}) if(NOT PANDA_DID_SET_OPTION_${name})
message(SEND_ERROR "config_package(${name}) was called before package_option(${name}). message(SEND_ERROR "package_status(${name}) was called before package_option(${name}).
This is a bug in the cmake build scripts.") This is a bug in the cmake build scripts.")
endif() endif()
list(FIND _ALL_CONFIG_PACKAGES "${name}" called_twice) list(FIND _ALL_CONFIG_PACKAGES "${name}" called_twice)
if(called_twice GREATER -1) if(called_twice GREATER -1)
message(SEND_ERROR "config_package(${name}) was called twice. message(SEND_ERROR "package_status(${name}) was called twice.
This is a bug in the cmake build scripts.") This is a bug in the cmake build scripts.")
else() else()
list(APPEND _ALL_CONFIG_PACKAGES "${name}") list(APPEND _ALL_CONFIG_PACKAGES "${name}")

View File

@ -102,9 +102,9 @@ alignment, which could impact memory usage on very-low-memory
platforms. Currently experimental." ON) platforms. Currently experimental." ON)
if(LINMATH_ALIGN) if(LINMATH_ALIGN)
config_package(EIGEN "Eigen linear algebra library" "vectorization enabled in build") package_status(EIGEN "Eigen linear algebra library" "vectorization enabled in build")
else() else()
config_package(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build") package_status(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build")
endif() endif()
# #
@ -122,9 +122,9 @@ option(REPORT_OPENSSL_ERRORS
error messages when they occur." ${IS_DEBUG_BUILD}) error messages when they occur." ${IS_DEBUG_BUILD})
if(REPORT_OPENSSL_ERRORS) if(REPORT_OPENSSL_ERRORS)
config_package(OPENSSL "OpenSSL" "with verbose error reporting") package_status(OPENSSL "OpenSSL" "with verbose error reporting")
else() else()
config_package(OPENSSL "OpenSSL") package_status(OPENSSL "OpenSSL")
endif() endif()
# #
@ -134,7 +134,7 @@ endif()
# JPEG: # JPEG:
find_package(JPEG QUIET) find_package(JPEG QUIET)
package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.")
config_package(JPEG "libjpeg") package_status(JPEG "libjpeg")
# PNG: # PNG:
find_package(PNG QUIET) find_package(PNG QUIET)
@ -142,17 +142,17 @@ package_option(PNG
DEFAULT ON DEFAULT ON
"Enable support for loading .png images." "Enable support for loading .png images."
IMPORTED_AS PNG::PNG) IMPORTED_AS PNG::PNG)
config_package(PNG "libpng") package_status(PNG "libpng")
# TIFF: # TIFF:
find_package(TIFF QUIET) find_package(TIFF QUIET)
package_option(TIFF "Enable support for loading .tif images.") package_option(TIFF "Enable support for loading .tif images.")
config_package(TIFF "libtiff") package_status(TIFF "libtiff")
# OpenEXR: # OpenEXR:
find_package(OpenEXR QUIET) find_package(OpenEXR QUIET)
package_option(OPENEXR "Enable support for loading .exr images.") package_option(OPENEXR "Enable support for loading .exr images.")
config_package(OPENEXR "OpenEXR") package_status(OPENEXR "OpenEXR")
# #
# ------------ LIBTAR ------------ # ------------ LIBTAR ------------
@ -160,7 +160,7 @@ config_package(OPENEXR "OpenEXR")
find_package(Tar QUIET) find_package(Tar QUIET)
package_option(TAR package_option(TAR
"This is used to optimize patch generation against tar files.") "This is used to optimize patch generation against tar files.")
config_package(TAR "libtar") package_status(TAR "libtar")
# #
# ------------ FFTW ------------ # ------------ FFTW ------------
@ -175,7 +175,7 @@ package_option(FFTW
FOUND_AS "FFTW3" FOUND_AS "FFTW3"
LICENSE "GPL") LICENSE "GPL")
config_package(FFTW "FFTW") package_status(FFTW "FFTW")
# #
# ------------ libsquish ------------ # ------------ libsquish ------------
@ -187,7 +187,7 @@ package_option(SQUISH
"Enables support for automatic compression of DXT textures." "Enables support for automatic compression of DXT textures."
FOUND_AS LIBSQUISH) FOUND_AS LIBSQUISH)
config_package(SQUISH "libsquish") package_status(SQUISH "libsquish")
# #
# ------------ Nvidia Cg ------------ # ------------ Nvidia Cg ------------
@ -214,7 +214,7 @@ elseif(HAVE_CGDX9)
else() else()
set(cg_apis "WITHOUT rendering backend support") set(cg_apis "WITHOUT rendering backend support")
endif() endif()
config_package(CG "Nvidia Cg Shading Language" "${cg_apis}") package_status(CG "Nvidia Cg Shading Language" "${cg_apis}")
# #
# ------------ VRPN ------------ # ------------ VRPN ------------
@ -226,7 +226,7 @@ package_option(VRPN
"Enables support for connecting to VRPN servers. This is only needed if you "Enables support for connecting to VRPN servers. This is only needed if you
are building Panda3D for a fixed VRPN-based VR installation.") are building Panda3D for a fixed VRPN-based VR installation.")
config_package(VRPN "VRPN") package_status(VRPN "VRPN")
# #
# ------------ zlib ------------ # ------------ zlib ------------
@ -238,7 +238,7 @@ package_option(ZLIB
"Enables support for compression of Panda assets." "Enables support for compression of Panda assets."
IMPORTED_AS ZLIB::ZLIB) IMPORTED_AS ZLIB::ZLIB)
config_package(ZLIB "zlib") package_status(ZLIB "zlib")
# #
# ------------ FFmpeg ------------ # ------------ FFmpeg ------------
@ -264,7 +264,7 @@ elseif(HAVE_SWRESAMPLE)
else() else()
set(ffmpeg_features "without resampling/rescaling support") set(ffmpeg_features "without resampling/rescaling support")
endif() endif()
config_package(FFMPEG "FFmpeg" "${ffmpeg_features}") package_status(FFMPEG "FFmpeg" "${ffmpeg_features}")
# #
# ------------ Audio libraries ------------ # ------------ Audio libraries ------------
@ -278,7 +278,7 @@ package_option(RAD_MSS
if you need to enable this option." if you need to enable this option."
FOUND_AS Miles FOUND_AS Miles
LICENSE "Miles") LICENSE "Miles")
config_package(RAD_MSS "Miles Sound System") package_status(RAD_MSS "Miles Sound System")
# FMOD Ex # FMOD Ex
find_package(FMODEx QUIET) find_package(FMODEx QUIET)
@ -287,7 +287,7 @@ package_option(FMODEX
from Firelight Technologies. This audio library is free for non-commercial from Firelight Technologies. This audio library is free for non-commercial
use." use."
LICENSE "FMOD") LICENSE "FMOD")
config_package(FMODEX "FMOD Ex sound library") package_status(FMODEX "FMOD Ex sound library")
# OpenAL # OpenAL
find_package(OpenAL QUIET) find_package(OpenAL QUIET)
@ -297,7 +297,7 @@ package_option(OPENAL
on most platforms this will imply OpenAL Soft, which is LGPL licensed." on most platforms this will imply OpenAL Soft, which is LGPL licensed."
IMPORTED_AS OpenAL::OpenAL IMPORTED_AS OpenAL::OpenAL
LICENSE "LGPL") LICENSE "LGPL")
config_package(OPENAL "OpenAL sound library") package_status(OPENAL "OpenAL sound library")
if(OPENAL_FOUND AND APPLE) if(OPENAL_FOUND AND APPLE)
set(HAVE_OPENAL_FRAMEWORK YES) set(HAVE_OPENAL_FRAMEWORK YES)
@ -317,7 +317,7 @@ package_option(FREETYPE
Panda3D will only be able to read fonts specially made with egg-mkfont." Panda3D will only be able to read fonts specially made with egg-mkfont."
IMPORTED_AS freetype) IMPORTED_AS freetype)
config_package(FREETYPE "FreeType") package_status(FREETYPE "FreeType")
# HarfBuzz # HarfBuzz
@ -329,7 +329,7 @@ package_option(HARFBUZZ
"This enables support for the HarfBuzz text shaping library." "This enables support for the HarfBuzz text shaping library."
IMPORTED_AS harfbuzz::harfbuzz) IMPORTED_AS harfbuzz::harfbuzz)
config_package(HARFBUZZ "HarfBuzz") package_status(HARFBUZZ "HarfBuzz")
# GTK2 # GTK2
@ -338,7 +338,7 @@ set(Freetype_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2
set(GTK2_GTK_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2 set(GTK2_GTK_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2
find_package(GTK2 QUIET COMPONENTS gtk) find_package(GTK2 QUIET COMPONENTS gtk)
package_option(GTK2) package_option(GTK2)
config_package(GTK2 "gtk+-2") package_status(GTK2 "gtk+-2")
# #
# ------------ Physics engines ------------ # ------------ Physics engines ------------
@ -350,7 +350,7 @@ find_package(Bullet MODULE QUIET)
package_option(BULLET package_option(BULLET
"Enable this option to support game dynamics with the Bullet physics library.") "Enable this option to support game dynamics with the Bullet physics library.")
config_package(BULLET "Bullet physics") package_status(BULLET "Bullet physics")
# ODE # ODE
find_package(ODE QUIET) find_package(ODE QUIET)
@ -360,7 +360,7 @@ package_option(ODE
LICENSE "BSD-3" LICENSE "BSD-3"
IMPORTED_AS ODE::ODE) IMPORTED_AS ODE::ODE)
config_package(ODE "Open Dynamics Engine") package_status(ODE "Open Dynamics Engine")
# PhysX # PhysX
find_package(PhysX QUIET) find_package(PhysX QUIET)
@ -369,7 +369,7 @@ package_option(PHYSX
"Enable this option to support game dynamics with Nvidia PhysX." "Enable this option to support game dynamics with Nvidia PhysX."
LICENSE "Nvidia") LICENSE "Nvidia")
config_package(PHYSX "Nvidia PhysX") package_status(PHYSX "Nvidia PhysX")
# #
# ------------ SpeedTree ------------ # ------------ SpeedTree ------------
@ -382,7 +382,7 @@ package_option(SPEEDTREE
"Enable this option to include scenegraph support for SpeedTree trees." "Enable this option to include scenegraph support for SpeedTree trees."
LICENSE "SpeedTree") LICENSE "SpeedTree")
config_package(SPEEDTREE "SpeedTree") package_status(SPEEDTREE "SpeedTree")
# #
# ------------ Rendering APIs ------------ # ------------ Rendering APIs ------------
@ -396,7 +396,7 @@ package_option(GL
FOUND_AS OPENGL FOUND_AS OPENGL
IMPORTED_AS OpenGL::GL) IMPORTED_AS OpenGL::GL)
config_package(GL "OpenGL") package_status(GL "OpenGL")
# OpenGL ES 1 # OpenGL ES 1
find_package(OpenGLES1 QUIET) find_package(OpenGLES1 QUIET)
@ -405,7 +405,7 @@ package_option(GLES1
"Enable support for OpenGL ES 1.x rendering APIs." "Enable support for OpenGL ES 1.x rendering APIs."
FOUND_AS OPENGLES1) FOUND_AS OPENGLES1)
config_package(GLES1 "OpenGL ES 1.x") package_status(GLES1 "OpenGL ES 1.x")
# OpenGL ES 2 # OpenGL ES 2
find_package(OpenGLES2 QUIET) find_package(OpenGLES2 QUIET)
@ -414,7 +414,7 @@ package_option(GLES2
"Enable support for OpenGL ES 2.x rendering APIs." "Enable support for OpenGL ES 2.x rendering APIs."
FOUND_AS OPENGLES2) FOUND_AS OPENGLES2)
config_package(GLES2 "OpenGL ES 2.x") package_status(GLES2 "OpenGL ES 2.x")
# #
# ------------ Display APIs ------------ # ------------ Display APIs ------------
@ -444,9 +444,9 @@ if(HAVE_GLX AND NOT HAVE_GLX_AVAILABLE)
endif() endif()
if(HAVE_GLX) if(HAVE_GLX)
config_package(X11 "X11" "with GLX") package_status(X11 "X11" "with GLX")
else() else()
config_package(X11 "X11" "without GLX") package_status(X11 "X11" "without GLX")
endif() endif()
# EGL # EGL
@ -456,7 +456,7 @@ package_option(EGL
"Enable support for the Khronos EGL context management interface for "Enable support for the Khronos EGL context management interface for
OpenGL ES. This is necessary to support OpenGL ES under X11.") OpenGL ES. This is necessary to support OpenGL ES under X11.")
config_package(EGL "EGL") package_status(EGL "EGL")
# Direct3D 9 # Direct3D 9
@ -466,7 +466,7 @@ package_option(DX9
"Enable support for DirectX 9. This is typically only viable on Windows." "Enable support for DirectX 9. This is typically only viable on Windows."
FOUND_AS DIRECT3D9) FOUND_AS DIRECT3D9)
config_package(DX9 "Direct3D 9.x") package_status(DX9 "Direct3D 9.x")
# #
# ------------ Vision tools ------------ # ------------ Vision tools ------------
@ -479,7 +479,7 @@ package_option(OPENCV
"Enable support for OpenCV. This will be built into the 'vision' package." "Enable support for OpenCV. This will be built into the 'vision' package."
FOUND_AS OpenCV) FOUND_AS OpenCV)
config_package(OPENCV "OpenCV") package_status(OPENCV "OpenCV")
# ARToolKit # ARToolKit
find_package(ARToolKit QUIET) find_package(ARToolKit QUIET)
@ -487,7 +487,7 @@ find_package(ARToolKit QUIET)
package_option(ARTOOLKIT package_option(ARTOOLKIT
"Enable support for ARToolKit. This will be built into the 'vision' package.") "Enable support for ARToolKit. This will be built into the 'vision' package.")
config_package(ARTOOLKIT "ARToolKit") package_status(ARTOOLKIT "ARToolKit")
######## ########
# TODO # # TODO #
@ -495,15 +495,15 @@ config_package(ARTOOLKIT "ARToolKit")
# Find and configure Awesomium # Find and configure Awesomium
#find_package(Awesomium) #find_package(Awesomium)
#config_package(AWESOMIUM COMMENT "Awesomium") #package_status(AWESOMIUM COMMENT "Awesomium")
# Find and configure OpenMaya # Find and configure OpenMaya
#find_package(OpenMaya) #find_package(OpenMaya)
#config_package(MAYA COMMENT "OpenMaya") #package_status(MAYA COMMENT "OpenMaya")
# Find and configure FCollada # Find and configure FCollada
#find_package(FCollada) #find_package(FCollada)
#config_package(FCOLLADA COMMENT "FCollada") #package_status(FCOLLADA COMMENT "FCollada")
#if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) #if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM)
# set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") # set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM")
# if(USE_COLLADA) # if(USE_COLLADA)
@ -517,11 +517,11 @@ config_package(ARTOOLKIT "ARToolKit")
# Find and configure Assimp # Find and configure Assimp
#find_package(Assimp) #find_package(Assimp)
#config_package(ASSIMP COMMENT "Assimp") #package_status(ASSIMP COMMENT "Assimp")
# Find and configure libRocket # Find and configure libRocket
#find_package(Rocket) #find_package(Rocket)
#config_package(ROCKET COMMENT "libRocket") #package_status(ROCKET COMMENT "libRocket")
#if(HAVE_ROCKET AND HAVE_PYTHON) #if(HAVE_ROCKET AND HAVE_PYTHON)
# # Check for rocket python bindings # # Check for rocket python bindings
# if(FOUND_ROCKET_PYTHON) # if(FOUND_ROCKET_PYTHON)
@ -543,4 +543,4 @@ config_package(ARTOOLKIT "ARToolKit")
# Find and configure Vorbis # Find and configure Vorbis
#find_package(Vorbis) #find_package(Vorbis)
#config_package(VORBIS COMMENT "Vorbis Ogg decoder") #package_status(VORBIS COMMENT "Vorbis Ogg decoder")