CMake: Remove target_use_packages

Instead, let's use a PKG::PKGNAME interface library, which simplifies
the linking and also allows us to use imported libraries from
find_package in the future.
This commit is contained in:
Sam Edwards 2018-09-18 20:00:03 -06:00
parent cf26888672
commit 1520d712d4
23 changed files with 56 additions and 88 deletions

View File

@ -73,7 +73,7 @@ if(WIN32)
endif() endif()
# Include global modules needed for configure scripts # Include global modules needed for configure scripts
include(PackageConfig) # Defines package_option AND target_use_packages include(PackageConfig) # Defines package_option
# Configure Panda3D # Configure Panda3D
include(dtool/PandaVersion.cmake) include(dtool/PandaVersion.cmake)

View File

@ -22,7 +22,7 @@ function(target_link_libraries target)
foreach(library ${ARGN}) foreach(library ${ARGN})
# This is a quick and dirty regex to tell targets apart from other stuff. # This is a quick and dirty regex to tell targets apart from other stuff.
# It just checks if it's alphanumeric and starts with p3/panda. # It just checks if it's alphanumeric and starts with p3/panda.
if(library MATCHES "^(p3|panda)[A-Za-z0-9]*$") if(library MATCHES "^(PKG::|p3|panda)[A-Za-z0-9]*$")
# We need to add "library"'s include directories to "target" # We need to add "library"'s include directories to "target"
# (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further
# dependencies will work) # dependencies will work)

View File

@ -317,7 +317,7 @@ function(add_python_target target)
set(sources ${ARGN}) set(sources ${ARGN})
add_library(${target} ${MODULE_TYPE} ${sources}) add_library(${target} ${MODULE_TYPE} ${sources})
target_use_packages(${target} PYTHON) target_link_libraries(${target} PKG::PYTHON)
if(BUILD_SHARED_LIBS) if(BUILD_SHARED_LIBS)
set_target_properties(${target} PROPERTIES set_target_properties(${target} PROPERTIES

View File

@ -6,6 +6,11 @@
# Assumes an attempt to find the package has already been made with # Assumes an attempt to find the package has already been made with
# find_package(). (i.e. relies on packagename_FOUND variable) # find_package(). (i.e. relies on packagename_FOUND variable)
# #
# The packages are added as imported/interface libraries in the PKG::
# namespace. If the package is not found (or disabled by the user),
# a dummy package will be created instead. Therefore, it is safe
# to link against the PKG::PACKAGENAME target unconditionally.
#
# Function: package_option # Function: package_option
# Usage: # Usage:
# package_option(package_name package_doc_string # package_option(package_name package_doc_string
@ -39,13 +44,6 @@
# 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 config_package above.
# #
#
# Function: target_use_packages
# Usage:
# target_use_packages(target [PACKAGES ...])
# Examples:
# target_use_packages(mylib PYTHON PNG)
#
# #
# package_option # package_option
@ -112,7 +110,6 @@ function(package_option name)
else() else()
list(FIND PANDA_DIST_USE_LICENSES ${license} license_index) list(FIND PANDA_DIST_USE_LICENSES ${license} license_index)
# If the license isn't in the accept listed, don't use the package # If the license isn't in the accept listed, don't use the package
message("INDEX for ${name}: ${license_index}")
if(${license_index} EQUAL "-1") if(${license_index} EQUAL "-1")
set(default OFF) set(default OFF)
else() else()
@ -147,19 +144,31 @@ function(package_option name)
# Create the option. # Create the option.
option("HAVE_${name}" "${cache_string}" "${default}") option("HAVE_${name}" "${cache_string}" "${default}")
# Create the library if the package is available.
add_library(PKG::${name} INTERFACE IMPORTED GLOBAL)
if(HAVE_${name}) if(HAVE_${name})
set(_PKG_${name}_INCLUDES ${${found_as}_INCLUDE_DIRS} ${${found_as}_INCLUDE_DIR} if(${found_as}_INCLUDE_DIRS)
CACHE INTERNAL "<Internal>") set(includes ${${found_as}_INCLUDE_DIRS})
if(${found_as}_LIBRARIES)
set(_PKG_${name}_LIBRARIES ${${found_as}_LIBRARIES} CACHE INTERNAL "<Internal>")
else() else()
set(_PKG_${name}_LIBRARIES "${${found_as}_LIBRARY}" CACHE INTERNAL "<Internal>") set(includes "${${found_as}_INCLUDE_DIR}")
endif() endif()
else() if(${found_as}_LIBRARIES)
unset(_PKG_${name}_INCLUDES CACHE) set(libs ${${found_as}_LIBRARIES})
unset(_PKG_${name}_LIBRARIES CACHE) else()
set(libs "${${found_as}_LIBRARY}")
endif()
target_link_libraries(PKG::${name} INTERFACE ${libs})
# This is gross, but we actually want to hide package include directories
# from Interrogate to make sure it relies on parser-inc instead, so we'll
# use some generator expressions to do that.
set_target_properties(PKG::${name} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES
"$<$<NOT:$<BOOL:$<TARGET_PROPERTY:IS_INTERROGATE>>>:${includes}>")
endif() endif()
endfunction() endfunction(package_option)
set(_ALL_CONFIG_PACKAGES CACHE INTERNAL "Internal variable") set(_ALL_CONFIG_PACKAGES CACHE INTERNAL "Internal variable")
@ -218,26 +227,3 @@ function(show_packages)
endif() endif()
endforeach() endforeach()
endfunction() endfunction()
#
# target_use_packages
#
# Useful macro that picks up a package located using find_package
# as dependencies of a target that is going to be built.
#
macro(target_use_packages target)
set(libs ${ARGV})
list(REMOVE_AT libs 0)
foreach(lib ${libs})
if(HAVE_${lib})
target_link_libraries("${target}" ${_PKG_${lib}_LIBRARIES})
# This is gross, but we actually want to hide package include directories
# from Interrogate to make sure it relies on parser-inc instead, so we'll
# use some generator expressions to do that.
target_include_directories("${target}" PUBLIC
$<$<NOT:$<BOOL:$<TARGET_PROPERTY:IS_INTERROGATE>>>:${_PKG_${lib}_INCLUDES}>)
endif()
endforeach(lib)
endmacro(target_use_packages)

View File

@ -49,8 +49,7 @@ composite_sources(p3dcparser P3DCPARSER_SOURCES)
add_component_library(p3dcparser NOINIT SYMBOL BUILDING_DIRECT_DCPARSER add_component_library(p3dcparser NOINIT SYMBOL BUILDING_DIRECT_DCPARSER
${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES})
target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA)
target_link_libraries(p3dcparser p3directbase panda) target_link_libraries(p3dcparser p3directbase panda PKG::PYTHON)
target_use_packages(p3dcparser PYTHON)
target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES})
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -17,8 +17,7 @@ set(P3DISTRIBUTED_SOURCES
add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED
${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES})
target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA)
target_link_libraries(p3distributed p3directbase p3dcparser panda) target_link_libraries(p3distributed p3directbase p3dcparser panda PKG::PYTHON)
target_use_packages(p3distributed PYTHON)
target_interrogate(p3distributed ALL) target_interrogate(p3distributed ALL)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -89,7 +89,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE
target_include_directories(p3dtoolbase PUBLIC target_include_directories(p3dtoolbase PUBLIC
${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}
${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR}) ${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR})
target_use_packages(p3dtoolbase THREADS EIGEN) target_link_libraries(p3dtoolbase PKG::EIGEN)
target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT})
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -52,14 +52,12 @@ set(INTERROGATE_SOURCES
composite_sources(interrogate INTERROGATE_SOURCES) composite_sources(interrogate INTERROGATE_SOURCES)
add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES})
target_link_libraries(interrogate target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub
p3cppParser p3dtoolconfig p3pystub) PKG::OPENSSL)
target_use_packages(interrogate OPENSSL)
add_executable(interrogate_module interrogate_module.cxx) add_executable(interrogate_module interrogate_module.cxx)
target_link_libraries(interrogate_module target_link_libraries(interrogate_module p3cppParser p3dtoolconfig p3pystub
p3cppParser p3dtoolconfig p3pystub) PKG::OPENSSL)
target_use_packages(interrogate_module OPENSSL)
if(NOT CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING)
add_executable(host_interrogate ALIAS interrogate) add_executable(host_interrogate ALIAS interrogate)

View File

@ -61,8 +61,7 @@ add_library(p3igateruntime
${P3IGATERUNTIME_HEADERS} ${P3IGATERUNTIME_SOURCES}) ${P3IGATERUNTIME_HEADERS} ${P3IGATERUNTIME_SOURCES})
set_target_properties(p3igateruntime PROPERTIES set_target_properties(p3igateruntime PROPERTIES
DEFINE_SYMBOL BUILDING_INTERROGATEDB) # HACK DEFINE_SYMBOL BUILDING_INTERROGATEDB) # HACK
target_link_libraries(p3igateruntime p3dtoolconfig) target_link_libraries(p3igateruntime p3dtoolconfig PKG::PYTHON)
target_use_packages(p3igateruntime PYTHON)
install(TARGETS p3igateruntime DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3igateruntime DESTINATION lib RUNTIME DESTINATION bin)
install(FILES ${P3IGATERUNTIME_HEADERS} DESTINATION include/panda3d) install(FILES ${P3IGATERUNTIME_HEADERS} DESTINATION include/panda3d)

View File

@ -73,8 +73,7 @@ composite_sources(p3prc P3PRC_SOURCES)
add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC
${P3PRC_HEADERS} ${P3PRC_SOURCES}) ${P3PRC_HEADERS} ${P3PRC_SOURCES})
target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(p3prc p3dtool) target_link_libraries(p3prc p3dtool PKG::OPENSSL)
target_use_packages(p3prc OPENSSL)
target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT})
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -23,8 +23,7 @@ if(HAVE_RAD_MSS)
composite_sources(p3miles_audio P3MILES_SOURCES) composite_sources(p3miles_audio P3MILES_SOURCES)
add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES})
set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO)
target_link_libraries(p3miles_audio panda) target_link_libraries(p3miles_audio panda PKG::MILES)
target_use_packages(p3miles_audio MILES)
install(TARGETS p3miles_audio DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3miles_audio DESTINATION lib RUNTIME DESTINATION bin)
endif() endif()
@ -41,8 +40,7 @@ if(HAVE_FMODEX)
composite_sources(p3fmod_audio P3FMOD_SOURCES) composite_sources(p3fmod_audio P3FMOD_SOURCES)
add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES})
set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO)
target_link_libraries(p3fmod_audio panda) target_link_libraries(p3fmod_audio panda PKG::FMODEX)
target_use_packages(p3fmod_audio FMODEX)
install(TARGETS p3fmod_audio DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3fmod_audio DESTINATION lib RUNTIME DESTINATION bin)
endif() endif()
@ -60,8 +58,7 @@ if(HAVE_OPENAL)
composite_sources(p3openal_audio P3OPENAL_SOURCES) composite_sources(p3openal_audio P3OPENAL_SOURCES)
add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES})
set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO)
target_link_libraries(p3openal_audio panda) target_link_libraries(p3openal_audio panda PKG::OPENAL)
target_use_packages(p3openal_audio OPENAL)
install(TARGETS p3openal_audio DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3openal_audio DESTINATION lib RUNTIME DESTINATION bin)
endif() endif()

View File

@ -109,8 +109,7 @@ set(P3BULLET_SOURCES
composite_sources(p3bullet P3BULLET_SOURCES) composite_sources(p3bullet P3BULLET_SOURCES)
add_library(p3bullet ${P3BULLET_SOURCES} ${P3BULLET_HEADERS}) add_library(p3bullet ${P3BULLET_SOURCES} ${P3BULLET_HEADERS})
set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET) set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET)
target_link_libraries(p3bullet panda) target_link_libraries(p3bullet panda PKG::BULLET)
target_use_packages(p3bullet BULLET)
target_interrogate(p3bullet ALL) target_interrogate(p3bullet ALL)
install(TARGETS p3bullet DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3bullet DESTINATION lib RUNTIME DESTINATION bin)

View File

@ -135,8 +135,8 @@ composite_sources(p3express P3EXPRESS_SOURCES)
add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS
${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS})
target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool) target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool
target_use_packages(p3express TAR ZLIB) PKG::TAR PKG::ZLIB)
target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT})
if(WIN32) if(WIN32)

View File

@ -22,8 +22,8 @@ set(P3FFMPEG_SOURCES
composite_sources(p3ffmpeg P3FFMPEG_SOURCES) composite_sources(p3ffmpeg P3FFMPEG_SOURCES)
add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES})
set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG)
target_link_libraries(p3ffmpeg panda) target_link_libraries(p3ffmpeg panda
target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) PKG::FFMPEG PKG::SWSCALE PKG::SWRESAMPLE)
install(TARGETS p3ffmpeg DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3ffmpeg DESTINATION lib RUNTIME DESTINATION bin)
install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d)

View File

@ -15,8 +15,7 @@ composite_sources(p3glgsg P3GLGSG_SOURCES)
add_component_library(p3glgsg SYMBOL BUILDING_PANDA_GLGSG add_component_library(p3glgsg SYMBOL BUILDING_PANDA_GLGSG
${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES})
target_link_libraries(p3glgsg p3glstuff panda target_link_libraries(p3glgsg p3glstuff panda
${OPENGL_LIBRARIES}) PKG::CG PKG::GL)
target_use_packages(p3glgsg CG)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)
install(TARGETS p3glgsg DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3glgsg DESTINATION lib RUNTIME DESTINATION bin)

View File

@ -170,8 +170,8 @@ set(P3GOBJ_IGATEEXT
composite_sources(p3gobj P3GOBJ_SOURCES) composite_sources(p3gobj P3GOBJ_SOURCES)
add_component_library(p3gobj NOINIT SYMBOL BUILDING_PANDA_GOBJ add_component_library(p3gobj NOINIT SYMBOL BUILDING_PANDA_GOBJ
${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES})
target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_link_libraries(p3gobj p3gsgbase p3pnmimage
target_use_packages(p3gobj ZLIB SQUISH CG) PKG::ZLIB PKG::SQUISH PKG::CG)
target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT})
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -46,8 +46,7 @@ set(P3LINMATH_SOURCES
composite_sources(p3linmath P3LINMATH_SOURCES) composite_sources(p3linmath P3LINMATH_SOURCES)
add_component_library(p3linmath SYMBOL BUILDING_PANDA_LINMATH add_component_library(p3linmath SYMBOL BUILDING_PANDA_LINMATH
${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES})
target_link_libraries(p3linmath p3pandabase pandaexpress) target_link_libraries(p3linmath p3pandabase pandaexpress PKG::EIGEN)
target_use_packages(p3linmath EIGEN)
target_interrogate(p3linmath ALL) target_interrogate(p3linmath ALL)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -63,8 +63,7 @@ set(P3MATHUTIL_SOURCES
composite_sources(p3mathutil P3MATHUTIL_SOURCES) composite_sources(p3mathutil P3MATHUTIL_SOURCES)
add_component_library(p3mathutil SYMBOL BUILDING_PANDA_MATHUTIL add_component_library(p3mathutil SYMBOL BUILDING_PANDA_MATHUTIL
${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES})
target_link_libraries(p3mathutil p3event) target_link_libraries(p3mathutil p3event PKG::FFTW)
target_use_packages(p3mathutil FFTW)
target_interrogate(p3mathutil ALL) target_interrogate(p3mathutil ALL)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -87,8 +87,7 @@ composite_sources(p3ode P3ODE_SOURCES)
add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS})
set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE)
target_compile_definitions(p3ode PUBLIC dSINGLE) target_compile_definitions(p3ode PUBLIC dSINGLE)
target_link_libraries(p3ode p3igateruntime panda) target_link_libraries(p3ode p3igateruntime panda PKG::ODE)
target_use_packages(p3ode ODE)
target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT})
install(TARGETS p3ode DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3ode DESTINATION lib RUNTIME DESTINATION bin)

View File

@ -33,8 +33,7 @@ set(P3PNMIMAGETYPES_SOURCES
composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES)
add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES
${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES})
target_link_libraries(p3pnmimagetypes p3pnmimage) target_link_libraries(p3pnmimagetypes p3pnmimage PKG::JPEG PKG::TIFF PKG::PNG)
target_use_packages(p3pnmimagetypes JPEG TIFF PNG)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)
install(TARGETS p3pnmimagetypes DESTINATION lib RUNTIME DESTINATION bin) install(TARGETS p3pnmimagetypes DESTINATION lib RUNTIME DESTINATION bin)

View File

@ -20,8 +20,7 @@ set(P3PNMTEXT_SOURCES
composite_sources(p3pnmtext P3PNMTEXT_SOURCES) composite_sources(p3pnmtext P3PNMTEXT_SOURCES)
add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT
${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES})
target_link_libraries(p3pnmtext p3parametrics p3pnmimage) target_link_libraries(p3pnmtext p3parametrics p3pnmimage PKG::FREETYPE)
target_use_packages(p3pnmtext FREETYPE)
target_interrogate(p3pnmtext ALL) target_interrogate(p3pnmtext ALL)
if(NOT BUILD_METALIBS) if(NOT BUILD_METALIBS)

View File

@ -26,8 +26,7 @@ set(GTKSTATS_SOURCES
composite_sources(gtkstats GTKSTATS_SOURCES) composite_sources(gtkstats GTKSTATS_SOURCES)
add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES})
target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub) target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub PKG::GTK2)
target_use_packages(gtkstats GTK2)
# This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and # This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and
# pstats everywhere else (as the Win32 GUI is not built). # pstats everywhere else (as the Win32 GUI is not built).

View File

@ -10,8 +10,7 @@ set(P3PROGBASE_SOURCES
composite_sources(p3progbase P3PROGBASE_SOURCES) composite_sources(p3progbase P3PROGBASE_SOURCES)
add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES})
target_link_libraries(p3progbase p3pandatoolbase panda) target_link_libraries(p3progbase p3pandatoolbase panda PKG::ZLIB)
target_use_packages(p3progbase ZLIB)
# This is only needed for binaries in the pandatool package. It is not useful # This is only needed for binaries in the pandatool package. It is not useful
# for user applications, so it is not installed. # for user applications, so it is not installed.