CMake: Configure: Finish cleaning up finding packages.

This commit is contained in:
kestred 2013-12-13 13:32:04 -07:00
parent c7b514bc75
commit 826979c099
11 changed files with 230 additions and 307 deletions

View File

@ -4,7 +4,7 @@
# Usage: # Usage:
# find_package(Cg [REQUIRED] [QUIET]) # find_package(Cg [REQUIRED] [QUIET])
# #
# It sets the following variables: # Once done this will define:
# CG_FOUND - system has NvidiaCg # CG_FOUND - system has NvidiaCg
# CG_INCLUDE_DIR - the NvidiaCg include directory # CG_INCLUDE_DIR - the NvidiaCg include directory
# CG_LIBRARY_DIR - the NvidiaCg library directory # CG_LIBRARY_DIR - the NvidiaCg library directory
@ -21,7 +21,10 @@
# Find Cg for OpenGL # Find Cg for OpenGL
macro(find_cggl) macro(find_cggl)
if(NOT CGGL_LIBRARY_DIR AND NOT CGGL_INCLUDE_DIR) if(Cg_FIND_QUIETLY)
set(CgGL_FIND_QUIETLY TRUE)
endif()
if(NOT CGGL_LIBRARY_DIR OR NOT CGGL_INCLUDE_DIR)
# Find the include directory # Find the include directory
find_path(CGGL_INCLUDE_DIR find_path(CGGL_INCLUDE_DIR
NAMES "cgGL.h" NAMES "cgGL.h"
@ -41,6 +44,7 @@ macro(find_cggl)
PATHS "C:/Program Files/Cg" PATHS "C:/Program Files/Cg"
"C:/Program Files/NVIDIA Corporation/Cg" "C:/Program Files/NVIDIA Corporation/Cg"
"/usr" "/usr"
"/usr/lib/x86_64-linux-gnu"
"/usr/local" "/usr/local"
"/opt/Cg" "/opt/Cg"
"/opt/nvidia-cg-toolkit" # Gentoo "/opt/nvidia-cg-toolkit" # Gentoo
@ -80,7 +84,7 @@ endmacro()
# Find base Nvidia Cg # Find base Nvidia Cg
if(NOT CG_LIBRARY_DIR AND NOT CG_INCLUDE_DIR) if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIR)
# On OSX default to using the framework version of Cg. # On OSX default to using the framework version of Cg.
if(APPLE) if(APPLE)
include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake) include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake)
@ -125,6 +129,7 @@ if(NOT CG_LIBRARY_DIR AND NOT CG_INCLUDE_DIR)
PATHS "C:/Program Files/Cg" PATHS "C:/Program Files/Cg"
"C:/Program Files/NVIDIA Corporation/Cg" "C:/Program Files/NVIDIA Corporation/Cg"
"/usr" "/usr"
"/usr/lib/x86_64-linux-gnu"
"/usr/local" "/usr/local"
"/opt/Cg" "/opt/Cg"
"/opt/nvidia-cg-toolkit" # Gentoo "/opt/nvidia-cg-toolkit" # Gentoo
@ -142,7 +147,7 @@ endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARY CG_INCLUDE_DIR CG_LIBRARY_DIR) find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARY CG_INCLUDE_DIR CG_LIBRARY_DIR)
if(FOUND_CG) if(CG_INCLUDE_DIR AND CG_LIBRARY_DIR)
find_cggl() find_cggl()
find_cgdx8() find_cgdx8()
find_cgdx9() find_cgdx9()

View File

@ -5,24 +5,25 @@
# find_package(Eigen2 [REQUIRED] [QUIET]) # find_package(Eigen2 [REQUIRED] [QUIET])
# #
# Once done this will define: # Once done this will define:
# EIGEN_FOUND - system has Eigen2 # EIGEN_FOUND - system has any version of Eigen
# EIGEN_INCLUDE_DIR - the Eigen2 include directory # EIGEN2_FOUND - system has Eigen2
# EIGEN2_INCLUDE_DIR - the Eigen2 include directory
# #
if(Eigen2_FIND_QUIETLY) if(NOT EIGEN2_INCLUDE_DIR)
set(Eigen_FIND_QUIETLY TRUE) find_path(EIGEN2_INCLUDE_DIR
endif()
if(NOT EIGEN_INCLUED_DIR)
find_path(EIGEN_INCLUDE_DIR
NAMES Eigen/Core NAMES Eigen/Core
PATHS ${INCLUDE_INSTALL_DIR} PATHS ${INCLUDE_INSTALL_DIR}
${KDE4_INCLUDE_DIR} ${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen2 PATH_SUFFIXES eigen2
) )
mark_as_advanced(EIGEN_INCLUDE_DIR) mark_as_advanced(EIGEN2_INCLUDE_DIR)
endif() endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR)
if(EIGEN2_FOUND)
set(EIGEN_FOUND TRUE)
endif()

View File

@ -5,24 +5,25 @@
# find_package(Eigen3 [REQUIRED] [QUIET]) # find_package(Eigen3 [REQUIRED] [QUIET])
# #
# Once done this will define: # Once done this will define:
# EIGEN_FOUND - system has Eigen3 # EIGEN_FOUND - system has any version of Eigen
# EIGEN_INCLUDE_DIR - the Eigen3 include directory # EIGEN3_FOUND - system has Eigen3
# EIGEN3_INCLUDE_DIR - the Eigen3 include directory
# #
if(Eigen3_FIND_QUIETLY) if(NOT EIGEN3_INCLUDE_DIR)
set(Eigen_FIND_QUIETLY TRUE) find_path(EIGEN3_INCLUDE_DIR
endif()
if(NOT EIGEN_INCLUDE_DIR)
find_path(EIGEN_INCLUDE_DIR
NAMES signature_of_eigen3_matrix_library NAMES signature_of_eigen3_matrix_library
PATHS ${CMAKE_INSTALL_PREFIX}/include PATHS ${CMAKE_INSTALL_PREFIX}/include
${KDE4_INCLUDE_DIR} ${KDE4_INCLUDE_DIR}
PATH_SUFFIXES eigen3 eigen PATH_SUFFIXES eigen3 eigen
) )
mark_as_advanced(EIGEN_INCLUDE_DIR) mark_as_advanced(EIGEN3_INCLUDE_DIR)
endif() endif()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR)
if(EIGEN3_FOUND)
set(EIGEN_FOUND TRUE)
endif()

View File

@ -14,7 +14,7 @@
# FFTW_ROOT - if set, the libraries are exclusively searched under this path # FFTW_ROOT - if set, the libraries are exclusively searched under this path
# #
if(NOT FFTW_INCLUDE_DIR AND NOT FFTW_LIBRARY_DIR) if(NOT FFTW_INCLUDE_DIR OR NOT FFTW_LIBRARY_DIR)
# Check if we can use PkgConfig # Check if we can use PkgConfig
find_package(PkgConfig QUIET) find_package(PkgConfig QUIET)

View File

@ -2,31 +2,21 @@
# Author: kestred (8 Dec, 2013) # Author: kestred (8 Dec, 2013)
# #
# Usage: # Usage:
# find_package(FMODEx [REQUIRED] [QUIET]) # find_pcackage(FMODEx [REQUIRED] [QUIET])
# #
# It sets the following variables: # Once done this will define:
# FOUND_FMODEX - system has FMOD Ex # FMODEX_FOUND - system has FMOD Ex
# FMODEX_IPATH - the FMOD Ex include directory # FMODEX_INCLUDE_DIR - the FMOD Ex include directory
# FMODEX_LPATH - the FMOD Ex library directory # FMODEX_LIBRARY_DIR - the FMOD Ex library directory
# FMODEX_LIBS - the FMOD Ex components found
# FMODEX_LIBRARY - the path to the library binary # FMODEX_LIBRARY - the path to the library binary
# #
# FMODEX_32_LIBRARY - the filepath of the Miles SDK 32-bit library # FMODEX_32_LIBRARY - the filepath of the Miles SDK 32-bit library
# FMOXEX_64_LIBRARY - the filepath of the Miles SDK 64-bit library # FMOXEX_64_LIBRARY - the filepath of the Miles SDK 64-bit library
# #
if(FMODEX_LPATH AND FMODEX_IPATH) if(NOT FMODEX_LIBRARY_DIR OR NOT FMODEX_INCLUDE_DIR)
# If its cached, we don't need to refind it
set(FOUND_FMODEX TRUE)
if(FMODEX_32_LIBRARY)
set(FMODEX_LIBS fmodex)
elseif(FMODEX_64_LIBRARY)
set(FMODEX_LIBS fmodex64)
endif()
else()
# Find the include directory # Find the include directory
find_path(FMODEX_IPATH find_path(FMODEX_INCLUDE_DIR
NAMES "fmod.h" NAMES "fmod.h"
PATHS "/usr/include" PATHS "/usr/include"
"/usr/local/include" "/usr/local/include"
@ -76,25 +66,20 @@ else()
) )
if(FMODEX_32_LIBRARY) if(FMODEX_32_LIBRARY)
set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY}) set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.")
set(FMODEX_LIBS fmodex)
elseif(FMODEX_64_LIBRARY) elseif(FMODEX_64_LIBRARY)
set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY}) set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.")
set(FMODEX_LIBS fmodex64)
endif() endif()
get_filename_component(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY}" PATH) get_filename_component(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY}" PATH)
set(FMODEX_LPATH "${FMODEX_LIBRARY_DIR}" CACHE PATH "The path to FMOD Ex's library directory.") set(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY_DIR}" CACHE PATH "The path to FMOD Ex's library directory.")
# Check if we have everything we need mark_as_advanced(FMODEX_INCLUDE_DIR)
if(FMODEX_IPATH AND FMODEX_LPATH) mark_as_advanced(FMODEX_LIBRARY_DIR)
set(FOUND_FMODEX TRUE)
endif()
mark_as_advanced(FMODEX_IPATH)
mark_as_advanced(FMODEX_LPATH)
mark_as_advanced(FMODEX_LIBRARY) mark_as_advanced(FMODEX_LIBRARY)
mark_as_advanced(FMODEX_32_LIBRARY) mark_as_advanced(FMODEX_32_LIBRARY)
mark_as_advanced(FMODEX_64_LIBRARY) mark_as_advanced(FMODEX_64_LIBRARY)
unset(FMODEX_LIBRARY_DIR)
endif() endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FMODEx DEFAULT_MSG FMODEX_LIBRARY FMODEX_INCLUDE_DIR FMODEX_LIBRARY_DIR)

View File

@ -4,49 +4,22 @@
# Usage: # Usage:
# find_package(Miles [REQUIRED] [QUIET]) # find_package(Miles [REQUIRED] [QUIET])
# #
# It sets the following variables: # Once done this will define:
# FOUND_RAD_MSS - system has Radgame's Miles SDK # MILES_FOUND - system has Radgame's Miles SDK
# RAD_MSS_IPATH - the Miles SDK include directory # RAD_MSS_FOUND - system has Radgame's Miles SDK
# RAD_MSS_LPATH - the Miles SDK library directory # MILES_INCLUDE_DIR - the Miles SDK include directory
# RAD_MSS_LIBS - the Miles SDK components found # MILES_LIBRARY_DIR - the Miles SDK library directory
# RAD_MSS_LIBRARY - the path to the library binary # MILES_LIBRARY - the path to the library binary
# #
# RAD_MSS_RELEASE_LIBRARY - the filepath of the Miles SDK release library # MILES_RELEASE_LIBRARY - the filepath of the Miles SDK release library
# RAD_MSS_RELWITHDEBINFO_LIBRARY - the filepath of the Miles SDK optimize debug library # MILES_RELDBG_LIBRARY - the filepath of the Miles SDK optimize debug library
# RAD_MSS_MINSIZE_LIBRARY - the filepath of the Miles SDK minimum size library # MILES_MINSIZE_LIBRARY - the filepath of the Miles SDK minimum size library
# RAD_MSS_DEBUG_LIBRARY - the filepath of the Miles SDK debug library # MILES_DEBUG_LIBRARY - the filepath of the Miles SDK debug library
# #
if(RAD_MSS_IPATH AND RAD_MSS_LPATH) if(NOT MILES_INCLUDE_DIR OR NOT MILES_LIBRARY_DIR)
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_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_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_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_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()
else()
# Find the Miles SDK include files # Find the Miles SDK include files
find_path(RAD_MSS_IPATH find_path(MILES_INCLUDE_DIR
NAMES "miles.h" NAMES "miles.h"
PATHS "/usr/include" PATHS "/usr/include"
"/usr/local/include" "/usr/local/include"
@ -58,7 +31,7 @@ else()
) )
# Find the Miles SDK libraries (.a, .so) # Find the Miles SDK libraries (.a, .so)
find_library(RAD_MSS_RELEASE_LIBRARY find_library(MILES_RELEASE_LIBRARY
NAMES "miles" NAMES "miles"
PATHS "/usr" PATHS "/usr"
"/usr/local" "/usr/local"
@ -70,7 +43,7 @@ else()
"C:/Program Files (x86)/Miles6" "C:/Program Files (x86)/Miles6"
PATH_SUFFIXES "lib" "lib32" PATH_SUFFIXES "lib" "lib32"
) )
find_library(RAD_MSS_MINSIZE_LIBRARY find_library(MILES_MINSIZE_LIBRARY
NAMES "miles_s" NAMES "miles_s"
PATHS "/usr" PATHS "/usr"
"/usr/local" "/usr/local"
@ -81,7 +54,7 @@ else()
"C:/Program Files (x86)/Miles6" "C:/Program Files (x86)/Miles6"
PATH_SUFFIXES "lib" "lib32" PATH_SUFFIXES "lib" "lib32"
) )
find_library(RAD_MSS_RELWITHDEBINFO_LIBRARY find_library(MILES_RELWITHDEBINFO_LIBRARY
NAMES "miles_rd" NAMES "miles_rd"
PATHS "/usr" PATHS "/usr"
"/usr/local" "/usr/local"
@ -92,7 +65,7 @@ else()
"C:/Program Files (x86)/Miles6" "C:/Program Files (x86)/Miles6"
PATH_SUFFIXES "lib" "lib32" PATH_SUFFIXES "lib" "lib32"
) )
find_library(RAD_MSS_DEBUG_LIBRARY find_library(MILES_DEBUG_LIBRARY
NAMES "miles_d" NAMES "miles_d"
PATHS "/usr" PATHS "/usr"
"/usr/local" "/usr/local"
@ -105,32 +78,57 @@ else()
) )
# Choose library # Choose library
if(CMAKE_BUILD_TYPE MATCHES "Release" AND RAD_MSS_RELEASE_LIBRARY) if(CMAKE_BUILD_TYPE MATCHES "Release" AND MILES_RELEASE_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") set(MILES_LIBRARY ${MILES_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND RAD_MSS_RELWITHDEBINFO_LIBRARY) elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") set(MILES_LIBRARY ${MILES_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND RAD_MSS_MINSIZE_LIBRARY) elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND MILES_MINSIZE_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") set(MILES_LIBRARY ${MILES_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND RAD_MSS_DEBUG_LIBRARY) elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND MILES_DEBUG_LIBRARY)
set(RAD_MSS_LIBRARY ${RAD_MSS_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") set(MILES_LIBRARY ${MILES_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
endif() endif()
# Set library path # Set library path
get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_LIBRARY}" PATH) get_filename_component(MILES_LIBRARY_DIR "${MILES_LIBRARY}" PATH)
set(RAD_MSS_LPATH "${RAD_MSS_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.") set(MILES_LIBRARY_DIR "${MILES_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
# Check if we have everything we need # Check if we have everything we need
if(RAD_MSS_IPATH AND RAD_MSS_LPATH) if(MILES_INCLUDE_DIR AND MILES_LIBRARY_DIR)
set(FOUND_RAD_MSS TRUE) set(FOUND_MILES TRUE)
set(RAD_MSS_LIBS Mss32) set(MILES_LIBS Mss32)
endif() endif()
unset(RAD_MSS_LIBRARY_DIR) mark_as_advanced(MILES_INCLUDE_DIR)
mark_as_advanced(RAD_MSS_IPATH) mark_as_advanced(MILES_DEBUG_LIBRARY)
mark_as_advanced(RAD_MSS_LPATH) mark_as_advanced(MILES_RELEASE_LIBRARY)
mark_as_advanced(RAD_MSS_LIBRARY) mark_as_advanced(MILES_RELWITHDEBINFO_LIBRARY)
mark_as_advanced(RAD_MSS_DEBUG_LIBRARY) mark_as_advanced(MILES_MINSIZE_LIBRARY)
mark_as_advanced(RAD_MSS_RELEASE_LIBRARY)
mark_as_advanced(RAD_MSS_RELWITHDEBINFO_LIBRARY)
mark_as_advanced(RAD_MSS_MINSIZE_LIBRARY)
endif() endif()
# Choose library
if(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY)
unset(MILES_LIBRARY CACHE)
set(MILES_LIBRARY ${MILES_RELDBG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND MILES_MINSIZE_LIBRARY)
unset(MILES_LIBRARY CACHE)
set(MILES_LIBRARY ${MILES_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND MILES_DEBUG_LIBRARY)
unset(MILES_LIBRARY CACHE)
set(MILES_LIBRARY ${MILES_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
elseif(MILES_RELEASE_LIBRARY)
unset(MILES_LIBRARY CACHE)
set(MILES_LIBRARY ${MILES_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.")
endif()
# Set library path
if(DEFINED MILES_LIBRARY)
unset(MILES_LIBRARY_DIR CACHE)
get_filename_component(MILES_LIBRARY_DIR "${MILES_LIBRARY}" PATH)
set(MILES_LIBRARY_DIR "${MILES_LIBRARY_DIR}" CACHE PATH "The path to the Miles SDK library directory.")
endif()
mark_as_advanced(MILES_LIBRARY)
mark_as_advanced(MILES_LIBRARY_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Miles DEFAULT_MSG MILES_LIBRARY MILES_INCLUDE_DIR MILES_LIBRARY_DIR)

View File

@ -4,38 +4,19 @@
# Usage: # Usage:
# find_package(Squish [REQUIRED] [QUIET]) # find_package(Squish [REQUIRED] [QUIET])
# #
# It sets the following variables: # Once done this will define:
# FOUND_SQUISH - system has squish # SQUISH_FOUND - system has squish
# SQUISH_IPATH - the squish include directory # SQUISH_INCLUDE_DIR - the squish include directory
# SQUISH_LPATH - the squish library directory # SQUISH_LIBRARY_DIR - the squish library directory
# SQUISH_LIBS - the squish components found
# SQUISH_LIBRARY - the path to the library binary # SQUISH_LIBRARY - the path to the library binary
# #
# SQUISH_RELEASE_LIBRARY - the filepath of the squish release library # SQUISH_RELEASE_LIBRARY - the filepath of the squish release library
# SQUISH_DEBUG_LIBRARY - the filepath of the squish debug library # SQUISH_DEBUG_LIBRARY - the filepath of the squish debug library
# #
if(SQUISH_IPATH AND SQUISH_LPATH) if(NOT SQUISH_INCLUDE_DIR OR NOT SQUISH_LIBRARY_DIR)
set(FOUND_SQUISH TRUE)
set(SQUISH_LIBS squish)
# Use the library appropriate to the build type
if(CMAKE_BUILD_TYPE MATCHES "Debug" AND SQUISH_DEBUG_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_DEBUG_LIBRARY})
elseif(SQUISH_RELEASE_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_RELEASE_LIBRARY})
endif()
# Update Squish library path
if(SQUISH_LIBRARY)
get_filename_component(SQUISH_LIBRARY_DIR "${SQUISH_LIBRARY}" PATH)
set(SQUISH_LPATH "${SQUISH_LIBRARY_DIR}" CACHE PATH "The path to libsquish's library directory.") # Library path
unset(SQUISH_LIBRARY_DIR)
unset(SQUISH_LIBRARY CACHE)
endif()
else()
# Find the libsquish include files # Find the libsquish include files
find_path(SQUISH_IPATH find_path(SQUISH_INCLUDE_DIR
NAMES "squish.h" NAMES "squish.h"
PATHS "/usr/include" PATHS "/usr/include"
"/usr/local/include" "/usr/local/include"
@ -70,33 +51,30 @@ else()
PATH_SUFFIXES "lib" "lib32" "lib64" PATH_SUFFIXES "lib" "lib32" "lib64"
) )
# Use the library appropriate to the build type
if(CMAKE_BUILD_TYPE MATCHES "Debug")
if(SQUISH_DEBUG_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_DEBUG_LIBRARY})
else()
set(SQUISH_LIBRARY ${SQUISH_RELEASE_LIBRARY})
endif()
elseif(SQUISH_RELEASE_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_RELEASE_LIBRARY})
else()
set(SQUISH_LIBRARY ${SQUISH_DEBUG_LIBRARY})
endif()
# Translate library into library path mark_as_advanced(SQUISH_INCLUDE_DIR)
get_filename_component(SQUISH_LIBRARY_DIR "${SQUISH_LIBRARY}" PATH)
set(SQUISH_LPATH "${SQUISH_LIBRARY_DIR}" CACHE PATH "The path to libsquish's library directory.") # Library path
# Check if we have everything we need
if(SQUISH_IPATH AND SQUISH_LPATH)
set(FOUND_SQUISH TRUE)
set(SQUISH_LIBS squish)
endif()
unset(SQUISH_LIBRARY_DIR)
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_RELEASE_LIBRARY)
mark_as_advanced(SQUISH_DEBUG_LIBRARY) mark_as_advanced(SQUISH_DEBUG_LIBRARY)
endif() endif()
# Choose library
if(CMAKE_BUILD_TYPE MATCHES "Debug" AND SQUISH_DEBUG_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libsquish's library binary.")
elseif(SQUISH_RELEASE_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_RELEASE_LIBRARY} CACHE FILEPATH "The filepath to libsquish's library binary.")
elseif(SQUISH_DEBUG_LIBRARY)
set(SQUISH_LIBRARY ${SQUISH_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libsquish's library binary.")
endif()
# Translate library into library directory
if(SQUISH_LIBRARY)
unset(SQUISH_LIBRARY_DIR CACHE)
get_filename_component(SQUISH_LIBRARY_DIR "${SQUISH_LIBRARY}" PATH)
set(SQUISH_LIBRARY_DIR "${SQUISH_LIBRARY_DIR}" CACHE PATH "The path to libsquish's library directory.") # Library path
endif()
mark_as_advanced(SQUISH_LIBRARY)
mark_as_advanced(SQUISH_LIBRARY_DIR)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Squish DEFAULT_MSG SQUISH_LIBRARY SQUISH_INCLUDE_DIR SQUISH_LIBRARY_DIR)

View File

@ -5,19 +5,15 @@
# find_package(Tar [REQUIRED] [QUIET]) # find_package(Tar [REQUIRED] [QUIET])
# #
# It sets the following variables: # It sets the following variables:
# FOUND_TAR - system has libtar # TAR_FOUND - system has libtar
# TAR_IPATH - the tar include directory # TAR_INCLUDE_DIR - the tar include directory
# TAR_LPATH - the tar library directory # TAR_LIBRARY_DIR - the tar library directory
# TAR_LIBS - the tar components found
# TAR_LIBRARY - the path to the library binary # TAR_LIBRARY - the path to the library binary
# #
if(TAR_IPATH AND TAR_LPATH) if(NOT TAR_INCLUDE_DIR OR NOT TAR_LIBRARY_DIR)
set(FOUND_TAR TRUE)
set(TAR_LIBS tar)
else()
# Find the libtar include files # Find the libtar include files
find_path(TAR_IPATH find_path(TAR_INCLUDE_DIR
NAMES "libtar.h" NAMES "libtar.h"
PATHS "/usr/include" PATHS "/usr/include"
"/usr/local/include" "/usr/local/include"
@ -34,16 +30,12 @@ else()
PATH_SUFFIXES "lib" "lib32" "lib64" PATH_SUFFIXES "lib" "lib32" "lib64"
) )
get_filename_component(TAR_LIBRARY_DIR "${TAR_LIBRARY}" PATH) get_filename_component(TAR_LIBRARY_DIR "${TAR_LIBRARY}" PATH)
set(TAR_LPATH "${TAR_LIBRARY_DIR}" CACHE PATH "The path to libtar's library directory.") # Library path set(TAR_LIBRARY_DIR "${TAR_LIBRARY_DIR}" CACHE PATH "The path to libtar's library directory.") # Library path
# Check if we have everything we need mark_as_advanced(TAR_INCLUDE_DIR)
if(TAR_IPATH AND TAR_LPATH) mark_as_advanced(TAR_LIBRARY_DIR)
set(FOUND_TAR TRUE)
set(TAR_LIBS tar)
endif()
unset(TAR_LIBRARY_DIR)
mark_as_advanced(TAR_IPATH)
mark_as_advanced(TAR_LPATH)
mark_as_advanced(TAR_LIBRARY) mark_as_advanced(TAR_LIBRARY)
endif() endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Tar DEFAULT_MSG TAR_LIBRARY TAR_INCLUDE_DIR TAR_LIBRARY_DIR)

View File

@ -1,21 +1,21 @@
# Filename: FindTar.cmake # Filename: FindVRPN.cmake
# Author: kestred (29 Nov, 2013) # Author: kestred (29 Nov, 2013)
# #
# Usage: # Usage:
# find_package(Tar [REQUIRED] [QUIET]) # find_package(VRPN [REQUIRED] [QUIET])
# #
# It sets the following variables: # It sets the following variables:
# FOUND_VRPN - system has libvrpn # VRPN_FOUND - system has libvrpn
# VRPN_IPATH - the vrpn include directory # VRPN_INCLUDE_DIR - the vrpn include directory
# VRPN_LPATH - the vrpn library directory # VRPN_LIBRARY_DIR - the vrpn library directory
# VRPN_LIBRARY - the path to the library binary # VRPN_LIBRARY - the path to the library binary
# #
if(VRPN_IPATH AND VRPN_LPATH) if(VRPN_INCLUDE_DIR AND VRPN_LIBRARY_DIR)
set(FOUND_VRPN TRUE) set(FOUND_VRPN TRUE)
else() else()
# Find the vrpn include files # Find the vrpn include files
find_path(VRPN_IPATH find_path(VRPN_INCLUDE_DIR
NAMES "vrpn_Keyboard.h" NAMES "vrpn_Keyboard.h"
PATHS "/usr/include" PATHS "/usr/include"
"/usr/local/include" "/usr/local/include"
@ -34,15 +34,12 @@ else()
PATH_SUFFIXES "lib" "lib32" "lib64" PATH_SUFFIXES "lib" "lib32" "lib64"
) )
get_filename_component(VRPN_LIBRARY_DIR "${VRPN_LIBRARY}" PATH) get_filename_component(VRPN_LIBRARY_DIR "${VRPN_LIBRARY}" PATH)
set(VRPN_LPATH "${VRPN_LIBRARY_DIR}" CACHE PATH "The path to vrpn's library directory.") # Library path set(VRPN_LIBRARY_DIR "${VRPN_LIBRARY_DIR}" CACHE PATH "The path to vrpn's library directory.") # Library path
# Check if we have everything we need mark_as_advanced(VRPN_INCLUDE_DIR)
if(VRPN_IPATH AND VRPN_LPATH) mark_as_advanced(VRPN_LIBRARY_DIR)
set(FOUND_VRPN TRUE)
endif()
unset(VRPN_LIBRARY_DIR)
mark_as_advanced(VRPN_IPATH)
mark_as_advanced(VRPN_LPATH)
mark_as_advanced(VRPN_LIBRARY) mark_as_advanced(VRPN_LIBRARY)
endif() endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_LIBRARY VRPN_INCLUDE_DIR VRPN_LIBRARY_DIR)

View File

@ -1,34 +0,0 @@
# Filename: MangleGTK2.cmake
# Author: kestred (11 Dec, 2013)
#
# MangleGTK2 replaces the output variables of the builtin FindGTK2
# with vars matching Panda3D's existing config-var names.
#
if(GTK2_FOUND)
set(FOUND_GTK TRUE)
list(GET GTK2_LIBRARIES 0 GTK2_LIBRARY)
list(GET GTK2_INCLUDE_DIRS 0 GTK2_INCLUDE_DIR)
get_filename_component(GTK2_LIBRARY_DIR "${GTK2_LIBRARY}" PATH)
set(GTK_IPATH "${GTK2_INCLUDE_DIR}" CACHE PATH "The path to gtk-2's include directory.") # Include path
set(GTK_LPATH "${GTK2_LIBRARY_DIR}" CACHE PATH "The path to gtk-2's library directory.") # Library path
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)
unset(GTK2_LIBRARY_DIR)
unset(GTK2_MAJOR_VERSION)
unset(GTK2_MINOR_VERSION)
unset(GTK2_PATCH_VERSION)
endif()
unset(GTK2_LIBRARIES CACHE)
unset(GTK2_INCLUDE_DIRS CACHE)
unset(GTK2_DEFINITIONS CACHE)

View File

@ -1,7 +1,6 @@
message(STATUS "") message(STATUS "")
message("Configuring support for the following optional third-party packages:") message("Configuring support for the following optional third-party packages:")
# Settings to change USE_PACKAGE behavior (these options override cached values) # Settings to change USE_PACKAGE behavior (these options override cached values)
set(CONFIG_ENABLE_EVERYTHING Off) set(CONFIG_ENABLE_EVERYTHING Off)
set(CONFIG_DISABLE_EVERYTHING Off) set(CONFIG_DISABLE_EVERYTHING Off)
@ -130,7 +129,12 @@ find_package(OpenAL QUIET)
config_package(OPENAL "OpenAL sound library") config_package(OPENAL "OpenAL sound library")
# Find and configure GTK # Find and configure GTK
find_package(GTK2 QUIET) set(Freetype_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2
set(GTK2_GTK_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2
find_package(GTK2 QUIET COMPONENTS gtk)
if(GTK2_FOUND)
set(GTK_FOUND TRUE) # Mangle for convenience
endif()
config_package(GTK "gtk+-2") config_package(GTK "gtk+-2")
# Find and configure Freetype # Find and configure Freetype
@ -290,8 +294,8 @@ endif()
### Configure threading support ### ### Configure threading support ###
# Add basic use flag for threading # Add basic use flag for threading
option(USE_THREADS "If on, compile Panda3D with threading support." ON) option(BUILD_THREADS "If on, compile Panda3D with threading support." ON)
if(USE_THREADS) if(BUILD_THREADS)
set(HAVE_THREADS TRUE) set(HAVE_THREADS TRUE)
else() else()
unset(BUILD_SIMPLE_THREADS CACHE) unset(BUILD_SIMPLE_THREADS CACHE)
@ -299,7 +303,7 @@ else()
endif() endif()
# Configure debug threads # Configure debug threads
if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 3) if(CMAKE_BUILD_TYPE MATCHES "Debug")
option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON)
else() else()
option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF)
@ -355,18 +359,14 @@ endif()
### Configure pipelining ### ### Configure pipelining ###
if(NOT DEFINED BUILD_PIPELINING) if(NOT DEFINED BUILD_PIPELINING)
if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2)
option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON)
else()
option(BUILD_PIPELINING "If on, compile with pipelined rendering." OFF)
endif()
endif() endif()
if(BUILD_PIPELINING) if(BUILD_PIPELINING)
set(DO_PIPELINING TRUE) set(DO_PIPELINING TRUE)
endif() endif()
### Configure OS X options ### ### Configure OS X options ###
if(OSX_PLATFORM) if(APPLE)
option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON)
if(BUILD_UNIVERSAL_BINARIES) if(BUILD_UNIVERSAL_BINARIES)
message(STATUS "Compilation will create universal binaries.") message(STATUS "Compilation will create universal binaries.")