CMake: Configure: Add XYZZY_LIBRARY(IES) variable declarations for Find packages. Other cleanup and reorginizaion.

This commit is contained in:
kestred 2013-12-12 12:30:42 -07:00
parent 4fa31ee4d6
commit d1572173d3
20 changed files with 127 additions and 90 deletions

View File

@ -9,11 +9,13 @@
# CG_IPATH - the NvidiaCg include directory
# CG_LPATH - the NvidiaCg library directory
# CG_LIBS - the Cg components found
# CG_LIBRARY - the path to the library binary
#
# FOUND_CGGL - system has CgGL
# CGGL_IPATH - the CgGL include directory
# CGGL_LPATH - the CgGL library directory
# CGGL_LIBS - the CgGL components found
# FOUND_CGGL - system has CgGL
# CGGL_IPATH - the CgGL include directory
# CGGL_LPATH - the CgGL library directory
# CGGL_LIBS - the CgGL components found
# CGGL_LIBRARY - the path to the library binary
#
@ -58,8 +60,6 @@ macro(find_cggl)
set(CGGL_LPATH "${CGGL_LIBRARY_DIR}" CACHE PATH "The path to the CgGL library directory.") # Library path
unset(CGGL_LIBRARY_DIR)
unset(CGGL_LIBRARY CACHE)
# Check if we have everything we need
if(CGGL_IPATH AND CGGL_LPATH)
@ -73,6 +73,7 @@ macro(find_cggl)
mark_as_advanced(CGGL_IPATH)
mark_as_advanced(CGGL_LPATH)
mark_as_advanced(CGGL_LIBRARY)
endif()
endmacro()
@ -165,7 +166,6 @@ else()
set(CG_LPATH "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path
unset(CG_LIBRARY_DIR)
unset(CG_LIBRARY CACHE)
endif()
# Check if we have everything we need
@ -186,4 +186,5 @@ else()
mark_as_advanced(CG_IPATH)
mark_as_advanced(CG_LPATH)
mark_as_advanced(CG_LIBRARY)
endif()

View File

@ -6,8 +6,9 @@
#
# It sets the following variables:
# FOUND_FFTW - true if fftw is found on the system
# FFTW_IPATH - the fftw include directory
# FFTW_LPATH - the fftw library directory
# FFTW_IPATH - the fftw include directory
# FFTW_LPATH - the fftw library directory
# FFTW_LIBRARY - the path to the library binary
#
# The following variables will be checked by the function
# FFTW_USE_STATIC_LIBS - if true, only static libraries are found
@ -121,9 +122,9 @@ else()
endif()
unset(FFTW_LIBRARY_DIR)
unset(FFTW_LIBRARY CACHE)
mark_as_advanced(FFTW_IPATH)
mark_as_advanced(FFTW_LPATH)
mark_as_advanced(FFTW_LIBRARY)
mark_as_advanced(FFTW_FFTWF_LIBRARY)
mark_as_advanced(FFTW_FFTWL_LIBRARY)
endif()

View File

@ -9,6 +9,10 @@
# FMODEX_IPATH - the FMOD Ex include directory
# FMODEX_LPATH - the FMOD Ex library directory
# FMODEX_LIBS - the FMOD Ex components found
# FMODEX_LIBRARY - the path to the library binary
#
# FMODEX_32_LIBRARY - the filepath of the Miles SDK 32-bit library
# FMOXEX_64_LIBRARY - the filepath of the Miles SDK 64-bit library
#
if(FMODEX_LPATH AND FMODEX_IPATH)
@ -89,8 +93,8 @@ else()
mark_as_advanced(FMODEX_IPATH)
mark_as_advanced(FMODEX_LPATH)
mark_as_advanced(FMODEX_LIBRARY)
mark_as_advanced(FMODEX_32_LIBRARY)
mark_as_advanced(FMODEX_64_LIBRARY)
unset(FMODEX_LIBRARY_DIR)
unset(FMODEX_LIBRARY CACHE)
endif()

View File

@ -5,34 +5,42 @@
# find_package(Miles [REQUIRED] [QUIET])
#
# It sets the following variables:
# FOUND_RAD_MSS - system has Radgame's Miles SDK
# RAD_MSS_IPATH - the Miles SDK include directory
# RAD_MSS_LPATH - the Miles SDK library directory
# RAD_MSS_LIBS - the Miles SDK components found
# FOUND_RAD_MSS - system has Radgame's Miles SDK
# RAD_MSS_IPATH - the Miles SDK include directory
# RAD_MSS_LPATH - the Miles SDK library directory
# RAD_MSS_LIBS - the Miles SDK components found
# RAD_MSS_LIBRARY - the path to the library binary
#
# RAD_MSS_RELEASE_LIBRARY - the filepath of the Miles SDK release library
# RAD_MSS_RELWITHDEBINFO_LIBRARY - the filepath of the Miles SDK optimize debug library
# RAD_MSS_MINSIZE_LIBRARY - the filepath of the Miles SDK minimum size library
# RAD_MSS_DEBUG_LIBRARY - the filepath of the Miles SDK debug library
#
if(RAD_MSS_IPATH AND RAD_MSS_LPATH)
set(FOUND_RAD_MSS TRUE)
set(RAD_MSS_LIBS Mss32)
# Choose library
if(CMAKE_BUILD_TYPE MATCHES "Release" AND RAD_MSS_RELEASE_LIBRARY)
unset(RAD_MSS_LPATH)
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_RELEASE_LIBRARY}" PATH)
set(RAD_MSS_LPATH "${RAD_MSS_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
unset(RAD_MSS_LIBRARY_DIR)
unset(RAD_MSS_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND RAD_MSS_RELWITHDEBINFO_LIBRARY)
unset(RAD_MSS_LPATH)
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_RELWITHDEBINFO_LIBRARY}" PATH)
set(RAD_MSS_LPATH "${RAD_MSS_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
unset(RAD_MSS_LIBRARY_DIR)
unset(RAD_MSS_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND RAD_MSS_MINSIZE_LIBRARY)
unset(RAD_MSS_LPATH)
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_MINSIZE_LIBRARY}" PATH)
set(RAD_MSS_LPATH "${RAD_MSS_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
unset(RAD_MSS_LIBRARY_DIR)
unset(RAD_MSS_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND RAD_MSS_DEBUG_LIBRARY)
unset(RAD_MSS_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
endif()
# Set library path
if(DEFINED RAD_MSS_LIBRARY)
unset(RAD_MSS_LPATH)
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_DEBUG_LIBRARY}" PATH)
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_LIBRARY}" PATH)
set(RAD_MSS_LPATH "${RAD_MSS_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
unset(RAD_MSS_LIBRARY_DIR)
endif()
@ -95,7 +103,20 @@ else()
"C:/Program Files (x86)/Miles6"
PATH_SUFFIXES "lib" "lib32"
)
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_RELEASE_LIBRARY}" PATH)
# Choose library
if(CMAKE_BUILD_TYPE MATCHES "Release" AND RAD_MSS_RELEASE_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND RAD_MSS_RELWITHDEBINFO_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND RAD_MSS_MINSIZE_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND RAD_MSS_DEBUG_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
endif()
# Set library path
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_LIBRARY}" PATH)
set(RAD_MSS_LPATH "${RAD_MSS_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
# Check if we have everything we need
@ -107,6 +128,7 @@ else()
unset(RAD_MSS_LIBRARY_DIR)
mark_as_advanced(RAD_MSS_IPATH)
mark_as_advanced(RAD_MSS_LPATH)
mark_as_advanced(RAD_MSS_LIBRARY)
mark_as_advanced(RAD_MSS_DEBUG_LIBRARY)
mark_as_advanced(RAD_MSS_RELEASE_LIBRARY)
mark_as_advanced(RAD_MSS_RELWITHDEBINFO_LIBRARY)

View File

@ -5,12 +5,14 @@
# find_package(Squish [REQUIRED] [QUIET])
#
# It sets the following variables:
# FOUND_SQUISH - system has squish
# SQUISH_IPATH - the squish include directory
# SQUISH_LPATH - the squish library directory
# FOUND_SQUISH - system has squish
# SQUISH_IPATH - the squish include directory
# SQUISH_LPATH - the squish library directory
# SQUISH_LIBS - the squish components found
# SQUISH_LIBRARY - the path to the library binary
#
# SQUISH_RELEASE_LIBRARY - the filepath of the squish release library
# SQUISH_DEBUG_LIBRARY - the filepath of the squish debug library
# SQUISH_LIBS - the squish components found
# SQUISH_DEBUG_LIBRARY - the filepath of the squish debug library
#
if(SQUISH_IPATH AND SQUISH_LPATH)
@ -92,9 +94,9 @@ else()
endif()
unset(SQUISH_LIBRARY_DIR)
unset(SQUISH_LIBRARY CACHE)
mark_as_advanced(SQUISH_IPATH)
mark_as_advanced(SQUISH_LPATH)
mark_as_advanced(SQUISH_LIBRARY)
mark_as_advanced(SQUISH_RELEASE_LIBRARY)
mark_as_advanced(SQUISH_DEBUG_LIBRARY)
endif()
endif()

View File

@ -5,10 +5,11 @@
# find_package(Tar [REQUIRED] [QUIET])
#
# It sets the following variables:
# FOUND_TAR - system has libtar
# TAR_IPATH - the tar include directory
# TAR_LPATH - the tar library directory
# TAR_LIBS - the tar components found
# FOUND_TAR - system has libtar
# TAR_IPATH - the tar include directory
# TAR_LPATH - the tar library directory
# TAR_LIBS - the tar components found
# TAR_LIBRARY - the path to the library binary
#
if(TAR_IPATH AND TAR_LPATH)
@ -42,7 +43,7 @@ else()
endif()
unset(TAR_LIBRARY_DIR)
unset(TAR_LIBRARY CACHE)
mark_as_advanced(TAR_IPATH)
mark_as_advanced(TAR_LPATH)
mark_as_advanced(TAR_LIBRARY)
endif()

View File

@ -5,9 +5,10 @@
# find_package(Tar [REQUIRED] [QUIET])
#
# It sets the following variables:
# FOUND_VRPN - system has libvrpn
# VRPN_IPATH - the vrpn include directory
# VRPN_LPATH - the vrpn library directory
# FOUND_VRPN - system has libvrpn
# VRPN_IPATH - the vrpn include directory
# VRPN_LPATH - the vrpn library directory
# VRPN_LIBRARY - the path to the library binary
#
if(VRPN_IPATH AND VRPN_LPATH)
@ -41,7 +42,7 @@ else()
endif()
unset(VRPN_LIBRARY_DIR)
unset(VRPN_LIBRARY CACHE)
mark_as_advanced(VRPN_IPATH)
mark_as_advanced(VRPN_LPATH)
mark_as_advanced(VRPN_LIBRARY)
endif()

View File

@ -20,13 +20,10 @@ if(FREETYPE_FOUND)
set(FREETYPE_VERSION ${FREETYPE_VERSION_STRING})
unset(FREETYPE_FOUND)
unset(FREETYPE_LIBRARY)
unset(FREETYPE_INCLUDE_DIR)
unset(FREETYPE_LIBRARY_DIR)
endif()
unset(FREETYPE_LIBRARY CACHE)
unset(FREETYPE_LIBRARIES CACHE)
unset(FREETYPE_INCLUDE_DIRS CACHE)
unset(FREETYPE_INCLUDE_DIR_ft2build CACHE)
unset(FREETYPE_INCLUDE_DIR_freetype2 CACHE)
unset(FREETYPE_INCLUDE_DIR_freetype2 CACHE)

View File

@ -18,6 +18,8 @@ if(GTK2_FOUND)
mark_as_advanced(GTK_IPATH)
mark_as_advanced(GTK_LPATH)
set(GTK_LIBRARIES GTK2_LIBRARIES)
unset(GTK2_FOUND)
unset(GTK2_LIBRARY)
unset(GTK2_INCLUDE_DIR)

View File

@ -17,11 +17,7 @@ if(JPEG_FOUND)
mark_as_advanced(JPEG_LPATH)
unset(JPEG_FOUND)
unset(JPEG_LIBRARY CACHE)
unset(JPEG_LIBRARIES)
unset(JPEG_INCLUDE_DIR CACHE)
unset(JPEG_LIBRARY_DIR)
else()
unset(JPEG_LIBRARY CACHE)
unset(JPEG_INCLUDE_DIR CACHE)
endif()
unset(JPEG_INCLUDE_DIR CACHE)

View File

@ -26,5 +26,4 @@ if(OPENAL_FOUND)
unset(OPENAL_LIBRARY_DIR)
endif()
unset(OPENAL_LIBRARY CACHE)
unset(OPENAL_INCLUDE_DIR CACHE)

View File

@ -19,10 +19,7 @@ if(OPENSSL_FOUND)
mark_as_advanced(OPENSSL_LPATH)
unset(OPENSSL_FOUND)
unset(OPENSSL_LIBRARY)
unset(OPENSSL_LIBRARIES)
unset(OPENSSL_INCLUDE_DIR CACHE)
unset(OPENSSL_LIBRARY_DIR)
else()
unset(OPENSSL_INCLUDE_DIR CACHE)
endif()
unset(OPENSSL_INCLUDE_DIR CACHE)

View File

@ -19,15 +19,10 @@ if(PNG_FOUND)
set(PNG_VERSION ${PNG_VERSION_STRING})
unset(PNG_FOUND)
unset(PNG_LIBRARY CACHE)
unset(PNG_LIBRARIES)
unset(PNG_DEFINITIONS)
unset(PNG_INCLUDE_DIR CACHE)
unset(PNG_PNG_INCLUDE_DIR CACHE)
unset(PNG_LIBRARY_DIR)
unset(PNG_VERSION_STRING)
else()
unset(PNG_LIBRARY CACHE)
unset(PNG_INCLUDE_DIR CACHE)
unset(PNG_PNG_INCLUDE_DIR CACHE)
endif()
unset(PNG_INCLUDE_DIR CACHE)
unset(PNG_PNG_INCLUDE_DIR CACHE)

View File

@ -19,11 +19,7 @@ if(TIFF_FOUND)
set(TIFF_VERSION ${TIFF_VERSION_STRING})
unset(TIFF_FOUND)
unset(TIFF_LIBRARY CACHE)
unset(TIFF_LIBRARIES)
unset(TIFF_INCLUDE_DIR CACHE)
unset(TIFF_LIBRARY_DIR)
else()
unset(TIFF_INCLUDE_DIR CACHE)
unset(TIFF_LIBRARY CACHE)
endif()
unset(TIFF_INCLUDE_DIR CACHE)

View File

@ -31,7 +31,5 @@ if(ZLIB_FOUND)
unset(ZLIB_OATCH_VERSION)
endif()
unset(ZLIB_LIBRARY CACHE)
unset(ZLIB_LIBRARIES CACHE)
unset(ZLIB_INCLUDE_DIR CACHE)
unset(ZLIB_INCLUDE_DIRS CACHE)

View File

@ -28,13 +28,10 @@ endif()
string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}")
## Installation Config ##
## Dtool Config ##
set(INSTALL_DIR "/usr/local/panda" CACHE STRING "The directory in which to install Panda3D.")
set(DTOOL_INSTALL "${INSTALL_DIR}" CACHE STRING "The directory in which to install the dtool package.")
set(DEFAULT_PRC_DIR "${INSTALL_DIR}/etc" CACHE STRING "Panda uses prc files for runtime configuration. Panda will search the default .prc directory if the PRC_PATH and PRC_DIR environment variables are not defined.")
include(Configure.cmake)
## Include dtool subpackages ##

View File

@ -136,7 +136,7 @@ mangle_package(GTK2)
config_package(GTK COMMENT "gtk+-2")
# Find and configure Freetype
find_package(Freetype)
find_package(Freetype QUIET)
mangle_package(Freetype)
config_package(FREETYPE COMMENT "Freetype")
if(HAVE_FREETYPE AND NOT WIN32)
@ -246,7 +246,7 @@ endif()
# Find and configure libRocket
#find_package(Rocket)
#config_package(ROCKET COMMENT "libRocket")
#if(HAVE_ROCKET)
#if(HAVE_ROCKET AND HAVE_PYTHON)
# # Check for rocket python bindings
# if(FOUND_ROCKET_PYTHON)
# option(USE_ROCKET_PYTHON "If on, compile Panda3D with python bindings for libRocket" ON)
@ -261,6 +261,8 @@ endif()
# else()
# message(STATUS "+ libRocket without Python bindings")
# endif()
#else()
# unset(USE_ROCKET_PYTHON CACHE)
#endif()
# Find and configure Bullet

View File

@ -15,7 +15,8 @@ set(P3CPPPARSER_HEADERS
cppSimpleType.h cppStructType.h cppTBDType.h
cppTemplateParameterList.h cppTemplateScope.h cppToken.h
cppType.h cppTypeDeclaration.h cppTypeParser.h
cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h)
cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h
)
set(P3CPPPARSER_SOURCES
cppArrayType.cxx ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx
@ -33,17 +34,30 @@ set(P3CPPPARSER_SOURCES
cppTemplateParameterList.cxx cppTemplateScope.cxx
cppToken.cxx cppType.cxx cppTypeDeclaration.cxx
cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx
cppUsing.cxx cppVisibility.cxx)
cppUsing.cxx cppVisibility.cxx
)
# Bison is required for CPPParser
# Check for it here, so that cppparser can be compiled individually
if(NOT HAVE_BISON)
find_package(BISON REQUIRED QUIET)
if(NOT BISON_FOUND)
message(FATAL_ERROR "CPPParser requires Bison.")
endif()
endif()
find_package(BISON)
bison_target(cppParser
cppBison.yxx
${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx
COMPILE_FLAGS --defines=${CMAKE_CURRENT_BINARY_DIR}/cppBison.h)
COMPILE_FLAGS --defines=${CMAKE_CURRENT_BINARY_DIR}/cppBison.h
)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_CURRENT_LIST_DIR})
add_library(p3cppParser STATIC
${P3CPPPARSER_HEADERS}
${P3CPPPARSER_SOURCES})
${P3CPPPARSER_SOURCES}
)
add_dependencies(p3cppParser cppParser)

View File

@ -6,8 +6,19 @@ include_directories(../dtoolbase)
include_directories(../pystub)
include_directories(../prc)
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
# OpenSSL is required for Interrogate
# Check for it here, so that Interrogate can be compiled individually
if(HAVE_OPENSSL)
include_directories(OPENSSL_IPATH)
else()
find_package(OpenSSL REQUIRED QUIET)
if(NOT OPENSSL_FOUND)
message(FATAL_ERROR "Interrogate requires OpenSSL.")
endif()
include_directories(${OPENSSL_INCLUDE_DIR})
endif()
set(INTERROGATE_HEADERS
functionRemap.h

View File

@ -1,6 +1,7 @@
include_directories(../dtoolutil)
include_directories(../dtoolbase)
set(DEFAULT_PRC_DIR "${INSTALL_DIR}/etc" CACHE STRING "Panda uses prc files for runtime configuration. Panda will search the default .prc directory if the PRC_PATH and PRC_DIR environment variables are not defined.")
set(PRC_DCONFIG_TRUST_LEVEL 0 CACHE STRING "The trust level value for any legacy (DConfig) variables.")
set(PRC_INC_TRUST_LEVEL 0 CACHE STRING "The amount by which we globally increment the trust level.")