mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
CMake: Detect and build support for Assimp
This commit is contained in:
parent
226dc69af2
commit
1ae736f881
28
cmake/modules/FindAssimp.cmake
Normal file
28
cmake/modules/FindAssimp.cmake
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Filename: FindAssimp.cmake
|
||||||
|
# Authors: CFSworks (9 Nov, 2018)
|
||||||
|
#
|
||||||
|
# Usage:
|
||||||
|
# find_package(Assimp [REQUIRED] [QUIET])
|
||||||
|
#
|
||||||
|
# Once done this will define:
|
||||||
|
# ASSIMP_FOUND - system has Assimp
|
||||||
|
# ASSIMP_INCLUDE_DIR - the path to the location of the assimp/ directory
|
||||||
|
# ASSIMP_LIBRARY - the library to link against for Assimp
|
||||||
|
#
|
||||||
|
|
||||||
|
if(NOT ASSIMP_INCLUDE_DIR)
|
||||||
|
find_path(ASSIMP_INCLUDE_DIR
|
||||||
|
NAMES "assimp/Importer.hpp")
|
||||||
|
|
||||||
|
mark_as_advanced(ASSIMP_INCLUDE_DIR)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT ASSIMP_LIBRARY)
|
||||||
|
find_library(ASSIMP_LIBRARY
|
||||||
|
NAMES "assimp")
|
||||||
|
|
||||||
|
mark_as_advanced(ASSIMP_LIBRARY)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include(FindPackageHandleStandardArgs)
|
||||||
|
find_package_handle_standard_args(Assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY)
|
@ -161,6 +161,17 @@ package_option(TAR
|
|||||||
package_status(TAR "libtar")
|
package_status(TAR "libtar")
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# ------------ Asset formats ------------
|
||||||
|
#
|
||||||
|
|
||||||
|
# Assimp
|
||||||
|
find_package(Assimp QUIET)
|
||||||
|
package_option(ASSIMP
|
||||||
|
"Build pandatool with support for loading 3D assets supported by Assimp.")
|
||||||
|
package_status(ASSIMP "Assimp")
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ------------ Math libraries ------------
|
# ------------ Math libraries ------------
|
||||||
#
|
#
|
||||||
|
@ -3,6 +3,7 @@ if(NOT BUILD_PANDA)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Include pandatool source directories
|
# Include pandatool source directories
|
||||||
|
add_subdirectory(src/assimp)
|
||||||
add_subdirectory(src/bam)
|
add_subdirectory(src/bam)
|
||||||
add_subdirectory(src/converter)
|
add_subdirectory(src/converter)
|
||||||
add_subdirectory(src/cvscopy)
|
add_subdirectory(src/cvscopy)
|
||||||
|
29
pandatool/src/assimp/CMakeLists.txt
Normal file
29
pandatool/src/assimp/CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
if(NOT HAVE_ASSIMP)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(P3ASSIMP_HEADERS
|
||||||
|
assimpLoader.h assimpLoader.I
|
||||||
|
config_assimp.h
|
||||||
|
loaderFileTypeAssimp.h
|
||||||
|
pandaIOStream.h
|
||||||
|
pandaIOSystem.h
|
||||||
|
pandaLogger.h
|
||||||
|
)
|
||||||
|
|
||||||
|
set(P3ASSIMP_SOURCES
|
||||||
|
assimpLoader.cxx
|
||||||
|
config_assimp.cxx
|
||||||
|
loaderFileTypeAssimp.cxx
|
||||||
|
pandaIOStream.cxx
|
||||||
|
pandaIOSystem.cxx
|
||||||
|
pandaLogger.cxx
|
||||||
|
)
|
||||||
|
|
||||||
|
composite_sources(p3assimp P3ASSIMP_SOURCES)
|
||||||
|
add_library(p3assimp ${MODULE_TYPE} ${P3ASSIMP_HEADERS} ${P3ASSIMP_SOURCES})
|
||||||
|
set_target_properties(p3assimp PROPERTIES DEFINE_SYMBOL BUILDING_ASSIMP)
|
||||||
|
target_link_libraries(p3assimp p3pandatoolbase
|
||||||
|
PKG::ASSIMP)
|
||||||
|
|
||||||
|
install(TARGETS p3assimp DESTINATION ${MODULE_DESTINATION})
|
Loading…
x
Reference in New Issue
Block a user