From b73d724fed3f38a8418e42e41f38aa1056533b06 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 25 Nov 2013 01:44:51 -0700 Subject: [PATCH 001/744] CMake: Start basic cmake files; working on dtool first as example. --- CMakeLists.txt | 18 ++++++++ dtool/Package.cmake | 41 +++++++++++++++++ dtool/src/dtoolbase/Sources.cmake | 74 +++++++++++++++++++++++++++++++ 3 files changed, 133 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 dtool/Package.cmake create mode 100644 dtool/src/dtoolbase/Sources.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..fb04c564c9 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 2.8) +project(Panda3D) + +## Panda Version Information ## +set(PANDA_VERSION 1 9 0) +set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL "If true, signifies this is a tagged release rather than a repository snapshot. Scripts that generate source tarballs and/or binary releases for distribution should explicitly set this to true.") +set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING "This should be set by whoever provides a particular distribution of Panda. If you build your own Panda, leave this unchanged.") + +set(P3D_PLUGIN_VERSION 1 0 4) +set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1) + + +## Set CMake Find Module path ## +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") + + +## Include Panda3D Packages ## +include(${CMAKE_SOURCE_DIR}/dtool/Package.cmake) diff --git a/dtool/Package.cmake b/dtool/Package.cmake new file mode 100644 index 0000000000..31b465ff61 --- /dev/null +++ b/dtool/Package.cmake @@ -0,0 +1,41 @@ +## Parse Panda3D Subversions ## +list(GET PANDA_VERSION 0 PANDA_MAJOR_VERSION) +list(GET PANDA_VERSION 1 PANDA_MINOR_VERSION) +list(GET PANDA_VERSION 2 PANDA_SEQUENCE_VERSION) + +string(REPLACE ";" "." PANDA_VERSION_STR "${PANDA_VERSION}") +if(NOT PANDA_OFFICIAL_VERSION) + set(PANDA_VERSION_STR "${PANDA_VERSION_STR}c") +endif() + +set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) + +math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}") + + +## Parse Plugin-framework Subversions ## +list(GET P3D_PLUGIN_VERSION 0 P3D_PLUGIN_MAJOR_VERSION) +list(GET P3D_PLUGIN_VERSION 1 P3D_PLUGIN_MINOR_VERSION) +list(GET P3D_PLUGIN_VERSION 2 P3D_PLUGIN_SEQUENCE_VERSION) + +string(REPLACE ";" "." P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") +if(PANDA_OFFICIAL_VERSION) + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.1000") +else() + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.0") + set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION_STR}c") +endif() +string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") + + +## Installation 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 dtool subpackages ## +include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolbase/Sources.cmake) diff --git a/dtool/src/dtoolbase/Sources.cmake b/dtool/src/dtoolbase/Sources.cmake new file mode 100644 index 0000000000..a8b3261476 --- /dev/null +++ b/dtool/src/dtoolbase/Sources.cmake @@ -0,0 +1,74 @@ +set(P3DTOOLBASE_HEADER_FILES + addHash.I addHash.h + atomicAdjust.h + atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I + atomicAdjustI386Impl.h atomicAdjustI386Impl.I + atomicAdjustPosixImpl.h atomicAdjustPosixImpl.I + atomicAdjustWin32Impl.h atomicAdjustWin32Impl.I + cmath.I cmath.h + deletedBufferChain.h deletedBufferChain.I + deletedChain.h deletedChain.T + dtoolbase.h dtoolbase_cc.h dtoolsymbols.h + dtool_platform.h + fakestringstream.h + indent.I indent.h + memoryBase.h + memoryHook.h memoryHook.I + mutexImpl.h + mutexDummyImpl.h mutexDummyImpl.I + mutexPosixImpl.h mutexPosixImpl.I + mutexWin32Impl.h mutexWin32Impl.I + mutexSpinlockImpl.h mutexSpinlockImpl.I + nearly_zero.h + neverFreeMemory.h neverFreeMemory.I + numeric_types.h + pstrtod.h + register_type.I register_type.h + selectThreadImpl.h + stl_compares.I stl_compares.h + typeHandle.I typeHandle.h + typeRegistry.I typeRegistry.h + typeRegistryNode.I typeRegistryNode.h + typedObject.I typedObject.h + pallocator.T pallocator.h + pdeque.h plist.h pmap.h pset.h pvector.h + lookup3.h +) + +set(P3DTOOLBASE_SOURCE_FILES + addHash.cxx + atomicAdjustDummyImpl.cxx + atomicAdjustI386Impl.cxx + atomicAdjustPosixImpl.cxx + atomicAdjustWin32Impl.cxx + deletedBufferChain.cxx + dtoolbase.cxx + indent.cxx + lookup3.c + memoryBase.cxx + memoryHook.cxx + mutexDummyImpl.cxx + mutexPosixImpl.cxx + mutexWin32Impl.cxx + mutexSpinlockImpl.cxx + neverFreeMemory.cxx + pstrtod.cxx + register_type.cxx + typeHandle.cxx + typeRegistry.cxx typeRegistryNode.cxx + typedObject.cxx +) + +foreach(FILENAME IN LISTS P3DTOOLBASE_HEADER_FILES) + set(P3DTOOLBASE_INSTALL_HEADERS ${P3DTOOLBASE_INSTALL_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() +foreach(FILENAME IN LISTS P3DTOOLBASE_SOURCE_FILES) + set(P3DTOOLBASE_SOURCES ${P3DTOOLBASE_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() + +message("${P3DTOOLBASE_SOURCES}") + +add_library(p3dtoolbase + ${P3DTOOLBASE_INSTALL_HEADERS} + ${P3DTOOLBASE_SOURCES} +) From c9084be73ad1ab647d35995c0aa89bad92ee60a5 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 25 Nov 2013 16:26:41 -0700 Subject: [PATCH 002/744] CMake: Remove debugging comment. --- dtool/src/dtoolbase/Sources.cmake | 2 -- 1 file changed, 2 deletions(-) diff --git a/dtool/src/dtoolbase/Sources.cmake b/dtool/src/dtoolbase/Sources.cmake index a8b3261476..7f540f2efe 100644 --- a/dtool/src/dtoolbase/Sources.cmake +++ b/dtool/src/dtoolbase/Sources.cmake @@ -66,8 +66,6 @@ foreach(FILENAME IN LISTS P3DTOOLBASE_SOURCE_FILES) set(P3DTOOLBASE_SOURCES ${P3DTOOLBASE_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) endforeach() -message("${P3DTOOLBASE_SOURCES}") - add_library(p3dtoolbase ${P3DTOOLBASE_INSTALL_HEADERS} ${P3DTOOLBASE_SOURCES} From 93a483ea3f2a62d414e0b5e610d0ce824e9c946c Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 25 Nov 2013 16:28:00 -0700 Subject: [PATCH 003/744] CMake: Start DTool Configure.cmake, currently produces output depending on the value of the configuration variables. Needs find_package() calls. --- dtool/Configure.cmake | 314 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 314 insertions(+) create mode 100644 dtool/Configure.cmake diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake new file mode 100644 index 0000000000..a571b9e37e --- /dev/null +++ b/dtool/Configure.cmake @@ -0,0 +1,314 @@ +message(STATUS "") +message("Configuring support for the following optional third-party packages:") + +if(HAVE_EIGEN) + message(STATUS "+ Eigen linear algebra library") + if(LINMATH_ALIGN) + message(STATUS "+ (vectorization enabled in build)") + else() + message(STATUS "- (vectorization NOT enabled in build)") + endif() +else() + message(STATUS "- Did not find Eigen linear algebra library") +endif() + +#find_package(OpenSSL ssl crypto) +if(HAVE_OPENSSL) + message(STATUS "+ OpenSSL") +else() + message(STATUS "- Did not find OpenSSL") +endif() + +if(HAVE_JPEG) + message(STATUS "+ libjpeg") +else() + message(STATUS "- Did not find libjpeg") +endif() + +if(HAVE_PNG) + message(STATUS "+ libpng") +else() + message(STATUS "- Did not find libpng") +endif() + +if(HAVE_TIFF) + message(STATUS "+ libtiff") +else() + message(STATUS "- Did not find libtiff") +endif() + +if(HAVE_TAR) + message(STATUS "+ libtar") +else() + message(STATUS "- Did not find libtar") +endif() + +if(HAVE_FFTW) + message(STATUS "+ fftw") +else() + message(STATUS "- Did not find fftw") +endif() + +if(HAVE_SQUISH) + message(STATUS "+ squish") +else() + message(STATUS "- Did not find squish") +endif() + +if(HAVE_CG) + message(STATUS "+ Nvidia Cg High Level Shading Language") +else() + message(STATUS "- Did not find Nvidia Cg High Level Shading Language") +endif() + +if(HAVE_CGGL) + message(STATUS "+ Cg OpenGL API") +else() + message(STATUS "- Did not find Cg OpenGL API") +endif() + +if(HAVE_CGDX8) + message(STATUS "+ Cg DX8 API") +else() + message(STATUS "- Did not find Cg DX8 API") +endif() + +if(HAVE_CGDX9) + message(STATUS "+ Cg DX9 API") +else() + message(STATUS "- Did not find Cg DX9 API") +endif() + +if(HAVE_CGDX10) + message(STATUS "+ Cg DX10 API") +else() + message(STATUS "- Did not find Cg DX10 API") +endif() + +if(HAVE_VRPN) + message(STATUS "+ VRPN") +else() + message(STATUS "- Did not find VRPN") +endif() + +if(HAVE_ZLIB) + message(STATUS "+ zlib") +else() + message(STATUS "- Did not find zlib") +endif() + +if(HAVE_RAD_MSS) + message(STATUS "+ Miles Sound System") +else() + message(STATUS "- Did not find Miles Sound System") +endif() + +if(HAVE_FMODEX) + message(STATUS "+ FMOD Ex sound library") +else() + message(STATUS "- Did not find FMOD Ex sound library") +endif() + +if(HAVE_OPENAL) + message(STATUS "+ OpenAL sound library") +else() + message(STATUS "- Did not find OpenAL sound library") +endif() + +if(HAVE_PHYSX) + message(STATUS "+ Ageia PhysX") +else() + message(STATUS "- Did not find Ageia PhysX") +endif() + +if(HAVE_SPEEDTREE) + message(STATUS "+ SpeedTree") +else() + message(STATUS "- Did not find SpeedTree") +endif() + +if(HAVE_GTK) + message(STATUS "+ gtk+-2") +else() + message(STATUS "- Did not find gtk+-2") +endif() + +if(HAVE_FREETYPE) + message(STATUS "+ Freetype") +else() + message(STATUS "- Did not find Freetype") +endif() + +if(HAVE_WX) + message(STATUS "+ WxWidgets") +else() + message(STATUS "- Did not find WxWidgets") +endif() + +if(HAVE_FLTK) + message(STATUS "+ FLTK") +else() + message(STATUS "- Did not find FLTK") +endif() + +if(HAVE_GL) + message(STATUS "+ OpenGL") +else() + message(STATUS "- Did not find OpenGL") +endif() + +if(HAVE_GLES) + message(STATUS "+ OpenGL ES 1") +else() + message(STATUS "- Did not find OpenGL ES 1") +endif() + +if(HAVE_GLES2) + message(STATUS "+ OpenGL ES 2") +else() + message(STATUS "- Did not find OpenGL ES 2") +endif() + +if(HAVE_DX8) + message(STATUS "+ DirectX8") +else() + message(STATUS "- Did not find DirectX8") +endif() + +if(HAVE_DX9) + message(STATUS "+ DirectX9") +else() + message(STATUS "- Did not find DirectX9") +endif() + +if(HAVE_TINYDISPLAY) + message(STATUS "+ Tinydisplay") +else() + message(STATUS "- Not building Tinydisplay") +endif() + +# if(HAVE_SDL) +# message(STATUS "+ SDL") +# else() +# message(STATUS "- Did not find SDL") +# endif() + +if(HAVE_X11) + message(STATUS "+ X11") +else() + message(STATUS "- Did not find X11") +endif() + +if(HAVE_MESA) + message(STATUS "+ Mesa") +else() + message(STATUS "- Did not find Mesa") +endif() + +if(HAVE_OPENCV) + message(STATUS "+ OpenCV") +else() + message(STATUS "- Did not find OpenCV") +endif() + +if(HAVE_FFMPEG) + message(STATUS "+ FFMPEG") +else() + message(STATUS "- Did not find FFMPEG") +endif() + +if(HAVE_ODE) + message(STATUS "+ ODE") +else() + message(STATUS "- Did not find ODE") +endif() + +if(HAVE_AWESOMIUM) + message(STATUS "+ AWESOMIUM") +else() + message(STATUS "- Did not find AWESOMIUM") +endif() + +if(HAVE_MAYA) + message(STATUS "+ OpenMaya") +else() + message(STATUS "- Did not find OpenMaya") +endif() + +if(HAVE_FCOLLADA) + message(STATUS "+ FCollada") +else() + message(STATUS "- Did not find FCollada") +endif() + +if(HAVE_COLLADA14DOM OR HAVE_COLLADA15DOM) + message(STATUS "+ COLLADA DOM") +else() + message(STATUS "- Did not find COLLADA DOM") +endif() + +if(HAVE_ASSIMP) + message(STATUS "+ Assimp") +else() + message(STATUS "- Did not find Assimp") +endif() + +if(HAVE_ARTOOLKIT) + message(STATUS "+ ARToolKit") +else() + message(STATUS "- Did not find ARToolKit") +endif() + +if(HAVE_ROCKET) + if(HAVE_ROCKET_PYTHON) + message(STATUS "+ libRocket with Python bindings") + else() + message(STATUS "+ libRocket without Python bindings") + endif() +else() + message(STATUS "- Did not find libRocket") +endif() + +if(HAVE_BULLET) + message(STATUS "+ Bullet Physics") +else() + message(STATUS "- Did not find Bullet Physics") +endif() + +if(HAVE_VORBIS) + message(STATUS "+ libvorbis (Ogg Vorbis Decoder)") +else() + message(STATUS "- Did not find libvorbis (Ogg Vorbis Decoder)") +endif() + +message(STATUS "") +if(HAVE_INTERROGATE AND HAVE_PYTHON) + message(STATUS "Compilation will generate Python interfaces.") +else() + message(STATUS "Configuring Panda without Python interfaces.") +endif() + +if(HAVE_THREADS) + if(SIMPLE_THREADS) + message(STATUS "Compilation will include simulated threading support.") + else() + if(DO_PIPELINING) + message(STATUS "Compilation will include full, pipelined threading support.") + else() + message(STATUS "Compilation will include nonpipelined threading support.") + endif() + endif() +else() + message(STATUS "Configuring Panda without threading support.") +endif() + +if(OSX_PLATFORM) + if(UNIVERSAL_BINARIES) + message(STATUS "Compilation will create universal binaries.") + else() + message(STATUS "Compilation will not create universal binaries.") + endif() +endif() + +message(STATUS "") +message(STATUS "See dtool_config.h for more details about the specified configuration.\n") From 470288a37c4e89defaf07977a27b1b2d2cc19753 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 00:47:12 -0700 Subject: [PATCH 004/744] Add enough to Configure.cmake to get libp3dtoolbase to build. --- dtool/Configure.cmake | 38 +++ dtool/dtool_config.h.cmake | 473 +++++++++++++++++++++++++++++++++++++ 2 files changed, 511 insertions(+) create mode 100644 dtool/dtool_config.h.cmake diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index a571b9e37e..a71c2a6f3c 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -312,3 +312,41 @@ endif() message(STATUS "") message(STATUS "See dtool_config.h for more details about the specified configuration.\n") + +include(CheckIncludeFileCXX) +check_include_file_cxx(io.h PHAVE_IO_H) +check_include_file_cxx(iostream PHAVE_IOSTREAM) +check_include_file_cxx(malloc.h PHAVE_MALLOC_H) +check_include_file_cxx(sys/malloc.h PHAVE_SYS_MALLOC_H) +check_include_file_cxx(alloca.h PHAVE_ALLOCA_H) +check_include_file_cxx(locale.h PHAVE_LOCALE_H) +check_include_file_cxx(string.h PHAVE_STRING_H) +check_include_file_cxx(stdlib.h PHAVE_STDLIB_H) +check_include_file_cxx(limits.h PHAVE_LIMITS_H) +check_include_file_cxx(minmax.h PHAVE_MINMAX_H) +check_include_file_cxx(sstream PHAVE_SSTREAM) +check_include_file_cxx(new PHAVE_NEW) +check_include_file_cxx(sys/types.h PHAVE_SYS_TYPES_H) +check_include_file_cxx(sys/time.h PHAVE_SYS_TIME_H) +check_include_file_cxx(unistd.h PHAVE_UNISTD_H) +check_include_file_cxx(utime.h PHAVE_UTIME_H) +check_include_file_cxx(glob.h PHAVE_GLOB_H) +check_include_file_cxx(dirent.h PHAVE_DIRENT_H) +check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H) +check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) +check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) +check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) +check_include_file_cxx(stdint.h PHAVE_STDINT_H) + +set(HAVE_NAMESPACE ON) +set(HAVE_OPEN_MASK ON) +set(HAVE_LOCKF ON) +set(HAVE_WCHAR_T ON) +set(HAVE_WSTRING ON) +set(HAVE_TYPENAME ON) +set(SIMPLE_STRUCT_POINTERS ON) +set(HAVE_STREAMSIZE ON) +set(HAVE_IOS_TYPEDEFS ON) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) +include_directories("${CMAKE_BINARY_DIR}/include") diff --git a/dtool/dtool_config.h.cmake b/dtool/dtool_config.h.cmake new file mode 100644 index 0000000000..344515b458 --- /dev/null +++ b/dtool/dtool_config.h.cmake @@ -0,0 +1,473 @@ +/* dtool_config.h. Generated automatically by CMake. */ + +/* Debug / non-debug symbols. OPTIMIZE = $[OPTIMIZE] */ +#cmakedefine _DEBUG +#cmakedefine NDEBUG + +/* Define if we have Eigen available. */ +#cmakedefine HAVE_EIGEN +#cmakedefine LINMATH_ALIGN + +/* Define if we have Python installed. */ +#cmakedefine HAVE_PYTHON +#cmakedefine USE_DEBUG_PYTHON +/* Define if we have Python as a framework (Mac OS X). */ +#cmakedefine PYTHON_FRAMEWORK + +/* Define if we have RAD game tools, Miles Sound System installed. */ +#cmakedefine HAVE_RAD_MSS + +/* Define if we have FMODex installed. */ +#cmakedefine HAVE_FMODEX + +/* Define if we have OpenAL installed. */ +#cmakedefine HAVE_OPENAL + +/* Define if we have Freetype 2.0 or better available. */ +#cmakedefine HAVE_FREETYPE + +/* Define if we are using SpeedTree. */ +#cmakedefine HAVE_SPEEDTREE + +/* Define if we want to compile in a default font. */ +#cmakedefine COMPILE_IN_DEFAULT_FONT + +/* Define to use doubles for most numbers, intead of single-precision floats. */ +#cmakedefine STDFLOAT_DOUBLE + +/* Define if we have Maya available. */ +#cmakedefine HAVE_MAYA +#cmakedefine MAYA_PRE_5_0 + +/* Define if we have libRocket available and built with the Rocket Debugger. */ +#cmakedefine HAVE_ROCKET_DEBUGGER + +/* Define if we have built libRocket available and built with Python support. */ +#cmakedefine HAVE_ROCKET_PYTHON + +/* Define if we have SoftImage available. */ +#cmakedefine HAVE_SOFTIMAGE + +/* Define if we have FCollada available. */ +#cmakedefine HAVE_FCOLLADA + +/* Define if we have ARToolKit available. */ +#cmakedefine HAVE_ARTOOLKIT + +/* Define if we have libvorbisfile available. */ +#cmakedefine HAVE_VORBIS + +/* Define if we have OpenSSL installed. */ +#cmakedefine HAVE_OPENSSL +#cmakedefine REPORT_OPENSSL_ERRORS + +/* Define if we have libjpeg installed. */ +#cmakedefine HAVE_JPEG +#cmakedefine PHAVE_JPEGINT_H + +/* Define to build video-for-linux. */ +#cmakedefine HAVE_VIDEO4LINUX + +/* Define if we have libpng installed. */ +#cmakedefine HAVE_PNG + +/* Define if we have libtiff installed. */ +#cmakedefine HAVE_TIFF + +/* Define if we want to build these other image file formats. */ +#cmakedefine HAVE_SGI_RGB +#cmakedefine HAVE_TGA +#cmakedefine HAVE_IMG +#cmakedefine HAVE_SOFTIMAGE_PIC +#cmakedefine HAVE_BMP +#cmakedefine HAVE_PNM + +/* Define if we have libtar installed. */ +#cmakedefine HAVE_TAR + +/* Define if we have libfftw installed. */ +#cmakedefine HAVE_FFTW + +/* Define if we have libsquish installed. */ +#cmakedefine HAVE_SQUISH + +/* Define if we have Berkeley DB installed. */ +#cmakedefine HAVE_BDB + +/* Define if we have HELIX installed. */ +#cmakedefine HAVE_HELIX + +/* Define if we have CG installed. */ +#cmakedefine HAVE_CG + +/* Define if we have CGGL installed. */ +#cmakedefine HAVE_CGGL + +/* Define if we have CGDX8 installed. */ +#cmakedefine HAVE_CGDX8 + +/* Define if we have CGDX9 installed. */ +#cmakedefine HAVE_CGDX9 + +/* Define if we have CGDX10 installed. */ +#cmakedefine HAVE_CGDX10 + +/* Define for dxerr.h instead of dxerr9.h. */ +#cmakedefine USE_GENERIC_DXERR_LIBRARY + +/* Define if we have zlib installed. */ +#cmakedefine HAVE_ZLIB + +/* Define if we have OpenGL installed and want to build for GL. */ +#cmakedefine HAVE_GL +#if HAVE_GL +#cmakedefine MIN_GL_VERSION_MAJOR +#cmakedefine MIN_GL_VERSION_MINOR +#endif + +/* Define if we have OpenGL ES installed and want to build for GLES. */ +#cmakedefine HAVE_GLES + +/* Define if we have OpenGL ES installed and want to build for GLES2. */ +#cmakedefine HAVE_GLES2 + +/* Define if we have OpenCV installed and want to build for OpenCV. */ +#cmakedefine HAVE_OPENCV +#cmakedefine OPENCV_VER_23 + +/* Define if we have FFMPEG installed and want to build for FFMPEG. */ +#cmakedefine HAVE_FFMPEG +#cmakedefine HAVE_SWSCALE +#cmakedefine HAVE_SWRESAMPLE + +/* Define if we have ODE installed and want to build for ODE. */ +#cmakedefine HAVE_ODE + +/* Define if we have AWESOMIUM installed and want to build for AWESOMIUM. */ +#cmakedefine HAVE_AWESOMIUM + +/* Define if we have Mesa installed and want to build mesadisplay. */ +#cmakedefine HAVE_MESA +#cmakedefine MESA_MGL +#if HAVE_MESA +#cmakedefine MIN_MESA_VERSION_MAJOR +#cmakedefine MIN_MESA_VERSION_MINOR +#endif + +/* Define if we have GLX installed and want to build for GLX. */ +#cmakedefine HAVE_GLX + +/* Define if we have EGL installed and want to build for EGL. */ +#cmakedefine HAVE_EGL + +/* Define if we have Windows-GL installed and want to build for Wgl. */ +#cmakedefine HAVE_WGL + +/* Define if we have DirectX installed and want to build for DX. */ +#cmakedefine HAVE_DX8 + +/* Define if we have DirectX installed and want to build for DX. */ +#cmakedefine HAVE_DX9 + +/* The choice of generic vs. the specific dxerr library largely + depends on which SDK you have installed. */ +#cmakedefine USE_GENERIC_DXERR_LIBRARY + +/* Define if we want to build tinydisplay. */ +#cmakedefine HAVE_TINYDISPLAY + +/* Define if we have the SDL library. */ +#cmakedefine HAVE_SDL + +/* Define if we have X11. */ +#cmakedefine HAVE_X11 + +/* Define if we have the XFree86-DGA extension. */ +#cmakedefine HAVE_XF86DGA + +/* Define if we have the XRandR extension. */ +#cmakedefine HAVE_XRANDR + +/* Define if we have the XCursor extension. */ +#cmakedefine HAVE_XCURSOR + +/* Define if we want to compile the threading code. */ +#cmakedefine HAVE_THREADS + +/* Define if we want to use fast, user-space simulated threads. */ +#cmakedefine SIMPLE_THREADS + +/* Define if SIMPLE_THREADS should be implemented with the OS-provided + threading layer (if available). */ +#cmakedefine OS_SIMPLE_THREADS + +/* Define to enable deadlock detection, mutex recursion checks, etc. */ +#cmakedefine DEBUG_THREADS + +/* Define to implement mutexes and condition variables via a user-space spinlock. */ +#cmakedefine MUTEX_SPINLOCK + +/* Define to enable the PandaFileStream implementation of pfstream etc. */ +#cmakedefine USE_PANDAFILESTREAM + +/* Define if we want to compile the net code. */ +#cmakedefine HAVE_NET + +/* Define if we want to compile the egg code. */ +#cmakedefine HAVE_EGG + +/* Define if we want to compile the audio code. */ +#cmakedefine HAVE_AUDIO + +/* Define if we have bison and flex available. */ +#cmakedefine HAVE_BISON + +/* Define if we want to use PStats. */ +#cmakedefine DO_PSTATS + +/* Define if we want to type-check downcasts. */ +#cmakedefine DO_DCAST + +/* Define if we want to provide collision system recording and + visualization tools. */ +#cmakedefine DO_COLLISION_RECORDING + +/* Define if we want to enable track-memory-usage. */ +#cmakedefine DO_MEMORY_USAGE + +/* Define if we want to enable min-lag and max-lag. */ +#cmakedefine SIMULATE_NETWORK_DELAY + +/* Define if we want to allow immediate mode OpenGL rendering. */ +#cmakedefine SUPPORT_IMMEDIATE_MODE + +/* Define for either of the alternative malloc schemes. */ +#cmakedefine USE_MEMORY_DLMALLOC +#cmakedefine USE_MEMORY_PTMALLOC2 + +/* Define if we want to compile in support for pipelining. */ +#cmakedefine DO_PIPELINING + +/* Define if we want to keep Notify debug messages around, or undefine + to compile them out. */ +#cmakedefine NOTIFY_DEBUG + +/* Define if we want to export template classes from the DLL. Only + makes sense to MSVC++. */ +#cmakedefine EXPORT_TEMPLATES + +/* Define if we are linking PANDAPHYSX in with PANDA. */ +#cmakedefine LINK_IN_PHYSX + +/* The compiled-in character(s) to expect to separate different + components of a path list (e.g. $PRC_PATH). */ +#cmakedefine DEFAULT_PATHSEP + +/* Many of the prc variables are exported by + dtool/src/prc/prc_parameters.h.pp, instead of here. Only those prc + variables that must be visible outside of the prc directory are + exported here. */ + +/* The filename that specifies the public keys to import into + config. */ +#cmakedefine PRC_PUBLIC_KEYS_FILENAME +#cmakedefine PRC_PUBLIC_KEYS_INCLUDE + +/* Define if you want to save the descriptions for ConfigVariables. */ +#cmakedefine PRC_SAVE_DESCRIPTIONS + + +/* Define if your processor stores words with the most significant + byte first (like Motorola and SPARC, unlike Intel and VAX). */ +#cmakedefine WORDS_BIGENDIAN + +/* Define if the C++ compiler uses namespaces. */ +#cmakedefine HAVE_NAMESPACE + +/* Define if fstream::open() accepts a third parameter for umask. */ +#cmakedefine HAVE_OPEN_MASK + +/* Define if we have a lockf() function. */ +#cmakedefine HAVE_LOCKF + +/* Define if some header file defines wchar_t. */ +#cmakedefine HAVE_WCHAR_T + +/* Define if the header file defines wstring. */ +#cmakedefine HAVE_WSTRING + +/* Define if the C++ compiler supports the typename keyword. */ +#cmakedefine HAVE_TYPENAME + +/* Define if we can trust the compiler not to insert extra bytes in + structs between base structs and derived structs. */ +#cmakedefine SIMPLE_STRUCT_POINTERS + +/* Define if we have Dinkumware STL installed. */ +#cmakedefine HAVE_DINKUM + +/* Define if we have STL hash_map etc. available */ +#cmakedefine HAVE_STL_HASH + +/* Define if we have a gettimeofday() function. */ +#cmakedefine HAVE_GETTIMEOFDAY + +/* Define if gettimeofday() takes only one parameter. */ +#cmakedefine GETTIMEOFDAY_ONE_PARAM + +/* Define if you have the getopt function. */ +#cmakedefine HAVE_GETOPT + +/* Define if you have the getopt_long_only function. */ +#cmakedefine HAVE_GETOPT_LONG_ONLY + +/* Define if getopt appears in getopt.h. */ +#cmakedefine PHAVE_GETOPT_H + +/* Define if you have ioctl(TIOCGWINSZ) to determine terminal width. */ +#cmakedefine IOCTL_TERMINAL_WIDTH + +/* Do the system headers define a "streamsize" typedef? */ +#cmakedefine HAVE_STREAMSIZE + +/* Do the system headers define key ios typedefs like ios::openmode + and ios::fmtflags? */ +#cmakedefine HAVE_IOS_TYPEDEFS + +/* Define if the C++ iostream library defines ios::binary. */ +#cmakedefine HAVE_IOS_BINARY + +/* Can we safely call getenv() at static init time? */ +#cmakedefine STATIC_INIT_GETENV + +/* Can we read the file /proc/self/[*] to determine our + environment variables at static init time? */ +#cmakedefine HAVE_PROC_SELF_EXE +#cmakedefine HAVE_PROC_SELF_MAPS +#cmakedefine HAVE_PROC_SELF_ENVIRON +#cmakedefine HAVE_PROC_SELF_CMDLINE +#cmakedefine HAVE_PROC_CURPROC_FILE +#cmakedefine HAVE_PROC_CURPROC_MAP +#cmakedefine HAVE_PROC_CURPROC_CMDLINE + +/* Do we have a global pair of argc/argv variables that we can read at + static init time? Should we prototype them? What are they called? */ +#cmakedefine HAVE_GLOBAL_ARGV +#cmakedefine PROTOTYPE_GLOBAL_ARGV +#cmakedefine GLOBAL_ARGV +#cmakedefine GLOBAL_ARGC + +/* Define if you have the header file. */ +#cmakedefine PHAVE_IO_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_IOSTREAM + +/* Define if you have the header file. */ +#cmakedefine PHAVE_MALLOC_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_SYS_MALLOC_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_ALLOCA_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_LOCALE_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_STRING_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_STDLIB_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_LIMITS_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_MINMAX_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_SSTREAM + +/* Define if you have the header file. */ +#cmakedefine PHAVE_NEW + +/* Define if you have the header file. */ +#cmakedefine PHAVE_SYS_TYPES_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_SYS_TIME_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_UNISTD_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_UTIME_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_GLOB_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_DIRENT_H + +/* Define if you have the header file. */ +#cmakedefine PHAVE_DRFFTW_H + +/* Do we have (and presumably a Linux-style audio + interface)? */ +#cmakedefine PHAVE_SYS_SOUNDCARD_H + +/* Do we have (and therefore makecontext() / + swapcontext())? */ +#cmakedefine PHAVE_UCONTEXT_H + +/* Do we have ? This enables us to use raw mouse input. */ +#cmakedefine PHAVE_LINUX_INPUT_H + +/* Do we have ? */ +#cmakedefine PHAVE_STDINT_H + +/* Do we have RTTI (and )? */ +#cmakedefine HAVE_RTTI + +/* Do we have Posix threads? */ +#cmakedefine HAVE_POSIX_THREADS + +/* Is the code being compiled with the Tau profiler's instrumentor? */ +#cmakedefine USE_TAU + +/* Define if needed to have 64-bit file i/o */ +#cmakedefine __USE_LARGEFILE64 + +// To activate the DELETED_CHAIN macros. +#cmakedefine USE_DELETED_CHAIN + +// To build the Windows TOUCHINPUT interfaces (requires Windows 7). +#cmakedefine HAVE_WIN_TOUCHINPUT + +// If we are to build the native net interfaces. +#cmakedefine WANT_NATIVE_NET + +/* Turn off warnings for using scanf and such */ +#if 0 + #cmakedefine _CRT_SECURE_NO_WARNINGS + #pragma warning( disable : 4996 4275 4267 4099 4049 4013 4005 ) +#endif + +/* Static linkage instead of the normal dynamic linkage? */ +#cmakedefine LINK_ALL_STATIC + +/* Define to compile the plugin code. */ +#cmakedefine HAVE_P3D_PLUGIN + +/* Define to compile for Cocoa or Carbon on Mac OS X. */ +#cmakedefine HAVE_COCOA +#cmakedefine HAVE_CARBON + +/* Platform-identifying defines. */ +#cmakedefine IS_OSX +#cmakedefine IS_LINUX +#cmakedefine IS_FREEBSD +#cmakedefine BUILD_IPHONE +#cmakedefine UNIVERSAL_BINARIES From 3f4f03229f5f39039419eb9238c85fc66b1fcca6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 01:27:12 -0700 Subject: [PATCH 005/744] Get dtoolutil to build under CMake. --- dtool/Configure.cmake | 7 +- dtool/Package.cmake | 1 + dtool/dtool_config.h.cmake | 2 +- dtool/src/dtoolutil/Sources.cmake | 68 ++++++++++++++++ .../src/dtoolutil/checkPandaVersion.cxx.cmake | 21 +++++ dtool/src/dtoolutil/checkPandaVersion.h.cmake | 39 ++++++++++ dtool/src/dtoolutil/pandaVersion.h.cmake | 77 +++++++++++++++++++ 7 files changed, 213 insertions(+), 2 deletions(-) create mode 100644 dtool/src/dtoolutil/Sources.cmake create mode 100644 dtool/src/dtoolutil/checkPandaVersion.cxx.cmake create mode 100644 dtool/src/dtoolutil/checkPandaVersion.h.cmake create mode 100644 dtool/src/dtoolutil/pandaVersion.h.cmake diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index a71c2a6f3c..18734eb91d 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -339,7 +339,6 @@ check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) check_include_file_cxx(stdint.h PHAVE_STDINT_H) set(HAVE_NAMESPACE ON) -set(HAVE_OPEN_MASK ON) set(HAVE_LOCKF ON) set(HAVE_WCHAR_T ON) set(HAVE_WSTRING ON) @@ -348,5 +347,11 @@ set(SIMPLE_STRUCT_POINTERS ON) set(HAVE_STREAMSIZE ON) set(HAVE_IOS_TYPEDEFS ON) +if(WIN32) + set(DEFAULT_PATHSEP ";") +else() + set(DEFAULT_PATHSEP ":") +endif() + configure_file(${CMAKE_CURRENT_LIST_DIR}/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) include_directories("${CMAKE_BINARY_DIR}/include") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 31b465ff61..3ab9d2ecf5 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -39,3 +39,4 @@ set(DEFAULT_PRC_DIR "${INSTALL_DIR}/etc" CACHE STRING "Panda uses prc files for ## Include dtool subpackages ## include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolbase/Sources.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolutil/Sources.cmake) diff --git a/dtool/dtool_config.h.cmake b/dtool/dtool_config.h.cmake index 344515b458..189e1f8a8d 100644 --- a/dtool/dtool_config.h.cmake +++ b/dtool/dtool_config.h.cmake @@ -261,7 +261,7 @@ /* The compiled-in character(s) to expect to separate different components of a path list (e.g. $PRC_PATH). */ -#cmakedefine DEFAULT_PATHSEP +#define DEFAULT_PATHSEP "@DEFAULT_PATHSEP@" /* Many of the prc variables are exported by dtool/src/prc/prc_parameters.h.pp, instead of here. Only those prc diff --git a/dtool/src/dtoolutil/Sources.cmake b/dtool/src/dtoolutil/Sources.cmake new file mode 100644 index 0000000000..edd6f6b278 --- /dev/null +++ b/dtool/src/dtoolutil/Sources.cmake @@ -0,0 +1,68 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/pandaVersion.h.cmake + ${CMAKE_CURRENT_LIST_DIR}/pandaVersion.h) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.h.cmake + ${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.h) + +configure_file(${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.cxx.cmake + ${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.cxx) + +set(P3DTOOLUTIL_HEADER_FILES + checkPandaVersion.h + config_dtoolutil.h + dSearchPath.I dSearchPath.h + executionEnvironment.I executionEnvironment.h filename.I + filename.h + globPattern.I globPattern.h + load_dso.h + pandaFileStream.h pandaFileStream.I + pandaFileStreamBuf.h + pandaSystem.h pandaVersion.h + panda_getopt.h panda_getopt_long.h panda_getopt_impl.h + pfstream.h pfstream.I pfstreamBuf.h + preprocess_argv.h + stringDecoder.h stringDecoder.I + textEncoder.h textEncoder.I + unicodeLatinMap.h + vector_string.h + vector_src.h + win32ArgParser.h +) + +if(APPLE) + set(P3DTOOL_HEADER_FILES ${P3DTOOL_HEADER_FILES} + filename_assist.mm filename_assist.h) +endif() + +set(P3DTOOLUTIL_SOURCE_FILES + checkPandaVersion.cxx + config_dtoolutil.cxx + dSearchPath.cxx + executionEnvironment.cxx filename.cxx + globPattern.cxx + load_dso.cxx + pandaFileStream.cxx pandaFileStreamBuf.cxx + pandaSystem.cxx + panda_getopt_impl.cxx + pfstreamBuf.cxx pfstream.cxx + preprocess_argv.cxx + stringDecoder.cxx + textEncoder.cxx + unicodeLatinMap.cxx + vector_string.cxx + win32ArgParser.cxx +) + +foreach(FILENAME IN LISTS P3DTOOLUTIL_HEADER_FILES) + set(P3DTOOLUTIL_INSTALL_HEADERS ${P3DTOOLUTIL_INSTALL_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() +foreach(FILENAME IN LISTS P3DTOOLUTIL_SOURCE_FILES) + set(P3DTOOLUTIL_SOURCES ${P3DTOOLUTIL_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() + +add_library(p3dtoolutil + ${P3DTOOLUTIL_INSTALL_HEADERS} + ${P3DTOOLUTIL_SOURCES} +) diff --git a/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake b/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake new file mode 100644 index 0000000000..db059b6870 --- /dev/null +++ b/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake @@ -0,0 +1,21 @@ +/* Filename: checkPandaVersion.cxx + * Created by: drose (26Jan05) + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * PANDA 3D SOFTWARE + * Copyright (c) Carnegie Mellon University. All rights reserved. + * + * All use of this software is subject to the terms of the revised BSD + * license. You should have received a copy of this license along + * with this source code in a file named "LICENSE." + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/******************************************************************* + * Generated automatically by CMake. + ***************************** DO NOT EDIT *************************/ + +# include "dtoolbase.h" + +EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@ = 0; diff --git a/dtool/src/dtoolutil/checkPandaVersion.h.cmake b/dtool/src/dtoolutil/checkPandaVersion.h.cmake new file mode 100644 index 0000000000..de76900fc0 --- /dev/null +++ b/dtool/src/dtoolutil/checkPandaVersion.h.cmake @@ -0,0 +1,39 @@ +/* Filename: checkPandaVersion.h + * Created by: drose (26Jan05) + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * PANDA 3D SOFTWARE + * Copyright (c) Carnegie Mellon University. All rights reserved. + * + * All use of this software is subject to the terms of the revised BSD + * license. You should have received a copy of this license along + * with this source code in a file named "LICENSE." + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/******************************************************************* + * Generated automatically by CMake. + ***************************** DO NOT EDIT *************************/ + +/* Include this file in code that compiles with Panda to guarantee + that it is linking with the same version of the Panda DLL's that it + was compiled with. You should include it in one .cxx file only. */ + +/* We guarantee this by defining an external symbol which is based on + the version number. If that symbol is defined, then our DLL's + (probably) match. Otherwise, we must be running with the wrong + DLL; but the system linker will prevent the DLL from loading with + an undefined symbol. */ + +# include "dtoolbase.h" + +extern EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@; + +# ifndef WIN32 +/* For Windows, exporting the symbol from the DLL is sufficient; the + DLL will not load unless all expected public symbols are defined. + Other systems may not mind if the symbol is absent unless we + explictly write code that references it. */ +static int check_panda_version = @PANDA_VERSION_SYMBOL@; +# endif diff --git a/dtool/src/dtoolutil/pandaVersion.h.cmake b/dtool/src/dtoolutil/pandaVersion.h.cmake new file mode 100644 index 0000000000..19321d09a8 --- /dev/null +++ b/dtool/src/dtoolutil/pandaVersion.h.cmake @@ -0,0 +1,77 @@ +/* Filename: pandaVersion.h + * Created by: drose (26Jan05) + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * PANDA 3D SOFTWARE + * Copyright (c) Carnegie Mellon University. All rights reserved. + * + * All use of this software is subject to the terms of the revised BSD + * license. You should have received a copy of this license along + * with this source code in a file named "LICENSE." + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + +/******************************************************************* + * Generated automatically by CMake. + ***************************** DO NOT EDIT ************************* + + Do NOT attempt to edit the version number in this file. This is a + generated file, and your changes to this file will not persist. To + increment the version number, modify dtool/PandaVersion.pp and + re-run ppremake. + + ***************************** DO NOT EDIT *************************/ + +/* Include this file anywhere you need to determine the Panda version + number at compile time. If you need the runtime Panda version, use + pandaSystem.h instead. */ + +/* Try to avoid including this file from another .h file; include it + only from .cxx instead. This helps prevent unnecessarily long + rebuilds just because the version number changes; if this file is + included in a .h file, then any other files which also include that + .h file will need to be rebuilt when the version number changes. */ + +#define PANDA_MAJOR_VERSION @PANDA_MAJOR_VERSION@ +#define PANDA_MINOR_VERSION @PANDA_MINOR_VERSION@ +#define PANDA_SEQUENCE_VERSION @PANDA_SEQUENCE_VERSION@ + +/* Define if this is an "official" version, undefine otherwise. */ +#cmakedefine PANDA_OFFICIAL_VERSION + +/* This is the panda numeric version as a single number, with three + digits reserved for each component. */ +#define PANDA_NUMERIC_VERSION @PANDA_NUMERIC_VERSION@ + +/* This is the panda version expressed as a string. It ends in the + letter "c" if this is not an "official" version (e.g. it was checked + out from CVS by the builder). */ +#define PANDA_VERSION_STR "@PANDA_VERSION_STR@" + +/* This is the version of the Panda3D ABI expressed as a string. + This usually means the major and minor version. It should be the + same for Panda3D versions that are supposed to be backward + ABI compatible with each other. */ +#define PANDA_ABI_VERSION_STR "@PANDA_MAJOR_VERSION@.@PANDA_MINOR_VERSION@" + +/* This is a string indicating who has provided this distribution. */ +#define PANDA_DISTRIBUTOR "@PANDA_DISTRIBUTOR@" + +/* The string indicating the version number of the associated Panda3D + distributable package, or empty string if there is no associated + package. */ +#define PANDA_PACKAGE_VERSION_STR "@PANDA_PACKAGE_VERSION@" + +/* The string indicating the URL from which the associated Panda3D + distributable package may be downloaded, or empty string if there + is no associated package. */ +#define PANDA_PACKAGE_HOST_URL "@PANDA_PACKAGE_HOST_URL@" + +#if HAVE_P3D_PLUGIN +/* Similar definitions for the plugin versioning, if in use. */ +#define P3D_PLUGIN_MAJOR_VERSION "@P3D_PLUGIN_MAJOR_VERSION@" +#define P3D_PLUGIN_MINOR_VERSION "@P3D_PLUGIN_MINOR_VERSION@" +#define P3D_PLUGIN_SEQUENCE_VERSION "@P3D_PLUGIN_SEQUENCE_VERSION@" +#define P3D_COREAPI_VERSION_STR "@P3D_COREAPI_VERSION_STR@" +#endif From e7655ced72790fd7fb61421a13c6b4f1fe35f44f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 01:41:32 -0700 Subject: [PATCH 006/744] Get p3dtool building under CMake. --- dtool/Package.cmake | 3 +++ dtool/metalibs/dtool/Sources.cmake | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 dtool/metalibs/dtool/Sources.cmake diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 3ab9d2ecf5..0e3df998d1 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -40,3 +40,6 @@ set(DEFAULT_PRC_DIR "${INSTALL_DIR}/etc" CACHE STRING "Panda uses prc files for include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolbase/Sources.cmake) include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolutil/Sources.cmake) + +## Include dtool metalibs ## +include(${CMAKE_CURRENT_LIST_DIR}/metalibs/dtool/Sources.cmake) diff --git a/dtool/metalibs/dtool/Sources.cmake b/dtool/metalibs/dtool/Sources.cmake new file mode 100644 index 0000000000..3707475cd3 --- /dev/null +++ b/dtool/metalibs/dtool/Sources.cmake @@ -0,0 +1,2 @@ +add_library(p3dtool ${CMAKE_CURRENT_LIST_DIR}/dtool.cxx) +target_link_libraries(p3dtool p3dtoolutil p3dtoolbase) From 8020f5da1a3567ff53c3feb986c6654382b126be Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 01:53:40 -0700 Subject: [PATCH 007/744] Ensure that dtoolutil/dtoolbase get built statically by CMake. --- dtool/src/dtoolbase/Sources.cmake | 2 +- dtool/src/dtoolutil/Sources.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/Sources.cmake b/dtool/src/dtoolbase/Sources.cmake index 7f540f2efe..87e6f0e0c7 100644 --- a/dtool/src/dtoolbase/Sources.cmake +++ b/dtool/src/dtoolbase/Sources.cmake @@ -66,7 +66,7 @@ foreach(FILENAME IN LISTS P3DTOOLBASE_SOURCE_FILES) set(P3DTOOLBASE_SOURCES ${P3DTOOLBASE_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) endforeach() -add_library(p3dtoolbase +add_library(p3dtoolbase STATIC ${P3DTOOLBASE_INSTALL_HEADERS} ${P3DTOOLBASE_SOURCES} ) diff --git a/dtool/src/dtoolutil/Sources.cmake b/dtool/src/dtoolutil/Sources.cmake index edd6f6b278..b350b4f2c1 100644 --- a/dtool/src/dtoolutil/Sources.cmake +++ b/dtool/src/dtoolutil/Sources.cmake @@ -62,7 +62,7 @@ foreach(FILENAME IN LISTS P3DTOOLUTIL_SOURCE_FILES) set(P3DTOOLUTIL_SOURCES ${P3DTOOLUTIL_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) endforeach() -add_library(p3dtoolutil +add_library(p3dtoolutil STATIC ${P3DTOOLUTIL_INSTALL_HEADERS} ${P3DTOOLUTIL_SOURCES} ) From ea140ed5cc68cc7a0ff0dc9bab8d800b37c4b035 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 19:01:16 -0700 Subject: [PATCH 008/744] Rename most *.cmake files to CMakeLists.txt [1/2] --- dtool/{Package.cmake => CMakeLists.txt} | 0 dtool/metalibs/dtool/{Sources.cmake => CMakeLists.txt} | 0 dtool/src/dtoolbase/{Sources.cmake => CMakeLists.txt} | 0 dtool/src/dtoolutil/{Sources.cmake => CMakeLists.txt} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename dtool/{Package.cmake => CMakeLists.txt} (100%) rename dtool/metalibs/dtool/{Sources.cmake => CMakeLists.txt} (100%) rename dtool/src/dtoolbase/{Sources.cmake => CMakeLists.txt} (100%) rename dtool/src/dtoolutil/{Sources.cmake => CMakeLists.txt} (100%) diff --git a/dtool/Package.cmake b/dtool/CMakeLists.txt similarity index 100% rename from dtool/Package.cmake rename to dtool/CMakeLists.txt diff --git a/dtool/metalibs/dtool/Sources.cmake b/dtool/metalibs/dtool/CMakeLists.txt similarity index 100% rename from dtool/metalibs/dtool/Sources.cmake rename to dtool/metalibs/dtool/CMakeLists.txt diff --git a/dtool/src/dtoolbase/Sources.cmake b/dtool/src/dtoolbase/CMakeLists.txt similarity index 100% rename from dtool/src/dtoolbase/Sources.cmake rename to dtool/src/dtoolbase/CMakeLists.txt diff --git a/dtool/src/dtoolutil/Sources.cmake b/dtool/src/dtoolutil/CMakeLists.txt similarity index 100% rename from dtool/src/dtoolutil/Sources.cmake rename to dtool/src/dtoolutil/CMakeLists.txt From bfe32b75d74298f9788c104937a14087bf83b9de Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 20:09:27 -0700 Subject: [PATCH 009/744] Modify CMakeLists to use add_subdirectory where appropriate, instead of include. --- CMakeLists.txt | 2 +- dtool/CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fb04c564c9..01f5b0056b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,4 +15,4 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") ## Include Panda3D Packages ## -include(${CMAKE_SOURCE_DIR}/dtool/Package.cmake) +add_subdirectory(dtool) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 0e3df998d1..46389c08ab 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -35,11 +35,11 @@ set(DTOOL_INSTALL "${INSTALL_DIR}" CACHE STRING "The directory in which to insta 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(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) ## Include dtool subpackages ## -include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolbase/Sources.cmake) -include(${CMAKE_CURRENT_LIST_DIR}/src/dtoolutil/Sources.cmake) +add_subdirectory(src/dtoolbase) +add_subdirectory(src/dtoolutil) ## Include dtool metalibs ## -include(${CMAKE_CURRENT_LIST_DIR}/metalibs/dtool/Sources.cmake) +add_subdirectory(metalibs/dtool) From 6c067883cc4d9c12adcc94340304092220f9869b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 22:21:28 -0700 Subject: [PATCH 010/744] Update CMake configuration (and a few includes) to get p3prc compiling. --- dtool/CMakeLists.txt | 1 + dtool/src/prc/CMakeLists.txt | 81 ++++++++++++++++++++++++++++ dtool/src/prc/configDeclaration.cxx | 1 + dtool/src/prc/configVariableBase.cxx | 1 + dtool/src/prc/nativeNumericData.h | 1 + dtool/src/prc/prc_parameters.h.cmake | 56 +++++++++++++++++++ 6 files changed, 141 insertions(+) create mode 100644 dtool/src/prc/CMakeLists.txt create mode 100644 dtool/src/prc/prc_parameters.h.cmake diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 46389c08ab..01ea7538e5 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -40,6 +40,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) ## Include dtool subpackages ## add_subdirectory(src/dtoolbase) add_subdirectory(src/dtoolutil) +add_subdirectory(src/prc) ## Include dtool metalibs ## add_subdirectory(metalibs/dtool) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt new file mode 100644 index 0000000000..0e05e21333 --- /dev/null +++ b/dtool/src/prc/CMakeLists.txt @@ -0,0 +1,81 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolutil) +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) + +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.") + +configure_file(${CMAKE_CURRENT_LIST_DIR}/prc_parameters.h.cmake + ${CMAKE_CURRENT_LIST_DIR}/prc_parameters.h) + +set(P3PRC_HEADER_FILES + bigEndian.h + config_prc.h + configDeclaration.I configDeclaration.h + configFlags.I configFlags.h + configPage.I configPage.h + configPageManager.I configPageManager.h + configVariable.I configVariable.h + configVariableBase.I configVariableBase.h + configVariableBool.I configVariableBool.h + configVariableCore.I configVariableCore.h + configVariableDouble.I configVariableDouble.h + configVariableEnum.I configVariableEnum.h + configVariableFilename.I configVariableFilename.h + configVariableInt.I configVariableInt.h + configVariableInt64.I configVariableInt64.h + configVariableList.I configVariableList.h + configVariableManager.I configVariableManager.h + configVariableSearchPath.I configVariableSearchPath.h + configVariableString.I configVariableString.h + encryptStreamBuf.h encryptStreamBuf.I encryptStream.h encryptStream.I + littleEndian.h + nativeNumericData.I nativeNumericData.h + pnotify.I pnotify.h + notifyCategory.I notifyCategory.h + notifyCategoryProxy.I notifyCategoryProxy.h + notifySeverity.h + prcKeyRegistry.h + reversedNumericData.I reversedNumericData.h + streamReader.I streamReader.h + streamWrapper.I streamWrapper.h + streamWriter.I streamWriter.h + prc_parameters.h) + +set(P3PRC_SOURCE_FILES + config_prc.cxx + configDeclaration.cxx + configFlags.cxx + configPage.cxx + configPageManager.cxx + configVariable.cxx + configVariableBase.cxx + configVariableBool.cxx + configVariableCore.cxx + configVariableDouble.cxx + configVariableEnum.cxx + configVariableFilename.cxx + configVariableInt.cxx + configVariableInt64.cxx + configVariableList.cxx + configVariableManager.cxx + configVariableSearchPath.cxx + configVariableString.cxx + encryptStreamBuf.cxx encryptStream.cxx + nativeNumericData.cxx + notify.cxx + notifyCategory.cxx + notifySeverity.cxx + prcKeyRegistry.cxx + reversedNumericData.cxx + streamReader.cxx streamWrapper.cxx streamWriter.cxx) + +foreach(FILENAME IN LISTS P3PRC_HEADER_FILES) + set(P3PRC_HEADERS ${P3PRC_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() +foreach(FILENAME IN LISTS P3PRC_SOURCE_FILES) + set(P3PRC_SOURCES ${P3PRC_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() + +add_library(p3prc STATIC + ${P3PRC_HEADERS} + ${P3PRC_SOURCES}) diff --git a/dtool/src/prc/configDeclaration.cxx b/dtool/src/prc/configDeclaration.cxx index cef2fccbac..fa3e4f095e 100644 --- a/dtool/src/prc/configDeclaration.cxx +++ b/dtool/src/prc/configDeclaration.cxx @@ -14,6 +14,7 @@ #include "configDeclaration.h" #include "configVariableCore.h" +#include "config_prc.h" #include "pstrtod.h" diff --git a/dtool/src/prc/configVariableBase.cxx b/dtool/src/prc/configVariableBase.cxx index e55b54f409..7cdc6b6a98 100644 --- a/dtool/src/prc/configVariableBase.cxx +++ b/dtool/src/prc/configVariableBase.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "configVariableBase.h" +#include "config_prc.h" ConfigVariableBase::Unconstructed *ConfigVariableBase::_unconstructed; diff --git a/dtool/src/prc/nativeNumericData.h b/dtool/src/prc/nativeNumericData.h index 454810c89b..95ba1c7a1a 100644 --- a/dtool/src/prc/nativeNumericData.h +++ b/dtool/src/prc/nativeNumericData.h @@ -16,6 +16,7 @@ #define NATIVENUMERICDATA_H #include "dtoolbase.h" +#include "numeric_types.h" #include // for memcpy() diff --git a/dtool/src/prc/prc_parameters.h.cmake b/dtool/src/prc/prc_parameters.h.cmake new file mode 100644 index 0000000000..80d4dcdb8d --- /dev/null +++ b/dtool/src/prc/prc_parameters.h.cmake @@ -0,0 +1,56 @@ +/* prc_parameters.h. Generated automatically by CMake. */ +/********************************** DO NOT EDIT ****************************/ + + +/* The compiled-in default directory to look for the Configrc file, in + the absence of the PRC_DIR environment variable set, and in + the absence of anything specified via the configpath directive. */ +#define DEFAULT_PRC_DIR "@DEFAULT_PRC_DIR@" + +/* The compiled-in name of the environment variable(s) that contain + the name of a single directory in which to search for prc files. */ +#define PRC_DIR_ENVVARS "@PRC_DIR_ENVVARS@" + +/* The compiled-in name of the environment variable(s) that contain + the name of multiple directories, separated by DEFAULT_PATHSEP, in + which to search for prc files. */ +#define PRC_PATH_ENVVARS "@PRC_PATH_ENVVARS@" + +/* This is a special variable that is rarely used; it exists primarily + to support the Cygwin-based "ctattach" tools used by the Walt + Disney VR Studio. This defines a set of environment variable(s) + that define a search path, as above; except that the directory + names on these search paths are Panda-style filenames, not + Windows-style filenames; and the path separator is always a space + character, regardless of DEFAULT_PATHSEP. */ +#define PRC_PATH2_ENVVARS "@PRC_PATH2_ENVVARS@" + +/* The filename(s) to search for in the above paths. Normally this is + *.prc. */ +#define PRC_PATTERNS "@PRC_PATTERNS@" + +/* The filename(s) for encrypted prc files. */ +#define PRC_ENCRYPTED_PATTERNS "@PRC_ENCRYPTED_PATTERNS@" + +/* The encryption key used to decrypt any encrypted prc files + identified by PRC_ENCRYPTED_PATTERNS. */ +#define PRC_ENCRYPTION_KEY "@PRC_ENCRYPTION_KEY@" + +/* The filename(s) to search for, and execute, in the above paths. + Normally this is empty. */ +#define PRC_EXECUTABLE_PATTERNS "@PRC_EXECUTABLE_PATTERNS@" + +/* The environment variable that defines optional args to pass to + executables found that match one of the above patterns. */ +#define PRC_EXECUTABLE_ARGS_ENVVAR "@PRC_EXECUTABLE_ARGS_ENVVAR@" + +/* Define if we want to enable the "trust_level" feature of prc config + variables. This requires OpenSSL and PRC_PUBLIC_KEYS_FILENAME, + above. */ +#cmakedefine PRC_RESPECT_TRUST_LEVEL + +/* The trust level value for any legacy (DConfig) variables. */ +#define PRC_DCONFIG_TRUST_LEVEL @PRC_DCONFIG_TRUST_LEVEL@ + +/* The amount by which we globally increment the trust level. */ +#define PRC_INC_TRUST_LEVEL @PRC_INC_TRUST_LEVEL@ From 111b1f054854c5f99417bfd178b56b43ec1b8882 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 28 Nov 2013 23:36:22 -0700 Subject: [PATCH 011/744] Add p3cppparser building to the CMake build system. --- dtool/CMakeLists.txt | 1 + dtool/src/cppparser/CMakeLists.txt | 55 ++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 dtool/src/cppparser/CMakeLists.txt diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 01ea7538e5..9d34b790a1 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -41,6 +41,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) add_subdirectory(src/dtoolbase) add_subdirectory(src/dtoolutil) add_subdirectory(src/prc) +add_subdirectory(src/cppparser) ## Include dtool metalibs ## add_subdirectory(metalibs/dtool) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt new file mode 100644 index 0000000000..a9e8f1db85 --- /dev/null +++ b/dtool/src/cppparser/CMakeLists.txt @@ -0,0 +1,55 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolutil) +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) + +set(P3CPPPARSER_HEADER_FILES + cppArrayType.h cppBison.yxx cppBisonDefs.h + cppClassTemplateParameter.h cppCommentBlock.h cppConstType.h + cppDeclaration.h cppEnumType.h cppExpression.h + cppExpressionParser.h cppExtensionType.h cppFile.h + cppFunctionGroup.h cppFunctionType.h cppGlobals.h + cppIdentifier.h cppInstance.h cppInstanceIdentifier.h + cppMakeSeq.h cppManifest.h + cppNameComponent.h cppNamespace.h + cppParameterList.h cppParser.h cppPointerType.h + cppPreprocessor.h cppReferenceType.h cppScope.h + 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) + +set(P3CPPPARSER_SOURCE_FILES + cppArrayType.cxx cppBison.cxx cppClassTemplateParameter.cxx + cppCommentBlock.cxx cppConstType.cxx cppDeclaration.cxx + cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx + cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx + cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx + cppInstance.cxx cppInstanceIdentifier.cxx + cppMakeSeq.cxx cppManifest.cxx + cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx + cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx + cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx + cppStructType.cxx cppTBDType.cxx + cppTemplateParameterList.cxx cppTemplateScope.cxx + cppToken.cxx cppType.cxx cppTypeDeclaration.cxx + cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx + cppUsing.cxx cppVisibility.cxx) + +foreach(FILENAME IN LISTS P3CPPPARSER_HEADER_FILES) + set(P3CPPPARSER_HEADERS ${P3CPPPARSER_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() +foreach(FILENAME IN LISTS P3CPPPARSER_SOURCE_FILES) + set(P3CPPPARSER_SOURCES ${P3CPPPARSER_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() + +if(HAVE_INTERROGATE) + find_package(BISON) + bison_target(cppParser + ${CMAKE_CURRENT_LIST_DIR}/cppBison.yxx + ${CMAKE_CURRENT_LIST_DIR}/cppBison.cxx + COMPILE_FLAGS --defines=${CMAKE_CURRENT_LIST_DIR}/cppBison.h) + + add_library(p3cppParser STATIC + ${P3CPPPARSER_HEADERS} + ${P3CPPPARSER_SOURCES}) + add_dependencies(p3cppParser cppParser) +endif() From 71889acb88f75bed15e2575f9fd78182a7523006 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 00:28:43 -0700 Subject: [PATCH 012/744] CMake: Begin implementing library detection and configuration. --- cmake/modules/FindEigen2.cmake | 80 +++++++++++++++++++++++++++++++ cmake/modules/FindEigen3.cmake | 80 +++++++++++++++++++++++++++++++ cmake/modules/MangleJPEG.cmake | 24 ++++++++++ cmake/modules/MangleOpenSSL.cmake | 26 ++++++++++ cmake/modules/ManglePNG.cmake | 29 +++++++++++ dtool/Configure.cmake | 37 +++++++++++++- 6 files changed, 275 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/FindEigen2.cmake create mode 100644 cmake/modules/FindEigen3.cmake create mode 100644 cmake/modules/MangleJPEG.cmake create mode 100644 cmake/modules/MangleOpenSSL.cmake create mode 100644 cmake/modules/ManglePNG.cmake diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake new file mode 100644 index 0000000000..ae3fb60a26 --- /dev/null +++ b/cmake/modules/FindEigen2.cmake @@ -0,0 +1,80 @@ +# Filename: FindEigen2.cmake +# Authors: montel@kde.org, g.gael@free.fr +# Redistribution and use is allowed according to the terms of the BSD license. +# +# Module modified to mangle the names for Panda3D. +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(Eigen2 2.0.3) +# to require version 2.0.3 to newer of Eigen2. +# +# Once done this will define +# +# HAVE_EIGEN - system has eigen lib with correct version +# EIGEN_IPATH - the eigen include directory +# EIGEN_VERSION - eigen version +# + +if(NOT Eigen2_FIND_VERSION) + if(NOT Eigen2_FIND_VERSION_MAJOR) + set(Eigen2_FIND_VERSION_MAJOR 2) + endif(NOT Eigen2_FIND_VERSION_MAJOR) + if(NOT Eigen2_FIND_VERSION_MINOR) + set(Eigen2_FIND_VERSION_MINOR 0) + endif(NOT Eigen2_FIND_VERSION_MINOR) + if(NOT Eigen2_FIND_VERSION_PATCH) + set(Eigen2_FIND_VERSION_PATCH 0) + endif(NOT Eigen2_FIND_VERSION_PATCH) + + set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}") +endif(NOT Eigen2_FIND_VERSION) + +macro(_eigen2_check_version) + file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen2_version_header) + + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}") + set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}") + set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}") + set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}") + + set(EIGEN_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION}) + if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})) + set(EIGEN_VERSION_OK FALSE) + else() + set(EIGEN_VERSION_OK TRUE) + endif() + + if(NOT EIGEN_VERSION_OK) + + message(STATUS "Eigen2 version ${EIGEN_VERSION} found in ${EIGEN_IPATH}, " + "but at least version ${Eigen2_FIND_VERSION} is required") + endif(NOT EIGEN_VERSION_OK) +endmacro(_eigen2_check_version) + +if (EIGEN_IPATH) + + # in cache already + _eigen2_check_version() + set(EIGEN2_FOUND ${EIGEN_VERSION_OK}) + +else (EIGEN_IPATH) + + find_path(EIGEN_IPATH NAMES Eigen/Core + PATHS + ${INCLUDE_INSTALL_DIR} + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen2 + ) + + if(EIGEN_IPATH) + _eigen2_check_version() + endif(EIGEN_IPATH) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN_IPATH EIGEN_VERSION_OK) + + mark_as_advanced(EIGEN_IPATH) + +endif(EIGEN_IPATH) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake new file mode 100644 index 0000000000..1992550555 --- /dev/null +++ b/cmake/modules/FindEigen3.cmake @@ -0,0 +1,80 @@ +# Filename: FindEigen3.cmake +# Authors: montel@kde.org, g.gael@free.fr, jacob.benoit.1@gmail.com +# Redistribution and use is allowed according to the terms of the BSD license. +# +# Module modified to mangle the names for Panda3D. +# +# This module supports requiring a minimum version, e.g. you can do +# find_package(Eigen3 3.1.2) +# to require version 3.1.2 or newer of Eigen3. +# +# Once done this will define +# +# HAVE_EIGEN - system has eigen lib with correct version +# EIGEN_IPATH - the eigen include directory +# EIGEN_VERSION - eigen version +# + +if(NOT Eigen3_FIND_VERSION) + if(NOT Eigen3_FIND_VERSION_MAJOR) + set(Eigen3_FIND_VERSION_MAJOR 2) + endif(NOT Eigen3_FIND_VERSION_MAJOR) + if(NOT Eigen3_FIND_VERSION_MINOR) + set(Eigen3_FIND_VERSION_MINOR 91) + endif(NOT Eigen3_FIND_VERSION_MINOR) + if(NOT Eigen3_FIND_VERSION_PATCH) + set(Eigen3_FIND_VERSION_PATCH 0) + endif(NOT Eigen3_FIND_VERSION_PATCH) + + set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") +endif(NOT Eigen3_FIND_VERSION) + +macro(_eigen3_check_version) + file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) + + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") + set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") + set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") + set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") + + set(EIGEN_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) + if(${EIGEN_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN_VERSION_OK FALSE) + else(${EIGEN_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + set(EIGEN_VERSION_OK TRUE) + endif(${EIGEN_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + + if(NOT EIGEN_VERSION_OK) + + message(STATUS "Eigen3 version ${EIGEN_VERSION} found in ${EIGEN_IPATH}, " + "but at least version ${Eigen3_FIND_VERSION} is required") + endif(NOT EIGEN_VERSION_OK) +endmacro(_eigen3_check_version) + +if (EIGEN_IPATH) + + # in cache already + _eigen3_check_version() + set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + +else (EIGEN_IPATH) + + find_path(EIGEN_IPATH NAMES signature_of_eigen3_matrix_library + PATHS + ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) + + if(EIGEN_IPATH) + _eigen3_check_version() + endif(EIGEN_IPATH) + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN_IPATH EIGEN_VERSION_OK) + + mark_as_advanced(EIGEN_IPATH) + +endif(EIGEN_IPATH) diff --git a/cmake/modules/MangleJPEG.cmake b/cmake/modules/MangleJPEG.cmake new file mode 100644 index 0000000000..9ef75a675d --- /dev/null +++ b/cmake/modules/MangleJPEG.cmake @@ -0,0 +1,24 @@ +# Filename: MangleJPEG.cmake +# Author: kestred (28 Nov, 2013) +# +# MangleJPEG replaces the output variables of the builtin FindJPEG +# with vars matching Panda3D's existing config-var names. +# + +if(JPEG_FOUND) + set(HAVE_JPEG TRUE) + set(JPEG_LIBS jpeg) + + get_filename_component(JPEG_LIBRARY_DIR "${JPEG_LIBRARY}" PATH) + + set(JPEG_IPATH "${JPEG_INCLUDE_DIR}" CACHE PATH "The path to libJPEG's include directory.") # Include path + set(JPEG_LPATH "${JPEG_LIBRARY_DIR}" CACHE PATH "The path to libJPEG's library directory.") # Library path + mark_as_advanced(JPEG_IPATH) + mark_as_advanced(JPEG_LPATH) + + unset(JPEG_FOUND) + unset(JPEG_LIBRARY CACHE) + unset(JPEG_LIBRARIES) + unset(JPEG_INCLUDE_DIR CACHE) + unset(JPEG_LIBRARY_DIR) +endif() \ No newline at end of file diff --git a/cmake/modules/MangleOpenSSL.cmake b/cmake/modules/MangleOpenSSL.cmake new file mode 100644 index 0000000000..5a3bc3b1fb --- /dev/null +++ b/cmake/modules/MangleOpenSSL.cmake @@ -0,0 +1,26 @@ +# Filename: MangleOpenSSL.cmake +# Author: kestred (28 Nov, 2013) +# +# MangleOpenSSL replaces the output variables of the builtin FindOpenSSL +# with vars matching Panda3D's existing config-var names. +# + +if(OPENSSL_FOUND) + set(HAVE_OPENSSL TRUE) + set(OPENSSL_LIBS ssl crypto) + + list(GET OPENSSL_LIBRARIES 0 OPENSSL_LIBRARY) + + get_filename_component(OPENSSL_LIBRARY_DIR "${OPENSSL_LIBRARY}" PATH) + + set(OPENSSL_IPATH "${OPENSSL_INCLUDE_DIR}" CACHE PATH "The path to OpenSSL's include directory.") # Include path + set(OPENSSL_LPATH "${OPENSSL_LIBRARY_DIR}" CACHE PATH "The path to OpenSSL's library directory.") # Library path + mark_as_advanced(OPENSSL_IPATH) + mark_as_advanced(OPENSSL_LPATH) + + unset(OPENSSL_FOUND) + unset(OPENSSL_LIBRARY) + unset(OPENSSL_LIBRARIES) + unset(OPENSSL_INCLUDE_DIR CACHE) + unset(OPENSSL_LIBRARY_DIR) +endif() \ No newline at end of file diff --git a/cmake/modules/ManglePNG.cmake b/cmake/modules/ManglePNG.cmake new file mode 100644 index 0000000000..e1001fb200 --- /dev/null +++ b/cmake/modules/ManglePNG.cmake @@ -0,0 +1,29 @@ +# Filename: ManglePNG.cmake +# Author: kestred (28 Nov, 2013) +# +# ManglePNG replaces the output variables of the builtin FindPNG +# with vars matching Panda3D's existing config-var names. +# + +if(PNG_FOUND) + set(HAVE_PNG TRUE) + set(PNG_LIBS png) + + get_filename_component(PNG_LIBRARY_DIR "${PNG_LIBRARY}" PATH) + + set(PNG_IPATH "${PNG_INCLUDE_DIR}" CACHE PATH "The path to libPNG's include directory.") # Include path + set(PNG_LPATH "${PNG_LIBRARY_DIR}" CACHE PATH "The path to libPNG's library directory.") # Library path + mark_as_advanced(PNG_IPATH) + mark_as_advanced(PNG_LPATH) + + 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) +endif() \ No newline at end of file diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 18734eb91d..9a7d231433 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -1,8 +1,18 @@ message(STATUS "") message("Configuring support for the following optional third-party packages:") + +# Check for and configure Eigen library +find_package(Eigen3 QUIET) if(HAVE_EIGEN) message(STATUS "+ Eigen linear algebra library") + if(WIN32) + set(EIGEN_CFLAGS "/arch:SSE2") + else() + set(EIGEN_CFLAGS "-msse2") + endif() + + set(LINMATH_ALIGN ON CACHE BOOL "If on, vectorization is enabled in build.") if(LINMATH_ALIGN) message(STATUS "+ (vectorization enabled in build)") else() @@ -12,25 +22,50 @@ else() message(STATUS "- Did not find Eigen linear algebra library") endif() -#find_package(OpenSSL ssl crypto) + +# Check for and configure OpenSSL library +# Mangle the builtin FindOpenSSL output to match Panda3D's config-style +find_package(OpenSSL QUIET COMPONENTS ssl crypto) +include(MangleOpenSSL) if(HAVE_OPENSSL) message(STATUS "+ OpenSSL") + + if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) + set(REPORT_OPENSSL_ERRORS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + else() + set(REPORT_OPENSSL_ERRORS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + endif() else() message(STATUS "- Did not find OpenSSL") endif() + +# Check for and configure JPEG library +# Mangle the builtin FindJPEG output to match Panda3D's config-style +find_package(JPEG QUIET COMPONENTS jpeg) +include(MangleJPEG) if(HAVE_JPEG) message(STATUS "+ libjpeg") + set(PHAVE_JPEGINT_H TRUE CACHE BOOL "Set to False if missing jpegint.h.") else() message(STATUS "- Did not find libjpeg") + unset(PHAVE_JPEGINT_H CACHE) endif() + +# Check for and configure PNG library +find_package(PNG QUIET COMPONENTS png) +# Mangle the builtin FindPNG output to match Panda3D's config-style +include(ManglePNG) if(HAVE_PNG) message(STATUS "+ libpng") else() message(STATUS "- Did not find libpng") endif() + + + if(HAVE_TIFF) message(STATUS "+ libtiff") else() From 1a75d28f9ae6326ff24d2ff511e0b8593817d9d0 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 00:36:18 -0700 Subject: [PATCH 013/744] temp --- dtool/Configure.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 9a7d231433..3a3af60b8e 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -54,8 +54,8 @@ endif() # Check for and configure PNG library -find_package(PNG QUIET COMPONENTS png) # Mangle the builtin FindPNG output to match Panda3D's config-style +find_package(PNG QUIET COMPONENTS png) include(ManglePNG) if(HAVE_PNG) message(STATUS "+ libpng") From b21b31dffd83be53911d630fdd9baef17d82f336 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 00:48:08 -0700 Subject: [PATCH 014/744] CMake: Libraries: Add TIFF. --- cmake/modules/MangleTIFF.cmake | 29 +++++++++++++++++++++++++++++ dtool/Configure.cmake | 6 ++++-- 2 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 cmake/modules/MangleTIFF.cmake diff --git a/cmake/modules/MangleTIFF.cmake b/cmake/modules/MangleTIFF.cmake new file mode 100644 index 0000000000..943f0beb80 --- /dev/null +++ b/cmake/modules/MangleTIFF.cmake @@ -0,0 +1,29 @@ +# Filename: MangleTIFF.cmake +# Author: kestred (29 Nov, 2013) +# +# MangleTIFF replaces the output variables of the builtin FindTIFF +# with vars matching Panda3D's existing config-var names. +# + +if(TIFF_FOUND) + set(HAVE_TIFF TRUE) + set(TIFF_LIBS tiff z) + + get_filename_component(TIFF_LIBRARY_DIR "${TIFF_LIBRARY}" PATH) + + set(TIFF_IPATH "${TIFF_INCLUDE_DIR}" CACHE PATH "The path to libTIFF's include directory.") # Include path + set(TIFF_LPATH "${TIFF_LIBRARY_DIR}" CACHE PATH "The path to libTIFF's library directory.") # Library path + mark_as_advanced(TIFF_IPATH) + mark_as_advanced(TIFF_LPATH) + + 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() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 3a3af60b8e..40f9adfa45 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -64,8 +64,10 @@ else() endif() - - +# Check for and configure TIFF library +# Mangle the builtin FindTIFF output to match Panda3D's config-style +find_package(TIFF QUIET COMPONENTS tiff z) +include(MangleTIFF) if(HAVE_TIFF) message(STATUS "+ libtiff") else() From df87842516dd9dc9bc9c60e184ad891d5c462b55 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 00:48:28 -0700 Subject: [PATCH 015/744] CMake: Libraries: Update other Manglers to cleanup properly. --- cmake/modules/MangleJPEG.cmake | 5 ++++- cmake/modules/MangleOpenSSL.cmake | 4 +++- cmake/modules/ManglePNG.cmake | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/cmake/modules/MangleJPEG.cmake b/cmake/modules/MangleJPEG.cmake index 9ef75a675d..78f5323e69 100644 --- a/cmake/modules/MangleJPEG.cmake +++ b/cmake/modules/MangleJPEG.cmake @@ -21,4 +21,7 @@ if(JPEG_FOUND) unset(JPEG_LIBRARIES) unset(JPEG_INCLUDE_DIR CACHE) unset(JPEG_LIBRARY_DIR) -endif() \ No newline at end of file +else() + unset(JPEG_LIBRARY CACHE) + unset(JPEG_INCLUDE_DIR CACHE) +endif() diff --git a/cmake/modules/MangleOpenSSL.cmake b/cmake/modules/MangleOpenSSL.cmake index 5a3bc3b1fb..b979bc46e6 100644 --- a/cmake/modules/MangleOpenSSL.cmake +++ b/cmake/modules/MangleOpenSSL.cmake @@ -23,4 +23,6 @@ if(OPENSSL_FOUND) unset(OPENSSL_LIBRARIES) unset(OPENSSL_INCLUDE_DIR CACHE) unset(OPENSSL_LIBRARY_DIR) -endif() \ No newline at end of file +else() + unset(OPENSSL_INCLUDE_DIR CACHE) +endif() diff --git a/cmake/modules/ManglePNG.cmake b/cmake/modules/ManglePNG.cmake index e1001fb200..60790779d9 100644 --- a/cmake/modules/ManglePNG.cmake +++ b/cmake/modules/ManglePNG.cmake @@ -26,4 +26,8 @@ if(PNG_FOUND) unset(PNG_PNG_INCLUDE_DIR CACHE) unset(PNG_LIBRARY_DIR) unset(PNG_VERSION_STRING) -endif() \ No newline at end of file +else() + unset(PNG_LIBRARY CACHE) + unset(PNG_INCLUDE_DIR CACHE) + unset(PNG_PNG_INCLUDE_DIR CACHE) +endif() From 67be41a6728f9abb8c060e0855d1dcc8b670214d Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 01:21:14 -0700 Subject: [PATCH 016/744] CMake: Configure: Add libtar support. First custom Find module. --- cmake/modules/FindTar.cmake | 49 ++++++++++++++++++++++++++++++++++ cmake/modules/MangleJPEG.cmake | 4 +-- dtool/Configure.cmake | 5 ++++ 3 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 cmake/modules/FindTar.cmake diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake new file mode 100644 index 0000000000..011ac40f12 --- /dev/null +++ b/cmake/modules/FindTar.cmake @@ -0,0 +1,49 @@ +# Filename: FindTar.cmake +# Author: kestred (29 Nov, 2013) +# +# Once done this will define +# +# HAVE_TAR - system has libtar +# TAR_IPATH - the tar include directory +# TAR_LPATH - the tar library directory +# TAR_LIBS - the tar components found +# + +if(TAR_IPATH AND TAR_LPATH) + set(HAVE_TAR TRUE) + set(TAR_LIBS tar) +else() + # Find the libtar include files + find_path(TAR_IPATH + NAMES "libtar.h" + PATHS "/usr/include" + "/usr/local/include" + PATH_SUFFIXES "" "tar" "libtar" + DOC "The path to libtar's include directory." + ) + + # Find the libtar library (.a, .so) + find_library(TAR_LIBRARY + NAMES "tar" + "libtar" + PATHS "/usr" + "/usr/local" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + 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 + + if(TAR_IPATH AND TAR_LPATH) + set(HAVE_TAR TRUE) + set(TAR_LIBS tar) + message("BAR") + endif() + + #include(FindPackageHandleStandardArgs) + #find_package_handle_standard_args(Tar DEFAULT_MSG TAR_IPATH) + + unset(TAR_LIBRARY_DIR) + unset(TAR_LIBRARY CACHE) + mark_as_advanced(TAR_IPATH) + mark_as_advanced(TAR_LPATH) +endif() diff --git a/cmake/modules/MangleJPEG.cmake b/cmake/modules/MangleJPEG.cmake index 78f5323e69..15ffb04724 100644 --- a/cmake/modules/MangleJPEG.cmake +++ b/cmake/modules/MangleJPEG.cmake @@ -11,8 +11,8 @@ if(JPEG_FOUND) get_filename_component(JPEG_LIBRARY_DIR "${JPEG_LIBRARY}" PATH) - set(JPEG_IPATH "${JPEG_INCLUDE_DIR}" CACHE PATH "The path to libJPEG's include directory.") # Include path - set(JPEG_LPATH "${JPEG_LIBRARY_DIR}" CACHE PATH "The path to libJPEG's library directory.") # Library path + set(JPEG_IPATH "${JPEG_INCLUDE_DIR}" CACHE PATH "The path to libjpeg's include directory.") # Include path + set(JPEG_LPATH "${JPEG_LIBRARY_DIR}" CACHE PATH "The path to libjpeg's library directory.") # Library path mark_as_advanced(JPEG_IPATH) mark_as_advanced(JPEG_LPATH) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 40f9adfa45..23f2e4566c 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -74,12 +74,17 @@ else() message(STATUS "- Did not find libtiff") endif() + +# Check for and configure TAR library +find_package(Tar QUIET COMPONENTS tar) if(HAVE_TAR) message(STATUS "+ libtar") else() message(STATUS "- Did not find libtar") endif() + + if(HAVE_FFTW) message(STATUS "+ fftw") else() From 57b2079a3f9839cbff7acb7fc2f6761634dc9598 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 01:38:01 -0700 Subject: [PATCH 017/744] CMake: Modules: Cleanup FindEigen2/3 and use a consistent format with that of FindTar.cmake. --- cmake/modules/FindEigen2.cmake | 95 ++++++++++++++++----------------- cmake/modules/FindEigen3.cmake | 97 ++++++++++++++++------------------ dtool/Configure.cmake | 4 +- 3 files changed, 95 insertions(+), 101 deletions(-) diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake index ae3fb60a26..d4940862ad 100644 --- a/cmake/modules/FindEigen2.cmake +++ b/cmake/modules/FindEigen2.cmake @@ -15,66 +15,63 @@ # EIGEN_VERSION - eigen version # -if(NOT Eigen2_FIND_VERSION) - if(NOT Eigen2_FIND_VERSION_MAJOR) - set(Eigen2_FIND_VERSION_MAJOR 2) - endif(NOT Eigen2_FIND_VERSION_MAJOR) - if(NOT Eigen2_FIND_VERSION_MINOR) - set(Eigen2_FIND_VERSION_MINOR 0) - endif(NOT Eigen2_FIND_VERSION_MINOR) - if(NOT Eigen2_FIND_VERSION_PATCH) - set(Eigen2_FIND_VERSION_PATCH 0) - endif(NOT Eigen2_FIND_VERSION_PATCH) +if(NOT EIGEN_FIND_VERSION) + if(NOT EIGEN_FIND_VERSION_MAJOR) + set(EIGEN_FIND_VERSION_MAJOR 2) + endif() + if(NOT EIGEN_FIND_VERSION_MINOR) + set(EIGEN_FIND_VERSION_MINOR 0) + endif() + if(NOT EIGEN_FIND_VERSION_PATCH) + set(EIGEN_FIND_VERSION_PATCH 0) + endif() - set(Eigen2_FIND_VERSION "${Eigen2_FIND_VERSION_MAJOR}.${Eigen2_FIND_VERSION_MINOR}.${Eigen2_FIND_VERSION_PATCH}") -endif(NOT Eigen2_FIND_VERSION) + set(EIGEN_FIND_VERSION "${EIGEN_FIND_VERSION_MAJOR}.${EIGEN_FIND_VERSION_MINOR}.${EIGEN_FIND_VERSION_PATCH}") +endif() -macro(_eigen2_check_version) - file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen2_version_header) - string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen2_world_version_match "${_eigen2_version_header}") - set(EIGEN2_WORLD_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen2_major_version_match "${_eigen2_version_header}") - set(EIGEN2_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen2_minor_version_match "${_eigen2_version_header}") - set(EIGEN2_MINOR_VERSION "${CMAKE_MATCH_1}") +macro(_eigen_check_version) + # Read version from Macros.h + file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen_version_header) - set(EIGEN_VERSION ${EIGEN2_WORLD_VERSION}.${EIGEN2_MAJOR_VERSION}.${EIGEN2_MINOR_VERSION}) - if((${EIGEN2_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN2_MAJOR_VERSION} GREATER 10) OR (${EIGEN_VERSION} VERSION_LESS ${Eigen2_FIND_VERSION})) + # Parse version from read data + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}") + set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}") + set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}") + set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}") + + # Set EIGEN_VERSION + set(EIGEN_VERSION ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}) + + # Make sure Eigen Version is at least the requested version + if((${EIGEN_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN_MAJOR_VERSION} GREATER 10) OR (${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION})) set(EIGEN_VERSION_OK FALSE) else() set(EIGEN_VERSION_OK TRUE) endif() +endmacro() - if(NOT EIGEN_VERSION_OK) - message(STATUS "Eigen2 version ${EIGEN_VERSION} found in ${EIGEN_IPATH}, " - "but at least version ${Eigen2_FIND_VERSION} is required") - endif(NOT EIGEN_VERSION_OK) -endmacro(_eigen2_check_version) - -if (EIGEN_IPATH) - - # in cache already - _eigen2_check_version() - set(EIGEN2_FOUND ${EIGEN_VERSION_OK}) - -else (EIGEN_IPATH) - - find_path(EIGEN_IPATH NAMES Eigen/Core - PATHS - ${INCLUDE_INSTALL_DIR} - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen2 - ) +if(EIGEN_IPATH) + # If already in cache, just check that the version is correct + _eigen_check_version() + set(HAVE_EIGEN ${EIGEN_VERSION_OK}) +else() + # Otherwise find it manually + find_path(EIGEN_IPATH + NAMES Eigen/Core + PATHS ${INCLUDE_INSTALL_DIR} + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen2 + ) + # Checking to make sure it has the write version if(EIGEN_IPATH) - _eigen2_check_version() - endif(EIGEN_IPATH) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN_IPATH EIGEN_VERSION_OK) + _eigen_check_version() + set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + endif() mark_as_advanced(EIGEN_IPATH) - -endif(EIGEN_IPATH) +endif() diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index 1992550555..b7d8401675 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -15,66 +15,63 @@ # EIGEN_VERSION - eigen version # -if(NOT Eigen3_FIND_VERSION) - if(NOT Eigen3_FIND_VERSION_MAJOR) - set(Eigen3_FIND_VERSION_MAJOR 2) - endif(NOT Eigen3_FIND_VERSION_MAJOR) - if(NOT Eigen3_FIND_VERSION_MINOR) - set(Eigen3_FIND_VERSION_MINOR 91) - endif(NOT Eigen3_FIND_VERSION_MINOR) - if(NOT Eigen3_FIND_VERSION_PATCH) - set(Eigen3_FIND_VERSION_PATCH 0) - endif(NOT Eigen3_FIND_VERSION_PATCH) +if(NOT EIGEN_FIND_VERSION) + if(NOT EIGEN_FIND_VERSION_MAJOR) + set(EIGEN_FIND_VERSION_MAJOR 2) + endif() + if(NOT EIGEN_FIND_VERSION_MINOR) + set(EIGEN_FIND_VERSION_MINOR 91) + endif() + if(NOT EIGEN_FIND_VERSION_PATCH) + set(EIGEN_FIND_VERSION_PATCH 0) + endif() - set(Eigen3_FIND_VERSION "${Eigen3_FIND_VERSION_MAJOR}.${Eigen3_FIND_VERSION_MINOR}.${Eigen3_FIND_VERSION_PATCH}") -endif(NOT Eigen3_FIND_VERSION) + set(EIGEN_FIND_VERSION "${EIGEN_FIND_VERSION_MAJOR}.${EIGEN_FIND_VERSION_MINOR}.${EIGEN_FIND_VERSION_PATCH}") +endif() -macro(_eigen3_check_version) - file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen3_version_header) - string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}") - set(EIGEN3_WORLD_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}") - set(EIGEN3_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}") - set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") +macro(_eigen_check_version) + # Read version from Macros.h + file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen_version_header) - set(EIGEN_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) - if(${EIGEN_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + # Parse version from read data + string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}") + set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}") + set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}") + string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}") + set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}") + + # Set EIGEN_VERSION + set(EIGEN_VERSION ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}) + + # Make sure Eigen Version is at least the requested version + if(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION}) set(EIGEN_VERSION_OK FALSE) - else(${EIGEN_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + else(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION}) set(EIGEN_VERSION_OK TRUE) - endif(${EIGEN_VERSION} VERSION_LESS ${Eigen3_FIND_VERSION}) + endif(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION}) +endmacro() - if(NOT EIGEN_VERSION_OK) - message(STATUS "Eigen3 version ${EIGEN_VERSION} found in ${EIGEN_IPATH}, " - "but at least version ${Eigen3_FIND_VERSION} is required") - endif(NOT EIGEN_VERSION_OK) -endmacro(_eigen3_check_version) - -if (EIGEN_IPATH) - - # in cache already - _eigen3_check_version() +if(EIGEN_IPATH) + # If already in cache, just check that the version is correct + _eigen_check_version() set(HAVE_EIGEN ${EIGEN_VERSION_OK}) +else() + # Otherwise find it manually + find_path(EIGEN_IPATH + NAMES signature_of_eigen3_matrix_library + PATHS ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) -else (EIGEN_IPATH) - - find_path(EIGEN_IPATH NAMES signature_of_eigen3_matrix_library - PATHS - ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen - ) - + # Checking to make sure it has the write version if(EIGEN_IPATH) - _eigen3_check_version() - endif(EIGEN_IPATH) - - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN_IPATH EIGEN_VERSION_OK) + _eigen_check_version() + set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + endif() mark_as_advanced(EIGEN_IPATH) - -endif(EIGEN_IPATH) +endif() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 23f2e4566c..74a1f98c71 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -3,7 +3,7 @@ message("Configuring support for the following optional third-party packages:") # Check for and configure Eigen library -find_package(Eigen3 QUIET) +find_package(Eigen3) if(HAVE_EIGEN) message(STATUS "+ Eigen linear algebra library") if(WIN32) @@ -76,7 +76,7 @@ endif() # Check for and configure TAR library -find_package(Tar QUIET COMPONENTS tar) +find_package(Tar) if(HAVE_TAR) message(STATUS "+ libtar") else() From 6f426a3e8249417af80e2306c4e1a5c0e697626f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 29 Nov 2013 01:54:33 -0700 Subject: [PATCH 018/744] Get dconfig building under CMake. --- dtool/CMakeLists.txt | 1 + dtool/src/dconfig/CMakeLists.txt | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 dtool/src/dconfig/CMakeLists.txt diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 9d34b790a1..5bf1cd61dc 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -41,6 +41,7 @@ include(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) add_subdirectory(src/dtoolbase) add_subdirectory(src/dtoolutil) add_subdirectory(src/prc) +add_subdirectory(src/dconfig) add_subdirectory(src/cppparser) ## Include dtool metalibs ## diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt new file mode 100644 index 0000000000..3e4b02f174 --- /dev/null +++ b/dtool/src/dconfig/CMakeLists.txt @@ -0,0 +1,20 @@ +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolutil) +include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) +include_directories(${CMAKE_CURRENT_LIST_DIR}/../prc) + +set(P3DCONFIG_HEADER_FILES + config_dconfig.h dconfig.I dconfig.h) + +set(P3DCONFIG_SOURCE_FILES + config_dconfig.cxx dconfig.cxx) + +foreach(FILENAME IN LISTS P3DCONFIG_HEADER_FILES) + set(P3DCONFIG_HEADERS ${P3DCONFIG_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() +foreach(FILENAME IN LISTS P3DCONFIG_SOURCE_FILES) + set(P3DCONFIG_SOURCES ${P3DCONFIG_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) +endforeach() + +add_library(p3dconfig STATIC + ${P3DCONFIG_HEADERS} + ${P3DCONFIG_SOURCES}) From 8abd7106169f94d4968cd833e54035747399dcf6 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 29 Nov 2013 02:13:19 -0700 Subject: [PATCH 019/744] CMake: Configure: Add fftw support. --- cmake/modules/FindFFTW.cmake | 129 +++++++++++++++++ cmake/modules/FindTar.cmake | 17 ++- dtool/Configure.cmake | 259 ++++++++++++++++++----------------- 3 files changed, 267 insertions(+), 138 deletions(-) create mode 100644 cmake/modules/FindFFTW.cmake diff --git a/cmake/modules/FindFFTW.cmake b/cmake/modules/FindFFTW.cmake new file mode 100644 index 0000000000..66db6d81d2 --- /dev/null +++ b/cmake/modules/FindFFTW.cmake @@ -0,0 +1,129 @@ +# Filename: FindFFTW.cmake +# Author: Unknown (???), kestred (29 Nov, 2013) +# +# Usage: +# find_package(FFTW [REQUIRED] [QUIET]) +# +# It sets the following variables: +# HAVE_FFTW - true if fftw is found on the system +# FFTW_IPATH - the fftw include directory +# FFTW_LPATH - the fftw library directory +# +# The following variables will be checked by the function +# FFTW_USE_STATIC_LIBS - if true, only static libraries are found +# FFTW_ROOT - if set, the libraries are exclusively searched under this path +# + +if(FFTW_IPATH AND FFTW_LPATH) + set(HAVE_FFTW TRUE) +else() + # Check if we can use PkgConfig + find_package(PkgConfig QUIET) + + #Determine from PKG + if(PKG_CONFIG_FOUND AND NOT FFTW_ROOT) + pkg_check_modules(PKG_FFTW QUIET "fftw3") + endif() + + #Check whether to search static or dynamic libs + set(CMAKE_FIND_LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) + + if(${FFTW_USE_STATIC_LIBS}) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) + endif() + + + if(FFTW_ROOT) + # Try to find headers under root + find_path(FFTW_IPATH + NAMES "fftw3.h" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "include" + NO_DEFAULT_PATH + ) + + # Try to find library under root + find_library(FFTW_LIBRARY + NAMES "fftw3" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + + find_library(FFTW_FFTWF_LIBRARY + NAMES "fftw3f" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + + find_library(FFTW_FFTWL_LIBRARY + NAMES "fftw3l" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + else() + # Find headers the normal way + find_path(FFTW_IPATH + NAMES "fftw3.h" + PATHS ${PKG_FFTW_INCLUDE_DIRS} + ${INCLUDE_INSTALL_DIR} + "/usr/include" + "/usr/local/include" + PATH_SUFFIXES "" "fftw" + ) + + # Find library the normal way + find_library(FFTW_LIBRARY + NAMES "fftw3" + PATHS ${PKG_FFTW_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + + find_library(FFTW_FFTWF_LIBRARY + NAMES "fftw3f" + PATHS ${PKG_FFTW_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + + + find_library(FFTW_FFTWL_LIBRARY + NAMES "fftw3l" + PATHS ${PKG_FFTW_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + endif() + + # Cleanup after the library suffixes + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAVED}) + unset(CMAKE_FIND_LIBRARY_SUFFIXES_SAVED) + + # Get the directory conaining FFTW_LIBRARY + get_filename_component(FFTW_LIBRARY_DIR "${FFTW_LIBRARY}" PATH) + set(FFTW_LPATH "${FFTW_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path + + + # Check if we have everything we need + if(FFTW_IPATH AND FFTW_LPATH) + set(HAVE_FFTW TRUE) + endif() + + unset(FFTW_LIBRARY_DIR) + unset(FFTW_LIBRARY CACHE) + mark_as_advanced(FFTW_IPATH) + mark_as_advanced(FFTW_LPATH) + mark_as_advanced(FFTW_FFTWF_LIBRARY) + mark_as_advanced(FFTW_FFTWL_LIBRARY) +endif() diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake index 011ac40f12..d0ab030b10 100644 --- a/cmake/modules/FindTar.cmake +++ b/cmake/modules/FindTar.cmake @@ -1,12 +1,14 @@ # Filename: FindTar.cmake # Author: kestred (29 Nov, 2013) # -# Once done this will define +# Usage: +# find_package(Tar [REQUIRED] [QUIET]) # -# HAVE_TAR - system has libtar -# TAR_IPATH - the tar include directory -# TAR_LPATH - the tar library directory -# TAR_LIBS - the tar components found +# It sets the following variables: +# HAVE_TAR - system has libtar +# TAR_IPATH - the tar include directory +# TAR_LPATH - the tar library directory +# TAR_LIBS - the tar components found # if(TAR_IPATH AND TAR_LPATH) @@ -33,15 +35,12 @@ else() 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 + # Check if we have everything we need if(TAR_IPATH AND TAR_LPATH) set(HAVE_TAR TRUE) set(TAR_LIBS tar) - message("BAR") endif() - #include(FindPackageHandleStandardArgs) - #find_package_handle_standard_args(Tar DEFAULT_MSG TAR_IPATH) - unset(TAR_LIBRARY_DIR) unset(TAR_LIBRARY CACHE) mark_as_advanced(TAR_IPATH) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 74a1f98c71..cf760ff8d0 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -5,21 +5,21 @@ message("Configuring support for the following optional third-party packages:") # Check for and configure Eigen library find_package(Eigen3) if(HAVE_EIGEN) - message(STATUS "+ Eigen linear algebra library") - if(WIN32) - set(EIGEN_CFLAGS "/arch:SSE2") - else() - set(EIGEN_CFLAGS "-msse2") - endif() + message(STATUS "+ Eigen linear algebra library") + if(WIN32) + set(EIGEN_CFLAGS "/arch:SSE2") + else() + set(EIGEN_CFLAGS "-msse2") + endif() - set(LINMATH_ALIGN ON CACHE BOOL "If on, vectorization is enabled in build.") - if(LINMATH_ALIGN) - message(STATUS "+ (vectorization enabled in build)") - else() - message(STATUS "- (vectorization NOT enabled in build)") - endif() + set(LINMATH_ALIGN ON CACHE BOOL "If on, vectorization is enabled in build.") + if(LINMATH_ALIGN) + message(STATUS "+ (vectorization enabled in build)") + else() + message(STATUS "- (vectorization NOT enabled in build)") + endif() else() - message(STATUS "- Did not find Eigen linear algebra library") + message(STATUS "- Did not find Eigen linear algebra library") endif() @@ -28,15 +28,15 @@ endif() find_package(OpenSSL QUIET COMPONENTS ssl crypto) include(MangleOpenSSL) if(HAVE_OPENSSL) - message(STATUS "+ OpenSSL") + message(STATUS "+ OpenSSL") - if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) - set(REPORT_OPENSSL_ERRORS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") - else() - set(REPORT_OPENSSL_ERRORS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") - endif() + if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) + set(REPORT_OPENSSL_ERRORS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + else() + set(REPORT_OPENSSL_ERRORS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + endif() else() - message(STATUS "- Did not find OpenSSL") + message(STATUS "- Did not find OpenSSL") endif() @@ -45,11 +45,11 @@ endif() find_package(JPEG QUIET COMPONENTS jpeg) include(MangleJPEG) if(HAVE_JPEG) - message(STATUS "+ libjpeg") - set(PHAVE_JPEGINT_H TRUE CACHE BOOL "Set to False if missing jpegint.h.") + message(STATUS "+ libjpeg") + set(PHAVE_JPEGINT_H TRUE CACHE BOOL "Set to False if missing jpegint.h.") else() - message(STATUS "- Did not find libjpeg") - unset(PHAVE_JPEGINT_H CACHE) + message(STATUS "- Did not find libjpeg") + unset(PHAVE_JPEGINT_H CACHE) endif() @@ -58,9 +58,9 @@ endif() find_package(PNG QUIET COMPONENTS png) include(ManglePNG) if(HAVE_PNG) - message(STATUS "+ libpng") + message(STATUS "+ libpng") else() - message(STATUS "- Did not find libpng") + message(STATUS "- Did not find libpng") endif() @@ -69,164 +69,165 @@ endif() find_package(TIFF QUIET COMPONENTS tiff z) include(MangleTIFF) if(HAVE_TIFF) - message(STATUS "+ libtiff") + message(STATUS "+ libtiff") else() - message(STATUS "- Did not find libtiff") + message(STATUS "- Did not find libtiff") endif() -# Check for and configure TAR library +# Check for and configure Tar library find_package(Tar) if(HAVE_TAR) - message(STATUS "+ libtar") + message(STATUS "+ libtar") else() - message(STATUS "- Did not find libtar") + message(STATUS "- Did not find libtar") endif() - +# Check for and configure FFTW library +find_package(FFTW) if(HAVE_FFTW) - message(STATUS "+ fftw") + message(STATUS "+ fftw") else() - message(STATUS "- Did not find fftw") + message(STATUS "- Did not find fftw") endif() if(HAVE_SQUISH) - message(STATUS "+ squish") + message(STATUS "+ squish") else() - message(STATUS "- Did not find squish") + message(STATUS "- Did not find squish") endif() if(HAVE_CG) - message(STATUS "+ Nvidia Cg High Level Shading Language") + message(STATUS "+ Nvidia Cg High Level Shading Language") else() - message(STATUS "- Did not find Nvidia Cg High Level Shading Language") + message(STATUS "- Did not find Nvidia Cg High Level Shading Language") endif() if(HAVE_CGGL) - message(STATUS "+ Cg OpenGL API") + message(STATUS "+ Cg OpenGL API") else() - message(STATUS "- Did not find Cg OpenGL API") + message(STATUS "- Did not find Cg OpenGL API") endif() if(HAVE_CGDX8) - message(STATUS "+ Cg DX8 API") + message(STATUS "+ Cg DX8 API") else() - message(STATUS "- Did not find Cg DX8 API") + message(STATUS "- Did not find Cg DX8 API") endif() if(HAVE_CGDX9) - message(STATUS "+ Cg DX9 API") + message(STATUS "+ Cg DX9 API") else() - message(STATUS "- Did not find Cg DX9 API") + message(STATUS "- Did not find Cg DX9 API") endif() if(HAVE_CGDX10) - message(STATUS "+ Cg DX10 API") + message(STATUS "+ Cg DX10 API") else() - message(STATUS "- Did not find Cg DX10 API") + message(STATUS "- Did not find Cg DX10 API") endif() if(HAVE_VRPN) - message(STATUS "+ VRPN") + message(STATUS "+ VRPN") else() - message(STATUS "- Did not find VRPN") + message(STATUS "- Did not find VRPN") endif() if(HAVE_ZLIB) - message(STATUS "+ zlib") + message(STATUS "+ zlib") else() - message(STATUS "- Did not find zlib") + message(STATUS "- Did not find zlib") endif() if(HAVE_RAD_MSS) - message(STATUS "+ Miles Sound System") + message(STATUS "+ Miles Sound System") else() - message(STATUS "- Did not find Miles Sound System") + message(STATUS "- Did not find Miles Sound System") endif() if(HAVE_FMODEX) - message(STATUS "+ FMOD Ex sound library") + message(STATUS "+ FMOD Ex sound library") else() - message(STATUS "- Did not find FMOD Ex sound library") + message(STATUS "- Did not find FMOD Ex sound library") endif() if(HAVE_OPENAL) - message(STATUS "+ OpenAL sound library") + message(STATUS "+ OpenAL sound library") else() - message(STATUS "- Did not find OpenAL sound library") + message(STATUS "- Did not find OpenAL sound library") endif() if(HAVE_PHYSX) - message(STATUS "+ Ageia PhysX") + message(STATUS "+ Ageia PhysX") else() - message(STATUS "- Did not find Ageia PhysX") + message(STATUS "- Did not find Ageia PhysX") endif() if(HAVE_SPEEDTREE) - message(STATUS "+ SpeedTree") + message(STATUS "+ SpeedTree") else() - message(STATUS "- Did not find SpeedTree") + message(STATUS "- Did not find SpeedTree") endif() if(HAVE_GTK) - message(STATUS "+ gtk+-2") + message(STATUS "+ gtk+-2") else() - message(STATUS "- Did not find gtk+-2") + message(STATUS "- Did not find gtk+-2") endif() if(HAVE_FREETYPE) - message(STATUS "+ Freetype") + message(STATUS "+ Freetype") else() - message(STATUS "- Did not find Freetype") + message(STATUS "- Did not find Freetype") endif() if(HAVE_WX) - message(STATUS "+ WxWidgets") + message(STATUS "+ WxWidgets") else() - message(STATUS "- Did not find WxWidgets") + message(STATUS "- Did not find WxWidgets") endif() if(HAVE_FLTK) - message(STATUS "+ FLTK") + message(STATUS "+ FLTK") else() - message(STATUS "- Did not find FLTK") + message(STATUS "- Did not find FLTK") endif() if(HAVE_GL) - message(STATUS "+ OpenGL") + message(STATUS "+ OpenGL") else() - message(STATUS "- Did not find OpenGL") + message(STATUS "- Did not find OpenGL") endif() if(HAVE_GLES) - message(STATUS "+ OpenGL ES 1") + message(STATUS "+ OpenGL ES 1") else() - message(STATUS "- Did not find OpenGL ES 1") + message(STATUS "- Did not find OpenGL ES 1") endif() if(HAVE_GLES2) - message(STATUS "+ OpenGL ES 2") + message(STATUS "+ OpenGL ES 2") else() - message(STATUS "- Did not find OpenGL ES 2") + message(STATUS "- Did not find OpenGL ES 2") endif() if(HAVE_DX8) - message(STATUS "+ DirectX8") + message(STATUS "+ DirectX8") else() - message(STATUS "- Did not find DirectX8") + message(STATUS "- Did not find DirectX8") endif() if(HAVE_DX9) - message(STATUS "+ DirectX9") + message(STATUS "+ DirectX9") else() - message(STATUS "- Did not find DirectX9") + message(STATUS "- Did not find DirectX9") endif() if(HAVE_TINYDISPLAY) - message(STATUS "+ Tinydisplay") + message(STATUS "+ Tinydisplay") else() - message(STATUS "- Not building Tinydisplay") + message(STATUS "- Not building Tinydisplay") endif() # if(HAVE_SDL) @@ -236,120 +237,120 @@ endif() # endif() if(HAVE_X11) - message(STATUS "+ X11") + message(STATUS "+ X11") else() - message(STATUS "- Did not find X11") + message(STATUS "- Did not find X11") endif() if(HAVE_MESA) - message(STATUS "+ Mesa") + message(STATUS "+ Mesa") else() - message(STATUS "- Did not find Mesa") + message(STATUS "- Did not find Mesa") endif() if(HAVE_OPENCV) - message(STATUS "+ OpenCV") + message(STATUS "+ OpenCV") else() - message(STATUS "- Did not find OpenCV") + message(STATUS "- Did not find OpenCV") endif() if(HAVE_FFMPEG) - message(STATUS "+ FFMPEG") + message(STATUS "+ FFMPEG") else() - message(STATUS "- Did not find FFMPEG") + message(STATUS "- Did not find FFMPEG") endif() if(HAVE_ODE) - message(STATUS "+ ODE") + message(STATUS "+ ODE") else() - message(STATUS "- Did not find ODE") + message(STATUS "- Did not find ODE") endif() if(HAVE_AWESOMIUM) - message(STATUS "+ AWESOMIUM") + message(STATUS "+ AWESOMIUM") else() - message(STATUS "- Did not find AWESOMIUM") + message(STATUS "- Did not find AWESOMIUM") endif() if(HAVE_MAYA) - message(STATUS "+ OpenMaya") + message(STATUS "+ OpenMaya") else() - message(STATUS "- Did not find OpenMaya") + message(STATUS "- Did not find OpenMaya") endif() if(HAVE_FCOLLADA) - message(STATUS "+ FCollada") + message(STATUS "+ FCollada") else() - message(STATUS "- Did not find FCollada") + message(STATUS "- Did not find FCollada") endif() if(HAVE_COLLADA14DOM OR HAVE_COLLADA15DOM) - message(STATUS "+ COLLADA DOM") + message(STATUS "+ COLLADA DOM") else() - message(STATUS "- Did not find COLLADA DOM") + message(STATUS "- Did not find COLLADA DOM") endif() if(HAVE_ASSIMP) - message(STATUS "+ Assimp") + message(STATUS "+ Assimp") else() - message(STATUS "- Did not find Assimp") + message(STATUS "- Did not find Assimp") endif() if(HAVE_ARTOOLKIT) - message(STATUS "+ ARToolKit") + message(STATUS "+ ARToolKit") else() - message(STATUS "- Did not find ARToolKit") + message(STATUS "- Did not find ARToolKit") endif() if(HAVE_ROCKET) - if(HAVE_ROCKET_PYTHON) - message(STATUS "+ libRocket with Python bindings") - else() - message(STATUS "+ libRocket without Python bindings") - endif() + if(HAVE_ROCKET_PYTHON) + message(STATUS "+ libRocket with Python bindings") + else() + message(STATUS "+ libRocket without Python bindings") + endif() else() - message(STATUS "- Did not find libRocket") + message(STATUS "- Did not find libRocket") endif() if(HAVE_BULLET) - message(STATUS "+ Bullet Physics") + message(STATUS "+ Bullet Physics") else() - message(STATUS "- Did not find Bullet Physics") + message(STATUS "- Did not find Bullet Physics") endif() if(HAVE_VORBIS) - message(STATUS "+ libvorbis (Ogg Vorbis Decoder)") + message(STATUS "+ libvorbis (Ogg Vorbis Decoder)") else() - message(STATUS "- Did not find libvorbis (Ogg Vorbis Decoder)") + message(STATUS "- Did not find libvorbis (Ogg Vorbis Decoder)") endif() message(STATUS "") if(HAVE_INTERROGATE AND HAVE_PYTHON) - message(STATUS "Compilation will generate Python interfaces.") + message(STATUS "Compilation will generate Python interfaces.") else() - message(STATUS "Configuring Panda without Python interfaces.") + message(STATUS "Configuring Panda without Python interfaces.") endif() if(HAVE_THREADS) - if(SIMPLE_THREADS) - message(STATUS "Compilation will include simulated threading support.") - else() - if(DO_PIPELINING) - message(STATUS "Compilation will include full, pipelined threading support.") - else() - message(STATUS "Compilation will include nonpipelined threading support.") - endif() - endif() + if(SIMPLE_THREADS) + message(STATUS "Compilation will include simulated threading support.") + else() + if(DO_PIPELINING) + message(STATUS "Compilation will include full, pipelined threading support.") + else() + message(STATUS "Compilation will include nonpipelined threading support.") + endif() + endif() else() - message(STATUS "Configuring Panda without threading support.") + message(STATUS "Configuring Panda without threading support.") endif() if(OSX_PLATFORM) - if(UNIVERSAL_BINARIES) - message(STATUS "Compilation will create universal binaries.") - else() - message(STATUS "Compilation will not create universal binaries.") - endif() + if(UNIVERSAL_BINARIES) + message(STATUS "Compilation will create universal binaries.") + else() + message(STATUS "Compilation will not create universal binaries.") + endif() endif() message(STATUS "") From 163cbe4ea2d58d1bd6bd312071f31fa02b275785 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 29 Nov 2013 02:19:41 -0700 Subject: [PATCH 020/744] Massively clean up CMakeLists files by removing use of ${CMAKE_CURRENT_LIST_DIR}; this is handled by add_subdirectory instead. --- dtool/CMakeLists.txt | 2 +- dtool/Configure.cmake | 2 +- dtool/metalibs/dtool/CMakeLists.txt | 2 +- dtool/src/cppparser/CMakeLists.txt | 21 ++++++----------- dtool/src/dconfig/CMakeLists.txt | 17 +++++--------- dtool/src/dtoolbase/CMakeLists.txt | 13 +++-------- dtool/src/dtoolutil/CMakeLists.txt | 35 +++++++++++++---------------- dtool/src/prc/CMakeLists.txt | 22 +++++++----------- 8 files changed, 41 insertions(+), 73 deletions(-) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 5bf1cd61dc..5e18bea829 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -35,7 +35,7 @@ set(DTOOL_INSTALL "${INSTALL_DIR}" CACHE STRING "The directory in which to insta 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(${CMAKE_CURRENT_LIST_DIR}/Configure.cmake) +include(Configure.cmake) ## Include dtool subpackages ## add_subdirectory(src/dtoolbase) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index cf760ff8d0..a007e18bc6 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -396,5 +396,5 @@ else() set(DEFAULT_PATHSEP ":") endif() -configure_file(${CMAKE_CURRENT_LIST_DIR}/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) +configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) include_directories("${CMAKE_BINARY_DIR}/include") diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 3707475cd3..54f02f0045 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,2 +1,2 @@ -add_library(p3dtool ${CMAKE_CURRENT_LIST_DIR}/dtool.cxx) +add_library(p3dtool dtool.cxx) target_link_libraries(p3dtool p3dtoolutil p3dtoolbase) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index a9e8f1db85..d879f107c4 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -1,7 +1,7 @@ -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolutil) -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) +include_directories(../dtoolutil) +include_directories(../dtoolbase) -set(P3CPPPARSER_HEADER_FILES +set(P3CPPPARSER_HEADERS cppArrayType.h cppBison.yxx cppBisonDefs.h cppClassTemplateParameter.h cppCommentBlock.h cppConstType.h cppDeclaration.h cppEnumType.h cppExpression.h @@ -17,7 +17,7 @@ set(P3CPPPARSER_HEADER_FILES cppType.h cppTypeDeclaration.h cppTypeParser.h cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h) -set(P3CPPPARSER_SOURCE_FILES +set(P3CPPPARSER_SOURCES cppArrayType.cxx cppBison.cxx cppClassTemplateParameter.cxx cppCommentBlock.cxx cppConstType.cxx cppDeclaration.cxx cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx @@ -34,19 +34,12 @@ set(P3CPPPARSER_SOURCE_FILES cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx cppUsing.cxx cppVisibility.cxx) -foreach(FILENAME IN LISTS P3CPPPARSER_HEADER_FILES) - set(P3CPPPARSER_HEADERS ${P3CPPPARSER_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() -foreach(FILENAME IN LISTS P3CPPPARSER_SOURCE_FILES) - set(P3CPPPARSER_SOURCES ${P3CPPPARSER_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() - if(HAVE_INTERROGATE) find_package(BISON) bison_target(cppParser - ${CMAKE_CURRENT_LIST_DIR}/cppBison.yxx - ${CMAKE_CURRENT_LIST_DIR}/cppBison.cxx - COMPILE_FLAGS --defines=${CMAKE_CURRENT_LIST_DIR}/cppBison.h) + cppBison.yxx + cppBison.cxx + COMPILE_FLAGS --defines=cppBison.h) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 3e4b02f174..40870d5f92 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -1,20 +1,13 @@ -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolutil) -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) -include_directories(${CMAKE_CURRENT_LIST_DIR}/../prc) +include_directories(../dtoolutil) +include_directories(../dtoolbase) +include_directories(../prc) -set(P3DCONFIG_HEADER_FILES +set(P3DCONFIG_HEADERS config_dconfig.h dconfig.I dconfig.h) -set(P3DCONFIG_SOURCE_FILES +set(P3DCONFIG_SOURCES config_dconfig.cxx dconfig.cxx) -foreach(FILENAME IN LISTS P3DCONFIG_HEADER_FILES) - set(P3DCONFIG_HEADERS ${P3DCONFIG_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() -foreach(FILENAME IN LISTS P3DCONFIG_SOURCE_FILES) - set(P3DCONFIG_SOURCES ${P3DCONFIG_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() - add_library(p3dconfig STATIC ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 87e6f0e0c7..151f6e013a 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -1,4 +1,4 @@ -set(P3DTOOLBASE_HEADER_FILES +set(P3DTOOLBASE_HEADERS addHash.I addHash.h atomicAdjust.h atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I @@ -35,7 +35,7 @@ set(P3DTOOLBASE_HEADER_FILES lookup3.h ) -set(P3DTOOLBASE_SOURCE_FILES +set(P3DTOOLBASE_SOURCES addHash.cxx atomicAdjustDummyImpl.cxx atomicAdjustI386Impl.cxx @@ -59,14 +59,7 @@ set(P3DTOOLBASE_SOURCE_FILES typedObject.cxx ) -foreach(FILENAME IN LISTS P3DTOOLBASE_HEADER_FILES) - set(P3DTOOLBASE_INSTALL_HEADERS ${P3DTOOLBASE_INSTALL_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() -foreach(FILENAME IN LISTS P3DTOOLBASE_SOURCE_FILES) - set(P3DTOOLBASE_SOURCES ${P3DTOOLBASE_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() - add_library(p3dtoolbase STATIC - ${P3DTOOLBASE_INSTALL_HEADERS} + ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES} ) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index b350b4f2c1..e26ded3312 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -1,16 +1,18 @@ -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) +include_directories(../dtoolbase) -configure_file(${CMAKE_CURRENT_LIST_DIR}/pandaVersion.h.cmake - ${CMAKE_CURRENT_LIST_DIR}/pandaVersion.h) +configure_file(pandaVersion.h.cmake + pandaVersion.h) -configure_file(${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.h.cmake - ${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.h) +configure_file(checkPandaVersion.h.cmake + checkPandaVersion.h) -configure_file(${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.cxx.cmake - ${CMAKE_CURRENT_LIST_DIR}/checkPandaVersion.cxx) +configure_file(checkPandaVersion.cxx.cmake + checkPandaVersion.cxx) -set(P3DTOOLUTIL_HEADER_FILES - checkPandaVersion.h +include_directories(${CMAKE_CURRENT_BINARY_DIR}) + +set(P3DTOOLUTIL_HEADERS + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h config_dtoolutil.h dSearchPath.I dSearchPath.h executionEnvironment.I executionEnvironment.h filename.I @@ -32,12 +34,12 @@ set(P3DTOOLUTIL_HEADER_FILES ) if(APPLE) - set(P3DTOOL_HEADER_FILES ${P3DTOOL_HEADER_FILES} + set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} filename_assist.mm filename_assist.h) endif() -set(P3DTOOLUTIL_SOURCE_FILES - checkPandaVersion.cxx +set(P3DTOOLUTIL_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx config_dtoolutil.cxx dSearchPath.cxx executionEnvironment.cxx filename.cxx @@ -55,14 +57,7 @@ set(P3DTOOLUTIL_SOURCE_FILES win32ArgParser.cxx ) -foreach(FILENAME IN LISTS P3DTOOLUTIL_HEADER_FILES) - set(P3DTOOLUTIL_INSTALL_HEADERS ${P3DTOOLUTIL_INSTALL_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() -foreach(FILENAME IN LISTS P3DTOOLUTIL_SOURCE_FILES) - set(P3DTOOLUTIL_SOURCES ${P3DTOOLUTIL_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() - add_library(p3dtoolutil STATIC - ${P3DTOOLUTIL_INSTALL_HEADERS} + ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES} ) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 0e05e21333..457fe08b2c 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -1,13 +1,14 @@ -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolutil) -include_directories(${CMAKE_CURRENT_LIST_DIR}/../dtoolbase) +include_directories(../dtoolutil) +include_directories(../dtoolbase) 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.") -configure_file(${CMAKE_CURRENT_LIST_DIR}/prc_parameters.h.cmake - ${CMAKE_CURRENT_LIST_DIR}/prc_parameters.h) +configure_file(prc_parameters.h.cmake + prc_parameters.h) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) -set(P3PRC_HEADER_FILES +set(P3PRC_HEADERS bigEndian.h config_prc.h configDeclaration.I configDeclaration.h @@ -39,9 +40,9 @@ set(P3PRC_HEADER_FILES streamReader.I streamReader.h streamWrapper.I streamWrapper.h streamWriter.I streamWriter.h - prc_parameters.h) + ${CMAKE_CURRENT_BINARY_DIR}/prc_parameters.h) -set(P3PRC_SOURCE_FILES +set(P3PRC_SOURCES config_prc.cxx configDeclaration.cxx configFlags.cxx @@ -69,13 +70,6 @@ set(P3PRC_SOURCE_FILES reversedNumericData.cxx streamReader.cxx streamWrapper.cxx streamWriter.cxx) -foreach(FILENAME IN LISTS P3PRC_HEADER_FILES) - set(P3PRC_HEADERS ${P3PRC_HEADERS} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() -foreach(FILENAME IN LISTS P3PRC_SOURCE_FILES) - set(P3PRC_SOURCES ${P3PRC_SOURCES} ${CMAKE_CURRENT_LIST_DIR}/${FILENAME}) -endforeach() - add_library(p3prc STATIC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) From eb1ac82a2ec1388c218695b489132a3351823e88 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 29 Nov 2013 02:24:45 -0700 Subject: [PATCH 021/744] Build dtool/pystub under CMake. --- dtool/CMakeLists.txt | 1 + dtool/src/pystub/CMakeLists.txt | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 dtool/src/pystub/CMakeLists.txt diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 5e18bea829..9c2aa941f3 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -42,6 +42,7 @@ add_subdirectory(src/dtoolbase) add_subdirectory(src/dtoolutil) add_subdirectory(src/prc) add_subdirectory(src/dconfig) +add_subdirectory(src/pystub) add_subdirectory(src/cppparser) ## Include dtool metalibs ## diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt new file mode 100644 index 0000000000..53efd1d6ff --- /dev/null +++ b/dtool/src/pystub/CMakeLists.txt @@ -0,0 +1,11 @@ +include_directories(../dtoolbase) + +set(P3PYSTUB_HEADERS + pystub.h) + +set(P3PYSTUB_SOURCES + pystub.cxx) + +add_library(p3pystub STATIC + ${P3PYSTUB_HEADERS} + ${P3PYSTUB_SOURCES}) From 03e79fce99f71c3fc90a2c2bab178b37148c8ac4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 29 Nov 2013 02:34:18 -0700 Subject: [PATCH 022/744] Build dtool/interrogatedb under CMake. --- dtool/CMakeLists.txt | 1 + dtool/src/interrogatedb/CMakeLists.txt | 37 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 dtool/src/interrogatedb/CMakeLists.txt diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 9c2aa941f3..97a54a8d89 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -44,6 +44,7 @@ add_subdirectory(src/prc) add_subdirectory(src/dconfig) add_subdirectory(src/pystub) add_subdirectory(src/cppparser) +add_subdirectory(src/interrogatedb) ## Include dtool metalibs ## add_subdirectory(metalibs/dtool) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt new file mode 100644 index 0000000000..180bf0c03e --- /dev/null +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -0,0 +1,37 @@ +include_directories(../dconfig) +include_directories(../dtoolutil) +include_directories(../dtoolbase) +include_directories(../prc) + +set(P3INTERROGATEDB_HEADERS + config_interrogatedb.h indexRemapper.h interrogateComponent.I + interrogateComponent.h interrogateDatabase.I + interrogateDatabase.h interrogateElement.I + interrogateElement.h interrogateFunction.I + interrogateFunction.h interrogateFunctionWrapper.I + interrogateFunctionWrapper.h + interrogateMakeSeq.I interrogateMakeSeq.h + interrogateManifest.I interrogateManifest.h + interrogateType.I interrogateType.h + interrogate_datafile.I interrogate_datafile.h + interrogate_interface.h interrogate_request.h + extension.h py_panda.h + vector_int.h ) + +set(P3INTERROGATEDB_SOURCES + config_interrogatedb.cxx + dtool_super_base.cxx + indexRemapper.cxx + interrogateComponent.cxx interrogateDatabase.cxx + interrogateElement.cxx interrogateFunction.cxx + interrogateFunctionWrapper.cxx + interrogateMakeSeq.cxx + interrogateManifest.cxx + interrogateType.cxx interrogate_datafile.cxx + interrogate_interface.cxx interrogate_request.cxx + py_panda.cxx + vector_int.cxx) + +add_library(p3interrogatedb STATIC + ${P3INTERROGATEDB_HEADERS} + ${P3INTERROGATEDB_SOURCES}) From e9518eab5c156feaf284472a87a04111f23374e5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 29 Nov 2013 02:59:46 -0700 Subject: [PATCH 023/744] CMake: Build dtool/cppparser without requiring HAVE_INTERROGATE; fix its use of paths. --- dtool/src/cppparser/CMakeLists.txt | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index d879f107c4..6a879739ba 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -18,7 +18,8 @@ set(P3CPPPARSER_HEADERS cppTypeProxy.h cppTypedef.h cppUsing.h cppVisibility.h) set(P3CPPPARSER_SOURCES - cppArrayType.cxx cppBison.cxx cppClassTemplateParameter.cxx + cppArrayType.cxx ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx + cppClassTemplateParameter.cxx cppCommentBlock.cxx cppConstType.cxx cppDeclaration.cxx cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx @@ -34,15 +35,15 @@ set(P3CPPPARSER_SOURCES cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx cppUsing.cxx cppVisibility.cxx) -if(HAVE_INTERROGATE) - find_package(BISON) - bison_target(cppParser - cppBison.yxx - cppBison.cxx - COMPILE_FLAGS --defines=cppBison.h) +find_package(BISON) +bison_target(cppParser + cppBison.yxx + ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx + 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}) - add_dependencies(p3cppParser cppParser) -endif() +add_library(p3cppParser STATIC + ${P3CPPPARSER_HEADERS} + ${P3CPPPARSER_SOURCES}) +add_dependencies(p3cppParser cppParser) From a71c7e6ad15e8ca50b90bca813d69c13c7ac3ce7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 29 Nov 2013 03:13:50 -0700 Subject: [PATCH 024/744] Get interrogate to (almost) build under CMake. --- dtool/CMakeLists.txt | 1 + dtool/src/interrogate/CMakeLists.txt | 61 +++++++++++++++++++ dtool/src/interrogate/interfaceMaker.h | 2 + .../interfaceMakerPythonNative.cxx | 1 + .../interrogate/parameterRemapToString.cxx | 1 + 5 files changed, 66 insertions(+) create mode 100644 dtool/src/interrogate/CMakeLists.txt diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 97a54a8d89..55577b6b11 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -45,6 +45,7 @@ add_subdirectory(src/dconfig) add_subdirectory(src/pystub) add_subdirectory(src/cppparser) add_subdirectory(src/interrogatedb) +add_subdirectory(src/interrogate) ## Include dtool metalibs ## add_subdirectory(metalibs/dtool) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt new file mode 100644 index 0000000000..d5bf4d82a7 --- /dev/null +++ b/dtool/src/interrogate/CMakeLists.txt @@ -0,0 +1,61 @@ +include_directories(../cppparser) +include_directories(../interrogatedb) +include_directories(../dconfig) +include_directories(../dtoolutil) +include_directories(../dtoolbase) +include_directories(../pystub) +include_directories(../prc) + +set(INTERROGATE_HEADERS + functionRemap.h + functionWriter.h + functionWriterPtrFromPython.h functionWriterPtrToPython.h + functionWriters.h + interfaceMaker.h + interfaceMakerC.h + interfaceMakerPython.h interfaceMakerPythonObj.h + interfaceMakerPythonSimple.h + interfaceMakerPythonNative.h + interrogate.h interrogateBuilder.h parameterRemap.I + parameterRemap.h + parameterRemapBasicStringPtrToString.h + parameterRemapBasicStringRefToString.h + parameterRemapBasicStringToString.h + parameterRemapCharStarToString.h + parameterRemapConcreteToPointer.h + parameterRemapConstToNonConst.h parameterRemapEnumToInt.h + parameterRemapPTToPointer.h + parameterRemapReferenceToConcrete.h + parameterRemapReferenceToPointer.h parameterRemapThis.h + parameterRemapToString.h parameterRemapUnchanged.h + typeManager.h) + +set(INTERROGATE_SOURCES + functionRemap.cxx + functionWriter.cxx + functionWriterPtrFromPython.cxx functionWriterPtrToPython.cxx + functionWriters.cxx + interfaceMaker.cxx + interfaceMakerC.cxx + interfaceMakerPython.cxx interfaceMakerPythonObj.cxx + interfaceMakerPythonSimple.cxx + interfaceMakerPythonNative.cxx + interrogate.cxx interrogateBuilder.cxx parameterRemap.cxx + parameterRemapBasicStringPtrToString.cxx + parameterRemapBasicStringRefToString.cxx + parameterRemapBasicStringToString.cxx + parameterRemapCharStarToString.cxx + parameterRemapConcreteToPointer.cxx + parameterRemapConstToNonConst.cxx + parameterRemapEnumToInt.cxx parameterRemapPTToPointer.cxx + parameterRemapReferenceToConcrete.cxx + parameterRemapReferenceToPointer.cxx parameterRemapThis.cxx + parameterRemapToString.cxx parameterRemapUnchanged.cxx + typeManager.cxx) + +add_executable(interrogate + ${INTERROGATE_HEADERS} + ${INTERROGATE_SOURCES}) +target_link_libraries(interrogate + p3cppParser p3interrogatedb p3dconfig p3dtoolutil p3dtoolbase p3pystub + p3prc) diff --git a/dtool/src/interrogate/interfaceMaker.h b/dtool/src/interrogate/interfaceMaker.h index 57e73ae008..8928afe556 100644 --- a/dtool/src/interrogate/interfaceMaker.h +++ b/dtool/src/interrogate/interfaceMaker.h @@ -17,6 +17,8 @@ #include "dtoolbase.h" +#include "cppMakeSeq.h" + #include "interrogate_interface.h" #include "interrogate_request.h" #include "functionWriters.h" diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 0a457f4058..a6461578c7 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -17,6 +17,7 @@ #include "parameterRemapUnchanged.h" #include "typeManager.h" +#include "pnotify.h" // For nout #include "interrogateDatabase.h" #include "interrogateType.h" #include "interrogateFunction.h" diff --git a/dtool/src/interrogate/parameterRemapToString.cxx b/dtool/src/interrogate/parameterRemapToString.cxx index 432b02d69f..362cd89691 100644 --- a/dtool/src/interrogate/parameterRemapToString.cxx +++ b/dtool/src/interrogate/parameterRemapToString.cxx @@ -14,6 +14,7 @@ #include "parameterRemapToString.h" #include "interrogate.h" +#include "typeManager.h" //////////////////////////////////////////////////////////////////// // Function: ParameterRemapToString::Constructor From b44101819c9ee556d406ecdd3aaf40ec236c10dc Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 30 Nov 2013 01:03:08 -0700 Subject: [PATCH 025/744] CMake: Configure: Update config vars with USE_ variables for each package that allow toggling of individual packages. --- cmake/modules/FindEigen2.cmake | 6 +- cmake/modules/FindEigen3.cmake | 6 +- cmake/modules/FindFFTW.cmake | 6 +- cmake/modules/FindTar.cmake | 6 +- cmake/modules/MangleJPEG.cmake | 2 +- cmake/modules/MangleOpenSSL.cmake | 2 +- cmake/modules/ManglePNG.cmake | 2 +- cmake/modules/MangleTIFF.cmake | 2 +- dtool/Configure.cmake | 300 +++++++++++++++++++++++++++++- 9 files changed, 313 insertions(+), 19 deletions(-) diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake index d4940862ad..703c28aa46 100644 --- a/cmake/modules/FindEigen2.cmake +++ b/cmake/modules/FindEigen2.cmake @@ -10,7 +10,7 @@ # # Once done this will define # -# HAVE_EIGEN - system has eigen lib with correct version +# FOUND_EIGEN - system has eigen lib with correct version # EIGEN_IPATH - the eigen include directory # EIGEN_VERSION - eigen version # @@ -57,7 +57,7 @@ endmacro() if(EIGEN_IPATH) # If already in cache, just check that the version is correct _eigen_check_version() - set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + set(FOUND_EIGEN ${EIGEN_VERSION_OK}) else() # Otherwise find it manually find_path(EIGEN_IPATH @@ -70,7 +70,7 @@ else() # Checking to make sure it has the write version if(EIGEN_IPATH) _eigen_check_version() - set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + set(FOUND_EIGEN ${EIGEN_VERSION_OK}) endif() mark_as_advanced(EIGEN_IPATH) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index b7d8401675..a965b01288 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -10,7 +10,7 @@ # # Once done this will define # -# HAVE_EIGEN - system has eigen lib with correct version +# FOUND_EIGEN - system has eigen lib with correct version # EIGEN_IPATH - the eigen include directory # EIGEN_VERSION - eigen version # @@ -57,7 +57,7 @@ endmacro() if(EIGEN_IPATH) # If already in cache, just check that the version is correct _eigen_check_version() - set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + set(FOUND_EIGEN ${EIGEN_VERSION_OK}) else() # Otherwise find it manually find_path(EIGEN_IPATH @@ -70,7 +70,7 @@ else() # Checking to make sure it has the write version if(EIGEN_IPATH) _eigen_check_version() - set(HAVE_EIGEN ${EIGEN_VERSION_OK}) + set(FOUND_EIGEN ${EIGEN_VERSION_OK}) endif() mark_as_advanced(EIGEN_IPATH) diff --git a/cmake/modules/FindFFTW.cmake b/cmake/modules/FindFFTW.cmake index 66db6d81d2..ce61c17f25 100644 --- a/cmake/modules/FindFFTW.cmake +++ b/cmake/modules/FindFFTW.cmake @@ -5,7 +5,7 @@ # find_package(FFTW [REQUIRED] [QUIET]) # # It sets the following variables: -# HAVE_FFTW - true if fftw is found on the system +# FOUND_FFTW - true if fftw is found on the system # FFTW_IPATH - the fftw include directory # FFTW_LPATH - the fftw library directory # @@ -15,7 +15,7 @@ # if(FFTW_IPATH AND FFTW_LPATH) - set(HAVE_FFTW TRUE) + set(FOUND_FFTW TRUE) else() # Check if we can use PkgConfig find_package(PkgConfig QUIET) @@ -117,7 +117,7 @@ else() # Check if we have everything we need if(FFTW_IPATH AND FFTW_LPATH) - set(HAVE_FFTW TRUE) + set(FOUND_FFTW TRUE) endif() unset(FFTW_LIBRARY_DIR) diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake index d0ab030b10..0e017c2b97 100644 --- a/cmake/modules/FindTar.cmake +++ b/cmake/modules/FindTar.cmake @@ -5,14 +5,14 @@ # find_package(Tar [REQUIRED] [QUIET]) # # It sets the following variables: -# HAVE_TAR - system has libtar +# FOUND_TAR - system has libtar # TAR_IPATH - the tar include directory # TAR_LPATH - the tar library directory # TAR_LIBS - the tar components found # if(TAR_IPATH AND TAR_LPATH) - set(HAVE_TAR TRUE) + set(FOUND_TAR TRUE) set(TAR_LIBS tar) else() # Find the libtar include files @@ -37,7 +37,7 @@ else() # Check if we have everything we need if(TAR_IPATH AND TAR_LPATH) - set(HAVE_TAR TRUE) + set(FOUND_TAR TRUE) set(TAR_LIBS tar) endif() diff --git a/cmake/modules/MangleJPEG.cmake b/cmake/modules/MangleJPEG.cmake index 15ffb04724..15b25c7c6b 100644 --- a/cmake/modules/MangleJPEG.cmake +++ b/cmake/modules/MangleJPEG.cmake @@ -6,7 +6,7 @@ # if(JPEG_FOUND) - set(HAVE_JPEG TRUE) + set(FOUND_JPEG TRUE) set(JPEG_LIBS jpeg) get_filename_component(JPEG_LIBRARY_DIR "${JPEG_LIBRARY}" PATH) diff --git a/cmake/modules/MangleOpenSSL.cmake b/cmake/modules/MangleOpenSSL.cmake index b979bc46e6..c53e1561fb 100644 --- a/cmake/modules/MangleOpenSSL.cmake +++ b/cmake/modules/MangleOpenSSL.cmake @@ -6,7 +6,7 @@ # if(OPENSSL_FOUND) - set(HAVE_OPENSSL TRUE) + set(FOUND_OPENSSL TRUE) set(OPENSSL_LIBS ssl crypto) list(GET OPENSSL_LIBRARIES 0 OPENSSL_LIBRARY) diff --git a/cmake/modules/ManglePNG.cmake b/cmake/modules/ManglePNG.cmake index 60790779d9..706967f08a 100644 --- a/cmake/modules/ManglePNG.cmake +++ b/cmake/modules/ManglePNG.cmake @@ -6,7 +6,7 @@ # if(PNG_FOUND) - set(HAVE_PNG TRUE) + set(FOUND_PNG TRUE) set(PNG_LIBS png) get_filename_component(PNG_LIBRARY_DIR "${PNG_LIBRARY}" PATH) diff --git a/cmake/modules/MangleTIFF.cmake b/cmake/modules/MangleTIFF.cmake index 943f0beb80..0292ee0755 100644 --- a/cmake/modules/MangleTIFF.cmake +++ b/cmake/modules/MangleTIFF.cmake @@ -6,7 +6,7 @@ # if(TIFF_FOUND) - set(HAVE_TIFF TRUE) + set(FOUND_TIFF TRUE) set(TIFF_LIBS tiff z) get_filename_component(TIFF_LIBRARY_DIR "${TIFF_LIBRARY}" PATH) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index a007e18bc6..3e4cf4765f 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -4,6 +4,12 @@ message("Configuring support for the following optional third-party packages:") # Check for and configure Eigen library find_package(Eigen3) +if(FOUND_EIGEN) + set(USE_EIGEN TRUE CACHE BOOL "If true, compile Panda3D with eigen") + if(USE_EIGEN) + set(HAVE_EIGEN TRUE) + endif() +endif() if(HAVE_EIGEN) message(STATUS "+ Eigen linear algebra library") if(WIN32) @@ -27,6 +33,12 @@ endif() # Mangle the builtin FindOpenSSL output to match Panda3D's config-style find_package(OpenSSL QUIET COMPONENTS ssl crypto) include(MangleOpenSSL) +if(FOUND_OPENSSL) + set(USE_OPENSSL TRUE CACHE BOOL "If true, compile Panda3D with OpenSSL") + if(USE_OPENSSL) + set(HAVE_OPENSSL TRUE) + endif() +endif() if(HAVE_OPENSSL) message(STATUS "+ OpenSSL") @@ -44,6 +56,12 @@ endif() # Mangle the builtin FindJPEG output to match Panda3D's config-style find_package(JPEG QUIET COMPONENTS jpeg) include(MangleJPEG) +if(FOUND_JPEG) + set(USE_JPEG TRUE CACHE BOOL "If true, compile Panda3D with libjpeg") + if(USE_JPEG) + set(HAVE_JPEG TRUE) + endif() +endif() if(HAVE_JPEG) message(STATUS "+ libjpeg") set(PHAVE_JPEGINT_H TRUE CACHE BOOL "Set to False if missing jpegint.h.") @@ -57,6 +75,12 @@ endif() # Mangle the builtin FindPNG output to match Panda3D's config-style find_package(PNG QUIET COMPONENTS png) include(ManglePNG) +if(FOUND_PNG) + set(USE_PNG TRUE CACHE BOOL "If true, compile Panda3D with libpng") + if(USE_PNG) + set(HAVE_PNG TRUE) + endif() +endif() if(HAVE_PNG) message(STATUS "+ libpng") else() @@ -68,6 +92,12 @@ endif() # Mangle the builtin FindTIFF output to match Panda3D's config-style find_package(TIFF QUIET COMPONENTS tiff z) include(MangleTIFF) +if(FOUND_TIFF) + set(USE_TIFF TRUE CACHE BOOL "If true, compile Panda3D with libtiff") + if(USE_TIFF) + set(HAVE_TIFF TRUE) + endif() +endif() if(HAVE_TIFF) message(STATUS "+ libtiff") else() @@ -77,6 +107,12 @@ endif() # Check for and configure Tar library find_package(Tar) +if(FOUND_TAR) + set(USE_TAR TRUE CACHE BOOL "If true, compile Panda3D with libtar") + if(USE_TAR) + set(HAVE_TAR TRUE) + endif() +endif() if(HAVE_TAR) message(STATUS "+ libtar") else() @@ -86,223 +122,457 @@ endif() # Check for and configure FFTW library find_package(FFTW) +if(FOUND_FFTW) + set(USE_FFTW TRUE CACHE BOOL "If true, compile Panda3D with fftw") + if(USE_FFTW) + set(HAVE_FFTW TRUE) + endif() +endif() if(HAVE_FFTW) message(STATUS "+ fftw") else() message(STATUS "- Did not find fftw") endif() +if(FOUND_SQUISH) + set(USE_SQUISH TRUE CACHE BOOL "If true, compile Panda3D with squish") + if(USE_SQUISH) + set(HAVE_SQUISH TRUE) + endif() +endif() if(HAVE_SQUISH) message(STATUS "+ squish") else() message(STATUS "- Did not find squish") endif() +if(FOUND_CG) + set(USE_CG TRUE CACHE BOOL "If true, compile Panda3D with Nvidia Cg") + if(USE_CG) + set(HAVE_CG TRUE) + endif() +endif() if(HAVE_CG) message(STATUS "+ Nvidia Cg High Level Shading Language") else() message(STATUS "- Did not find Nvidia Cg High Level Shading Language") endif() +if(FOUND_CGGL) + set(USE_CGGL TRUE CACHE BOOL "If true, compile Panda3D with Cg OpenGL API") + if(USE_CGGL) + set(HAVE_CGGL TRUE) + endif() +endif() if(HAVE_CGGL) message(STATUS "+ Cg OpenGL API") else() message(STATUS "- Did not find Cg OpenGL API") endif() +if(FOUND_CGDX8) + set(USE_CGDX8 TRUE CACHE BOOL "If true, compile Panda3D with Cg DX8 API") + if(USE_CGDX8) + set(HAVE_CGDX8 TRUE) + endif() +endif() if(HAVE_CGDX8) message(STATUS "+ Cg DX8 API") else() message(STATUS "- Did not find Cg DX8 API") endif() +if(FOUND_CGDX9) + set(USE_CGDX9 TRUE CACHE BOOL "If true, compile Panda3D with Cg DX9 API") + if(USE_CGDX9) + set(HAVE_CGDX9 TRUE) + endif() +endif() if(HAVE_CGDX9) message(STATUS "+ Cg DX9 API") else() message(STATUS "- Did not find Cg DX9 API") endif() +if(FOUND_CGDX10) + set(USE_CGDX10 TRUE CACHE BOOL "If true, compile Panda3D with Cg DX10 API") + if(USE_CGDX10) + set(HAVE_CGDX10 TRUE) + endif() +endif() if(HAVE_CGDX10) message(STATUS "+ Cg DX10 API") else() message(STATUS "- Did not find Cg DX10 API") endif() +if(FOUND_VRPN) + set(USE_VRPN TRUE CACHE BOOL "If true, compile Panda3D with VRPN") + if(USE_VRPN) + set(HAVE_VRPN TRUE) + endif() +endif() if(HAVE_VRPN) message(STATUS "+ VRPN") else() message(STATUS "- Did not find VRPN") endif() +if(FOUND_ZLIB) + set(USE_ZLIB TRUE CACHE BOOL "If true, compile Panda3D with zlib") + if(USE_ZLIB) + set(HAVE_ZLIB TRUE) + endif() +endif() if(HAVE_ZLIB) message(STATUS "+ zlib") else() message(STATUS "- Did not find zlib") endif() +if(FOUND_RAD_MSS) + set(USE_RAD_MSS TRUE CACHE BOOL "If true, compile Panda3D with Miles Sound System") + if(USE_RAD_MSS) + set(HAVE_RAD_MSS TRUE) + endif() +endif() if(HAVE_RAD_MSS) message(STATUS "+ Miles Sound System") else() message(STATUS "- Did not find Miles Sound System") endif() +if(FOUND_FMODEX) + set(USE_FMODEX TRUE CACHE BOOL "If true, compile Panda3D with FMOD Ex sound library") + if(USE_FMODEX) + set(HAVE_FMODEX TRUE) + endif() +endif() if(HAVE_FMODEX) message(STATUS "+ FMOD Ex sound library") else() message(STATUS "- Did not find FMOD Ex sound library") endif() +if(FOUND_OPENAL) + set(USE_OPENAL TRUE CACHE BOOL "If true, compile Panda3D with OpenAL sound library") + if(USE_OPENAL) + set(HAVE_OPENAL TRUE) + endif() +endif() if(HAVE_OPENAL) message(STATUS "+ OpenAL sound library") else() message(STATUS "- Did not find OpenAL sound library") endif() +if(FOUND_PHYSX) + set(USE_PHYSX TRUE CACHE BOOL "If true, compile Panda3D with Aegia PhysX") + if(USE_PHYSX) + set(HAVE_PHYSX TRUE) + endif() +endif() if(HAVE_PHYSX) message(STATUS "+ Ageia PhysX") else() message(STATUS "- Did not find Ageia PhysX") endif() +if(FOUND_SPEEDTREE) + set(USE_SPEEDTREE TRUE CACHE BOOL "If true, compile Panda3D with SpeedTree") + if(USE_SPEEDTREE) + set(HAVE_SPEEDTREE TRUE) + endif() +endif() if(HAVE_SPEEDTREE) message(STATUS "+ SpeedTree") else() message(STATUS "- Did not find SpeedTree") endif() +if(FOUND_GTK) + set(USE_GTK TRUE CACHE BOOL "If true, compile Panda3D with gtk+-2") + if(USE_GTK) + set(HAVE_GTK TRUE) + endif() +endif() if(HAVE_GTK) message(STATUS "+ gtk+-2") else() message(STATUS "- Did not find gtk+-2") endif() +if(FOUND_FREETYPE) + set(USE_FREETYPE TRUE CACHE BOOL "If true, compile Panda3D with Freetype") + if(USE_FREETYPE) + set(HAVE_FREETYPE TRUE) + endif() +endif() if(HAVE_FREETYPE) message(STATUS "+ Freetype") else() message(STATUS "- Did not find Freetype") endif() +if(FOUND_WX) + set(USE_WX TRUE CACHE BOOL "If true, compile Panda3D with WxWidgets") + if(USE_WX) + set(HAVE_WX TRUE) + endif() +endif() if(HAVE_WX) message(STATUS "+ WxWidgets") else() message(STATUS "- Did not find WxWidgets") endif() +if(FOUND_FLTK) + set(USE_FLTK TRUE CACHE BOOL "If true, compile Panda3D with FLTK") + if(USE_FLTK) + set(HAVE_FLTK TRUE) + endif() +endif() if(HAVE_FLTK) message(STATUS "+ FLTK") else() message(STATUS "- Did not find FLTK") endif() +if(FOUND_GL) + set(USE_GL TRUE CACHE BOOL "If true, compile Panda3D with OpenGL") + if(USE_GL) + set(HAVE_GL TRUE) + endif() +endif() if(HAVE_GL) message(STATUS "+ OpenGL") else() message(STATUS "- Did not find OpenGL") endif() +if(FOUND_GLES) + set(USE_GLES TRUE CACHE BOOL "If true, compile Panda3D with OpenGL ES 1") + if(USE_GLES) + set(HAVE_GLES TRUE) + endif() +endif() if(HAVE_GLES) message(STATUS "+ OpenGL ES 1") else() message(STATUS "- Did not find OpenGL ES 1") endif() +if(FOUND_GLES2) + set(USE_GLES2 TRUE CACHE BOOL "If true, compile Panda3D with OpenGL ES 2") + if(USE_GLES2) + set(HAVE_GLES2 TRUE) + endif() +endif() if(HAVE_GLES2) message(STATUS "+ OpenGL ES 2") else() message(STATUS "- Did not find OpenGL ES 2") endif() +if(FOUND_DX8) + set(USE_DX8 TRUE CACHE BOOL "If true, compile Panda3D with DirectX8") + if(USE_DX8) + set(HAVE_DX8 TRUE) + endif() +endif() if(HAVE_DX8) message(STATUS "+ DirectX8") else() message(STATUS "- Did not find DirectX8") endif() +if(FOUND_DX9) + set(USE_DX9 TRUE CACHE BOOL "If true, compile Panda3D with DirectX9") + if(USE_DX9) + set(HAVE_DX9 TRUE) + endif() +endif() if(HAVE_DX9) message(STATUS "+ DirectX9") else() message(STATUS "- Did not find DirectX9") endif() +if(FOUND_TINYDISPLAY) + set(USE_TINYDISPLAY TRUE CACHE BOOL "If true, compile Panda3D with Tinydisplay") + if(USE_TINYDISPLAY) + set(HAVE_TINYDISPLAY TRUE) + endif() +endif() if(HAVE_TINYDISPLAY) message(STATUS "+ Tinydisplay") else() message(STATUS "- Not building Tinydisplay") endif() -# if(HAVE_SDL) +#### Was commented out in original 'Config.pp' not sure why +#if(FOUND_SDL) +# set(USE_SDL TRUE CACHE BOOL "If true, compile Panda3D with SDL") +# if(USE_SDL) +# set(HAVE_SDL TRUE) +# endif() +#endif() +#if(HAVE_SDL) # message(STATUS "+ SDL") # else() # message(STATUS "- Did not find SDL") # endif() +if(FOUND_X11) + set(USE_X11 TRUE CACHE BOOL "If true, compile Panda3D with X11") + if(USE_X11) + set(HAVE_X11 TRUE) + endif() +endif() if(HAVE_X11) message(STATUS "+ X11") else() message(STATUS "- Did not find X11") endif() +if(FOUND_MESA) + set(USE_MESA TRUE CACHE BOOL "If true, compile Panda3D with Mesa") + if(USE_MESA) + set(HAVE_MESA TRUE) + endif() +endif() if(HAVE_MESA) message(STATUS "+ Mesa") else() message(STATUS "- Did not find Mesa") endif() +if(FOUND_OPENCV) + set(USE_OPENCV TRUE CACHE BOOL "If true, compile Panda3D with OpenCV") + if(USE_OPENCV) + set(HAVE_OPENCV TRUE) + endif() +endif() if(HAVE_OPENCV) message(STATUS "+ OpenCV") else() message(STATUS "- Did not find OpenCV") endif() +if(FOUND_FFMPEG) + set(USE_FFMPEG TRUE CACHE BOOL "If true, compile Panda3D with FFMPEG") + if(USE_FFMPEG) + set(HAVE_FFMPEG TRUE) + endif() +endif() if(HAVE_FFMPEG) message(STATUS "+ FFMPEG") else() message(STATUS "- Did not find FFMPEG") endif() +if(FOUND_ODE) + set(USE_ODE TRUE CACHE BOOL "If true, compile Panda3D with ODE") + if(USE_ODE) + set(HAVE_ODE TRUE) + endif() +endif() if(HAVE_ODE) message(STATUS "+ ODE") else() message(STATUS "- Did not find ODE") endif() +if(FOUND_AWESOMIUM) + set(USE_AWESOMIUM TRUE CACHE BOOL "If true, compile Panda3D with AWESOMIUM") + if(USE_AWESOMIUM) + set(HAVE_AWESOMIUM TRUE) + endif() +endif() if(HAVE_AWESOMIUM) message(STATUS "+ AWESOMIUM") else() message(STATUS "- Did not find AWESOMIUM") endif() +if(FOUND_MAYA) + set(USE_MAYA TRUE CACHE BOOL "If true, compile Panda3D with OpenMaya") + if(USE_MAYA) + set(HAVE_MAYA TRUE) + endif() +endif() if(HAVE_MAYA) message(STATUS "+ OpenMaya") else() message(STATUS "- Did not find OpenMaya") endif() +if(FOUND_FCOLLADA) + set(USE_FCOLLADA TRUE CACHE BOOL "If true, compile Panda3D with FCollada") + if(USE_FCOLLADA) + set(HAVE_FCOLLADA TRUE) + endif() +endif() if(HAVE_FCOLLADA) message(STATUS "+ FCollada") else() message(STATUS "- Did not find FCollada") endif() +if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) + set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") + if(USE_COLLADA) + if(FOUND_COLLADA15DOM) + set(HAVE_COLLADA15DOM TRUE) + else() + set(HAVE_COLLADA14DOM TRUE) + endif() + endif() +endif() if(HAVE_COLLADA14DOM OR HAVE_COLLADA15DOM) message(STATUS "+ COLLADA DOM") else() message(STATUS "- Did not find COLLADA DOM") endif() +if(FOUND_ASSIMP) + set(USE_ASSIMP TRUE CACHE BOOL "If true, compile Panda3D with Assimp") + if(USE_ASSIMP) + set(HAVE_ASSIMP TRUE) + endif() +endif() if(HAVE_ASSIMP) message(STATUS "+ Assimp") else() message(STATUS "- Did not find Assimp") endif() +if(FOUND_ARTOOLKIT) + set(USE_ARTOOLKIT TRUE CACHE BOOL "If true, compile Panda3D with ARToolKit") + if(USE_ARTOOLKIT) + set(HAVE_ARTOOLKIT TRUE) + endif() +endif() if(HAVE_ARTOOLKIT) message(STATUS "+ ARToolKit") else() message(STATUS "- Did not find ARToolKit") endif() +if(FOUND_ROCKET) + set(USE_ROCKET TRUE CACHE BOOL "If true, compile Panda3D with libRocket") + if(USE_ROCKET) + set(HAVE_ROCKET TRUE) + endif() +endif() if(HAVE_ROCKET) + # Check for rocket python bindings + if(FOUND_ROCKET_PYTHON) + set(USE_ROCKET_PYTHON TRUE CACHE BOOL "If true, compile Panda3D with python bindings for libRocket") + if(USE_ROCKET_PYTHON) + set(HAVE_ROCKET_PYTHON TRUE) + endif() + endif() if(HAVE_ROCKET_PYTHON) message(STATUS "+ libRocket with Python bindings") else() @@ -312,25 +582,49 @@ else() message(STATUS "- Did not find libRocket") endif() +if(FOUND_BULLET) + set(USE_BULLET TRUE CACHE BOOL "If true, compile Panda3D with Bullet Physics") + if(USE_BULLET) + set(HAVE_BULLET TRUE) + endif() +endif() if(HAVE_BULLET) message(STATUS "+ Bullet Physics") else() message(STATUS "- Did not find Bullet Physics") endif() +if(FOUND_VORBIS) + set(USE_VORBIS TRUE CACHE BOOL "If true, compile Panda3D with libvorbis") + if(USE_VORBIS) + set(HAVE_VORBIS TRUE) + endif() +endif() if(HAVE_VORBIS) message(STATUS "+ libvorbis (Ogg Vorbis Decoder)") else() message(STATUS "- Did not find libvorbis (Ogg Vorbis Decoder)") endif() -message(STATUS "") -if(HAVE_INTERROGATE AND HAVE_PYTHON) +message(STATUS "") # simple line break +if(FOUND_INTERROGATE AND HAVE_PYTHON) + set(USE_INTERROGATE TRUE CACHE BOOL "If true, Panda3D will generate python interfaces") + if(USE_INTERROGATE) + set(HAVE_INTERROGATE TRUE) + endif() +endif() +if(HAVE_INTERROGATE) message(STATUS "Compilation will generate Python interfaces.") else() message(STATUS "Configuring Panda without Python interfaces.") endif() +if(FOUND_THREADS) + set(USE_THREADS TRUE CACHE BOOL "If true, compile Panda3D with threading support.") + if(USE_THREADS) + set(HAVE_THREADS TRUE) + endif() +endif() if(HAVE_THREADS) if(SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") From 1dc12b6ea1ec30863e0a278409f2f949b16a7a66 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 30 Nov 2013 02:17:10 -0700 Subject: [PATCH 026/744] CMake: Configure: Implement config_package and mangle_package functions with test-case uses. --- cmake/modules/ConfigurePackage.cmake | 75 ++++++++++++++++++++++++++++ dtool/Configure.cmake | 15 ++---- 2 files changed, 78 insertions(+), 12 deletions(-) create mode 100644 cmake/modules/ConfigurePackage.cmake diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake new file mode 100644 index 0000000000..b79734626d --- /dev/null +++ b/cmake/modules/ConfigurePackage.cmake @@ -0,0 +1,75 @@ +# Filename: ConfigurePackage.cmake +# Author: kestred (30 Nov, 2013) +# +# This modules defines a function which finds and configures libraries +# and packages for Panda3Ds configuration file headers (.h files). +# +# Additionally, it defines a macro for including Mangle modules. +# +# Assumes the file has already been found with find_package(). +# + +# Usage: +# mangle_package(LIBRARY_NAME) +macro(mangle_package PKG_NAME) + include(Mangle${PKG_NAME}) +endmacro() + +# Usage: +# config_package(PACKAGE_NAME [REQUIRED] [COMMENT ]) +function(config_package PKG_NAME) + # Set function vars to defaults + set(DISPLAY_NAME ${PKG_NAME}) + + # Handle optional function arguments + foreach(arg ${ARGN}) + if(ARG_IS_LIBRARY) + unset(ARG_IS_LIBRARY) + set(LIB_NAME ${arg}) + break() + elseif(ARG_IS_COMMENT) + unset(ARG_IS_COMMENT) + set(DISPLAY_NAME ${arg}) + break() + endif() + + if(arg MATCHES "REQUIRED") + # TODO: Implement currently ignored + elseif(arg MATCHES "COMMENT") + set(ARG_IS_COMMENT TRUE) + else() + message(AUTHOR_WARNING "configure_package() unexpected argument: '${arg}'") + return() + endif() + endforeach() + if(ARG_IS_COMMENT) + message(AUTHOR_WARNING "configure_package() expected display-name after 'COMMENT'") + endif() + + if(FOUND_${PKG_NAME}) + # Output success after finding the package for the first time + if(NOT DEFINED USE_${PKG_NAME}) + endif() + + # Add a USE_XYZZY config variable to the cache + set(USE_${PKG_NAME} TRUE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + if(USE_${PKG_NAME}) + set(HAVE_${PKG_NAME} TRUE PARENT_SCOPE) + endif() + + elseif(DEFINED USE_${PKG_NAME}) + # If we were compiling with a particular package, but we can't find it; + # then inform the user the package was lost. + if(USE_${PKG_NAME}) + message(STATUS "- Can no longer find ${DISPLAY_NAME}") + + # Only unset if USE_XYZZY is true; + # This allows us to set USE_XYZZY to false to silence the output + unset(USE_${PKG_NAME}) + endif() + + else() + # Output failure to find package + message(STATUS "- Did not find ${DISPLAY_NAME}") + endif() +endfunction() \ No newline at end of file diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 3e4cf4765f..bf609dfb64 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -1,6 +1,7 @@ message(STATUS "") message("Configuring support for the following optional third-party packages:") +include(ConfigurePackage) # Check for and configure Eigen library find_package(Eigen3) @@ -91,7 +92,7 @@ endif() # Check for and configure TIFF library # Mangle the builtin FindTIFF output to match Panda3D's config-style find_package(TIFF QUIET COMPONENTS tiff z) -include(MangleTIFF) +mangle_package(TIFF) if(FOUND_TIFF) set(USE_TIFF TRUE CACHE BOOL "If true, compile Panda3D with libtiff") if(USE_TIFF) @@ -107,17 +108,7 @@ endif() # Check for and configure Tar library find_package(Tar) -if(FOUND_TAR) - set(USE_TAR TRUE CACHE BOOL "If true, compile Panda3D with libtar") - if(USE_TAR) - set(HAVE_TAR TRUE) - endif() -endif() -if(HAVE_TAR) - message(STATUS "+ libtar") -else() - message(STATUS "- Did not find libtar") -endif() +config_package(TAR COMMENT "libtar") # Check for and configure FFTW library From a0b8deb7451a3a2c86c7ea1c243819825dbe8b2c Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 30 Nov 2013 02:28:59 -0700 Subject: [PATCH 027/744] CMake: Configure: Update to use the mangle_package and config_package functions. --- cmake/modules/ConfigurePackage.cmake | 1 + dtool/Configure.cmake | 110 ++++++--------------------- 2 files changed, 24 insertions(+), 87 deletions(-) diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake index b79734626d..da5fe23bac 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/modules/ConfigurePackage.cmake @@ -49,6 +49,7 @@ function(config_package PKG_NAME) if(FOUND_${PKG_NAME}) # Output success after finding the package for the first time if(NOT DEFINED USE_${PKG_NAME}) + message(STATUS "+ ${DISPLAY_NAME}") endif() # Add a USE_XYZZY config variable to the cache diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index bf609dfb64..0f40898488 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -3,127 +3,63 @@ message("Configuring support for the following optional third-party packages:") include(ConfigurePackage) -# Check for and configure Eigen library +# Find and configure Eigen library find_package(Eigen3) -if(FOUND_EIGEN) - set(USE_EIGEN TRUE CACHE BOOL "If true, compile Panda3D with eigen") - if(USE_EIGEN) - set(HAVE_EIGEN TRUE) - endif() -endif() +config_package(EIGEN COMMENT "eigen") if(HAVE_EIGEN) - message(STATUS "+ Eigen linear algebra library") if(WIN32) set(EIGEN_CFLAGS "/arch:SSE2") else() set(EIGEN_CFLAGS "-msse2") endif() - set(LINMATH_ALIGN ON CACHE BOOL "If on, vectorization is enabled in build.") - if(LINMATH_ALIGN) + if(NOT DEFINED LINMATH_ALIGN) message(STATUS "+ (vectorization enabled in build)") - else() - message(STATUS "- (vectorization NOT enabled in build)") endif() + set(LINMATH_ALIGN ON CACHE BOOL "If on, vectorization is enabled in build.") else() - message(STATUS "- Did not find Eigen linear algebra library") + unset(LINMATH_ALIGN CACHE) endif() - -# Check for and configure OpenSSL library -# Mangle the builtin FindOpenSSL output to match Panda3D's config-style +# Find and configure OpenSSL library find_package(OpenSSL QUIET COMPONENTS ssl crypto) -include(MangleOpenSSL) -if(FOUND_OPENSSL) - set(USE_OPENSSL TRUE CACHE BOOL "If true, compile Panda3D with OpenSSL") - if(USE_OPENSSL) - set(HAVE_OPENSSL TRUE) - endif() -endif() +mangle_package(OpenSSL) +config_package(OPENSSL COMMENT "OpenSSL") if(HAVE_OPENSSL) - message(STATUS "+ OpenSSL") - if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) set(REPORT_OPENSSL_ERRORS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") else() set(REPORT_OPENSSL_ERRORS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") endif() else() - message(STATUS "- Did not find OpenSSL") + unset(REPORT_OPENSSL_ERRORS CACHE) endif() - -# Check for and configure JPEG library -# Mangle the builtin FindJPEG output to match Panda3D's config-style +# Find and configure JPEG library find_package(JPEG QUIET COMPONENTS jpeg) -include(MangleJPEG) -if(FOUND_JPEG) - set(USE_JPEG TRUE CACHE BOOL "If true, compile Panda3D with libjpeg") - if(USE_JPEG) - set(HAVE_JPEG TRUE) - endif() -endif() -if(HAVE_JPEG) - message(STATUS "+ libjpeg") - set(PHAVE_JPEGINT_H TRUE CACHE BOOL "Set to False if missing jpegint.h.") -else() - message(STATUS "- Did not find libjpeg") - unset(PHAVE_JPEGINT_H CACHE) -endif() +mangle_package(JPEG) +config_package(JPEG COMMENT "libjpeg") - -# Check for and configure PNG library -# Mangle the builtin FindPNG output to match Panda3D's config-style +# Find and configure PNG library find_package(PNG QUIET COMPONENTS png) -include(ManglePNG) -if(FOUND_PNG) - set(USE_PNG TRUE CACHE BOOL "If true, compile Panda3D with libpng") - if(USE_PNG) - set(HAVE_PNG TRUE) - endif() -endif() -if(HAVE_PNG) - message(STATUS "+ libpng") -else() - message(STATUS "- Did not find libpng") -endif() +mangle_package(PNG) +config_package(PNG COMMENT "libpng") - -# Check for and configure TIFF library -# Mangle the builtin FindTIFF output to match Panda3D's config-style +# Find and configure TIFF library find_package(TIFF QUIET COMPONENTS tiff z) mangle_package(TIFF) -if(FOUND_TIFF) - set(USE_TIFF TRUE CACHE BOOL "If true, compile Panda3D with libtiff") - if(USE_TIFF) - set(HAVE_TIFF TRUE) - endif() -endif() -if(HAVE_TIFF) - message(STATUS "+ libtiff") -else() - message(STATUS "- Did not find libtiff") -endif() +config_package(TIFF COMMENT "libtiff") - -# Check for and configure Tar library +# Find and configure Tar library find_package(Tar) config_package(TAR COMMENT "libtar") - -# Check for and configure FFTW library +# Find and configure FFTW library find_package(FFTW) -if(FOUND_FFTW) - set(USE_FFTW TRUE CACHE BOOL "If true, compile Panda3D with fftw") - if(USE_FFTW) - set(HAVE_FFTW TRUE) - endif() -endif() -if(HAVE_FFTW) - message(STATUS "+ fftw") -else() - message(STATUS "- Did not find fftw") -endif() +config_package(FFTW COMMENT "fftw") + + + if(FOUND_SQUISH) set(USE_SQUISH TRUE CACHE BOOL "If true, compile Panda3D with squish") From 8f3a798ae8f63cc07789964e6ec6e7cda530105d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 30 Nov 2013 03:07:23 -0700 Subject: [PATCH 028/744] CMake: Resolve linker issues with interrogate; it now builds! --- dtool/src/interrogate/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index d5bf4d82a7..c04518c967 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -6,6 +6,9 @@ include_directories(../dtoolbase) include_directories(../pystub) include_directories(../prc) +find_package(OpenSSL REQUIRED) +include_directories(${OPENSSL_INCLUDE_DIR}) + set(INTERROGATE_HEADERS functionRemap.h functionWriter.h @@ -57,5 +60,5 @@ add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate - p3cppParser p3interrogatedb p3dconfig p3dtoolutil p3dtoolbase p3pystub - p3prc) + p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase + p3pystub ${OPENSSL_LIBRARIES}) From 93ca5ade900fbb14e5bed543e7bd16453cd1488e Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 6 Dec 2013 01:32:04 -0700 Subject: [PATCH 029/744] CMake: Bugfix: Include "memoryHook.h" in "streamReader.cxx" to fix incomplete class from foward decl. --- dtool/src/prc/streamReader.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/dtool/src/prc/streamReader.cxx b/dtool/src/prc/streamReader.cxx index d8b5c3a675..27708563bd 100644 --- a/dtool/src/prc/streamReader.cxx +++ b/dtool/src/prc/streamReader.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "streamReader.h" +#include "memoryHook.h" //////////////////////////////////////////////////////////////////// From d03d5125a0da10808bcd40ad15666d311a41ed93 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 7 Dec 2013 21:09:40 -0700 Subject: [PATCH 030/744] CMake: Configure: Add using and finding squish library. --- cmake/modules/FindSquish.cmake | 100 +++++++++++++++++++++++++++++++++ dtool/Configure.cmake | 16 +----- 2 files changed, 103 insertions(+), 13 deletions(-) create mode 100644 cmake/modules/FindSquish.cmake diff --git a/cmake/modules/FindSquish.cmake b/cmake/modules/FindSquish.cmake new file mode 100644 index 0000000000..742fb67af1 --- /dev/null +++ b/cmake/modules/FindSquish.cmake @@ -0,0 +1,100 @@ +# Filename: FindSquish.cmake +# Author: kestred (7 Dec, 2013) +# +# Usage: +# 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 +# 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 +# + +if(SQUISH_IPATH AND SQUISH_LPATH) + 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_path(SQUISH_IPATH + NAMES "squish.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "" "cppunit" + ) + + # Find the libsquish library built for release + find_library(SQUISH_RELEASE_LIBRARY + NAMES "squish" "libsquish" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + # Find the libsquish library built for debug + find_library(SQUISH_DEBUG_LIBRARY + NAMES "squishd" "libsquishd" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + 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 + 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) + unset(SQUISH_LIBRARY CACHE) + mark_as_advanced(SQUISH_IPATH) + mark_as_advanced(SQUISH_LPATH) + mark_as_advanced(SQUISH_RELEASE_LIBRARY) + mark_as_advanced(SQUISH_DEBUG_LIBRARY) +endif() \ No newline at end of file diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 0f40898488..d121c76060 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -58,21 +58,11 @@ config_package(TAR COMMENT "libtar") find_package(FFTW) config_package(FFTW COMMENT "fftw") +# Find and configure Squish library +find_package(Squish) +config_package(SQUISH COMMENT "squish") - -if(FOUND_SQUISH) - set(USE_SQUISH TRUE CACHE BOOL "If true, compile Panda3D with squish") - if(USE_SQUISH) - set(HAVE_SQUISH TRUE) - endif() -endif() -if(HAVE_SQUISH) - message(STATUS "+ squish") -else() - message(STATUS "- Did not find squish") -endif() - if(FOUND_CG) set(USE_CG TRUE CACHE BOOL "If true, compile Panda3D with Nvidia Cg") if(USE_CG) From 6fe7b5980116a67ce75cf3021b2f730ab63fef06 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 8 Dec 2013 20:59:17 -0700 Subject: [PATCH 031/744] CMake: Configure: Add cross-platform (openGL) Nvidia Cg support. --- cmake/modules/FindCg.cmake | 185 +++++++++++++++++++++++++++++++++++++ dtool/Configure.cmake | 64 ++----------- 2 files changed, 192 insertions(+), 57 deletions(-) create mode 100644 cmake/modules/FindCg.cmake diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake new file mode 100644 index 0000000000..e8546b6cc9 --- /dev/null +++ b/cmake/modules/FindCg.cmake @@ -0,0 +1,185 @@ +# Filename: FindCg.cmake +# +# Usage: +# find_package(Cg [REQUIRED] [QUIET]) +# +# It sets the following variables: +# FOUND_CG - system has NvidiaCg +# CG_IPATH - the NvidiaCg include directory +# CG_LPATH - the NvidiaCg library directory +# CG_LIBS - the Cg 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 +# + + +### Define macros to find each sublibrary ### + +# Find Cg for OpenGL +macro(find_cggl) + if(CGGL_LPATH AND CGGL_IPATH) + # If its cached, we don't need to refind it + set(FOUND_CGGL TRUE) + if(WIN32) + set(CGGL_LIBS cgGL.lib) + else() + set(CGGL_LIBS CgGL) + endif() + else() + # Find the include directory + find_path(CGGL_IPATH + NAMES "cgGL.h" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg/include" + "/usr/include" + "/usr/local/include" + "/opt/Cg" + "/opt/nvidia-cg-toolkit/include" # Gentoo + PATH_SUFFIXES "" "Cg" + DOC "The path to NvidiaCg's include directory." + ) + + # Find the library directory + find_library(CGGL_LIBRARY + NAMES "CgGL" "libCgGL" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg" + "/usr" + "/usr/local" + "/opt/Cg" + "/opt/nvidia-cg-toolkit" # Gentoo + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + get_filename_component(CGGL_LIBRARY_DIR "${CGGL_LIBRARY}" PATH) + 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) + set(CGGL_FOUND TRUE) + if(WIN32) + set(CGGL_LIBS cgGL.lib) + else() + set(CGGL_LIBS CgGL) + endif() + endif() + + mark_as_advanced(CGGL_IPATH) + mark_as_advanced(CGGL_LPATH) + endif() +endmacro() + + +# Find Cg for DirectX 8 +macro(find_cgdx8) +endmacro() + + +# Find Cg for DirectX 9 +macro(find_cgdx9) +endmacro() + + +# Find Cg for DirectX 10 +macro(find_cgdx10) +endmacro() + + + +# Find base Nvidia Cg +if(CG_LPATH AND CG_IPATH) + # If its cached, we don't need to refind it + set(FOUND_CG TRUE) + if(WIN32) + set(CG_LIBS cg.lib) + else() + set(CG_LIBS Cg) + endif() + + find_cggl() + find_cgdx8() + find_cgdx9() + find_cgdx10() + +else() + # On OSX default to using the framework version of Cg. + if(APPLE) + include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake) + set(CG_INCLUDES) + + cmake_find_frameworks(Cg) + if(Cg_FRAMEWORKS) + foreach(dir ${Cg_FRAMEWORKS}) + set(CG_INCLUDES ${CG_INCLUDES} ${dir}/Headers ${dir}/PrivateHeaders) + endforeach(dir) + unset(Cg_FRAMEWORKS) + + # Find the include dir + find_path(CG_IPATH + NAMES "cg.h" + PATHS ${CG_INCLUDES} + DOC "The path to NvidiaCg's include directory." + ) + unset(CG_INCLUDES) + + # Set the library dir (TODO: Check the correctness on Mac OS X) + set(CG_LPATH "/Library/Frameworks/Cg.framework" CACHE PATH "The path to NvidiaCg's library directory.") + endif() + + else() + # Find the include directory + find_path(CG_IPATH + NAMES "cg.h" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg/include" + "/usr/include" + "/usr/local/include" + "/opt/Cg" + "/opt/nvidia-cg-toolkit/include" # Gentoo + PATH_SUFFIXES "" "Cg" + DOC "The path to NvidiaCg's include directory." + ) + + # Find the library directory + find_library(CG_LIBRARY + NAMES "Cg" "libCg" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg" + "/usr" + "/usr/local" + "/opt/Cg" + "/opt/nvidia-cg-toolkit" # Gentoo + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + get_filename_component(CG_LIBRARY_DIR "${CG_LIBRARY}" PATH) + 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 + if(CG_IPATH AND CG_LPATH) + set(CG_FOUND TRUE) + if(WIN32) + set(CG_LIBS cg.lib) + else() + set(CG_LIBS Cg) + endif() + + find_cggl() + find_cgdx8() + find_cgdx9() + find_cgdx10() + + endif() + + mark_as_advanced(CG_IPATH) + mark_as_advanced(CG_LPATH) +endif() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index d121c76060..e608fd54f8 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -62,66 +62,16 @@ config_package(FFTW COMMENT "fftw") find_package(Squish) config_package(SQUISH COMMENT "squish") +# Find and configure Cg library +find_package(Cg) +config_package(CG COMMENT "Nvidia Cg Shading Langauge") +config_package(CGGL COMMENT "Cg OpenGL API") +config_package(CGDX8 COMMENT "Cg DX8 API") +config_package(CGDX9 COMMENT "Cg DX9 API") +config_package(CGDX10 COMMENT "Cg DX10 API") -if(FOUND_CG) - set(USE_CG TRUE CACHE BOOL "If true, compile Panda3D with Nvidia Cg") - if(USE_CG) - set(HAVE_CG TRUE) - endif() -endif() -if(HAVE_CG) - message(STATUS "+ Nvidia Cg High Level Shading Language") -else() - message(STATUS "- Did not find Nvidia Cg High Level Shading Language") -endif() -if(FOUND_CGGL) - set(USE_CGGL TRUE CACHE BOOL "If true, compile Panda3D with Cg OpenGL API") - if(USE_CGGL) - set(HAVE_CGGL TRUE) - endif() -endif() -if(HAVE_CGGL) - message(STATUS "+ Cg OpenGL API") -else() - message(STATUS "- Did not find Cg OpenGL API") -endif() -if(FOUND_CGDX8) - set(USE_CGDX8 TRUE CACHE BOOL "If true, compile Panda3D with Cg DX8 API") - if(USE_CGDX8) - set(HAVE_CGDX8 TRUE) - endif() -endif() -if(HAVE_CGDX8) - message(STATUS "+ Cg DX8 API") -else() - message(STATUS "- Did not find Cg DX8 API") -endif() - -if(FOUND_CGDX9) - set(USE_CGDX9 TRUE CACHE BOOL "If true, compile Panda3D with Cg DX9 API") - if(USE_CGDX9) - set(HAVE_CGDX9 TRUE) - endif() -endif() -if(HAVE_CGDX9) - message(STATUS "+ Cg DX9 API") -else() - message(STATUS "- Did not find Cg DX9 API") -endif() - -if(FOUND_CGDX10) - set(USE_CGDX10 TRUE CACHE BOOL "If true, compile Panda3D with Cg DX10 API") - if(USE_CGDX10) - set(HAVE_CGDX10 TRUE) - endif() -endif() -if(HAVE_CGDX10) - message(STATUS "+ Cg DX10 API") -else() - message(STATUS "- Did not find Cg DX10 API") -endif() if(FOUND_VRPN) set(USE_VRPN TRUE CACHE BOOL "If true, compile Panda3D with VRPN") From 90e4926b94462f6467b0462508784ae404a00406 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 8 Dec 2013 23:17:24 -0700 Subject: [PATCH 032/744] CMake: Configure: Support VRPN. --- cmake/modules/FindCg.cmake | 3 +++ cmake/modules/FindVRPN.cmake | 47 ++++++++++++++++++++++++++++++++++++ dtool/Configure.cmake | 14 +++-------- 3 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 cmake/modules/FindVRPN.cmake diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index e8546b6cc9..082f0f282a 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -78,16 +78,19 @@ endmacro() # Find Cg for DirectX 8 macro(find_cgdx8) + # TODO: Implement endmacro() # Find Cg for DirectX 9 macro(find_cgdx9) + # TODO: Implement endmacro() # Find Cg for DirectX 10 macro(find_cgdx10) + # TODO: Implement endmacro() diff --git a/cmake/modules/FindVRPN.cmake b/cmake/modules/FindVRPN.cmake new file mode 100644 index 0000000000..efa151f350 --- /dev/null +++ b/cmake/modules/FindVRPN.cmake @@ -0,0 +1,47 @@ +# Filename: FindTar.cmake +# Author: kestred (29 Nov, 2013) +# +# Usage: +# 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 +# + +if(VRPN_IPATH AND VRPN_LPATH) + set(FOUND_VRPN TRUE) +else() + # Find the vrpn include files + find_path(VRPN_IPATH + NAMES "vrpn_Keyboard.h" + PATHS "/usr/include" + "/usr/local/include" + "/opt/vrpn/include" + PATH_SUFFIXES "" "vrpn" + DOC "The path to vrpn's include directory." + ) + + # Find the libvrpn library (.a, .so) + find_library(VRPN_LIBRARY + NAMES "vrpn" + "libvrpn" + PATHS "/usr" + "/usr/local" + "/opt/vrpn" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + 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 + + # Check if we have everything we need + if(VRPN_IPATH AND VRPN_LPATH) + set(FOUND_VRPN TRUE) + endif() + + unset(VRPN_LIBRARY_DIR) + unset(VRPN_LIBRARY CACHE) + mark_as_advanced(VRPN_IPATH) + mark_as_advanced(VRPN_LPATH) +endif() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index e608fd54f8..b386d1c620 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -70,20 +70,12 @@ config_package(CGDX8 COMMENT "Cg DX8 API") config_package(CGDX9 COMMENT "Cg DX9 API") config_package(CGDX10 COMMENT "Cg DX10 API") +# Find and configure VRPN library +find_package(VRPN) +config_package(VRPN) -if(FOUND_VRPN) - set(USE_VRPN TRUE CACHE BOOL "If true, compile Panda3D with VRPN") - if(USE_VRPN) - set(HAVE_VRPN TRUE) - endif() -endif() -if(HAVE_VRPN) - message(STATUS "+ VRPN") -else() - message(STATUS "- Did not find VRPN") -endif() if(FOUND_ZLIB) set(USE_ZLIB TRUE CACHE BOOL "If true, compile Panda3D with zlib") From 693f7b39cff6b5b197c6b38c31d9117a154df4a8 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 00:11:39 -0700 Subject: [PATCH 033/744] CMake: Configure: Add option to enable or disable all packages. --- cmake/README.md | 34 ++++++++++++++++++++++++++++ cmake/modules/ConfigurePackage.cmake | 23 +++++++++++++++---- dtool/Configure.cmake | 10 ++++++++ 3 files changed, 62 insertions(+), 5 deletions(-) create mode 100644 cmake/README.md diff --git a/cmake/README.md b/cmake/README.md new file mode 100644 index 0000000000..abbad32fa4 --- /dev/null +++ b/cmake/README.md @@ -0,0 +1,34 @@ +Building with CMake +------------------- + +The quickest way to build and install panda with CMake is to run: +```sh +cmake . +make +[sudo] make install +``` + +It is recommended to create a separate directory to build Panda3D: +```sh +mkdir build +cd build/ +cmake .. +make +``` + +To configure CMake, it is recommended to use cmake-gui (`cmake-gui .`), +however it is also possible to configure it entirely through CMake's +command-line interface; see `man cmake` for more details. + +All third-party libraries are enabled by default and Panda3D will +be compiled with any 3rd party library that is found. +Third-party libraries can be enabled or disabled through +configuration with the cmake gui or cli. + +To quickly enable or disable all third-party libraries, run: +```sh +cmake -DEVERYTHING=True . # or .. if you are in a separate build/ dir +# OR +cmake -DNOTHING=True . # or .. if you are in a separate build/ dir +``` + diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake index da5fe23bac..52793c862c 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/modules/ConfigurePackage.cmake @@ -48,12 +48,23 @@ function(config_package PKG_NAME) if(FOUND_${PKG_NAME}) # Output success after finding the package for the first time - if(NOT DEFINED USE_${PKG_NAME}) + if(NOT DEFINED USE_${PKG_NAME} AND NOT DISABLE_EVERYTHING) message(STATUS "+ ${DISPLAY_NAME}") endif() - # Add a USE_XYZZY config variable to the cache - set(USE_${PKG_NAME} TRUE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + ### Add a USE_XYZZY config variable to the cache ### + if(ENABLE_EVERYTHING OR DISABLE_EVERYTHING) + unset(USE_${PKG_NAME} CACHE) + endif() + + if(DISABLE_EVERYTHING) + set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + else() + set(USE_${PKG_NAME} TRUE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + endif() + + + # Update HAVE_XYZZY if(USE_${PKG_NAME}) set(HAVE_${PKG_NAME} TRUE PARENT_SCOPE) endif() @@ -71,6 +82,8 @@ function(config_package PKG_NAME) else() # Output failure to find package - message(STATUS "- Did not find ${DISPLAY_NAME}") + if(NOT DISABLE_EVERYTHING) + message(STATUS "- Did not find ${DISPLAY_NAME}") + endif() endif() -endfunction() \ No newline at end of file +endfunction() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index b386d1c620..591f332cd7 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -1,6 +1,16 @@ message(STATUS "") message("Configuring support for the following optional third-party packages:") +set(ENABLE_EVERYTHING Off) +set(DISABLE_EVERYTHING Off) +if(EVERYTHING) + message("Re-enabling all disabled third-party libraries.") + set(ENABLE_EVERYTHING On) +elseif(NOTHING) + message("Disabling all third-party libraries.") + set(DISABLE_EVERYTHING On) +endif() + include(ConfigurePackage) # Find and configure Eigen library From ebddd2292b90331a9f63b41a143e657c4607d3ea Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 00:43:29 -0700 Subject: [PATCH 034/744] CMake: Configure: Remove cruft in ConfigurePackage module. --- cmake/modules/ConfigurePackage.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake index 52793c862c..6bde40e2f9 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/modules/ConfigurePackage.cmake @@ -23,11 +23,7 @@ function(config_package PKG_NAME) # Handle optional function arguments foreach(arg ${ARGN}) - if(ARG_IS_LIBRARY) - unset(ARG_IS_LIBRARY) - set(LIB_NAME ${arg}) - break() - elseif(ARG_IS_COMMENT) + if(ARG_IS_COMMENT) unset(ARG_IS_COMMENT) set(DISPLAY_NAME ${arg}) break() From 31bb550bdaac7509134202373d5d96de744f0e3b Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 00:44:03 -0700 Subject: [PATCH 035/744] CMake: Bugfix: Fix bug where Cg was not set to found properly on first-pass configuration. --- cmake/modules/FindCg.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 082f0f282a..2908199a29 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -62,7 +62,7 @@ macro(find_cggl) # Check if we have everything we need if(CGGL_IPATH AND CGGL_LPATH) - set(CGGL_FOUND TRUE) + set(FOUND_CGGL TRUE) if(WIN32) set(CGGL_LIBS cgGL.lib) else() @@ -169,7 +169,7 @@ else() # Check if we have everything we need if(CG_IPATH AND CG_LPATH) - set(CG_FOUND TRUE) + set(FOUND_CG TRUE) if(WIN32) set(CG_LIBS cg.lib) else() From eb947cc15a2ff2850d7ddfd231e1ed32d292fb5c Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 00:44:59 -0700 Subject: [PATCH 036/744] CMake: Configure: Cleanup the packages which haven't been implemented yet, and other config settings. --- dtool/Configure.cmake | 504 ++++++++++++------------------------------ 1 file changed, 137 insertions(+), 367 deletions(-) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 591f332cd7..555140636b 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -87,396 +87,159 @@ config_package(VRPN) -if(FOUND_ZLIB) - set(USE_ZLIB TRUE CACHE BOOL "If true, compile Panda3D with zlib") - if(USE_ZLIB) - set(HAVE_ZLIB TRUE) - endif() -endif() -if(HAVE_ZLIB) - message(STATUS "+ zlib") -else() - message(STATUS "- Did not find zlib") -endif() +######## +# TODO # +######## -if(FOUND_RAD_MSS) - set(USE_RAD_MSS TRUE CACHE BOOL "If true, compile Panda3D with Miles Sound System") - if(USE_RAD_MSS) - set(HAVE_RAD_MSS TRUE) - endif() -endif() -if(HAVE_RAD_MSS) - message(STATUS "+ Miles Sound System") -else() - message(STATUS "- Did not find Miles Sound System") -endif() +# Find and configure zlib +#find_package(zlib) +#config_package(ZLIB COMMENT "zlib") -if(FOUND_FMODEX) - set(USE_FMODEX TRUE CACHE BOOL "If true, compile Panda3D with FMOD Ex sound library") - if(USE_FMODEX) - set(HAVE_FMODEX TRUE) - endif() -endif() -if(HAVE_FMODEX) - message(STATUS "+ FMOD Ex sound library") -else() - message(STATUS "- Did not find FMOD Ex sound library") -endif() +# Find and configure Miles sound system +#find_package(RAD_MSS) +#config_package(RAD_MSS COMMENT "Miles Sound System") -if(FOUND_OPENAL) - set(USE_OPENAL TRUE CACHE BOOL "If true, compile Panda3D with OpenAL sound library") - if(USE_OPENAL) - set(HAVE_OPENAL TRUE) - endif() -endif() -if(HAVE_OPENAL) - message(STATUS "+ OpenAL sound library") -else() - message(STATUS "- Did not find OpenAL sound library") -endif() +# Find and configure FMOD Ex +#find_package(FMODEX) +#config_package(FMODEX COMMENT "FMOD Ex sound library") -if(FOUND_PHYSX) - set(USE_PHYSX TRUE CACHE BOOL "If true, compile Panda3D with Aegia PhysX") - if(USE_PHYSX) - set(HAVE_PHYSX TRUE) - endif() -endif() -if(HAVE_PHYSX) - message(STATUS "+ Ageia PhysX") -else() - message(STATUS "- Did not find Ageia PhysX") -endif() +# Find and configure OpenAL +#find_package(OpenAL) +#config_package(OPENAL COMMENT "OpenAL sound library") -if(FOUND_SPEEDTREE) - set(USE_SPEEDTREE TRUE CACHE BOOL "If true, compile Panda3D with SpeedTree") - if(USE_SPEEDTREE) - set(HAVE_SPEEDTREE TRUE) - endif() -endif() -if(HAVE_SPEEDTREE) - message(STATUS "+ SpeedTree") -else() - message(STATUS "- Did not find SpeedTree") -endif() +# Find and configure PhysX +#find_package(PhysX) +#config_package(PHYSX COMMENT "Aegia PhysX") -if(FOUND_GTK) - set(USE_GTK TRUE CACHE BOOL "If true, compile Panda3D with gtk+-2") - if(USE_GTK) - set(HAVE_GTK TRUE) - endif() -endif() -if(HAVE_GTK) - message(STATUS "+ gtk+-2") -else() - message(STATUS "- Did not find gtk+-2") -endif() +# Find and configure SpeedTree +#find_package(SpeedTree) +#config_package(SPEEDTREE COMMENT "SpeedTree") -if(FOUND_FREETYPE) - set(USE_FREETYPE TRUE CACHE BOOL "If true, compile Panda3D with Freetype") - if(USE_FREETYPE) - set(HAVE_FREETYPE TRUE) - endif() -endif() -if(HAVE_FREETYPE) - message(STATUS "+ Freetype") -else() - message(STATUS "- Did not find Freetype") -endif() +# Find and configure GTK +#find_package(GTK) +#config_package(GTK COMMENT "gtk+-2") -if(FOUND_WX) - set(USE_WX TRUE CACHE BOOL "If true, compile Panda3D with WxWidgets") - if(USE_WX) - set(HAVE_WX TRUE) - endif() -endif() -if(HAVE_WX) - message(STATUS "+ WxWidgets") -else() - message(STATUS "- Did not find WxWidgets") -endif() +# Find and configure Freetype +#find_package(Freetype) +#config_package(FREETYPE COMMENT "Freetype") -if(FOUND_FLTK) - set(USE_FLTK TRUE CACHE BOOL "If true, compile Panda3D with FLTK") - if(USE_FLTK) - set(HAVE_FLTK TRUE) - endif() -endif() -if(HAVE_FLTK) - message(STATUS "+ FLTK") -else() - message(STATUS "- Did not find FLTK") -endif() +# Find and configure WxWidgets +#find_package(WxWidgets) +#config_package(WX COMMENT "WxWidgets") -if(FOUND_GL) - set(USE_GL TRUE CACHE BOOL "If true, compile Panda3D with OpenGL") - if(USE_GL) - set(HAVE_GL TRUE) - endif() -endif() -if(HAVE_GL) - message(STATUS "+ OpenGL") -else() - message(STATUS "- Did not find OpenGL") -endif() +# Find and configure FLTK +#find_package(FLTK) +#config_package(FLTK) -if(FOUND_GLES) - set(USE_GLES TRUE CACHE BOOL "If true, compile Panda3D with OpenGL ES 1") - if(USE_GLES) - set(HAVE_GLES TRUE) - endif() -endif() -if(HAVE_GLES) - message(STATUS "+ OpenGL ES 1") -else() - message(STATUS "- Did not find OpenGL ES 1") -endif() +# Find and configure OpenGL +#find_package(OpenGL) +#config_package(OPENGL COMMENT "OpenGL") -if(FOUND_GLES2) - set(USE_GLES2 TRUE CACHE BOOL "If true, compile Panda3D with OpenGL ES 2") - if(USE_GLES2) - set(HAVE_GLES2 TRUE) - endif() -endif() -if(HAVE_GLES2) - message(STATUS "+ OpenGL ES 2") -else() - message(STATUS "- Did not find OpenGL ES 2") -endif() +# Find and configure OpenGL ES 1 +#find_package(GLES) +#config_package(GLES COMMENT "OpenGL ES 1") -if(FOUND_DX8) - set(USE_DX8 TRUE CACHE BOOL "If true, compile Panda3D with DirectX8") - if(USE_DX8) - set(HAVE_DX8 TRUE) - endif() -endif() -if(HAVE_DX8) - message(STATUS "+ DirectX8") -else() - message(STATUS "- Did not find DirectX8") -endif() +# Find and configure OpenGL ES 2 +#find_package(GLES) +#config_package(GLES COMMENT "OpenGL ES 2") -if(FOUND_DX9) - set(USE_DX9 TRUE CACHE BOOL "If true, compile Panda3D with DirectX9") - if(USE_DX9) - set(HAVE_DX9 TRUE) - endif() -endif() -if(HAVE_DX9) - message(STATUS "+ DirectX9") -else() - message(STATUS "- Did not find DirectX9") -endif() +# Find and configure DirectX 8 +#find_package(DX8) +#config_package(DX8 COMMENT "DirectX8") -if(FOUND_TINYDISPLAY) - set(USE_TINYDISPLAY TRUE CACHE BOOL "If true, compile Panda3D with Tinydisplay") - if(USE_TINYDISPLAY) - set(HAVE_TINYDISPLAY TRUE) - endif() -endif() -if(HAVE_TINYDISPLAY) - message(STATUS "+ Tinydisplay") -else() - message(STATUS "- Not building Tinydisplay") -endif() +# Find and configure DirectX 9 +#find_package(DX9) +#config_package(DX9 COMMENT "DirectX9") + +# Find and configure DirectX 11 +#find_package(DX11) +#config_package(DX11 COMMENT "DirectX11") + +# Find and configure Tinydisplay +#find_package(Tinydisplay) +#config_package(TINYDISPLAY COMMENT "Tinydisplay") #### Was commented out in original 'Config.pp' not sure why -#if(FOUND_SDL) -# set(USE_SDL TRUE CACHE BOOL "If true, compile Panda3D with SDL") -# if(USE_SDL) -# set(HAVE_SDL TRUE) +# Find and configure SDL +#find_package(SDL) +#config_package(SDL) + +# Find and configure Mesa +#find_package(Mesa) +#config_package(MESA COMMENT "Mesa") + +# Find and configure OpenCV +#find_package(OpenCV) +#config_package(OPENCV COMMENT "OpenCV") + +# Find and configure FFMPEG +#find_package(FFMPEG) +#config_package(FFMPEG) + +# Find and configure ODE +#find_package(ODE) +#config_package(ODE) + +# Find and configure Awesomium +#find_package(Awesomium) +#config_package(AWESOMIUM COMMENT "Awesomium") + +# Find and configure OpenMaya +#find_package(OpenMaya) +#config_package(MAYA COMMENT "OpenMaya") + +# Find and configure FCollada +#find_package(FCollada) +#config_package(FCOLLADA COMMENT "FCollada") +#if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) +# set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") +# if(USE_COLLADA) +# if(FOUND_COLLADA15DOM) +# set(HAVE_COLLADA15DOM TRUE) +# else() +# set(HAVE_COLLADA14DOM TRUE) +# endif() # endif() #endif() -#if(HAVE_SDL) -# message(STATUS "+ SDL") -# else() -# message(STATUS "- Did not find SDL") -# endif() -if(FOUND_X11) - set(USE_X11 TRUE CACHE BOOL "If true, compile Panda3D with X11") - if(USE_X11) - set(HAVE_X11 TRUE) - endif() -endif() -if(HAVE_X11) - message(STATUS "+ X11") -else() - message(STATUS "- Did not find X11") -endif() +# Find and configure Assimp +#find_package(Assimp) +#config_package(ASSIMP COMMENT "Assimp") -if(FOUND_MESA) - set(USE_MESA TRUE CACHE BOOL "If true, compile Panda3D with Mesa") - if(USE_MESA) - set(HAVE_MESA TRUE) - endif() -endif() -if(HAVE_MESA) - message(STATUS "+ Mesa") -else() - message(STATUS "- Did not find Mesa") -endif() +# Find and configure ARToolKit +#find_package(ARToolKit) +#config_package(ARTOOLKIT COMMENT "ARToolKit") -if(FOUND_OPENCV) - set(USE_OPENCV TRUE CACHE BOOL "If true, compile Panda3D with OpenCV") - if(USE_OPENCV) - set(HAVE_OPENCV TRUE) - endif() -endif() -if(HAVE_OPENCV) - message(STATUS "+ OpenCV") -else() - message(STATUS "- Did not find OpenCV") -endif() +# Find and configure libRocket +#find_package(Rocket) +#config_package(ROCKET COMMENT "libRocket") +#if(HAVE_ROCKET) +# # Check for rocket python bindings +# if(FOUND_ROCKET_PYTHON) +# set(USE_ROCKET_PYTHON TRUE CACHE BOOL "If true, compile Panda3D with python bindings for libRocket") +# if(USE_ROCKET_PYTHON) +# set(HAVE_ROCKET_PYTHON TRUE) +# endif() +# endif() +# if(HAVE_ROCKET_PYTHON) +# message(STATUS "+ libRocket with Python bindings") +# else() +# message(STATUS "+ libRocket without Python bindings") +# endif() +#endif() -if(FOUND_FFMPEG) - set(USE_FFMPEG TRUE CACHE BOOL "If true, compile Panda3D with FFMPEG") - if(USE_FFMPEG) - set(HAVE_FFMPEG TRUE) - endif() -endif() -if(HAVE_FFMPEG) - message(STATUS "+ FFMPEG") -else() - message(STATUS "- Did not find FFMPEG") -endif() +# Find and configure Bullet +#find_package(Bullet) +#config_package(BULLET COMMENT "Bullet Physics") -if(FOUND_ODE) - set(USE_ODE TRUE CACHE BOOL "If true, compile Panda3D with ODE") - if(USE_ODE) - set(HAVE_ODE TRUE) - endif() -endif() -if(HAVE_ODE) - message(STATUS "+ ODE") -else() - message(STATUS "- Did not find ODE") -endif() +# Find and configure Vorbis +#find_package(Vorbis) +#config_package(VORBIS COMMENT "Vorbis Ogg decoder") -if(FOUND_AWESOMIUM) - set(USE_AWESOMIUM TRUE CACHE BOOL "If true, compile Panda3D with AWESOMIUM") - if(USE_AWESOMIUM) - set(HAVE_AWESOMIUM TRUE) - endif() -endif() -if(HAVE_AWESOMIUM) - message(STATUS "+ AWESOMIUM") -else() - message(STATUS "- Did not find AWESOMIUM") -endif() -if(FOUND_MAYA) - set(USE_MAYA TRUE CACHE BOOL "If true, compile Panda3D with OpenMaya") - if(USE_MAYA) - set(HAVE_MAYA TRUE) - endif() -endif() -if(HAVE_MAYA) - message(STATUS "+ OpenMaya") -else() - message(STATUS "- Did not find OpenMaya") -endif() - -if(FOUND_FCOLLADA) - set(USE_FCOLLADA TRUE CACHE BOOL "If true, compile Panda3D with FCollada") - if(USE_FCOLLADA) - set(HAVE_FCOLLADA TRUE) - endif() -endif() -if(HAVE_FCOLLADA) - message(STATUS "+ FCollada") -else() - message(STATUS "- Did not find FCollada") -endif() - -if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) - set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") - if(USE_COLLADA) - if(FOUND_COLLADA15DOM) - set(HAVE_COLLADA15DOM TRUE) - else() - set(HAVE_COLLADA14DOM TRUE) - endif() - endif() -endif() -if(HAVE_COLLADA14DOM OR HAVE_COLLADA15DOM) - message(STATUS "+ COLLADA DOM") -else() - message(STATUS "- Did not find COLLADA DOM") -endif() - -if(FOUND_ASSIMP) - set(USE_ASSIMP TRUE CACHE BOOL "If true, compile Panda3D with Assimp") - if(USE_ASSIMP) - set(HAVE_ASSIMP TRUE) - endif() -endif() -if(HAVE_ASSIMP) - message(STATUS "+ Assimp") -else() - message(STATUS "- Did not find Assimp") -endif() - -if(FOUND_ARTOOLKIT) - set(USE_ARTOOLKIT TRUE CACHE BOOL "If true, compile Panda3D with ARToolKit") - if(USE_ARTOOLKIT) - set(HAVE_ARTOOLKIT TRUE) - endif() -endif() -if(HAVE_ARTOOLKIT) - message(STATUS "+ ARToolKit") -else() - message(STATUS "- Did not find ARToolKit") -endif() - -if(FOUND_ROCKET) - set(USE_ROCKET TRUE CACHE BOOL "If true, compile Panda3D with libRocket") - if(USE_ROCKET) - set(HAVE_ROCKET TRUE) - endif() -endif() -if(HAVE_ROCKET) - # Check for rocket python bindings - if(FOUND_ROCKET_PYTHON) - set(USE_ROCKET_PYTHON TRUE CACHE BOOL "If true, compile Panda3D with python bindings for libRocket") - if(USE_ROCKET_PYTHON) - set(HAVE_ROCKET_PYTHON TRUE) - endif() - endif() - if(HAVE_ROCKET_PYTHON) - message(STATUS "+ libRocket with Python bindings") - else() - message(STATUS "+ libRocket without Python bindings") - endif() -else() - message(STATUS "- Did not find libRocket") -endif() - -if(FOUND_BULLET) - set(USE_BULLET TRUE CACHE BOOL "If true, compile Panda3D with Bullet Physics") - if(USE_BULLET) - set(HAVE_BULLET TRUE) - endif() -endif() -if(HAVE_BULLET) - message(STATUS "+ Bullet Physics") -else() - message(STATUS "- Did not find Bullet Physics") -endif() - -if(FOUND_VORBIS) - set(USE_VORBIS TRUE CACHE BOOL "If true, compile Panda3D with libvorbis") - if(USE_VORBIS) - set(HAVE_VORBIS TRUE) - endif() -endif() -if(HAVE_VORBIS) - message(STATUS "+ libvorbis (Ogg Vorbis Decoder)") -else() - message(STATUS "- Did not find libvorbis (Ogg Vorbis Decoder)") -endif() message(STATUS "") # simple line break -if(FOUND_INTERROGATE AND HAVE_PYTHON) +if(HAVE_PYTHON) set(USE_INTERROGATE TRUE CACHE BOOL "If true, Panda3D will generate python interfaces") if(USE_INTERROGATE) set(HAVE_INTERROGATE TRUE) @@ -488,16 +251,22 @@ else() message(STATUS "Configuring Panda without Python interfaces.") endif() -if(FOUND_THREADS) - set(USE_THREADS TRUE CACHE BOOL "If true, compile Panda3D with threading support.") - if(USE_THREADS) - set(HAVE_THREADS TRUE) - endif() + +set(USE_THREADS TRUE CACHE BOOL "If true, compile Panda3D with threading support.") +if(USE_THREADS) + set(HAVE_THREADS TRUE) +else() + unset(SIMPLE_THREADS CACHE) + unset(DO_PIPELINING CACHE) endif() + if(HAVE_THREADS) + set(SIMPLE_THREADS FALSE CACHE BOOL "If true, compile with simulated threads.") if(SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") + unset(DO_PIPELINING CACHE) else() + set(DO_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined threads.") if(DO_PIPELINING) message(STATUS "Compilation will include full, pipelined threading support.") else() @@ -509,6 +278,7 @@ else() endif() if(OSX_PLATFORM) + set(UNIVERSIAL_BINARIES TRUE CACHE BOOL "If true, compiling will create universal OS X binaries.") if(UNIVERSAL_BINARIES) message(STATUS "Compilation will create universal binaries.") else() From 054cafeac877b2bd25412aee59243b31cbf4de55 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 01:10:36 -0700 Subject: [PATCH 037/744] CMake: Configure: Add threading support. --- dtool/Configure.cmake | 48 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 555140636b..e1404e3f14 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -237,7 +237,7 @@ config_package(VRPN) #config_package(VORBIS COMMENT "Vorbis Ogg decoder") - +### Configure interrogate ### message(STATUS "") # simple line break if(HAVE_PYTHON) set(USE_INTERROGATE TRUE CACHE BOOL "If true, Panda3D will generate python interfaces") @@ -252,21 +252,33 @@ else() endif() +### Configure threading support ### +# Add basic use flag for threading set(USE_THREADS TRUE CACHE BOOL "If true, compile Panda3D with threading support.") if(USE_THREADS) set(HAVE_THREADS TRUE) else() unset(SIMPLE_THREADS CACHE) - unset(DO_PIPELINING CACHE) + unset(OS_SIMPLE_THREADS CACHE) endif() +# Configure debug threads +if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 3) + set(DEBUG_THREADS ON CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") +else() + set(DEBUG_THREADS OFF CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") +endif() + +# Add advanced threading configuration if(HAVE_THREADS) set(SIMPLE_THREADS FALSE CACHE BOOL "If true, compile with simulated threads.") if(SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") - unset(DO_PIPELINING CACHE) + set(OS_SIMPLE_THREADS TRUE CACHE BOOL "If true, OS threading constructs will be used to perform context switches.") else() - set(DO_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined threads.") + unset(OS_SIMPLE_THREADS CACHE) + + set(DO_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") if(DO_PIPELINING) message(STATUS "Compilation will include full, pipelined threading support.") else() @@ -277,6 +289,34 @@ else() message(STATUS "Configuring Panda without threading support.") endif() +set(HAVE_POSIX_THREADS FALSE) +if(NOT WIN32) + find_path(PTHREAD_IPATH + NAMES "pthread.h" + PATHS "/usr/include" + ) + if(PTHREAD_IPATH) + set(HAVE_POSIX_THREADS TRUE) + set(THREAD_LIBS pthread) + set(CMAKE_CXX_FLAGS "-pthread") + set(CMAKE_CXX_FLAGS_DEBUG "-pthread") + set(CMAKE_CXX_FLAGS_RELEASE "-pthread") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") + set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") + endif() +endif() + + +### Configure pipelining ### +if(NOT DEFINED DO_PIPELINING) + if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2) + set(DO_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") + else() + set(DO_PIPELINING FALSE CACHE BOOL "If true, compile with pipelined rendering.") + endif() +endif() + +### Configure OS X options ### if(OSX_PLATFORM) set(UNIVERSIAL_BINARIES TRUE CACHE BOOL "If true, compiling will create universal OS X binaries.") if(UNIVERSAL_BINARIES) From 6d8ba55bedb868d842bb8b77f7284c26b6b23864 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 02:02:56 -0700 Subject: [PATCH 038/744] CMake: Configure: Add zlib support. --- cmake/modules/FindCg.cmake | 1 + cmake/modules/MangleZLIB.cmake | 37 ++++++++++++++++++++++++++++++++++ dtool/Configure.cmake | 9 +++++---- 3 files changed, 43 insertions(+), 4 deletions(-) create mode 100644 cmake/modules/MangleZLIB.cmake diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 2908199a29..2a1c82a940 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -1,4 +1,5 @@ # Filename: FindCg.cmake +# Author: kestred (8 Dec, 2013) # # Usage: # find_package(Cg [REQUIRED] [QUIET]) diff --git a/cmake/modules/MangleZLIB.cmake b/cmake/modules/MangleZLIB.cmake new file mode 100644 index 0000000000..7ba15f09ce --- /dev/null +++ b/cmake/modules/MangleZLIB.cmake @@ -0,0 +1,37 @@ +# Filename: MangleZLIB.cmake +# Author: kestred (9 Dec, 2013) +# +# MangleZLIB replaces the output variables of the builtin FindZLIB +# with vars matching Panda3D's existing config-var names. +# + +if(ZLIB_FOUND) + set(FOUND_ZLIB TRUE) + set(ZLIB_LIBS ZLIB) + + list(GET ZLIB_INCLUDE_DIRS 0 ZLIB_INCLUDE_DIR) + list(GET ZLIB_LIBRARIES 0 ZLIB_LIBRARY) + get_filename_component(ZLIB_LIBRARY_DIR "${ZLIB_LIBRARY}" PATH) + + set(ZLIB_IPATH "${ZLIB_INCLUDE_DIR}" CACHE PATH "The path to zlibs's include directory.") # Include path + set(ZLIB_LPATH "${ZLIB_LIBRARY_DIR}" CACHE PATH "The path to zlibs's library directory.") # Library path + mark_as_advanced(ZLIB_IPATH) + mark_as_advanced(ZLIB_LPATH) + + set(ZLIB_VERSION ${ZLIB_VERSION_STRING}) + + unset(ZLIB_FOUND) + unset(ZLIB_VERSION_STRING) + unset(ZLIB_VERSION_MAJOR) + unset(ZLIB_VERSION_MINOR) + unset(ZLIB_VERSION_PATCH) + unset(ZLIB_VERSION_TWEAK) + unset(ZLIB_MAJOR_VERSION) + unset(ZLIB_MINOR_VERSION) + unset(ZLIB_OATCH_VERSION) +endif() + +unset(ZLIB_LIBRARY CACHE) +unset(ZLIB_LIBRARIES CACHE) +unset(ZLIB_INCLUDE_DIR CACHE) +unset(ZLIB_INCLUDE_DIRS CACHE) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index e1404e3f14..5d4b24eb87 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -84,6 +84,11 @@ config_package(CGDX10 COMMENT "Cg DX10 API") find_package(VRPN) config_package(VRPN) +# Find and configure zlib +find_package(ZLIB) +mangle_package(ZLIB) +config_package(ZLIB COMMENT "zlib") + @@ -91,10 +96,6 @@ config_package(VRPN) # TODO # ######## -# Find and configure zlib -#find_package(zlib) -#config_package(ZLIB COMMENT "zlib") - # Find and configure Miles sound system #find_package(RAD_MSS) #config_package(RAD_MSS COMMENT "Miles Sound System") From 9790c6f5046093e45a6c4c8124c62df71bdcad40 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 02:23:44 -0700 Subject: [PATCH 039/744] CMake: Configure: Nominally support Miles Sound System. Can't actually test it, because I don't own it. --- cmake/modules/FindMiles.cmake | 105 +++++++++++++++++++++++++++++++++ cmake/modules/MangleZLIB.cmake | 2 +- dtool/Configure.cmake | 6 +- 3 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 cmake/modules/FindMiles.cmake diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake new file mode 100644 index 0000000000..6f907fe06b --- /dev/null +++ b/cmake/modules/FindMiles.cmake @@ -0,0 +1,105 @@ +# Filename: FindMiles.cmake +# Author: kestred (9 Dec, 2013) +# +# Usage: +# 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 +# + +if(RAD_MSS_IPATH AND RAD_MSS_LPATH) + set(FOUND_RAD_MSS TRUE) + set(RAD_MSS_LIBS Mss32) + + 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) + 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) + 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) + elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND RAD_MSS_DEBUG_LIBRARY) + unset(RAD_MSS_LPATH) + get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_DEBUG_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_path(RAD_MSS_IPATH + NAMES "miles.h" + PATHS "/usr/include" + "/usr/local/include" + "/opt/miles/include" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + PATH_SUFFIXES "" "miles" + DOC "The path to the Miles SDK include directory." + ) + + # Find the Miles SDK libraries (.a, .so) + find_library(RAD_MSS_RELEASE_LIBRARY + NAMES "miles" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + PATH_SUFFIXES "lib" "lib32" + ) + find_library(RAD_MSS_MINSIZE_LIBRARY + NAMES "miles_s" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + PATH_SUFFIXES "lib" "lib32" + ) + find_library(RAD_MSS_RELWITHDEBINFO_LIBRARY + NAMES "miles_rd" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + PATH_SUFFIXES "lib" "lib32" + ) + find_library(RAD_MSS_DEBUG_LIBRARY + NAMES "miles_d" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + PATH_SUFFIXES "lib" "lib32" + ) + 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.") + + # Check if we have everything we need + if(RAD_MSS_IPATH AND RAD_MSS_LPATH) + set(FOUND_RAD_MSS TRUE) + set(RAD_MSS_LIBS Mss32) + endif() + + unset(RAD_MSS_LIBRARY_DIR) + mark_as_advanced(RAD_MSS_IPATH) + mark_as_advanced(RAD_MSS_LPATH) + mark_as_advanced(RAD_MSS_DEBUG_LIBRARY) + mark_as_advanced(RAD_MSS_RELEASE_LIBRARY) + mark_as_advanced(RAD_MSS_RELWITHDEBINFO_LIBRARY) + mark_as_advanced(RAD_MSS_MINSIZE_LIBRARY) +endif() diff --git a/cmake/modules/MangleZLIB.cmake b/cmake/modules/MangleZLIB.cmake index 7ba15f09ce..8222b936a1 100644 --- a/cmake/modules/MangleZLIB.cmake +++ b/cmake/modules/MangleZLIB.cmake @@ -7,7 +7,7 @@ if(ZLIB_FOUND) set(FOUND_ZLIB TRUE) - set(ZLIB_LIBS ZLIB) + set(ZLIB_LIBS z) list(GET ZLIB_INCLUDE_DIRS 0 ZLIB_INCLUDE_DIR) list(GET ZLIB_LIBRARIES 0 ZLIB_LIBRARY) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 5d4b24eb87..4a34453108 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -96,9 +96,9 @@ config_package(ZLIB COMMENT "zlib") # TODO # ######## -# Find and configure Miles sound system -#find_package(RAD_MSS) -#config_package(RAD_MSS COMMENT "Miles Sound System") +# Find and configure Miles Sound System +find_package(Miles) +config_package(RAD_MSS COMMENT "Miles Sound System") # Find and configure FMOD Ex #find_package(FMODEX) From b4e19226fd306b6d540ce31b6a96927822e262a3 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 02:25:58 -0700 Subject: [PATCH 040/744] CMake: Add a ToDo list for things that prone to being accidently forgotten. --- cmake/TODO | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 cmake/TODO diff --git a/cmake/TODO b/cmake/TODO new file mode 100644 index 0000000000..d612816b78 --- /dev/null +++ b/cmake/TODO @@ -0,0 +1,4 @@ +# List of things which may appear done but actually still need work! +Test Miles Sound System support +Add DirectX support for Nvidia Cg + From 55089fda95d006ea9da0b1e8c4c2d2fb75d650c7 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 03:30:49 -0700 Subject: [PATCH 041/744] CMake: Configure: Add FMOD Ex support. --- cmake/modules/FindFMODEx.cmake | 96 ++++++++++++++++++++++++++++++++++ dtool/Configure.cmake | 18 +++---- 2 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 cmake/modules/FindFMODEx.cmake diff --git a/cmake/modules/FindFMODEx.cmake b/cmake/modules/FindFMODEx.cmake new file mode 100644 index 0000000000..ce624e41bf --- /dev/null +++ b/cmake/modules/FindFMODEx.cmake @@ -0,0 +1,96 @@ +# Filename: FindFMODEx.cmake +# Author: kestred (8 Dec, 2013) +# +# Usage: +# find_package(FMODEx [REQUIRED] [QUIET]) +# +# It sets the following variables: +# FOUND_FMODEX - system has FMOD Ex +# FMODEX_IPATH - the FMOD Ex include directory +# FMODEX_LPATH - the FMOD Ex library directory +# FMODEX_LIBS - the FMOD Ex components found +# + +if(FMODEX_LPATH AND FMODEX_IPATH) + # 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_path(FMODEX_IPATH + NAMES "fmod.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + "/opt/fmodex/include" + "/opt/fmodex/api/inc" + "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/inc" + PATH_SUFFIXES "" "fmodex/fmod" "fmodex/fmod3" "fmod" "fmod3" + DOC "The path to FMOD Ex's include directory." + ) + + # Find the 32-bit library + find_library(FMODEX_32_LIBRARY + NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" + PATHS "/usr" + "/usr/local" + "/usr/X11R6" + "/usr/local/X11R6" + "/sw" + "/opt" + "/opt/local" + "/opt/csw" + "/opt/fmodex" + "/opt/fmodex/api" + "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/lib" + PATH_SUFFIXES "" "lib" "lib32" + ) + + # Find the 64-bit library + find_library(FMODEX_64_LIBRARY + NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" + PATHS "/usr" + "/usr/local" + "/usr/X11R6" + "/usr/local/X11R6" + "/sw" + "/opt" + "/opt/local" + "/opt/csw" + "/opt/fmodex" + "/opt/fmodex/api" + "/usr/freeware" + PATH_SUFFIXES "" "lib" "lib64" + ) + + if(FMODEX_32_LIBRARY) + set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY}) + set(FMODEX_LIBS fmodex) + elseif(FMODEX_64_LIBRARY) + set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY}) + set(FMODEX_LIBS fmodex64) + endif() + + 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.") + + # Check if we have everything we need + if(FMODEX_IPATH AND FMODEX_LPATH) + set(FOUND_FMODEX TRUE) + endif() + + mark_as_advanced(FMODEX_IPATH) + mark_as_advanced(FMODEX_LPATH) + mark_as_advanced(FMODEX_32_LIBRARY) + mark_as_advanced(FMODEX_64_LIBRARY) + unset(FMODEX_LIBRARY_DIR) + unset(FMODEX_LIBRARY CACHE) +endif() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 4a34453108..d5f7410a33 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -85,24 +85,22 @@ find_package(VRPN) config_package(VRPN) # Find and configure zlib -find_package(ZLIB) +find_package(ZLIB QUIET COMPONENTS z) mangle_package(ZLIB) config_package(ZLIB COMMENT "zlib") - - - -######## -# TODO # -######## - # Find and configure Miles Sound System find_package(Miles) config_package(RAD_MSS COMMENT "Miles Sound System") # Find and configure FMOD Ex -#find_package(FMODEX) -#config_package(FMODEX COMMENT "FMOD Ex sound library") +find_package(FMODEx) +config_package(FMODEX COMMENT "FMOD Ex sound library") + + +######## +# TODO # +######## # Find and configure OpenAL #find_package(OpenAL) From 204d88f1e15ec204dfca097dba7b6b8a2fa4096a Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 09:46:46 -0700 Subject: [PATCH 042/744] CMake: Configure: Improve Miles Sound System detection. --- cmake/modules/FindMiles.cmake | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake index 6f907fe06b..afc8425cc5 100644 --- a/cmake/modules/FindMiles.cmake +++ b/cmake/modules/FindMiles.cmake @@ -42,10 +42,10 @@ else() NAMES "miles.h" PATHS "/usr/include" "/usr/local/include" - "/opt/miles/include" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - PATH_SUFFIXES "" "miles" + "/opt/" + "C:/Program Files" + "C:/Program Files (x86)" + PATH_SUFFIXES "" "miles" "Miles6" "miles/include" "Miles6/include" DOC "The path to the Miles SDK include directory." ) @@ -55,8 +55,11 @@ else() PATHS "/usr" "/usr/local" "/opt/miles" + "/opt/Miles6" "C:/Program Files/miles" "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) find_library(RAD_MSS_MINSIZE_LIBRARY @@ -66,6 +69,8 @@ else() "/opt/miles" "C:/Program Files/miles" "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) find_library(RAD_MSS_RELWITHDEBINFO_LIBRARY @@ -75,6 +80,8 @@ else() "/opt/miles" "C:/Program Files/miles" "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) find_library(RAD_MSS_DEBUG_LIBRARY @@ -84,6 +91,8 @@ else() "/opt/miles" "C:/Program Files/miles" "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) get_filename_component(RAD_MSS_LIBRARY_DIR "${RAD_MSS_RELEASE_LIBRARY}" PATH) From 4ac236367317dd413276abee963327735a5975af Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 11:40:25 -0700 Subject: [PATCH 043/744] CMake: Configure: Add a "DISCOVERED" option to configure. --- cmake/README.md | 24 ++++++++++++++++++++++++ cmake/modules/ConfigurePackage.cmake | 27 +++++++++++++++++++++------ dtool/Configure.cmake | 17 +++++++++++++---- 3 files changed, 58 insertions(+), 10 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index abbad32fa4..beffdb5749 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -20,6 +20,26 @@ To configure CMake, it is recommended to use cmake-gui (`cmake-gui .`), however it is also possible to configure it entirely through CMake's command-line interface; see `man cmake` for more details. +In general, the config variable for a particular third party library is: +``` + USE_=True/False # Example: USE_JPEG +``` +Optional features typically use the format: +``` + BUILD_=True/False # Example: BUILD_THREADS +``` +Configuration settings use more direct names: +``` + # Examples + PANDA_DISTRIBUTOR="MyDistributor" + DTOOL_INSTALL="/usr/local/panda" + + # ... etc ... + +``` + +For example, `makepanda.py --distributor X` becomes `cmake -DDISTRIBUTOR + All third-party libraries are enabled by default and Panda3D will be compiled with any 3rd party library that is found. Third-party libraries can be enabled or disabled through @@ -32,3 +52,7 @@ cmake -DEVERYTHING=True . # or .. if you are in a separate build/ dir cmake -DNOTHING=True . # or .. if you are in a separate build/ dir ``` +To use all available packages, and silence output for missing packages, run: +```sh +cmake- DDISCOVERED=True . # or .. if you are in a separate build/ dir +``` diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake index 6bde40e2f9..2c9767b9bf 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/modules/ConfigurePackage.cmake @@ -8,6 +8,12 @@ # # Assumes the file has already been found with find_package(). # +# The following variables can be set to override the cached values of USE_XYZZY +# CONFIG_DISABLE_EVERYTHING - always set USE_XYZZY to false +# CONFIG_DISABLE_MISSING - set USE_XYZZY to false if it was not found +# CONFIG_ENABLE_FOUND - set USE_XYZZY to true if the package was found +# CONFIG_ENABLE_EVERYTHING - always set USE_XYZZY to true (even if the package is missing) +# # Usage: # mangle_package(LIBRARY_NAME) @@ -44,16 +50,16 @@ function(config_package PKG_NAME) if(FOUND_${PKG_NAME}) # Output success after finding the package for the first time - if(NOT DEFINED USE_${PKG_NAME} AND NOT DISABLE_EVERYTHING) + if(NOT DEFINED USE_${PKG_NAME} AND NOT CONFIG_DISABLE_EVERYTHING) message(STATUS "+ ${DISPLAY_NAME}") endif() ### Add a USE_XYZZY config variable to the cache ### - if(ENABLE_EVERYTHING OR DISABLE_EVERYTHING) + if(CONFIG_ENABLE_EVERYTHING OR CONFIG_DISABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) unset(USE_${PKG_NAME} CACHE) endif() - if(DISABLE_EVERYTHING) + if(CONFIG_DISABLE_EVERYTHING) set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") else() set(USE_${PKG_NAME} TRUE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") @@ -73,12 +79,21 @@ function(config_package PKG_NAME) # Only unset if USE_XYZZY is true; # This allows us to set USE_XYZZY to false to silence the output - unset(USE_${PKG_NAME}) + unset(USE_${PKG_NAME} CACHE) + + # If using Discovery, we want to silently disable missing packages + if(CONFIG_DISABLE_MISSING) + set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + endif() endif() else() - # Output failure to find package - if(NOT DISABLE_EVERYTHING) + # If using DISCOVERED NOTHING, we want to silently disable missing packages + if(CONFIG_DISABLE_MISSING OR CONFIG_DISABLE_EVERYTHING) + set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + + else() + # Otherwise, output failure to find package message(STATUS "- Did not find ${DISPLAY_NAME}") endif() endif() diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index d5f7410a33..7cc1f5c393 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -1,14 +1,23 @@ message(STATUS "") message("Configuring support for the following optional third-party packages:") -set(ENABLE_EVERYTHING Off) -set(DISABLE_EVERYTHING Off) +# Settings to change USE_PACKAGE behavior (these options override cached values) +set(CONFIG_ENABLE_EVERYTHING Off) +set(CONFIG_DISABLE_EVERYTHING Off) +set(CONFIG_ENABLE_FOUND Off) +set(CONFIG_DISABLE_MISSING Off) + +# Update USE_PACKAGE settings based on CLI arguments if(EVERYTHING) message("Re-enabling all disabled third-party libraries.") - set(ENABLE_EVERYTHING On) + set(CONFIG_ENABLE_EVERYTHING On) +elseif(DISCOVERED) + message("Enabling found and disabling not-found third-party libraries.") + set(CONFIG_ENABLE_FOUND On) + set(CONFIG_DISABLE_MISSING On) elseif(NOTHING) message("Disabling all third-party libraries.") - set(DISABLE_EVERYTHING On) + set(CONFIG_DISABLE_EVERYTHING On) endif() include(ConfigurePackage) From aaff5b9c4f138985e7cd79d082b5f85c8833ffb6 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 12:22:54 -0700 Subject: [PATCH 044/744] CMake: Configure: Add OpenAL support. Typo fix in CMake README.md. --- cmake/README.md | 2 +- dtool/Configure.cmake | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index beffdb5749..203a8753fc 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -54,5 +54,5 @@ cmake -DNOTHING=True . # or .. if you are in a separate build/ dir To use all available packages, and silence output for missing packages, run: ```sh -cmake- DDISCOVERED=True . # or .. if you are in a separate build/ dir +cmake -DDISCOVERED=True . # or .. if you are in a separate build/ dir ``` diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 7cc1f5c393..e7cf021f24 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -106,14 +106,15 @@ config_package(RAD_MSS COMMENT "Miles Sound System") find_package(FMODEx) config_package(FMODEX COMMENT "FMOD Ex sound library") +# Find and configure OpenAL +find_package(OpenAL QUIET) +mangle_package(OpenAL) +config_package(OPENAL COMMENT "OpenAL sound library") ######## # TODO # ######## -# Find and configure OpenAL -#find_package(OpenAL) -#config_package(OPENAL COMMENT "OpenAL sound library") # Find and configure PhysX #find_package(PhysX) From a6162615d7a83525ec20970f6d4b7d9d3e016621 Mon Sep 17 00:00:00 2001 From: kestred Date: Mon, 9 Dec 2013 22:25:30 -0700 Subject: [PATCH 045/744] CMake: Configure: Add forgotten Mangle module. --- cmake/modules/MangleOpenAL.cmake | 30 ++++++++++++++++++++++++++++++ dtool/Configure.cmake | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/MangleOpenAL.cmake diff --git a/cmake/modules/MangleOpenAL.cmake b/cmake/modules/MangleOpenAL.cmake new file mode 100644 index 0000000000..dc8c4de12a --- /dev/null +++ b/cmake/modules/MangleOpenAL.cmake @@ -0,0 +1,30 @@ +# Filename: MangleOpenAL.cmake +# Author: kestred (28 Nov, 2013) +# +# MangleOpenAL replaces the output variables of the builtin FindOpenAL +# with vars matching Panda3D's existing config-var names. +# + +if(OPENAL_FOUND) + set(FOUND_OPENAL TRUE) + if(APPLE) + set(OPENAL_FRAMEWORK OpenAL) + else() + set(OPENAL_LIBS openal) + endif() + + get_filename_component(OPENAL_LIBRARY_DIR "${OPENAL_LIBRARY}" PATH) + + set(OPENAL_IPATH "${OPENAL_INCLUDE_DIR}" CACHE PATH "The path to OpenAL's include directory.") # Include path + set(OPENAL_LPATH "${OPENAL_LIBRARY_DIR}" CACHE PATH "The path to OpenAL's library directory.") # Library path + mark_as_advanced(OPENAL_IPATH) + mark_as_advanced(OPENAL_LPATH) + + set(OPENAL_VERSION ${OPENAL_VERSION_STRING}) + + unset(OPENAL_FOUND) + unset(OPENAL_LIBRARY_DIR) +endif() + +unset(OPENAL_LIBRARY CACHE) +unset(OPENAL_INCLUDE_DIR CACHE) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index e7cf021f24..9dbb4a005f 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -111,11 +111,11 @@ find_package(OpenAL QUIET) mangle_package(OpenAL) config_package(OPENAL COMMENT "OpenAL sound library") + ######## # TODO # ######## - # Find and configure PhysX #find_package(PhysX) #config_package(PHYSX COMMENT "Aegia PhysX") From 150624b27deee10adf9fc29d5f99b0fcb0ee010e Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 11 Dec 2013 10:53:39 -0700 Subject: [PATCH 046/744] Add GTK2 support. --- cmake/modules/MangleGTK2.cmake | 31 +++++++++++++++++++++++++++++++ dtool/Configure.cmake | 10 ++++++---- 2 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 cmake/modules/MangleGTK2.cmake diff --git a/cmake/modules/MangleGTK2.cmake b/cmake/modules/MangleGTK2.cmake new file mode 100644 index 0000000000..f48bb62022 --- /dev/null +++ b/cmake/modules/MangleGTK2.cmake @@ -0,0 +1,31 @@ +# Filename: MangleOpenAL.cmake +# Author: kestred (28 Nov, 2013) +# +# MangleOpenAL replaces the output variables of the builtin FindOpenAL +# 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) + + unset(GTK2_FOUND) + 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) \ No newline at end of file diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 9dbb4a005f..d4d172487f 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -111,6 +111,12 @@ find_package(OpenAL QUIET) mangle_package(OpenAL) config_package(OPENAL COMMENT "OpenAL sound library") +# Find and configure GTK +find_package(GTK2 QUIET) +mangle_package(GTK2) +config_package(GTK COMMENT "gtk+-2") + + ######## # TODO # @@ -124,10 +130,6 @@ config_package(OPENAL COMMENT "OpenAL sound library") #find_package(SpeedTree) #config_package(SPEEDTREE COMMENT "SpeedTree") -# Find and configure GTK -#find_package(GTK) -#config_package(GTK COMMENT "gtk+-2") - # Find and configure Freetype #find_package(Freetype) #config_package(FREETYPE COMMENT "Freetype") From ee06025d439f892c6d21278e99a843426d9f6e00 Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 11 Dec 2013 11:00:43 -0700 Subject: [PATCH 047/744] CMake: Configure: Add Freetype support. --- cmake/modules/MangleFreetype.cmake | 32 ++++++++++++++++++++++++++++++ cmake/modules/MangleGTK2.cmake | 7 ++++--- dtool/Configure.cmake | 7 ++++--- 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 cmake/modules/MangleFreetype.cmake diff --git a/cmake/modules/MangleFreetype.cmake b/cmake/modules/MangleFreetype.cmake new file mode 100644 index 0000000000..8c3ca5a5b0 --- /dev/null +++ b/cmake/modules/MangleFreetype.cmake @@ -0,0 +1,32 @@ +# Filename: MangleFREETYPE.cmake +# Author: kestred (11 Dec, 2013) +# +# MangleFREETYPE replaces the output variables of the builtin FindFREETYPE +# with vars matching Panda3D's existing config-var names. +# + +if(FREETYPE_FOUND) + set(FOUND_FREETYPE TRUE) + + list(GET FREETYPE_INCLUDE_DIRS 0 FREETYPE_INCLUDE_DIR) + + get_filename_component(FREETYPE_LIBRARY_DIR "${FREETYPE_LIBRARY}" PATH) + + set(FREETYPE_IPATH "${FREETYPE_INCLUDE_DIR}" CACHE PATH "The path to Freetype's include directory.") # Include path + set(FREETYPE_LPATH "${FREETYPE_LIBRARY_DIR}" CACHE PATH "The path to Freetype's library directory.") # Library path + mark_as_advanced(FREETYPE_IPATH) + mark_as_advanced(FREETYPE_LPATH) + + 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) \ No newline at end of file diff --git a/cmake/modules/MangleGTK2.cmake b/cmake/modules/MangleGTK2.cmake index f48bb62022..672c787e5c 100644 --- a/cmake/modules/MangleGTK2.cmake +++ b/cmake/modules/MangleGTK2.cmake @@ -1,7 +1,7 @@ -# Filename: MangleOpenAL.cmake -# Author: kestred (28 Nov, 2013) +# Filename: MangleGTK2.cmake +# Author: kestred (11 Dec, 2013) # -# MangleOpenAL replaces the output variables of the builtin FindOpenAL +# MangleGTK2 replaces the output variables of the builtin FindGTK2 # with vars matching Panda3D's existing config-var names. # @@ -19,6 +19,7 @@ if(GTK2_FOUND) mark_as_advanced(GTK_LPATH) unset(GTK2_FOUND) + unset(GTK2_LIBRARY) unset(GTK2_INCLUDE_DIR) unset(GTK2_LIBRARY_DIR) unset(GTK2_MAJOR_VERSION) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index d4d172487f..a3d46e1f77 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -116,6 +116,10 @@ find_package(GTK2 QUIET) mangle_package(GTK2) config_package(GTK COMMENT "gtk+-2") +# Find and configure Freetype +find_package(Freetype) +mangle_package(Freetype) +config_package(FREETYPE COMMENT "Freetype") ######## @@ -130,9 +134,6 @@ config_package(GTK COMMENT "gtk+-2") #find_package(SpeedTree) #config_package(SPEEDTREE COMMENT "SpeedTree") -# Find and configure Freetype -#find_package(Freetype) -#config_package(FREETYPE COMMENT "Freetype") # Find and configure WxWidgets #find_package(WxWidgets) From bd5ade1fb7280f1b780649255d4fbf4f7a2ed36a Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 11 Dec 2013 11:03:43 -0700 Subject: [PATCH 048/744] CMake: Configure: Add missing CMake variable for freetype. --- dtool/Configure.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index a3d46e1f77..fd533b5b61 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -120,6 +120,9 @@ config_package(GTK COMMENT "gtk+-2") find_package(Freetype) mangle_package(Freetype) config_package(FREETYPE COMMENT "Freetype") +if(HAVE_FREETYPE AND NOT WIN32) + set(FREETYPE_CONFIG freetype-config) +endif() ######## From ca041ae6d5999a23a4c9fdf93bfb7974b23e99f8 Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 11 Dec 2013 11:19:58 -0700 Subject: [PATCH 049/744] CMake: Configure: Use BUILD_ for CMake cache when configuring Panda features. --- dtool/Configure.cmake | 78 ++++++++++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 23 deletions(-) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index fd533b5b61..ffda2df616 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -32,12 +32,23 @@ if(HAVE_EIGEN) set(EIGEN_CFLAGS "-msse2") endif() - if(NOT DEFINED LINMATH_ALIGN) + if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) + unset(BUILD_EIGEN_VECTORIZATION) + elseif(CONFIG_DISABLE_EVERYTHING) + set(BUILD_EIGEN_VECTORIZATION OFF CACHE BOOL "If on, vectorization is enabled in build.") + endif() + + if(NOT DEFINED BUILD_EIGEN_VECTORIZATION) message(STATUS "+ (vectorization enabled in build)") endif() - set(LINMATH_ALIGN ON CACHE BOOL "If on, vectorization is enabled in build.") + + set(BUILD_EIGEN_VECTORIZATION ON CACHE BOOL "If on, vectorization is enabled in build.") + + if(BUILD_EIGEN_VECTORIZATION) + set(LINMATH_ALIGN TRUE) + endif() else() - unset(LINMATH_ALIGN CACHE) + unset(BUILD_EIGEN_VECTORIZATION CACHE) endif() # Find and configure OpenSSL library @@ -45,13 +56,21 @@ find_package(OpenSSL QUIET COMPONENTS ssl crypto) mangle_package(OpenSSL) config_package(OPENSSL COMMENT "OpenSSL") if(HAVE_OPENSSL) + if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) + unset(BUILD_OPENSSL_ERROR_REPORTS) + endif() + if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) - set(REPORT_OPENSSL_ERRORS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + set(BUILD_OPENSSL_ERROR_REPORTS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") else() - set(REPORT_OPENSSL_ERRORS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + set(BUILD_OPENSSL_ERROR_REPORTS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + endif() + + if(BUILD_OPENSSL_ERROR_REPORTS) + set(REPORT_OPENSSL_ERRORS TRUE) endif() else() - unset(REPORT_OPENSSL_ERRORS CACHE) + unset(BUILD_OPENSSL_ERROR_REPORTS CACHE) endif() # Find and configure JPEG library @@ -137,7 +156,6 @@ endif() #find_package(SpeedTree) #config_package(SPEEDTREE COMMENT "SpeedTree") - # Find and configure WxWidgets #find_package(WxWidgets) #config_package(WX COMMENT "WxWidgets") @@ -273,28 +291,36 @@ set(USE_THREADS TRUE CACHE BOOL "If true, compile Panda3D with threading support if(USE_THREADS) set(HAVE_THREADS TRUE) else() - unset(SIMPLE_THREADS CACHE) - unset(OS_SIMPLE_THREADS CACHE) + unset(BUILD_SIMPLE_THREADS CACHE) + unset(BUILD_OS_SIMPLE_THREADS CACHE) endif() # Configure debug threads if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 3) - set(DEBUG_THREADS ON CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") + set(BUILD_DEBUG_THREADS ON CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") else() - set(DEBUG_THREADS OFF CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") + set(BUILD_DEBUG_THREADS OFF CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") +endif() +if(BUILD_DEBUG_THREADS) + set(DEBUG_THREADS TRUE) endif() # Add advanced threading configuration if(HAVE_THREADS) - set(SIMPLE_THREADS FALSE CACHE BOOL "If true, compile with simulated threads.") - if(SIMPLE_THREADS) + set(BUILD_SIMPLE_THREADS FALSE CACHE BOOL "If true, compile with simulated threads.") + if(BUILD_SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") - set(OS_SIMPLE_THREADS TRUE CACHE BOOL "If true, OS threading constructs will be used to perform context switches.") - else() - unset(OS_SIMPLE_THREADS CACHE) + set(BUILD_OS_SIMPLE_THREADS TRUE CACHE BOOL "If true, OS threading constructs will be used to perform context switches.") - set(DO_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") - if(DO_PIPELINING) + set(SIMPLE_THREADS TRUE) + if(BUILD_OS_SIMPLE_THREADS) + set(OS_SIMPLE_THREADS TRUE) + endif() + else() + unset(BUILD_OS_SIMPLE_THREADS CACHE) + + set(BUILD_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") + if(BUILD_PIPELINING) message(STATUS "Compilation will include full, pipelined threading support.") else() message(STATUS "Compilation will include nonpipelined threading support.") @@ -318,24 +344,30 @@ if(NOT WIN32) set(CMAKE_CXX_FLAGS_RELEASE "-pthread") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") + + mark_as_advanced(PTHREAD_IPATH) endif() endif() ### Configure pipelining ### -if(NOT DEFINED DO_PIPELINING) +if(NOT DEFINED BUILD_PIPELINING) if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2) - set(DO_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") + set(BUILD_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") else() - set(DO_PIPELINING FALSE CACHE BOOL "If true, compile with pipelined rendering.") + set(BUILD_PIPELINING FALSE CACHE BOOL "If true, compile with pipelined rendering.") endif() endif() +if(BUILD_PIPELINING) + set(DO_PIPELINING TRUE) +endif() ### Configure OS X options ### if(OSX_PLATFORM) - set(UNIVERSIAL_BINARIES TRUE CACHE BOOL "If true, compiling will create universal OS X binaries.") - if(UNIVERSAL_BINARIES) + set(BUILD_UNIVERSIAL_BINARIES TRUE CACHE BOOL "If true, compiling will create universal OS X binaries.") + if(BUILD_UNIVERSAL_BINARIES) message(STATUS "Compilation will create universal binaries.") + set(UNIVERSAL_BINARIES TRUE) else() message(STATUS "Compilation will not create universal binaries.") endif() From 4fa31ee4d61a3b31a7d87a9772d8fe546f85b406 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 12 Dec 2013 10:24:39 -0700 Subject: [PATCH 050/744] CMake: Use option() instead of set(CACHE) --- cmake/modules/ConfigurePackage.cmake | 8 +++---- dtool/Configure.cmake | 35 ++++++++++++++++------------ 2 files changed, 24 insertions(+), 19 deletions(-) diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake index 2c9767b9bf..c4e1df0d94 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/modules/ConfigurePackage.cmake @@ -60,9 +60,9 @@ function(config_package PKG_NAME) endif() if(CONFIG_DISABLE_EVERYTHING) - set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) else() - set(USE_${PKG_NAME} TRUE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" ON) endif() @@ -83,14 +83,14 @@ function(config_package PKG_NAME) # If using Discovery, we want to silently disable missing packages if(CONFIG_DISABLE_MISSING) - set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) endif() endif() else() # If using DISCOVERED NOTHING, we want to silently disable missing packages if(CONFIG_DISABLE_MISSING OR CONFIG_DISABLE_EVERYTHING) - set(USE_${PKG_NAME} FALSE CACHE BOOL "If true, compile Panda3D with ${DISPLAY_NAME}") + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) else() # Otherwise, output failure to find package diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index ffda2df616..247a78c3d3 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -35,14 +35,14 @@ if(HAVE_EIGEN) if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) unset(BUILD_EIGEN_VECTORIZATION) elseif(CONFIG_DISABLE_EVERYTHING) - set(BUILD_EIGEN_VECTORIZATION OFF CACHE BOOL "If on, vectorization is enabled in build.") + option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." OFF) endif() if(NOT DEFINED BUILD_EIGEN_VECTORIZATION) message(STATUS "+ (vectorization enabled in build)") endif() - set(BUILD_EIGEN_VECTORIZATION ON CACHE BOOL "If on, vectorization is enabled in build.") + option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." ON) if(BUILD_EIGEN_VECTORIZATION) set(LINMATH_ALIGN TRUE) @@ -61,9 +61,9 @@ if(HAVE_OPENSSL) endif() if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) - set(BUILD_OPENSSL_ERROR_REPORTS ON CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + option(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." ON) else() - set(BUILD_OPENSSL_ERROR_REPORTS OFF CACHE BOOL "If on, OpenSSL reports verbose error messages when they occur.") + set(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." OFF) endif() if(BUILD_OPENSSL_ERROR_REPORTS) @@ -249,10 +249,12 @@ endif() #if(HAVE_ROCKET) # # Check for rocket python bindings # if(FOUND_ROCKET_PYTHON) -# set(USE_ROCKET_PYTHON TRUE CACHE BOOL "If true, compile Panda3D with python bindings for libRocket") +# option(USE_ROCKET_PYTHON "If on, compile Panda3D with python bindings for libRocket" ON) # if(USE_ROCKET_PYTHON) # set(HAVE_ROCKET_PYTHON TRUE) # endif() +# else() +# unset(USE_ROCKET_PYTHON CACHE) # endif() # if(HAVE_ROCKET_PYTHON) # message(STATUS "+ libRocket with Python bindings") @@ -273,10 +275,12 @@ endif() ### Configure interrogate ### message(STATUS "") # simple line break if(HAVE_PYTHON) - set(USE_INTERROGATE TRUE CACHE BOOL "If true, Panda3D will generate python interfaces") + option(USE_INTERROGATE "If on, Panda3D will generate python interfaces" ON) if(USE_INTERROGATE) set(HAVE_INTERROGATE TRUE) endif() +else() + unset(USE_INTERROGATE CACHE) endif() if(HAVE_INTERROGATE) message(STATUS "Compilation will generate Python interfaces.") @@ -287,7 +291,7 @@ endif() ### Configure threading support ### # Add basic use flag for threading -set(USE_THREADS TRUE CACHE BOOL "If true, compile Panda3D with threading support.") +option(USE_THREADS "If on, compile Panda3D with threading support." ON) if(USE_THREADS) set(HAVE_THREADS TRUE) else() @@ -297,9 +301,9 @@ endif() # Configure debug threads if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 3) - set(BUILD_DEBUG_THREADS ON CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") + option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) else() - set(BUILD_DEBUG_THREADS OFF CACHE BOOL "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)") + option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) endif() if(BUILD_DEBUG_THREADS) set(DEBUG_THREADS TRUE) @@ -307,10 +311,10 @@ endif() # Add advanced threading configuration if(HAVE_THREADS) - set(BUILD_SIMPLE_THREADS FALSE CACHE BOOL "If true, compile with simulated threads.") + option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) if(BUILD_SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") - set(BUILD_OS_SIMPLE_THREADS TRUE CACHE BOOL "If true, OS threading constructs will be used to perform context switches.") + option(BUILD_OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches." ON) set(SIMPLE_THREADS TRUE) if(BUILD_OS_SIMPLE_THREADS) @@ -319,7 +323,7 @@ if(HAVE_THREADS) else() unset(BUILD_OS_SIMPLE_THREADS CACHE) - set(BUILD_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) if(BUILD_PIPELINING) message(STATUS "Compilation will include full, pipelined threading support.") else() @@ -353,9 +357,9 @@ endif() ### Configure pipelining ### if(NOT DEFINED BUILD_PIPELINING) if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2) - set(BUILD_PIPELINING TRUE CACHE BOOL "If true, compile with pipelined rendering.") + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) else() - set(BUILD_PIPELINING FALSE CACHE BOOL "If true, compile with pipelined rendering.") + option(BUILD_PIPELINING "If on, compile with pipelined rendering." OFF) endif() endif() if(BUILD_PIPELINING) @@ -364,7 +368,7 @@ endif() ### Configure OS X options ### if(OSX_PLATFORM) - set(BUILD_UNIVERSIAL_BINARIES TRUE CACHE BOOL "If true, compiling will create universal OS X binaries.") + option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) if(BUILD_UNIVERSAL_BINARIES) message(STATUS "Compilation will create universal binaries.") set(UNIVERSAL_BINARIES TRUE) @@ -401,6 +405,7 @@ check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) check_include_file_cxx(stdint.h PHAVE_STDINT_H) +# TODO: Actually check for these, instead of assuming set(HAVE_NAMESPACE ON) set(HAVE_LOCKF ON) set(HAVE_WCHAR_T ON) From d1572173d34c00bc75785b728c00cc3fef9dec05 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 12 Dec 2013 12:30:42 -0700 Subject: [PATCH 051/744] CMake: Configure: Add XYZZY_LIBRARY(IES) variable declarations for Find packages. Other cleanup and reorginizaion. --- cmake/modules/FindCg.cmake | 15 +++---- cmake/modules/FindFFTW.cmake | 7 ++-- cmake/modules/FindFMODEx.cmake | 6 ++- cmake/modules/FindMiles.cmake | 58 +++++++++++++++++++--------- cmake/modules/FindSquish.cmake | 16 ++++---- cmake/modules/FindTar.cmake | 11 +++--- cmake/modules/FindVRPN.cmake | 9 +++-- cmake/modules/MangleFreetype.cmake | 5 +-- cmake/modules/MangleGTK2.cmake | 2 + cmake/modules/MangleJPEG.cmake | 8 +--- cmake/modules/MangleOpenAL.cmake | 1 - cmake/modules/MangleOpenSSL.cmake | 7 +--- cmake/modules/ManglePNG.cmake | 11 ++---- cmake/modules/MangleTIFF.cmake | 8 +--- cmake/modules/MangleZLIB.cmake | 2 - dtool/CMakeLists.txt | 5 +-- dtool/Configure.cmake | 6 ++- dtool/src/cppparser/CMakeLists.txt | 24 +++++++++--- dtool/src/interrogate/CMakeLists.txt | 15 ++++++- dtool/src/prc/CMakeLists.txt | 1 + 20 files changed, 127 insertions(+), 90 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 2a1c82a940..c8342fffc4 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -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() diff --git a/cmake/modules/FindFFTW.cmake b/cmake/modules/FindFFTW.cmake index ce61c17f25..d735ed79b3 100644 --- a/cmake/modules/FindFFTW.cmake +++ b/cmake/modules/FindFFTW.cmake @@ -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() diff --git a/cmake/modules/FindFMODEx.cmake b/cmake/modules/FindFMODEx.cmake index ce624e41bf..47e8de3f24 100644 --- a/cmake/modules/FindFMODEx.cmake +++ b/cmake/modules/FindFMODEx.cmake @@ -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() diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake index afc8425cc5..8ec6598c2e 100644 --- a/cmake/modules/FindMiles.cmake +++ b/cmake/modules/FindMiles.cmake @@ -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) diff --git a/cmake/modules/FindSquish.cmake b/cmake/modules/FindSquish.cmake index 742fb67af1..dd626e63f5 100644 --- a/cmake/modules/FindSquish.cmake +++ b/cmake/modules/FindSquish.cmake @@ -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() \ No newline at end of file +endif() diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake index 0e017c2b97..de365a30c4 100644 --- a/cmake/modules/FindTar.cmake +++ b/cmake/modules/FindTar.cmake @@ -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() diff --git a/cmake/modules/FindVRPN.cmake b/cmake/modules/FindVRPN.cmake index efa151f350..3f9247db9b 100644 --- a/cmake/modules/FindVRPN.cmake +++ b/cmake/modules/FindVRPN.cmake @@ -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() diff --git a/cmake/modules/MangleFreetype.cmake b/cmake/modules/MangleFreetype.cmake index 8c3ca5a5b0..e4e85efed6 100644 --- a/cmake/modules/MangleFreetype.cmake +++ b/cmake/modules/MangleFreetype.cmake @@ -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) \ No newline at end of file +unset(FREETYPE_INCLUDE_DIR_freetype2 CACHE) diff --git a/cmake/modules/MangleGTK2.cmake b/cmake/modules/MangleGTK2.cmake index 672c787e5c..e3918f40d1 100644 --- a/cmake/modules/MangleGTK2.cmake +++ b/cmake/modules/MangleGTK2.cmake @@ -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) diff --git a/cmake/modules/MangleJPEG.cmake b/cmake/modules/MangleJPEG.cmake index 15b25c7c6b..5c8b5fd321 100644 --- a/cmake/modules/MangleJPEG.cmake +++ b/cmake/modules/MangleJPEG.cmake @@ -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) diff --git a/cmake/modules/MangleOpenAL.cmake b/cmake/modules/MangleOpenAL.cmake index dc8c4de12a..5191f94721 100644 --- a/cmake/modules/MangleOpenAL.cmake +++ b/cmake/modules/MangleOpenAL.cmake @@ -26,5 +26,4 @@ if(OPENAL_FOUND) unset(OPENAL_LIBRARY_DIR) endif() -unset(OPENAL_LIBRARY CACHE) unset(OPENAL_INCLUDE_DIR CACHE) diff --git a/cmake/modules/MangleOpenSSL.cmake b/cmake/modules/MangleOpenSSL.cmake index c53e1561fb..c64b0d9e65 100644 --- a/cmake/modules/MangleOpenSSL.cmake +++ b/cmake/modules/MangleOpenSSL.cmake @@ -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) diff --git a/cmake/modules/ManglePNG.cmake b/cmake/modules/ManglePNG.cmake index 706967f08a..d34b5d35f3 100644 --- a/cmake/modules/ManglePNG.cmake +++ b/cmake/modules/ManglePNG.cmake @@ -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) diff --git a/cmake/modules/MangleTIFF.cmake b/cmake/modules/MangleTIFF.cmake index 0292ee0755..8bab70092e 100644 --- a/cmake/modules/MangleTIFF.cmake +++ b/cmake/modules/MangleTIFF.cmake @@ -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) diff --git a/cmake/modules/MangleZLIB.cmake b/cmake/modules/MangleZLIB.cmake index 8222b936a1..f663bc1c3e 100644 --- a/cmake/modules/MangleZLIB.cmake +++ b/cmake/modules/MangleZLIB.cmake @@ -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) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 55577b6b11..b6968d0ece 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -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 ## diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 247a78c3d3..b1742ba6d6 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -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 diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 6a879739ba..1d3d2e23c3 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -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) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index c04518c967..d355d8d579 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -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 diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 457fe08b2c..a122e036b9 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -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.") From b0e3949544d67413ae375b20b1bdb3218fc0629c Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 13 Dec 2013 14:24:17 +0100 Subject: [PATCH 052/744] Get rid of HAVE_GETTIMEOFDAY --- dtool/dtool_config.h.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/dtool/dtool_config.h.cmake b/dtool/dtool_config.h.cmake index 189e1f8a8d..a31bec6d5c 100644 --- a/dtool/dtool_config.h.cmake +++ b/dtool/dtool_config.h.cmake @@ -309,9 +309,6 @@ /* Define if we have STL hash_map etc. available */ #cmakedefine HAVE_STL_HASH -/* Define if we have a gettimeofday() function. */ -#cmakedefine HAVE_GETTIMEOFDAY - /* Define if gettimeofday() takes only one parameter. */ #cmakedefine GETTIMEOFDAY_ONE_PARAM From a8cde9f6f155df5238b11b5fde990fd97a025bc7 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 13 Dec 2013 16:35:16 +0100 Subject: [PATCH 053/744] Use a custom target for bison as the built-in one is ill-equipped for our purposes. Also, add pandabase. --- CMakeLists.txt | 3 +++ dtool/Configure.cmake | 1 - dtool/src/cppparser/CMakeLists.txt | 22 +++++++++++++++++----- panda/CMakeLists.txt | 2 ++ panda/src/pandabase/CMakeLists.txt | 14 ++++++++++++++ 5 files changed, 36 insertions(+), 6 deletions(-) create mode 100644 panda/CMakeLists.txt create mode 100644 panda/src/pandabase/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 01f5b0056b..14e3da0ba6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,9 @@ set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1) ## Set CMake Find Module path ## set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") +## This is where dtool_config.h gets generated ## +include_directories("${CMAKE_BINARY_DIR}/include") ## Include Panda3D Packages ## add_subdirectory(dtool) +add_subdirectory(panda) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index b1742ba6d6..72bb43a358 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -424,4 +424,3 @@ else() endif() configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) -include_directories("${CMAKE_BINARY_DIR}/include") diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 1d3d2e23c3..c7970491a1 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -47,11 +47,23 @@ if(NOT HAVE_BISON) endif() endif() -bison_target(cppParser - cppBison.yxx - ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx - COMPILE_FLAGS --defines=${CMAKE_CURRENT_BINARY_DIR}/cppBison.h -) +# TODO: we should move this to a global macro somewhere. +if(BISON_FOUND) + add_custom_command( + OUTPUT cppBison.h cppBison.cxx + COMMAND ${BISON_EXECUTABLE} + --defines=cppBison.h -o cppBison.cxx -p cppyy + "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.yxx" + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.yxx" + ) +else() + add_custom_command( + OUTPUT cppBison.h cppBison.cxx + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.h.prebuilt" cppBison.h + COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.cxx.prebuilt" cppBison.cxx + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.h.prebuilt" "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.cxx.prebuilt" + ) +endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_LIST_DIR}) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt new file mode 100644 index 0000000000..f07f3367dc --- /dev/null +++ b/panda/CMakeLists.txt @@ -0,0 +1,2 @@ +## Include panda subpackages ## +add_subdirectory(src/pandabase) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt new file mode 100644 index 0000000000..25f065b222 --- /dev/null +++ b/panda/src/pandabase/CMakeLists.txt @@ -0,0 +1,14 @@ +include_directories(../../../dtool/src/dtoolbase) + +set(P3PANDABASE_HEADERS + pandabase.h pandasymbols.h +) + +set(P3PANDABASE_SOURCES + pandabase.cxx +) + +add_library(p3pandabase STATIC + ${P3PANDABASE_HEADERS} + ${P3PANDABASE_SOURCES} +) From c7b514bc757383a3307515bf6ff509a9e3897b86 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 03:27:52 -0700 Subject: [PATCH 054/744] CMake: Configure: Begin conversion to standard CMake find package syntax. --- cmake/modules/ConfigurePackage.cmake | 120 +++++------ cmake/modules/FindCg.cmake | 248 +++++++++------------ cmake/modules/FindEigen2.cmake | 87 ++------ cmake/modules/FindEigen3.cmake | 87 ++------ cmake/modules/FindFFTW.cmake | 203 ++++++++--------- cmake/modules/FindMiles.cmake | 212 +++++++++--------- cmake/modules/MangleFreetype.cmake | 29 --- cmake/modules/MangleJPEG.cmake | 23 -- cmake/modules/MangleOpenAL.cmake | 29 --- cmake/modules/MangleOpenSSL.cmake | 25 --- cmake/modules/ManglePNG.cmake | 28 --- cmake/modules/MangleTIFF.cmake | 25 --- cmake/modules/MangleZLIB.cmake | 35 --- dtool/Configure.cmake | 311 +++++++++++++-------------- 14 files changed, 542 insertions(+), 920 deletions(-) delete mode 100644 cmake/modules/MangleFreetype.cmake delete mode 100644 cmake/modules/MangleJPEG.cmake delete mode 100644 cmake/modules/MangleOpenAL.cmake delete mode 100644 cmake/modules/MangleOpenSSL.cmake delete mode 100644 cmake/modules/ManglePNG.cmake delete mode 100644 cmake/modules/MangleTIFF.cmake delete mode 100644 cmake/modules/MangleZLIB.cmake diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/modules/ConfigurePackage.cmake index c4e1df0d94..81551994f8 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/modules/ConfigurePackage.cmake @@ -4,8 +4,6 @@ # This modules defines a function which finds and configures libraries # and packages for Panda3Ds configuration file headers (.h files). # -# Additionally, it defines a macro for including Mangle modules. -# # Assumes the file has already been found with find_package(). # # The following variables can be set to override the cached values of USE_XYZZY @@ -16,85 +14,65 @@ # # Usage: -# mangle_package(LIBRARY_NAME) -macro(mangle_package PKG_NAME) - include(Mangle${PKG_NAME}) -endmacro() - -# Usage: -# config_package(PACKAGE_NAME [REQUIRED] [COMMENT ]) +# config_package(PACKAGE_NAME []) function(config_package PKG_NAME) - # Set function vars to defaults - set(DISPLAY_NAME ${PKG_NAME}) + # Get package display name + foreach(arg ${ARGN}) + set(DISPLAY_NAME "${DISPLAY_NAME}${arg}") + endforeach() - # Handle optional function arguments - foreach(arg ${ARGN}) - if(ARG_IS_COMMENT) - unset(ARG_IS_COMMENT) - set(DISPLAY_NAME ${arg}) - break() - endif() + # Set function vars to defaults + if(NOT DISPLAY_NAME) + set(DISPLAY_NAME ${PKG_NAME}) + endif() - if(arg MATCHES "REQUIRED") - # TODO: Implement currently ignored - elseif(arg MATCHES "COMMENT") - set(ARG_IS_COMMENT TRUE) - else() - message(AUTHOR_WARNING "configure_package() unexpected argument: '${arg}'") - return() - endif() - endforeach() - if(ARG_IS_COMMENT) - message(AUTHOR_WARNING "configure_package() expected display-name after 'COMMENT'") - endif() + if(${PKG_NAME}_FOUND) + # Output success after finding the package for the first time + if(NOT DEFINED USE_${PKG_NAME} AND NOT CONFIG_DISABLE_EVERYTHING) + message(STATUS "+ ${DISPLAY_NAME}") + endif() - if(FOUND_${PKG_NAME}) - # Output success after finding the package for the first time - if(NOT DEFINED USE_${PKG_NAME} AND NOT CONFIG_DISABLE_EVERYTHING) - message(STATUS "+ ${DISPLAY_NAME}") - endif() + ### Add a USE_XYZZY config variable to the cache ### + if(CONFIG_ENABLE_EVERYTHING OR CONFIG_DISABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) + unset(USE_${PKG_NAME} CACHE) + endif() - ### Add a USE_XYZZY config variable to the cache ### - if(CONFIG_ENABLE_EVERYTHING OR CONFIG_DISABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) - unset(USE_${PKG_NAME} CACHE) - endif() - - if(CONFIG_DISABLE_EVERYTHING) - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) - else() - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" ON) - endif() + if(CONFIG_DISABLE_EVERYTHING) + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) + else() + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" ON) + endif() - # Update HAVE_XYZZY - if(USE_${PKG_NAME}) - set(HAVE_${PKG_NAME} TRUE PARENT_SCOPE) - endif() + # Update HAVE_XYZZY + if(USE_${PKG_NAME}) + set(HAVE_${PKG_NAME} TRUE PARENT_SCOPE) + endif() - elseif(DEFINED USE_${PKG_NAME}) - # If we were compiling with a particular package, but we can't find it; - # then inform the user the package was lost. - if(USE_${PKG_NAME}) - message(STATUS "- Can no longer find ${DISPLAY_NAME}") + elseif(DEFINED USE_${PKG_NAME}) + # If we were compiling with a particular package, but we can't find it; + # then inform the user the package was lost. + if(USE_${PKG_NAME}) + message(STATUS "- Can no longer find ${DISPLAY_NAME}") - # Only unset if USE_XYZZY is true; - # This allows us to set USE_XYZZY to false to silence the output - unset(USE_${PKG_NAME} CACHE) + # Only unset if USE_XYZZY is true; + # This allows us to set USE_XYZZY to false to silence the output + unset(USE_${PKG_NAME} CACHE) - # If using Discovery, we want to silently disable missing packages - if(CONFIG_DISABLE_MISSING) - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) - endif() - endif() + # If using Discovery, we want to silently disable missing packages + if(CONFIG_DISABLE_MISSING) + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) + endif() + endif() - else() - # If using DISCOVERED NOTHING, we want to silently disable missing packages - if(CONFIG_DISABLE_MISSING OR CONFIG_DISABLE_EVERYTHING) - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) + else() + # If using DISCOVERED NOTHING, we want to silently disable missing packages + if(CONFIG_DISABLE_MISSING OR CONFIG_DISABLE_EVERYTHING) + option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) - else() - # Otherwise, output failure to find package - message(STATUS "- Did not find ${DISPLAY_NAME}") - endif() - endif() + else() + # Otherwise, output failure to find package + message(STATUS "- Did not find ${DISPLAY_NAME}") + endif() + endif() endfunction() diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index c8342fffc4..f22e279765 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -5,17 +5,15 @@ # find_package(Cg [REQUIRED] [QUIET]) # # It sets the following variables: -# FOUND_CG - system has NvidiaCg -# 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 +# CG_FOUND - system has NvidiaCg +# CG_INCLUDE_DIR - the NvidiaCg include directory +# CG_LIBRARY_DIR - the NvidiaCg library directory +# 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 -# CGGL_LIBRARY - the path to the library binary +# CGGL_FOUND - system has CgGL +# CGGL_INCLUDE_DIR - the CgGL include directory +# CGGL_LIBRARY_DIR - the CgGL library directory +# CGGL_LIBRARY - the path to the library binary # @@ -23,168 +21,130 @@ # Find Cg for OpenGL macro(find_cggl) - if(CGGL_LPATH AND CGGL_IPATH) - # If its cached, we don't need to refind it - set(FOUND_CGGL TRUE) - if(WIN32) - set(CGGL_LIBS cgGL.lib) - else() - set(CGGL_LIBS CgGL) - endif() - else() - # Find the include directory - find_path(CGGL_IPATH - NAMES "cgGL.h" - PATHS "C:/Program Files/Cg" - "C:/Program Files/NVIDIA Corporation/Cg/include" - "/usr/include" - "/usr/local/include" - "/opt/Cg" - "/opt/nvidia-cg-toolkit/include" # Gentoo - PATH_SUFFIXES "" "Cg" - DOC "The path to NvidiaCg's include directory." - ) + if(NOT CGGL_LIBRARY_DIR AND NOT CGGL_INCLUDE_DIR) + # Find the include directory + find_path(CGGL_INCLUDE_DIR + NAMES "cgGL.h" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg/include" + "/usr/include" + "/usr/local/include" + "/opt/Cg" + "/opt/nvidia-cg-toolkit/include" # Gentoo + PATH_SUFFIXES "" "Cg" + DOC "The path to NvidiaCgGL's include directory." + ) - # Find the library directory - find_library(CGGL_LIBRARY - NAMES "CgGL" "libCgGL" - PATHS "C:/Program Files/Cg" - "C:/Program Files/NVIDIA Corporation/Cg" - "/usr" - "/usr/local" - "/opt/Cg" - "/opt/nvidia-cg-toolkit" # Gentoo - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - get_filename_component(CGGL_LIBRARY_DIR "${CGGL_LIBRARY}" PATH) - set(CGGL_LPATH "${CGGL_LIBRARY_DIR}" CACHE PATH "The path to the CgGL library directory.") # Library path + # Find the library directory + find_library(CGGL_LIBRARY + NAMES "CgGL" "libCgGL" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg" + "/usr" + "/usr/local" + "/opt/Cg" + "/opt/nvidia-cg-toolkit" # Gentoo + PATH_SUFFIXES "" "lib" "lib32" "lib64" + DOC "The filepath to NvidiaCgGL's libary binary." + ) + get_filename_component(CGGL_LIBRARY_DIR "${CGGL_LIBRARY}" PATH) + set(CGGL_LIBRARY_DIR "${CGGL_LIBRARY_DIR}" CACHE PATH "The path to the CgGL library directory.") # Library path - unset(CGGL_LIBRARY_DIR) + mark_as_advanced(CGGL_INCLUDE_DIR) + mark_as_advanced(CGGL_LIBRARY_DIR) + mark_as_advanced(CGGL_LIBRARY) + endif() - # Check if we have everything we need - if(CGGL_IPATH AND CGGL_LPATH) - set(FOUND_CGGL TRUE) - if(WIN32) - set(CGGL_LIBS cgGL.lib) - else() - set(CGGL_LIBS CgGL) - endif() - endif() + find_package_handle_standard_args(CgGL DEFAULT_MSG CGGL_LIBRARY CGGL_INCLUDE_DIR CGGL_LIBRARY_DIR) - mark_as_advanced(CGGL_IPATH) - mark_as_advanced(CGGL_LPATH) - mark_as_advanced(CGGL_LIBRARY) - endif() endmacro() # Find Cg for DirectX 8 macro(find_cgdx8) - # TODO: Implement + # TODO: Implement endmacro() # Find Cg for DirectX 9 macro(find_cgdx9) - # TODO: Implement + # TODO: Implement endmacro() # Find Cg for DirectX 10 macro(find_cgdx10) - # TODO: Implement + # TODO: Implement endmacro() # Find base Nvidia Cg -if(CG_LPATH AND CG_IPATH) - # If its cached, we don't need to refind it - set(FOUND_CG TRUE) - if(WIN32) - set(CG_LIBS cg.lib) - else() - set(CG_LIBS Cg) - endif() +if(NOT CG_LIBRARY_DIR AND NOT CG_INCLUDE_DIR) + # On OSX default to using the framework version of Cg. + if(APPLE) + include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake) + set(CG_INCLUDES) - find_cggl() - find_cgdx8() - find_cgdx9() - find_cgdx10() + cmake_find_frameworks(Cg) + if(Cg_FRAMEWORKS) + foreach(dir ${Cg_FRAMEWORKS}) + set(CG_INCLUDES ${CG_INCLUDES} ${dir}/Headers ${dir}/PrivateHeaders) + endforeach(dir) + unset(Cg_FRAMEWORKS) -else() - # On OSX default to using the framework version of Cg. - if(APPLE) - include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake) - set(CG_INCLUDES) + # Find the include dir + find_path(CG_INCLUDE_DIR + NAMES "cg.h" + PATHS ${CG_INCLUDES} + DOC "The path to NvidiaCg's include directory." + ) + unset(CG_INCLUDES) - cmake_find_frameworks(Cg) - if(Cg_FRAMEWORKS) - foreach(dir ${Cg_FRAMEWORKS}) - set(CG_INCLUDES ${CG_INCLUDES} ${dir}/Headers ${dir}/PrivateHeaders) - endforeach(dir) - unset(Cg_FRAMEWORKS) + # Set the library dir (TODO: Check the correctness on Mac OS X) + set(CG_LIBRARY_DIR "/Library/Frameworks/Cg.framework" CACHE PATH "The path to NvidiaCg's library directory.") + endif() - # Find the include dir - find_path(CG_IPATH - NAMES "cg.h" - PATHS ${CG_INCLUDES} - DOC "The path to NvidiaCg's include directory." - ) - unset(CG_INCLUDES) + else() + # Find the include directory + find_path(CG_INCLUDE_DIR + NAMES "cg.h" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg/include" + "/usr/include" + "/usr/local/include" + "/opt/Cg" + "/opt/nvidia-cg-toolkit/include" # Gentoo + PATH_SUFFIXES "" "Cg" + DOC "The path to NvidiaCg's include directory." + ) - # Set the library dir (TODO: Check the correctness on Mac OS X) - set(CG_LPATH "/Library/Frameworks/Cg.framework" CACHE PATH "The path to NvidiaCg's library directory.") - endif() + # Find the library directory + find_library(CG_LIBRARY + NAMES "Cg" "libCg" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg" + "/usr" + "/usr/local" + "/opt/Cg" + "/opt/nvidia-cg-toolkit" # Gentoo + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + get_filename_component(CG_LIBRARY_DIR "${CG_LIBRARY}" PATH) + set(CG_LIBRARY_DIR "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path + endif() - else() - # Find the include directory - find_path(CG_IPATH - NAMES "cg.h" - PATHS "C:/Program Files/Cg" - "C:/Program Files/NVIDIA Corporation/Cg/include" - "/usr/include" - "/usr/local/include" - "/opt/Cg" - "/opt/nvidia-cg-toolkit/include" # Gentoo - PATH_SUFFIXES "" "Cg" - DOC "The path to NvidiaCg's include directory." - ) - - # Find the library directory - find_library(CG_LIBRARY - NAMES "Cg" "libCg" - PATHS "C:/Program Files/Cg" - "C:/Program Files/NVIDIA Corporation/Cg" - "/usr" - "/usr/local" - "/opt/Cg" - "/opt/nvidia-cg-toolkit" # Gentoo - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - get_filename_component(CG_LIBRARY_DIR "${CG_LIBRARY}" PATH) - set(CG_LPATH "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path - - unset(CG_LIBRARY_DIR) - endif() - - # Check if we have everything we need - if(CG_IPATH AND CG_LPATH) - set(FOUND_CG TRUE) - if(WIN32) - set(CG_LIBS cg.lib) - else() - set(CG_LIBS Cg) - endif() - - find_cggl() - find_cgdx8() - find_cgdx9() - find_cgdx10() - - endif() - - mark_as_advanced(CG_IPATH) - mark_as_advanced(CG_LPATH) - mark_as_advanced(CG_LIBRARY) + mark_as_advanced(CG_INCLUDE_DIR) + mark_as_advanced(CG_LIBRARY_DIR) + mark_as_advanced(CG_LIBRARY) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARY CG_INCLUDE_DIR CG_LIBRARY_DIR) + +if(FOUND_CG) + find_cggl() + find_cgdx8() + find_cgdx9() + find_cgdx10() +endif() \ No newline at end of file diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake index 703c28aa46..bbdb28b620 100644 --- a/cmake/modules/FindEigen2.cmake +++ b/cmake/modules/FindEigen2.cmake @@ -1,77 +1,28 @@ # Filename: FindEigen2.cmake -# Authors: montel@kde.org, g.gael@free.fr -# Redistribution and use is allowed according to the terms of the BSD license. +# Authors: kestred (13 Dec, 2013) # -# Module modified to mangle the names for Panda3D. +# Usage: +# find_package(Eigen2 [REQUIRED] [QUIET]) # -# This module supports requiring a minimum version, e.g. you can do -# find_package(Eigen2 2.0.3) -# to require version 2.0.3 to newer of Eigen2. -# -# Once done this will define -# -# FOUND_EIGEN - system has eigen lib with correct version -# EIGEN_IPATH - the eigen include directory -# EIGEN_VERSION - eigen version +# Once done this will define: +# EIGEN_FOUND - system has Eigen2 +# EIGEN_INCLUDE_DIR - the Eigen2 include directory # -if(NOT EIGEN_FIND_VERSION) - if(NOT EIGEN_FIND_VERSION_MAJOR) - set(EIGEN_FIND_VERSION_MAJOR 2) - endif() - if(NOT EIGEN_FIND_VERSION_MINOR) - set(EIGEN_FIND_VERSION_MINOR 0) - endif() - if(NOT EIGEN_FIND_VERSION_PATCH) - set(EIGEN_FIND_VERSION_PATCH 0) - endif() - - set(EIGEN_FIND_VERSION "${EIGEN_FIND_VERSION_MAJOR}.${EIGEN_FIND_VERSION_MINOR}.${EIGEN_FIND_VERSION_PATCH}") +if(Eigen2_FIND_QUIETLY) + set(Eigen_FIND_QUIETLY TRUE) endif() +if(NOT EIGEN_INCLUED_DIR) + find_path(EIGEN_INCLUDE_DIR + NAMES Eigen/Core + PATHS ${INCLUDE_INSTALL_DIR} + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen2 + ) -macro(_eigen_check_version) - # Read version from Macros.h - file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen_version_header) - - # Parse version from read data - string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}") - set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}") - set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}") - set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}") - - # Set EIGEN_VERSION - set(EIGEN_VERSION ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}) - - # Make sure Eigen Version is at least the requested version - if((${EIGEN_WORLD_VERSION} NOTEQUAL 2) OR (${EIGEN_MAJOR_VERSION} GREATER 10) OR (${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION})) - set(EIGEN_VERSION_OK FALSE) - else() - set(EIGEN_VERSION_OK TRUE) - endif() -endmacro() - - -if(EIGEN_IPATH) - # If already in cache, just check that the version is correct - _eigen_check_version() - set(FOUND_EIGEN ${EIGEN_VERSION_OK}) -else() - # Otherwise find it manually - find_path(EIGEN_IPATH - NAMES Eigen/Core - PATHS ${INCLUDE_INSTALL_DIR} - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen2 - ) - - # Checking to make sure it has the write version - if(EIGEN_IPATH) - _eigen_check_version() - set(FOUND_EIGEN ${EIGEN_VERSION_OK}) - endif() - - mark_as_advanced(EIGEN_IPATH) + mark_as_advanced(EIGEN_INCLUDE_DIR) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index a965b01288..3f7b5047d7 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -1,77 +1,28 @@ # Filename: FindEigen3.cmake -# Authors: montel@kde.org, g.gael@free.fr, jacob.benoit.1@gmail.com -# Redistribution and use is allowed according to the terms of the BSD license. +# Authors: kestred (13 Dec, 2013) # -# Module modified to mangle the names for Panda3D. +# Usage: +# find_package(Eigen3 [REQUIRED] [QUIET]) # -# This module supports requiring a minimum version, e.g. you can do -# find_package(Eigen3 3.1.2) -# to require version 3.1.2 or newer of Eigen3. -# -# Once done this will define -# -# FOUND_EIGEN - system has eigen lib with correct version -# EIGEN_IPATH - the eigen include directory -# EIGEN_VERSION - eigen version +# Once done this will define: +# EIGEN_FOUND - system has Eigen3 +# EIGEN_INCLUDE_DIR - the Eigen3 include directory # -if(NOT EIGEN_FIND_VERSION) - if(NOT EIGEN_FIND_VERSION_MAJOR) - set(EIGEN_FIND_VERSION_MAJOR 2) - endif() - if(NOT EIGEN_FIND_VERSION_MINOR) - set(EIGEN_FIND_VERSION_MINOR 91) - endif() - if(NOT EIGEN_FIND_VERSION_PATCH) - set(EIGEN_FIND_VERSION_PATCH 0) - endif() - - set(EIGEN_FIND_VERSION "${EIGEN_FIND_VERSION_MAJOR}.${EIGEN_FIND_VERSION_MINOR}.${EIGEN_FIND_VERSION_PATCH}") +if(Eigen3_FIND_QUIETLY) + set(Eigen_FIND_QUIETLY TRUE) endif() +if(NOT EIGEN_INCLUDE_DIR) + find_path(EIGEN_INCLUDE_DIR + NAMES signature_of_eigen3_matrix_library + PATHS ${CMAKE_INSTALL_PREFIX}/include + ${KDE4_INCLUDE_DIR} + PATH_SUFFIXES eigen3 eigen + ) -macro(_eigen_check_version) - # Read version from Macros.h - file(READ "${EIGEN_IPATH}/Eigen/src/Core/util/Macros.h" _eigen_version_header) - - # Parse version from read data - string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen_world_version_match "${_eigen_version_header}") - set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen_major_version_match "${_eigen_version_header}") - set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}") - string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen_minor_version_match "${_eigen_version_header}") - set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}") - - # Set EIGEN_VERSION - set(EIGEN_VERSION ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION}) - - # Make sure Eigen Version is at least the requested version - if(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION}) - set(EIGEN_VERSION_OK FALSE) - else(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION}) - set(EIGEN_VERSION_OK TRUE) - endif(${EIGEN_VERSION} VERSION_LESS ${EIGEN_FIND_VERSION}) -endmacro() - - -if(EIGEN_IPATH) - # If already in cache, just check that the version is correct - _eigen_check_version() - set(FOUND_EIGEN ${EIGEN_VERSION_OK}) -else() - # Otherwise find it manually - find_path(EIGEN_IPATH - NAMES signature_of_eigen3_matrix_library - PATHS ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen - ) - - # Checking to make sure it has the write version - if(EIGEN_IPATH) - _eigen_check_version() - set(FOUND_EIGEN ${EIGEN_VERSION_OK}) - endif() - - mark_as_advanced(EIGEN_IPATH) + mark_as_advanced(EIGEN_INCLUDE_DIR) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) \ No newline at end of file diff --git a/cmake/modules/FindFFTW.cmake b/cmake/modules/FindFFTW.cmake index d735ed79b3..1fb9d3edf0 100644 --- a/cmake/modules/FindFFTW.cmake +++ b/cmake/modules/FindFFTW.cmake @@ -4,127 +4,106 @@ # Usage: # find_package(FFTW [REQUIRED] [QUIET]) # -# 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_LIBRARY - the path to the library binary +# Once done this will define: +# FFTW_FOUND - true if fftw is found on the system +# FFTW_INCLUDE_DIR - the fftw include directory +# FFTW_LIBRARY_DIR - 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 -# 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(FFTW_IPATH AND FFTW_LPATH) - set(FOUND_FFTW TRUE) -else() - # Check if we can use PkgConfig - find_package(PkgConfig QUIET) +if(NOT FFTW_INCLUDE_DIR AND NOT FFTW_LIBRARY_DIR) + # Check if we can use PkgConfig + find_package(PkgConfig QUIET) - #Determine from PKG - if(PKG_CONFIG_FOUND AND NOT FFTW_ROOT) - pkg_check_modules(PKG_FFTW QUIET "fftw3") - endif() + #Determine from PKG + if(PKG_CONFIG_FOUND AND NOT FFTW_ROOT) + pkg_check_modules(PKG_FFTW QUIET "fftw3") + endif() - #Check whether to search static or dynamic libs - set(CMAKE_FIND_LIBRARY_SUFFIXES_SAVED ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(FFTW_ROOT) + # Try to find headers under root + find_path(FFTW_INCLUDE_DIR + NAMES "fftw3.h" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "include" + NO_DEFAULT_PATH + ) - if(${FFTW_USE_STATIC_LIBS}) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) - else() - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_SHARED_LIBRARY_SUFFIX}) - endif() + # Try to find library under root + find_library(FFTW_LIBRARY + NAMES "fftw3" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + + find_library(FFTW_FFTWF_LIBRARY + NAMES "fftw3f" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + + find_library(FFTW_FFTWL_LIBRARY + NAMES "fftw3l" + PATHS ${FFTW_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + else() + # Find headers the normal way + find_path(FFTW_INCLUDE_DIR + NAMES "fftw3.h" + PATHS ${PKG_FFTW_INCLUDE_DIRS} + ${INCLUDE_INSTALL_DIR} + "/usr/include" + "/usr/local/include" + PATH_SUFFIXES "" "fftw" + ) + + # Find library the normal way + find_library(FFTW_LIBRARY + NAMES "fftw3" + PATHS ${PKG_FFTW_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + + find_library(FFTW_FFTWF_LIBRARY + NAMES "fftw3f" + PATHS ${PKG_FFTW_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) - if(FFTW_ROOT) - # Try to find headers under root - find_path(FFTW_IPATH - NAMES "fftw3.h" - PATHS ${FFTW_ROOT} - PATH_SUFFIXES "include" - NO_DEFAULT_PATH - ) + find_library(FFTW_FFTWL_LIBRARY + NAMES "fftw3l" + PATHS ${PKG_FFTW_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + endif() - # Try to find library under root - find_library(FFTW_LIBRARY - NAMES "fftw3" - PATHS ${FFTW_ROOT} - PATH_SUFFIXES "lib" "lib64" - NO_DEFAULT_PATH - ) + # Get the directory conaining FFTW_LIBRARY + get_filename_component(FFTW_LIBRARY_DIR "${FFTW_LIBRARY}" PATH) + set(FFTW_LIBRARY_DIR "${FFTW_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path - find_library(FFTW_FFTWF_LIBRARY - NAMES "fftw3f" - PATHS ${FFTW_ROOT} - PATH_SUFFIXES "lib" "lib64" - NO_DEFAULT_PATH - ) - - find_library(FFTW_FFTWL_LIBRARY - NAMES "fftw3l" - PATHS ${FFTW_ROOT} - PATH_SUFFIXES "lib" "lib64" - NO_DEFAULT_PATH - ) - else() - # Find headers the normal way - find_path(FFTW_IPATH - NAMES "fftw3.h" - PATHS ${PKG_FFTW_INCLUDE_DIRS} - ${INCLUDE_INSTALL_DIR} - "/usr/include" - "/usr/local/include" - PATH_SUFFIXES "" "fftw" - ) - - # Find library the normal way - find_library(FFTW_LIBRARY - NAMES "fftw3" - PATHS ${PKG_FFTW_LIBRARY_DIRS} - ${LIB_INSTALL_DIR} - "/usr" - "/usr/local" - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - - find_library(FFTW_FFTWF_LIBRARY - NAMES "fftw3f" - PATHS ${PKG_FFTW_LIBRARY_DIRS} - ${LIB_INSTALL_DIR} - "/usr" - "/usr/local" - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - - - find_library(FFTW_FFTWL_LIBRARY - NAMES "fftw3l" - PATHS ${PKG_FFTW_LIBRARY_DIRS} - ${LIB_INSTALL_DIR} - "/usr" - "/usr/local" - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - endif() - - # Cleanup after the library suffixes - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SAVED}) - unset(CMAKE_FIND_LIBRARY_SUFFIXES_SAVED) - - # Get the directory conaining FFTW_LIBRARY - get_filename_component(FFTW_LIBRARY_DIR "${FFTW_LIBRARY}" PATH) - set(FFTW_LPATH "${FFTW_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path - - - # Check if we have everything we need - if(FFTW_IPATH AND FFTW_LPATH) - set(FOUND_FFTW TRUE) - endif() - - unset(FFTW_LIBRARY_DIR) - 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) + mark_as_advanced(FFTW_INCLUDE_DIR) + mark_as_advanced(FFTW_LIBRARY_DIR) + mark_as_advanced(FFTW_LIBRARY) + mark_as_advanced(FFTW_FFTWF_LIBRARY) + mark_as_advanced(FFTW_FFTWL_LIBRARY) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW_LIBRARY FFTW_INCLUDE_DIR FFTW_LIBRARY_DIR) \ No newline at end of file diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake index 8ec6598c2e..dde814df8d 100644 --- a/cmake/modules/FindMiles.cmake +++ b/cmake/modules/FindMiles.cmake @@ -18,119 +18,119 @@ # if(RAD_MSS_IPATH AND RAD_MSS_LPATH) - set(FOUND_RAD_MSS TRUE) - set(RAD_MSS_LIBS Mss32) + 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() + # 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() + # 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_path(RAD_MSS_IPATH - NAMES "miles.h" - PATHS "/usr/include" - "/usr/local/include" - "/opt/" - "C:/Program Files" - "C:/Program Files (x86)" - PATH_SUFFIXES "" "miles" "Miles6" "miles/include" "Miles6/include" - DOC "The path to the Miles SDK include directory." - ) + # Find the Miles SDK include files + find_path(RAD_MSS_IPATH + NAMES "miles.h" + PATHS "/usr/include" + "/usr/local/include" + "/opt/" + "C:/Program Files" + "C:/Program Files (x86)" + PATH_SUFFIXES "" "miles" "Miles6" "miles/include" "Miles6/include" + DOC "The path to the Miles SDK include directory." + ) - # Find the Miles SDK libraries (.a, .so) - find_library(RAD_MSS_RELEASE_LIBRARY - NAMES "miles" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "/opt/Miles6" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) - find_library(RAD_MSS_MINSIZE_LIBRARY - NAMES "miles_s" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) - find_library(RAD_MSS_RELWITHDEBINFO_LIBRARY - NAMES "miles_rd" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) - find_library(RAD_MSS_DEBUG_LIBRARY - NAMES "miles_d" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) + # Find the Miles SDK libraries (.a, .so) + find_library(RAD_MSS_RELEASE_LIBRARY + NAMES "miles" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "/opt/Miles6" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" + ) + find_library(RAD_MSS_MINSIZE_LIBRARY + NAMES "miles_s" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" + ) + find_library(RAD_MSS_RELWITHDEBINFO_LIBRARY + NAMES "miles_rd" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" + ) + find_library(RAD_MSS_DEBUG_LIBRARY + NAMES "miles_d" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" + ) - # 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() + # 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.") + # 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 - if(RAD_MSS_IPATH AND RAD_MSS_LPATH) - set(FOUND_RAD_MSS TRUE) - set(RAD_MSS_LIBS Mss32) - endif() + # Check if we have everything we need + if(RAD_MSS_IPATH AND RAD_MSS_LPATH) + set(FOUND_RAD_MSS TRUE) + set(RAD_MSS_LIBS Mss32) + endif() - 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) - mark_as_advanced(RAD_MSS_MINSIZE_LIBRARY) + 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) + mark_as_advanced(RAD_MSS_MINSIZE_LIBRARY) endif() diff --git a/cmake/modules/MangleFreetype.cmake b/cmake/modules/MangleFreetype.cmake deleted file mode 100644 index e4e85efed6..0000000000 --- a/cmake/modules/MangleFreetype.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Filename: MangleFREETYPE.cmake -# Author: kestred (11 Dec, 2013) -# -# MangleFREETYPE replaces the output variables of the builtin FindFREETYPE -# with vars matching Panda3D's existing config-var names. -# - -if(FREETYPE_FOUND) - set(FOUND_FREETYPE TRUE) - - list(GET FREETYPE_INCLUDE_DIRS 0 FREETYPE_INCLUDE_DIR) - - get_filename_component(FREETYPE_LIBRARY_DIR "${FREETYPE_LIBRARY}" PATH) - - set(FREETYPE_IPATH "${FREETYPE_INCLUDE_DIR}" CACHE PATH "The path to Freetype's include directory.") # Include path - set(FREETYPE_LPATH "${FREETYPE_LIBRARY_DIR}" CACHE PATH "The path to Freetype's library directory.") # Library path - mark_as_advanced(FREETYPE_IPATH) - mark_as_advanced(FREETYPE_LPATH) - - set(FREETYPE_VERSION ${FREETYPE_VERSION_STRING}) - - unset(FREETYPE_FOUND) - unset(FREETYPE_INCLUDE_DIR) - unset(FREETYPE_LIBRARY_DIR) -endif() - -unset(FREETYPE_INCLUDE_DIRS CACHE) -unset(FREETYPE_INCLUDE_DIR_ft2build CACHE) -unset(FREETYPE_INCLUDE_DIR_freetype2 CACHE) diff --git a/cmake/modules/MangleJPEG.cmake b/cmake/modules/MangleJPEG.cmake deleted file mode 100644 index 5c8b5fd321..0000000000 --- a/cmake/modules/MangleJPEG.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# Filename: MangleJPEG.cmake -# Author: kestred (28 Nov, 2013) -# -# MangleJPEG replaces the output variables of the builtin FindJPEG -# with vars matching Panda3D's existing config-var names. -# - -if(JPEG_FOUND) - set(FOUND_JPEG TRUE) - set(JPEG_LIBS jpeg) - - get_filename_component(JPEG_LIBRARY_DIR "${JPEG_LIBRARY}" PATH) - - set(JPEG_IPATH "${JPEG_INCLUDE_DIR}" CACHE PATH "The path to libjpeg's include directory.") # Include path - set(JPEG_LPATH "${JPEG_LIBRARY_DIR}" CACHE PATH "The path to libjpeg's library directory.") # Library path - mark_as_advanced(JPEG_IPATH) - mark_as_advanced(JPEG_LPATH) - - unset(JPEG_FOUND) - unset(JPEG_LIBRARY_DIR) -endif() - -unset(JPEG_INCLUDE_DIR CACHE) diff --git a/cmake/modules/MangleOpenAL.cmake b/cmake/modules/MangleOpenAL.cmake deleted file mode 100644 index 5191f94721..0000000000 --- a/cmake/modules/MangleOpenAL.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Filename: MangleOpenAL.cmake -# Author: kestred (28 Nov, 2013) -# -# MangleOpenAL replaces the output variables of the builtin FindOpenAL -# with vars matching Panda3D's existing config-var names. -# - -if(OPENAL_FOUND) - set(FOUND_OPENAL TRUE) - if(APPLE) - set(OPENAL_FRAMEWORK OpenAL) - else() - set(OPENAL_LIBS openal) - endif() - - get_filename_component(OPENAL_LIBRARY_DIR "${OPENAL_LIBRARY}" PATH) - - set(OPENAL_IPATH "${OPENAL_INCLUDE_DIR}" CACHE PATH "The path to OpenAL's include directory.") # Include path - set(OPENAL_LPATH "${OPENAL_LIBRARY_DIR}" CACHE PATH "The path to OpenAL's library directory.") # Library path - mark_as_advanced(OPENAL_IPATH) - mark_as_advanced(OPENAL_LPATH) - - set(OPENAL_VERSION ${OPENAL_VERSION_STRING}) - - unset(OPENAL_FOUND) - unset(OPENAL_LIBRARY_DIR) -endif() - -unset(OPENAL_INCLUDE_DIR CACHE) diff --git a/cmake/modules/MangleOpenSSL.cmake b/cmake/modules/MangleOpenSSL.cmake deleted file mode 100644 index c64b0d9e65..0000000000 --- a/cmake/modules/MangleOpenSSL.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# Filename: MangleOpenSSL.cmake -# Author: kestred (28 Nov, 2013) -# -# MangleOpenSSL replaces the output variables of the builtin FindOpenSSL -# with vars matching Panda3D's existing config-var names. -# - -if(OPENSSL_FOUND) - set(FOUND_OPENSSL TRUE) - set(OPENSSL_LIBS ssl crypto) - - list(GET OPENSSL_LIBRARIES 0 OPENSSL_LIBRARY) - - get_filename_component(OPENSSL_LIBRARY_DIR "${OPENSSL_LIBRARY}" PATH) - - set(OPENSSL_IPATH "${OPENSSL_INCLUDE_DIR}" CACHE PATH "The path to OpenSSL's include directory.") # Include path - set(OPENSSL_LPATH "${OPENSSL_LIBRARY_DIR}" CACHE PATH "The path to OpenSSL's library directory.") # Library path - mark_as_advanced(OPENSSL_IPATH) - mark_as_advanced(OPENSSL_LPATH) - - unset(OPENSSL_FOUND) - unset(OPENSSL_LIBRARY_DIR) -endif() - -unset(OPENSSL_INCLUDE_DIR CACHE) diff --git a/cmake/modules/ManglePNG.cmake b/cmake/modules/ManglePNG.cmake deleted file mode 100644 index d34b5d35f3..0000000000 --- a/cmake/modules/ManglePNG.cmake +++ /dev/null @@ -1,28 +0,0 @@ -# Filename: ManglePNG.cmake -# Author: kestred (28 Nov, 2013) -# -# ManglePNG replaces the output variables of the builtin FindPNG -# with vars matching Panda3D's existing config-var names. -# - -if(PNG_FOUND) - set(FOUND_PNG TRUE) - set(PNG_LIBS png) - - get_filename_component(PNG_LIBRARY_DIR "${PNG_LIBRARY}" PATH) - - set(PNG_IPATH "${PNG_INCLUDE_DIR}" CACHE PATH "The path to libPNG's include directory.") # Include path - set(PNG_LPATH "${PNG_LIBRARY_DIR}" CACHE PATH "The path to libPNG's library directory.") # Library path - mark_as_advanced(PNG_IPATH) - mark_as_advanced(PNG_LPATH) - - set(PNG_VERSION ${PNG_VERSION_STRING}) - - unset(PNG_FOUND) - unset(PNG_DEFINITIONS) - unset(PNG_LIBRARY_DIR) - unset(PNG_VERSION_STRING) -endif() - -unset(PNG_INCLUDE_DIR CACHE) -unset(PNG_PNG_INCLUDE_DIR CACHE) diff --git a/cmake/modules/MangleTIFF.cmake b/cmake/modules/MangleTIFF.cmake deleted file mode 100644 index 8bab70092e..0000000000 --- a/cmake/modules/MangleTIFF.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# Filename: MangleTIFF.cmake -# Author: kestred (29 Nov, 2013) -# -# MangleTIFF replaces the output variables of the builtin FindTIFF -# with vars matching Panda3D's existing config-var names. -# - -if(TIFF_FOUND) - set(FOUND_TIFF TRUE) - set(TIFF_LIBS tiff z) - - get_filename_component(TIFF_LIBRARY_DIR "${TIFF_LIBRARY}" PATH) - - set(TIFF_IPATH "${TIFF_INCLUDE_DIR}" CACHE PATH "The path to libTIFF's include directory.") # Include path - set(TIFF_LPATH "${TIFF_LIBRARY_DIR}" CACHE PATH "The path to libTIFF's library directory.") # Library path - mark_as_advanced(TIFF_IPATH) - mark_as_advanced(TIFF_LPATH) - - set(TIFF_VERSION ${TIFF_VERSION_STRING}) - - unset(TIFF_FOUND) - unset(TIFF_LIBRARY_DIR) -endif() - -unset(TIFF_INCLUDE_DIR CACHE) diff --git a/cmake/modules/MangleZLIB.cmake b/cmake/modules/MangleZLIB.cmake deleted file mode 100644 index f663bc1c3e..0000000000 --- a/cmake/modules/MangleZLIB.cmake +++ /dev/null @@ -1,35 +0,0 @@ -# Filename: MangleZLIB.cmake -# Author: kestred (9 Dec, 2013) -# -# MangleZLIB replaces the output variables of the builtin FindZLIB -# with vars matching Panda3D's existing config-var names. -# - -if(ZLIB_FOUND) - set(FOUND_ZLIB TRUE) - set(ZLIB_LIBS z) - - list(GET ZLIB_INCLUDE_DIRS 0 ZLIB_INCLUDE_DIR) - list(GET ZLIB_LIBRARIES 0 ZLIB_LIBRARY) - get_filename_component(ZLIB_LIBRARY_DIR "${ZLIB_LIBRARY}" PATH) - - set(ZLIB_IPATH "${ZLIB_INCLUDE_DIR}" CACHE PATH "The path to zlibs's include directory.") # Include path - set(ZLIB_LPATH "${ZLIB_LIBRARY_DIR}" CACHE PATH "The path to zlibs's library directory.") # Library path - mark_as_advanced(ZLIB_IPATH) - mark_as_advanced(ZLIB_LPATH) - - set(ZLIB_VERSION ${ZLIB_VERSION_STRING}) - - unset(ZLIB_FOUND) - unset(ZLIB_VERSION_STRING) - unset(ZLIB_VERSION_MAJOR) - unset(ZLIB_VERSION_MINOR) - unset(ZLIB_VERSION_PATCH) - unset(ZLIB_VERSION_TWEAK) - unset(ZLIB_MAJOR_VERSION) - unset(ZLIB_MINOR_VERSION) - unset(ZLIB_OATCH_VERSION) -endif() - -unset(ZLIB_INCLUDE_DIR CACHE) -unset(ZLIB_INCLUDE_DIRS CACHE) diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 72bb43a358..38e1b426de 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -1,6 +1,7 @@ message(STATUS "") message("Configuring support for the following optional third-party packages:") + # Settings to change USE_PACKAGE behavior (these options override cached values) set(CONFIG_ENABLE_EVERYTHING Off) set(CONFIG_DISABLE_EVERYTHING Off) @@ -9,138 +10,134 @@ set(CONFIG_DISABLE_MISSING Off) # Update USE_PACKAGE settings based on CLI arguments if(EVERYTHING) - message("Re-enabling all disabled third-party libraries.") - set(CONFIG_ENABLE_EVERYTHING On) + message("Re-enabling all disabled third-party libraries.") + set(CONFIG_ENABLE_EVERYTHING On) elseif(DISCOVERED) - message("Enabling found and disabling not-found third-party libraries.") - set(CONFIG_ENABLE_FOUND On) - set(CONFIG_DISABLE_MISSING On) + message("Enabling found and disabling not-found third-party libraries.") + set(CONFIG_ENABLE_FOUND On) + set(CONFIG_DISABLE_MISSING On) elseif(NOTHING) - message("Disabling all third-party libraries.") - set(CONFIG_DISABLE_EVERYTHING On) + message("Disabling all third-party libraries.") + set(CONFIG_DISABLE_EVERYTHING On) endif() + include(ConfigurePackage) + # Find and configure Eigen library -find_package(Eigen3) -config_package(EIGEN COMMENT "eigen") +find_package(Eigen3 QUIET) +config_package(EIGEN "Eigen") if(HAVE_EIGEN) - if(WIN32) - set(EIGEN_CFLAGS "/arch:SSE2") - else() - set(EIGEN_CFLAGS "-msse2") - endif() + if(WIN32) + set(EIGEN_CFLAGS "/arch:SSE2") + else() + set(EIGEN_CFLAGS "-msse2") + endif() - if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) - unset(BUILD_EIGEN_VECTORIZATION) - elseif(CONFIG_DISABLE_EVERYTHING) - option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." OFF) - endif() + if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) + unset(BUILD_EIGEN_VECTORIZATION) + elseif(CONFIG_DISABLE_EVERYTHING) + option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." OFF) + endif() - if(NOT DEFINED BUILD_EIGEN_VECTORIZATION) - message(STATUS "+ (vectorization enabled in build)") - endif() + if(NOT DEFINED BUILD_EIGEN_VECTORIZATION) + message(STATUS "+ (vectorization enabled in build)") + endif() - option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." ON) + option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." ON) - if(BUILD_EIGEN_VECTORIZATION) - set(LINMATH_ALIGN TRUE) - endif() + if(BUILD_EIGEN_VECTORIZATION) + set(LINMATH_ALIGN TRUE) + endif() else() - unset(BUILD_EIGEN_VECTORIZATION CACHE) + unset(BUILD_EIGEN_VECTORIZATION CACHE) endif() + # Find and configure OpenSSL library find_package(OpenSSL QUIET COMPONENTS ssl crypto) -mangle_package(OpenSSL) -config_package(OPENSSL COMMENT "OpenSSL") +config_package(OPENSSL "OpenSSL") if(HAVE_OPENSSL) - if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) - unset(BUILD_OPENSSL_ERROR_REPORTS) - endif() + if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) + unset(BUILD_OPENSSL_ERROR_REPORTS) + endif() - if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 4) - option(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." ON) - else() - set(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." OFF) - endif() + if(CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") + option(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." ON) + else() + set(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." OFF) + endif() - if(BUILD_OPENSSL_ERROR_REPORTS) - set(REPORT_OPENSSL_ERRORS TRUE) - endif() + if(BUILD_OPENSSL_ERROR_REPORTS) + set(REPORT_OPENSSL_ERRORS TRUE) + endif() else() - unset(BUILD_OPENSSL_ERROR_REPORTS CACHE) + unset(BUILD_OPENSSL_ERROR_REPORTS CACHE) endif() + # Find and configure JPEG library -find_package(JPEG QUIET COMPONENTS jpeg) -mangle_package(JPEG) -config_package(JPEG COMMENT "libjpeg") +find_package(JPEG QUIET) +config_package(JPEG "libjpeg") # Find and configure PNG library -find_package(PNG QUIET COMPONENTS png) -mangle_package(PNG) -config_package(PNG COMMENT "libpng") +find_package(PNG QUIET) +config_package(PNG "libpng") # Find and configure TIFF library find_package(TIFF QUIET COMPONENTS tiff z) -mangle_package(TIFF) -config_package(TIFF COMMENT "libtiff") +config_package(TIFF "libtiff") # Find and configure Tar library -find_package(Tar) -config_package(TAR COMMENT "libtar") +find_package(Tar QUIET) +config_package(TAR "libtar") # Find and configure FFTW library -find_package(FFTW) -config_package(FFTW COMMENT "fftw") +find_package(FFTW QUIET) +config_package(FFTW "fftw") # Find and configure Squish library -find_package(Squish) -config_package(SQUISH COMMENT "squish") +find_package(Squish QUIET) +config_package(SQUISH "squish") # Find and configure Cg library -find_package(Cg) -config_package(CG COMMENT "Nvidia Cg Shading Langauge") -config_package(CGGL COMMENT "Cg OpenGL API") -config_package(CGDX8 COMMENT "Cg DX8 API") -config_package(CGDX9 COMMENT "Cg DX9 API") -config_package(CGDX10 COMMENT "Cg DX10 API") +find_package(Cg QUIET) +config_package(CG "Nvidia Cg Shading Langauge") +config_package(CGGL "Cg OpenGL API") +config_package(CGDX8 "Cg DX8 API") +config_package(CGDX9 "Cg DX9 API") +config_package(CGDX10 "Cg DX10 API") # Find and configure VRPN library -find_package(VRPN) +find_package(VRPN QUIET) config_package(VRPN) # Find and configure zlib -find_package(ZLIB QUIET COMPONENTS z) -mangle_package(ZLIB) -config_package(ZLIB COMMENT "zlib") +find_package(ZLIB QUIET) +config_package(ZLIB "zlib") # Find and configure Miles Sound System -find_package(Miles) -config_package(RAD_MSS COMMENT "Miles Sound System") +find_package(Miles QUIET) +config_package(RAD_MSS "Miles Sound System") # Find and configure FMOD Ex -find_package(FMODEx) -config_package(FMODEX COMMENT "FMOD Ex sound library") +find_package(FMODEx QUIET) +config_package(FMODEX "FMOD Ex sound library") # Find and configure OpenAL find_package(OpenAL QUIET) -mangle_package(OpenAL) -config_package(OPENAL COMMENT "OpenAL sound library") +config_package(OPENAL "OpenAL sound library") # Find and configure GTK find_package(GTK2 QUIET) -mangle_package(GTK2) -config_package(GTK COMMENT "gtk+-2") +config_package(GTK "gtk+-2") # Find and configure Freetype find_package(Freetype QUIET) -mangle_package(Freetype) -config_package(FREETYPE COMMENT "Freetype") +config_package(FREETYPE "Freetype") if(HAVE_FREETYPE AND NOT WIN32) - set(FREETYPE_CONFIG freetype-config) + set(FREETYPE_CONFIG freetype-config) endif() @@ -225,14 +222,14 @@ endif() #find_package(FCollada) #config_package(FCOLLADA COMMENT "FCollada") #if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) -# set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") -# if(USE_COLLADA) -# if(FOUND_COLLADA15DOM) -# set(HAVE_COLLADA15DOM TRUE) -# else() -# set(HAVE_COLLADA14DOM TRUE) -# endif() -# endif() +# set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") +# if(USE_COLLADA) +# if(FOUND_COLLADA15DOM) +# set(HAVE_COLLADA15DOM TRUE) +# else() +# set(HAVE_COLLADA14DOM TRUE) +# endif() +# endif() #endif() # Find and configure Assimp @@ -247,22 +244,22 @@ endif() #find_package(Rocket) #config_package(ROCKET COMMENT "libRocket") #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) -# if(USE_ROCKET_PYTHON) -# set(HAVE_ROCKET_PYTHON TRUE) -# endif() +# # Check for rocket python bindings +# if(FOUND_ROCKET_PYTHON) +# option(USE_ROCKET_PYTHON "If on, compile Panda3D with python bindings for libRocket" ON) +# if(USE_ROCKET_PYTHON) +# set(HAVE_ROCKET_PYTHON TRUE) +# endif() # else() # unset(USE_ROCKET_PYTHON CACHE) -# endif() -# if(HAVE_ROCKET_PYTHON) -# message(STATUS "+ libRocket with Python bindings") -# else() -# message(STATUS "+ libRocket without Python bindings") -# endif() +# endif() +# if(HAVE_ROCKET_PYTHON) +# message(STATUS "+ libRocket with Python bindings") +# else() +# message(STATUS "+ libRocket without Python bindings") +# endif() #else() -# unset(USE_ROCKET_PYTHON CACHE) +# unset(USE_ROCKET_PYTHON CACHE) #endif() # Find and configure Bullet @@ -277,17 +274,17 @@ endif() ### Configure interrogate ### message(STATUS "") # simple line break if(HAVE_PYTHON) - option(USE_INTERROGATE "If on, Panda3D will generate python interfaces" ON) - if(USE_INTERROGATE) - set(HAVE_INTERROGATE TRUE) - endif() + option(USE_INTERROGATE "If on, Panda3D will generate python interfaces" ON) + if(USE_INTERROGATE) + set(HAVE_INTERROGATE TRUE) + endif() else() - unset(USE_INTERROGATE CACHE) + unset(USE_INTERROGATE CACHE) endif() if(HAVE_INTERROGATE) - message(STATUS "Compilation will generate Python interfaces.") + message(STATUS "Compilation will generate Python interfaces.") else() - message(STATUS "Configuring Panda without Python interfaces.") + message(STATUS "Configuring Panda without Python interfaces.") endif() @@ -295,88 +292,88 @@ endif() # Add basic use flag for threading option(USE_THREADS "If on, compile Panda3D with threading support." ON) if(USE_THREADS) - set(HAVE_THREADS TRUE) + set(HAVE_THREADS TRUE) else() - unset(BUILD_SIMPLE_THREADS CACHE) - unset(BUILD_OS_SIMPLE_THREADS CACHE) + unset(BUILD_SIMPLE_THREADS CACHE) + unset(BUILD_OS_SIMPLE_THREADS CACHE) endif() # Configure debug threads if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 3) - 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() - 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) endif() if(BUILD_DEBUG_THREADS) - set(DEBUG_THREADS TRUE) + set(DEBUG_THREADS TRUE) endif() # Add advanced threading configuration if(HAVE_THREADS) - option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) - if(BUILD_SIMPLE_THREADS) - message(STATUS "Compilation will include simulated threading support.") - option(BUILD_OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches." ON) + option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) + if(BUILD_SIMPLE_THREADS) + message(STATUS "Compilation will include simulated threading support.") + option(BUILD_OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches." ON) - set(SIMPLE_THREADS TRUE) - if(BUILD_OS_SIMPLE_THREADS) - set(OS_SIMPLE_THREADS TRUE) - endif() - else() - unset(BUILD_OS_SIMPLE_THREADS CACHE) + set(SIMPLE_THREADS TRUE) + if(BUILD_OS_SIMPLE_THREADS) + set(OS_SIMPLE_THREADS TRUE) + endif() + else() + unset(BUILD_OS_SIMPLE_THREADS CACHE) - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) - if(BUILD_PIPELINING) - message(STATUS "Compilation will include full, pipelined threading support.") - else() - message(STATUS "Compilation will include nonpipelined threading support.") - endif() - endif() + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) + if(BUILD_PIPELINING) + message(STATUS "Compilation will include full, pipelined threading support.") + else() + message(STATUS "Compilation will include nonpipelined threading support.") + endif() + endif() else() - message(STATUS "Configuring Panda without threading support.") + message(STATUS "Configuring Panda without threading support.") endif() set(HAVE_POSIX_THREADS FALSE) if(NOT WIN32) - find_path(PTHREAD_IPATH - NAMES "pthread.h" - PATHS "/usr/include" - ) - if(PTHREAD_IPATH) - set(HAVE_POSIX_THREADS TRUE) - set(THREAD_LIBS pthread) - set(CMAKE_CXX_FLAGS "-pthread") - set(CMAKE_CXX_FLAGS_DEBUG "-pthread") - set(CMAKE_CXX_FLAGS_RELEASE "-pthread") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") - set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") + find_path(PTHREAD_IPATH + NAMES "pthread.h" + PATHS "/usr/include" + ) + if(PTHREAD_IPATH) + set(HAVE_POSIX_THREADS TRUE) + set(THREAD_LIBS pthread) + set(CMAKE_CXX_FLAGS "-pthread") + set(CMAKE_CXX_FLAGS_DEBUG "-pthread") + set(CMAKE_CXX_FLAGS_RELEASE "-pthread") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") + set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") - mark_as_advanced(PTHREAD_IPATH) - endif() + mark_as_advanced(PTHREAD_IPATH) + endif() endif() ### Configure pipelining ### if(NOT DEFINED BUILD_PIPELINING) - if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2) - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) - else() - option(BUILD_PIPELINING "If on, compile with pipelined rendering." OFF) - endif() + if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2) + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) + else() + option(BUILD_PIPELINING "If on, compile with pipelined rendering." OFF) + endif() endif() if(BUILD_PIPELINING) - set(DO_PIPELINING TRUE) + set(DO_PIPELINING TRUE) endif() ### Configure OS X options ### if(OSX_PLATFORM) - option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) - if(BUILD_UNIVERSAL_BINARIES) - message(STATUS "Compilation will create universal binaries.") - set(UNIVERSAL_BINARIES TRUE) - else() - message(STATUS "Compilation will not create universal binaries.") - endif() + option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) + if(BUILD_UNIVERSAL_BINARIES) + message(STATUS "Compilation will create universal binaries.") + set(UNIVERSAL_BINARIES TRUE) + else() + message(STATUS "Compilation will not create universal binaries.") + endif() endif() message(STATUS "") @@ -418,9 +415,9 @@ set(HAVE_STREAMSIZE ON) set(HAVE_IOS_TYPEDEFS ON) if(WIN32) - set(DEFAULT_PATHSEP ";") + set(DEFAULT_PATHSEP ";") else() - set(DEFAULT_PATHSEP ":") + set(DEFAULT_PATHSEP ":") endif() configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) From 826979c09968f3f41e60c385872b750f15dba2e7 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 13:32:04 -0700 Subject: [PATCH 055/744] CMake: Configure: Finish cleaning up finding packages. --- cmake/modules/FindCg.cmake | 13 ++- cmake/modules/FindEigen2.cmake | 21 ++--- cmake/modules/FindEigen3.cmake | 21 ++--- cmake/modules/FindFFTW.cmake | 2 +- cmake/modules/FindFMODEx.cmake | 157 +++++++++++++++------------------ cmake/modules/FindMiles.cmake | 126 +++++++++++++------------- cmake/modules/FindSquish.cmake | 82 +++++++---------- cmake/modules/FindTar.cmake | 30 +++---- cmake/modules/FindVRPN.cmake | 29 +++--- cmake/modules/MangleGTK2.cmake | 34 ------- dtool/Configure.cmake | 22 ++--- 11 files changed, 230 insertions(+), 307 deletions(-) delete mode 100644 cmake/modules/MangleGTK2.cmake diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index f22e279765..55e7b7ea42 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -4,7 +4,7 @@ # Usage: # find_package(Cg [REQUIRED] [QUIET]) # -# It sets the following variables: +# Once done this will define: # CG_FOUND - system has NvidiaCg # CG_INCLUDE_DIR - the NvidiaCg include directory # CG_LIBRARY_DIR - the NvidiaCg library directory @@ -21,7 +21,10 @@ # Find Cg for OpenGL 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_path(CGGL_INCLUDE_DIR NAMES "cgGL.h" @@ -41,6 +44,7 @@ macro(find_cggl) PATHS "C:/Program Files/Cg" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" + "/usr/lib/x86_64-linux-gnu" "/usr/local" "/opt/Cg" "/opt/nvidia-cg-toolkit" # Gentoo @@ -80,7 +84,7 @@ endmacro() # 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. if(APPLE) 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" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" + "/usr/lib/x86_64-linux-gnu" "/usr/local" "/opt/Cg" "/opt/nvidia-cg-toolkit" # Gentoo @@ -142,7 +147,7 @@ endif() include(FindPackageHandleStandardArgs) 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_cgdx8() find_cgdx9() diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake index bbdb28b620..8cf93e94d5 100644 --- a/cmake/modules/FindEigen2.cmake +++ b/cmake/modules/FindEigen2.cmake @@ -5,24 +5,25 @@ # find_package(Eigen2 [REQUIRED] [QUIET]) # # Once done this will define: -# EIGEN_FOUND - system has Eigen2 -# EIGEN_INCLUDE_DIR - the Eigen2 include directory +# EIGEN_FOUND - system has any version of Eigen +# EIGEN2_FOUND - system has Eigen2 +# EIGEN2_INCLUDE_DIR - the Eigen2 include directory # -if(Eigen2_FIND_QUIETLY) - set(Eigen_FIND_QUIETLY TRUE) -endif() - -if(NOT EIGEN_INCLUED_DIR) - find_path(EIGEN_INCLUDE_DIR +if(NOT EIGEN2_INCLUDE_DIR) + find_path(EIGEN2_INCLUDE_DIR NAMES Eigen/Core PATHS ${INCLUDE_INSTALL_DIR} ${KDE4_INCLUDE_DIR} PATH_SUFFIXES eigen2 ) - mark_as_advanced(EIGEN_INCLUDE_DIR) + mark_as_advanced(EIGEN2_INCLUDE_DIR) endif() 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() \ No newline at end of file diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index 3f7b5047d7..73b0b90062 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -5,24 +5,25 @@ # find_package(Eigen3 [REQUIRED] [QUIET]) # # Once done this will define: -# EIGEN_FOUND - system has Eigen3 -# EIGEN_INCLUDE_DIR - the Eigen3 include directory +# EIGEN_FOUND - system has any version of Eigen +# EIGEN3_FOUND - system has Eigen3 +# EIGEN3_INCLUDE_DIR - the Eigen3 include directory # -if(Eigen3_FIND_QUIETLY) - set(Eigen_FIND_QUIETLY TRUE) -endif() - -if(NOT EIGEN_INCLUDE_DIR) - find_path(EIGEN_INCLUDE_DIR +if(NOT EIGEN3_INCLUDE_DIR) + find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library PATHS ${CMAKE_INSTALL_PREFIX}/include ${KDE4_INCLUDE_DIR} PATH_SUFFIXES eigen3 eigen ) - mark_as_advanced(EIGEN_INCLUDE_DIR) + mark_as_advanced(EIGEN3_INCLUDE_DIR) endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR) \ No newline at end of file +find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR) + +if(EIGEN3_FOUND) + set(EIGEN_FOUND TRUE) +endif() \ No newline at end of file diff --git a/cmake/modules/FindFFTW.cmake b/cmake/modules/FindFFTW.cmake index 1fb9d3edf0..c4b86ce812 100644 --- a/cmake/modules/FindFFTW.cmake +++ b/cmake/modules/FindFFTW.cmake @@ -14,7 +14,7 @@ # 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 find_package(PkgConfig QUIET) diff --git a/cmake/modules/FindFMODEx.cmake b/cmake/modules/FindFMODEx.cmake index 47e8de3f24..5725c365c0 100644 --- a/cmake/modules/FindFMODEx.cmake +++ b/cmake/modules/FindFMODEx.cmake @@ -2,99 +2,84 @@ # Author: kestred (8 Dec, 2013) # # Usage: -# find_package(FMODEx [REQUIRED] [QUIET]) +# find_pcackage(FMODEx [REQUIRED] [QUIET]) # -# It sets the following variables: -# FOUND_FMODEX - system has FMOD Ex -# 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 +# Once done this will define: +# FMODEX_FOUND - system has FMOD Ex +# FMODEX_INCLUDE_DIR - the FMOD Ex include directory +# FMODEX_LIBRARY_DIR - the FMOD Ex library directory +# 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 +# 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) - # If its cached, we don't need to refind it - set(FOUND_FMODEX TRUE) +if(NOT FMODEX_LIBRARY_DIR OR NOT FMODEX_INCLUDE_DIR) + # Find the include directory + find_path(FMODEX_INCLUDE_DIR + NAMES "fmod.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + "/opt/fmodex/include" + "/opt/fmodex/api/inc" + "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/inc" + PATH_SUFFIXES "" "fmodex/fmod" "fmodex/fmod3" "fmod" "fmod3" + DOC "The path to FMOD Ex's include directory." + ) - if(FMODEX_32_LIBRARY) - set(FMODEX_LIBS fmodex) - elseif(FMODEX_64_LIBRARY) - set(FMODEX_LIBS fmodex64) - endif() -else() - # Find the include directory - find_path(FMODEX_IPATH - NAMES "fmod.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - "/opt/fmodex/include" - "/opt/fmodex/api/inc" - "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/inc" - PATH_SUFFIXES "" "fmodex/fmod" "fmodex/fmod3" "fmod" "fmod3" - DOC "The path to FMOD Ex's include directory." - ) + # Find the 32-bit library + find_library(FMODEX_32_LIBRARY + NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" + PATHS "/usr" + "/usr/local" + "/usr/X11R6" + "/usr/local/X11R6" + "/sw" + "/opt" + "/opt/local" + "/opt/csw" + "/opt/fmodex" + "/opt/fmodex/api" + "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/lib" + PATH_SUFFIXES "" "lib" "lib32" + ) - # Find the 32-bit library - find_library(FMODEX_32_LIBRARY - NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" - PATHS "/usr" - "/usr/local" - "/usr/X11R6" - "/usr/local/X11R6" - "/sw" - "/opt" - "/opt/local" - "/opt/csw" - "/opt/fmodex" - "/opt/fmodex/api" - "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/lib" - PATH_SUFFIXES "" "lib" "lib32" - ) + # Find the 64-bit library + find_library(FMODEX_64_LIBRARY + NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" + PATHS "/usr" + "/usr/local" + "/usr/X11R6" + "/usr/local/X11R6" + "/sw" + "/opt" + "/opt/local" + "/opt/csw" + "/opt/fmodex" + "/opt/fmodex/api" + "/usr/freeware" + PATH_SUFFIXES "" "lib" "lib64" + ) - # Find the 64-bit library - find_library(FMODEX_64_LIBRARY - NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" - PATHS "/usr" - "/usr/local" - "/usr/X11R6" - "/usr/local/X11R6" - "/sw" - "/opt" - "/opt/local" - "/opt/csw" - "/opt/fmodex" - "/opt/fmodex/api" - "/usr/freeware" - PATH_SUFFIXES "" "lib" "lib64" - ) + if(FMODEX_32_LIBRARY) + set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.") + elseif(FMODEX_64_LIBRARY) + set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.") + endif() - if(FMODEX_32_LIBRARY) - set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY}) - set(FMODEX_LIBS fmodex) - elseif(FMODEX_64_LIBRARY) - set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY}) - set(FMODEX_LIBS fmodex64) - endif() + get_filename_component(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY}" PATH) + set(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY_DIR}" CACHE PATH "The path to FMOD Ex's library directory.") - 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.") - - # Check if we have everything we need - if(FMODEX_IPATH AND FMODEX_LPATH) - set(FOUND_FMODEX TRUE) - endif() - - 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) + mark_as_advanced(FMODEX_INCLUDE_DIR) + mark_as_advanced(FMODEX_LIBRARY_DIR) + mark_as_advanced(FMODEX_LIBRARY) + mark_as_advanced(FMODEX_32_LIBRARY) + mark_as_advanced(FMODEX_64_LIBRARY) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FMODEx DEFAULT_MSG FMODEX_LIBRARY FMODEX_INCLUDE_DIR FMODEX_LIBRARY_DIR) diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake index dde814df8d..def0949e78 100644 --- a/cmake/modules/FindMiles.cmake +++ b/cmake/modules/FindMiles.cmake @@ -4,49 +4,22 @@ # Usage: # 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 -# RAD_MSS_LIBRARY - the path to the library binary +# Once done this will define: +# MILES_FOUND - system has Radgame's Miles SDK +# RAD_MSS_FOUND - system has Radgame's Miles SDK +# MILES_INCLUDE_DIR - the Miles SDK include directory +# MILES_LIBRARY_DIR - the Miles SDK library directory +# MILES_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 +# MILES_RELEASE_LIBRARY - the filepath of the Miles SDK release library +# MILES_RELDBG_LIBRARY - the filepath of the Miles SDK optimize debug library +# MILES_MINSIZE_LIBRARY - the filepath of the Miles SDK minimum size library +# MILES_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_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() +if(NOT MILES_INCLUDE_DIR OR NOT MILES_LIBRARY_DIR) # Find the Miles SDK include files - find_path(RAD_MSS_IPATH + find_path(MILES_INCLUDE_DIR NAMES "miles.h" PATHS "/usr/include" "/usr/local/include" @@ -58,7 +31,7 @@ else() ) # Find the Miles SDK libraries (.a, .so) - find_library(RAD_MSS_RELEASE_LIBRARY + find_library(MILES_RELEASE_LIBRARY NAMES "miles" PATHS "/usr" "/usr/local" @@ -70,7 +43,7 @@ else() "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) - find_library(RAD_MSS_MINSIZE_LIBRARY + find_library(MILES_MINSIZE_LIBRARY NAMES "miles_s" PATHS "/usr" "/usr/local" @@ -81,7 +54,7 @@ else() "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) - find_library(RAD_MSS_RELWITHDEBINFO_LIBRARY + find_library(MILES_RELWITHDEBINFO_LIBRARY NAMES "miles_rd" PATHS "/usr" "/usr/local" @@ -92,7 +65,7 @@ else() "C:/Program Files (x86)/Miles6" PATH_SUFFIXES "lib" "lib32" ) - find_library(RAD_MSS_DEBUG_LIBRARY + find_library(MILES_DEBUG_LIBRARY NAMES "miles_d" PATHS "/usr" "/usr/local" @@ -105,32 +78,57 @@ else() ) # 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.") + if(CMAKE_BUILD_TYPE MATCHES "Release" AND MILES_RELEASE_LIBRARY) + set(MILES_LIBRARY ${MILES_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") + elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY) + set(MILES_LIBRARY ${MILES_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") + elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND MILES_MINSIZE_LIBRARY) + set(MILES_LIBRARY ${MILES_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") + elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND MILES_DEBUG_LIBRARY) + set(MILES_LIBRARY ${MILES_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.") + 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.") # Check if we have everything we need - if(RAD_MSS_IPATH AND RAD_MSS_LPATH) - set(FOUND_RAD_MSS TRUE) - set(RAD_MSS_LIBS Mss32) + if(MILES_INCLUDE_DIR AND MILES_LIBRARY_DIR) + set(FOUND_MILES TRUE) + set(MILES_LIBS Mss32) endif() - 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) - mark_as_advanced(RAD_MSS_MINSIZE_LIBRARY) + mark_as_advanced(MILES_INCLUDE_DIR) + mark_as_advanced(MILES_DEBUG_LIBRARY) + mark_as_advanced(MILES_RELEASE_LIBRARY) + mark_as_advanced(MILES_RELWITHDEBINFO_LIBRARY) + mark_as_advanced(MILES_MINSIZE_LIBRARY) 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) diff --git a/cmake/modules/FindSquish.cmake b/cmake/modules/FindSquish.cmake index dd626e63f5..9a0acb80ae 100644 --- a/cmake/modules/FindSquish.cmake +++ b/cmake/modules/FindSquish.cmake @@ -4,38 +4,19 @@ # Usage: # 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 -# SQUISH_LIBS - the squish components found -# SQUISH_LIBRARY - the path to the library binary +# Once done this will define: +# SQUISH_FOUND - system has squish +# SQUISH_INCLUDE_DIR - the squish include directory +# SQUISH_LIBRARY_DIR - the squish library directory +# 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 # -if(SQUISH_IPATH AND SQUISH_LPATH) - 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() +if(NOT SQUISH_INCLUDE_DIR OR NOT SQUISH_LIBRARY_DIR) # Find the libsquish include files - find_path(SQUISH_IPATH + find_path(SQUISH_INCLUDE_DIR NAMES "squish.h" PATHS "/usr/include" "/usr/local/include" @@ -70,33 +51,30 @@ else() 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 - 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_INCLUDE_DIR) mark_as_advanced(SQUISH_RELEASE_LIBRARY) mark_as_advanced(SQUISH_DEBUG_LIBRARY) 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) diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake index de365a30c4..a14a99bb6b 100644 --- a/cmake/modules/FindTar.cmake +++ b/cmake/modules/FindTar.cmake @@ -5,19 +5,15 @@ # 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 +# TAR_FOUND - system has libtar +# TAR_INCLUDE_DIR - the tar include directory +# TAR_LIBRARY_DIR - the tar library directory # TAR_LIBRARY - the path to the library binary # -if(TAR_IPATH AND TAR_LPATH) - set(FOUND_TAR TRUE) - set(TAR_LIBS tar) -else() +if(NOT TAR_INCLUDE_DIR OR NOT TAR_LIBRARY_DIR) # Find the libtar include files - find_path(TAR_IPATH + find_path(TAR_INCLUDE_DIR NAMES "libtar.h" PATHS "/usr/include" "/usr/local/include" @@ -34,16 +30,12 @@ else() PATH_SUFFIXES "lib" "lib32" "lib64" ) 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 - if(TAR_IPATH AND TAR_LPATH) - 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_INCLUDE_DIR) + mark_as_advanced(TAR_LIBRARY_DIR) mark_as_advanced(TAR_LIBRARY) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Tar DEFAULT_MSG TAR_LIBRARY TAR_INCLUDE_DIR TAR_LIBRARY_DIR) diff --git a/cmake/modules/FindVRPN.cmake b/cmake/modules/FindVRPN.cmake index 3f9247db9b..759cbbf2a8 100644 --- a/cmake/modules/FindVRPN.cmake +++ b/cmake/modules/FindVRPN.cmake @@ -1,21 +1,21 @@ -# Filename: FindTar.cmake +# Filename: FindVRPN.cmake # Author: kestred (29 Nov, 2013) # # Usage: -# find_package(Tar [REQUIRED] [QUIET]) +# find_package(VRPN [REQUIRED] [QUIET]) # # It sets the following variables: -# FOUND_VRPN - system has libvrpn -# VRPN_IPATH - the vrpn include directory -# VRPN_LPATH - the vrpn library directory +# VRPN_FOUND - system has libvrpn +# VRPN_INCLUDE_DIR - the vrpn include directory +# VRPN_LIBRARY_DIR - the vrpn library directory # 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) else() # Find the vrpn include files - find_path(VRPN_IPATH + find_path(VRPN_INCLUDE_DIR NAMES "vrpn_Keyboard.h" PATHS "/usr/include" "/usr/local/include" @@ -34,15 +34,12 @@ else() PATH_SUFFIXES "lib" "lib32" "lib64" ) 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 - if(VRPN_IPATH AND VRPN_LPATH) - set(FOUND_VRPN TRUE) - endif() - - unset(VRPN_LIBRARY_DIR) - mark_as_advanced(VRPN_IPATH) - mark_as_advanced(VRPN_LPATH) + mark_as_advanced(VRPN_INCLUDE_DIR) + mark_as_advanced(VRPN_LIBRARY_DIR) mark_as_advanced(VRPN_LIBRARY) endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_LIBRARY VRPN_INCLUDE_DIR VRPN_LIBRARY_DIR) diff --git a/cmake/modules/MangleGTK2.cmake b/cmake/modules/MangleGTK2.cmake deleted file mode 100644 index e3918f40d1..0000000000 --- a/cmake/modules/MangleGTK2.cmake +++ /dev/null @@ -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) \ No newline at end of file diff --git a/dtool/Configure.cmake b/dtool/Configure.cmake index 38e1b426de..8f900ef987 100644 --- a/dtool/Configure.cmake +++ b/dtool/Configure.cmake @@ -1,7 +1,6 @@ message(STATUS "") message("Configuring support for the following optional third-party packages:") - # Settings to change USE_PACKAGE behavior (these options override cached values) set(CONFIG_ENABLE_EVERYTHING Off) set(CONFIG_DISABLE_EVERYTHING Off) @@ -130,7 +129,12 @@ find_package(OpenAL QUIET) config_package(OPENAL "OpenAL sound library") # 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") # Find and configure Freetype @@ -290,8 +294,8 @@ endif() ### Configure threading support ### # Add basic use flag for threading -option(USE_THREADS "If on, compile Panda3D with threading support." ON) -if(USE_THREADS) +option(BUILD_THREADS "If on, compile Panda3D with threading support." ON) +if(BUILD_THREADS) set(HAVE_THREADS TRUE) else() unset(BUILD_SIMPLE_THREADS CACHE) @@ -299,7 +303,7 @@ else() endif() # 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) else() 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 ### if(NOT DEFINED BUILD_PIPELINING) - if(NOT DEFINED OPTIMIZE OR OPTIMIZE LESS 2) - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) - else() - option(BUILD_PIPELINING "If on, compile with pipelined rendering." OFF) - endif() + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) endif() if(BUILD_PIPELINING) set(DO_PIPELINING TRUE) endif() ### Configure OS X options ### -if(OSX_PLATFORM) +if(APPLE) option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) if(BUILD_UNIVERSAL_BINARIES) message(STATUS "Compilation will create universal binaries.") From 905f0a8c55d7b1c0a626756d0ac1148842fd9af9 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 13:32:23 -0700 Subject: [PATCH 056/744] CMake: Start cleaning up configuration variables. --- dtool/CMakeLists.txt | 27 ++++++++++++++++++++++++--- dtool/src/prc/CMakeLists.txt | 4 ---- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index b6968d0ece..5de54213f4 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -27,10 +27,31 @@ else() endif() string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") +# PRC Config settings +set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING "Specify the PRC_DEFAULT_DIR as an absolute path.") +if(NOT PRC_DEFAULT_DIR_ABSOLUTE) + set(PRC_DEFAULT_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.") +else() + set(PRC_DEFAULT_DIR "" 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.") +endif() +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.") +if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) + message(FATAL_ERROR "Cannot have both PRC_DEFAULT_DIR and PRC_DEFAULT_DIR_ABSOLUTE, choose one.") +endif() + +# PRC special values for config headers +if(PRC_DEFAULT_DIR_ABSOLUTE) + set(DEFAULT_PRC_DIR ${PRC_ABSOLUTE_DIR}) +else() + set(DEFAULT_PRC_DIR "${CMAKE_INSTALL_PREFIX}/panda/${PRC_DEFAULT_DIR}") +endif() + -## 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.") include(Configure.cmake) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index a122e036b9..8b55f0944b 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -1,10 +1,6 @@ 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.") - configure_file(prc_parameters.h.cmake prc_parameters.h) include_directories(${CMAKE_CURRENT_BINARY_DIR}) From fdcd21ad4c60e4b79e0db0fd0c17ee295e44db59 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 14:06:36 -0700 Subject: [PATCH 057/744] CMake: Rearrange CMake flow so that Version, Package, and Config information is available at the top level. Remove complexity from subpackages where possible. --- CMakeLists.txt | 16 +- dtool/CMakeLists.txt | 58 +------- dtool/Config.cmake | 169 ++++++++++++++++++++++ dtool/{Configure.cmake => Packages.cmake} | 149 ------------------- dtool/Version.cmake | 37 +++++ dtool/src/interrogate/CMakeLists.txt | 14 -- 6 files changed, 214 insertions(+), 229 deletions(-) create mode 100644 dtool/Config.cmake rename dtool/{Configure.cmake => Packages.cmake} (60%) create mode 100644 dtool/Version.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 14e3da0ba6..c9ac44d2a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,21 +1,17 @@ cmake_minimum_required(VERSION 2.8) project(Panda3D) -## Panda Version Information ## -set(PANDA_VERSION 1 9 0) -set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL "If true, signifies this is a tagged release rather than a repository snapshot. Scripts that generate source tarballs and/or binary releases for distribution should explicitly set this to true.") -set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING "This should be set by whoever provides a particular distribution of Panda. If you build your own Panda, leave this unchanged.") - -set(P3D_PLUGIN_VERSION 1 0 4) -set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1) - - -## Set CMake Find Module path ## +## Set Panda's CMake Module path ## set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") ## This is where dtool_config.h gets generated ## include_directories("${CMAKE_BINARY_DIR}/include") +## Configure Panda3D ##( +include(dtool/Version.cmake) +include(dtool/Packages.cmake) +include(dtool/Config.cmake) + ## Include Panda3D Packages ## add_subdirectory(dtool) add_subdirectory(panda) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 5de54213f4..161814cd3d 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -1,59 +1,5 @@ -## Parse Panda3D Subversions ## -list(GET PANDA_VERSION 0 PANDA_MAJOR_VERSION) -list(GET PANDA_VERSION 1 PANDA_MINOR_VERSION) -list(GET PANDA_VERSION 2 PANDA_SEQUENCE_VERSION) - -string(REPLACE ";" "." PANDA_VERSION_STR "${PANDA_VERSION}") -if(NOT PANDA_OFFICIAL_VERSION) - set(PANDA_VERSION_STR "${PANDA_VERSION_STR}c") -endif() - -set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) - -math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}") - - -## Parse Plugin-framework Subversions ## -list(GET P3D_PLUGIN_VERSION 0 P3D_PLUGIN_MAJOR_VERSION) -list(GET P3D_PLUGIN_VERSION 1 P3D_PLUGIN_MINOR_VERSION) -list(GET P3D_PLUGIN_VERSION 2 P3D_PLUGIN_SEQUENCE_VERSION) - -string(REPLACE ";" "." P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") -if(PANDA_OFFICIAL_VERSION) - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.1000") -else() - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.0") - set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION_STR}c") -endif() -string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") - -# PRC Config settings -set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING "Specify the PRC_DEFAULT_DIR as an absolute path.") -if(NOT PRC_DEFAULT_DIR_ABSOLUTE) - set(PRC_DEFAULT_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.") -else() - set(PRC_DEFAULT_DIR "" 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.") -endif() -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.") -if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) - message(FATAL_ERROR "Cannot have both PRC_DEFAULT_DIR and PRC_DEFAULT_DIR_ABSOLUTE, choose one.") -endif() - -# PRC special values for config headers -if(PRC_DEFAULT_DIR_ABSOLUTE) - set(DEFAULT_PRC_DIR ${PRC_ABSOLUTE_DIR}) -else() - set(DEFAULT_PRC_DIR "${CMAKE_INSTALL_PREFIX}/panda/${PRC_DEFAULT_DIR}") -endif() - - - -include(Configure.cmake) +## Configure dtool ## +configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) ## Include dtool subpackages ## add_subdirectory(src/dtoolbase) diff --git a/dtool/Config.cmake b/dtool/Config.cmake new file mode 100644 index 0000000000..6c51d4c06a --- /dev/null +++ b/dtool/Config.cmake @@ -0,0 +1,169 @@ +# PRC Config settings +set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING "Specify the PRC_DEFAULT_DIR as an absolute path.") +if(NOT PRC_DEFAULT_DIR_ABSOLUTE) + set(PRC_DEFAULT_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.") +else() + set(PRC_DEFAULT_DIR "" 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.") +endif() +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.") +if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) + message(FATAL_ERROR "Cannot have both PRC_DEFAULT_DIR and PRC_DEFAULT_DIR_ABSOLUTE, choose one.") +endif() + +# PRC special values for config headers +if(PRC_DEFAULT_DIR_ABSOLUTE) + set(DEFAULT_PRC_DIR ${PRC_ABSOLUTE_DIR}) +else() + set(DEFAULT_PRC_DIR "${CMAKE_INSTALL_PREFIX}/panda/${PRC_DEFAULT_DIR}") +endif() + +### Configure interrogate ### +message(STATUS "") # simple line break +if(HAVE_PYTHON AND HAVE_OPENSSL) + option(USE_INTERROGATE "If on, Panda3D will generate python interfaces" ON) + if(USE_INTERROGATE) + set(HAVE_INTERROGATE TRUE) + endif() +else() + unset(USE_INTERROGATE CACHE) +endif() +if(HAVE_INTERROGATE) + message(STATUS "Compilation will generate Python interfaces.") +else() + message(STATUS "Configuring Panda without Python interfaces.") +endif() + + +### Configure threading support ### +# Add basic use flag for threading +option(BUILD_THREADS "If on, compile Panda3D with threading support." ON) +if(BUILD_THREADS) + set(HAVE_THREADS TRUE) +else() + unset(BUILD_SIMPLE_THREADS CACHE) + unset(BUILD_OS_SIMPLE_THREADS CACHE) +endif() + +# Configure debug threads +if(CMAKE_BUILD_TYPE MATCHES "Debug") + option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) +else() + option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) +endif() +if(BUILD_DEBUG_THREADS) + set(DEBUG_THREADS TRUE) +endif() + +# Add advanced threading configuration +if(HAVE_THREADS) + option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) + if(BUILD_SIMPLE_THREADS) + message(STATUS "Compilation will include simulated threading support.") + option(BUILD_OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches." ON) + + set(SIMPLE_THREADS TRUE) + if(BUILD_OS_SIMPLE_THREADS) + set(OS_SIMPLE_THREADS TRUE) + endif() + else() + unset(BUILD_OS_SIMPLE_THREADS CACHE) + + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) + if(BUILD_PIPELINING) + message(STATUS "Compilation will include full, pipelined threading support.") + else() + message(STATUS "Compilation will include nonpipelined threading support.") + endif() + endif() +else() + message(STATUS "Configuring Panda without threading support.") +endif() + +set(HAVE_POSIX_THREADS FALSE) +if(NOT WIN32) + find_path(PTHREAD_INCLUDE_DIR + NAMES "pthread.h" + PATHS "/usr/include" + ) + if(PTHREAD_INCLUDE_DIR) + set(HAVE_POSIX_THREADS TRUE) + set(CMAKE_CXX_FLAGS "-pthread") + set(CMAKE_CXX_FLAGS_DEBUG "-pthread") + set(CMAKE_CXX_FLAGS_RELEASE "-pthread") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") + set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") + + mark_as_advanced(PTHREAD_INCLUDE_DIR) + endif() +endif() + + +### Configure pipelining ### +if(NOT DEFINED BUILD_PIPELINING) + option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) +endif() +if(BUILD_PIPELINING) + set(DO_PIPELINING TRUE) +endif() + +### Configure OS X options ### +if(APPLE) + option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) + if(BUILD_UNIVERSAL_BINARIES) + message(STATUS "Compilation will create universal binaries.") + set(UNIVERSAL_BINARIES TRUE) + else() + message(STATUS "Compilation will not create universal binaries.") + endif() +endif() + +message(STATUS "") +message(STATUS "See dtool_config.h for more details about the specified configuration.\n") + +include(CheckIncludeFileCXX) +check_include_file_cxx(io.h PHAVE_IO_H) +check_include_file_cxx(iostream PHAVE_IOSTREAM) +check_include_file_cxx(malloc.h PHAVE_MALLOC_H) +check_include_file_cxx(sys/malloc.h PHAVE_SYS_MALLOC_H) +check_include_file_cxx(alloca.h PHAVE_ALLOCA_H) +check_include_file_cxx(locale.h PHAVE_LOCALE_H) +check_include_file_cxx(string.h PHAVE_STRING_H) +check_include_file_cxx(stdlib.h PHAVE_STDLIB_H) +check_include_file_cxx(limits.h PHAVE_LIMITS_H) +check_include_file_cxx(minmax.h PHAVE_MINMAX_H) +check_include_file_cxx(sstream PHAVE_SSTREAM) +check_include_file_cxx(new PHAVE_NEW) +check_include_file_cxx(sys/types.h PHAVE_SYS_TYPES_H) +check_include_file_cxx(sys/time.h PHAVE_SYS_TIME_H) +check_include_file_cxx(unistd.h PHAVE_UNISTD_H) +check_include_file_cxx(utime.h PHAVE_UTIME_H) +check_include_file_cxx(glob.h PHAVE_GLOB_H) +check_include_file_cxx(dirent.h PHAVE_DIRENT_H) +check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H) +check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) +check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) +check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) +check_include_file_cxx(stdint.h PHAVE_STDINT_H) + +# TODO: Actually check for these, instead of assuming +set(HAVE_NAMESPACE ON) +set(HAVE_LOCKF ON) +set(HAVE_WCHAR_T ON) +set(HAVE_WSTRING ON) +set(HAVE_TYPENAME ON) +set(SIMPLE_STRUCT_POINTERS ON) +set(HAVE_STREAMSIZE ON) +set(HAVE_IOS_TYPEDEFS ON) + +if(WIN32) + set(DEFAULT_PATHSEP ";") +else() + set(DEFAULT_PATHSEP ":") +endif() + +configure_file(dtool/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) \ No newline at end of file diff --git a/dtool/Configure.cmake b/dtool/Packages.cmake similarity index 60% rename from dtool/Configure.cmake rename to dtool/Packages.cmake index 8f900ef987..b5325c8216 100644 --- a/dtool/Configure.cmake +++ b/dtool/Packages.cmake @@ -23,7 +23,6 @@ endif() include(ConfigurePackage) - # Find and configure Eigen library find_package(Eigen3 QUIET) config_package(EIGEN "Eigen") @@ -273,151 +272,3 @@ endif() # Find and configure Vorbis #find_package(Vorbis) #config_package(VORBIS COMMENT "Vorbis Ogg decoder") - - -### Configure interrogate ### -message(STATUS "") # simple line break -if(HAVE_PYTHON) - option(USE_INTERROGATE "If on, Panda3D will generate python interfaces" ON) - if(USE_INTERROGATE) - set(HAVE_INTERROGATE TRUE) - endif() -else() - unset(USE_INTERROGATE CACHE) -endif() -if(HAVE_INTERROGATE) - message(STATUS "Compilation will generate Python interfaces.") -else() - message(STATUS "Configuring Panda without Python interfaces.") -endif() - - -### Configure threading support ### -# Add basic use flag for threading -option(BUILD_THREADS "If on, compile Panda3D with threading support." ON) -if(BUILD_THREADS) - set(HAVE_THREADS TRUE) -else() - unset(BUILD_SIMPLE_THREADS CACHE) - unset(BUILD_OS_SIMPLE_THREADS CACHE) -endif() - -# Configure debug threads -if(CMAKE_BUILD_TYPE MATCHES "Debug") - option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) -else() - option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) -endif() -if(BUILD_DEBUG_THREADS) - set(DEBUG_THREADS TRUE) -endif() - -# Add advanced threading configuration -if(HAVE_THREADS) - option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) - if(BUILD_SIMPLE_THREADS) - message(STATUS "Compilation will include simulated threading support.") - option(BUILD_OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches." ON) - - set(SIMPLE_THREADS TRUE) - if(BUILD_OS_SIMPLE_THREADS) - set(OS_SIMPLE_THREADS TRUE) - endif() - else() - unset(BUILD_OS_SIMPLE_THREADS CACHE) - - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) - if(BUILD_PIPELINING) - message(STATUS "Compilation will include full, pipelined threading support.") - else() - message(STATUS "Compilation will include nonpipelined threading support.") - endif() - endif() -else() - message(STATUS "Configuring Panda without threading support.") -endif() - -set(HAVE_POSIX_THREADS FALSE) -if(NOT WIN32) - find_path(PTHREAD_IPATH - NAMES "pthread.h" - PATHS "/usr/include" - ) - if(PTHREAD_IPATH) - set(HAVE_POSIX_THREADS TRUE) - set(THREAD_LIBS pthread) - set(CMAKE_CXX_FLAGS "-pthread") - set(CMAKE_CXX_FLAGS_DEBUG "-pthread") - set(CMAKE_CXX_FLAGS_RELEASE "-pthread") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") - set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") - - mark_as_advanced(PTHREAD_IPATH) - endif() -endif() - - -### Configure pipelining ### -if(NOT DEFINED BUILD_PIPELINING) - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) -endif() -if(BUILD_PIPELINING) - set(DO_PIPELINING TRUE) -endif() - -### Configure OS X options ### -if(APPLE) - option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) - if(BUILD_UNIVERSAL_BINARIES) - message(STATUS "Compilation will create universal binaries.") - set(UNIVERSAL_BINARIES TRUE) - else() - message(STATUS "Compilation will not create universal binaries.") - endif() -endif() - -message(STATUS "") -message(STATUS "See dtool_config.h for more details about the specified configuration.\n") - -include(CheckIncludeFileCXX) -check_include_file_cxx(io.h PHAVE_IO_H) -check_include_file_cxx(iostream PHAVE_IOSTREAM) -check_include_file_cxx(malloc.h PHAVE_MALLOC_H) -check_include_file_cxx(sys/malloc.h PHAVE_SYS_MALLOC_H) -check_include_file_cxx(alloca.h PHAVE_ALLOCA_H) -check_include_file_cxx(locale.h PHAVE_LOCALE_H) -check_include_file_cxx(string.h PHAVE_STRING_H) -check_include_file_cxx(stdlib.h PHAVE_STDLIB_H) -check_include_file_cxx(limits.h PHAVE_LIMITS_H) -check_include_file_cxx(minmax.h PHAVE_MINMAX_H) -check_include_file_cxx(sstream PHAVE_SSTREAM) -check_include_file_cxx(new PHAVE_NEW) -check_include_file_cxx(sys/types.h PHAVE_SYS_TYPES_H) -check_include_file_cxx(sys/time.h PHAVE_SYS_TIME_H) -check_include_file_cxx(unistd.h PHAVE_UNISTD_H) -check_include_file_cxx(utime.h PHAVE_UTIME_H) -check_include_file_cxx(glob.h PHAVE_GLOB_H) -check_include_file_cxx(dirent.h PHAVE_DIRENT_H) -check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H) -check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) -check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) -check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) -check_include_file_cxx(stdint.h PHAVE_STDINT_H) - -# TODO: Actually check for these, instead of assuming -set(HAVE_NAMESPACE ON) -set(HAVE_LOCKF ON) -set(HAVE_WCHAR_T ON) -set(HAVE_WSTRING ON) -set(HAVE_TYPENAME ON) -set(SIMPLE_STRUCT_POINTERS ON) -set(HAVE_STREAMSIZE ON) -set(HAVE_IOS_TYPEDEFS ON) - -if(WIN32) - set(DEFAULT_PATHSEP ";") -else() - set(DEFAULT_PATHSEP ":") -endif() - -configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) diff --git a/dtool/Version.cmake b/dtool/Version.cmake new file mode 100644 index 0000000000..cb4643932c --- /dev/null +++ b/dtool/Version.cmake @@ -0,0 +1,37 @@ +## Panda Version Information ## +set(PANDA_VERSION 1 9 0) +set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL "If true, signifies this is a tagged release rather than a repository snapshot. Scripts that generate source tarballs and/or binary releases for distribution should explicitly set this to true.") +set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING "This should be set by whoever provides a particular distribution of Panda. If you build your own Panda, leave this unchanged.") + +set(P3D_PLUGIN_VERSION 1 0 4) +set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1) + + +## Parse Panda3D Subversions ## +list(GET PANDA_VERSION 0 PANDA_MAJOR_VERSION) +list(GET PANDA_VERSION 1 PANDA_MINOR_VERSION) +list(GET PANDA_VERSION 2 PANDA_SEQUENCE_VERSION) + +string(REPLACE ";" "." PANDA_VERSION_STR "${PANDA_VERSION}") +if(NOT PANDA_OFFICIAL_VERSION) + set(PANDA_VERSION_STR "${PANDA_VERSION_STR}c") +endif() + +set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) + +math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}") + + +## Parse Plugin-framework Subversions ## +list(GET P3D_PLUGIN_VERSION 0 P3D_PLUGIN_MAJOR_VERSION) +list(GET P3D_PLUGIN_VERSION 1 P3D_PLUGIN_MINOR_VERSION) +list(GET P3D_PLUGIN_VERSION 2 P3D_PLUGIN_SEQUENCE_VERSION) + +string(REPLACE ";" "." P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") +if(PANDA_OFFICIAL_VERSION) + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.1000") +else() + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.0") + set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION_STR}c") +endif() +string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") \ No newline at end of file diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index d355d8d579..cbfed8ec85 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -6,20 +6,6 @@ include_directories(../dtoolbase) include_directories(../pystub) include_directories(../prc) -# 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 functionWriter.h From 90e48a9b7d6c0102f6ba9a2a509262756097cc44 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 10:03:00 -0700 Subject: [PATCH 058/744] CMake: Improve documentation for cached Version variables. Add more version variables to cache. --- dtool/Config.cmake | 23 ++++++++++++-------- dtool/Version.cmake | 51 +++++++++++++++++++++++++++++---------------- 2 files changed, 47 insertions(+), 27 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 6c51d4c06a..b9c344366f 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -1,18 +1,23 @@ # PRC Config settings -set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING "Specify the PRC_DEFAULT_DIR as an absolute path.") +set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING + "Specify the PRC_DEFAULT_DIR as an absolute path.") if(NOT PRC_DEFAULT_DIR_ABSOLUTE) set(PRC_DEFAULT_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.") + "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.") else() set(PRC_DEFAULT_DIR "" 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.") + "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.") endif() -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.") +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.") if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) - message(FATAL_ERROR "Cannot have both PRC_DEFAULT_DIR and PRC_DEFAULT_DIR_ABSOLUTE, choose one.") + message("Using PRC_DEFAULT_DIR_ABSOLUTE instead of PRC_DEFAULT_DIR.") endif() # PRC special values for config headers @@ -166,4 +171,4 @@ else() set(DEFAULT_PATHSEP ":") endif() -configure_file(dtool/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) \ No newline at end of file +configure_file(dtool/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) diff --git a/dtool/Version.cmake b/dtool/Version.cmake index cb4643932c..a9ca6c57b0 100644 --- a/dtool/Version.cmake +++ b/dtool/Version.cmake @@ -1,20 +1,34 @@ ## Panda Version Information ## -set(PANDA_VERSION 1 9 0) -set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL "If true, signifies this is a tagged release rather than a repository snapshot. Scripts that generate source tarballs and/or binary releases for distribution should explicitly set this to true.") -set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING "This should be set by whoever provides a particular distribution of Panda. If you build your own Panda, leave this unchanged.") +set(PANDA_VERSION "1.9.0" CACHE STRING + "Use dots to separate the major, minor, and sequence numbers.") +set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL + "If on, signifies this is a tagged release rather than a repository snapshot. +Scripts that generate source tarballs and/or binary releases for +distribution should explicitly set this to true.") +set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING + "This string is reported verbatim by PandaSystem::get_distributor(). +It should be set by whoever provides a particular distribution of Panda. +If you build your own Panda, leave this unchanged.") -set(P3D_PLUGIN_VERSION 1 0 4) -set(P3D_COREAPI_VERSION ${P3D_PLUGIN_VERSION} 1) +set(PANDA_PLUGIN_VERSION "1.1.0" CACHE STRING + "We also define a version for the Panda3D plugin/runtime. This is an +independent version number from PANDA_VERSION or PANDA_PACKAGE_VERSION, +because it is anticipated that this plugin code, once settled, +will need to be updated much less frequently than Panda itself.") +set(P3D_PLUGIN_VERSION "${PANDA_PLUGIN_VERSION}") +set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1") ## Parse Panda3D Subversions ## -list(GET PANDA_VERSION 0 PANDA_MAJOR_VERSION) -list(GET PANDA_VERSION 1 PANDA_MINOR_VERSION) -list(GET PANDA_VERSION 2 PANDA_SEQUENCE_VERSION) +string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}") +list(GET PANDA_VERSION_LIST 0 PANDA_MAJOR_VERSION) +list(GET PANDA_VERSION_LIST 1 PANDA_MINOR_VERSION) +list(GET PANDA_VERSION_LIST 2 PANDA_SEQUENCE_VERSION) -string(REPLACE ";" "." PANDA_VERSION_STR "${PANDA_VERSION}") -if(NOT PANDA_OFFICIAL_VERSION) - set(PANDA_VERSION_STR "${PANDA_VERSION_STR}c") +if(PANDA_OFFICIAL_VERSION) + set(PANDA_VERSION_STR "${PANDA_VERSION}c") +else() + set(PANDA_VERSION_STR "${PANDA_VERSION}c") endif() set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) @@ -23,15 +37,16 @@ math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_ ## Parse Plugin-framework Subversions ## -list(GET P3D_PLUGIN_VERSION 0 P3D_PLUGIN_MAJOR_VERSION) -list(GET P3D_PLUGIN_VERSION 1 P3D_PLUGIN_MINOR_VERSION) -list(GET P3D_PLUGIN_VERSION 2 P3D_PLUGIN_SEQUENCE_VERSION) +string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}") +list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION) +list(GET P3D_PLUGIN_VERSION_LIST 1 P3D_PLUGIN_MINOR_VERSION) +list(GET P3D_PLUGIN_VERSION_LIST 2 P3D_PLUGIN_SEQUENCE_VERSION) -string(REPLACE ";" "." P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") if(PANDA_OFFICIAL_VERSION) + set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.1000") else() - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.0") - set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION_STR}c") + set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}c") + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0") endif() -string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") \ No newline at end of file +string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") From abb19ae689fc983586663af0ccde6fe00ad71de6 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 10:42:33 -0700 Subject: [PATCH 059/744] CMake: Filch some local system config vars from cmake-rdb branch, and misc cleanup. --- dtool/Config.cmake | 129 +++++++++++++++++++++++++++++++-------------- 1 file changed, 88 insertions(+), 41 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index b9c344366f..db98fe2514 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -45,27 +45,41 @@ endif() ### Configure threading support ### -# Add basic use flag for threading -option(BUILD_THREADS "If on, compile Panda3D with threading support." ON) -if(BUILD_THREADS) - set(HAVE_THREADS TRUE) +find_package(Threads) +if(THREADS_FOUND) + # Add basic use flag for threading + option(BUILD_THREADS "If on, compile Panda3D with threading support." ON) + if(BUILD_THREADS) + set(HAVE_THREADS TRUE) + else() + unset(BUILD_SIMPLE_THREADS CACHE) + unset(BUILD_OS_SIMPLE_THREADS CACHE) + endif() else() - unset(BUILD_SIMPLE_THREADS CACHE) - unset(BUILD_OS_SIMPLE_THREADS CACHE) + unset(BUILD_THREADS CACHE) endif() # Configure debug threads -if(CMAKE_BUILD_TYPE MATCHES "Debug") - option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) -else() - option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) -endif() -if(BUILD_DEBUG_THREADS) - set(DEBUG_THREADS TRUE) -endif() - # Add advanced threading configuration if(HAVE_THREADS) + if(CMAKE_BUILD_TYPE MATCHES "Debug") + option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) + else() + option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) + endif() + if(BUILD_DEBUG_THREADS) + set(DEBUG_THREADS TRUE) + endif() + + set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) + if(HAVE_POSIX_THREADS) + set(CMAKE_CXX_FLAGS "-pthread") + set(CMAKE_CXX_FLAGS_DEBUG "-pthread") + set(CMAKE_CXX_FLAGS_RELEASE "-pthread") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") + set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") + endif() + option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) if(BUILD_SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") @@ -89,24 +103,6 @@ else() message(STATUS "Configuring Panda without threading support.") endif() -set(HAVE_POSIX_THREADS FALSE) -if(NOT WIN32) - find_path(PTHREAD_INCLUDE_DIR - NAMES "pthread.h" - PATHS "/usr/include" - ) - if(PTHREAD_INCLUDE_DIR) - set(HAVE_POSIX_THREADS TRUE) - set(CMAKE_CXX_FLAGS "-pthread") - set(CMAKE_CXX_FLAGS_DEBUG "-pthread") - set(CMAKE_CXX_FLAGS_RELEASE "-pthread") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") - set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") - - mark_as_advanced(PTHREAD_INCLUDE_DIR) - endif() -endif() - ### Configure pipelining ### if(NOT DEFINED BUILD_PIPELINING) @@ -130,6 +126,9 @@ endif() message(STATUS "") message(STATUS "See dtool_config.h for more details about the specified configuration.\n") + +### Check for system support of various values ### +# Do we have all these header files? include(CheckIncludeFileCXX) check_include_file_cxx(io.h PHAVE_IO_H) check_include_file_cxx(iostream PHAVE_IOSTREAM) @@ -154,16 +153,64 @@ check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) check_include_file_cxx(stdint.h PHAVE_STDINT_H) +check_include_file_cxx(typeinfo HAVE_RTTI) +check_include_file_cxx(getopt.h PHAVE_GETOPT_H) + +# Do we have these sized type definitions +include(CheckTypeSize) +check_type_size(wchar_t WCHAR_T) + +# Does the compiler accept these declarations +include(CheckCXXSourceCompiles) +check_cxx_source_compiles( + "#include + std::wstring str; + int main(int argc, char *argv[]) { return 0; }" + HAVE_WSTRING) + +# Do we have these standard functions +include(CheckFunctionExists) +check_function_exists(getopt HAVE_GETOPT) +check_function_exists(getopt_long_only HAVE_GETOPT_LONG_ONLY) + +# Are we on a big endian system? +include(TestBigEndian) +test_big_endian(WORDS_BIGENDIAN) + +# Do we support std namespaces? +include(TestForSTDNamespace) +set(HAVE_NAMESPACE CMAKE_STD_NAMESPACE) + +# Can we read the file /proc/self/[*] to determine our +# environment variables at static init time? +if(EXISTS "/proc/self/exe") + set(HAVE_PROC_SELF_EXE TRUE) +endif() +if(EXISTS "/proc/self/maps") + set(HAVE_PROC_SELF_MAPS TRUE) +endif() +if(EXISTS "/proc/self/environ") + set(HAVE_PROC_SELF_ENVIRON TRUE) +endif() +if(EXISTS "/proc/self/cmdline") + set(HAVE_PROC_SELF_CMDLINE TRUE) +endif() +if(EXISTS "/proc/curproc/file") + set(HAVE_PROC_CURPROC_FILE TRUE) +endif() +if(EXISTS "/proc/curproc/map") + set(HAVE_PROC_CURPROC_MAP TRUE) +endif() +if(EXISTS "/proc/curproc/cmdline") + set(HAVE_PROC_CURPROC_CMDLINE TRUE) +endif() # TODO: Actually check for these, instead of assuming -set(HAVE_NAMESPACE ON) -set(HAVE_LOCKF ON) -set(HAVE_WCHAR_T ON) -set(HAVE_WSTRING ON) -set(HAVE_TYPENAME ON) -set(SIMPLE_STRUCT_POINTERS ON) -set(HAVE_STREAMSIZE ON) -set(HAVE_IOS_TYPEDEFS ON) +set(HAVE_LOCKF TRUE) +set(HAVE_TYPENAME TRUE) +set(SIMPLE_STRUCT_POINTERS TRUE) +set(HAVE_STREAMSIZE TRUE) +set(HAVE_IOS_TYPEDEFS TRUE) if(WIN32) set(DEFAULT_PATHSEP ";") From 5c85d29d27fd0fbbb88417ee5b42aed1da34be27 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 11:02:37 -0700 Subject: [PATCH 060/744] CMake: Configure: Cherry-pick more documentation and misc config vars from cmake-rdb branch. --- dtool/Config.cmake | 74 ++++++++++++++++++++++++++++++++++++++++---- dtool/Packages.cmake | 2 +- 2 files changed, 69 insertions(+), 7 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index db98fe2514..0ceb63ca53 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -12,13 +12,29 @@ else() default .prc directory if the PRC_PATH and PRC_DIR environment variables are not defined.") endif() +if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) + message("Using PRC_DEFAULT_DIR_ABSOLUTE instead of PRC_DEFAULT_DIR.") +endif() + +set(PRC_DIR_ENVVARS "PANDA_PRC_DIR" CACHE STRING "") +set(PRC_PATH_ENVVARS "PANDA_PRC_PATH" CACHE STRING "") +set(PRC_PATH2_ENVVARS "" CACHE STRING "") +set(PRC_PATTERNS "*.prc" CACHE STRING "") +set(PRC_ENCRYPTED_PATTERNS "*.prc.pe" CACHE STRING "") +set(PRC_ENCRYPTION_KEY "" CACHE STRING "") +set(PRC_EXECUTABLE_PATTERNS "" CACHE STRING "") +set(PRC_EXECUTABLE_ARGS_ENVVAR "PANDA_PRC_XARGS" CACHE STRING "") +set(PRC_PUBLIC_KEYS_FILENAME "" CACHE STRING "") +set(PRC_RESPECT_TRUST_LEVEL CACHE STRING "") 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.") -if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) - message("Using PRC_DEFAULT_DIR_ABSOLUTE instead of PRC_DEFAULT_DIR.") -endif() +mark_as_advanced(PRC_DEFAULT_DIR PRC_DEFAULT_DIR_ABSOLUTE PRC_DIR_ENVVARS + PRC_PATH_ENVVARS PRC_PATH2_ENVVARS PRC_PATTERNS PRC_ENCRYPTED_PATTERNS + PRC_ENCRYPTION_KEY PRC_EXECUTABLE_PATTERNS PRC_EXECUTABLE_ARGS_ENVVAR + PRC_PUBLIC_KEYS_FILENAME PRC_RESPECT_TRUST_LEVEL + PRC_DCONFIG_TRUST_LEVEL PRC_INC_TRUST_LEVEL) # PRC special values for config headers if(PRC_DEFAULT_DIR_ABSOLUTE) @@ -48,7 +64,12 @@ endif() find_package(Threads) if(THREADS_FOUND) # Add basic use flag for threading - option(BUILD_THREADS "If on, compile Panda3D with threading support." ON) + option(BUILD_THREADS + "If on, compile Panda3D with threading support. +Building in support for threading will enable Panda to take +advantage of multiple CPU's if you have them (and if the OS +supports kernel threads running on different CPU's), but it will +slightly slow down Panda for the single CPU case." ON) if(BUILD_THREADS) set(HAVE_THREADS TRUE) else() @@ -80,10 +101,24 @@ if(HAVE_THREADS) set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") endif() - option(BUILD_SIMPLE_THREADS "If on, compile with simulated threads." OFF) + option(BUILD_SIMPLE_THREADS + "If on, compile with simulated threads. Threads, by default, use +OS-provided threading constructs, which usually allows for full +multithreading support (i.e. the program can use multiple CPU's). +On the other hand, compiling in this full OS-provided support can +impose some substantial runtime overhead, making the application +run slower on a single-CPU machine. This settings avoid the overhead, +but still gain some of the basic functionality of threads." OFF) + if(BUILD_SIMPLE_THREADS) message(STATUS "Compilation will include simulated threading support.") - option(BUILD_OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches." ON) + option(BUILD_OS_SIMPLE_THREADS + "If on, OS threading constructs will be used to perform context switches. +A mutex is used to ensure that only one thread runs at a time, so the +normal SIMPLE_THREADS optimizations still apply, and the normal +SIMPLE_THREADS scheduler is used to switch between threads (instead +of the OS scheduler). This may be more portable and more reliable, +but it is a hybrid between user-space threads and os-provided threads." ON) set(SIMPLE_THREADS TRUE) if(BUILD_OS_SIMPLE_THREADS) @@ -126,6 +161,33 @@ endif() message(STATUS "") message(STATUS "See dtool_config.h for more details about the specified configuration.\n") +### Miscellaneous configuration +if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") + unset(BUILD_WITH_DEFAULT_FONT CACHE) + option(BUILD_WITH_DEFAULT_FONT + "If on, compiles in a default font, so that every TextNode will always +have a font available without requiring the user to specify one. +When turned off, the generated libary will save a few kilobytes." OFF) +else() + option(BUILD_WITH_DEFAULT_FONT + "If on, compiles in a default font, so that every TextNode will always +have a font available without requiring the user to specify one. +When turned off, the generated libary will save a few kilobytes." ON) +endif() +if(BUILD_WITH_DEFAULT_FONT) + set(COMPILE_IN_DEFAULT_FONT TRUE) +endif() + +option(BUILD_PREFER_STDFLOAT + "Define this true to compile a special version of Panda to use a +'double' floating-precision type for most internal values, such as +positions and transforms, instead of the standard single-precision +'float' type. This does not affect the default numeric type of +vertices, which is controlled by the runtime config variable +vertices-float64." OFF) +if(BUILD_PREFER_STDFLOAT) + set(STDFLOAT_DOUBLE TRUE) +endif() ### Check for system support of various values ### # Do we have all these header files? diff --git a/dtool/Packages.cmake b/dtool/Packages.cmake index b5325c8216..461d2e3cd3 100644 --- a/dtool/Packages.cmake +++ b/dtool/Packages.cmake @@ -1,5 +1,5 @@ message(STATUS "") -message("Configuring support for the following optional third-party packages:") +message(STATUS "Configuring support for the following optional third-party packages:") # Settings to change USE_PACKAGE behavior (these options override cached values) set(CONFIG_ENABLE_EVERYTHING Off) From 81e4f8742057eacbad6379690466952aee846cf4 Mon Sep 17 00:00:00 2001 From: kestred Date: Fri, 13 Dec 2013 11:06:08 -0700 Subject: [PATCH 061/744] CMake: Don't smash CMAKE flags when using posix threads. --- dtool/Config.cmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 0ceb63ca53..9574e12237 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -94,11 +94,11 @@ if(HAVE_THREADS) set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) if(HAVE_POSIX_THREADS) - set(CMAKE_CXX_FLAGS "-pthread") - set(CMAKE_CXX_FLAGS_DEBUG "-pthread") - set(CMAKE_CXX_FLAGS_RELEASE "-pthread") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-pthread") - set(CMAKE_CXX_FLAGS_MINSIZEREL "-pthread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pthread") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pthread") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -pthread") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -pthread") endif() option(BUILD_SIMPLE_THREADS From 7a66d4ea2f9bc6030234de98901564c637048d4c Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 14 Dec 2013 12:08:30 +0100 Subject: [PATCH 062/744] Fix issues with version, copy over documentation for version vars. --- dtool/Version.cmake | 86 +++++++++++++------ .../src/dtoolutil/checkPandaVersion.cxx.cmake | 2 +- dtool/src/dtoolutil/checkPandaVersion.h.cmake | 6 +- dtool/src/dtoolutil/pandaVersion.h.cmake | 8 +- 4 files changed, 70 insertions(+), 32 deletions(-) diff --git a/dtool/Version.cmake b/dtool/Version.cmake index a9ca6c57b0..69efa2477c 100644 --- a/dtool/Version.cmake +++ b/dtool/Version.cmake @@ -1,52 +1,90 @@ -## Panda Version Information ## +# This file defines the current version number for Panda. It is read +# by the top CMakeLists.txt, which puts it in the global namespace for +# all CMake scripts for Panda. + set(PANDA_VERSION "1.9.0" CACHE STRING "Use dots to separate the major, minor, and sequence numbers.") -set(PANDA_OFFICIAL_VERSION FALSE CACHE BOOL - "If on, signifies this is a tagged release rather than a repository snapshot. -Scripts that generate source tarballs and/or binary releases for -distribution should explicitly set this to true.") -set(PANDA_DISTRIBUTOR "homebuilt" CACHE STRING + +option(PANDA_OFFICIAL_VERSION + "This variable will be defined to false in the CVS repository, but +scripts that generate source tarballs and/or binary releases for +distribution, by checking out Panda from an official CVS tag, +should explictly set this to true. When false, it indicates that +the current version of Panda was checked out from CVS, so it may +not be a complete representation of the indicated version." + OFF) + +set(PANDA_DISTRIBUTOR homebuilt CACHE STRING "This string is reported verbatim by PandaSystem::get_distributor(). -It should be set by whoever provides a particular distribution of Panda. -If you build your own Panda, leave this unchanged.") +It should be set by whoever provides a particular distribution of +Panda. If you build your own Panda, leave this unchanged.") -set(PANDA_PLUGIN_VERSION "1.1.0" CACHE STRING - "We also define a version for the Panda3D plugin/runtime. This is an -independent version number from PANDA_VERSION or PANDA_PACKAGE_VERSION, -because it is anticipated that this plugin code, once settled, -will need to be updated much less frequently than Panda itself.") -set(P3D_PLUGIN_VERSION "${PANDA_PLUGIN_VERSION}") -set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1") +set(PANDA_PACKAGE_VERSION CACHE STRING + "This string is used to describe the Panda3D \"package\" associated +with this current build of Panda. It should increment with major +and minor version changes, but not sequence (or \"bugfix\") changes. +It should be unique for each unique distributor. The default is +the empty string, which means this build does not precisely match +any distributable Panda3D packages. If you are making a Panda3D +build which you will be using to produce a distributable Panda3D +package, you should set this string appropriately.") + +set(P3D_PLUGIN_VERSION "1.0.4" CACHE STRING + "We also define a version for the Panda3D plugin/runtime, +i.e. nppanda3d.dll, p3dactivex.ocx, and panda3d.exe. This is an +independent version number from PANDA_VERSION or +PANDA_PACKAGE_VERSION, because it is anticipated that this plugin +code, once settled, will need to be updated much less frequently +than Panda itself.") + +set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1" CACHE STRING + "Finally, there's a separate version number for the Core API. At +first, we didn't believe we needed a Core API version number, but +in this belief we were naive. This version number is a little less +strict in its format requirements than P3D_PLUGIN_VERSION, above, +and it doesn't necessarily consist of a specific number of +integers, but by convention it will consist of four integers, with +the first three matching the plugin version, and the fourth integer +being incremented with each new Core API revision.") -## Parse Panda3D Subversions ## +# Separate the Panda3D version into its three components. string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}") list(GET PANDA_VERSION_LIST 0 PANDA_MAJOR_VERSION) list(GET PANDA_VERSION_LIST 1 PANDA_MINOR_VERSION) list(GET PANDA_VERSION_LIST 2 PANDA_SEQUENCE_VERSION) +# The version gets a "c" at the end if it's not an official one. if(PANDA_OFFICIAL_VERSION) - set(PANDA_VERSION_STR "${PANDA_VERSION}c") + set(VERSION_SUFFIX "") else() - set(PANDA_VERSION_STR "${PANDA_VERSION}c") + set(VERSION_SUFFIX "c") endif() +set(PANDA_VERSION_STR "${PANDA_VERSION}c") + +# This symbol is used to enforce ABI incompatibility between +# major versions of Panda3D. set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) +# The Panda version as a number, with three digits reserved +# for each component. math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}") - -## Parse Plugin-framework Subversions ## +# Separate the plugin version into its three components. string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}") list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION) list(GET P3D_PLUGIN_VERSION_LIST 1 P3D_PLUGIN_MINOR_VERSION) list(GET P3D_PLUGIN_VERSION_LIST 2 P3D_PLUGIN_SEQUENCE_VERSION) +set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}${VERSION_SUFFIX}") + +# The plugin version as dot-delimited integer quad, according to MS +# conventions for DLL version numbers. if(PANDA_OFFICIAL_VERSION) - set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}") - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION_STR}.1000") + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.1000") else() - set(P3D_PLUGIN_VERSION_STR "${P3D_PLUGIN_VERSION}c") - set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0") + set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0") endif() +# The same thing as a comma-delimited quad. string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") diff --git a/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake b/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake index db059b6870..f268bfbd21 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake +++ b/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake @@ -16,6 +16,6 @@ * Generated automatically by CMake. ***************************** DO NOT EDIT *************************/ -# include "dtoolbase.h" +#include "dtoolbase.h" EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@ = 0; diff --git a/dtool/src/dtoolutil/checkPandaVersion.h.cmake b/dtool/src/dtoolutil/checkPandaVersion.h.cmake index de76900fc0..583f3b00f6 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.h.cmake +++ b/dtool/src/dtoolutil/checkPandaVersion.h.cmake @@ -26,14 +26,14 @@ DLL; but the system linker will prevent the DLL from loading with an undefined symbol. */ -# include "dtoolbase.h" +#include "dtoolbase.h" extern EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@; -# ifndef WIN32 +#ifndef WIN32 /* For Windows, exporting the symbol from the DLL is sufficient; the DLL will not load unless all expected public symbols are defined. Other systems may not mind if the symbol is absent unless we explictly write code that references it. */ static int check_panda_version = @PANDA_VERSION_SYMBOL@; -# endif +#endif diff --git a/dtool/src/dtoolutil/pandaVersion.h.cmake b/dtool/src/dtoolutil/pandaVersion.h.cmake index 19321d09a8..350a229e4e 100644 --- a/dtool/src/dtoolutil/pandaVersion.h.cmake +++ b/dtool/src/dtoolutil/pandaVersion.h.cmake @@ -18,7 +18,7 @@ Do NOT attempt to edit the version number in this file. This is a generated file, and your changes to this file will not persist. To - increment the version number, modify dtool/PandaVersion.pp and + increment the version number, modify dtool/PandaVersion.cmake and re-run ppremake. ***************************** DO NOT EDIT *************************/ @@ -70,8 +70,8 @@ #if HAVE_P3D_PLUGIN /* Similar definitions for the plugin versioning, if in use. */ -#define P3D_PLUGIN_MAJOR_VERSION "@P3D_PLUGIN_MAJOR_VERSION@" -#define P3D_PLUGIN_MINOR_VERSION "@P3D_PLUGIN_MINOR_VERSION@" -#define P3D_PLUGIN_SEQUENCE_VERSION "@P3D_PLUGIN_SEQUENCE_VERSION@" +#define P3D_PLUGIN_MAJOR_VERSION @P3D_PLUGIN_MAJOR_VERSION@ +#define P3D_PLUGIN_MINOR_VERSION @P3D_PLUGIN_MINOR_VERSION@ +#define P3D_PLUGIN_SEQUENCE_VERSION @P3D_PLUGIN_SEQUENCE_VERSION@ #define P3D_COREAPI_VERSION_STR "@P3D_COREAPI_VERSION_STR@" #endif From 39bea67211354c7aa9de0712936546d35af0a14f Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 14 Dec 2013 14:51:36 +0100 Subject: [PATCH 063/744] Split automated compiler settings into LocalSetup.cmake. Rename Version.cmake into PandaVersion.cmake. --- CMakeLists.txt | 4 +- dtool/CMakeLists.txt | 2 +- dtool/Config.cmake | 96 +---------- dtool/LocalSetup.cmake | 179 ++++++++++++++++++++ dtool/{Version.cmake => PandaVersion.cmake} | 2 +- 5 files changed, 191 insertions(+), 92 deletions(-) create mode 100644 dtool/LocalSetup.cmake rename dtool/{Version.cmake => PandaVersion.cmake} (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9ac44d2a7..76c91556bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,10 +5,10 @@ project(Panda3D) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") ## This is where dtool_config.h gets generated ## -include_directories("${CMAKE_BINARY_DIR}/include") +include_directories("${CMAKE_BINARY_DIR}") ## Configure Panda3D ##( -include(dtool/Version.cmake) +include(dtool/PandaVersion.cmake) include(dtool/Packages.cmake) include(dtool/Config.cmake) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 161814cd3d..0497ff114e 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -1,5 +1,5 @@ ## Configure dtool ## -configure_file(dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) +include(LocalSetup.cmake) ## Include dtool subpackages ## add_subdirectory(src/dtoolbase) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 9574e12237..954399e2f1 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -167,12 +167,12 @@ if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") option(BUILD_WITH_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. -When turned off, the generated libary will save a few kilobytes." OFF) +When turned off, the generated library will save a few kilobytes." OFF) else() option(BUILD_WITH_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. -When turned off, the generated libary will save a few kilobytes." ON) +When turned off, the generated library will save a few kilobytes." ON) endif() if(BUILD_WITH_DEFAULT_FONT) set(COMPILE_IN_DEFAULT_FONT TRUE) @@ -189,95 +189,15 @@ if(BUILD_PREFER_STDFLOAT) set(STDFLOAT_DOUBLE TRUE) endif() -### Check for system support of various values ### -# Do we have all these header files? -include(CheckIncludeFileCXX) -check_include_file_cxx(io.h PHAVE_IO_H) -check_include_file_cxx(iostream PHAVE_IOSTREAM) -check_include_file_cxx(malloc.h PHAVE_MALLOC_H) -check_include_file_cxx(sys/malloc.h PHAVE_SYS_MALLOC_H) -check_include_file_cxx(alloca.h PHAVE_ALLOCA_H) -check_include_file_cxx(locale.h PHAVE_LOCALE_H) -check_include_file_cxx(string.h PHAVE_STRING_H) -check_include_file_cxx(stdlib.h PHAVE_STDLIB_H) -check_include_file_cxx(limits.h PHAVE_LIMITS_H) -check_include_file_cxx(minmax.h PHAVE_MINMAX_H) -check_include_file_cxx(sstream PHAVE_SSTREAM) -check_include_file_cxx(new PHAVE_NEW) -check_include_file_cxx(sys/types.h PHAVE_SYS_TYPES_H) -check_include_file_cxx(sys/time.h PHAVE_SYS_TIME_H) -check_include_file_cxx(unistd.h PHAVE_UNISTD_H) -check_include_file_cxx(utime.h PHAVE_UTIME_H) -check_include_file_cxx(glob.h PHAVE_GLOB_H) -check_include_file_cxx(dirent.h PHAVE_DIRENT_H) -check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H) -check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) -check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) -check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) -check_include_file_cxx(stdint.h PHAVE_STDINT_H) -check_include_file_cxx(typeinfo HAVE_RTTI) -check_include_file_cxx(getopt.h PHAVE_GETOPT_H) - -# Do we have these sized type definitions -include(CheckTypeSize) -check_type_size(wchar_t WCHAR_T) - -# Does the compiler accept these declarations -include(CheckCXXSourceCompiles) -check_cxx_source_compiles( - "#include - std::wstring str; - int main(int argc, char *argv[]) { return 0; }" - HAVE_WSTRING) - -# Do we have these standard functions -include(CheckFunctionExists) -check_function_exists(getopt HAVE_GETOPT) -check_function_exists(getopt_long_only HAVE_GETOPT_LONG_ONLY) - -# Are we on a big endian system? -include(TestBigEndian) -test_big_endian(WORDS_BIGENDIAN) - -# Do we support std namespaces? -include(TestForSTDNamespace) -set(HAVE_NAMESPACE CMAKE_STD_NAMESPACE) - -# Can we read the file /proc/self/[*] to determine our -# environment variables at static init time? -if(EXISTS "/proc/self/exe") - set(HAVE_PROC_SELF_EXE TRUE) -endif() -if(EXISTS "/proc/self/maps") - set(HAVE_PROC_SELF_MAPS TRUE) -endif() -if(EXISTS "/proc/self/environ") - set(HAVE_PROC_SELF_ENVIRON TRUE) -endif() -if(EXISTS "/proc/self/cmdline") - set(HAVE_PROC_SELF_CMDLINE TRUE) -endif() -if(EXISTS "/proc/curproc/file") - set(HAVE_PROC_CURPROC_FILE TRUE) -endif() -if(EXISTS "/proc/curproc/map") - set(HAVE_PROC_CURPROC_MAP TRUE) -endif() -if(EXISTS "/proc/curproc/cmdline") - set(HAVE_PROC_CURPROC_CMDLINE TRUE) -endif() - -# TODO: Actually check for these, instead of assuming -set(HAVE_LOCKF TRUE) -set(HAVE_TYPENAME TRUE) -set(SIMPLE_STRUCT_POINTERS TRUE) -set(HAVE_STREAMSIZE TRUE) -set(HAVE_IOS_TYPEDEFS TRUE) +#XXX note from rdb: I've moved the automatically-configured +# compiler settings to LocalSetup.cmake, which is also where +# dtool_config.h.cmake is now being invoked. +# LocalSetup.cmake is included in dtool/CMakeLists.txt, which +# is OK since the variables in there don't have to be used +# outside of dtool_config.h.cmake. if(WIN32) set(DEFAULT_PATHSEP ";") else() set(DEFAULT_PATHSEP ":") endif() - -configure_file(dtool/dtool_config.h.cmake ${CMAKE_BINARY_DIR}/include/dtool_config.h) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake new file mode 100644 index 0000000000..9cc9395ad5 --- /dev/null +++ b/dtool/LocalSetup.cmake @@ -0,0 +1,179 @@ +# +# LocalSetup.cmake +# +# This file contains further instructions to set up the DTOOL package +# when using CMake. In particular, it creates the dtool_config.h +# file based on the user's selected configure variables. +# + +include(CheckCXXSourceCompiles) +include(CheckCSourceRuns) +include(CheckIncludeFileCXX) +include(CheckFunctionExists) +include(CheckTypeSize) +include(TestBigEndian) +include(TestForSTDNamespace) + +# Define if we have libjpeg installed. +check_include_file_cxx(jpegint.h PHAVE_JPEGINT_H) + +# Define to build video-for-linux. +check_include_file_cxx(linux/videodev2.h HAVE_VIDEO4LINUX) + +# Check if this is a big-endian system. +test_big_endian(WORDS_BIGENDIAN) + +# Check if the compiler supports namespaces. +set(HAVE_NAMESPACE ${CMAKE_STD_NAMESPACE}) + +# Define if fstream::open() accepts a third parameter for umask. +#TODO make test case +#$[cdefine HAVE_OPEN_MASK] + +# Define if we have lockf(). +#TODO make test case +set(HAVE_LOCKF 1) + +# Check if we have a wchar_t type. +check_type_size(wchar_t HAVE_WCHAR_T) + +# Check if we have a wstring type. +check_cxx_source_compiles(" +#include +std::wstring str; +int main(int argc, char *argv[]) { return 0; } +" HAVE_WSTRING) + +# Define if the C++ compiler supports the typename keyword. +#TODO make test case (I had one but it broke) +set(HAVE_TYPENAME 1) + +# Define if we can trust the compiler not to insert extra bytes in +# structs between base structs and derived structs. +check_c_source_runs(" +struct A { int a; }; +struct B : public A { int b; }; +int main(int argc, char *argv[]) { + struct B i; + if ((size_t) &(i.b) == ((size_t) &(i.a)) + sizeof(struct A)) { + return 0; + } else { + return 1; + } +}" SIMPLE_STRUCT_POINTERS) + +# Define if we have STL hash_map etc. available +#TODO make test case +#//$[cdefine HAVE_STL_HASH] + +# Check if we have a gettimeofday() function. +check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) + +# Define if gettimeofday() takes only one parameter. +check_cxx_source_compiles(" +#include +int main(int argc, char *argv[]) { + struct timeval tv; + int result; + result = gettimeofday(&tv); + return 0; +}" GETTIMEOFDAY_ONE_PARAM) + +# Check if we have getopt. +check_function_exists(getopt HAVE_GETOPT) +check_function_exists(getopt_long_only HAVE_GETOPT_LONG_ONLY) +check_include_file_cxx(getopt.h PHAVE_GETOPT_H) + +# Define if you have ioctl(TIOCGWINSZ) to determine terminal width. +#XXX can we make a test case for this that isn't dependent on +# the current terminal? It might also be useful for Cygwin users. +if(UNIX) + set(IOCTL_TERMINAL_WIDTH 1) +endif() + +# Do the system headers define a "streamsize" typedef? +check_cxx_source_compiles(" +#include +std::streamsize ss; +int main(int argc, char *argv[]) { return 0; } +" HAVE_STREAMSIZE) + +# Do the system headers define key ios typedefs like ios::openmode +# and ios::fmtflags? +#TODO make test case +set(HAVE_IOS_TYPEDEFS 1) + +# Define if the C++ iostream library defines ios::binary. +#TODO make test case +#$[cdefine HAVE_IOS_BINARY] + +# Can we safely call getenv() at static init time? +#TODO make test case? can we make a reliable one? +#$[cdefine STATIC_INIT_GETENV] + +# Can we read the file /proc/self/[*] to determine our +# environment variables at static init time? +if(EXISTS "/proc/self/exe") + set(HAVE_PROC_SELF_EXE 1) +endif() +if(EXISTS "/proc/self/maps") + set(HAVE_PROC_SELF_MAPS 1) +endif() +if(EXISTS "/proc/self/environ") + set(HAVE_PROC_SELF_ENVIRON 1) +endif() +if(EXISTS "/proc/self/cmdline") + set(HAVE_PROC_SELF_CMDLINE 1) +endif() +if(EXISTS "/proc/curproc/file") + set(HAVE_PROC_CURPROC_FILE 1) +endif() +if(EXISTS "/proc/curproc/map") + set(HAVE_PROC_CURPROC_MAP 1) +endif() +if(EXISTS "/proc/curproc/cmdline") + set(HAVE_PROC_CURPROC_CMDLINE 1) +endif() + +# Do we have a global pair of argc/argv variables that we can read at +# static init time? Should we prototype them? What are they called? +#TODO make test case +#$[cdefine HAVE_GLOBAL_ARGV] +#$[cdefine PROTOTYPE_GLOBAL_ARGV] +#$[cdefine GLOBAL_ARGV] +#$[cdefine GLOBAL_ARGC] + +# Do we have all these header files? +check_include_file_cxx(io.h PHAVE_IO_H) +check_include_file_cxx(iostream PHAVE_IOSTREAM) +check_include_file_cxx(malloc.h PHAVE_MALLOC_H) +check_include_file_cxx(sys/malloc.h PHAVE_SYS_MALLOC_H) +check_include_file_cxx(alloca.h PHAVE_ALLOCA_H) +check_include_file_cxx(locale.h PHAVE_LOCALE_H) +check_include_file_cxx(string.h PHAVE_STRING_H) +check_include_file_cxx(stdlib.h PHAVE_STDLIB_H) +check_include_file_cxx(limits.h PHAVE_LIMITS_H) +check_include_file_cxx(minmax.h PHAVE_MINMAX_H) +check_include_file_cxx(sstream PHAVE_SSTREAM) +check_include_file_cxx(new PHAVE_NEW) +check_include_file_cxx(sys/types.h PHAVE_SYS_TYPES_H) +check_include_file_cxx(sys/time.h PHAVE_SYS_TIME_H) +check_include_file_cxx(unistd.h PHAVE_UNISTD_H) +check_include_file_cxx(utime.h PHAVE_UTIME_H) +check_include_file_cxx(glob.h PHAVE_GLOB_H) +check_include_file_cxx(dirent.h PHAVE_DIRENT_H) +check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H) +check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) +check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) #TODO doesn't work on OSX, use sys/ucontext.h +check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) +check_include_file_cxx(stdint.h PHAVE_STDINT_H) +check_include_file_cxx(typeinfo HAVE_RTTI) + +# Do we have Posix threads? +#set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) + +#/* Define if needed to have 64-bit file i/o */ +#$[cdefine __USE_LARGEFILE64] + +configure_file(dtool_config.h.cmake "${PROJECT_BINARY_DIR}/dtool_config.h") +#install(FILES "${PROJECT_BINARY_DIR}/dtool_config.h" DESTINATION include/panda3d) diff --git a/dtool/Version.cmake b/dtool/PandaVersion.cmake similarity index 98% rename from dtool/Version.cmake rename to dtool/PandaVersion.cmake index 69efa2477c..5e2bd15ef1 100644 --- a/dtool/Version.cmake +++ b/dtool/PandaVersion.cmake @@ -61,7 +61,7 @@ else() set(VERSION_SUFFIX "c") endif() -set(PANDA_VERSION_STR "${PANDA_VERSION}c") +set(PANDA_VERSION_STR "${PANDA_VERSION}${VERSION_SUFFIX}") # This symbol is used to enforce ABI incompatibility between # major versions of Panda3D. From b002c8299a59a9485d994ecfb6c31cbbec7aa9ea Mon Sep 17 00:00:00 2001 From: rdb Date: Sat, 14 Dec 2013 17:28:51 +0100 Subject: [PATCH 064/744] Work on Config.cmake (add documentation and such) --- cmake/README.md | 4 +- dtool/CMakeLists.txt | 6 +- dtool/Config.cmake | 267 ++++++++++++++++++++++++++++++++--------- dtool/LocalSetup.cmake | 1 + panda/CMakeLists.txt | 2 +- 5 files changed, 220 insertions(+), 60 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 203a8753fc..0b2437f71b 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -38,10 +38,10 @@ Configuration settings use more direct names: ``` -For example, `makepanda.py --distributor X` becomes `cmake -DDISTRIBUTOR +For example, `makepanda.py --distributor X` becomes `cmake -DPANDA_DISTRIBUTOR=X` All third-party libraries are enabled by default and Panda3D will -be compiled with any 3rd party library that is found. +be compiled with any third-party library that is found. Third-party libraries can be enabled or disabled through configuration with the cmake gui or cli. diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 0497ff114e..6422d57d5a 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -1,7 +1,7 @@ -## Configure dtool ## +# Generate dtool_config.h include(LocalSetup.cmake) -## Include dtool subpackages ## +# Include dtool source directories add_subdirectory(src/dtoolbase) add_subdirectory(src/dtoolutil) add_subdirectory(src/prc) @@ -11,5 +11,5 @@ add_subdirectory(src/cppparser) add_subdirectory(src/interrogatedb) add_subdirectory(src/interrogate) -## Include dtool metalibs ## +# Include dtool metalibs add_subdirectory(metalibs/dtool) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 954399e2f1..ebbee61487 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -1,64 +1,228 @@ -# PRC Config settings -set(PRC_DEFAULT_DIR_ABSOLUTE "" CACHE STRING - "Specify the PRC_DEFAULT_DIR as an absolute path.") -if(NOT PRC_DEFAULT_DIR_ABSOLUTE) - set(PRC_DEFAULT_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.") +# +# dtool/Config.cmake +# +# This file defines certain configuration variables that are written +# into the various make scripts. It is processed by CMake to +# generate build scripts appropriate to each environment. +# + +# The character used to separate components of an OS-specific +# directory name depends on the platform (it is '/' on Unix, '\' on +# Windows). That character selection is hardcoded into Panda and +# cannot be changed here. (Note that an internal Panda filename +# always uses the forward slash, '/', to separate the components of a +# directory name.) + +# There's a different character used to separate the complete +# directory names in a search path specification. On Unix, the +# normal convention is ':', on Windows, it has to be ';', because the +# colon is already used to mark the drive letter. This character is +# selectable here. Most users won't want to change this. If +# multiple characters are placed in this string, any one of them may +# be used as a separator character. + +if(WIN32) + set(DEFAULT_PATHSEP ";") else() - set(PRC_DEFAULT_DIR "" 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.") -endif() -if(PRC_DEFAULT_DIR AND PRC_DEFAULT_DIR_ABSOLUTE) - message("Using PRC_DEFAULT_DIR_ABSOLUTE instead of PRC_DEFAULT_DIR.") + set(DEFAULT_PATHSEP ":") endif() -set(PRC_DIR_ENVVARS "PANDA_PRC_DIR" CACHE STRING "") -set(PRC_PATH_ENVVARS "PANDA_PRC_PATH" CACHE STRING "") -set(PRC_PATH2_ENVVARS "" CACHE STRING "") -set(PRC_PATTERNS "*.prc" CACHE STRING "") -set(PRC_ENCRYPTED_PATTERNS "*.prc.pe" CACHE STRING "") -set(PRC_ENCRYPTION_KEY "" CACHE STRING "") -set(PRC_EXECUTABLE_PATTERNS "" CACHE STRING "") -set(PRC_EXECUTABLE_ARGS_ENVVAR "PANDA_PRC_XARGS" CACHE STRING "") +# Panda uses prc files for runtime configuration. There are many +# compiled-in options to customize the behavior of the prc config +# system; most users won't need to change any of them. Feel free to +# skip over all of the PRC_* variables defined here. + +# The default behavior is to search for files names *.prc in the +# directory specified by the PRC_DIR environment variable, and then +# to search along all of the directories named by the PRC_PATH +# environment variable. Either of these variables might be +# undefined; if both of them are undefined, the default is to search +# in the directory named here by DEFAULT_PRC_DIR. + +# By default, we specify the /etc dir, which is a special +# syntax that causes it to automatically search up the directory +# tree starting at the location of libpandaexpress.dll for any +# directories called 'etc'. + +set(DEFAULT_PRC_DIR "etc" CACHE STRING + "The compiled-in default directory to look for the Config.prc file, +in the absence of the PRC_DIR environment variable set, and in +the absence of anything specified via the configpath directive.") + +# You can specify the names of the environment variables that are +# used to specify the search location(s) for prc files at runtime. +# These are space-separated lists of environment variable names. +# Specify empty string for either one of these to disable the +# feature. For instance, redefining PRC_DIR_ENVVARS here to +# PRC_DIR would cause the environment variable $PRC_DIR +# to be consulted at startup instead of the default value of +# $PANDA_PRC_DIR. + +set(PRC_DIR_ENVVARS "PANDA_PRC_DIR" CACHE STRING + "The compiled-in name of the environment variable(s) that contain +the name of a single directory in which to search for prc files.") + +set(PRC_PATH_ENVVARS "PANDA_PRC_PATH" CACHE STRING + "The compiled-in name of the environment variable(s) that contain +the name of multiple directories, separated by DEFAULT_PATHSEP, in +which to search for prc files.") + +# You can specify the name of the file(s) to search for in the above +# paths to be considered a config file. This should be a +# space-separated list of filename patterns. This is *.prc by +# default; normally there's no reason to change this. + +set(PRC_PATTERNS "*.prc" CACHE STRING + "The filename(s) to search for in the above paths. Normally this is +*.prc.") + +# You can optionally encrypt your prc file(s) to help protect them +# from curious eyes. You have to specify the encryption key, which +# gets hard-coded into the executable. (This feature provides mere +# obfuscation, not real security, since the encryption key can +# potentially be extracted by a hacker.) This requires building with +# OpenSSL. + +set(PRC_ENCRYPTED_PATTERNS "*.prc.pe" CACHE STRING + "The filename(s) for encrypted prc files.") + +set(PRC_ENCRYPTION_KEY "" CACHE STRING + "The encryption key used to decrypt any encrypted prc files +identified by PRC_ENCRYPTED_PATTERNS.") + +# One unusual feature of config is the ability to execute one or more +# of the files it discovers as if it were a program, and then treat +# the output of this program as a prc file. If you want to use this +# feature, define this variable to the filename pattern or patterns +# for such executable-style config programs (e.g. *prc.exe). This +# can be the same as the above if you like this sort of ambiguity; in +# that case, config will execute the file if it appears to be +# executable; otherwise, it will simply read it. + +set(PRC_EXECUTABLE_PATTERNS "" CACHE STRING + "The filename(s) to search for, and execute, in the above paths. +Normally this is empty.") + +# If you do use the above feature, you'll need another environment +# variable that specifies additional arguments to pass to the +# executable programs. The default definition, given here, makes +# that variable be $PANDA_PRC_XARGS. Sorry, the same arguments +# must be supplied to all executables in a given runtime session. + +set(PRC_EXECUTABLE_ARGS_ENVVAR "PANDA_PRC_XARGS" CACHE STRING + "The environment variable that defines optional args to pass to +executables found that match one of the above patterns.") + +# You can implement signed prc files, if you require this advanced +# feature. This allows certain config variables to be set only by a +# prc file that has been provided by a trusted source. To do this, +# first install and compile Dtool with OpenSSL and run the program +# make-prc-key, and then specify here the output filename generated +# by that program, and then recompile Dtool. + set(PRC_PUBLIC_KEYS_FILENAME "" CACHE STRING "") -set(PRC_RESPECT_TRUST_LEVEL CACHE STRING "") -set(PRC_DCONFIG_TRUST_LEVEL 0 CACHE STRING + +# By default, the signed-prc feature, above, is enabled only for a +# release build. In a normal development environment, any prc file +# can set any config variable, whether or not it is signed. Set +# this variable true or false to explicitly enable or disable this +# feature. +#XXX For which build types should this be enabled? +if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(DEFAULT_PRC_RESPECT_TRUST_LEVEL ON) +else() + set(DEFAULT_PRC_RESPECT_TRUST_LEVEL OFF) +endif() + +option(PRC_RESPECT_TRUST_LEVEL + "Define if we want to enable the trust_level feature of prc config +variables. This requires OpenSSL and PRC_PUBLIC_KEYS_FILENAME, +above." ${DEFAULT_PRC_RESPECT_TRUST_LEVEL}) + +# If trust level is in effect, this specifies the default trust level +# for any legacy (Dconfig) config variables (that is, variables +# created using the config.GetBool(), etc. interface, rather than the +# newer ConfigVariableBool interface). + +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 + +# If trust level is in effect, you may globally increment the +# (mis)trust level of all variables by the specified amount. +# Incrementing this value by 1 will cause all variables to require at +# least a level 1 signature. + +set(PRC_INC_TRUST_LEVEL "0" CACHE STRING "The amount by which we globally increment the trust level.") -mark_as_advanced(PRC_DEFAULT_DIR PRC_DEFAULT_DIR_ABSOLUTE PRC_DIR_ENVVARS - PRC_PATH_ENVVARS PRC_PATH2_ENVVARS PRC_PATTERNS PRC_ENCRYPTED_PATTERNS - PRC_ENCRYPTION_KEY PRC_EXECUTABLE_PATTERNS PRC_EXECUTABLE_ARGS_ENVVAR + +# Similarly, the descriptions are normally saved only in a +# development build, not in a release build. Set this value true to +# explicitly save them anyway. +#XXX only for release-release builds +option(PRC_SAVE_DESCRIPTIONS + "Define if you want to save the descriptions for ConfigVariables." + ON) + +mark_as_advanced(PRC_DEFAULT_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS + PRC_PATTERNS PRC_ENCRYPTED_PATTERNS PRC_ENCRYPTION_KEY + PRC_EXECUTABLE_PATTERNS PRC_EXECUTABLE_ARGS_ENVVAR PRC_PUBLIC_KEYS_FILENAME PRC_RESPECT_TRUST_LEVEL PRC_DCONFIG_TRUST_LEVEL PRC_INC_TRUST_LEVEL) -# PRC special values for config headers -if(PRC_DEFAULT_DIR_ABSOLUTE) - set(DEFAULT_PRC_DIR ${PRC_ABSOLUTE_DIR}) -else() - set(DEFAULT_PRC_DIR "${CMAKE_INSTALL_PREFIX}/panda/${PRC_DEFAULT_DIR}") +# This is the end of the PRC variable customization section. The +# remaining variables are of general interest to everyone. + + +option(HAVE_P3D_PLUGIN + "You may define this to build or develop the plugin." OFF) + +option(HAVE_P3D_RTDIST + "You may define this to build or develop the Panda3D rtdist, +the environment packaged up for distribution with the plugin." + OFF) + +if(HAVE_P3D_RTDIST) + set(PANDA_PACKAGE_VERSION "local_dev" CACHE STRING "") + set(PANDA_PACKAGE_HOST_URL "http://localhost/" CACHE STRING "") endif() -### Configure interrogate ### -message(STATUS "") # simple line break -if(HAVE_PYTHON AND HAVE_OPENSSL) - option(USE_INTERROGATE "If on, Panda3D will generate python interfaces" ON) - if(USE_INTERROGATE) - set(HAVE_INTERROGATE TRUE) - endif() -else() - unset(USE_INTERROGATE CACHE) -endif() -if(HAVE_INTERROGATE) - message(STATUS "Compilation will generate Python interfaces.") -else() - message(STATUS "Configuring Panda without Python interfaces.") -endif() +mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST) +# The following options relate to interrogate, the tool that is +# used to generate bindings for non-C++ languages. + +option(INTERROGATE_PYTHON_INTERFACE + "Do you want to generate a Python-callable interrogate interface? +This is only necessary if you plan to make calls into Panda from a +program written in Python. This is done only if HAVE_PYTHON is also +true." ON) + +set(PYTHON_NATIVE + "Define this true to use the new interrogate feature to generate +Python-native objects directly, rather than requiring a separate +FFI step. This loads and runs much more quickly than the original +mechanism. Define this false (that is, empty) to use the original +interfaces." ON) + +set(INTERROGATE_OPTIONS "-fnames;-string;-refcount;-assert" CACHE STRING + "What additional options should be passed to interrogate when +generating either of the above two interfaces? Generally, you +probably don't want to mess with this.") + +set(INTERROGATE "interrogate" CACHE STRING + "What's the name of the interrogate binary to run? The default +specified is the one that is built as part of DTOOL. If you have a +prebuilt binary standing by (for instance, if you are cross-compiling +and cannot run the built version), specify its name instead.") + +set(INTERROGATE_MODULE "interrogate_module" CACHE STRING + "Same as INTERROGATE, except for the interrogate_module binary.") + +mark_as_advanced(PYTHON_NATIVE INTERROGATE_OPTIONS) + +if(NOT CMAKE_CROSSCOMPILING) + mark_as_advanced(INTERROGATE INTERROGATE_MODULE) +endif() ### Configure threading support ### find_package(Threads) @@ -196,8 +360,3 @@ endif() # is OK since the variables in there don't have to be used # outside of dtool_config.h.cmake. -if(WIN32) - set(DEFAULT_PATHSEP ";") -else() - set(DEFAULT_PATHSEP ":") -endif() diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 9cc9395ad5..452fdb06e0 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -176,4 +176,5 @@ check_include_file_cxx(typeinfo HAVE_RTTI) #$[cdefine __USE_LARGEFILE64] configure_file(dtool_config.h.cmake "${PROJECT_BINARY_DIR}/dtool_config.h") +include_directories("${PROJECT_BINARY_DIR}") #install(FILES "${PROJECT_BINARY_DIR}/dtool_config.h" DESTINATION include/panda3d) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f07f3367dc..06dfc35836 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -1,2 +1,2 @@ -## Include panda subpackages ## +# Include panda source directories add_subdirectory(src/pandabase) From 57c9b1ae648b1a05c84d47a1cad59e94ce6036e0 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 16 Dec 2013 17:21:11 +0100 Subject: [PATCH 065/744] Add composite_sources, add bison macro, emulate CMAKE_CURRENT_DIR_IN_INTERFACE in pre-2.8.11 --- CMakeLists.txt | 13 +- dtool/Config.cmake | 7 - dtool/LocalSetup.cmake | 3 +- dtool/MakeComposite.cmake | 22 ++ dtool/PandaMacros.cmake | 215 ++++++++++++++++++ ...dtool_config.h.cmake => dtool_config.h.in} | 0 dtool/src/cppparser/CMakeLists.txt | 38 +--- dtool/src/dconfig/CMakeLists.txt | 11 +- dtool/src/dtoolbase/CMakeLists.txt | 7 +- dtool/src/dtoolutil/CMakeLists.txt | 23 +- ...ion.cxx.cmake => checkPandaVersion.cxx.in} | 0 ...Version.h.cmake => checkPandaVersion.h.in} | 0 ...pandaVersion.h.cmake => pandaVersion.h.in} | 0 dtool/src/interrogate/CMakeLists.txt | 14 +- dtool/src/interrogatedb/CMakeLists.txt | 12 +- dtool/src/prc/CMakeLists.txt | 14 +- ...parameters.h.cmake => prc_parameters.h.in} | 0 dtool/src/pystub/CMakeLists.txt | 14 +- panda/src/pandabase/CMakeLists.txt | 8 +- 19 files changed, 285 insertions(+), 116 deletions(-) create mode 100644 dtool/MakeComposite.cmake create mode 100644 dtool/PandaMacros.cmake rename dtool/{dtool_config.h.cmake => dtool_config.h.in} (100%) rename dtool/src/dtoolutil/{checkPandaVersion.cxx.cmake => checkPandaVersion.cxx.in} (100%) rename dtool/src/dtoolutil/{checkPandaVersion.h.cmake => checkPandaVersion.h.in} (100%) rename dtool/src/dtoolutil/{pandaVersion.h.cmake => pandaVersion.h.in} (100%) rename dtool/src/prc/{prc_parameters.h.cmake => prc_parameters.h.in} (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76c91556bd..fce94d4c76 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,20 @@ -cmake_minimum_required(VERSION 2.8) +# We require 2.8.4 because earlier releases had a bug +# with invalid HEADER_FILE_ONLY behavior in MSVC 2010. +cmake_minimum_required(VERSION 2.8.4) project(Panda3D) -## Set Panda's CMake Module path ## +# Set Panda's CMake module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") -## This is where dtool_config.h gets generated ## +# This is where dtool_config.h gets generated. include_directories("${CMAKE_BINARY_DIR}") -## Configure Panda3D ##( +# Configure Panda3D +include(dtool/PandaMacros.cmake) include(dtool/PandaVersion.cmake) include(dtool/Packages.cmake) include(dtool/Config.cmake) -## Include Panda3D Packages ## +# Include Panda3D packages add_subdirectory(dtool) add_subdirectory(panda) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index ebbee61487..4da32e5442 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -353,10 +353,3 @@ if(BUILD_PREFER_STDFLOAT) set(STDFLOAT_DOUBLE TRUE) endif() -#XXX note from rdb: I've moved the automatically-configured -# compiler settings to LocalSetup.cmake, which is also where -# dtool_config.h.cmake is now being invoked. -# LocalSetup.cmake is included in dtool/CMakeLists.txt, which -# is OK since the variables in there don't have to be used -# outside of dtool_config.h.cmake. - diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 452fdb06e0..4e5db017fc 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -175,6 +175,7 @@ check_include_file_cxx(typeinfo HAVE_RTTI) #/* Define if needed to have 64-bit file i/o */ #$[cdefine __USE_LARGEFILE64] -configure_file(dtool_config.h.cmake "${PROJECT_BINARY_DIR}/dtool_config.h") +# Generate dtool_config.h +configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/dtool_config.h") include_directories("${PROJECT_BINARY_DIR}") #install(FILES "${PROJECT_BINARY_DIR}/dtool_config.h" DESTINATION include/panda3d) diff --git a/dtool/MakeComposite.cmake b/dtool/MakeComposite.cmake new file mode 100644 index 0000000000..242eb48ef2 --- /dev/null +++ b/dtool/MakeComposite.cmake @@ -0,0 +1,22 @@ +# This script is invoked via add_custom_target, like this: +# cmake -P MakeComposite.cmake -D COMPOSITE_FILE="x_composite1.cxx" -D COMPOSITE_SOURCES="a.cxx b.cxx" + +if(CMAKE_SCRIPT_MODE_FILE) + #cmake_minimum_required(VERSION 2.8.4) + + if(NOT DEFINED COMPOSITE_FILE) + message(FATAL_ERROR "COMPOSITE_FILE should be defined when running MakeComposite.cmake!") + return() + endif() + + file(WRITE "${COMPOSITE_FILE}" "/* Generated by CMake. DO NOT EDIT. */\n") + + separate_arguments(COMPOSITE_SOURCES) + foreach(source ${COMPOSITE_SOURCES}) + file(APPEND "${COMPOSITE_FILE}" "#include \"${source}\"\n") + endforeach() + +else() + message(SEND_ERROR "MakeComposite.cmake should not be included but run in script mode.") + +endif() diff --git a/dtool/PandaMacros.cmake b/dtool/PandaMacros.cmake new file mode 100644 index 0000000000..abda6679eb --- /dev/null +++ b/dtool/PandaMacros.cmake @@ -0,0 +1,215 @@ +# Settings for composite builds. +set(COMPOSITE_SOURCE_LIMIT "10" CACHE STRING + "Setting this to a value higher than 1 will enable unity builds. +A high value will speed up the build dramatically but use more RAM.") + +set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING + "Only files of these extensions will be added to composite files.") + +set(COMPOSITE_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/MakeComposite.cmake") + +# Settings for interrogate. +#set(INTERROGATE_OPTIONS + +# +# Function: write_composite_file(file [source1 [source2 ...]) +# Writes out a single composite file. Used by composite_sources, below. +# +#function(write_composite_file file) +# set(COMPOSITE_INCLUDES "") +# foreach(source ${ARGN}) +# set(COMPOSITE_INCLUDES "${COMPOSITE_INCLUDES}#include \"${source}\"\n") +# endforeach() +# +# configure_file("${COMPOSITE_TEMPLATE}" "${file}") +#endfunction(write_composite_file) + +# +# Macro: composite_sources(target sources_var) +# Looks at all the sources, generates _composite#.cxx and modifies the list. +# Usage: +# set(MY_SOURCES a.cxx b.cxx c.cxx) +# composite_sources(MY_SOURCES) +# add_library(my ${MY_SOURCES}) +# +#TODO: only supports .cxx files so far, not yet .mm files +# it should probably sort the files by extension (.c, .cxx, .mm) first. +# +function(composite_sources target sources_var) + # How many sources were specified? + set(orig_sources ${${sources_var}}) + set(sources ${orig_sources}) + list(LENGTH sources num_sources) + + if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2) + # It's silly to do this for a single source. + return() + endif() + + set(composite_files "") + set(composite_sources "") + + while(num_sources GREATER 0) + # Pop the first element + list(GET sources 0 source) + list(REMOVE_AT sources 0) + list(LENGTH sources num_sources) + + # Check if we can safely add this to a composite file. + get_source_file_property(generated "${source}" GENERATED) + get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) + + if(NOT generated AND NOT is_header) + # Add it to composite_sources. + list(APPEND composite_sources ${source}) + list(LENGTH composite_sources num_composite_sources) + + if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT}) + + # It's pointless to make a composite source from just one file. + if(num_composite_sources GREATER 1) + + # Figure out the name of our composite file. + list(LENGTH composite_files index) + math(EXPR index "1+${index}") + set(composite_file "${CMAKE_CURRENT_BINARY_DIR}/${target}_composite${index}.cxx") + list(APPEND composite_files "${composite_file}") + + # Set HEADER_FILE_ONLY to prevent it from showing up in the + # compiler command, but still show up in the IDE environment. + set_source_files_properties(${composite_sources} PROPERTIES HEADER_FILE_ONLY ON) + + # We'll interrogate the composite files, so exclude the original sources. + set_source_files_properties(${composite_sources} PROPERTIES WRAP_EXCLUDE YES) + + # Finally, add the target that generates the composite file. + add_custom_command( + OUTPUT "${composite_file}" + COMMAND ${CMAKE_COMMAND} + -DCOMPOSITE_FILE="${composite_file}" + -DCOMPOSITE_SOURCES="${composite_sources}" + -P "${COMPOSITE_GENERATOR}" + DEPENDS ${composite_sources}) + + # Reset for the next composite file. + set(composite_sources "") + endif() + endif() + endif() + endwhile() + + #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) + + # The new files are added to the existing files, which means the old files + # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting. + set(${sources_var} ${orig_sources} ${composite_files} PARENT_SCOPE) +endfunction(composite_sources) + +# +# Function: add_bison_target(output_cxx input_yxx [DEFINES output_h] [PREFIX prefix]) +# Takes .prebuilt files into account if BISON_FOUND is not true. +# +function(add_bison_target output_cxx input_yxx) + set(arguments "") + set(outputs "${output_cxx}") + set(keyword "") + + # Parse the extra arguments to the function. + foreach(arg ${ARGN}) + if(arg STREQUAL "DEFINES") + set(keyword "DEFINES") + elseif(arg STREQUAL "PREFIX") + set(keyword "PREFIX") + + elseif(keyword STREQUAL "PREFIX") + set(arguments ${arguments} -p "${arg}") + elseif(keyword STREQUAL "DEFINES") + set(arguments ${arguments} --defines="${arg}") + list(APPEND outputs "${arg}") + + else() + message(SEND_ERROR "Unexpected argument ${arg} to add_bison_target") + endif() + endforeach() + + if(keyword STREQUAL arg AND NOT keyword STREQUAL "") + message(SEND_ERROR "Expected argument after ${keyword}") + endif() + + if(HAVE_BISON) + # If we have bison, we can of course just run it. + add_custom_command( + OUTPUT ${outputs} + COMMAND ${BISON_EXECUTABLE} + -o "${output_cxx}" ${arguments} + "${input_yxx}" + MAIN_DEPENDENCY "${input_yxx}" + ) + + else() + # Look for prebuilt versions of the outputs. + set(commands "") + set(depends "") + + foreach(output ${outputs}) + set(prebuilt_file "${output}.prebuilt") + get_filename_component(prebuilt_file "${prebuilt_file}" ABSOLUTE) + + if(NOT EXISTS "${prebuilt_file}") + message(SEND_ERROR "Bison was not found and ${prebuilt_file} does not exist!") + endif() + + list(APPEND depends "${prebuilt_file}") + set(commands ${commands} COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) + endforeach() + + add_custom_command( + OUTPUT ${outputs} + ${commands} + DEPENDS ${depends} + ) + endif() +endfunction(add_bison_target) + + +# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. +if(CMAKE_VERSION VERSION_LESS 2.8.11) + # Replace some built-in functions in order to extend their functionality. + function(add_library target) + _add_library(${target} ${ARGN}) + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") + endfunction() + + function(add_executable target) + _add_executable(${target} ${ARGN}) + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") + endfunction() + + function(target_link_libraries target) + set(interface_dirs "") + get_target_property(target_interface_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) + + foreach(lib ${ARGN}) + get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) + + set(interface_dirs ${interface_dirs} ${lib_interface_dirs}) + endforeach() + + #NB. target_include_directories is new in 2.8.8. + #target_include_directories("${target}" ${interace_dirs}) + include_directories(${interface_dirs}) + message(STATUS "adding extra ${interface_dirs}") + + # Update this target's interface inc dirs. + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") + + # Call to the built-in function we are overriding. + _target_link_libraries(${name} ${ARGN}) + endfunction() + +else() + # 2.8.11 supports this natively. + set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +endif() + +set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/dtool/dtool_config.h.cmake b/dtool/dtool_config.h.in similarity index 100% rename from dtool/dtool_config.h.cmake rename to dtool/dtool_config.h.in diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index c7970491a1..ffe6e2ed3d 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -1,6 +1,3 @@ -include_directories(../dtoolutil) -include_directories(../dtoolbase) - set(P3CPPPARSER_HEADERS cppArrayType.h cppBison.yxx cppBisonDefs.h cppClassTemplateParameter.h cppCommentBlock.h cppConstType.h @@ -37,39 +34,16 @@ set(P3CPPPARSER_SOURCES cppUsing.cxx cppVisibility.cxx ) +composite_sources(p3cppParser P3CPPPARSER_SOURCES) + # Bison is required for CPPParser # Check for it here, so that cppparser can be compiled individually +#TODO rdb: should be global if(NOT HAVE_BISON) find_package(BISON REQUIRED QUIET) - - if(NOT BISON_FOUND) - message(FATAL_ERROR "CPPParser requires Bison.") - endif() endif() -# TODO: we should move this to a global macro somewhere. -if(BISON_FOUND) - add_custom_command( - OUTPUT cppBison.h cppBison.cxx - COMMAND ${BISON_EXECUTABLE} - --defines=cppBison.h -o cppBison.cxx -p cppyy - "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.yxx" - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.yxx" - ) -else() - add_custom_command( - OUTPUT cppBison.h cppBison.cxx - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.h.prebuilt" cppBison.h - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.cxx.prebuilt" cppBison.cxx - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.h.prebuilt" "${CMAKE_CURRENT_SOURCE_DIR}/cppBison.cxx.prebuilt" - ) -endif() +add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) -include_directories(${CMAKE_CURRENT_LIST_DIR}) - -add_library(p3cppParser STATIC - ${P3CPPPARSER_HEADERS} - ${P3CPPPARSER_SOURCES} -) -add_dependencies(p3cppParser cppParser) +add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) +target_link_libraries(p3cppParser p3dtoolutil) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 40870d5f92..7c71d68d82 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -1,13 +1,10 @@ -include_directories(../dtoolutil) -include_directories(../dtoolbase) -include_directories(../prc) - set(P3DCONFIG_HEADERS config_dconfig.h dconfig.I dconfig.h) set(P3DCONFIG_SOURCES config_dconfig.cxx dconfig.cxx) -add_library(p3dconfig STATIC - ${P3DCONFIG_HEADERS} - ${P3DCONFIG_SOURCES}) +composite_sources(p3dconfig P3DCONFIG_SOURCES) + +add_library(p3dconfig ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) +target_link_libraries(p3dconfig p3prc) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 151f6e013a..3761f03b1e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -59,7 +59,6 @@ set(P3DTOOLBASE_SOURCES typedObject.cxx ) -add_library(p3dtoolbase STATIC - ${P3DTOOLBASE_HEADERS} - ${P3DTOOLBASE_SOURCES} -) +composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) + +add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index e26ded3312..c631b027ea 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -1,15 +1,6 @@ -include_directories(../dtoolbase) - -configure_file(pandaVersion.h.cmake - pandaVersion.h) - -configure_file(checkPandaVersion.h.cmake - checkPandaVersion.h) - -configure_file(checkPandaVersion.cxx.cmake - checkPandaVersion.cxx) - -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +configure_file(pandaVersion.h.in pandaVersion.h) +configure_file(checkPandaVersion.h.in checkPandaVersion.h) +configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) set(P3DTOOLUTIL_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h @@ -57,7 +48,7 @@ set(P3DTOOLUTIL_SOURCES win32ArgParser.cxx ) -add_library(p3dtoolutil STATIC - ${P3DTOOLUTIL_HEADERS} - ${P3DTOOLUTIL_SOURCES} -) +composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) + +add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) +target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) diff --git a/dtool/src/dtoolutil/checkPandaVersion.cxx.cmake b/dtool/src/dtoolutil/checkPandaVersion.cxx.in similarity index 100% rename from dtool/src/dtoolutil/checkPandaVersion.cxx.cmake rename to dtool/src/dtoolutil/checkPandaVersion.cxx.in diff --git a/dtool/src/dtoolutil/checkPandaVersion.h.cmake b/dtool/src/dtoolutil/checkPandaVersion.h.in similarity index 100% rename from dtool/src/dtoolutil/checkPandaVersion.h.cmake rename to dtool/src/dtoolutil/checkPandaVersion.h.in diff --git a/dtool/src/dtoolutil/pandaVersion.h.cmake b/dtool/src/dtoolutil/pandaVersion.h.in similarity index 100% rename from dtool/src/dtoolutil/pandaVersion.h.cmake rename to dtool/src/dtoolutil/pandaVersion.h.in diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index cbfed8ec85..7444dfbab3 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -1,11 +1,3 @@ -include_directories(../cppparser) -include_directories(../interrogatedb) -include_directories(../dconfig) -include_directories(../dtoolutil) -include_directories(../dtoolbase) -include_directories(../pystub) -include_directories(../prc) - set(INTERROGATE_HEADERS functionRemap.h functionWriter.h @@ -53,9 +45,9 @@ set(INTERROGATE_SOURCES parameterRemapToString.cxx parameterRemapUnchanged.cxx typeManager.cxx) -add_executable(interrogate - ${INTERROGATE_HEADERS} - ${INTERROGATE_SOURCES}) +composite_sources(interrogate INTERROGATE_SOURCES) + +add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${OPENSSL_LIBRARIES}) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 180bf0c03e..927fea94a0 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -1,8 +1,3 @@ -include_directories(../dconfig) -include_directories(../dtoolutil) -include_directories(../dtoolbase) -include_directories(../prc) - set(P3INTERROGATEDB_HEADERS config_interrogatedb.h indexRemapper.h interrogateComponent.I interrogateComponent.h interrogateDatabase.I @@ -32,6 +27,7 @@ set(P3INTERROGATEDB_SOURCES py_panda.cxx vector_int.cxx) -add_library(p3interrogatedb STATIC - ${P3INTERROGATEDB_HEADERS} - ${P3INTERROGATEDB_SOURCES}) +composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) + +add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) +target_link_libraries(p3interrogatedb p3dconfig) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 8b55f0944b..64c9c8168a 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -1,9 +1,4 @@ -include_directories(../dtoolutil) -include_directories(../dtoolbase) - -configure_file(prc_parameters.h.cmake - prc_parameters.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}) +configure_file(prc_parameters.h.in prc_parameters.h) set(P3PRC_HEADERS bigEndian.h @@ -67,6 +62,7 @@ set(P3PRC_SOURCES reversedNumericData.cxx streamReader.cxx streamWrapper.cxx streamWriter.cxx) -add_library(p3prc STATIC - ${P3PRC_HEADERS} - ${P3PRC_SOURCES}) +composite_sources(p3prc P3PRC_SOURCES) + +add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) +target_link_libraries(p3prc p3dtoolutil p3dtoolbase) diff --git a/dtool/src/prc/prc_parameters.h.cmake b/dtool/src/prc/prc_parameters.h.in similarity index 100% rename from dtool/src/prc/prc_parameters.h.cmake rename to dtool/src/prc/prc_parameters.h.in diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index 53efd1d6ff..0054a7a948 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -1,11 +1,5 @@ -include_directories(../dtoolbase) +set(P3PYSTUB_HEADERS pystub.h) +set(P3PYSTUB_SOURCES pystub.cxx) -set(P3PYSTUB_HEADERS - pystub.h) - -set(P3PYSTUB_SOURCES - pystub.cxx) - -add_library(p3pystub STATIC - ${P3PYSTUB_HEADERS} - ${P3PYSTUB_SOURCES}) +add_library(p3pystub STATIC ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) +target_link_libraries(p3pystub p3dtoolbase) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index 25f065b222..c266e6b313 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -1,5 +1,3 @@ -include_directories(../../../dtool/src/dtoolbase) - set(P3PANDABASE_HEADERS pandabase.h pandasymbols.h ) @@ -8,7 +6,5 @@ set(P3PANDABASE_SOURCES pandabase.cxx ) -add_library(p3pandabase STATIC - ${P3PANDABASE_HEADERS} - ${P3PANDABASE_SOURCES} -) +add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) +target_link_libraries(p3pandabase p3dtoolbase) From 7ea0d099e98f718e0fe2782e3830b68a75a764a4 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 16 Dec 2013 20:33:20 +0100 Subject: [PATCH 066/744] More progress on Config.cmake, fix bison, add BUILD_DTOOL/BUILD_PANDA to toggle trees. --- CMakeLists.txt | 14 ++- dtool/Config.cmake | 168 +++++++++++++++++++++++++++-- dtool/LocalSetup.cmake | 13 ++- dtool/PandaMacros.cmake | 20 +--- dtool/PandaVersion.cmake | 8 +- dtool/dtool_config.h.in | 5 - dtool/src/cppparser/CMakeLists.txt | 11 +- panda/CMakeLists.txt | 4 + 8 files changed, 194 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fce94d4c76..5a45ccf707 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,17 @@ include(dtool/PandaMacros.cmake) include(dtool/PandaVersion.cmake) include(dtool/Packages.cmake) include(dtool/Config.cmake) +#include(dtool/Interrogate.cmake) + +# Determine which trees to build. +option(BUILD_DTOOL "Build the dtool source tree." ON) +option(BUILD_PANDA "Build the panda source tree." ON) # Include Panda3D packages -add_subdirectory(dtool) -add_subdirectory(panda) +if(BUILD_DTOOL) + add_subdirectory(dtool) +endif() + +if(BUILD_PANDA) + add_subdirectory(panda) +endif() diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 4da32e5442..f95cdcbceb 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -27,6 +27,14 @@ else() set(DEFAULT_PATHSEP ":") endif() +#TODO figure out what to do about release/debug vs OPTIMIZE level. +if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "") + set(DO_DEBUG ON) +else() + set(DO_DEBUG OFF) +endif() + + # Panda uses prc files for runtime configuration. There are many # compiled-in options to customize the behavior of the prc config # system; most users won't need to change any of them. Feel free to @@ -169,9 +177,10 @@ mark_as_advanced(PRC_DEFAULT_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS PRC_PUBLIC_KEYS_FILENAME PRC_RESPECT_TRUST_LEVEL PRC_DCONFIG_TRUST_LEVEL PRC_INC_TRUST_LEVEL) +# # This is the end of the PRC variable customization section. The # remaining variables are of general interest to everyone. - +# option(HAVE_P3D_PLUGIN "You may define this to build or develop the plugin." OFF) @@ -209,6 +218,10 @@ set(INTERROGATE_OPTIONS "-fnames;-string;-refcount;-assert" CACHE STRING generating either of the above two interfaces? Generally, you probably don't want to mess with this.") +option(INTERROGATE_VERBOSE + "Set this if you would like interrogate to generate advanced +debugging information." OFF) + set(INTERROGATE "interrogate" CACHE STRING "What's the name of the interrogate binary to run? The default specified is the one that is built as part of DTOOL. If you have a @@ -224,6 +237,148 @@ if(NOT CMAKE_CROSSCOMPILING) mark_as_advanced(INTERROGATE INTERROGATE_MODULE) endif() +# +# Now let's check for the presence of various thirdparty libraries. +# + +option(USE_EIGEN + "Enables experimental support for the Eigen linear algebra library. +If this is provided, Panda will use this library as the fundamental +implementation of its own linmath library; otherwise, it will use +its own internal implementation. The primary advantage of using +Eigen is SSE2 support, which is only activated if LINMATH_ALIGN +is also enabled." ON) + +option(LINMATH_ALIGN + "This is required for activating SSE2 support using Eigen. +Activating this does constrain most objects in Panda to 16-byte +alignment, which could impact memory usage on very-low-memory +platforms. Currently experimental." ON) + +if(USE_EIGEN) + find_package(Eigen3) + if(EIGEN3_FOUND) + set(HAVE_EIGEN3 TRUE) + endif() +endif() + +option(USE_PYTHON + "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE +is also enabled, Python bindings will be generated.") + +if(USE_PYTHON) + find_package(PythonLibs) + find_package(PythonInterp) + if(PYTHONLIBS_FOUND) + set(HAVE_PYTHON TRUE) + include_directories("${PYTHON_INCLUDE_DIR}") + endif() +endif() + +# By default, we'll assume the user only wants to run with Debug +# python if he has to--that is, on Windows when building a debug build. +if(WIN32 AND DO_DEBUG) + set(USE_DEBUG_PYTHON ON) +else() + set(USE_DEBUG_PYTHON OFF) +endif() + +set(GENPYCODE_LIBS "libpandaexpress;libpanda;libpandaphysics;libp3direct;libpandafx;libp3vision;libpandaode;libp3vrpn" CACHE STRING + "Define the default set of libraries to be instrumented by +genPyCode. You may wish to add to this list to add your own +libraries, or if you want to use some of the more obscure +interfaces like libpandaegg and libpandafx.") + +mark_as_advanced(GENPYCODE_LIBS) + +#TODO INSTALL_PYTHON_SOURCE? + +# +# The following options have to do with the memory allocation system +# that will be used by Panda3D. +# + +option(DO_MEMORY_USAGE + "Do you want to compile in support for tracking memory usage? This +enables you to define the variable 'track-memory-usage' at runtime +to help track memory leaks, and also report total memory usage on +PStats. There is some small overhead for having this ability +available, even if it is unused." ${DO_DEBUG}) + +option(SIMULATE_NETWORK_DELAY + "This option compiles in support for simulating network delay via +the min-lag and max-lag prc variables. It adds a tiny bit of +overhead even when it is not activated, so it is typically enabled +only in a development build." ${DO_DEBUG}) + +option(SUPPORT_IMMEDIATE_MODE + "This option compiles in support for immediate-mode OpenGL +rendering. Since this is normally useful only for researching +buggy drivers, and since there is a tiny bit of per-primitive +overhead to have this option available even if it is unused, it is +by default enabled only in a development build. This has no effect +on DirectX rendering." ${DO_DEBUG}) + +option(USE_MEMORY_DLMALLOC + "This is an optional alternative memory-allocation scheme +available within Panda. You can experiment with it to see +if it gives better performance than the system malloc(), but +at the time of this writing, it doesn't appear that it does." OFF) + +option(USE_MEMORY_PTMALLOC2 + "This is an optional alternative memory-allocation scheme +available within Panda. You can experiment with it to see +if it gives better performance than the system malloc(), but +at the time of this writing, it doesn't appear that it does." OFF) + +option(MEMORY_HOOK_DO_ALIGN + "Set this true if you prefer to use the system malloc library even +if 16-byte alignment must be performed on top of it, wasting up to +30% of memory usage. If you do not set this, and 16-byte alignment +is required and not provided by the system malloc library, then an +alternative malloc system (above) will be used instead." OFF) + +option(ALTERNATIVE_MALLOC + "Do you want to use one of the alternative malloc implementations?" + OFF) + +option(USE_DELETED_CHAIN + "Define this true to use the DELETED_CHAIN macros, which support +fast re-use of existing allocated blocks, minimizing the low-level +calls to malloc() and free() for frequently-created and -deleted +objects. There's usually no reason to set this false, unless you +suspect a bug in Panda's memory management code." ON) + +mark_as_advanced(DO_MEMORY_USAGE SIMULATE_NETWORK_DELAY + SUPPORT_IMMEDIATE_MODE USE_MEMORY_DLMALLOC USE_MEMORY_PTMALLOC2 + MEMORY_HOOK_DO_ALIGN ALTERNATIVE_MALLOC USE_DELETED_CHAIN) + + +# +# < Insert the rest of the Config.pp port here < +# + +# How to invoke bison and flex. Panda takes advantage of some +# bison/flex features, and therefore specifically requires bison and +# flex, not some other versions of yacc and lex. However, you only +# need to have these programs if you need to make changes to the +# bison or flex sources (see the next point, below). + +find_package(BISON QUIET) +find_package(FLEX QUIET) + +# You may not even have bison and flex installed. If you don't, no +# sweat; Panda ships with the pre-generated output of these programs, +# so you don't need them unless you want to make changes to the +# grammars themselves (files named *.yxx or *.lxx). + +set(HAVE_BISON ${BISON_FOUND}) +set(HAVE_FLEX ${FLEX_FOUND}) + +# +# +# + ### Configure threading support ### find_package(Threads) if(THREADS_FOUND) @@ -311,16 +466,9 @@ if(BUILD_PIPELINING) set(DO_PIPELINING TRUE) endif() + + ### Configure OS X options ### -if(APPLE) - option(BUILD_UNIVERSIAL_BINARIES "If on, compiling will create universal OS X binaries." ON) - if(BUILD_UNIVERSAL_BINARIES) - message(STATUS "Compilation will create universal binaries.") - set(UNIVERSAL_BINARIES TRUE) - else() - message(STATUS "Compilation will not create universal binaries.") - endif() -endif() message(STATUS "") message(STATUS "See dtool_config.h for more details about the specified configuration.\n") diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 4e5db017fc..2ec5e7c6f8 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -62,9 +62,9 @@ int main(int argc, char *argv[]) { } }" SIMPLE_STRUCT_POINTERS) -# Define if we have STL hash_map etc. available -#TODO make test case -#//$[cdefine HAVE_STL_HASH] +# Define if we have STL hash_map etc. available. +# We're not using this functionality at the moment, it seems. +set(HAVE_STL_HASH OFF) # Check if we have a gettimeofday() function. check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) @@ -175,6 +175,13 @@ check_include_file_cxx(typeinfo HAVE_RTTI) #/* Define if needed to have 64-bit file i/o */ #$[cdefine __USE_LARGEFILE64] +# Set LINK_ALL_STATIC if we're building everything as static libraries. +if(BUILD_SHARED_LIBS) + set(LINK_ALL_STATIC OFF) +else() + set(LINK_ALL_STATIC ON) +endif() + # Generate dtool_config.h configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/dtool_config.h") include_directories("${PROJECT_BINARY_DIR}") diff --git a/dtool/PandaMacros.cmake b/dtool/PandaMacros.cmake index abda6679eb..0fea8d65d7 100644 --- a/dtool/PandaMacros.cmake +++ b/dtool/PandaMacros.cmake @@ -1,4 +1,4 @@ -# Settings for composite builds. +# Settings for composite builds. Should be moved to Config.cmake? set(COMPOSITE_SOURCE_LIMIT "10" CACHE STRING "Setting this to a value higher than 1 will enable unity builds. A high value will speed up the build dramatically but use more RAM.") @@ -8,22 +8,6 @@ set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING set(COMPOSITE_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/MakeComposite.cmake") -# Settings for interrogate. -#set(INTERROGATE_OPTIONS - -# -# Function: write_composite_file(file [source1 [source2 ...]) -# Writes out a single composite file. Used by composite_sources, below. -# -#function(write_composite_file file) -# set(COMPOSITE_INCLUDES "") -# foreach(source ${ARGN}) -# set(COMPOSITE_INCLUDES "${COMPOSITE_INCLUDES}#include \"${source}\"\n") -# endforeach() -# -# configure_file("${COMPOSITE_TEMPLATE}" "${file}") -#endfunction(write_composite_file) - # # Macro: composite_sources(target sources_var) # Looks at all the sources, generates _composite#.cxx and modifies the list. @@ -137,6 +121,8 @@ function(add_bison_target output_cxx input_yxx) endif() if(HAVE_BISON) + get_source_file_property(input_yxx "${input_yxx}" LOCATION) + # If we have bison, we can of course just run it. add_custom_command( OUTPUT ${outputs} diff --git a/dtool/PandaVersion.cmake b/dtool/PandaVersion.cmake index 5e2bd15ef1..bfdc73590d 100644 --- a/dtool/PandaVersion.cmake +++ b/dtool/PandaVersion.cmake @@ -9,7 +9,7 @@ option(PANDA_OFFICIAL_VERSION "This variable will be defined to false in the CVS repository, but scripts that generate source tarballs and/or binary releases for distribution, by checking out Panda from an official CVS tag, -should explictly set this to true. When false, it indicates that +should explictly set this to true. When false, it indicates that the current version of Panda was checked out from CVS, so it may not be a complete representation of the indicated version." OFF) @@ -17,7 +17,7 @@ not be a complete representation of the indicated version." set(PANDA_DISTRIBUTOR homebuilt CACHE STRING "This string is reported verbatim by PandaSystem::get_distributor(). It should be set by whoever provides a particular distribution of -Panda. If you build your own Panda, leave this unchanged.") +Panda. If you build your own Panda, leave this unchanged.") set(PANDA_PACKAGE_VERSION CACHE STRING "This string is used to describe the Panda3D \"package\" associated @@ -40,13 +40,15 @@ than Panda itself.") set(P3D_COREAPI_VERSION "${P3D_PLUGIN_VERSION}.1" CACHE STRING "Finally, there's a separate version number for the Core API. At first, we didn't believe we needed a Core API version number, but -in this belief we were naive. This version number is a little less +in this belief we were naive. This version number is a little less strict in its format requirements than P3D_PLUGIN_VERSION, above, and it doesn't necessarily consist of a specific number of integers, but by convention it will consist of four integers, with the first three matching the plugin version, and the fourth integer being incremented with each new Core API revision.") +mark_as_advanced(PANDA_VERSION PANDA_OFFICIAL_VERSION + PANDA_PACKAGE_VERSION P3D_PLUGIN_VERSION P3D_COREAPI_VERSION) # Separate the Panda3D version into its three components. string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}") diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index a31bec6d5c..186bea89b2 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -1,9 +1,5 @@ /* dtool_config.h. Generated automatically by CMake. */ -/* Debug / non-debug symbols. OPTIMIZE = $[OPTIMIZE] */ -#cmakedefine _DEBUG -#cmakedefine NDEBUG - /* Define if we have Eigen available. */ #cmakedefine HAVE_EIGEN #cmakedefine LINMATH_ALIGN @@ -467,4 +463,3 @@ #cmakedefine IS_LINUX #cmakedefine IS_FREEBSD #cmakedefine BUILD_IPHONE -#cmakedefine UNIVERSAL_BINARIES diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index ffe6e2ed3d..1e6ba9e511 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -1,3 +1,5 @@ +add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) + set(P3CPPPARSER_HEADERS cppArrayType.h cppBison.yxx cppBisonDefs.h cppClassTemplateParameter.h cppCommentBlock.h cppConstType.h @@ -36,14 +38,5 @@ set(P3CPPPARSER_SOURCES composite_sources(p3cppParser P3CPPPARSER_SOURCES) -# Bison is required for CPPParser -# Check for it here, so that cppparser can be compiled individually -#TODO rdb: should be global -if(NOT HAVE_BISON) - find_package(BISON REQUIRED QUIET) -endif() - -add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) - add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) target_link_libraries(p3cppParser p3dtoolutil) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 06dfc35836..75b940fa5b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -1,2 +1,6 @@ +if(NOT BUILD_DTOOL) + message(FATAL_ERROR "Cannot build panda without dtool! Please enable the BUILD_DTOOL option.") +endif() + # Include panda source directories add_subdirectory(src/pandabase) From d71923b36ed68cf06c6d0d39da53954a0afd9b18 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 16 Dec 2013 22:20:46 +0100 Subject: [PATCH 067/744] Add interrogate macros, add p3express/p3downloader/p3dtoolconfig, fixes for pre-2.8.11 --- CMakeLists.txt | 2 +- dtool/CMakeLists.txt | 1 + dtool/Config.cmake | 15 ++- dtool/Interrogate.cmake | 130 ++++++++++++++++++++++ dtool/PandaMacros.cmake | 20 ++-- dtool/metalibs/dtoolconfig/CMakeLists.txt | 8 ++ panda/CMakeLists.txt | 2 + panda/src/downloader/CMakeLists.txt | 67 +++++++++++ panda/src/express/CMakeLists.txt | 128 +++++++++++++++++++++ 9 files changed, 363 insertions(+), 10 deletions(-) create mode 100644 dtool/Interrogate.cmake create mode 100644 dtool/metalibs/dtoolconfig/CMakeLists.txt create mode 100644 panda/src/downloader/CMakeLists.txt create mode 100644 panda/src/express/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a45ccf707..8a272f652c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,7 @@ include(dtool/PandaMacros.cmake) include(dtool/PandaVersion.cmake) include(dtool/Packages.cmake) include(dtool/Config.cmake) -#include(dtool/Interrogate.cmake) +include(dtool/Interrogate.cmake) # Determine which trees to build. option(BUILD_DTOOL "Build the dtool source tree." ON) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 6422d57d5a..8c9761298a 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -13,3 +13,4 @@ add_subdirectory(src/interrogate) # Include dtool metalibs add_subdirectory(metalibs/dtool) +add_subdirectory(metalibs/dtoolconfig) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index f95cdcbceb..86393eac4e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -213,6 +213,19 @@ FFI step. This loads and runs much more quickly than the original mechanism. Define this false (that is, empty) to use the original interfaces." ON) +set(INTERROGATE_C_INTERFACE + "Do you want to generate a C-callable interrogate interface? This +generates an interface similar to the Python interface above, with +a C calling convention. It should be useful for most other kinds +of scripting language; the VR Studio used to use this to make calls +into Panda from Squeak." OFF) + +option(HAVE_INTERROGATE + "Do you even want to build interrogate at all? This is the program +that reads our C++ source files and generates one of the above +interfaces. If you won't be building the interfaces, you don't +need the program." ON) + set(INTERROGATE_OPTIONS "-fnames;-string;-refcount;-assert" CACHE STRING "What additional options should be passed to interrogate when generating either of the above two interfaces? Generally, you @@ -264,7 +277,7 @@ endif() option(USE_PYTHON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE -is also enabled, Python bindings will be generated.") +is also enabled, Python bindings will be generated." ON) if(USE_PYTHON) find_package(PythonLibs) diff --git a/dtool/Interrogate.cmake b/dtool/Interrogate.cmake new file mode 100644 index 0000000000..e7b3ad9103 --- /dev/null +++ b/dtool/Interrogate.cmake @@ -0,0 +1,130 @@ +# +# dtool/Interrogate.cmake +# +# This file contains macros and functions that are used to invoke +# interrogate, in order to generate wrappers for Python and/or other +# languages. +# + +set(IGATE_FLAGS ${INTERROGATE_OPTIONS} -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable) + +if(WIN32) + list(APPEND IGATE_FLAGS -longlong __int64 -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32) +endif() +if(INTERROGATE_VERBOSE) + list(APPEND IGATE_FLAGS "-v") +endif() + +set(IMOD_FLAGS ${INTERROGATE_MODULE_OPTIONS}) + +# +# Function: target_interrogate(target [ALL] [source1 [source2 ...]]) +# NB. This doesn't actually invoke interrogate, but merely adds the +# sources to the list of scan sources associated with the target. +# Interrogate will be invoked when add_python_module is called. +# If ALL is specified, all of the sources from the associated +# target are added. +# +function(target_interrogate target) + if(HAVE_PYTHON AND HAVE_INTERROGATE) + set(sources) + set(want_all OFF) + + # Find any .N files that would normally be picked up by interrogate. + # We let CMake add these as dependencies too, to allow rebuilding + # the wrappers when the .N files have been modified. + set(deps) + foreach(arg ${ARGV}) + if(arg STREQUAL "ALL") + set(want_all ON) + else() + list(APPEND sources "${source}") + endif() + endforeach() + + # If ALL was specified, pull in all sources from the target. + if(want_all) + get_target_property(target_sources "${target}" SOURCES) + list(APPEND sources ${target_sources}) + endif() + + list(REMOVE_DUPLICATES sources) + + # Go through the sources to determine the full name, + # and also find out if there are any .N files to pick up. + foreach(source ${sources}) + get_source_file_property(exclude "${source}" WRAP_EXCLUDE) + + if(NOT exclude) + get_filename_component(basename "${source}" NAME_WE) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${basename}.N") + list(APPEND deps "${CMAKE_CURRENT_SOURCE_DIR}/${basename}.N") + endif() + + # Add the full path to the source file itself. + get_source_file_property(location "${source}" LOCATION) + list(APPEND deps "${location}") + endif() + endforeach(source) + + set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${sources}") + set_target_properties("${target}" PROPERTIES IGATE_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") + set_target_properties("${target}" PROPERTIES IGATE_DEPS "${deps}") + endif() +endfunction(target_interrogate) + +# +# Function: add_python_module(module [lib1 [lib2 ...]]) +# Uses interrogate to create a Python module. +# +function(add_python_module module) + if(HAVE_PYTHON AND HAVE_INTERROGATE) + set(targets ${ARGN}) + set(infiles) + set(sources) + + foreach(target ${targets}) + get_target_property(scansrc "${target}" IGATE_SOURCES) + get_target_property(srcdir "${target}" IGATE_SRCDIR) + get_target_property(deps "${target}" IGATE_DEPS) + + add_custom_command( + OUTPUT "${target}_igate.cxx" "${target}.in" + COMMAND interrogate + -od "${target}.in" + -oc "${target}_igate.cxx" + -module ${module} -library ${target} ${IGATE_FLAGS} + -srcdir "${srcdir}" + -I "${PROJECT_BINARY_DIR}/include" + -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" + -S "${PROJECT_BINARY_DIR}/include/parser-inc" + ${scansrc} + DEPENDS interrogate ${deps} + ) + + list(APPEND infiles "${target}.in") + list(APPEND sources "${target}_igate.cxx") + endforeach(target) + + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" + COMMAND interrogate_module + -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" + -module ${module} -library ${module} + ${IMOD_FLAGS} ${infiles} + DEPENDS interrogate_module ${infiles} + ) + + add_library(${module} MODULE "${module}_module.cxx" ${sources}) + target_link_libraries(${module} ${PYTHON_LIBRARIES}) + target_link_libraries(${module} p3interrogatedb) + + set_target_properties(${module} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + PREFIX "" + ) + if(WIN32 AND NOT CYGWIN) + set_target_properties(${module} PROPERTIES SUFFIX ".pyd") + endif() + endif() +endfunction(add_python_module) diff --git a/dtool/PandaMacros.cmake b/dtool/PandaMacros.cmake index 0fea8d65d7..3c2d426ac4 100644 --- a/dtool/PandaMacros.cmake +++ b/dtool/PandaMacros.cmake @@ -1,7 +1,8 @@ # Settings for composite builds. Should be moved to Config.cmake? -set(COMPOSITE_SOURCE_LIMIT "10" CACHE STRING - "Setting this to a value higher than 1 will enable unity builds. -A high value will speed up the build dramatically but use more RAM.") +set(COMPOSITE_SOURCE_LIMIT "30" CACHE STRING + "Setting this to a value higher than 1 will enable unity builds, also +known as SCU (single compilation unit). A high value will speed up the +build dramatically but will be more memory intensive than a low value.") set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING "Only files of these extensions will be added to composite files.") @@ -172,25 +173,28 @@ if(CMAKE_VERSION VERSION_LESS 2.8.11) endfunction() function(target_link_libraries target) - set(interface_dirs "") + set(interface_dirs) get_target_property(target_interface_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) foreach(lib ${ARGN}) get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) - set(interface_dirs ${interface_dirs} ${lib_interface_dirs}) + if(lib_interface_dirs) + list(APPEND interface_dirs ${lib_interface_dirs}) + endif() endforeach() + list(REMOVE_DUPLICATES interface_dirs) + #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interace_dirs}) + #target_include_directories("${target}" ${interface_dirs}) include_directories(${interface_dirs}) - message(STATUS "adding extra ${interface_dirs}") # Update this target's interface inc dirs. set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") # Call to the built-in function we are overriding. - _target_link_libraries(${name} ${ARGN}) + _target_link_libraries(${target} ${ARGN}) endfunction() else() diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt new file mode 100644 index 0000000000..22ed64ed6d --- /dev/null +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -0,0 +1,8 @@ +if(HAVE_PYTHON) + add_library(p3dtoolconfig dtoolconfig.cxx pydtool.cxx) + target_link_libraries(p3dtoolconfig ${PYTHON_LIBRARIES}) +else() + add_library(p3dtoolconfig dtoolconfig.cxx) +endif() + +target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 75b940fa5b..13a678cbff 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -4,3 +4,5 @@ endif() # Include panda source directories add_subdirectory(src/pandabase) +add_subdirectory(src/express) +add_subdirectory(src/downloader) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt new file mode 100644 index 0000000000..7aad0126ad --- /dev/null +++ b/panda/src/downloader/CMakeLists.txt @@ -0,0 +1,67 @@ +set(P3DOWNLOADER_HEADERS + bioPtr.I bioPtr.h + bioStreamPtr.I bioStreamPtr.h + bioStream.I bioStream.h bioStreamBuf.h + chunkedStream.I chunkedStream.h + chunkedStreamBuf.h chunkedStreamBuf.I + config_downloader.h + decompressor.h decompressor.I + documentSpec.h documentSpec.I + download_utils.h downloadDb.h downloadDb.I + extractor.h + httpAuthorization.I httpAuthorization.h + httpBasicAuthorization.I httpBasicAuthorization.h + httpChannel.I httpChannel.h + httpClient.I httpClient.h + httpCookie.I httpCookie.h + httpDate.I httpDate.h + httpDigestAuthorization.I httpDigestAuthorization.h + httpEntityTag.I httpEntityTag.h + httpEnum.h + identityStream.I identityStream.h + identityStreamBuf.h identityStreamBuf.I + multiplexStream.I multiplexStream.h + multiplexStreamBuf.I multiplexStreamBuf.h + patcher.h patcher.I + socketStream.h socketStream.I + stringStreamBuf.I stringStreamBuf.h + stringStream.I stringStream.h + urlSpec.h urlSpec.I + virtualFileHTTP.I virtualFileHTTP.h + virtualFileMountHTTP.I virtualFileMountHTTP.h) + +set(P3DOWNLOADER_SOURCES + config_downloader.cxx + bioPtr.cxx + bioStreamPtr.cxx + bioStream.cxx bioStreamBuf.cxx + chunkedStream.cxx chunkedStreamBuf.cxx + decompressor.cxx + documentSpec.cxx + downloadDb.cxx + download_utils.cxx + extractor.cxx + httpAuthorization.cxx + httpBasicAuthorization.cxx + httpChannel.cxx + httpClient.cxx + httpCookie.cxx + httpDate.cxx + httpDigestAuthorization.cxx + httpEntityTag.cxx + httpEnum.cxx + identityStream.cxx identityStreamBuf.cxx + multiplexStream.cxx multiplexStreamBuf.cxx + patcher.cxx + socketStream.cxx + stringStreamBuf.cxx + stringStream.cxx + urlSpec.cxx + virtualFileHTTP.cxx + virtualFileMountHTTP.cxx) + +composite_sources(p3downloader P3DOWNLOADER_SOURCES) + +add_library(p3downloader ${P3DOWNLOADER_SOURCES} ${P3DOWNLOADER_HEADERS}) +target_link_libraries(p3downloader p3express p3pandabase) +target_interrogate(p3downloader ALL) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt new file mode 100644 index 0000000000..f1b4744eb4 --- /dev/null +++ b/panda/src/express/CMakeLists.txt @@ -0,0 +1,128 @@ +set(P3EXPRESS_HEADERS + buffer.I buffer.h + ca_bundle_data_src.c + checksumHashGenerator.I checksumHashGenerator.h circBuffer.I + circBuffer.h + compress_string.h + config_express.h + copy_stream.h + datagram.I datagram.h datagramGenerator.I + datagramGenerator.h + datagramIterator.I datagramIterator.h datagramSink.I datagramSink.h + dcast.T dcast.h + encrypt_string.h + error_utils.h + fileReference.h fileReference.I + hashGeneratorBase.I hashGeneratorBase.h + hashVal.I hashVal.h + indirectLess.I indirectLess.h + memoryInfo.I memoryInfo.h + memoryUsage.I memoryUsage.h + memoryUsagePointerCounts.I memoryUsagePointerCounts.h + memoryUsagePointers.I memoryUsagePointers.h + multifile.I multifile.h + namable.I + namable.h + nodePointerTo.h nodePointerTo.I + nodePointerToBase.h nodePointerToBase.I + nodeReferenceCount.h nodeReferenceCount.I + openSSLWrapper.h openSSLWrapper.I + ordered_vector.h ordered_vector.I ordered_vector.T + pStatCollectorForwardBase.h + password_hash.h + patchfile.I patchfile.h + pointerTo.I pointerTo.h + pointerToArray.I pointerToArray.h + pointerToArrayBase.I pointerToArrayBase.h + pointerToBase.I pointerToBase.h + pointerToVoid.I pointerToVoid.h + profileTimer.I profileTimer.h + pta_int.h + pta_uchar.h pta_double.h pta_float.h + pta_stdfloat.h + ramfile.I ramfile.h + referenceCount.I referenceCount.h + subStream.I subStream.h subStreamBuf.h + subfileInfo.h subfileInfo.I + temporaryFile.h temporaryFile.I + threadSafePointerTo.I threadSafePointerTo.h + threadSafePointerToBase.I threadSafePointerToBase.h + trueClock.I trueClock.h + typedReferenceCount.I typedReferenceCount.h typedef.h + vector_uchar.h vector_double.h vector_float.h + vector_stdfloat.h + virtualFile.I virtualFileList.I virtualFileList.h virtualFileMount.h + virtualFileComposite.h virtualFileComposite.I virtualFile.h + virtualFileMount.I virtualFileMountMultifile.h + virtualFileMountMultifile.I + virtualFileMountRamdisk.h virtualFileMountRamdisk.I + virtualFileMountSystem.h virtualFileMountSystem.I + virtualFileSimple.h virtualFileSimple.I + virtualFileSystem.h virtualFileSystem.I + weakPointerCallback.I weakPointerCallback.h + weakPointerTo.I weakPointerTo.h + weakPointerToBase.I weakPointerToBase.h + weakPointerToVoid.I weakPointerToVoid.h + weakReferenceList.I weakReferenceList.h + windowsRegistry.h + zStream.I zStream.h zStreamBuf.h) + +set(P3EXPRESS_SOURCES + buffer.cxx checksumHashGenerator.cxx + compress_string.cxx + config_express.cxx + copy_stream.cxx + datagram.cxx datagramGenerator.cxx + datagramIterator.cxx + datagramSink.cxx dcast.cxx + encrypt_string.cxx + error_utils.cxx + fileReference.cxx + hashGeneratorBase.cxx hashVal.cxx + memoryInfo.cxx memoryUsage.cxx memoryUsagePointerCounts.cxx + memoryUsagePointers.cxx multifile.cxx + namable.cxx + nodePointerTo.cxx + nodePointerToBase.cxx + nodeReferenceCount.cxx + openSSLWrapper.cxx + ordered_vector.cxx + pStatCollectorForwardBase.cxx + password_hash.cxx + patchfile.cxx + pointerTo.cxx + pointerToArray.cxx + pointerToBase.cxx + pointerToVoid.cxx + profileTimer.cxx + pta_int.cxx + pta_uchar.cxx pta_double.cxx pta_float.cxx + ramfile.cxx + referenceCount.cxx + subStream.cxx subStreamBuf.cxx + subfileInfo.cxx + temporaryFile.cxx + threadSafePointerTo.cxx + threadSafePointerToBase.cxx + trueClock.cxx + typedReferenceCount.cxx + vector_uchar.cxx vector_double.cxx vector_float.cxx + virtualFileComposite.cxx virtualFile.cxx virtualFileList.cxx + virtualFileMount.cxx + virtualFileMountMultifile.cxx + virtualFileMountRamdisk.cxx + virtualFileMountSystem.cxx + virtualFileSimple.cxx virtualFileSystem.cxx + weakPointerCallback.cxx + weakPointerTo.cxx + weakPointerToBase.cxx + weakPointerToVoid.cxx + weakReferenceList.cxx + windowsRegistry.cxx + zStream.cxx zStreamBuf.cxx) + +composite_sources(p3express P3EXPRESS_SOURCES) + +add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) +target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig) +target_interrogate(p3express ALL) From c579f870076fd32c532a3186bf535a921b59db80 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 13:44:05 -0700 Subject: [PATCH 068/744] cmake: Reorganize macros, and cleanup related files (add docs, etc) --- CMakeLists.txt | 17 +- cmake/macros/AddBisonTarget.cmake | 73 +++++++ cmake/macros/CompositeSources.cmake | 101 +++++++++ .../ConfigPackage.cmake} | 5 +- {dtool => cmake/macros}/Interrogate.cmake | 10 +- cmake/macros/README.md | 9 + cmake/modules/AutoInclude.cmake | 50 +++++ cmake/modules/README.md | 7 + {dtool => cmake/scripts}/MakeComposite.cmake | 12 +- cmake/scripts/README.md | 10 + dtool/PandaMacros.cmake | 205 ------------------ 11 files changed, 282 insertions(+), 217 deletions(-) create mode 100644 cmake/macros/AddBisonTarget.cmake create mode 100644 cmake/macros/CompositeSources.cmake rename cmake/{modules/ConfigurePackage.cmake => macros/ConfigPackage.cmake} (97%) rename {dtool => cmake/macros}/Interrogate.cmake (93%) create mode 100644 cmake/macros/README.md create mode 100644 cmake/modules/AutoInclude.cmake create mode 100644 cmake/modules/README.md rename {dtool => cmake/scripts}/MakeComposite.cmake (58%) create mode 100644 cmake/scripts/README.md delete mode 100644 dtool/PandaMacros.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a272f652c..45255c3254 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,18 +3,25 @@ cmake_minimum_required(VERSION 2.8.4) project(Panda3D) -# Set Panda's CMake module path +# Add generic modules to cmake module path, +# and add Panda3D specific modules to cmake module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") -# This is where dtool_config.h gets generated. +# Include global modules +include(AutoInclude) # Implements automatic include_directories finding +include(AddBisonTarget) # Defines add_bison_target function +include(CompositeSources) # Defines composite_sources function +include(ConfigPackage) # Defines config_package function +include(Interrogate) # Defines target_interrogate AND add_python_module + +# Add the include path for source and header files generated by CMake include_directories("${CMAKE_BINARY_DIR}") # Configure Panda3D -include(dtool/PandaMacros.cmake) include(dtool/PandaVersion.cmake) -include(dtool/Packages.cmake) +include(dtool/Package.cmake) include(dtool/Config.cmake) -include(dtool/Interrogate.cmake) # Determine which trees to build. option(BUILD_DTOOL "Build the dtool source tree." ON) diff --git a/cmake/macros/AddBisonTarget.cmake b/cmake/macros/AddBisonTarget.cmake new file mode 100644 index 0000000000..45278db7de --- /dev/null +++ b/cmake/macros/AddBisonTarget.cmake @@ -0,0 +1,73 @@ +# Filename: AddBisonTarget.cmake +# Description: This file defines the function add_bison_target which instructs +# cmake to use bison on an input .yxx file. If bison is not available on +# the system, add_bison_target tries to use .prebuilt .cxx files instead. +# +# Usage: +# add_bison_target(output_cxx input_yxx [DEFINES output_h] [PREFIX prefix]) +# + +# Define add_bison_target() +function(add_bison_target output_cxx input_yxx) + set(arguments "") + set(outputs "${output_cxx}") + set(keyword "") + + # Parse the extra arguments to the function. + foreach(arg ${ARGN}) + if(arg STREQUAL "DEFINES") + set(keyword "DEFINES") + elseif(arg STREQUAL "PREFIX") + set(keyword "PREFIX") + + elseif(keyword STREQUAL "PREFIX") + set(arguments ${arguments} -p "${arg}") + elseif(keyword STREQUAL "DEFINES") + set(arguments ${arguments} --defines="${arg}") + list(APPEND outputs "${arg}") + + else() + message(SEND_ERROR "Unexpected argument ${arg} to add_bison_target") + endif() + endforeach() + + if(keyword STREQUAL arg AND NOT keyword STREQUAL "") + message(SEND_ERROR "Expected argument after ${keyword}") + endif() + + if(HAVE_BISON) + get_source_file_property(input_yxx "${input_yxx}" LOCATION) + + # If we have bison, we can of course just run it. + add_custom_command( + OUTPUT ${outputs} + COMMAND ${BISON_EXECUTABLE} + -o "${output_cxx}" ${arguments} + "${input_yxx}" + MAIN_DEPENDENCY "${input_yxx}" + ) + + else() + # Look for prebuilt versions of the outputs. + set(commands "") + set(depends "") + + foreach(output ${outputs}) + set(prebuilt_file "${output}.prebuilt") + get_filename_component(prebuilt_file "${prebuilt_file}" ABSOLUTE) + + if(NOT EXISTS "${prebuilt_file}") + message(SEND_ERROR "Bison was not found and ${prebuilt_file} does not exist!") + endif() + + list(APPEND depends "${prebuilt_file}") + set(commands ${commands} COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) + endforeach() + + add_custom_command( + OUTPUT ${outputs} + ${commands} + DEPENDS ${depends} + ) + endif() +endfunction(add_bison_target) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake new file mode 100644 index 0000000000..f2fc29426d --- /dev/null +++ b/cmake/macros/CompositeSources.cmake @@ -0,0 +1,101 @@ +# Filename: CompositeSources.cmake +# Description: This file defines the function composite_sources which looks at +# a provided list of sources, generates _compositeN.cxx, and appends the +# composites to the list. The original files in the list are marked as headers +# so that they will be available in an IDE, but not compiled at build time. +# +# Usage: +# composite_sources(target source_var) +# +# Example: +# set(MY_SOURCES a.cxx b.cxx c.cxx) +# composite_sources(my_lib MY_SOURCES) +# add_library(my_lib ${MY_SOURCES}) +# +# TODO: Only supports .cxx files so far, not yet .mm files +# It should probably sort the files by extension (.c, .cxx, .mm) first. +# + + +# Settings for composite builds. Should be moved to Config.cmake? +set(COMPOSITE_SOURCE_LIMIT "30" CACHE STRING + "Setting this to a value higher than 1 will enable unity builds, also +known as SCU (single compilation unit). A high value will speed up the +build dramatically but will be more memory intensive than a low value.") + +set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING + "Only files of these extensions will be added to composite files.") + +set(COMPOSITE_GENERATOR "${CMAKE_SOURCE_DIR}/cmake/scripts/MakeComposite.cmake") + + +# Define composite_sources() +function(composite_sources target sources_var) + # How many sources were specified? + set(orig_sources ${${sources_var}}) + set(sources ${orig_sources}) + list(LENGTH sources num_sources) + + if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2) + # It's silly to do this for a single source. + return() + endif() + + set(composite_files "") + set(composite_sources "") + + while(num_sources GREATER 0) + # Pop the first element + list(GET sources 0 source) + list(REMOVE_AT sources 0) + list(LENGTH sources num_sources) + + # Check if we can safely add this to a composite file. + get_source_file_property(generated "${source}" GENERATED) + get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) + + if(NOT generated AND NOT is_header) + # Add it to composite_sources. + list(APPEND composite_sources ${source}) + list(LENGTH composite_sources num_composite_sources) + + if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT}) + + # It's pointless to make a composite source from just one file. + if(num_composite_sources GREATER 1) + + # Figure out the name of our composite file. + list(LENGTH composite_files index) + math(EXPR index "1+${index}") + set(composite_file "${CMAKE_CURRENT_BINARY_DIR}/${target}_composite${index}.cxx") + list(APPEND composite_files "${composite_file}") + + # Set HEADER_FILE_ONLY to prevent it from showing up in the + # compiler command, but still show up in the IDE environment. + set_source_files_properties(${composite_sources} PROPERTIES HEADER_FILE_ONLY ON) + + # We'll interrogate the composite files, so exclude the original sources. + set_source_files_properties(${composite_sources} PROPERTIES WRAP_EXCLUDE YES) + + # Finally, add the target that generates the composite file. + add_custom_command( + OUTPUT "${composite_file}" + COMMAND ${CMAKE_COMMAND} + -DCOMPOSITE_FILE="${composite_file}" + -DCOMPOSITE_SOURCES="${composite_sources}" + -P "${COMPOSITE_GENERATOR}" + DEPENDS ${composite_sources}) + + # Reset for the next composite file. + set(composite_sources "") + endif() + endif() + endif() + endwhile() + + #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) + + # The new files are added to the existing files, which means the old files + # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting. + set(${sources_var} ${orig_sources} ${composite_files} PARENT_SCOPE) +endfunction(composite_sources) diff --git a/cmake/modules/ConfigurePackage.cmake b/cmake/macros/ConfigPackage.cmake similarity index 97% rename from cmake/modules/ConfigurePackage.cmake rename to cmake/macros/ConfigPackage.cmake index 81551994f8..b4511faec2 100644 --- a/cmake/modules/ConfigurePackage.cmake +++ b/cmake/macros/ConfigPackage.cmake @@ -1,4 +1,4 @@ -# Filename: ConfigurePackage.cmake +# Filename: ConfigPackage.cmake # Author: kestred (30 Nov, 2013) # # This modules defines a function which finds and configures libraries @@ -6,6 +6,9 @@ # # Assumes the file has already been found with find_package(). # +# Usage: +# config_package(package_name) +# # The following variables can be set to override the cached values of USE_XYZZY # CONFIG_DISABLE_EVERYTHING - always set USE_XYZZY to false # CONFIG_DISABLE_MISSING - set USE_XYZZY to false if it was not found diff --git a/dtool/Interrogate.cmake b/cmake/macros/Interrogate.cmake similarity index 93% rename from dtool/Interrogate.cmake rename to cmake/macros/Interrogate.cmake index e7b3ad9103..a118b3f945 100644 --- a/dtool/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -1,9 +1,11 @@ +# Filename: Interrogate.cmake # -# dtool/Interrogate.cmake +# Description: This file contains macros and functions that are used to invoke +# interrogate, to generate wrappers for Python and/or other languages. # -# This file contains macros and functions that are used to invoke -# interrogate, in order to generate wrappers for Python and/or other -# languages. +# Functions: +# target_interrogate(target [ALL] [source1 [source2 ...]]) +# add_python_module(module [lib1 [lib2 ...]]) # set(IGATE_FLAGS ${INTERROGATE_OPTIONS} -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable) diff --git a/cmake/macros/README.md b/cmake/macros/README.md new file mode 100644 index 0000000000..63d12981ec --- /dev/null +++ b/cmake/macros/README.md @@ -0,0 +1,9 @@ +Directory Info +-------------- +**Directory:** /cmake/macros +**License:** Unlicense +**Description:** This directory is used for CMake modules which may be _unsafe_ +to use outside of a Panda3D project. These modules may rely on Panda3D specific +cmake variables, Panda3D's directory structure, or some other dependency. +They are not intended to be included in other projects directly, though you +are free to copy and adapt them to your own needs. diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake new file mode 100644 index 0000000000..3a2f2d74e0 --- /dev/null +++ b/cmake/modules/AutoInclude.cmake @@ -0,0 +1,50 @@ +# Filename: AutoInclude.cmake +# Description: This file backports the CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE +# introduced in CMake 2.8.11 to previous versions of cmake, and enables the +# behavior by default. +# + +# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. +if(CMAKE_VERSION VERSION_LESS 2.8.11) + # Replace some built-in functions in order to extend their functionality. + function(add_library target) + _add_library(${target} ${ARGN}) + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") + endfunction() + + function(add_executable target) + _add_executable(${target} ${ARGN}) + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") + endfunction() + + function(target_link_libraries target) + set(interface_dirs) + get_target_property(target_interface_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) + + foreach(lib ${ARGN}) + get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) + + if(lib_interface_dirs) + list(APPEND interface_dirs ${lib_interface_dirs}) + endif() + endforeach() + + list(REMOVE_DUPLICATES interface_dirs) + + #NB. target_include_directories is new in 2.8.8. + #target_include_directories("${target}" ${interface_dirs}) + include_directories(${interface_dirs}) + + # Update this target's interface inc dirs. + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") + + # Call to the built-in function we are overriding. + _target_link_libraries(${target} ${ARGN}) + endfunction() + +else() + # 2.8.11 supports this natively. + set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +endif() + +set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/cmake/modules/README.md b/cmake/modules/README.md new file mode 100644 index 0000000000..057b9cc95d --- /dev/null +++ b/cmake/modules/README.md @@ -0,0 +1,7 @@ +Directory Info +-------------- +**Directory:** /cmake/modules +**License:** Unlicense +**Description:** This directory is used for standard CMake modules which are safe +to use outside of a Panda3D project. This should be the normal location for +most FindXYZZY packages that are written for Panda3D. diff --git a/dtool/MakeComposite.cmake b/cmake/scripts/MakeComposite.cmake similarity index 58% rename from dtool/MakeComposite.cmake rename to cmake/scripts/MakeComposite.cmake index 242eb48ef2..11b618dad0 100644 --- a/dtool/MakeComposite.cmake +++ b/cmake/scripts/MakeComposite.cmake @@ -1,5 +1,13 @@ -# This script is invoked via add_custom_target, like this: -# cmake -P MakeComposite.cmake -D COMPOSITE_FILE="x_composite1.cxx" -D COMPOSITE_SOURCES="a.cxx b.cxx" +# Filename: MakeComposite.cmake +# +# Description: When run, creates a single C++ file which includes multiple +# other C++ files, to help facilitate unity builds. +# Unity builds provide significantly increased compile speed. +# +# Usage: +# This script is invoked via add_custom_target, like this: +# cmake -P MakeComposite.cmake -D COMPOSITE_FILE="x_composite1.cxx" -D COMPOSITE_SOURCES="a.cxx b.cxx" +# if(CMAKE_SCRIPT_MODE_FILE) #cmake_minimum_required(VERSION 2.8.4) diff --git a/cmake/scripts/README.md b/cmake/scripts/README.md new file mode 100644 index 0000000000..1f97423ab8 --- /dev/null +++ b/cmake/scripts/README.md @@ -0,0 +1,10 @@ +Directory Info +-------------- +**Directory:** /cmake/scripts +**License:** Unlicense +**Description:** This directory is used for cmake files which are not meant to +be included using CMake's normal include() directive. Typically, files in this +directory will be invoked as a custom command/target in the form of: +``` + cmake -P [... other options ...] +``` diff --git a/dtool/PandaMacros.cmake b/dtool/PandaMacros.cmake deleted file mode 100644 index 3c2d426ac4..0000000000 --- a/dtool/PandaMacros.cmake +++ /dev/null @@ -1,205 +0,0 @@ -# Settings for composite builds. Should be moved to Config.cmake? -set(COMPOSITE_SOURCE_LIMIT "30" CACHE STRING - "Setting this to a value higher than 1 will enable unity builds, also -known as SCU (single compilation unit). A high value will speed up the -build dramatically but will be more memory intensive than a low value.") - -set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING - "Only files of these extensions will be added to composite files.") - -set(COMPOSITE_GENERATOR "${CMAKE_CURRENT_LIST_DIR}/MakeComposite.cmake") - -# -# Macro: composite_sources(target sources_var) -# Looks at all the sources, generates _composite#.cxx and modifies the list. -# Usage: -# set(MY_SOURCES a.cxx b.cxx c.cxx) -# composite_sources(MY_SOURCES) -# add_library(my ${MY_SOURCES}) -# -#TODO: only supports .cxx files so far, not yet .mm files -# it should probably sort the files by extension (.c, .cxx, .mm) first. -# -function(composite_sources target sources_var) - # How many sources were specified? - set(orig_sources ${${sources_var}}) - set(sources ${orig_sources}) - list(LENGTH sources num_sources) - - if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2) - # It's silly to do this for a single source. - return() - endif() - - set(composite_files "") - set(composite_sources "") - - while(num_sources GREATER 0) - # Pop the first element - list(GET sources 0 source) - list(REMOVE_AT sources 0) - list(LENGTH sources num_sources) - - # Check if we can safely add this to a composite file. - get_source_file_property(generated "${source}" GENERATED) - get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) - - if(NOT generated AND NOT is_header) - # Add it to composite_sources. - list(APPEND composite_sources ${source}) - list(LENGTH composite_sources num_composite_sources) - - if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT}) - - # It's pointless to make a composite source from just one file. - if(num_composite_sources GREATER 1) - - # Figure out the name of our composite file. - list(LENGTH composite_files index) - math(EXPR index "1+${index}") - set(composite_file "${CMAKE_CURRENT_BINARY_DIR}/${target}_composite${index}.cxx") - list(APPEND composite_files "${composite_file}") - - # Set HEADER_FILE_ONLY to prevent it from showing up in the - # compiler command, but still show up in the IDE environment. - set_source_files_properties(${composite_sources} PROPERTIES HEADER_FILE_ONLY ON) - - # We'll interrogate the composite files, so exclude the original sources. - set_source_files_properties(${composite_sources} PROPERTIES WRAP_EXCLUDE YES) - - # Finally, add the target that generates the composite file. - add_custom_command( - OUTPUT "${composite_file}" - COMMAND ${CMAKE_COMMAND} - -DCOMPOSITE_FILE="${composite_file}" - -DCOMPOSITE_SOURCES="${composite_sources}" - -P "${COMPOSITE_GENERATOR}" - DEPENDS ${composite_sources}) - - # Reset for the next composite file. - set(composite_sources "") - endif() - endif() - endif() - endwhile() - - #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) - - # The new files are added to the existing files, which means the old files - # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting. - set(${sources_var} ${orig_sources} ${composite_files} PARENT_SCOPE) -endfunction(composite_sources) - -# -# Function: add_bison_target(output_cxx input_yxx [DEFINES output_h] [PREFIX prefix]) -# Takes .prebuilt files into account if BISON_FOUND is not true. -# -function(add_bison_target output_cxx input_yxx) - set(arguments "") - set(outputs "${output_cxx}") - set(keyword "") - - # Parse the extra arguments to the function. - foreach(arg ${ARGN}) - if(arg STREQUAL "DEFINES") - set(keyword "DEFINES") - elseif(arg STREQUAL "PREFIX") - set(keyword "PREFIX") - - elseif(keyword STREQUAL "PREFIX") - set(arguments ${arguments} -p "${arg}") - elseif(keyword STREQUAL "DEFINES") - set(arguments ${arguments} --defines="${arg}") - list(APPEND outputs "${arg}") - - else() - message(SEND_ERROR "Unexpected argument ${arg} to add_bison_target") - endif() - endforeach() - - if(keyword STREQUAL arg AND NOT keyword STREQUAL "") - message(SEND_ERROR "Expected argument after ${keyword}") - endif() - - if(HAVE_BISON) - get_source_file_property(input_yxx "${input_yxx}" LOCATION) - - # If we have bison, we can of course just run it. - add_custom_command( - OUTPUT ${outputs} - COMMAND ${BISON_EXECUTABLE} - -o "${output_cxx}" ${arguments} - "${input_yxx}" - MAIN_DEPENDENCY "${input_yxx}" - ) - - else() - # Look for prebuilt versions of the outputs. - set(commands "") - set(depends "") - - foreach(output ${outputs}) - set(prebuilt_file "${output}.prebuilt") - get_filename_component(prebuilt_file "${prebuilt_file}" ABSOLUTE) - - if(NOT EXISTS "${prebuilt_file}") - message(SEND_ERROR "Bison was not found and ${prebuilt_file} does not exist!") - endif() - - list(APPEND depends "${prebuilt_file}") - set(commands ${commands} COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) - endforeach() - - add_custom_command( - OUTPUT ${outputs} - ${commands} - DEPENDS ${depends} - ) - endif() -endfunction(add_bison_target) - - -# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. -if(CMAKE_VERSION VERSION_LESS 2.8.11) - # Replace some built-in functions in order to extend their functionality. - function(add_library target) - _add_library(${target} ${ARGN}) - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - function(add_executable target) - _add_executable(${target} ${ARGN}) - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - function(target_link_libraries target) - set(interface_dirs) - get_target_property(target_interface_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) - - foreach(lib ${ARGN}) - get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) - - if(lib_interface_dirs) - list(APPEND interface_dirs ${lib_interface_dirs}) - endif() - endforeach() - - list(REMOVE_DUPLICATES interface_dirs) - - #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interface_dirs}) - include_directories(${interface_dirs}) - - # Update this target's interface inc dirs. - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") - - # Call to the built-in function we are overriding. - _target_link_libraries(${target} ${ARGN}) - endfunction() - -else() - # 2.8.11 supports this natively. - set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) -endif() - -set(CMAKE_INCLUDE_CURRENT_DIR ON) From 1fc064104f0a09bd4c49d17ae6c9ea139554fab5 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 13:46:28 -0700 Subject: [PATCH 069/744] cmake: Rename dtool/Packages.cmake to dtool/Package.cmake to keep consistency with ppremake. --- dtool/{Packages.cmake => Package.cmake} | 3 --- 1 file changed, 3 deletions(-) rename dtool/{Packages.cmake => Package.cmake} (99%) diff --git a/dtool/Packages.cmake b/dtool/Package.cmake similarity index 99% rename from dtool/Packages.cmake rename to dtool/Package.cmake index 461d2e3cd3..04b2139ab7 100644 --- a/dtool/Packages.cmake +++ b/dtool/Package.cmake @@ -20,9 +20,6 @@ elseif(NOTHING) set(CONFIG_DISABLE_EVERYTHING On) endif() - -include(ConfigurePackage) - # Find and configure Eigen library find_package(Eigen3 QUIET) config_package(EIGEN "Eigen") From 7321c7b4b75a150fbe24e5fe80547af4c95b4173 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 13:46:47 -0700 Subject: [PATCH 070/744] cmake: add missing prc variables to the mark_as_advanced declaration. --- dtool/Config.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 86393eac4e..6247336361 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -171,11 +171,11 @@ option(PRC_SAVE_DESCRIPTIONS "Define if you want to save the descriptions for ConfigVariables." ON) -mark_as_advanced(PRC_DEFAULT_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS +mark_as_advanced(DEFAULT_PRC_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS PRC_PATTERNS PRC_ENCRYPTED_PATTERNS PRC_ENCRYPTION_KEY PRC_EXECUTABLE_PATTERNS PRC_EXECUTABLE_ARGS_ENVVAR PRC_PUBLIC_KEYS_FILENAME PRC_RESPECT_TRUST_LEVEL - PRC_DCONFIG_TRUST_LEVEL PRC_INC_TRUST_LEVEL) + PRC_DCONFIG_TRUST_LEVEL PRC_INC_TRUST_LEVEL PRC_SAVE_DESCRIPTIONS) # # This is the end of the PRC variable customization section. The From 26b3d826b9fa707447d65e762b998cd4369e88cf Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 14:31:17 -0700 Subject: [PATCH 071/744] cmake: packages: add support for wxwidgets --- dtool/Package.cmake | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 04b2139ab7..2399253163 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -128,9 +128,7 @@ config_package(OPENAL "OpenAL sound library") 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() +set(GTK_FOUND ${GTK2_FOUND}) # Mangle for convenience config_package(GTK "gtk+-2") # Find and configure Freetype @@ -147,15 +145,20 @@ endif() # Find and configure PhysX #find_package(PhysX) -#config_package(PHYSX COMMENT "Aegia PhysX") +#config_package(PHYSX "Aegia PhysX") # Find and configure SpeedTree #find_package(SpeedTree) -#config_package(SPEEDTREE COMMENT "SpeedTree") +#config_package(SPEEDTREE "SpeedTree") # Find and configure WxWidgets -#find_package(WxWidgets) -#config_package(WX COMMENT "WxWidgets") +find_package(wxWidgets QUIET) +if(WXWIDGETS_FOUND) + set(WX_FOUND TRUE) # Mangle for convenience + mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) # Cleanup after builtin find + mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) # Cleanup after builtin find +endif() +config_package(WX "WxWidgets") # Find and configure FLTK #find_package(FLTK) From 9c42b3602f6cc0cd8a4fb387940ae14e2c172a1a Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 14:36:22 -0700 Subject: [PATCH 072/744] cmake: packages: Add FLTK find and config. --- dtool/Package.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 2399253163..11a647f9ff 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -161,8 +161,8 @@ endif() config_package(WX "WxWidgets") # Find and configure FLTK -#find_package(FLTK) -#config_package(FLTK) +find_package(FLTK QUIET) +config_package(FLTK) # Find and configure OpenGL #find_package(OpenGL) From 89e0cd9d963dc6e639db6d998553a794525e508f Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 14:39:49 -0700 Subject: [PATCH 073/744] cmake: packages: Add OpenGL find and config. --- dtool/Package.cmake | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 11a647f9ff..c7a7c52578 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -124,6 +124,10 @@ config_package(FMODEX "FMOD Ex sound library") find_package(OpenAL QUIET) config_package(OPENAL "OpenAL sound library") +# Find and configure OpenGL +find_package(OpenGL QUIET) +config_package(OPENGL "OpenGL") + # Find and configure GTK set(Freetype_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2 set(GTK2_GTK_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2 @@ -134,22 +138,6 @@ config_package(GTK "gtk+-2") # Find and configure Freetype find_package(Freetype QUIET) config_package(FREETYPE "Freetype") -if(HAVE_FREETYPE AND NOT WIN32) - set(FREETYPE_CONFIG freetype-config) -endif() - - -######## -# TODO # -######## - -# Find and configure PhysX -#find_package(PhysX) -#config_package(PHYSX "Aegia PhysX") - -# Find and configure SpeedTree -#find_package(SpeedTree) -#config_package(SPEEDTREE "SpeedTree") # Find and configure WxWidgets find_package(wxWidgets QUIET) @@ -164,9 +152,18 @@ config_package(WX "WxWidgets") find_package(FLTK QUIET) config_package(FLTK) -# Find and configure OpenGL -#find_package(OpenGL) -#config_package(OPENGL COMMENT "OpenGL") + +######## +# TODO # +######## + +# Find and configure PhysX +#find_package(PhysX) +#config_package(PHYSX "Aegia PhysX") + +# Find and configure SpeedTree +#find_package(SpeedTree) +#config_package(SPEEDTREE "SpeedTree") # Find and configure OpenGL ES 1 #find_package(GLES) From 87dba6f06476326bf09f9ee0f20aa1248a3e98db Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 14:58:38 -0700 Subject: [PATCH 074/744] cmake: packages: Add SDL find and config, general bugfixing and cleanup --- dtool/Package.cmake | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index c7a7c52578..6fbe140182 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -49,7 +49,6 @@ else() unset(BUILD_EIGEN_VECTORIZATION CACHE) endif() - # Find and configure OpenSSL library find_package(OpenSSL QUIET COMPONENTS ssl crypto) config_package(OPENSSL "OpenSSL") @@ -71,7 +70,6 @@ else() unset(BUILD_OPENSSL_ERROR_REPORTS CACHE) endif() - # Find and configure JPEG library find_package(JPEG QUIET) config_package(JPEG "libjpeg") @@ -126,7 +124,12 @@ config_package(OPENAL "OpenAL sound library") # Find and configure OpenGL find_package(OpenGL QUIET) -config_package(OPENGL "OpenGL") +set(GL_FOUND ${OPENGL_FOUND}) +config_package(GL "OpenGL") + +# Find and configure Freetype +find_package(Freetype QUIET) +config_package(FREETYPE "Freetype") # Find and configure GTK set(Freetype_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2 @@ -135,23 +138,39 @@ find_package(GTK2 QUIET COMPONENTS gtk) set(GTK_FOUND ${GTK2_FOUND}) # Mangle for convenience config_package(GTK "gtk+-2") -# Find and configure Freetype -find_package(Freetype QUIET) -config_package(FREETYPE "Freetype") - # Find and configure WxWidgets find_package(wxWidgets QUIET) if(WXWIDGETS_FOUND) set(WX_FOUND TRUE) # Mangle for convenience - mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) # Cleanup after builtin find - mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) # Cleanup after builtin find + + # Cleanup after builtin FindWx + mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) + mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) endif() config_package(WX "WxWidgets") # Find and configure FLTK +set(OpenGL_FIND_QUIETLY TRUE) # Fix for builtin FindFLTK find_package(FLTK QUIET) config_package(FLTK) +# Cleanup after builtin FindFLTK +mark_as_advanced(FLTK_DIR) +mark_as_advanced(FLTK_MATH_LIBRARY) + +# Find and configure SDL +set(Threads_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +set(Eigen3_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +set(PythonLibs_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +set(PythonInterp_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +find_package(SDL QUIET) +config_package(SDL) + +# Cleanup after builtin FindSDL +mark_as_advanced(SDLMAIN_LIBRARY) +mark_as_advanced(SDL_INCLUDE_DIR) +mark_as_advanced(SDL_LIBRARY) +mark_as_advanced(SDL_LIBRARY_TEMP) ######## # TODO # @@ -189,11 +208,6 @@ config_package(FLTK) #find_package(Tinydisplay) #config_package(TINYDISPLAY COMMENT "Tinydisplay") -#### Was commented out in original 'Config.pp' not sure why -# Find and configure SDL -#find_package(SDL) -#config_package(SDL) - # Find and configure Mesa #find_package(Mesa) #config_package(MESA COMMENT "Mesa") From f3d7a325abc5fce21aaed3c07786ce0b818f63d7 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 15:12:22 -0700 Subject: [PATCH 075/744] cmake: bugfix: Should be #ifdef HAVE_GL not #if HAVE_GL --- dtool/dtool_config.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 186bea89b2..7d0114a3fc 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -116,7 +116,7 @@ /* Define if we have OpenGL installed and want to build for GL. */ #cmakedefine HAVE_GL -#if HAVE_GL +#ifdef HAVE_GL #cmakedefine MIN_GL_VERSION_MAJOR #cmakedefine MIN_GL_VERSION_MINOR #endif From 89f8f2f12a20cb58ac73107fc00bee6539991dd0 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 15:37:24 -0700 Subject: [PATCH 076/744] cmake: Add various missing header includes. --- panda/src/downloader/identityStream.cxx | 1 + panda/src/downloader/identityStreamBuf.cxx | 1 + panda/src/express/password_hash.cxx | 1 + panda/src/express/virtualFileMount.cxx | 1 + panda/src/express/virtualFileSimple.cxx | 1 + 5 files changed, 5 insertions(+) diff --git a/panda/src/downloader/identityStream.cxx b/panda/src/downloader/identityStream.cxx index f47d806c80..ce78718426 100644 --- a/panda/src/downloader/identityStream.cxx +++ b/panda/src/downloader/identityStream.cxx @@ -16,6 +16,7 @@ // This module is not compiled if OpenSSL is not available. #ifdef HAVE_OPENSSL +#include "httpChannel.h" //////////////////////////////////////////////////////////////////// // Function: IIdentityStream::Destructor diff --git a/panda/src/downloader/identityStreamBuf.cxx b/panda/src/downloader/identityStreamBuf.cxx index 90df917fcc..f4b2076291 100644 --- a/panda/src/downloader/identityStreamBuf.cxx +++ b/panda/src/downloader/identityStreamBuf.cxx @@ -16,6 +16,7 @@ // This module is not compiled if OpenSSL is not available. #ifdef HAVE_OPENSSL +#include "httpChannel.h" #ifndef HAVE_STREAMSIZE // Some compilers (notably SGI) don't define this for us diff --git a/panda/src/express/password_hash.cxx b/panda/src/express/password_hash.cxx index 145476c63e..34670107e4 100644 --- a/panda/src/express/password_hash.cxx +++ b/panda/src/express/password_hash.cxx @@ -20,6 +20,7 @@ #include "pnotify.h" #include "openssl/evp.h" +#include "memoryHook.h" //////////////////////////////////////////////////////////////////// // Function: password_hash diff --git a/panda/src/express/virtualFileMount.cxx b/panda/src/express/virtualFileMount.cxx index 1de64d446b..4be532b8a7 100644 --- a/panda/src/express/virtualFileMount.cxx +++ b/panda/src/express/virtualFileMount.cxx @@ -14,6 +14,7 @@ #include "virtualFileMount.h" #include "virtualFileSimple.h" +#include "virtualFileSystem.h" #include "zStream.h" TypeHandle VirtualFileMount::_type_handle; diff --git a/panda/src/express/virtualFileSimple.cxx b/panda/src/express/virtualFileSimple.cxx index 7a08bb5729..330b73e30f 100644 --- a/panda/src/express/virtualFileSimple.cxx +++ b/panda/src/express/virtualFileSimple.cxx @@ -15,6 +15,7 @@ #include "virtualFileSimple.h" #include "virtualFileMount.h" #include "virtualFileList.h" +#include "dcast.h" TypeHandle VirtualFileSimple::_type_handle; From 5fdf4828bed67181eeff04c3386167b06457868c Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 22 Dec 2013 00:18:57 +0100 Subject: [PATCH 077/744] package macros, add stuff to Config.cmake --- CMakeLists.txt | 1 + dtool/Config.cmake | 175 ++++++++++++++++++++++++++--- dtool/LocalSetup.cmake | 35 +++++- dtool/PackageMacros.cmake | 77 +++++++++++++ dtool/src/dtoolbase/CMakeLists.txt | 1 + 5 files changed, 268 insertions(+), 21 deletions(-) create mode 100644 dtool/PackageMacros.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a272f652c..04670c3d9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,7 @@ include_directories("${CMAKE_BINARY_DIR}") include(dtool/PandaMacros.cmake) include(dtool/PandaVersion.cmake) include(dtool/Packages.cmake) +include(dtool/PackageMacros.cmake) include(dtool/Config.cmake) include(dtool/Interrogate.cmake) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 86393eac4e..46229431ed 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -6,6 +6,19 @@ # generate build scripts appropriate to each environment. # +# Define the plaform we are building on. +if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(IS_LINUX 1) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "Darwin") + set(IS_OSX 1) +endif() + +if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(IS_FREEBSD 1) +endif() + # The character used to separate components of an OS-specific # directory name depends on the platform (it is '/' on Unix, '\' on # Windows). That character selection is hardcoded into Panda and @@ -254,13 +267,23 @@ endif() # Now let's check for the presence of various thirdparty libraries. # -option(USE_EIGEN +find_package(Eigen3) + +package_option(EIGEN "Enables experimental support for the Eigen linear algebra library. If this is provided, Panda will use this library as the fundamental implementation of its own linmath library; otherwise, it will use its own internal implementation. The primary advantage of using Eigen is SSE2 support, which is only activated if LINMATH_ALIGN -is also enabled." ON) +is also enabled.") + +#option(USE_EIGEN +# "Enables experimental support for the Eigen linear algebra library. +#If this is provided, Panda will use this library as the fundamental +#implementation of its own linmath library; otherwise, it will use +#its own internal implementation. The primary advantage of using +#Eigen is SSE2 support, which is only activated if LINMATH_ALIGN +#is also enabled." ON) option(LINMATH_ALIGN "This is required for activating SSE2 support using Eigen. @@ -268,25 +291,37 @@ Activating this does constrain most objects in Panda to 16-byte alignment, which could impact memory usage on very-low-memory platforms. Currently experimental." ON) -if(USE_EIGEN) - find_package(Eigen3) - if(EIGEN3_FOUND) - set(HAVE_EIGEN3 TRUE) - endif() -endif() +#if(USE_EIGEN) +# find_package(Eigen3) +# if(EIGEN3_FOUND) +# set(HAVE_EIGEN3 TRUE) +# endif() +#endif() -option(USE_PYTHON +find_package(PythonLibs) +find_package(PythonInterp) +set(PYTHON_FOUND ${PYTHONLIBS_FOUND}) + +package_option(PYTHON DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE -is also enabled, Python bindings will be generated." ON) +is also enabled, Python bindings will be generated.") -if(USE_PYTHON) - find_package(PythonLibs) - find_package(PythonInterp) - if(PYTHONLIBS_FOUND) - set(HAVE_PYTHON TRUE) - include_directories("${PYTHON_INCLUDE_DIR}") - endif() -endif() +# Always include Python, because we include it pretty much everywhere +# though we don't usually want to link it in as well. +include_directories(${PYTHON_INCLUDE_DIRS}) + +#option(USE_PYTHON +# "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE +#is also enabled, Python bindings will be generated." ON) + +#if(USE_PYTHON) +# find_package(PythonLibs) +# find_package(PythonInterp) +# if(PYTHONLIBS_FOUND) +# set(HAVE_PYTHON TRUE) +# include_directories("${PYTHON_INCLUDE_DIR}") +# endif() +#endif() # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. @@ -366,6 +401,110 @@ mark_as_advanced(DO_MEMORY_USAGE SIMULATE_NETWORK_DELAY SUPPORT_IMMEDIATE_MODE USE_MEMORY_DLMALLOC USE_MEMORY_PTMALLOC2 MEMORY_HOOK_DO_ALIGN ALTERNATIVE_MALLOC USE_DELETED_CHAIN) +option(HAVE_WIN_TOUCHINPUT +"Define this if you are building on Windows 7 or better, and you +want your Panda build to run only on Windows 7 or better, and you +need to use the Windows touchinput interfaces." OFF) + +option(WANT_NATIVE_NET + "Define this true to build the low-level native network +implementation. Normally this should be set true." ON) + +option(HAVE_NET + "Do you want to build the high-level network interface? This layers +on top of the low-level native_net interface, specified above. +Normally, if you build NATIVE_NET, you will also build NET." + ${WANT_NATIVE_NET}) + +option(HAVE_EGG + "Do you want to build the egg loader? Usually there's no reason to +avoid building this, unless you really want to make a low-footprint +build (such as, for instance, for the iPhone)." ON) + +# Is OpenSSL installed, and where? +find_package(OpenSSL) + +package_option(OPENSSL DEFAULT ON + "Enable OpenSSL support") + +option(REPORT_OPENSSL_ERRORS + "Define this true to include the OpenSSL code to report verbose +error messages when they occur." ${DO_DEBUG}) + +# Is libjpeg installed, and where? +find_package(JPEG) + +package_option(JPEG DEFAULT ON + "Enable support for loading .jpg images.") + +# Some versions of libjpeg did not provide jpegint.h. Redefine this +# to false if you lack this header file. +#set(PHAVE_JPEGINT_H TRUE) + +option(HAVE_VIDEO4LINUX + "Set this to enable webcam support on Linux." ${IS_LINUX}) + +# Is libpng installed, and where? +find_package(PNG) + +package_option(PNG DEFAULT ON + "Enable support for loading .png images.") + +# Is libtiff installed, and where? +find_package(TIFF) + +package_option(TIFF + "Enable support for loading .tif images.") + +# These image formats don't require the assistance of a +# third-party library to read and write, so there's normally no +# reason to disable them int he build, unless you are looking to +# reduce the memory footprint. + +option(HAVE_SGI_RGB "Enable support for loading SGI RGB images." ON) +option(HAVE_TGA "Enable support for loading TGA images." ON) +option(HAVE_IMG "Enable support for loading IMG images." ON) +option(HAVE_SOFTIMAGE_PIC "Enable support for loading SOFTIMAGE PIC images." ON) +option(HAVE_BMP "Enable support for loading BMP images." ON) +option(HAVE_PNM "Enable support for loading PNM images." ON) + +mark_as_advanced(HAVE_SGI_RGB HAVE_TGA + HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM) + +# Is libtar installed, and where? +find_package(Tar) + +package_option(TAR + "This is used to optimize patch generation against tar files.") + +# Is libfftw installed, and where? +find_package(FFTW) + +package_option(FFTW + "This enables support for lossless compression of animations in +.bam files. This is rarely used, and you probably don't need it.") + +#TODO PHAVE_DRFFTW_H + +# Is libsquish installed, and where? +find_package(Squish) + +package_option(SQUISH + "Enables support for automatic compression of DXT textures.") + +#TODO: Cg HERE! + +# Is VRPN installed, and where? +find_package(VRPN) + +package_option(VRPN + "Enables support for connecting to VRPN servers.") + +# Is ZLIB installed, and where? +find_package(ZLIB) + +package_option(ZLIB DEFAULT ON + "Enables support for compression of Panda assets.") # # < Insert the rest of the Config.pp port here < diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 2ec5e7c6f8..978c79073b 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -17,9 +17,6 @@ include(TestForSTDNamespace) # Define if we have libjpeg installed. check_include_file_cxx(jpegint.h PHAVE_JPEGINT_H) -# Define to build video-for-linux. -check_include_file_cxx(linux/videodev2.h HAVE_VIDEO4LINUX) - # Check if this is a big-endian system. test_big_endian(WORDS_BIGENDIAN) @@ -182,6 +179,38 @@ else() set(LINK_ALL_STATIC ON) endif() +# Now go through all the packages and report whether we have them. +message(STATUS "Configuring support for the following optional third-party packages:") + +#report_package(EIGEN "Eigen linear algebra library") +if(LINMATH_ALIGN) + message("+ (vectorization enabled in build)") +else() + message("- (vectorization NOT enabled in build)") +endif() + +if(HAVE_INTERROGATE AND HAVE_PYTHON) + message("Compilation will generate Python interfaces.") +else() + message("Configuring Panda WITHOUT Python interfaces.") +endif() + +if(HAVE_THREADS) + if(SIMPLE_THREADS) + message("Compilation will include simulated threading support.") + + elseif(DO_PIPELINING) + message("Compilation will include full, pipelined threading support.") + + else() + message("Compilation will include nonpipelined threading support.") + endif() +else() + message("Configuring Panda without threading support.") +endif() + +message("See dtool_config.h for more details about the specified configuration.") + # Generate dtool_config.h configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/dtool_config.h") include_directories("${PROJECT_BINARY_DIR}") diff --git a/dtool/PackageMacros.cmake b/dtool/PackageMacros.cmake new file mode 100644 index 0000000000..de2822e7cc --- /dev/null +++ b/dtool/PackageMacros.cmake @@ -0,0 +1,77 @@ +# Filename: ConfigurePackage.cmake +# Author: kestred (30 Nov, 2013) +# +# This modules defines a function which finds and configures libraries +# and packages for Panda3Ds configuration file headers (.h files). +# +# Assumes the file has already been found with find_package(). +# + +# +# Usage: +# package_option(PYTHON "Enables support for Python" [DEFAULT ON | OFF]) +# If no default is given, it is initialized to whether it was found on the system. +# +function(package_option name) + # Parse the arguments. + set(command) + set(default) + set(cache_string) + + foreach(arg ${ARGN}) + if(command STREQUAL "DEFAULT") + set(default "${arg}") + set(command) + + elseif(arg STREQUAL "DEFAULT") + set(command "DEFAULT") + + else() + # Yes, a list, ecause semicolons can be in there, and + # that gets split up into multiple args, so we have to + # join it back together here. + list(APPEND cache_string "${arg}") + + endif() + endforeach() + + if(command STREQUAL "DEFAULT") + message(SEND_ERROR "DEFAULT in package_option takes an argument") + endif() + + # If the default is not set, we set it. + if(NOT DEFINED default) + set(default "${${name}_FOUND}") + endif() + + # If it was set by the user but not found, display an error. + if(HAVE_${name} AND NOT ${name}_FOUND) + message(SEND_ERROR "NOT FOUND: ${name}. Disable HAVE_${name} to continue.") + endif() + + # Create the option. + option("HAVE_${name}" "${cache_string}" "${default}") +endfunction() + +# +# Useful macro that picks up a package located using find_package +# as dependencies of a target that is going to be built. +# Example use: +# add_library(mylib ${SOURCES}) +# target_use_packages(mylib PYTHON PNG) +# +macro(target_use_packages target) + set(libs ${ARGV}) + list(REMOVE_AT libs 0) + + foreach(lib ${libs}) + if(HAVE_${lib}) + target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") + if(${lib}_LIBRARIES) + target_link_libraries("${target}" ${${lib}_LIBRARIES}) + else() + target_link_libraries("${target}" ${${lib}_LIBRARY}) + endif() + endif() + endforeach(lib) +endmacro(target_use_packages) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 3761f03b1e..92edf9886e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -62,3 +62,4 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) + From 8cdc81934491fe1a1b67a0cc6dd8faed997f3603 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 19:30:53 -0700 Subject: [PATCH 078/744] cmake: config: Move new package macros to cmake/macros, use new package macros in Package.cmake, begin removing redundant package/config options from Package.cmake (theses are being moved to Config.cmake). --- CMakeLists.txt | 3 +- cmake/macros/ConfigPackage.cmake | 81 ----------------- cmake/macros/PackageConfig.cmake | 98 +++++++++++++++++++++ dtool/Config.cmake | 2 +- dtool/Package.cmake | 143 ++++++------------------------- dtool/PackageMacros.cmake | 77 ----------------- 6 files changed, 128 insertions(+), 276 deletions(-) delete mode 100644 cmake/macros/ConfigPackage.cmake create mode 100644 cmake/macros/PackageConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a0fedea951..e17f3f2826 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") include(AutoInclude) # Implements automatic include_directories finding include(AddBisonTarget) # Defines add_bison_target function include(CompositeSources) # Defines composite_sources function -include(ConfigPackage) # Defines config_package function +include(PackageConfig) # Defines package_option AND target_use_packages include(Interrogate) # Defines target_interrogate AND add_python_module # Add the include path for source and header files generated by CMake @@ -21,7 +21,6 @@ include_directories("${CMAKE_BINARY_DIR}") # Configure Panda3D include(dtool/PandaVersion.cmake) include(dtool/Package.cmake) -include(dtool/PackageMacros.cmake) include(dtool/Config.cmake) # Determine which trees to build. diff --git a/cmake/macros/ConfigPackage.cmake b/cmake/macros/ConfigPackage.cmake deleted file mode 100644 index b4511faec2..0000000000 --- a/cmake/macros/ConfigPackage.cmake +++ /dev/null @@ -1,81 +0,0 @@ -# Filename: ConfigPackage.cmake -# Author: kestred (30 Nov, 2013) -# -# This modules defines a function which finds and configures libraries -# and packages for Panda3Ds configuration file headers (.h files). -# -# Assumes the file has already been found with find_package(). -# -# Usage: -# config_package(package_name) -# -# The following variables can be set to override the cached values of USE_XYZZY -# CONFIG_DISABLE_EVERYTHING - always set USE_XYZZY to false -# CONFIG_DISABLE_MISSING - set USE_XYZZY to false if it was not found -# CONFIG_ENABLE_FOUND - set USE_XYZZY to true if the package was found -# CONFIG_ENABLE_EVERYTHING - always set USE_XYZZY to true (even if the package is missing) -# - -# Usage: -# config_package(PACKAGE_NAME []) -function(config_package PKG_NAME) - # Get package display name - foreach(arg ${ARGN}) - set(DISPLAY_NAME "${DISPLAY_NAME}${arg}") - endforeach() - - # Set function vars to defaults - if(NOT DISPLAY_NAME) - set(DISPLAY_NAME ${PKG_NAME}) - endif() - - if(${PKG_NAME}_FOUND) - # Output success after finding the package for the first time - if(NOT DEFINED USE_${PKG_NAME} AND NOT CONFIG_DISABLE_EVERYTHING) - message(STATUS "+ ${DISPLAY_NAME}") - endif() - - ### Add a USE_XYZZY config variable to the cache ### - if(CONFIG_ENABLE_EVERYTHING OR CONFIG_DISABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) - unset(USE_${PKG_NAME} CACHE) - endif() - - if(CONFIG_DISABLE_EVERYTHING) - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) - else() - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" ON) - endif() - - - # Update HAVE_XYZZY - if(USE_${PKG_NAME}) - set(HAVE_${PKG_NAME} TRUE PARENT_SCOPE) - endif() - - elseif(DEFINED USE_${PKG_NAME}) - # If we were compiling with a particular package, but we can't find it; - # then inform the user the package was lost. - if(USE_${PKG_NAME}) - message(STATUS "- Can no longer find ${DISPLAY_NAME}") - - # Only unset if USE_XYZZY is true; - # This allows us to set USE_XYZZY to false to silence the output - unset(USE_${PKG_NAME} CACHE) - - # If using Discovery, we want to silently disable missing packages - if(CONFIG_DISABLE_MISSING) - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) - endif() - endif() - - else() - # If using DISCOVERED NOTHING, we want to silently disable missing packages - if(CONFIG_DISABLE_MISSING OR CONFIG_DISABLE_EVERYTHING) - option(USE_${PKG_NAME} "If on, compile Panda3D with ${DISPLAY_NAME}" OFF) - - else() - # Otherwise, output failure to find package - message(STATUS "- Did not find ${DISPLAY_NAME}") - endif() - endif() -endfunction() diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake new file mode 100644 index 0000000000..e55a83ef01 --- /dev/null +++ b/cmake/macros/PackageConfig.cmake @@ -0,0 +1,98 @@ +# Filename: PackageConfig.cmake +# +# This modules defines functions which find and configures libraries +# and packages for Panda3Ds configuration file headers (.h files). +# +# Assumes the file has already been found with find_package(). +# +# Function: package_option +# Usage: +# package_option(package_name DOCSTRING [DEFAULT ON | OFF]) +# Examples: +# add_library(mylib ${SOURCES}) +# +# If no default is given, the default is whether the package was found. +# +# +# Function: target_use_packages +# Usage: +# target_use_packages(target [PACKAGES ...]) +# Examples: +# target_use_packages(mylib PYTHON PNG) +# + + +# +# package_option +# +function(package_option name) + # Parse the arguments. + set(command) + set(default) + set(cache_string) + + foreach(arg ${ARGN}) + if(command STREQUAL "DEFAULT") + set(default "${arg}") + set(command) + + elseif(arg STREQUAL "DEFAULT") + set(command "DEFAULT") + + else() + # Yes, a list, because semicolons can be in there, and + # that gets split up into multiple args, so we have to + # join it back together here. + list(APPEND cache_string "${arg}") + + endif() + endforeach() + + if(command STREQUAL "DEFAULT") + message(SEND_ERROR "DEFAULT in package_option takes an argument") + endif() + + # If the default is not set, we set it. + if(NOT DEFINED default) + set(default "${${name}_FOUND}") + endif() + + # If it was set by the user but not found, display an error. + if(HAVE_${name} AND NOT ${name}_FOUND) + message(SEND_ERROR "NOT FOUND: ${name}. Disable HAVE_${name} to continue.") + endif() + + # Prevent the function from being called twice. + # This would indicate a cmake error. + if(PANDA_DID_SET_OPTION_${name}) + message(SEND_ERROR "package_option(${name}) was called twice. + This is a bug in the cmake build scripts.") + else() + set(PANDA_DID_SET_OPTION_${name} TRUE PARENT_SCOPE) + endif() + + # Create the option. + option("HAVE_${name}" "${cache_string}" "${default}") +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_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") + if(${lib}_LIBRARIES) + target_link_libraries("${target}" ${${lib}_LIBRARIES}) + else() + target_link_libraries("${target}" ${${lib}_LIBRARY}) + endif() + endif() + endforeach(lib) +endmacro(target_use_packages) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 55150c9cd6..3aee5c9b2d 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -422,7 +422,7 @@ avoid building this, unless you really want to make a low-footprint build (such as, for instance, for the iPhone)." ON) # Is OpenSSL installed, and where? -find_package(OpenSSL) +find_package(OpenSSL COMPONENTS ssl crypto) package_option(OPENSSL DEFAULT ON "Enable OpenSSL support") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 6fbe140182..0cbd91ad45 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,142 +1,52 @@ message(STATUS "") message(STATUS "Configuring support for the following optional third-party packages:") -# Settings to change USE_PACKAGE behavior (these options override cached values) -set(CONFIG_ENABLE_EVERYTHING Off) -set(CONFIG_DISABLE_EVERYTHING Off) -set(CONFIG_ENABLE_FOUND Off) -set(CONFIG_DISABLE_MISSING Off) - -# Update USE_PACKAGE settings based on CLI arguments -if(EVERYTHING) - message("Re-enabling all disabled third-party libraries.") - set(CONFIG_ENABLE_EVERYTHING On) -elseif(DISCOVERED) - message("Enabling found and disabling not-found third-party libraries.") - set(CONFIG_ENABLE_FOUND On) - set(CONFIG_DISABLE_MISSING On) -elseif(NOTHING) - message("Disabling all third-party libraries.") - set(CONFIG_DISABLE_EVERYTHING On) -endif() - -# Find and configure Eigen library -find_package(Eigen3 QUIET) -config_package(EIGEN "Eigen") -if(HAVE_EIGEN) - if(WIN32) - set(EIGEN_CFLAGS "/arch:SSE2") - else() - set(EIGEN_CFLAGS "-msse2") - endif() - - if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) - unset(BUILD_EIGEN_VECTORIZATION) - elseif(CONFIG_DISABLE_EVERYTHING) - option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." OFF) - endif() - - if(NOT DEFINED BUILD_EIGEN_VECTORIZATION) - message(STATUS "+ (vectorization enabled in build)") - endif() - - option(BUILD_EIGEN_VECTORIZATION "If on, vectorization is enabled in build." ON) - - if(BUILD_EIGEN_VECTORIZATION) - set(LINMATH_ALIGN TRUE) - endif() -else() - unset(BUILD_EIGEN_VECTORIZATION CACHE) -endif() - -# Find and configure OpenSSL library -find_package(OpenSSL QUIET COMPONENTS ssl crypto) -config_package(OPENSSL "OpenSSL") -if(HAVE_OPENSSL) - if(CONFIG_ENABLE_EVERYTHING OR CONFIG_ENABLE_FOUND) - unset(BUILD_OPENSSL_ERROR_REPORTS) - endif() - - if(CMAKE_BUILD_TYPE MATCHES "Debug" OR CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo") - option(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." ON) - else() - set(BUILD_OPENSSL_ERROR_REPORTS "If on, OpenSSL reports verbose error messages when they occur." OFF) - endif() - - if(BUILD_OPENSSL_ERROR_REPORTS) - set(REPORT_OPENSSL_ERRORS TRUE) - endif() -else() - unset(BUILD_OPENSSL_ERROR_REPORTS CACHE) -endif() - -# Find and configure JPEG library -find_package(JPEG QUIET) -config_package(JPEG "libjpeg") - -# Find and configure PNG library -find_package(PNG QUIET) -config_package(PNG "libpng") - -# Find and configure TIFF library -find_package(TIFF QUIET COMPONENTS tiff z) -config_package(TIFF "libtiff") - -# Find and configure Tar library -find_package(Tar QUIET) -config_package(TAR "libtar") - -# Find and configure FFTW library -find_package(FFTW QUIET) -config_package(FFTW "fftw") - -# Find and configure Squish library -find_package(Squish QUIET) -config_package(SQUISH "squish") - # Find and configure Cg library find_package(Cg QUIET) -config_package(CG "Nvidia Cg Shading Langauge") -config_package(CGGL "Cg OpenGL API") -config_package(CGDX8 "Cg DX8 API") -config_package(CGDX9 "Cg DX9 API") -config_package(CGDX10 "Cg DX10 API") - -# Find and configure VRPN library -find_package(VRPN QUIET) -config_package(VRPN) - -# Find and configure zlib -find_package(ZLIB QUIET) -config_package(ZLIB "zlib") +#config_package(CG "Nvidia Cg Shading Langauge") +#config_package(CGGL "Cg OpenGL API") +#config_package(CGDX8 "Cg DX8 API") +#config_package(CGDX9 "Cg DX9 API") +#config_package(CGDX10 "Cg DX10 API") +package_option(CG) +package_option(CGGL) +package_option(CGDX8) +package_option(CGDX9) +package_option(CGDX10) # Find and configure Miles Sound System find_package(Miles QUIET) -config_package(RAD_MSS "Miles Sound System") +#config_package(RAD_MSS "Miles Sound System") +package_option(RAD_MSS) # Find and configure FMOD Ex find_package(FMODEx QUIET) -config_package(FMODEX "FMOD Ex sound library") +#config_package(FMODEX "FMOD Ex sound library") +package_option(FMODEX) # Find and configure OpenAL find_package(OpenAL QUIET) -config_package(OPENAL "OpenAL sound library") +#config_package(OPENAL "OpenAL sound library") +package_option(OPENAL) # Find and configure OpenGL find_package(OpenGL QUIET) set(GL_FOUND ${OPENGL_FOUND}) -config_package(GL "OpenGL") +#config_package(GL "OpenGL") +package_option(GL) # Find and configure Freetype find_package(Freetype QUIET) -config_package(FREETYPE "Freetype") +#config_package(FREETYPE "Freetype") +package_option(FREETYPE) # Find and configure GTK 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) set(GTK_FOUND ${GTK2_FOUND}) # Mangle for convenience -config_package(GTK "gtk+-2") +#config_package(GTK "gtk+-2") +package_option(GTK) # Find and configure WxWidgets find_package(wxWidgets QUIET) @@ -147,12 +57,14 @@ if(WXWIDGETS_FOUND) mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) endif() -config_package(WX "WxWidgets") +#config_package(WX "WxWidgets") +package_option(WX) # Find and configure FLTK set(OpenGL_FIND_QUIETLY TRUE) # Fix for builtin FindFLTK find_package(FLTK QUIET) -config_package(FLTK) +#config_package(FLTK) +package_option(FLTK) # Cleanup after builtin FindFLTK mark_as_advanced(FLTK_DIR) @@ -164,7 +76,8 @@ set(Eigen3_FIND_QUIETLY TRUE) # Fix for builtin FindSDL set(PythonLibs_FIND_QUIETLY TRUE) # Fix for builtin FindSDL set(PythonInterp_FIND_QUIETLY TRUE) # Fix for builtin FindSDL find_package(SDL QUIET) -config_package(SDL) +#config_package(SDL) +package_option(SDL) # Cleanup after builtin FindSDL mark_as_advanced(SDLMAIN_LIBRARY) diff --git a/dtool/PackageMacros.cmake b/dtool/PackageMacros.cmake index de2822e7cc..e69de29bb2 100644 --- a/dtool/PackageMacros.cmake +++ b/dtool/PackageMacros.cmake @@ -1,77 +0,0 @@ -# Filename: ConfigurePackage.cmake -# Author: kestred (30 Nov, 2013) -# -# This modules defines a function which finds and configures libraries -# and packages for Panda3Ds configuration file headers (.h files). -# -# Assumes the file has already been found with find_package(). -# - -# -# Usage: -# package_option(PYTHON "Enables support for Python" [DEFAULT ON | OFF]) -# If no default is given, it is initialized to whether it was found on the system. -# -function(package_option name) - # Parse the arguments. - set(command) - set(default) - set(cache_string) - - foreach(arg ${ARGN}) - if(command STREQUAL "DEFAULT") - set(default "${arg}") - set(command) - - elseif(arg STREQUAL "DEFAULT") - set(command "DEFAULT") - - else() - # Yes, a list, ecause semicolons can be in there, and - # that gets split up into multiple args, so we have to - # join it back together here. - list(APPEND cache_string "${arg}") - - endif() - endforeach() - - if(command STREQUAL "DEFAULT") - message(SEND_ERROR "DEFAULT in package_option takes an argument") - endif() - - # If the default is not set, we set it. - if(NOT DEFINED default) - set(default "${${name}_FOUND}") - endif() - - # If it was set by the user but not found, display an error. - if(HAVE_${name} AND NOT ${name}_FOUND) - message(SEND_ERROR "NOT FOUND: ${name}. Disable HAVE_${name} to continue.") - endif() - - # Create the option. - option("HAVE_${name}" "${cache_string}" "${default}") -endfunction() - -# -# Useful macro that picks up a package located using find_package -# as dependencies of a target that is going to be built. -# Example use: -# add_library(mylib ${SOURCES}) -# target_use_packages(mylib PYTHON PNG) -# -macro(target_use_packages target) - set(libs ${ARGV}) - list(REMOVE_AT libs 0) - - foreach(lib ${libs}) - if(HAVE_${lib}) - target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") - if(${lib}_LIBRARIES) - target_link_libraries("${target}" ${${lib}_LIBRARIES}) - else() - target_link_libraries("${target}" ${${lib}_LIBRARY}) - endif() - endif() - endforeach(lib) -endmacro(target_use_packages) From f81b14a70be845aea63dabc35ed2fae5fea9693b Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 19:41:23 -0700 Subject: [PATCH 079/744] cmake: config: Finish updating config to use the same variables as used in-source. --- dtool/Config.cmake | 105 ++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 64 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3aee5c9b2d..c916299ae7 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -533,36 +533,33 @@ set(HAVE_FLEX ${FLEX_FOUND}) ### Configure threading support ### find_package(Threads) + +# Add basic use flag for threading if(THREADS_FOUND) - # Add basic use flag for threading - option(BUILD_THREADS + option(HAVE_THREADS "If on, compile Panda3D with threading support. Building in support for threading will enable Panda to take advantage of multiple CPU's if you have them (and if the OS supports kernel threads running on different CPU's), but it will slightly slow down Panda for the single CPU case." ON) - if(BUILD_THREADS) - set(HAVE_THREADS TRUE) - else() - unset(BUILD_SIMPLE_THREADS CACHE) - unset(BUILD_OS_SIMPLE_THREADS CACHE) - endif() else() - unset(BUILD_THREADS CACHE) + option(HAVE_THREADS + "If on, compile Panda3D with threading support. +Building in support for threading will enable Panda to take +advantage of multiple CPU's if you have them (and if the OS +supports kernel threads running on different CPU's), but it will +slightly slow down Panda for the single CPU case." OFF) endif() -# Configure debug threads -# Add advanced threading configuration -if(HAVE_THREADS) - if(CMAKE_BUILD_TYPE MATCHES "Debug") - option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) - else() - option(BUILD_DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) - endif() - if(BUILD_DEBUG_THREADS) - set(DEBUG_THREADS TRUE) - endif() +# Configure debug threads +if(CMAKE_BUILD_TYPE MATCHES "Debug") + option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) +else() + option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) +endif() + +if(HAVE_THREADS) set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) if(HAVE_POSIX_THREADS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") @@ -571,9 +568,10 @@ if(HAVE_THREADS) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -pthread") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -pthread") endif() +endif() - option(BUILD_SIMPLE_THREADS - "If on, compile with simulated threads. Threads, by default, use +option(SIMPLE_THREADS + "If on, compile with simulated threads. Threads, by default, use OS-provided threading constructs, which usually allows for full multithreading support (i.e. the program can use multiple CPU's). On the other hand, compiling in this full OS-provided support can @@ -581,75 +579,54 @@ impose some substantial runtime overhead, making the application run slower on a single-CPU machine. This settings avoid the overhead, but still gain some of the basic functionality of threads." OFF) - if(BUILD_SIMPLE_THREADS) - message(STATUS "Compilation will include simulated threading support.") - option(BUILD_OS_SIMPLE_THREADS - "If on, OS threading constructs will be used to perform context switches. + +option(OS_SIMPLE_THREADS + "If on, OS threading constructs will be used to perform context switches. A mutex is used to ensure that only one thread runs at a time, so the normal SIMPLE_THREADS optimizations still apply, and the normal SIMPLE_THREADS scheduler is used to switch between threads (instead of the OS scheduler). This may be more portable and more reliable, but it is a hybrid between user-space threads and os-provided threads." ON) - set(SIMPLE_THREADS TRUE) - if(BUILD_OS_SIMPLE_THREADS) - set(OS_SIMPLE_THREADS TRUE) - endif() - else() - unset(BUILD_OS_SIMPLE_THREADS CACHE) - - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) - if(BUILD_PIPELINING) - message(STATUS "Compilation will include full, pipelined threading support.") - else() - message(STATUS "Compilation will include nonpipelined threading support.") - endif() - endif() -else() - message(STATUS "Configuring Panda without threading support.") -endif() - ### Configure pipelining ### -if(NOT DEFINED BUILD_PIPELINING) - option(BUILD_PIPELINING "If on, compile with pipelined rendering." ON) +option(DO_PIPELINING "If on, compile with pipelined rendering." ON) + + +### Report on threading and pipelining status ### +if(SIMPLE_THREADS) + message(STATUS "Compilation will include simulated threading support.") +elseif(HAVE_THREADS) + if(DO_PIPELINING) + message(STATUS "Compilation will include full, pipelined threading support.") + else() + message(STATUS "Compilation will include nonpipelined threading support.") + endif() +else(NOT SIMPLE_THREADS) + message(STATUS "Configuring Panda without threading support.") endif() -if(BUILD_PIPELINING) - set(DO_PIPELINING TRUE) -endif() - - - -### Configure OS X options ### message(STATUS "") message(STATUS "See dtool_config.h for more details about the specified configuration.\n") ### Miscellaneous configuration if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") - unset(BUILD_WITH_DEFAULT_FONT CACHE) - option(BUILD_WITH_DEFAULT_FONT + unset(COMPILE_IN_DEFAULT_FONT CACHE) + option(COMPILE_IN_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. When turned off, the generated library will save a few kilobytes." OFF) else() - option(BUILD_WITH_DEFAULT_FONT + option(COMPILE_IN_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. When turned off, the generated library will save a few kilobytes." ON) endif() -if(BUILD_WITH_DEFAULT_FONT) - set(COMPILE_IN_DEFAULT_FONT TRUE) -endif() -option(BUILD_PREFER_STDFLOAT +option(STDFLOAT_DOUBLE "Define this true to compile a special version of Panda to use a 'double' floating-precision type for most internal values, such as positions and transforms, instead of the standard single-precision 'float' type. This does not affect the default numeric type of vertices, which is controlled by the runtime config variable vertices-float64." OFF) -if(BUILD_PREFER_STDFLOAT) - set(STDFLOAT_DOUBLE TRUE) -endif() - From 9dd82f90c299b2e05a36f44499f3f93af1fe9f57 Mon Sep 17 00:00:00 2001 From: kestred Date: Sat, 21 Dec 2013 19:45:12 -0700 Subject: [PATCH 080/744] cmake: Update readme to match current cmake variable naming scheme. --- cmake/README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 0b2437f71b..5b46309b87 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -22,17 +22,18 @@ command-line interface; see `man cmake` for more details. In general, the config variable for a particular third party library is: ``` - USE_=True/False # Example: USE_JPEG + HAVE_=True/False # Example: USE_JPEG ``` -Optional features typically use the format: +Panda subpackage building is handled by: ``` - BUILD_=True/False # Example: BUILD_THREADS + BUILD_=True/False # Example: BUILD_DTOOL, BUILD_PANDA ``` -Configuration settings use more direct names: +Other configuration settings use more direct names (same names as in-source): ``` # Examples PANDA_DISTRIBUTOR="MyDistributor" DTOOL_INSTALL="/usr/local/panda" + LINMATH_ALIGN=On # ... etc ... From 58d54eb4fee3674bbb2bdee67916f62fd2c11741 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 00:17:44 -0700 Subject: [PATCH 081/744] Add commented test to panda/src/express/CMakeLists, emulating Sources.pp --- CMakeLists.txt | 1 + panda/src/express/CMakeLists.txt | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e17f3f2826..b85a3ef6bf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ # with invalid HEADER_FILE_ONLY behavior in MSVC 2010. cmake_minimum_required(VERSION 2.8.4) project(Panda3D) +enable_testing() # Add generic modules to cmake module path, # and add Panda3D specific modules to cmake module path diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index f1b4744eb4..b89b598eff 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -126,3 +126,17 @@ composite_sources(p3express P3EXPRESS_SOURCES) add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig) target_interrogate(p3express ALL) + +#add_executable(p3expressTestTypes test_types.cxx) +#target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) +#add_test(p3express_test_types p3expressTestTypes) + +#add_executable(p3expressTestOrderedVector test_ordered_vector.cxx) +#target_link_libraries(p3expressTestOrderedVector p3putil p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) +#add_test(p3express_test_ordered_vector p3expressTestOrderedVector) + +if(HAVE_ZLIB) + #add_executable(p3expressTestBinTarget test_zstream.cxx) + #target_link_libraries(p3expressTestBinTarget p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) + #add_test(p3express_test_zstream p3expressTestBinTarget) +endif() From b07ce7dc9324354e40b041d3587f2dfa0e74f39c Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 00:28:55 -0700 Subject: [PATCH 082/744] Add include guards to our generated dtool_config.h --- dtool/dtool_config.h.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 7d0114a3fc..ab42a14059 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -1,4 +1,6 @@ /* dtool_config.h. Generated automatically by CMake. */ +#ifndef DTOOL_CONFIG_H +#define DTOOL_CONFIG_H /* Define if we have Eigen available. */ #cmakedefine HAVE_EIGEN @@ -463,3 +465,5 @@ #cmakedefine IS_LINUX #cmakedefine IS_FREEBSD #cmakedefine BUILD_IPHONE + +#endif From 3fd5f58583a319a0d07a54d19a22f0b504a68135 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 00:44:14 -0700 Subject: [PATCH 083/744] Add #ifdef and #undef where necessary to prevent duplicate definitions. --- dtool/src/dtoolbase/dlmalloc.h | 6 ++++++ dtool/src/dtoolbase/dlmalloc_src.cxx | 7 +++++++ dtool/src/dtoolbase/dtoolbase.h | 1 + 3 files changed, 14 insertions(+) diff --git a/dtool/src/dtoolbase/dlmalloc.h b/dtool/src/dtoolbase/dlmalloc.h index 1bb3ed8abc..9b3d4e628d 100644 --- a/dtool/src/dtoolbase/dlmalloc.h +++ b/dtool/src/dtoolbase/dlmalloc.h @@ -148,9 +148,15 @@ void* dlvalloc(size_t); */ int dlmallopt(int, int); +#ifndef M_TRIM_THRESHOLD #define M_TRIM_THRESHOLD (-1) +#endif + #define M_GRANULARITY (-2) + +#ifndef M_MMAP_THRESHOLD #define M_MMAP_THRESHOLD (-3) +#endif /* diff --git a/dtool/src/dtoolbase/dlmalloc_src.cxx b/dtool/src/dtoolbase/dlmalloc_src.cxx index 93e843ea75..56c901251d 100644 --- a/dtool/src/dtoolbase/dlmalloc_src.cxx +++ b/dtool/src/dtoolbase/dlmalloc_src.cxx @@ -597,9 +597,15 @@ DEFAULT_MMAP_THRESHOLD default: 256K malloc does support the following options. */ +#ifndef M_TRIM_THRESHOLD #define M_TRIM_THRESHOLD (-1) +#endif + #define M_GRANULARITY (-2) + +#ifndef M_MMAP_THRESHOLD #define M_MMAP_THRESHOLD (-3) +#endif /* ------------------------ Mallinfo declarations ------------------------ */ @@ -1180,6 +1186,7 @@ int mspace_mallopt(int, int); #include #endif /* ABORT_ON_ASSERT_FAILURE */ #else /* DEBUG */ +#undef assert #define assert(x) #endif /* DEBUG */ #ifndef LACKS_STRING_H diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 160128e22e..cb130def3c 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -106,6 +106,7 @@ #ifdef HAVE_PYTHON #undef _POSIX_C_SOURCE #undef _XOPEN_SOURCE +#undef HAVE_LOCKF #include "pyconfig.h" #endif From 9ee6e59795f07c44be13aba1f96ba8750e15a8c5 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 00:45:02 -0700 Subject: [PATCH 084/744] Change %pure_parser to %pure-parser in cppBison.yxx (%pure_parser is very very deprecated) --- dtool/src/cppparser/cppBison.yxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 6d533f80d1..386c2e7230 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -194,7 +194,7 @@ pop_struct() { /* This is a bison-specific declaration to enable recursive calls to yyparse(). It changes the calling sequence to yylex(), passing pointers to the current yylval and yylloc. */ -%pure_parser +%pure-parser %token REAL %token INTEGER From b940bbc88e5a97ab454fa35b70500307fae8cf71 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 00:53:11 -0700 Subject: [PATCH 085/744] Add python_libaries for linker to p3interrogatedb target (when not HAVE_PYTHON, PYTHON_LIBRARIES will be empty). --- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 927fea94a0..58477d2ad7 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -30,4 +30,4 @@ set(P3INTERROGATEDB_SOURCES composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3dconfig) +target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) From e086647fa21127c0e12f904f50bc5b23f768caba Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:02:31 -0700 Subject: [PATCH 086/744] Add panda/src/pipeline/CMakeLists.txt --- panda/CMakeLists.txt | 6 + panda/src/pipeline/CMakeLists.txt | 232 ++++++++++++++++++++++++++++++ 2 files changed, 238 insertions(+) create mode 100644 panda/src/pipeline/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 13a678cbff..580923eca2 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -6,3 +6,9 @@ endif() add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) + +add_subdirectory(src/pipeline) +add_subdirectory(src/pgraph) +#add_subdirectory(src/display) +#add_subdirectory(src/framework) +#add_subdirectory(src/testbed) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt new file mode 100644 index 0000000000..2f008e5d41 --- /dev/null +++ b/panda/src/pipeline/CMakeLists.txt @@ -0,0 +1,232 @@ +set(P3PIPELINE_HEADERS + asyncTaskBase.h asyncTaskBase.I + contextSwitch.h + blockerSimple.h blockerSimple.I + conditionVar.h conditionVar.I + conditionVarDebug.h conditionVarDebug.I + conditionVarDirect.h conditionVarDirect.I + conditionVarDummyImpl.h conditionVarDummyImpl.I + conditionVarFull.h conditionVarFull.I + conditionVarFullDebug.h conditionVarFullDebug.I + conditionVarFullDirect.h conditionVarFullDirect.I + conditionVarImpl.h + conditionVarSimpleImpl.h conditionVarSimpleImpl.I + conditionVarSpinlockImpl.h conditionVarSpinlockImpl.I + conditionVarPosixImpl.h conditionVarPosixImpl.I + config_pipeline.h + cycleData.h cycleData.I + cycleDataLockedReader.h cycleDataLockedReader.I + cycleDataLockedStageReader.h cycleDataLockedStageReader.I + cycleDataReader.h cycleDataReader.I + cycleDataStageReader.h cycleDataStageReader.I + cycleDataStageWriter.h cycleDataStageWriter.I + cycleDataWriter.h cycleDataWriter.I + cyclerHolder.h cyclerHolder.I + externalThread.h + genericThread.h genericThread.I + lightMutex.I lightMutex.h + lightMutexDirect.h lightMutexDirect.I + lightMutexHolder.I lightMutexHolder.h + lightReMutex.I lightReMutex.h + lightReMutexDirect.h lightReMutexDirect.I + lightReMutexHolder.I lightReMutexHolder.h + mainThread.h + mutexDebug.h mutexDebug.I + mutexDirect.h mutexDirect.I + mutexHolder.h mutexHolder.I + mutexSimpleImpl.h mutexSimpleImpl.I + mutexTrueImpl.h + pipeline.h pipeline.I + pipelineCycler.h pipelineCycler.I + pipelineCyclerLinks.h pipelineCyclerLinks.I + pipelineCyclerBase.h + pipelineCyclerDummyImpl.h pipelineCyclerDummyImpl.I + pipelineCyclerTrivialImpl.h pipelineCyclerTrivialImpl.I + pipelineCyclerTrueImpl.h pipelineCyclerTrueImpl.I + pmutex.h pmutex.I + reMutex.I reMutex.h + reMutexDirect.h reMutexDirect.I + reMutexHolder.I reMutexHolder.h + psemaphore.h psemaphore.I + thread.h thread.I threadImpl.h + threadDummyImpl.h threadDummyImpl.I + threadSimpleImpl.h threadSimpleImpl.I + threadPosixImpl.h threadPosixImpl.I + threadSimpleManager.h threadSimpleManager.I + threadPriority.h +) + +set(P3PIPELINE_SOURCES + asyncTaskBase.cxx + contextSwitch.c + conditionVar.cxx + conditionVarDebug.cxx + conditionVarDirect.cxx + conditionVarDummyImpl.cxx + conditionVarFull.cxx + conditionVarFullDebug.cxx + conditionVarFullDirect.cxx + conditionVarSimpleImpl.cxx + conditionVarSpinlockImpl.cxx + conditionVarPosixImpl.cxx + config_pipeline.cxx + cycleData.cxx + cycleDataLockedReader.cxx + cycleDataLockedStageReader.cxx + cycleDataReader.cxx + cycleDataStageReader.cxx + cycleDataStageWriter.cxx + cycleDataWriter.cxx + cyclerHolder.cxx + externalThread.cxx + genericThread.cxx + lightMutex.cxx + lightMutexDirect.cxx + lightMutexHolder.cxx + lightReMutex.cxx + lightReMutexDirect.cxx + lightReMutexHolder.cxx + mainThread.cxx + mutexDebug.cxx + mutexDirect.cxx + mutexHolder.cxx + mutexSimpleImpl.cxx + pipeline.cxx + pipelineCycler.cxx + pipelineCyclerDummyImpl.cxx + pipelineCyclerTrivialImpl.cxx + pipelineCyclerTrueImpl.cxx + pmutex.cxx + reMutex.cxx + reMutexDirect.cxx + reMutexHolder.cxx + psemaphore.cxx + thread.cxx + threadDummyImpl.cxx + threadPosixImpl.cxx + threadSimpleImpl.cxx + threadSimpleManager.cxx + threadPriority.cxx +) + +if(WIN32) + set(P3PIPELINE_HEADERS + ${P3PIPELINE_HEADERS} + conditionVarFullWin32Impl.h conditionVarFullWin32Impl.I + conditionVarWin32Impl.h conditionVarWin32Impl.I + threadWin32Impl.h threadWin32Impl.I + ) + set(P3PIPELINE_SOURCES + ${P3PIPELINE_SOURCES} + conditionVarFullWin32Impl.cxx + conditionVarWin32Impl.cxx + threadWin32Impl.cxx + ) +endif() + +if(HAVE_PYTHON) + set(P3PIPELINE_HEADERS + ${P3PIPELINE_HEADERS} + pythonThread.h + ) + set(P3PIPELINE_SOURCES + ${P3PIPELINE_SOURCES} + pythonThread.cxx + ) +endif() + +composite_sources(p3pipeline P3PIPELINE_SOURCES) +add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) +target_link_libraries(p3pipeline p3express) +target_interrogate(p3pipeline ALL) + +#begin test_bin_target + #define TARGET test_threaddata + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ + # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ + # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + # test_threaddata.cxx + +#end test_bin_target + + +#begin test_bin_target + #define TARGET test_diners + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ + # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ + # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + # test_diners.cxx + +#end test_bin_target + + +#begin test_bin_target + #define TARGET test_mutex + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ + # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ + # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + # test_mutex.cxx + +#end test_bin_target + + +#begin test_bin_target + #define TARGET test_concurrency + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ +# p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ +# p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + # test_concurrency.cxx + +#end test_bin_target + + +#begin test_bin_target + #define TARGET test_delete + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ + # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ + # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + # test_delete.cxx + +#end test_bin_target + + +#begin test_bin_target + #define TARGET test_atomic + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ + # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ + # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + # test_atomic.cxx + +#end test_bin_target + + + +#begin test_bin_target + #define TARGET test_setjmp + #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline + #define OTHER_LIBS \ + #p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ + # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ + #test_setjmp.cxx + +#end test_bin_target From a411ad48139b97645711813c4139be08007571dd Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:09:19 -0700 Subject: [PATCH 087/744] Fix name for p3express zstream test --- panda/src/express/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index b89b598eff..d0c6970d02 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -136,7 +136,7 @@ target_interrogate(p3express ALL) #add_test(p3express_test_ordered_vector p3expressTestOrderedVector) if(HAVE_ZLIB) - #add_executable(p3expressTestBinTarget test_zstream.cxx) - #target_link_libraries(p3expressTestBinTarget p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) - #add_test(p3express_test_zstream p3expressTestBinTarget) + #add_executable(p3expressTestZstream test_zstream.cxx) + #target_link_libraries(p3expressTestZstream p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) + #add_test(p3express_test_zstream p3expressTestZstream) endif() From fe90bcfdea5da6d1f08efcd481bd10b43fca25bf Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:09:32 -0700 Subject: [PATCH 088/744] Fix indentation on pandabase --- panda/src/pandabase/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index c266e6b313..bcb2d1f85d 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -1,9 +1,9 @@ set(P3PANDABASE_HEADERS - pandabase.h pandasymbols.h + pandabase.h pandasymbols.h ) set(P3PANDABASE_SOURCES - pandabase.cxx + pandabase.cxx ) add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) From 4214b6a4f473b9f4f449e370e0a536b0025f0d9a Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:23:00 -0700 Subject: [PATCH 089/744] Add CMakeList.txt for panda/putil --- panda/CMakeLists.txt | 5 +- panda/src/putil/CMakeLists.txt | 176 +++++++++++++++++++++++++++++++++ 2 files changed, 179 insertions(+), 2 deletions(-) create mode 100644 panda/src/putil/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 580923eca2..3a5a8e7a8b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -6,9 +6,10 @@ endif() add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) - add_subdirectory(src/pipeline) -add_subdirectory(src/pgraph) + +add_subdirectory(src/putil) +#add_subdirectory(src/pgraph) #add_subdirectory(src/display) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt new file mode 100644 index 0000000000..c77cac1d7d --- /dev/null +++ b/panda/src/putil/CMakeLists.txt @@ -0,0 +1,176 @@ +set(P3PUTIL_HEADERS + animInterface.h animInterface.I + autoTextureScale.h + bam.h + bamCache.h bamCache.I + bamCacheIndex.h bamCacheIndex.I + bamCacheRecord.h bamCacheRecord.I + bamEnums.h + bamReader.I bamReader.h bamReaderParam.I + bamReaderParam.h + bamWriter.I bamWriter.h + bitArray.I bitArray.h + bitMask.I bitMask.h + buttonHandle.I + buttonHandle.h buttonRegistry.I buttonRegistry.h + cachedTypedWritableReferenceCount.h cachedTypedWritableReferenceCount.I + callbackData.h callbackData.I + callbackObject.h callbackObject.I + clockObject.h clockObject.I + collideMask.h + copyOnWriteObject.h copyOnWriteObject.I + copyOnWritePointer.h copyOnWritePointer.I + compareTo.I compareTo.h + config_util.N config_util.h configurable.h + cPointerCallbackObject.h cPointerCallbackObject.I + datagramInputFile.I datagramInputFile.h + datagramOutputFile.I datagramOutputFile.h + doubleBitMask.I doubleBitMask.h + drawMask.h + factory.I factory.h + factoryBase.I factoryBase.h + factoryParam.I factoryParam.h factoryParams.I + factoryParams.h + firstOfPairCompare.I firstOfPairCompare.h + firstOfPairLess.I firstOfPairLess.h + globalPointerRegistry.I globalPointerRegistry.h + indirectCompareNames.I indirectCompareNames.h + indirectCompareSort.I indirectCompareSort.h + indirectCompareTo.I indirectCompareTo.h + ioPtaDatagramFloat.h ioPtaDatagramInt.h + ioPtaDatagramShort.h keyboardButton.h lineStream.I + lineStream.h lineStreamBuf.I lineStreamBuf.h + linkedListNode.I linkedListNode.h + load_prc_file.h + loaderOptions.I loaderOptions.h + modifierButtons.I modifierButtons.h mouseButton.h + mouseData.I mouseData.h nameUniquifier.I nameUniquifier.h + nodeCachedReferenceCount.h nodeCachedReferenceCount.I + pbitops.I pbitops.h + portalMask.h + pta_ushort.h + pythonCallbackObject.h pythonCallbackObject.I + simpleHashMap.I simpleHashMap.h + sparseArray.I sparseArray.h + string_utils.I string_utils.h + timedCycle.I timedCycle.h typedWritable.I + typedWritable.h typedWritableReferenceCount.I + typedWritableReferenceCount.h updateSeq.I updateSeq.h + uniqueIdAllocator.h + vector_typedWritable.h + vector_ushort.h vector_writable.h + writableConfigurable.h + writableParam.I writableParam.h +) + +set(P3PUTIL_SOURCES + animInterface.cxx + autoTextureScale.cxx + bamCache.cxx + bamCacheIndex.cxx + bamCacheRecord.cxx + bamEnums.cxx + bamReader.cxx bamReaderParam.cxx + bamWriter.cxx + bitArray.cxx + bitMask.cxx + buttonHandle.cxx buttonRegistry.cxx + cachedTypedWritableReferenceCount.cxx + callbackData.cxx + callbackObject.cxx + clockObject.cxx + copyOnWriteObject.cxx + copyOnWritePointer.cxx + config_util.cxx configurable.cxx + cPointerCallbackObject.cxx + datagramInputFile.cxx datagramOutputFile.cxx + doubleBitMask.cxx + factoryBase.cxx + factoryParam.cxx factoryParams.cxx + globalPointerRegistry.cxx + ioPtaDatagramFloat.cxx + ioPtaDatagramInt.cxx ioPtaDatagramShort.cxx + keyboardButton.cxx lineStream.cxx lineStreamBuf.cxx + linkedListNode.cxx + load_prc_file.cxx + loaderOptions.cxx + modifierButtons.cxx mouseButton.cxx mouseData.cxx + nameUniquifier.cxx + nodeCachedReferenceCount.cxx + pbitops.cxx + pta_ushort.cxx + pythonCallbackObject.cxx + simpleHashMap.cxx + sparseArray.cxx + string_utils.cxx + timedCycle.cxx typedWritable.cxx + typedWritableReferenceCount.cxx updateSeq.cxx + uniqueIdAllocator.cxx + vector_typedWritable.cxx + vector_ushort.cxx vector_writable.cxx + writableConfigurable.cxx writableParam.cxx +) + + +composite_sources(p3putil P3PUTIL_SOURCES) +add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) +target_link_libraries(p3putil p3pipeline) +target_interrogate(p3putil ALL) + +#begin test_bin_target + #define TARGET test_bamRead + #define LOCAL_LIBS + #p3putil p3pgraph + + #define SOURCES + #test_bam.cxx test_bam.h test_bamRead.cxx + +#end test_bin_target + +#begin test_bin_target + #define TARGET test_bamWrite + #define LOCAL_LIBS + #p3putil p3pgraph + + #define SOURCES + #test_bam.cxx test_bam.h test_bamWrite.cxx + +#end test_bin_target + +#begin test_bin_target + #define TARGET test_filename + + #define SOURCES + #test_filename.cxx + +#end test_bin_target + +#begin test_bin_target + #define TARGET test_uniqueIdAllocator + + #define SOURCES + #uniqueIdAllocator.cxx test_uniqueIdAllocator.cxx + +#end test_bin_target + +#begin test_bin_target + #define TARGET test_glob + + #define SOURCES + #test_glob.cxx + + #define LOCAL_LIBS $[LOCAL_LIBS] p3putil + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + +#end test_bin_target + +#begin test_bin_target + #define TARGET test_linestream + + #define SOURCES + #test_linestream.cxx + + #define LOCAL_LIBS $[LOCAL_LIBS] p3putil + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + +#end test_bin_target From fea7c70e1c317f66c206549f376d970d1b4e0bec Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:30:13 -0700 Subject: [PATCH 090/744] Add CMakeLists for panda/pstatclient. --- panda/CMakeLists.txt | 3 +- panda/src/pstatclient/CMakeLists.txt | 41 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 panda/src/pstatclient/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 3a5a8e7a8b..d1b015665a 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -7,8 +7,9 @@ add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) add_subdirectory(src/pipeline) - add_subdirectory(src/putil) +add_subdirectory(src/pstatclient) + #add_subdirectory(src/pgraph) #add_subdirectory(src/display) #add_subdirectory(src/framework) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt new file mode 100644 index 0000000000..13f8e8ae3d --- /dev/null +++ b/panda/src/pstatclient/CMakeLists.txt @@ -0,0 +1,41 @@ +set(P3PSTATCLIENT_HEADERS + config_pstats.h pStatClient.I pStatClient.h + pStatClientImpl.I pStatClientImpl.h + pStatClientVersion.I + pStatClientVersion.h pStatClientControlMessage.h + pStatCollector.I pStatCollector.h pStatCollectorDef.h + pStatCollectorForward.I pStatCollectorForward.h + pStatFrameData.I pStatFrameData.h pStatProperties.h + pStatServerControlMessage.h pStatThread.I pStatThread.h + pStatTimer.I pStatTimer.h +) + +set(P3PSTATCLIENT_SOURCES + config_pstats.cxx pStatClient.cxx pStatClientImpl.cxx + pStatClientVersion.cxx + pStatClientControlMessage.cxx + pStatCollector.cxx + pStatCollectorDef.cxx + pStatCollectorForward.cxx + pStatFrameData.cxx pStatProperties.cxx + pStatServerControlMessage.cxx + pStatThread.cxx +) + +composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) +add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) +target_link_libraries(p3pstatclient p3putil) +target_interrogate(p3pstatclient ALL) + +#begin test_bin_target + #define LOCAL_LIBS \ + # p3pstatclient + #define OTHER_LIBS \ + # $[OTHER_LIBS] p3pystub + + #define TARGET test_client + + #define SOURCES \ + # test_client.cxx + +#end test_bin_target From 747c31f6d1d968aacffdfdceb53faab95ccdabfd Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:48:10 -0700 Subject: [PATCH 091/744] Add CMakeLists for panda/linmath --- panda/CMakeLists.txt | 2 + panda/src/linmath/CMakeLists.txt | 63 ++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 panda/src/linmath/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index d1b015665a..4068f78a54 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -9,7 +9,9 @@ add_subdirectory(src/downloader) add_subdirectory(src/pipeline) add_subdirectory(src/putil) add_subdirectory(src/pstatclient) +add_subdirectory(src/linmath) +#add_subdirectory(src/gobj) #add_subdirectory(src/pgraph) #add_subdirectory(src/display) #add_subdirectory(src/framework) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt new file mode 100644 index 0000000000..439cf1656d --- /dev/null +++ b/panda/src/linmath/CMakeLists.txt @@ -0,0 +1,63 @@ +set(P3LINMATH_HEADERS + aa_luse.h + compose_matrix.h compose_matrix_src.I + compose_matrix_src.h config_linmath.h + coordinateSystem.h dbl2fltnames.h dblnames.h + deg_2_rad.h deg_2_rad.I + flt2dblnames.h fltnames.h lcast_to.h lcast_to_src.h + lcast_to_src.I lmatrix.h lmatrix_ext.h lmatrix3_src.I + lmatrix3_src.h lmatrix4_src.I + lmatrix4_src.h lorientation.h + lorientation_src.I lorientation_src.h + lpoint2.h lpoint2_src.I lpoint2_src.h + lpoint3.h lpoint3_src.I lpoint3_src.h + lpoint4.h lpoint4_src.I lpoint4_src.h + lquaternion.h lquaternion_src.I lquaternion_src.cxx + lquaternion_src.h lrotation.h lrotation_src.I + lrotation_src.h + lsimpleMatrix.h lsimpleMatrix.I + luse.I luse.N luse.h + lvec2_ops.h lvec2_ops_src.I lvec2_ops_src.h lvec3_ops.h + lvec3_ops_src.I lvec3_ops_src.h lvec4_ops.h lvec4_ops_src.I + lvec4_ops_src.h + lvecBase2.h lvecBase2_src.I lvecBase2_src.h + lvecBase3.h lvecBase3_src.I lvecBase3_src.h + lvecBase4.h lvecBase4_src.I lvecBase4_src.h + lvector2.h lvector2_src.I lvector2_src.h + lvector3.h lvector3_src.I lvector3_src.h + lvector4.h lvector4_src.I lvector4_src.h + lvector4.h lvector4_src.I lvector4_src.h + lvecBase2_ext.h lvecBase3_ext.h lvecBase4_ext.h + lpoint2_ext.h lpoint3_ext.h lpoint4_ext.h + lvector2_ext.h lvector3_ext.h lvector4_ext.h + mathNumbers.h mathNumbers.I +) + +set(P3LINMATH_SOURCES + compose_matrix.cxx config_linmath.cxx coordinateSystem.cxx + lmatrix.cxx + lorientation.cxx lpoint2.cxx + lpoint3.cxx lpoint4.cxx lquaternion.cxx lrotation.cxx + luse.cxx lvecBase2.cxx lvecBase3.cxx lvecBase4.cxx + lvector2.cxx lvector3.cxx lvector4.cxx mathNumbers.cxx +) + +if(EIGEN_FOUND) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + +composite_sources(p3linmath P3LINMATH_SOURCES) +add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) +target_link_libraries(p3linmath p3putil) +target_interrogate(p3linmath ALL) + +#begin test_bin_target + #define TARGET test_math + #define LOCAL_LIBS \ +# p3linmath + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + + #define SOURCES \ +# test_math.cxx + +#end test_bin_target From 5f23b506d9f8f787a1c5dcda8db09feebea346fb Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:58:13 -0700 Subject: [PATCH 092/744] Add CMakeLists for panda/pevent. --- panda/CMakeLists.txt | 1 + panda/src/event/CMakeLists.txt | 54 ++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 panda/src/event/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 4068f78a54..b7ca562f97 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -10,6 +10,7 @@ add_subdirectory(src/pipeline) add_subdirectory(src/putil) add_subdirectory(src/pstatclient) add_subdirectory(src/linmath) +add_subdirectory(src/event) #add_subdirectory(src/gobj) #add_subdirectory(src/pgraph) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt new file mode 100644 index 0000000000..3a3b293356 --- /dev/null +++ b/panda/src/event/CMakeLists.txt @@ -0,0 +1,54 @@ +set(P3EVENT_HEADERS + asyncTask.h asyncTask.I + asyncTaskChain.h asyncTaskChain.I + asyncTaskCollection.h asyncTaskCollection.I + asyncTaskManager.h asyncTaskManager.I + asyncTaskPause.h asyncTaskPause.I + asyncTaskSequence.h asyncTaskSequence.I + config_event.h + buttonEvent.I buttonEvent.h + buttonEventList.I buttonEventList.h + genericAsyncTask.h genericAsyncTask.I + pointerEvent.I pointerEvent.h + pointerEventList.I pointerEventList.h + pythonTask.h pythonTask.I + event.I event.h eventHandler.h eventHandler.I + eventParameter.I eventParameter.h + eventQueue.I eventQueue.h eventReceiver.h + pt_Event.h throw_event.I throw_event.h +) + +set(P3EVENT_SOURCES + asyncTask.cxx + asyncTaskChain.cxx + asyncTaskCollection.cxx + asyncTaskManager.cxx + asyncTaskPause.cxx + asyncTaskSequence.cxx + buttonEvent.cxx + buttonEventList.cxx + genericAsyncTask.cxx + pointerEvent.cxx + pointerEventList.cxx + pythonTask.cxx + config_event.cxx event.cxx eventHandler.cxx + eventParameter.cxx eventQueue.cxx eventReceiver.cxx + pt_Event.cxx +) + +composite_sources(p3event P3EVENT_SOURCES) +add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) +target_link_libraries(p3event p3linmath p3pstatclient) +target_interrogate(p3event ALL) + +#begin test_bin_target + #define TARGET test_task + #define LOCAL_LIBS $[LOCAL_LIBS] p3mathutil + #define OTHER_LIBS \ +# p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ +# p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub + + #define SOURCES \ +# test_task.cxx + +#end test_bin_target \ No newline at end of file From 8e681876c08ee9fa6e2c1b44bbc165464639650b Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 02:58:53 -0700 Subject: [PATCH 093/744] Have linmath's CMakeLists check for HAVE_EIGEN instead of FOUND_EIGEN. --- panda/src/linmath/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 439cf1656d..751c45039b 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -42,7 +42,7 @@ set(P3LINMATH_SOURCES lvector2.cxx lvector3.cxx lvector4.cxx mathNumbers.cxx ) -if(EIGEN_FOUND) +if(HAVE_EIGEN) include_directories(${EIGEN3_INCLUDE_DIR}) endif() From 5f136ca281d9858c8d4a309093f8beae69fe5d23 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 03:56:39 -0700 Subject: [PATCH 094/744] Add the basics of CMakeLists for panda/mathutil. Doesn't compile yet, has some errors. --- panda/CMakeLists.txt | 1 + panda/src/mathutil/CMakeLists.txt | 96 +++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 panda/src/mathutil/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b7ca562f97..44fa45bc4a 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -12,6 +12,7 @@ add_subdirectory(src/pstatclient) add_subdirectory(src/linmath) add_subdirectory(src/event) +add_subdirectory(src/mathutil) #add_subdirectory(src/gobj) #add_subdirectory(src/pgraph) #add_subdirectory(src/display) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt new file mode 100644 index 0000000000..b341bc84a2 --- /dev/null +++ b/panda/src/mathutil/CMakeLists.txt @@ -0,0 +1,96 @@ +set(P3GOBJ_HEADERS + boundingHexahedron.I boundingHexahedron.h boundingLine.I + boundingLine.h + boundingBox.I boundingBox.h + boundingPlane.I boundingPlane.h + boundingSphere.I boundingSphere.h + boundingVolume.I boundingVolume.h config_mathutil.h + fftCompressor.h finiteBoundingVolume.h frustum.h + frustum_src.I frustum_src.h geometricBoundingVolume.I + geometricBoundingVolume.h + intersectionBoundingVolume.h intersectionBoundingVolume.I + linmath_events.h + look_at.h look_at_src.I + look_at_src.h + linmath_events.h + mersenne.h + omniBoundingVolume.I + omniBoundingVolume.h + parabola.h parabola_src.I parabola_src.h + perlinNoise.h perlinNoise.I + perlinNoise2.h perlinNoise2.I + perlinNoise3.h perlinNoise3.I + plane.h plane_src.I plane_src.h + pta_LMatrix4.h pta_LMatrix3.h pta_LVecBase3.h + pta_LVecBase4.h pta_LVecBase2.h + randomizer.h randomizer.I + rotate_to.h + stackedPerlinNoise2.h stackedPerlinNoise2.I + stackedPerlinNoise3.h stackedPerlinNoise3.I + triangulator.h triangulator.I + triangulator3.h triangulator3.I + unionBoundingVolume.h unionBoundingVolume.I +) + +set(P3GOBJ_SOURCES + boundingHexahedron.cxx boundingLine.cxx + boundingBox.cxx + boundingPlane.cxx + boundingSphere.cxx + boundingVolume.cxx config_mathutil.cxx fftCompressor.cxx + finiteBoundingVolume.cxx geometricBoundingVolume.cxx + intersectionBoundingVolume.cxx + look_at.cxx + linmath_events.cxx + mersenne.cxx + omniBoundingVolume.cxx + parabola.cxx + perlinNoise.cxx + perlinNoise2.cxx + perlinNoise3.cxx + plane.cxx + pta_LMatrix4.cxx pta_LMatrix3.cxx pta_LVecBase3.cxx + pta_LVecBase4.cxx pta_LVecBase2.cxx + randomizer.cxx + rotate_to.cxx + stackedPerlinNoise2.cxx + stackedPerlinNoise3.cxx + triangulator.cxx + triangulator3.cxx + unionBoundingVolume.cxx +) + +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() +if(NOT HAVE_FFTW) + configure_file(../../../dtool/src/parser-inc/rfftw.h rfftw.h COPYONLY) +endif() + +composite_sources(p3gobj P3GOBJ_SOURCES) +add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) +target_link_libraries(p3gobj p3event ${FFTW_LIBRARY_DIR}) +target_interrogate(p3gobj ALL) + +#begin test_bin_target + #define TARGET test_mathutil + #define LOCAL_LIBS \ +# p3mathutil p3pipeline + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + + #define SOURCES \ +# test_mathutil.cxx + +#end test_bin_target + + +#begin test_bin_target + #define TARGET test_tri + #define LOCAL_LIBS \ +# p3mathutil p3pipeline + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + + #define SOURCES \ +# test_tri.cxx + +#end test_bin_target From f4bf740362fb96c8b33e48e008084c91ef20f86e Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 17:33:19 -0700 Subject: [PATCH 095/744] Fix HAVE_LOCKF in dtoolbase.h for python headers that don't define it. --- dtool/src/dtoolbase/dtoolbase.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index cb130def3c..e9d6a09da9 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -104,10 +104,21 @@ #endif #ifdef HAVE_PYTHON -#undef _POSIX_C_SOURCE -#undef _XOPEN_SOURCE -#undef HAVE_LOCKF -#include "pyconfig.h" +# undef _POSIX_C_SOURCE +# undef _XOPEN_SOURCE +// Some versions of python also define HAVE_LOCKF +# ifdef HAVE_LOCKF +# define PANDA_HAVE_LOCKF +# undef HAVE_LOCKF +# endif +# include "pyconfig.h" +// Restore our HAVE_LOCKF if python didn't define it +# ifdef PANDA_HAVE_LOCKF +# undef PANDA_HAVE_LOCKF +# ifndef HAVE_LOCKF +# define HAVE_LOCKF 1 +# endif +# endif #endif #ifndef HAVE_EIGEN From f1919df2619c0436c35375c0c968f1fe1307dd1c Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 17:34:59 -0700 Subject: [PATCH 096/744] Fix names in CMakeLists for p3mathutil. --- panda/src/mathutil/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index b341bc84a2..db78e3ea79 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -1,4 +1,4 @@ -set(P3GOBJ_HEADERS +set(P3MATHUTIL_HEADERS boundingHexahedron.I boundingHexahedron.h boundingLine.I boundingLine.h boundingBox.I boundingBox.h @@ -32,7 +32,7 @@ set(P3GOBJ_HEADERS unionBoundingVolume.h unionBoundingVolume.I ) -set(P3GOBJ_SOURCES +set(P3MATHUTIL_SOURCES boundingHexahedron.cxx boundingLine.cxx boundingBox.cxx boundingPlane.cxx @@ -63,14 +63,14 @@ set(P3GOBJ_SOURCES if(HAVE_EIGEN) include_directories(${EIGEN3_INCLUDE_DIR}) endif() -if(NOT HAVE_FFTW) +if(NOT PHAVE_DRFFTW_H) configure_file(../../../dtool/src/parser-inc/rfftw.h rfftw.h COPYONLY) endif() -composite_sources(p3gobj P3GOBJ_SOURCES) -add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -target_link_libraries(p3gobj p3event ${FFTW_LIBRARY_DIR}) -target_interrogate(p3gobj ALL) +composite_sources(p3mathutil P3MATHUTIL_SOURCES) +add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) +target_link_libraries(p3mathutil p3event ${FFTW_LIBRARY_DIR}) +target_interrogate(p3mathutil ALL) #begin test_bin_target #define TARGET test_mathutil From 1cf0b5d78c2a4601fdcf02471c34c0d35a265fe1 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 11:21:52 -0700 Subject: [PATCH 097/744] Add missing headers to panda/pipeline (when doing non-composite builds). --- panda/src/pipeline/lightMutexDirect.h | 1 + panda/src/pipeline/psemaphore.h | 1 + panda/src/pipeline/threadPriority.cxx | 2 ++ 3 files changed, 4 insertions(+) diff --git a/panda/src/pipeline/lightMutexDirect.h b/panda/src/pipeline/lightMutexDirect.h index 19b6d46a9e..b145661604 100644 --- a/panda/src/pipeline/lightMutexDirect.h +++ b/panda/src/pipeline/lightMutexDirect.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "mutexImpl.h" +#include "pnotify.h" class Thread; diff --git a/panda/src/pipeline/psemaphore.h b/panda/src/pipeline/psemaphore.h index 8fe89a0d82..5c8e58cc18 100644 --- a/panda/src/pipeline/psemaphore.h +++ b/panda/src/pipeline/psemaphore.h @@ -18,6 +18,7 @@ #include "pandabase.h" #include "pmutex.h" #include "conditionVar.h" +#include "mutexHolder.h" //////////////////////////////////////////////////////////////////// // Class : Semaphore diff --git a/panda/src/pipeline/threadPriority.cxx b/panda/src/pipeline/threadPriority.cxx index b4b565f673..b1746c442a 100644 --- a/panda/src/pipeline/threadPriority.cxx +++ b/panda/src/pipeline/threadPriority.cxx @@ -13,6 +13,8 @@ //////////////////////////////////////////////////////////////////// #include "threadPriority.h" +#include "pnotify.h" // nassertr +#include "pipeline.h" ostream & operator << (ostream &out, ThreadPriority pri) { From 07b7f5de5d583ef826bdbb4220d94d1d669ab68d Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 11:37:25 -0700 Subject: [PATCH 098/744] Add missing headers to panda/putil (when doing non-composite builds). --- panda/src/putil/bamCache.cxx | 2 ++ panda/src/putil/bamCacheIndex.cxx | 3 +++ panda/src/putil/bamCacheRecord.cxx | 3 +++ panda/src/putil/bitArray.cxx | 2 ++ panda/src/putil/datagramOutputFile.h | 2 ++ panda/src/putil/pythonCallbackObject.cxx | 1 + panda/src/putil/sparseArray.cxx | 2 ++ panda/src/putil/typedWritableReferenceCount.cxx | 1 + 8 files changed, 16 insertions(+) diff --git a/panda/src/putil/bamCache.cxx b/panda/src/putil/bamCache.cxx index d6223389e6..daf64f40c0 100644 --- a/panda/src/putil/bamCache.cxx +++ b/panda/src/putil/bamCache.cxx @@ -14,6 +14,8 @@ #include "bamCache.h" #include "bamCacheIndex.h" +#include "bamReader.h" +#include "bamWriter.h" #include "hashVal.h" #include "datagramInputFile.h" #include "datagramOutputFile.h" diff --git a/panda/src/putil/bamCacheIndex.cxx b/panda/src/putil/bamCacheIndex.cxx index ae993fc88a..6ff14ab583 100644 --- a/panda/src/putil/bamCacheIndex.cxx +++ b/panda/src/putil/bamCacheIndex.cxx @@ -13,6 +13,9 @@ //////////////////////////////////////////////////////////////////// #include "bamCacheIndex.h" +#include "bamReader.h" +#include "bamWriter.h" +#include "config_util.h" // util_cat #include "indent.h" #include diff --git a/panda/src/putil/bamCacheRecord.cxx b/panda/src/putil/bamCacheRecord.cxx index 96f5c7f092..79a12ea2da 100644 --- a/panda/src/putil/bamCacheRecord.cxx +++ b/panda/src/putil/bamCacheRecord.cxx @@ -13,9 +13,12 @@ //////////////////////////////////////////////////////////////////// #include "bamCacheRecord.h" +#include "bamReader.h" +#include "bamWriter.h" #include "virtualFileSystem.h" #include "virtualFile.h" #include "indent.h" +#include "config_util.h" // util_cat TypeHandle BamCacheRecord::_type_handle; diff --git a/panda/src/putil/bitArray.cxx b/panda/src/putil/bitArray.cxx index 323cfc1e1d..9ce4474d7b 100755 --- a/panda/src/putil/bitArray.cxx +++ b/panda/src/putil/bitArray.cxx @@ -14,6 +14,8 @@ #include "bitArray.h" #include "sparseArray.h" +#include "datagram.h" +#include "datagramIterator.h" TypeHandle BitArray::_type_handle; diff --git a/panda/src/putil/datagramOutputFile.h b/panda/src/putil/datagramOutputFile.h index 7c40d2b37a..a3a292bdba 100644 --- a/panda/src/putil/datagramOutputFile.h +++ b/panda/src/putil/datagramOutputFile.h @@ -21,6 +21,8 @@ #include "filename.h" #include "fileReference.h" #include "virtualFile.h" +#include "virtualFileSystem.h" +#include "config_util.h" //////////////////////////////////////////////////////////////////// // Class : DatagramOutputFile diff --git a/panda/src/putil/pythonCallbackObject.cxx b/panda/src/putil/pythonCallbackObject.cxx index 2b0b26baf0..1160877901 100644 --- a/panda/src/putil/pythonCallbackObject.cxx +++ b/panda/src/putil/pythonCallbackObject.cxx @@ -18,6 +18,7 @@ #include "py_panda.h" #include "thread.h" #include "callbackData.h" +#include "config_util.h" TypeHandle PythonCallbackObject::_type_handle; diff --git a/panda/src/putil/sparseArray.cxx b/panda/src/putil/sparseArray.cxx index 546416c97a..418a28edfc 100644 --- a/panda/src/putil/sparseArray.cxx +++ b/panda/src/putil/sparseArray.cxx @@ -14,6 +14,8 @@ #include "sparseArray.h" #include "bitArray.h" +#include "datagram.h" +#include "datagramIterator.h" TypeHandle SparseArray::_type_handle; diff --git a/panda/src/putil/typedWritableReferenceCount.cxx b/panda/src/putil/typedWritableReferenceCount.cxx index 0de2d392fd..9e5bcb2910 100644 --- a/panda/src/putil/typedWritableReferenceCount.cxx +++ b/panda/src/putil/typedWritableReferenceCount.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "typedWritableReferenceCount.h" +#include "dcast.h" TypeHandle TypedWritableReferenceCount::_type_handle; From 595b69fc719cea9a8f77b88ba56e451440b76918 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 11:49:03 -0700 Subject: [PATCH 099/744] Add missing headers to panda/linmath (when doing non-composite builds). --- panda/src/linmath/CMakeLists.txt | 2 +- panda/src/linmath/lvecBase2.h | 1 + panda/src/linmath/lvecBase4.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 751c45039b..c52ceb6039 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -12,7 +12,7 @@ set(P3LINMATH_HEADERS lpoint2.h lpoint2_src.I lpoint2_src.h lpoint3.h lpoint3_src.I lpoint3_src.h lpoint4.h lpoint4_src.I lpoint4_src.h - lquaternion.h lquaternion_src.I lquaternion_src.cxx + lquaternion.h lquaternion_src.I lquaternion_src.h lrotation.h lrotation_src.I lrotation_src.h lsimpleMatrix.h lsimpleMatrix.I diff --git a/panda/src/linmath/lvecBase2.h b/panda/src/linmath/lvecBase2.h index 5477236d8c..42e87b40a8 100644 --- a/panda/src/linmath/lvecBase2.h +++ b/panda/src/linmath/lvecBase2.h @@ -23,6 +23,7 @@ #include "checksumHashGenerator.h" #include "mathNumbers.h" #include "deg_2_rad.h" +#include "lsimpleMatrix.h" #include "cmath.h" #include "nearly_zero.h" diff --git a/panda/src/linmath/lvecBase4.h b/panda/src/linmath/lvecBase4.h index d75379e8f7..cad78f0a93 100644 --- a/panda/src/linmath/lvecBase4.h +++ b/panda/src/linmath/lvecBase4.h @@ -21,6 +21,7 @@ #include "datagram.h" #include "datagramIterator.h" #include "checksumHashGenerator.h" +#include "lsimpleMatrix.h" #include "cmath.h" #include "nearly_zero.h" From d44ab29ed7e354b95e25fad94856bea0ade72842 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 11:51:58 -0700 Subject: [PATCH 100/744] Add missing headers to panda/event (when doing non-composite builds). --- panda/src/event/asyncTask.cxx | 1 + panda/src/event/asyncTaskChain.cxx | 1 + panda/src/event/asyncTaskSequence.cxx | 1 + panda/src/event/pythonTask.cxx | 1 + 4 files changed, 4 insertions(+) diff --git a/panda/src/event/asyncTask.cxx b/panda/src/event/asyncTask.cxx index 9a70627866..b6b197d4dc 100644 --- a/panda/src/event/asyncTask.cxx +++ b/panda/src/event/asyncTask.cxx @@ -18,6 +18,7 @@ #include "pt_Event.h" #include "throw_event.h" #include "eventParameter.h" +#include "event.h" AtomicAdjust::Integer AsyncTask::_next_task_id; PStatCollector AsyncTask::_show_code_pcollector("App:Show code"); diff --git a/panda/src/event/asyncTaskChain.cxx b/panda/src/event/asyncTaskChain.cxx index 11ad2b1686..ac160a978b 100644 --- a/panda/src/event/asyncTaskChain.cxx +++ b/panda/src/event/asyncTaskChain.cxx @@ -20,6 +20,7 @@ #include "pStatClient.h" #include "pStatTimer.h" #include "clockObject.h" +#include "config_event.h" #include #include // For sprintf/snprintf diff --git a/panda/src/event/asyncTaskSequence.cxx b/panda/src/event/asyncTaskSequence.cxx index 38f121e4f4..819a4f8ee5 100644 --- a/panda/src/event/asyncTaskSequence.cxx +++ b/panda/src/event/asyncTaskSequence.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "asyncTaskSequence.h" +#include "asyncTaskManager.h" TypeHandle AsyncTaskSequence::_type_handle; diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index 66d3d6bfa6..d841cf4b35 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -14,6 +14,7 @@ #include "pythonTask.h" #include "pnotify.h" +#include "config_event.h" #ifdef HAVE_PYTHON #include "py_panda.h" From dd495b557302886f54bc33b5908afae1dc4ad079 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 12:07:20 -0700 Subject: [PATCH 101/744] Rename FindFFTW to FindFFTW3 and comment out configuration for it. FindFFTW3 was implemented, but Panda expects FFTW2. --- .../{FindFFTW.cmake => FindFFTW3.cmake} | 66 +++++++++---------- dtool/Config.cmake | 8 +-- panda/src/mathutil/CMakeLists.txt | 6 +- panda/src/mathutil/fftCompressor.cxx | 2 +- 4 files changed, 41 insertions(+), 41 deletions(-) rename cmake/modules/{FindFFTW.cmake => FindFFTW3.cmake} (50%) diff --git a/cmake/modules/FindFFTW.cmake b/cmake/modules/FindFFTW3.cmake similarity index 50% rename from cmake/modules/FindFFTW.cmake rename to cmake/modules/FindFFTW3.cmake index c4b86ce812..619c580828 100644 --- a/cmake/modules/FindFFTW.cmake +++ b/cmake/modules/FindFFTW3.cmake @@ -5,59 +5,59 @@ # find_package(FFTW [REQUIRED] [QUIET]) # # Once done this will define: -# FFTW_FOUND - true if fftw is found on the system -# FFTW_INCLUDE_DIR - the fftw include directory -# FFTW_LIBRARY_DIR - the fftw library directory -# FFTW_LIBRARY - the path to the library binary +# FFTW3_FOUND - true if fftw is found on the system +# FFTW3_INCLUDE_DIR - the fftw include directory +# FFTW3_LIBRARY_DIR - the fftw library directory +# FFTW3_LIBRARY - the path to the library binary # # The following variables will be checked by the function -# FFTW_ROOT - if set, the libraries are exclusively searched under this path +# FFTW3_ROOT - if set, the libraries are exclusively searched under this path # -if(NOT FFTW_INCLUDE_DIR OR NOT FFTW_LIBRARY_DIR) +if(NOT FFTW3_INCLUDE_DIR OR NOT FFTW3_LIBRARY_DIR) # Check if we can use PkgConfig find_package(PkgConfig QUIET) #Determine from PKG - if(PKG_CONFIG_FOUND AND NOT FFTW_ROOT) + if(PKG_CONFIG_FOUND AND NOT FFTW3_ROOT) pkg_check_modules(PKG_FFTW QUIET "fftw3") endif() - if(FFTW_ROOT) + if(FFTW3_ROOT) # Try to find headers under root - find_path(FFTW_INCLUDE_DIR + find_path(FFTW3_INCLUDE_DIR NAMES "fftw3.h" - PATHS ${FFTW_ROOT} + PATHS ${FFTW3_ROOT} PATH_SUFFIXES "include" NO_DEFAULT_PATH ) # Try to find library under root - find_library(FFTW_LIBRARY + find_library(FFTW3_LIBRARY NAMES "fftw3" - PATHS ${FFTW_ROOT} + PATHS ${FFTW3_ROOT} PATH_SUFFIXES "lib" "lib64" NO_DEFAULT_PATH ) - find_library(FFTW_FFTWF_LIBRARY + find_library(FFTW3_FFTWF_LIBRARY NAMES "fftw3f" - PATHS ${FFTW_ROOT} + PATHS ${FFTW3_ROOT} PATH_SUFFIXES "lib" "lib64" NO_DEFAULT_PATH ) - find_library(FFTW_FFTWL_LIBRARY + find_library(FFTW3_FFTWL_LIBRARY NAMES "fftw3l" - PATHS ${FFTW_ROOT} + PATHS ${FFTW3_ROOT} PATH_SUFFIXES "lib" "lib64" NO_DEFAULT_PATH ) else() # Find headers the normal way - find_path(FFTW_INCLUDE_DIR + find_path(FFTW3_INCLUDE_DIR NAMES "fftw3.h" - PATHS ${PKG_FFTW_INCLUDE_DIRS} + PATHS ${PKG_FFTW3_INCLUDE_DIRS} ${INCLUDE_INSTALL_DIR} "/usr/include" "/usr/local/include" @@ -65,18 +65,18 @@ if(NOT FFTW_INCLUDE_DIR OR NOT FFTW_LIBRARY_DIR) ) # Find library the normal way - find_library(FFTW_LIBRARY + find_library(FFTW3_LIBRARY NAMES "fftw3" - PATHS ${PKG_FFTW_LIBRARY_DIRS} + PATHS ${PKG_FFTW3_LIBRARY_DIRS} ${LIB_INSTALL_DIR} "/usr" "/usr/local" PATH_SUFFIXES "" "lib" "lib32" "lib64" ) - find_library(FFTW_FFTWF_LIBRARY + find_library(FFTW3_FFTWF_LIBRARY NAMES "fftw3f" - PATHS ${PKG_FFTW_LIBRARY_DIRS} + PATHS ${PKG_FFTW3_LIBRARY_DIRS} ${LIB_INSTALL_DIR} "/usr" "/usr/local" @@ -84,9 +84,9 @@ if(NOT FFTW_INCLUDE_DIR OR NOT FFTW_LIBRARY_DIR) ) - find_library(FFTW_FFTWL_LIBRARY + find_library(FFTW3_FFTWL_LIBRARY NAMES "fftw3l" - PATHS ${PKG_FFTW_LIBRARY_DIRS} + PATHS ${PKG_FFTW3_LIBRARY_DIRS} ${LIB_INSTALL_DIR} "/usr" "/usr/local" @@ -94,16 +94,16 @@ if(NOT FFTW_INCLUDE_DIR OR NOT FFTW_LIBRARY_DIR) ) endif() - # Get the directory conaining FFTW_LIBRARY - get_filename_component(FFTW_LIBRARY_DIR "${FFTW_LIBRARY}" PATH) - set(FFTW_LIBRARY_DIR "${FFTW_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path + # Get the directory conaining FFTW3_LIBRARY + get_filename_component(FFTW3_LIBRARY_DIR "${FFTW3_LIBRARY}" PATH) + set(FFTW3_LIBRARY_DIR "${FFTW3_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path - mark_as_advanced(FFTW_INCLUDE_DIR) - mark_as_advanced(FFTW_LIBRARY_DIR) - mark_as_advanced(FFTW_LIBRARY) - mark_as_advanced(FFTW_FFTWF_LIBRARY) - mark_as_advanced(FFTW_FFTWL_LIBRARY) + mark_as_advanced(FFTW3_INCLUDE_DIR) + mark_as_advanced(FFTW3_LIBRARY_DIR) + mark_as_advanced(FFTW3_LIBRARY) + mark_as_advanced(FFTW3_FFTWF_LIBRARY) + mark_as_advanced(FFTW3_FFTWL_LIBRARY) endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW_LIBRARY FFTW_INCLUDE_DIR FFTW_LIBRARY_DIR) \ No newline at end of file +find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR) \ No newline at end of file diff --git a/dtool/Config.cmake b/dtool/Config.cmake index c916299ae7..a2ae2c0f55 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -478,11 +478,11 @@ package_option(TAR "This is used to optimize patch generation against tar files.") # Is libfftw installed, and where? -find_package(FFTW) +#find_package(FFTW2) -package_option(FFTW - "This enables support for lossless compression of animations in -.bam files. This is rarely used, and you probably don't need it.") +#package_option(FFTW +# "This enables support for lossless compression of animations in +#.bam files. This is rarely used, and you probably don't need it.") #TODO PHAVE_DRFFTW_H diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index db78e3ea79..67e787836d 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -63,13 +63,13 @@ set(P3MATHUTIL_SOURCES if(HAVE_EIGEN) include_directories(${EIGEN3_INCLUDE_DIR}) endif() -if(NOT PHAVE_DRFFTW_H) - configure_file(../../../dtool/src/parser-inc/rfftw.h rfftw.h COPYONLY) +if(HAVE_FFTW) + include_directories(${FFTW2_INCLUDE_DIR}) endif() composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -target_link_libraries(p3mathutil p3event ${FFTW_LIBRARY_DIR}) +target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}}) target_interrogate(p3mathutil ALL) #begin test_bin_target diff --git a/panda/src/mathutil/fftCompressor.cxx b/panda/src/mathutil/fftCompressor.cxx index 84bb08a510..3b47952860 100644 --- a/panda/src/mathutil/fftCompressor.cxx +++ b/panda/src/mathutil/fftCompressor.cxx @@ -25,7 +25,7 @@ #ifdef HAVE_FFTW // hack..... -// this is a hack to help interigate sort out a macro +// this is a hack to help interrogate sort out a macro // in the system poll and select definitions // #ifdef howmany From c5a7e820095abfc294e9c9746f117053dd0b31c9 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 12:07:37 -0700 Subject: [PATCH 102/744] Remove unnecessary include in panda/event/asyncTask.cxx --- panda/src/event/asyncTask.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/event/asyncTask.cxx b/panda/src/event/asyncTask.cxx index b6b197d4dc..9a70627866 100644 --- a/panda/src/event/asyncTask.cxx +++ b/panda/src/event/asyncTask.cxx @@ -18,7 +18,6 @@ #include "pt_Event.h" #include "throw_event.h" #include "eventParameter.h" -#include "event.h" AtomicAdjust::Integer AsyncTask::_next_task_id; PStatCollector AsyncTask::_show_code_pcollector("App:Show code"); From 3d65bd49a715779346f5dcea9e35753473b84766 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 12:13:14 -0700 Subject: [PATCH 103/744] Fix mathutil compilation with CMake. --- panda/src/mathutil/boundingLine.cxx | 1 + panda/src/mathutil/boundingPlane.cxx | 2 ++ panda/src/mathutil/boundingVolume.cxx | 6 ++++++ panda/src/mathutil/finiteBoundingVolume.cxx | 1 + panda/src/mathutil/randomizer.h | 1 + panda/src/mathutil/triangulator3.cxx | 1 + 6 files changed, 12 insertions(+) diff --git a/panda/src/mathutil/boundingLine.cxx b/panda/src/mathutil/boundingLine.cxx index afc66b857e..9878668322 100644 --- a/panda/src/mathutil/boundingLine.cxx +++ b/panda/src/mathutil/boundingLine.cxx @@ -14,6 +14,7 @@ #include "boundingLine.h" #include "boundingSphere.h" +#include "boundingBox.h" #include "config_mathutil.h" #include diff --git a/panda/src/mathutil/boundingPlane.cxx b/panda/src/mathutil/boundingPlane.cxx index 01a8bc5076..d5a3316d7c 100644 --- a/panda/src/mathutil/boundingPlane.cxx +++ b/panda/src/mathutil/boundingPlane.cxx @@ -14,6 +14,8 @@ #include "boundingPlane.h" #include "boundingSphere.h" +#include "boundingBox.h" +#include "boundingHexahedron.h" #include "config_mathutil.h" TypeHandle BoundingPlane::_type_handle; diff --git a/panda/src/mathutil/boundingVolume.cxx b/panda/src/mathutil/boundingVolume.cxx index 39d086dbe6..a6a70d50d6 100644 --- a/panda/src/mathutil/boundingVolume.cxx +++ b/panda/src/mathutil/boundingVolume.cxx @@ -16,6 +16,12 @@ #include "finiteBoundingVolume.h" #include "unionBoundingVolume.h" #include "intersectionBoundingVolume.h" +#include "boundingBox.h" +#include "boundingLine.h" +#include "boundingPlane.h" +#include "boundingSphere.h" +#include "boundingHexahedron.h" +#include "config_mathutil.h" #include "indent.h" diff --git a/panda/src/mathutil/finiteBoundingVolume.cxx b/panda/src/mathutil/finiteBoundingVolume.cxx index 08adf02ddd..b0ff3f47dc 100644 --- a/panda/src/mathutil/finiteBoundingVolume.cxx +++ b/panda/src/mathutil/finiteBoundingVolume.cxx @@ -14,6 +14,7 @@ #include "finiteBoundingVolume.h" #include "boundingBox.h" +#include "config_mathutil.h" TypeHandle FiniteBoundingVolume::_type_handle; diff --git a/panda/src/mathutil/randomizer.h b/panda/src/mathutil/randomizer.h index 1010c37073..1e7f1f5bc6 100644 --- a/panda/src/mathutil/randomizer.h +++ b/panda/src/mathutil/randomizer.h @@ -19,6 +19,7 @@ #include "mersenne.h" #include +#include //////////////////////////////////////////////////////////////////// // Class : Randomizer diff --git a/panda/src/mathutil/triangulator3.cxx b/panda/src/mathutil/triangulator3.cxx index 92215a0bfc..0ac0367d52 100755 --- a/panda/src/mathutil/triangulator3.cxx +++ b/panda/src/mathutil/triangulator3.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "triangulator3.h" +#include "look_at_src.h" //////////////////////////////////////////////////////////////////// // Function: Triangulator3::Constructor From 8e3c001f8a9600b13cf3244e706cf3f8e9d0bd71 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 13:09:20 -0700 Subject: [PATCH 104/744] Add CMakeLists for panda/gsgbase --- panda/CMakeLists.txt | 3 ++- panda/src/gsgbase/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 panda/src/gsgbase/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 44fa45bc4a..61652662dd 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -11,8 +11,9 @@ add_subdirectory(src/putil) add_subdirectory(src/pstatclient) add_subdirectory(src/linmath) add_subdirectory(src/event) - add_subdirectory(src/mathutil) +add_subdirectory(src/gsgbase) + #add_subdirectory(src/gobj) #add_subdirectory(src/pgraph) #add_subdirectory(src/display) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt new file mode 100644 index 0000000000..f6c3a10104 --- /dev/null +++ b/panda/src/gsgbase/CMakeLists.txt @@ -0,0 +1,32 @@ +set(P3GSGBASE_HEADERS + config_gsgbase.h + displayRegionBase.I displayRegionBase.h + graphicsOutputBase.I graphicsOutputBase.h + graphicsStateGuardianBase.h +) + +set(P3GSGBASE_SOURCES + config_gsgbase.cxx + displayRegionBase.cxx + graphicsOutputBase.cxx + graphicsStateGuardianBase.cxx +) + +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + +composite_sources(p3gsgbase P3GSGBASE_SOURCES) +add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) +target_link_libraries(p3gsgbase p3linmath) +target_interrogate(p3gsgbase ALL) + +#begin test_bin_target + #define TARGET test_gsgbase + #define LOCAL_LIBS +# p3gsgbase + + #define SOURCES +# test_gsgbase.cxx + +#end test_bin_target From 53ae0fb95b1af24d866b527ce77e9150ac44cdc6 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 14:04:18 -0700 Subject: [PATCH 105/744] Fix FindCG to output variables in a general and expected format. --- cmake/modules/FindCg.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 55e7b7ea42..757eb52603 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -7,6 +7,7 @@ # Once done this will define: # CG_FOUND - system has NvidiaCg # CG_INCLUDE_DIR - the NvidiaCg include directory +# CG_INCLUDE_DIRS - directories for all NvidiaCg components # CG_LIBRARY_DIR - the NvidiaCg library directory # CG_LIBRARY - the path to the library binary # @@ -34,7 +35,7 @@ macro(find_cggl) "/usr/local/include" "/opt/Cg" "/opt/nvidia-cg-toolkit/include" # Gentoo - PATH_SUFFIXES "" "Cg" + PATH_SUFFIXES "" "Cg" "cg" DOC "The path to NvidiaCgGL's include directory." ) @@ -84,7 +85,7 @@ endmacro() # Find base Nvidia Cg -if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIR) +if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIRS) # On OSX default to using the framework version of Cg. if(APPLE) include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake) @@ -119,7 +120,7 @@ if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIR) "/usr/local/include" "/opt/Cg" "/opt/nvidia-cg-toolkit/include" # Gentoo - PATH_SUFFIXES "" "Cg" + PATH_SUFFIXES "" "Cg" "cg" DOC "The path to NvidiaCg's include directory." ) @@ -139,13 +140,17 @@ if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIR) set(CG_LIBRARY_DIR "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path endif() + string(REGEX REPLACE "/Cg$" "" CG_BASE_INCLUDE_DIR ${CG_INCLUDE_DIR}) + set(CG_INCLUDE_DIRS ${CG_BASE_INCLUDE_DIR} ${CG_INCLUDE_DIR}) + + mark_as_advanced(CG_INCLUDE_DIRS) mark_as_advanced(CG_INCLUDE_DIR) mark_as_advanced(CG_LIBRARY_DIR) mark_as_advanced(CG_LIBRARY) endif() 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_DIRS CG_LIBRARY_DIR) if(CG_INCLUDE_DIR AND CG_LIBRARY_DIR) find_cggl() From c000d2c19b87d1f637fbb4a795a547a12b825a87 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 14:27:02 -0700 Subject: [PATCH 106/744] Fix mix with gobj/gsgbase CMakeLists and #includes Signed-off-by: kestred --- panda/src/gobj/CMakeLists.txt | 165 ++++++++++++++++++++++++++++ panda/src/gobj/config_gobj.h | 2 + panda/src/gobj/geomCacheManager.cxx | 1 + panda/src/gsgbase/CMakeLists.txt | 3 + 4 files changed, 171 insertions(+) create mode 100644 panda/src/gobj/CMakeLists.txt diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt new file mode 100644 index 0000000000..fac938a8b6 --- /dev/null +++ b/panda/src/gobj/CMakeLists.txt @@ -0,0 +1,165 @@ +set(P3GOBJ_HEADERS + adaptiveLru.I adaptiveLru.h + animateVerticesRequest.I animateVerticesRequest.h + bufferContext.I bufferContext.h + bufferContextChain.I bufferContextChain.h + bufferResidencyTracker.I bufferResidencyTracker.h + config_gobj.h + geom.h geom.I + geomContext.I geomContext.h + geomEnums.h + geomMunger.h geomMunger.I + geomPrimitive.h geomPrimitive.I + geomPatches.h + geomTriangles.h + geomTristrips.h + geomTrifans.h + geomLines.h + geomLinestrips.h + geomPoints.h + geomVertexArrayData.h geomVertexArrayData.I + geomVertexArrayData_ext.h geomVertexArrayData_ext.cxx + geomVertexArrayFormat.h geomVertexArrayFormat.I + geomCacheEntry.h geomCacheEntry.I + geomCacheManager.h geomCacheManager.I + geomVertexAnimationSpec.h geomVertexAnimationSpec.I + geomVertexData.h geomVertexData.I + geomVertexColumn.h geomVertexColumn.I + geomVertexFormat.h geomVertexFormat.I + geomVertexReader.h geomVertexReader.I + geomVertexRewriter.h geomVertexRewriter.I + geomVertexWriter.h geomVertexWriter.I + indexBufferContext.I indexBufferContext.h + internalName.I internalName.h + lens.h lens.I + material.I material.h materialPool.I materialPool.h + matrixLens.I matrixLens.h + occlusionQueryContext.I occlusionQueryContext.h + orthographicLens.I orthographicLens.h perspectiveLens.I + perspectiveLens.h + preparedGraphicsObjects.I preparedGraphicsObjects.h + queryContext.I queryContext.h + savedContext.I savedContext.h + shader.I shader.h + shaderContext.h shaderContext.I + simpleAllocator.h simpleAllocator.I + simpleLru.h simpleLru.I + sliderTable.I sliderTable.h + texture.I texture.h + textureCollection.I textureCollection.h + textureContext.I textureContext.h + texturePeeker.I texturePeeker.h + texturePool.I texturePool.h + texturePoolFilter.I texturePoolFilter.h + textureReloadRequest.I textureReloadRequest.h + textureStage.I textureStage.h + textureStagePool.I textureStagePool.h + transformBlend.I transformBlend.h + transformBlendTable.I transformBlendTable.h + transformTable.I transformTable.h + userVertexSlider.I userVertexSlider.h + userVertexTransform.I userVertexTransform.h + vertexBufferContext.I vertexBufferContext.h + vertexDataBlock.I vertexDataBlock.h + vertexDataBook.I vertexDataBook.h + vertexDataBuffer.I vertexDataBuffer.h + vertexDataPage.I vertexDataPage.h + vertexDataSaveFile.I vertexDataSaveFile.h + vertexSlider.I vertexSlider.h + vertexTransform.I vertexTransform.h + videoTexture.I videoTexture.h +) + +set(P3GOBJ_SOURCES + adaptiveLru.cxx + animateVerticesRequest.cxx + bufferContext.cxx + bufferContextChain.cxx + bufferResidencyTracker.cxx + config_gobj.cxx + geomContext.cxx + geom.cxx + geomEnums.cxx + geomMunger.cxx + geomPrimitive.cxx + geomPatches.cxx + geomTriangles.cxx + geomTristrips.cxx + geomTrifans.cxx + geomLines.cxx + geomLinestrips.cxx + geomPoints.cxx + geomVertexArrayData.cxx + geomVertexArrayFormat.cxx + geomCacheEntry.cxx + geomCacheManager.cxx + geomVertexAnimationSpec.cxx + geomVertexData.cxx + geomVertexColumn.cxx + geomVertexFormat.cxx + geomVertexReader.cxx + geomVertexRewriter.cxx + geomVertexWriter.cxx + indexBufferContext.cxx + material.cxx + internalName.cxx + lens.cxx + materialPool.cxx matrixLens.cxx + occlusionQueryContext.cxx + orthographicLens.cxx + perspectiveLens.cxx + preparedGraphicsObjects.cxx + queryContext.cxx + savedContext.cxx + shader.cxx + shaderContext.cxx + simpleAllocator.cxx + simpleLru.cxx + sliderTable.cxx + texture.cxx + textureCollection.cxx + textureContext.cxx + texturePeeker.cxx + texturePool.cxx + texturePoolFilter.cxx + textureReloadRequest.cxx + textureStage.cxx + textureStagePool.cxx + transformBlend.cxx + transformBlendTable.cxx + transformTable.cxx + userVertexSlider.cxx + userVertexTransform.cxx + vertexBufferContext.cxx + vertexDataBlock.cxx + vertexDataBook.cxx + vertexDataBuffer.cxx + vertexDataPage.cxx + vertexDataSaveFile.cxx + vertexSlider.cxx + vertexTransform.cxx + videoTexture.cxx +) + +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + +if(HAVE_CG) + include_directories(${CG_INCLUDE_DIRS}) +endif() + +composite_sources(p3gobj P3GOBJ_SOURCES) +add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) +target_link_libraries(p3gobj p3mathutil p3gsgbase) +target_interrogate(p3gobj ALL) + +#begin test_bin_target + #define TARGET test_gobj + #define LOCAL_LIBS \ +# p3gobj p3putil + + #define SOURCES \ +# test_gobj.cxx + +#end test_bin_target diff --git a/panda/src/gobj/config_gobj.h b/panda/src/gobj/config_gobj.h index 6184768dc1..3e1192ef48 100644 --- a/panda/src/gobj/config_gobj.h +++ b/panda/src/gobj/config_gobj.h @@ -23,6 +23,7 @@ #include "configVariableDouble.h" #include "configVariableFilename.h" #include "configVariableString.h" +#include "configVariableList.h" #include "autoTextureScale.h" NotifyCategoryDecl(gobj, EXPCL_PANDA_GOBJ, EXPTP_PANDA_GOBJ); @@ -84,6 +85,7 @@ extern EXPCL_PANDA_GOBJ ConfigVariableInt released_ibuffer_cache_size; extern EXPCL_PANDA_GOBJ ConfigVariableDouble default_near; extern EXPCL_PANDA_GOBJ ConfigVariableDouble default_far; +extern EXPCL_PANDA_GOBJ ConfigVariableDouble lens_far_limit; extern EXPCL_PANDA_GOBJ ConfigVariableDouble default_fov; extern EXPCL_PANDA_GOBJ ConfigVariableDouble default_iod; extern EXPCL_PANDA_GOBJ ConfigVariableDouble default_converge; diff --git a/panda/src/gobj/geomCacheManager.cxx b/panda/src/gobj/geomCacheManager.cxx index 61dc8b4a64..59596d1839 100644 --- a/panda/src/gobj/geomCacheManager.cxx +++ b/panda/src/gobj/geomCacheManager.cxx @@ -15,6 +15,7 @@ #include "geomCacheManager.h" #include "geomCacheEntry.h" #include "lightMutexHolder.h" +#include "clockObject.h" GeomCacheManager *GeomCacheManager::_global_ptr = NULL; diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index f6c3a10104..691c4fcc07 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -15,6 +15,9 @@ set(P3GSGBASE_SOURCES if(HAVE_EIGEN) include_directories(${EIGEN3_INCLUDE_DIR}) endif() +if(HAVE_CG) + include_directories(${CG_INCLUDE_DIRS}) +endif() composite_sources(p3gsgbase P3GSGBASE_SOURCES) add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) From f0076da3c09b5119e72359b1a6c5c4d9f086fbb1 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 14:27:31 -0700 Subject: [PATCH 107/744] Add CMakeLists for panda/pnmimage --- panda/CMakeLists.txt | 1 + panda/src/pnmimage/CMakeLists.txt | 34 +++++++++++++++++++++++++ panda/src/pnmimage/pnm-image-filter.cxx | 1 + panda/src/pnmimage/pnmBrush.cxx | 1 + panda/src/pnmimage/pnmPainter.cxx | 1 - panda/src/pnmimage/pnmPainter.h | 1 + 6 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 panda/src/pnmimage/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 61652662dd..84d78f05ab 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -13,6 +13,7 @@ add_subdirectory(src/linmath) add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) +add_subdirectory(src/pnmimage) #add_subdirectory(src/gobj) #add_subdirectory(src/pgraph) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt new file mode 100644 index 0000000000..aea7e8716f --- /dev/null +++ b/panda/src/pnmimage/CMakeLists.txt @@ -0,0 +1,34 @@ +set(P3PNMIMAGE_HEADERS + config_pnmimage.h + pfmFile.I pfmFile.h + pnmbitio.h + pnmBrush.h pnmBrush.I + pnmFileType.h pnmFileTypeRegistry.h pnmImage.I + pnmImage.h pnmImageHeader.I pnmImageHeader.h + pnmPainter.h pnmPainter.I + pnmReader.I + pnmReader.h pnmWriter.I pnmWriter.h pnmimage_base.h + ppmcmap.h +) + +set(P3PNMIMAGE_SOURCES + config_pnmimage.cxx + pfmFile.cxx + pnm-image-filter.cxx + pnmbitio.cxx + pnmBrush.cxx + pnmFileType.cxx + pnmFileTypeRegistry.cxx pnmImage.cxx pnmImageHeader.cxx + pnmPainter.cxx + pnmReader.cxx pnmWriter.cxx pnmimage_base.cxx + ppmcmap.cxx +) + +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + +composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) +add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) +target_link_libraries(p3pnmimage p3mathutil) +target_interrogate(p3pnmimage ALL) \ No newline at end of file diff --git a/panda/src/pnmimage/pnm-image-filter.cxx b/panda/src/pnmimage/pnm-image-filter.cxx index ae687a8b16..0de628050a 100644 --- a/panda/src/pnmimage/pnm-image-filter.cxx +++ b/panda/src/pnmimage/pnm-image-filter.cxx @@ -35,6 +35,7 @@ #include "pandabase.h" #include #include "cmath.h" +#include "thread.h" #include "pnmImage.h" #include "pfmFile.h" diff --git a/panda/src/pnmimage/pnmBrush.cxx b/panda/src/pnmimage/pnmBrush.cxx index 8e93eabdab..d6105c030f 100644 --- a/panda/src/pnmimage/pnmBrush.cxx +++ b/panda/src/pnmimage/pnmBrush.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "pnmBrush.h" +#include "pnmImage.h" #include "config_pnmimage.h" #include "cmath.h" diff --git a/panda/src/pnmimage/pnmPainter.cxx b/panda/src/pnmimage/pnmPainter.cxx index 7b4ec50ea9..60bd988498 100644 --- a/panda/src/pnmimage/pnmPainter.cxx +++ b/panda/src/pnmimage/pnmPainter.cxx @@ -13,7 +13,6 @@ //////////////////////////////////////////////////////////////////// #include "pnmPainter.h" -#include "pnmBrush.h" //////////////////////////////////////////////////////////////////// // Function: PNMPainter::Constructor diff --git a/panda/src/pnmimage/pnmPainter.h b/panda/src/pnmimage/pnmPainter.h index 93a5b6db44..edc50cc9ae 100644 --- a/panda/src/pnmimage/pnmPainter.h +++ b/panda/src/pnmimage/pnmPainter.h @@ -16,6 +16,7 @@ #define PNMPAINTER_H #include "pandabase.h" +#include "pnmBrush.h" class PNMImage; From 95a58809ffc25209413aad70cd1272a74f2b62c0 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 15:04:00 -0700 Subject: [PATCH 108/744] Add CMakeLists for panda/gobj. Has some compilation issues with vertexDataPage. --- panda/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 2 +- panda/src/gobj/shader.h | 1 + panda/src/gobj/texturePool.cxx | 1 + panda/src/gobj/textureStagePool.cxx | 1 + panda/src/gobj/vertexBufferContext.cxx | 1 + panda/src/gobj/vertexDataBlock.h | 1 + panda/src/gobj/vertexDataBuffer.cxx | 1 + panda/src/gobj/vertexDataPage.cxx | 2 + panda/src/gobj/vertexDataSaveFile.cxx | 1 + panda/src/pgraph/CMakeLists.txt | 215 +++++++++++++++++++++++++ panda/src/pnmimage/CMakeLists.txt | 2 +- panda/src/testbed/CMakeLists.txt | 1 + 13 files changed, 228 insertions(+), 3 deletions(-) create mode 100644 panda/src/pgraph/CMakeLists.txt create mode 100644 panda/src/testbed/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 84d78f05ab..4da1a4306b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -15,7 +15,7 @@ add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/pnmimage) -#add_subdirectory(src/gobj) +add_subdirectory(src/gobj) #add_subdirectory(src/pgraph) #add_subdirectory(src/display) #add_subdirectory(src/framework) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index fac938a8b6..21c1c6af6b 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -151,7 +151,7 @@ endif() composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -target_link_libraries(p3gobj p3mathutil p3gsgbase) +target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_interrogate(p3gobj ALL) #begin test_bin_target diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 420fc0ab8f..50249dccaa 100755 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -16,6 +16,7 @@ #define SHADER_H #include "pandabase.h" +#include "config_gobj.h" #include "typedWritableReferenceCount.h" #include "namable.h" #include "graphicsStateGuardianBase.h" diff --git a/panda/src/gobj/texturePool.cxx b/panda/src/gobj/texturePool.cxx index 92cae15cbb..4377767089 100644 --- a/panda/src/gobj/texturePool.cxx +++ b/panda/src/gobj/texturePool.cxx @@ -26,6 +26,7 @@ #include "configVariableList.h" #include "load_dso.h" #include "mutexHolder.h" +#include "dcast.h" TexturePool *TexturePool::_global_ptr; diff --git a/panda/src/gobj/textureStagePool.cxx b/panda/src/gobj/textureStagePool.cxx index fd5e4942e8..413abe19a8 100644 --- a/panda/src/gobj/textureStagePool.cxx +++ b/panda/src/gobj/textureStagePool.cxx @@ -17,6 +17,7 @@ #include "config_gobj.h" #include "mutexHolder.h" #include "configVariableEnum.h" +#include "string_utils.h" TextureStagePool *TextureStagePool::_global_ptr = (TextureStagePool *)NULL; diff --git a/panda/src/gobj/vertexBufferContext.cxx b/panda/src/gobj/vertexBufferContext.cxx index be6e48b980..ca1751bffe 100644 --- a/panda/src/gobj/vertexBufferContext.cxx +++ b/panda/src/gobj/vertexBufferContext.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "vertexBufferContext.h" +#include "config_gobj.h" TypeHandle VertexBufferContext::_type_handle; diff --git a/panda/src/gobj/vertexDataBlock.h b/panda/src/gobj/vertexDataBlock.h index 1c485569a4..715c0a0153 100644 --- a/panda/src/gobj/vertexDataBlock.h +++ b/panda/src/gobj/vertexDataBlock.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "simpleAllocator.h" +#include "vertexDataPage.h" #include "referenceCount.h" class VertexDataPage; diff --git a/panda/src/gobj/vertexDataBuffer.cxx b/panda/src/gobj/vertexDataBuffer.cxx index fbca451608..11bd743b2c 100644 --- a/panda/src/gobj/vertexDataBuffer.cxx +++ b/panda/src/gobj/vertexDataBuffer.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "vertexDataBuffer.h" +#include "config_gobj.h" #include "pStatTimer.h" TypeHandle VertexDataBuffer::_type_handle; diff --git a/panda/src/gobj/vertexDataPage.cxx b/panda/src/gobj/vertexDataPage.cxx index dc4c0aabcb..a5255c5503 100644 --- a/panda/src/gobj/vertexDataPage.cxx +++ b/panda/src/gobj/vertexDataPage.cxx @@ -16,8 +16,10 @@ #include "configVariableInt.h" #include "vertexDataSaveFile.h" #include "vertexDataBook.h" +#include "vertexDataBlock.h" #include "pStatTimer.h" #include "memoryHook.h" +#include "config_gobj.h" #ifdef HAVE_ZLIB #include diff --git a/panda/src/gobj/vertexDataSaveFile.cxx b/panda/src/gobj/vertexDataSaveFile.cxx index f3ee44cbb2..22deb2de5d 100644 --- a/panda/src/gobj/vertexDataSaveFile.cxx +++ b/panda/src/gobj/vertexDataSaveFile.cxx @@ -15,6 +15,7 @@ #include "vertexDataSaveFile.h" #include "mutexHolder.h" #include "clockObject.h" +#include "config_gobj.h" #ifndef _WIN32 #include diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt new file mode 100644 index 0000000000..e3003eea7c --- /dev/null +++ b/panda/src/pgraph/CMakeLists.txt @@ -0,0 +1,215 @@ +set(P3PGRAPH_HEADERS + accumulatedAttribs.I accumulatedAttribs.h + alphaTestAttrib.I alphaTestAttrib.h + antialiasAttrib.I antialiasAttrib.h + attribNodeRegistry.I attribNodeRegistry.h + audioVolumeAttrib.I audioVolumeAttrib.h + auxSceneData.I auxSceneData.h + auxBitplaneAttrib.I auxBitplaneAttrib.h + bamFile.I bamFile.h + billboardEffect.I billboardEffect.h + cacheStats.I cacheStats.h + camera.I camera.h + clipPlaneAttrib.I clipPlaneAttrib.h + colorAttrib.I colorAttrib.h + colorBlendAttrib.I colorBlendAttrib.h + colorScaleAttrib.I colorScaleAttrib.h + colorWriteAttrib.I colorWriteAttrib.h + compassEffect.I compassEffect.h + config_pgraph.h + cullBin.I cullBin.h + cullBinEnums.h + cullBinAttrib.I cullBinAttrib.h + cullBinManager.I cullBinManager.h + cullFaceAttrib.I cullFaceAttrib.h + cullHandler.I cullHandler.h + cullPlanes.I cullPlanes.h + cullResult.I cullResult.h + cullTraverser.I cullTraverser.h + cullTraverserData.I cullTraverserData.h + cullableObject.I cullableObject.h + decalEffect.I decalEffect.h + depthOffsetAttrib.I depthOffsetAttrib.h + depthTestAttrib.I depthTestAttrib.h + depthWriteAttrib.I depthWriteAttrib.h + eventStorePandaNode.I eventStorePandaNode.h + findApproxLevelEntry.I findApproxLevelEntry.h + findApproxPath.I findApproxPath.h + fog.I fog.h + fogAttrib.I fogAttrib.h + geomDrawCallbackData.I geomDrawCallbackData.h + geomNode.I geomNode.h + geomTransformer.I geomTransformer.h + internalNameCollection.I internalNameCollection.h + lensNode.I lensNode.h + light.I light.h + lightAttrib.I lightAttrib.h + lightRampAttrib.I lightRampAttrib.h + loader.I loader.h + loaderFileType.h + loaderFileTypeBam.h + loaderFileTypeRegistry.h + materialAttrib.I materialAttrib.h + materialCollection.I materialCollection.h + modelFlattenRequest.I modelFlattenRequest.h + modelLoadRequest.I modelLoadRequest.h + modelSaveRequest.I modelSaveRequest.h + modelNode.I modelNode.h + modelPool.I modelPool.h + modelRoot.I modelRoot.h + nodePath.I nodePath.h nodePath.cxx + nodePathCollection.I nodePathCollection.h + nodePathComponent.I nodePathComponent.h + occluderEffect.I occluderEffect.h + occluderNode.I occluderNode.h + pandaNode.I pandaNode.h + pandaNodeChain.I pandaNodeChain.h + planeNode.I planeNode.h + polylightEffect.I polylightEffect.h + polylightNode.I polylightNode.h + portalNode.I portalNode.h + portalClipper.I portalClipper.h + renderAttrib.I renderAttrib.h + renderAttribRegistry.I renderAttribRegistry.h + renderEffect.I renderEffect.h + renderEffects.I renderEffects.h + renderModeAttrib.I renderModeAttrib.h + renderState.I renderState.h + rescaleNormalAttrib.I rescaleNormalAttrib.h + sceneGraphReducer.I sceneGraphReducer.h + sceneSetup.I sceneSetup.h + scissorAttrib.I scissorAttrib.h + scissorEffect.I scissorEffect.h + shadeModelAttrib.I shadeModelAttrib.h + shaderAttrib.I shaderAttrib.h + shaderInput.I shaderInput.h + shaderPool.I shaderPool.h + showBoundsEffect.I showBoundsEffect.h + stateMunger.I stateMunger.h + stencilAttrib.I stencilAttrib.h + texMatrixAttrib.I texMatrixAttrib.h + texProjectorEffect.I texProjectorEffect.h + textureAttrib.I textureAttrib.h + texGenAttrib.I texGenAttrib.h + textureStageCollection.I textureStageCollection.h + transformState.I transformState.h + transparencyAttrib.I transparencyAttrib.h + weakNodePath.I weakNodePath.h + workingNodePath.I workingNodePath.h +) + +set(P3PGRAPH_SOURCES + accumulatedAttribs.cxx + alphaTestAttrib.cxx + antialiasAttrib.cxx + attribNodeRegistry.cxx + audioVolumeAttrib.cxx + auxBitplaneAttrib.cxx + auxSceneData.cxx + bamFile.cxx + billboardEffect.cxx + cacheStats.cxx + camera.cxx + clipPlaneAttrib.cxx + colorAttrib.cxx + colorBlendAttrib.cxx + colorScaleAttrib.cxx + colorWriteAttrib.cxx + compassEffect.cxx + config_pgraph.cxx + cullBin.cxx + cullBinAttrib.cxx + cullBinManager.cxx + cullFaceAttrib.cxx + cullHandler.cxx + cullPlanes.cxx + cullResult.cxx + cullTraverser.cxx + cullTraverserData.cxx + cullableObject.cxx + decalEffect.cxx + depthOffsetAttrib.cxx + depthTestAttrib.cxx + depthWriteAttrib.cxx + eventStorePandaNode.cxx + findApproxLevelEntry.cxx + findApproxPath.cxx + fog.cxx + fogAttrib.cxx + geomDrawCallbackData.cxx + geomNode.cxx + geomTransformer.cxx + internalNameCollection.cxx + lensNode.cxx + light.cxx + lightAttrib.cxx + lightRampAttrib.cxx + loader.cxx + loaderFileType.cxx + loaderFileTypeBam.cxx + loaderFileTypeRegistry.cxx + materialAttrib.cxx + materialCollection.cxx + modelFlattenRequest.cxx + modelLoadRequest.cxx + modelSaveRequest.cxx + modelNode.cxx + modelPool.cxx + modelRoot.cxx + nodePathCollection.cxx + nodePathComponent.cxx + occluderEffect.cxx + occluderNode.cxx + pandaNode.cxx + pandaNodeChain.cxx + planeNode.cxx + polylightEffect.cxx + polylightNode.cxx + portalNode.cxx + portalClipper.cxx + renderAttrib.cxx + renderAttribRegistry.cxx + renderEffect.cxx + renderEffects.cxx + renderModeAttrib.cxx + renderState.cxx + rescaleNormalAttrib.cxx + sceneGraphReducer.cxx + sceneSetup.cxx + scissorAttrib.cxx + scissorEffect.cxx + shadeModelAttrib.cxx + shaderAttrib.cxx + shaderInput.cxx + shaderPool.cxx + showBoundsEffect.cxx + stateMunger.cxx + stencilAttrib.cxx + texMatrixAttrib.cxx + texProjectorEffect.cxx + textureAttrib.cxx + texGenAttrib.cxx + textureStageCollection.cxx + transformState.cxx + transparencyAttrib.cxx + weakNodePath.cxx + workingNodePath.cxx +) + +composite_sources(p3pgraph P3PGRAPH_SOURCES) +add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) +target_link_libraries(p3pgraph) #p3gobj +target_interrogate(p3pgraph ALL) + # p3gobj p3event p3gsgbase p3putil p3linmath p3downloader + + +#begin test_bin_target + #define TARGET test_pgraph + + #define SOURCES + # test_pgraph.cxx + + #define LOCAL_LIBS $[LOCAL_LIBS] p3pgraph + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + +#end test_bin_target diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index aea7e8716f..fd95838222 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -31,4 +31,4 @@ endif() composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) -target_interrogate(p3pnmimage ALL) \ No newline at end of file +target_interrogate(p3pnmimage ALL) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt new file mode 100644 index 0000000000..c632347b29 --- /dev/null +++ b/panda/src/testbed/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(pview pview.cxx) \ No newline at end of file From 6a9f2e023a5fdbd226d2693b73e6232b476e401b Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 19 Jan 2014 18:28:49 -0700 Subject: [PATCH 109/744] Finish CMake for panda/gobj. --- panda/src/gobj/vertexDataPage.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/gobj/vertexDataPage.cxx b/panda/src/gobj/vertexDataPage.cxx index a5255c5503..7fd13208cd 100644 --- a/panda/src/gobj/vertexDataPage.cxx +++ b/panda/src/gobj/vertexDataPage.cxx @@ -20,6 +20,7 @@ #include "pStatTimer.h" #include "memoryHook.h" #include "config_gobj.h" +#include #ifdef HAVE_ZLIB #include From 6c98b96f5dff5c853d08b877b753ea1a22e8fc80 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 18:36:25 -0700 Subject: [PATCH 110/744] Add CMakeLists.txt for panda/pgraph. --- panda/CMakeLists.txt | 4 ++-- panda/src/pgraph/CMakeLists.txt | 6 +++++- panda/src/pgraph/antialiasAttrib.cxx | 1 + panda/src/pgraph/cullTraverserData.cxx | 1 + panda/src/pgraph/cullableObject.cxx | 2 ++ panda/src/pgraph/findApproxPath.h | 1 + panda/src/pgraph/geomDrawCallbackData.cxx | 2 ++ panda/src/pgraph/geomDrawCallbackData.h | 4 ++++ panda/src/pgraph/geomNode.cxx | 6 ++++++ panda/src/pgraph/geomTransformer.cxx | 2 ++ panda/src/pgraph/geomTransformer.h | 1 + panda/src/pgraph/loaderFileTypeBam.cxx | 1 + panda/src/pgraph/modelPool.cxx | 1 + panda/src/pgraph/portalNode.cxx | 2 ++ panda/src/pgraph/rescaleNormalAttrib.cxx | 1 + panda/src/pgraph/scissorEffect.cxx | 1 + panda/src/pgraph/scissorEffect.h | 3 +++ 17 files changed, 36 insertions(+), 3 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 4da1a4306b..c33f82f597 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -14,9 +14,9 @@ add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/pnmimage) - add_subdirectory(src/gobj) -#add_subdirectory(src/pgraph) +add_subdirectory(src/pgraph) + #add_subdirectory(src/display) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index e3003eea7c..99ab715868 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -196,9 +196,13 @@ set(P3PGRAPH_SOURCES workingNodePath.cxx ) +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + composite_sources(p3pgraph P3PGRAPH_SOURCES) add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) -target_link_libraries(p3pgraph) #p3gobj +target_link_libraries(p3pgraph p3gobj) target_interrogate(p3pgraph ALL) # p3gobj p3event p3gsgbase p3putil p3linmath p3downloader diff --git a/panda/src/pgraph/antialiasAttrib.cxx b/panda/src/pgraph/antialiasAttrib.cxx index 6a5dc4bfb5..54c41096f1 100644 --- a/panda/src/pgraph/antialiasAttrib.cxx +++ b/panda/src/pgraph/antialiasAttrib.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "antialiasAttrib.h" +#include "config_pgraph.h" #include "graphicsStateGuardianBase.h" #include "dcast.h" #include "bamReader.h" diff --git a/panda/src/pgraph/cullTraverserData.cxx b/panda/src/pgraph/cullTraverserData.cxx index 5bd8619152..a103cb2903 100644 --- a/panda/src/pgraph/cullTraverserData.cxx +++ b/panda/src/pgraph/cullTraverserData.cxx @@ -23,6 +23,7 @@ #include "boundingPlane.h" #include "billboardEffect.h" #include "compassEffect.h" +#include "occluderEffect.h" #include "polylightEffect.h" #include "renderState.h" diff --git a/panda/src/pgraph/cullableObject.cxx b/panda/src/pgraph/cullableObject.cxx index 4ea54f5923..a305c243b2 100644 --- a/panda/src/pgraph/cullableObject.cxx +++ b/panda/src/pgraph/cullableObject.cxx @@ -15,7 +15,9 @@ #include "cullableObject.h" #include "lightAttrib.h" #include "nodePath.h" +#include "colorAttrib.h" #include "texGenAttrib.h" +#include "textureAttrib.h" #include "renderState.h" #include "clockObject.h" #include "cullTraverser.h" diff --git a/panda/src/pgraph/findApproxPath.h b/panda/src/pgraph/findApproxPath.h index 324222710a..3e422048ed 100644 --- a/panda/src/pgraph/findApproxPath.h +++ b/panda/src/pgraph/findApproxPath.h @@ -20,6 +20,7 @@ #include "globPattern.h" #include "typeHandle.h" #include "pvector.h" +#include "pnotify.h" class PandaNode; diff --git a/panda/src/pgraph/geomDrawCallbackData.cxx b/panda/src/pgraph/geomDrawCallbackData.cxx index 5563b09193..40078988c3 100644 --- a/panda/src/pgraph/geomDrawCallbackData.cxx +++ b/panda/src/pgraph/geomDrawCallbackData.cxx @@ -13,6 +13,8 @@ //////////////////////////////////////////////////////////////////// #include "geomDrawCallbackData.h" +#include "cullableObject.h" +#include "graphicsStateGuardianBase.h" TypeHandle GeomDrawCallbackData::_type_handle; diff --git a/panda/src/pgraph/geomDrawCallbackData.h b/panda/src/pgraph/geomDrawCallbackData.h index 48ae66ed3c..ecce6b8476 100644 --- a/panda/src/pgraph/geomDrawCallbackData.h +++ b/panda/src/pgraph/geomDrawCallbackData.h @@ -18,6 +18,10 @@ #include "pandabase.h" #include "callbackData.h" +// Forward declarations +class CullableObject; +class GraphicsStateGuardianBase; + //////////////////////////////////////////////////////////////////// // Class : GeomDrawCallbackData // Description : This specialization on CallbackData is passed when diff --git a/panda/src/pgraph/geomNode.cxx b/panda/src/pgraph/geomNode.cxx index e6fc63f5c3..ecdaaa8f31 100644 --- a/panda/src/pgraph/geomNode.cxx +++ b/panda/src/pgraph/geomNode.cxx @@ -19,11 +19,16 @@ #include "accumulatedAttribs.h" #include "colorAttrib.h" #include "colorScaleAttrib.h" +#include "cullFaceAttrib.h" #include "texMatrixAttrib.h" #include "textureAttrib.h" #include "shaderAttrib.h" #include "bamReader.h" #include "bamWriter.h" +#include "cullableObject.h" +#include "cullHandler.h" +#include "cullTraverser.h" +#include "cullTraverserData.h" #include "datagram.h" #include "datagramIterator.h" #include "indent.h" @@ -31,6 +36,7 @@ #include "config_pgraph.h" #include "graphicsStateGuardianBase.h" #include "boundingBox.h" +#include "boundingSphere.h" #include "config_mathutil.h" diff --git a/panda/src/pgraph/geomTransformer.cxx b/panda/src/pgraph/geomTransformer.cxx index 60e8d5b151..bc988fffa0 100644 --- a/panda/src/pgraph/geomTransformer.cxx +++ b/panda/src/pgraph/geomTransformer.cxx @@ -28,6 +28,8 @@ #include "geomMunger.h" #include "texture.h" #include "texturePeeker.h" +#include "textureAttrib.h" +#include "colorAttrib.h" #include "config_pgraph.h" PStatCollector GeomTransformer::_apply_vertex_collector("*:Flatten:apply:vertex"); diff --git a/panda/src/pgraph/geomTransformer.h b/panda/src/pgraph/geomTransformer.h index 250bb15c43..5166fc70e8 100644 --- a/panda/src/pgraph/geomTransformer.h +++ b/panda/src/pgraph/geomTransformer.h @@ -20,6 +20,7 @@ #include "luse.h" #include "geom.h" #include "geomVertexData.h" +#include "texMatrixAttrib.h" class GeomNode; class RenderState; diff --git a/panda/src/pgraph/loaderFileTypeBam.cxx b/panda/src/pgraph/loaderFileTypeBam.cxx index 9fd3bc1347..a585dac81f 100644 --- a/panda/src/pgraph/loaderFileTypeBam.cxx +++ b/panda/src/pgraph/loaderFileTypeBam.cxx @@ -16,6 +16,7 @@ #include "config_pgraph.h" #include "bamFile.h" #include "bamCacheRecord.h" +#include "modelRoot.h" #include "loaderOptions.h" #include "dcast.h" diff --git a/panda/src/pgraph/modelPool.cxx b/panda/src/pgraph/modelPool.cxx index 4b57720794..f738f7090f 100644 --- a/panda/src/pgraph/modelPool.cxx +++ b/panda/src/pgraph/modelPool.cxx @@ -16,6 +16,7 @@ #include "loader.h" #include "config_pgraph.h" #include "lightMutexHolder.h" +#include "virtualFileSystem.h" ModelPool *ModelPool::_global_ptr = (ModelPool *)NULL; diff --git a/panda/src/pgraph/portalNode.cxx b/panda/src/pgraph/portalNode.cxx index de021bbadc..f7a2d26add 100755 --- a/panda/src/pgraph/portalNode.cxx +++ b/panda/src/pgraph/portalNode.cxx @@ -20,12 +20,14 @@ #include "renderState.h" #include "portalClipper.h" #include "transformState.h" +#include "clipPlaneAttrib.h" #include "colorScaleAttrib.h" #include "transparencyAttrib.h" #include "datagram.h" #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" +#include "boundingSphere.h" #include "plane.h" diff --git a/panda/src/pgraph/rescaleNormalAttrib.cxx b/panda/src/pgraph/rescaleNormalAttrib.cxx index 33ef7f2137..3f061975f8 100644 --- a/panda/src/pgraph/rescaleNormalAttrib.cxx +++ b/panda/src/pgraph/rescaleNormalAttrib.cxx @@ -21,6 +21,7 @@ #include "datagram.h" #include "datagramIterator.h" #include "configVariableEnum.h" +#include "config_pgraph.h" TypeHandle RescaleNormalAttrib::_type_handle; int RescaleNormalAttrib::_attrib_slot; diff --git a/panda/src/pgraph/scissorEffect.cxx b/panda/src/pgraph/scissorEffect.cxx index 0c67f9c58a..05867fd913 100644 --- a/panda/src/pgraph/scissorEffect.cxx +++ b/panda/src/pgraph/scissorEffect.cxx @@ -22,6 +22,7 @@ #include "datagram.h" #include "datagramIterator.h" #include "boundingHexahedron.h" +#include "lens.h" TypeHandle ScissorEffect::_type_handle; diff --git a/panda/src/pgraph/scissorEffect.h b/panda/src/pgraph/scissorEffect.h index bde3aa16d2..9a86f17fbc 100644 --- a/panda/src/pgraph/scissorEffect.h +++ b/panda/src/pgraph/scissorEffect.h @@ -21,6 +21,9 @@ #include "luse.h" #include "nodePath.h" +// Forward declarations +class Lens; + //////////////////////////////////////////////////////////////////// // Class : ScissorEffect // Description : This provides a higher-level wrapper around From fd9ce53bc9804a4eba6062834e9c826044a384de Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 20:53:38 -0700 Subject: [PATCH 111/744] Add CMakeLists for panda/cull --- panda/CMakeLists.txt | 1 + panda/src/cull/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 panda/src/cull/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index c33f82f597..67590532d1 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -17,6 +17,7 @@ add_subdirectory(src/pnmimage) add_subdirectory(src/gobj) add_subdirectory(src/pgraph) +add_subdirectory(src/cull) #add_subdirectory(src/display) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt new file mode 100644 index 0000000000..a51d1dfd0d --- /dev/null +++ b/panda/src/cull/CMakeLists.txt @@ -0,0 +1,30 @@ +set(P3CULL_HEADERS + binCullHandler.h binCullHandler.I + config_cull.h + cullBinBackToFront.h cullBinBackToFront.I + cullBinFixed.h cullBinFixed.I + cullBinFrontToBack.h cullBinFrontToBack.I + cullBinStateSorted.h cullBinStateSorted.I + cullBinUnsorted.h cullBinUnsorted.I + drawCullHandler.h drawCullHandler.I +) + +set(P3CULL_SOURCES + binCullHandler.cxx + config_cull.cxx + cullBinBackToFront.cxx + cullBinFixed.cxx + cullBinFrontToBack.cxx + cullBinStateSorted.cxx + cullBinUnsorted.cxx + drawCullHandler.cxx +) + +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + +composite_sources(p3cull P3CULL_SOURCES) +add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) +target_link_libraries(p3cull p3pgraph) +target_interrogate(p3cull ALL) From 83c60dc187c28cad7b118f11142edfe942a1b356 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 21:11:39 -0700 Subject: [PATCH 112/744] Move conditional includes to panda/CMakeLists.txt so they don't have to be repeated everywhere. --- panda/CMakeLists.txt | 15 ++++++++++++++- panda/src/cull/CMakeLists.txt | 4 ---- panda/src/gobj/CMakeLists.txt | 8 -------- panda/src/gsgbase/CMakeLists.txt | 7 ------- panda/src/linmath/CMakeLists.txt | 4 ---- panda/src/mathutil/CMakeLists.txt | 7 ------- panda/src/pgraph/CMakeLists.txt | 4 ---- panda/src/pnmimage/CMakeLists.txt | 4 ---- 8 files changed, 14 insertions(+), 39 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 67590532d1..9a5934e018 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -2,6 +2,19 @@ if(NOT BUILD_DTOOL) message(FATAL_ERROR "Cannot build panda without dtool! Please enable the BUILD_DTOOL option.") endif() +# Not sure where I want to hide these inludes yet, but it is annoying +# to have to add them to every CMakeLists that either directly, or +# recursively includes linmath, and other libraries etc... +if(HAVE_EIGEN) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() +if(HAVE_FFTW) + include_directories(${FFTW2_INCLUDE_DIR}) +endif() +if(HAVE_CG) + include_directories(${CG_INCLUDE_DIRS}) +endif() + # Include panda source directories add_subdirectory(src/pandabase) add_subdirectory(src/express) @@ -16,8 +29,8 @@ add_subdirectory(src/gsgbase) add_subdirectory(src/pnmimage) add_subdirectory(src/gobj) add_subdirectory(src/pgraph) - add_subdirectory(src/cull) + #add_subdirectory(src/display) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index a51d1dfd0d..f41ca915a8 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -20,10 +20,6 @@ set(P3CULL_SOURCES drawCullHandler.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - composite_sources(p3cull P3CULL_SOURCES) add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) target_link_libraries(p3cull p3pgraph) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 21c1c6af6b..5c6e587628 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -141,14 +141,6 @@ set(P3GOBJ_SOURCES videoTexture.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - -if(HAVE_CG) - include_directories(${CG_INCLUDE_DIRS}) -endif() - composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 691c4fcc07..53ba50d152 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -12,13 +12,6 @@ set(P3GSGBASE_SOURCES graphicsStateGuardianBase.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() -if(HAVE_CG) - include_directories(${CG_INCLUDE_DIRS}) -endif() - composite_sources(p3gsgbase P3GSGBASE_SOURCES) add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) target_link_libraries(p3gsgbase p3linmath) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index c52ceb6039..5b08370b99 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -42,10 +42,6 @@ set(P3LINMATH_SOURCES lvector2.cxx lvector3.cxx lvector4.cxx mathNumbers.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3putil) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 67e787836d..939038a79a 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -60,13 +60,6 @@ set(P3MATHUTIL_SOURCES unionBoundingVolume.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() -if(HAVE_FFTW) - include_directories(${FFTW2_INCLUDE_DIR}) -endif() - composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}}) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 99ab715868..b18557fc7f 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -196,10 +196,6 @@ set(P3PGRAPH_SOURCES workingNodePath.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - composite_sources(p3pgraph P3PGRAPH_SOURCES) add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index fd95838222..e23f01f69a 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -24,10 +24,6 @@ set(P3PNMIMAGE_SOURCES ppmcmap.cxx ) -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) From cb09aa42f39b37509d586f142238e3befcd7d10d Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 21:19:34 -0700 Subject: [PATCH 113/744] Add CMakeLists.txt for panda/pgraphnodes --- panda/src/pgraphnodes/CMakeLists.txt | 44 +++++++++++++++++++++++ panda/src/pgraphnodes/lodNodeType.cxx | 1 + panda/src/pgraphnodes/shaderGenerator.cxx | 2 ++ panda/src/pgraphnodes/uvScrollNode.cxx | 1 + 4 files changed, 48 insertions(+) create mode 100644 panda/src/pgraphnodes/CMakeLists.txt diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt new file mode 100644 index 0000000000..22961aa9f1 --- /dev/null +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -0,0 +1,44 @@ +set(P3PGRAPHNODES_HEADERS + ambientLight.h ambientLight.I + callbackNode.h callbackNode.I + config_pgraphnodes.h + directionalLight.h directionalLight.I + fadeLodNode.I fadeLodNode.h fadeLodNodeData.h + lightLensNode.h lightLensNode.I + lightNode.h lightNode.I + lodNode.I lodNode.h lodNodeType.h + nodeCullCallbackData.h nodeCullCallbackData.I + pointLight.h pointLight.I + sceneGraphAnalyzer.h sceneGraphAnalyzer.I + selectiveChildNode.h selectiveChildNode.I + sequenceNode.h sequenceNode.I + shaderGenerator.h shaderGenerator.I + spotlight.h spotlight.I + switchNode.h switchNode.I + uvScrollNode.I uvScrollNode.h +) + +set(P3PGRAPHNODES_SOURCES + ambientLight.cxx + callbackNode.cxx + config_pgraphnodes.cxx + directionalLight.cxx + fadeLodNode.cxx fadeLodNodeData.cxx + lightLensNode.cxx + lightNode.cxx + lodNode.cxx lodNodeType.cxx + nodeCullCallbackData.cxx + pointLight.cxx + sceneGraphAnalyzer.cxx + selectiveChildNode.cxx + sequenceNode.cxx + shaderGenerator.cxx + spotlight.cxx + switchNode.cxx + uvScrollNode.cxx +) + +composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) +add_library(p3pgraphnodes ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) +target_link_libraries(p3pgraphnodes p3pgraph) +target_interrogate(p3pgraphnodes ALL) diff --git a/panda/src/pgraphnodes/lodNodeType.cxx b/panda/src/pgraphnodes/lodNodeType.cxx index 1c91002c1f..8ceb4eb860 100644 --- a/panda/src/pgraphnodes/lodNodeType.cxx +++ b/panda/src/pgraphnodes/lodNodeType.cxx @@ -14,6 +14,7 @@ #include "lodNodeType.h" #include "string_utils.h" +#include "config_pgraph.h" ostream & operator << (ostream &out, LODNodeType lnt) { diff --git a/panda/src/pgraphnodes/shaderGenerator.cxx b/panda/src/pgraphnodes/shaderGenerator.cxx index 9f9218ed46..204aa1e91b 100644 --- a/panda/src/pgraphnodes/shaderGenerator.cxx +++ b/panda/src/pgraphnodes/shaderGenerator.cxx @@ -31,6 +31,7 @@ #include "texMatrixAttrib.h" #include "texGenAttrib.h" #include "colorScaleAttrib.h" +#include "clipPlaneAttrib.h" #include "fogAttrib.h" #include "texture.h" #include "ambientLight.h" @@ -39,6 +40,7 @@ #include "spotlight.h" #include "lightLensNode.h" #include "lvector4.h" +#include "config_pgraphnodes.h" TypeHandle ShaderGenerator::_type_handle; diff --git a/panda/src/pgraphnodes/uvScrollNode.cxx b/panda/src/pgraphnodes/uvScrollNode.cxx index 831c549d9f..06c2af3410 100644 --- a/panda/src/pgraphnodes/uvScrollNode.cxx +++ b/panda/src/pgraphnodes/uvScrollNode.cxx @@ -15,6 +15,7 @@ #include "uvScrollNode.h" #include "bamReader.h" +#include "cullTraverserData.h" #include "datagram.h" #include "datagramIterator.h" #include "luse.h" From a4e48359da58c9f78445decf5ca784966966288e Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 21:25:38 -0700 Subject: [PATCH 114/744] Add CMakeLists for panda/display --- panda/CMakeLists.txt | 3 +- panda/src/display/CMakeLists.txt | 113 ++++++++++++++++++ .../display/displayRegionDrawCallbackData.cxx | 5 + panda/src/display/drawableRegion.cxx | 1 + panda/src/display/graphicsEngine.cxx | 1 + .../src/display/graphicsWindowInputDevice.cxx | 1 + panda/src/display/graphicsWindowInputDevice.h | 2 + .../graphicsWindowProcCallbackData.cxx | 1 + panda/src/display/lru.cxx | 3 + 9 files changed, 129 insertions(+), 1 deletion(-) create mode 100644 panda/src/display/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 9a5934e018..bad0d467a6 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -29,8 +29,9 @@ add_subdirectory(src/gsgbase) add_subdirectory(src/pnmimage) add_subdirectory(src/gobj) add_subdirectory(src/pgraph) +add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) -#add_subdirectory(src/display) +add_subdirectory(src/display) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt new file mode 100644 index 0000000000..b9f9813cc3 --- /dev/null +++ b/panda/src/display/CMakeLists.txt @@ -0,0 +1,113 @@ +set(P3DISPLAY_HEADERS + standardMunger.I standardMunger.h + config_display.h + callbackGraphicsWindow.I callbackGraphicsWindow.h + drawableRegion.I drawableRegion.h + displayRegion.I displayRegion.h + displayRegionCullCallbackData.I displayRegionCullCallbackData.h + displayRegionDrawCallbackData.I displayRegionDrawCallbackData.h + frameBufferProperties.I frameBufferProperties.h + get_x11.h pre_x11_include.h post_x11_include.h + graphicsEngine.I graphicsEngine.h + graphicsOutput.I graphicsOutput.h + graphicsBuffer.I graphicsBuffer.h + graphicsDevice.h graphicsDevice.I + graphicsPipe.I graphicsPipe.h + graphicsPipeSelection.I graphicsPipeSelection.h + graphicsStateGuardian.I graphicsStateGuardian.h + graphicsThreadingModel.I graphicsThreadingModel.h + graphicsWindow.I graphicsWindow.h + graphicsWindowInputDevice.I graphicsWindowInputDevice.h + graphicsWindowProc.h + graphicsWindowProcCallbackData.I graphicsWindowProcCallbackData.h + lru.h + nativeWindowHandle.I nativeWindowHandle.h + parasiteBuffer.I parasiteBuffer.h + windowHandle.I windowHandle.h + windowProperties.I windowProperties.h + renderBuffer.h + stencilRenderStates.h + stereoDisplayRegion.I stereoDisplayRegion.h + displaySearchParameters.h + displayInformation.h + subprocessWindow.h subprocessWindow.I + touchInfo.h +) + +set(P3DISPLAY_SOURCES + standardMunger.cxx + config_display.cxx + callbackGraphicsWindow.cxx + drawableRegion.cxx + displayRegion.cxx + displayRegionCullCallbackData.cxx + displayRegionDrawCallbackData.cxx + displaySearchParameters.cxx + displayInformation.cxx + frameBufferProperties.cxx + graphicsEngine.cxx + graphicsOutput.cxx + graphicsBuffer.cxx + graphicsPipe.cxx + graphicsPipeSelection.cxx + graphicsStateGuardian.cxx + graphicsThreadingModel.cxx + graphicsWindow.cxx graphicsWindowInputDevice.cxx + graphicsWindowProc.cxx + graphicsWindowProcCallbackData.cxx + graphicsDevice.cxx + lru.cxx + nativeWindowHandle.cxx + parasiteBuffer.cxx + windowHandle.cxx + windowProperties.cxx + stencilRenderStates.cxx + stereoDisplayRegion.cxx + subprocessWindow.cxx + touchInfo.cxx +) + +if(HAVE_PYTHON) + set(P3DISPLAY_HEADERS + ${P3DISPLAY_HEADERS} + pythonGraphicsWindowProc.h + ) + set(P3DISPLAY_SOURCES + ${P3DISPLAY_SOURCES} + pythonGraphicsWindowProc.cxx + ) +endif() + +if(OSX_PLATFORM) + set(P3DISPLAY_HEADER + ${P3DISPLAY_HEADERS} + subprocessWindowBuffer.h + subprocessWindowBuffer.I + ) +endif() + +composite_sources(p3display P3DISPLAY_SOURCES) +add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) +target_link_libraries(p3display p3cull p3pgraphnodes) +target_interrogate(p3display ALL) + +if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) + # We build a static library of just these files, so the plugin can + # link with it in direct/src/plugin, without pulling in the rest of + # Panda. + add_library(p3subprocbuffer + subprocessWindowBuffer.h + subprocessWindowBuffer.I + subprocessWindowBuffer.cxx + ) +endif() + +#begin test_bin_target + #define TARGET test_display + #define LOCAL_LIBS \ +# p3display p3putil + + #define SOURCES \ +# test_display.cxx + +#end test_bin_target diff --git a/panda/src/display/displayRegionDrawCallbackData.cxx b/panda/src/display/displayRegionDrawCallbackData.cxx index b108edab11..07e2242463 100644 --- a/panda/src/display/displayRegionDrawCallbackData.cxx +++ b/panda/src/display/displayRegionDrawCallbackData.cxx @@ -13,7 +13,12 @@ //////////////////////////////////////////////////////////////////// #include "displayRegionDrawCallbackData.h" + +#include "config_display.h" #include "cullResult.h" +#include "displayRegion.h" +#include "graphicsOutput.h" +#include "graphicsStateGuardian.h" #include "sceneSetup.h" TypeHandle DisplayRegionDrawCallbackData::_type_handle; diff --git a/panda/src/display/drawableRegion.cxx b/panda/src/display/drawableRegion.cxx index b7d03bf339..67188080bd 100644 --- a/panda/src/display/drawableRegion.cxx +++ b/panda/src/display/drawableRegion.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "drawableRegion.h" +#include "config_display.h" //////////////////////////////////////////////////////////////////// diff --git a/panda/src/display/graphicsEngine.cxx b/panda/src/display/graphicsEngine.cxx index 2b036f5beb..b42c27d13c 100644 --- a/panda/src/display/graphicsEngine.cxx +++ b/panda/src/display/graphicsEngine.cxx @@ -46,6 +46,7 @@ #include "config_pgraph.h" #include "displayRegionCullCallbackData.h" #include "displayRegionDrawCallbackData.h" +#include "callbackGraphicsWindow.h" #if defined(WIN32) #define WINDOWS_LEAN_AND_MEAN diff --git a/panda/src/display/graphicsWindowInputDevice.cxx b/panda/src/display/graphicsWindowInputDevice.cxx index e6f9fdf483..d1fd8b4cfb 100644 --- a/panda/src/display/graphicsWindowInputDevice.cxx +++ b/panda/src/display/graphicsWindowInputDevice.cxx @@ -14,6 +14,7 @@ #include "graphicsWindowInputDevice.h" +#include "graphicsWindow.h" #include "mouseButton.h" #include "keyboardButton.h" diff --git a/panda/src/display/graphicsWindowInputDevice.h b/panda/src/display/graphicsWindowInputDevice.h index 367feebd26..4ded5e964b 100644 --- a/panda/src/display/graphicsWindowInputDevice.h +++ b/panda/src/display/graphicsWindowInputDevice.h @@ -28,6 +28,8 @@ #include "lightMutex.h" #include "lightMutexHolder.h" +// Forward declarations +class GraphicsWindow; //////////////////////////////////////////////////////////////////// // Class : GraphicsWindowInputDevice diff --git a/panda/src/display/graphicsWindowProcCallbackData.cxx b/panda/src/display/graphicsWindowProcCallbackData.cxx index 684efcbcfb..aab668839b 100644 --- a/panda/src/display/graphicsWindowProcCallbackData.cxx +++ b/panda/src/display/graphicsWindowProcCallbackData.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "graphicsWindowProcCallbackData.h" +#include "graphicsWindow.h" TypeHandle GraphicsWindowProcCallbackData::_type_handle; diff --git a/panda/src/display/lru.cxx b/panda/src/display/lru.cxx index f9361ceaac..b93fb500b0 100644 --- a/panda/src/display/lru.cxx +++ b/panda/src/display/lru.cxx @@ -21,6 +21,9 @@ //#include #include "lru.h" +#if ENABLE_MUTEX +#include "mutexHolder.h" +#endif static const int HIGH_PRIORITY_SCALE = 4; From 43332362df676e1966286bbac8255207829f90a2 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 22:12:53 -0700 Subject: [PATCH 115/744] Add CMakeLists.txt for panda/chan --- panda/CMakeLists.txt | 4 ++- panda/src/chan/CMakeLists.txt | 56 +++++++++++++++++++++++++++++ panda/src/chan/movingPartMatrix.cxx | 1 + panda/src/chan/movingPartScalar.cxx | 1 + panda/src/chan/partBundle.cxx | 2 ++ panda/src/chan/partGroup.cxx | 1 + 6 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 panda/src/chan/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index bad0d467a6..911722d10b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -31,7 +31,9 @@ add_subdirectory(src/gobj) add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) - add_subdirectory(src/display) +add_subdirectory(src/chan) +#add_subdirectory(src/char) + #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt new file mode 100644 index 0000000000..53f4f64fc9 --- /dev/null +++ b/panda/src/chan/CMakeLists.txt @@ -0,0 +1,56 @@ +set(P3CHAN_HEADERS + animBundle.I animBundle.h + animBundleNode.I animBundleNode.h + animChannel.I animChannel.h animChannelBase.I + animChannelBase.h + animChannelMatrixDynamic.I animChannelMatrixDynamic.h + animChannelMatrixFixed.I animChannelMatrixFixed.h + animChannelMatrixXfmTable.I animChannelMatrixXfmTable.h + animChannelScalarDynamic.I animChannelScalarDynamic.h + animChannelScalarTable.I animChannelScalarTable.h + animControl.I + animControl.h animControlCollection.I + animControlCollection.h animGroup.I animGroup.h + animPreloadTable.I animPreloadTable.h + auto_bind.h + bindAnimRequest.I bindAnimRequest.h + config_chan.h + movingPart.I movingPart.h + movingPartBase.I movingPartBase.h + movingPartMatrix.I movingPartMatrix.h movingPartScalar.I + movingPartScalar.h partBundle.I partBundle.h + partBundleHandle.I partBundleHandle.h + partBundleNode.I partBundleNode.h + partGroup.I partGroup.h + partSubset.I partSubset.h + vector_PartGroupStar.h +) + +set(P3CHAN_SOURCES + animBundle.cxx + animBundleNode.cxx + animChannel.cxx + animChannelBase.cxx + animChannelMatrixDynamic.cxx + animChannelMatrixFixed.cxx + animChannelMatrixXfmTable.cxx + animChannelScalarDynamic.cxx + animChannelScalarTable.cxx + animControl.cxx + animControlCollection.cxx animGroup.cxx + animPreloadTable.cxx + auto_bind.cxx + bindAnimRequest.cxx + config_chan.cxx movingPartBase.cxx movingPartMatrix.cxx + movingPartScalar.cxx partBundle.cxx + partBundleHandle.cxx + partBundleNode.cxx + partGroup.cxx + partSubset.cxx + vector_PartGroupStar.cxx +) + +composite_sources(p3chan P3CHAN_SOURCES) +add_library(p3chan ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) +target_link_libraries(p3chan p3pgraph) +target_interrogate(p3chan ALL) diff --git a/panda/src/chan/movingPartMatrix.cxx b/panda/src/chan/movingPartMatrix.cxx index ad9b836fcf..de9d60e2a0 100644 --- a/panda/src/chan/movingPartMatrix.cxx +++ b/panda/src/chan/movingPartMatrix.cxx @@ -21,6 +21,7 @@ #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" +#include "config_chan.h" // Tell GCC that we'll take care of the instantiation explicitly here. #ifdef __GNUC__ diff --git a/panda/src/chan/movingPartScalar.cxx b/panda/src/chan/movingPartScalar.cxx index 4fc34e79dc..7f5260c7a7 100644 --- a/panda/src/chan/movingPartScalar.cxx +++ b/panda/src/chan/movingPartScalar.cxx @@ -19,6 +19,7 @@ #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" +#include "config_chan.h" // Tell GCC that we'll take care of the instantiation explicitly here. #ifdef __GNUC__ diff --git a/panda/src/chan/partBundle.cxx b/panda/src/chan/partBundle.cxx index 2a837cb76d..6a7d405f99 100644 --- a/panda/src/chan/partBundle.cxx +++ b/panda/src/chan/partBundle.cxx @@ -29,6 +29,8 @@ #include "bamWriter.h" #include "configVariableEnum.h" #include "loaderOptions.h" +#include "bindAnimRequest.h" +#include "transformState.h" #include diff --git a/panda/src/chan/partGroup.cxx b/panda/src/chan/partGroup.cxx index 16dab291b7..3b4a65d057 100644 --- a/panda/src/chan/partGroup.cxx +++ b/panda/src/chan/partGroup.cxx @@ -22,6 +22,7 @@ #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" +#include "transformState.h" #include From d94951a91aa939c89e496513bddb764f0d4b537b Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 22:14:20 -0700 Subject: [PATCH 116/744] Add CMakeLists for panda/chan. --- panda/CMakeLists.txt | 2 +- panda/src/chan/partBundle.cxx | 1 - panda/src/char/CMakeLists.txt | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 panda/src/char/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 911722d10b..f4fe3edcc7 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -33,7 +33,7 @@ add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) add_subdirectory(src/chan) -#add_subdirectory(src/char) +add_subdirectory(src/char) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/chan/partBundle.cxx b/panda/src/chan/partBundle.cxx index 6a7d405f99..1648a87a0d 100644 --- a/panda/src/chan/partBundle.cxx +++ b/panda/src/chan/partBundle.cxx @@ -30,7 +30,6 @@ #include "configVariableEnum.h" #include "loaderOptions.h" #include "bindAnimRequest.h" -#include "transformState.h" #include diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt new file mode 100644 index 0000000000..421573ed54 --- /dev/null +++ b/panda/src/char/CMakeLists.txt @@ -0,0 +1,24 @@ +set(P3CHAR_HEADERS + character.I character.h + characterJoint.I characterJoint.h + characterJointBundle.I characterJointBundle.h + characterJointEffect.h characterJointEffect.I + characterSlider.h + characterVertexSlider.I characterVertexSlider.h + config_char.h + jointVertexTransform.I jointVertexTransform.h +) +set(P3CHAR_SOURCES + character.cxx + characterJoint.cxx characterJointBundle.cxx + characterJointEffect.cxx + characterSlider.cxx + characterVertexSlider.cxx + config_char.cxx + jointVertexTransform.cxx +) + +composite_sources(p3char P3CHAR_SOURCES) +add_library(p3char ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) +target_link_libraries(p3char p3chan) +target_interrogate(p3char ALL) From 62a0039d600fa0395e3f00cda4f329d1e6849b55 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 22:45:09 -0700 Subject: [PATCH 117/744] Add CMakeLists for panda/dgraph --- panda/src/dgraph/CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 panda/src/dgraph/CMakeLists.txt diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt new file mode 100644 index 0000000000..0117da0334 --- /dev/null +++ b/panda/src/dgraph/CMakeLists.txt @@ -0,0 +1,17 @@ +set(P3DGRAPH_HEADERS + config_dgraph.h + dataGraphTraverser.I dataGraphTraverser.h + dataNode.I dataNode.h + dataNodeTransmit.I dataNodeTransmit.h +) +set(P3DGRAPH_SOURCES + config_dgraph.cxx + dataGraphTraverser.cxx + dataNode.cxx + dataNodeTransmit.cxx +) + +composite_sources(p3dgraph P3DGRAPH_SOURCES) +add_library(p3dgraph ${P3DGRAPH_SOURCES} ${P3DGRAPH_HEADERS}) +target_link_libraries(p3dgraph p3pgraph) +target_interrogate(p3dgraph ALL) From 065867f8d6e1aec0b40754a8f1c5e19ac97d65ff Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 22:50:05 -0700 Subject: [PATCH 118/744] Add CMakeLists for panda/device --- panda/CMakeLists.txt | 3 +++ panda/src/device/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 panda/src/device/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f4fe3edcc7..6399687273 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -34,6 +34,9 @@ add_subdirectory(src/cull) add_subdirectory(src/display) add_subdirectory(src/chan) add_subdirectory(src/char) +add_subdirectory(src/dgraph) +add_subdirectory(src/device) +#add_subdirectory(src/tform) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt new file mode 100644 index 0000000000..b33fff0d40 --- /dev/null +++ b/panda/src/device/CMakeLists.txt @@ -0,0 +1,32 @@ +set(P3DEVICE_HEADERS + analogNode.I analogNode.h + buttonNode.I buttonNode.h + clientAnalogDevice.I clientAnalogDevice.h clientBase.I + clientBase.h clientButtonDevice.I clientButtonDevice.h + clientDevice.I clientDevice.h clientDialDevice.I + clientDialDevice.h clientTrackerDevice.I + clientTrackerDevice.h config_device.h + dialNode.I dialNode.h + mouseAndKeyboard.h + trackerData.I trackerData.h + trackerNode.I trackerNode.h + virtualMouse.h +) +set(P3DEVICE_SOURCES + analogNode.cxx + buttonNode.cxx + clientAnalogDevice.cxx + clientBase.cxx clientButtonDevice.cxx clientDevice.cxx + clientDialDevice.cxx clientTrackerDevice.cxx + config_device.cxx + dialNode.cxx + mouseAndKeyboard.cxx + trackerData.cxx + trackerNode.cxx + virtualMouse.cxx +) + +composite_sources(p3device P3DEVICE_SOURCES) +add_library(p3device ${P3DEVICE_SOURCES} ${P3DEVICE_HEADERS}) +target_link_libraries(p3device p3dgraph p3display) +target_interrogate(p3device ALL) From 2af95517504087a693d421b14a265db0506b76c5 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:11:51 -0700 Subject: [PATCH 119/744] Add CMakeLists.txt to pnmtext. --- panda/CMakeLists.txt | 6 ++++++ panda/src/device/CMakeLists.txt | 18 +++++++++--------- panda/src/pnmtext/CMakeLists.txt | 19 +++++++++++++++++++ 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100644 panda/src/pnmtext/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6399687273..b6f69dd2a7 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -14,6 +14,9 @@ endif() if(HAVE_CG) include_directories(${CG_INCLUDE_DIRS}) endif() +if(HAVE_FREETYPE) + include_directories(${FREETYPE_INCLUDE_DIRS}) +endif() # Include panda source directories add_subdirectory(src/pandabase) @@ -36,7 +39,10 @@ add_subdirectory(src/chan) add_subdirectory(src/char) add_subdirectory(src/dgraph) add_subdirectory(src/device) +add_subdirectory(src/pnmtext) +#add_subdirectory(src/text) +#add_subdirectory(src/grutil) #add_subdirectory(src/tform) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index b33fff0d40..0b7eaedb1e 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -1,12 +1,12 @@ set(P3DEVICE_HEADERS analogNode.I analogNode.h - buttonNode.I buttonNode.h - clientAnalogDevice.I clientAnalogDevice.h clientBase.I - clientBase.h clientButtonDevice.I clientButtonDevice.h - clientDevice.I clientDevice.h clientDialDevice.I - clientDialDevice.h clientTrackerDevice.I + buttonNode.I buttonNode.h + clientAnalogDevice.I clientAnalogDevice.h clientBase.I + clientBase.h clientButtonDevice.I clientButtonDevice.h + clientDevice.I clientDevice.h clientDialDevice.I + clientDialDevice.h clientTrackerDevice.I clientTrackerDevice.h config_device.h - dialNode.I dialNode.h + dialNode.I dialNode.h mouseAndKeyboard.h trackerData.I trackerData.h trackerNode.I trackerNode.h @@ -15,9 +15,9 @@ set(P3DEVICE_HEADERS set(P3DEVICE_SOURCES analogNode.cxx buttonNode.cxx - clientAnalogDevice.cxx - clientBase.cxx clientButtonDevice.cxx clientDevice.cxx - clientDialDevice.cxx clientTrackerDevice.cxx + clientAnalogDevice.cxx + clientBase.cxx clientButtonDevice.cxx clientDevice.cxx + clientDialDevice.cxx clientTrackerDevice.cxx config_device.cxx dialNode.cxx mouseAndKeyboard.cxx diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt new file mode 100644 index 0000000000..999b43b2b2 --- /dev/null +++ b/panda/src/pnmtext/CMakeLists.txt @@ -0,0 +1,19 @@ +set(P3PNMTEXT_HEADERS + config_pnmtext.h + freetypeFace.h freetypeFace.I + freetypeFont.h freetypeFont.I + pnmTextGlyph.h pnmTextGlyph.I + pnmTextMaker.h pnmTextMaker.I +) +set(P3PNMTEXT_SOURCES + config_pnmtext.cxx + freetypeFace.cxx + freetypeFont.cxx + pnmTextGlyph.cxx + pnmTextMaker.cxx +) + +composite_sources(p3pnmtext P3PNMTEXT_SOURCES) +add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) +target_link_libraries(p3pnmtext p3pnmimage) +target_interrogate(p3pnmtext ALL) From 4a0e57255fe0dc0c2c60b2613c64d36310b28ecf Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:17:52 -0700 Subject: [PATCH 120/744] Add CMakeLists.txt for panda/parametrics. --- panda/CMakeLists.txt | 1 + panda/src/parametrics/CMakeLists.txt | 49 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 panda/src/parametrics/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b6f69dd2a7..ac7e456c26 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -41,6 +41,7 @@ add_subdirectory(src/dgraph) add_subdirectory(src/device) add_subdirectory(src/pnmtext) +add_subdirectory(src/parametrics) #add_subdirectory(src/text) #add_subdirectory(src/grutil) #add_subdirectory(src/tform) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt new file mode 100644 index 0000000000..5b204e752b --- /dev/null +++ b/panda/src/parametrics/CMakeLists.txt @@ -0,0 +1,49 @@ +set(P3PARAMETRICS_HEADERS + config_parametrics.h + cubicCurveseg.h curveFitter.I curveFitter.h + hermiteCurve.h + nurbsCurve.I nurbsCurve.h + nurbsCurveEvaluator.I nurbsCurveEvaluator.h + nurbsCurveInterface.I nurbsCurveInterface.h + nurbsCurveResult.I nurbsCurveResult.h + nurbsBasisVector.I nurbsBasisVector.h + nurbsSurfaceEvaluator.I nurbsSurfaceEvaluator.h + nurbsSurfaceResult.I nurbsSurfaceResult.h + nurbsVertex.h nurbsVertex.I + parametricCurve.h + parametricCurveCollection.I parametricCurveCollection.h + piecewiseCurve.h + ropeNode.I ropeNode.h + sheetNode.I sheetNode.h +) +set(P3PARAMETRICS_SOURCES + config_parametrics.cxx cubicCurveseg.cxx + curveFitter.cxx hermiteCurve.cxx + nurbsCurve.cxx + nurbsCurveEvaluator.cxx + nurbsCurveInterface.cxx + nurbsCurveResult.cxx + nurbsBasisVector.cxx + nurbsSurfaceEvaluator.cxx + nurbsSurfaceResult.cxx + nurbsVertex.cxx + parametricCurve.cxx parametricCurveCollection.cxx + piecewiseCurve.cxx + ropeNode.cxx + sheetNode.cxx +) + +composite_sources(p3parametrics P3PARAMETRICS_SOURCES) +add_library(p3parametrics ${P3PARAMETRICS_SOURCES} ${P3PARAMETRICS_HEADERS}) +target_link_libraries(p3parametrics p3pgraph) +target_interrogate(p3parametrics ALL) + +#begin test_bin_target + #define TARGET test_parametrics + #define LOCAL_LIBS +# p3parametrics + + #define SOURCES +# test_parametrics.cxx + +#end test_bin_target From 3cf973f64c840cefea885710124b2e2ce6338120 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:21:54 -0700 Subject: [PATCH 121/744] Add CMakeLists.txt for panda/text. --- panda/src/text/CMakeLists.txt | 39 +++++++++++++++++++++++++++++ panda/src/text/config_text.h | 1 + panda/src/text/dynamicTextGlyph.cxx | 1 + panda/src/text/dynamicTextPage.cxx | 1 + 4 files changed, 42 insertions(+) create mode 100644 panda/src/text/CMakeLists.txt diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt new file mode 100644 index 0000000000..1a318581ce --- /dev/null +++ b/panda/src/text/CMakeLists.txt @@ -0,0 +1,39 @@ +set(P3TEXT_HEADERS + config_text.h + default_font.h + dynamicTextFont.I dynamicTextFont.h + dynamicTextGlyph.I dynamicTextGlyph.h + dynamicTextPage.I dynamicTextPage.h + fontPool.I fontPool.h + geomTextGlyph.I geomTextGlyph.h + staticTextFont.I staticTextFont.h + textAssembler.I textAssembler.h + textFont.I textFont.h + textGlyph.I textGlyph.h + textGraphic.I textGraphic.h + textNode.I textNode.h + textProperties.I textProperties.h + textPropertiesManager.I textPropertiesManager.h +) +set(P3TEXT_SOURCES + config_text.cxx + default_font.cxx + dynamicTextFont.cxx + dynamicTextGlyph.cxx + dynamicTextPage.cxx + fontPool.cxx + geomTextGlyph.cxx + staticTextFont.cxx + textAssembler.cxx + textFont.cxx textGlyph.cxx + textGraphic.cxx + textNode.cxx + textProperties.cxx + textPropertiesManager.cxx + cmss12.bam_src.c cmss12.bam.pz_src.c persans.ttf_src.c +) + +composite_sources(p3text P3TEXT_SOURCES) +add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) +target_link_libraries(p3text p3pnmtext p3parametrics) +target_interrogate(p3text ALL) diff --git a/panda/src/text/config_text.h b/panda/src/text/config_text.h index fcd9465899..6d4d01f6af 100644 --- a/panda/src/text/config_text.h +++ b/panda/src/text/config_text.h @@ -53,6 +53,7 @@ extern ConfigVariableDouble text_default_underscore_height; extern ConfigVariableEnum text_minfilter; extern ConfigVariableEnum text_magfilter; extern ConfigVariableEnum text_wrap_mode; +extern ConfigVariableEnum text_quality_level; extern ConfigVariableEnum text_render_mode; extern EXPCL_PANDA_TEXT void init_libtext(); diff --git a/panda/src/text/dynamicTextGlyph.cxx b/panda/src/text/dynamicTextGlyph.cxx index dd1c1f02e9..3f76c9eb0b 100644 --- a/panda/src/text/dynamicTextGlyph.cxx +++ b/panda/src/text/dynamicTextGlyph.cxx @@ -16,6 +16,7 @@ #ifdef HAVE_FREETYPE +#include "dynamicTextFont.h" #include "dynamicTextPage.h" #include "geomTextGlyph.h" #include "geomVertexData.h" diff --git a/panda/src/text/dynamicTextPage.cxx b/panda/src/text/dynamicTextPage.cxx index 7d3b5764bb..f42063c0fd 100644 --- a/panda/src/text/dynamicTextPage.cxx +++ b/panda/src/text/dynamicTextPage.cxx @@ -14,6 +14,7 @@ #include "dynamicTextPage.h" #include "dynamicTextFont.h" +#include "config_text.h" #ifdef HAVE_FREETYPE From 2cac5d9b1c517a2f5644fbd0f87138fbbb4234d9 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:26:11 -0700 Subject: [PATCH 122/744] Add CMakeLists for panda/grutil. --- panda/CMakeLists.txt | 6 ++-- panda/src/grutil/CMakeLists.txt | 40 ++++++++++++++++++++++++++ panda/src/grutil/lineSegs.cxx | 1 + panda/src/grutil/pfmVizzer.cxx | 1 + panda/src/grutil/rigidBodyCombiner.cxx | 1 + 5 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 panda/src/grutil/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index ac7e456c26..1b97c30dad 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,10 +40,10 @@ add_subdirectory(src/char) add_subdirectory(src/dgraph) add_subdirectory(src/device) add_subdirectory(src/pnmtext) - add_subdirectory(src/parametrics) -#add_subdirectory(src/text) -#add_subdirectory(src/grutil) +add_subdirectory(src/text) +add_subdirectory(src/grutil) + #add_subdirectory(src/tform) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt new file mode 100644 index 0000000000..1324beea89 --- /dev/null +++ b/panda/src/grutil/CMakeLists.txt @@ -0,0 +1,40 @@ +set(P3GRUTIL_HEADERS + pipeOcclusionCullTraverser.I pipeOcclusionCullTraverser.h + cardMaker.I cardMaker.h + config_grutil.h + movieTexture.I movieTexture.h + fisheyeMaker.I fisheyeMaker.h + frameRateMeter.I frameRateMeter.h + meshDrawer.I meshDrawer.h + meshDrawer2D.I meshDrawer2D.h + geoMipTerrain.I geoMipTerrain.h + sceneGraphAnalyzerMeter.I sceneGraphAnalyzerMeter.h + heightfieldTesselator.I heightfieldTesselator.h + lineSegs.I lineSegs.h + multitexReducer.I multitexReducer.h + nodeVertexTransform.I nodeVertexTransform.h + pfmVizzer.I pfmVizzer.h + rigidBodyCombiner.I rigidBodyCombiner.h +) +set(P3GRUTIL_SOURCES + cardMaker.cxx + movieTexture.cxx + fisheyeMaker.cxx + config_grutil.cxx + frameRateMeter.cxx + meshDrawer.cxx + meshDrawer2D.cxx + geoMipTerrain.cxx + sceneGraphAnalyzerMeter.cxx + heightfieldTesselator.cxx + nodeVertexTransform.cxx + pfmVizzer.cxx + pipeOcclusionCullTraverser.cxx + lineSegs.cxx + rigidBodyCombiner.cxx +) + +composite_sources(p3grutil P3GRUTIL_SOURCES) +add_library(p3grutil ${P3GRUTIL_SOURCES} ${P3GRUTIL_HEADERS}) +target_link_libraries(p3grutil p3display p3text) +target_interrogate(p3grutil ALL) diff --git a/panda/src/grutil/lineSegs.cxx b/panda/src/grutil/lineSegs.cxx index dfd6bd3d89..5c09d8e79f 100644 --- a/panda/src/grutil/lineSegs.cxx +++ b/panda/src/grutil/lineSegs.cxx @@ -20,6 +20,7 @@ #include "geomPoints.h" #include "geomVertexReader.h" #include "geomVertexWriter.h" +#include "colorAttrib.h" //////////////////////////////////////////////////////////////////// // Function: LineSegs::Constructor diff --git a/panda/src/grutil/pfmVizzer.cxx b/panda/src/grutil/pfmVizzer.cxx index 3033af5845..91f3af1a6c 100644 --- a/panda/src/grutil/pfmVizzer.cxx +++ b/panda/src/grutil/pfmVizzer.cxx @@ -21,6 +21,7 @@ #include "geomTriangles.h" #include "geomVertexWriter.h" #include "lens.h" +#include "pnmImage.h" #include "config_grutil.h" //////////////////////////////////////////////////////////////////// diff --git a/panda/src/grutil/rigidBodyCombiner.cxx b/panda/src/grutil/rigidBodyCombiner.cxx index ef9584f5a1..198da02e20 100644 --- a/panda/src/grutil/rigidBodyCombiner.cxx +++ b/panda/src/grutil/rigidBodyCombiner.cxx @@ -22,6 +22,7 @@ #include "geomVertexAnimationSpec.h" #include "sceneGraphReducer.h" #include "omniBoundingVolume.h" +#include "cullTraverserData.h" TypeHandle RigidBodyCombiner::_type_handle; From d624fce61c28f20b8996aff38a8acb595dd19f02 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:28:34 -0700 Subject: [PATCH 123/744] Add CMakeLists for panda/tform. --- panda/CMakeLists.txt | 2 +- panda/src/tform/CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ panda/src/tform/trackball.cxx | 1 + 3 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 panda/src/tform/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 1b97c30dad..6bb38f62bf 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -43,7 +43,7 @@ add_subdirectory(src/pnmtext) add_subdirectory(src/parametrics) add_subdirectory(src/text) add_subdirectory(src/grutil) +add_subdirectory(src/tform) -#add_subdirectory(src/tform) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt new file mode 100644 index 0000000000..1de7ffe237 --- /dev/null +++ b/panda/src/tform/CMakeLists.txt @@ -0,0 +1,30 @@ +set(P3TFORM_HEADERS + buttonThrower.I buttonThrower.h + config_tform.h + driveInterface.I driveInterface.h + mouseInterfaceNode.I mouseInterfaceNode.h + mouseSubregion.I mouseSubregion.h + mouseWatcher.I mouseWatcher.h + mouseWatcherGroup.h + mouseWatcherParameter.I mouseWatcherParameter.h + mouseWatcherRegion.I mouseWatcherRegion.h + trackball.h + transform2sg.h +) +set(P3TFORM_SOURCES + buttonThrower.cxx + config_tform.cxx + driveInterface.cxx + mouseInterfaceNode.cxx + mouseSubregion.cxx + mouseWatcher.cxx + mouseWatcherGroup.cxx + mouseWatcherParameter.cxx mouseWatcherRegion.cxx + trackball.cxx + transform2sg.cxx +) + +composite_sources(p3tform P3TFORM_SOURCES) +add_library(p3tform ${P3TFORM_SOURCES} ${P3TFORM_HEADERS}) +target_link_libraries(p3tform p3device p3grutil) +target_interrogate(p3tform ALL) diff --git a/panda/src/tform/trackball.cxx b/panda/src/tform/trackball.cxx index 0f66a8a927..bf5f8c3a23 100644 --- a/panda/src/tform/trackball.cxx +++ b/panda/src/tform/trackball.cxx @@ -22,6 +22,7 @@ #include "linmath_events.h" #include "mouseButton.h" #include "keyboardButton.h" +#include "config_tform.h" TypeHandle Trackball::_type_handle; From 6ecff9799e7c6f6ca0c3e638f41e59ba1aaa34bc Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:38:28 -0700 Subject: [PATCH 124/744] Add CMakeLists.txt for pgui. --- panda/CMakeLists.txt | 1 + panda/src/pgui/CMakeLists.txt | 63 +++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 panda/src/pgui/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6bb38f62bf..481ebbd80e 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -44,6 +44,7 @@ add_subdirectory(src/parametrics) add_subdirectory(src/text) add_subdirectory(src/grutil) add_subdirectory(src/tform) +add_subdirectory(src/pgui) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt new file mode 100644 index 0000000000..55839744cb --- /dev/null +++ b/panda/src/pgui/CMakeLists.txt @@ -0,0 +1,63 @@ +set(P3PGUI_HEADERS + config_pgui.h + pgButton.I pgButton.h + pgButtonNotify.I pgButtonNotify.h + pgCullTraverser.I pgCullTraverser.h + pgEntry.I pgEntry.h + pgMouseWatcherGroup.I pgMouseWatcherGroup.h + pgMouseWatcherParameter.I pgMouseWatcherParameter.h + pgFrameStyle.I pgFrameStyle.h + pgItem.I pgItem.h + pgItemNotify.I pgItemNotify.h + pgMouseWatcherBackground.h + pgMouseWatcherRegion.I pgMouseWatcherRegion.h + pgScrollFrame.I pgScrollFrame.h + pgSliderBar.I pgSliderBar.h + pgSliderBarNotify.I pgSliderBarNotify.h + pgTop.I pgTop.h + pgVirtualFrame.I pgVirtualFrame.h + pgWaitBar.I pgWaitBar.h +) +set(P3PGUI_SOURCES + config_pgui.cxx + pgButton.cxx + pgButtonNotify.cxx + pgCullTraverser.cxx + pgEntry.cxx + pgMouseWatcherGroup.cxx + pgMouseWatcherParameter.cxx + pgFrameStyle.cxx + pgItem.cxx + pgItemNotify.cxx + pgMouseWatcherBackground.cxx + pgMouseWatcherRegion.cxx + pgScrollFrame.cxx + pgSliderBar.cxx + pgSliderBarNotify.cxx + pgTop.cxx + pgVirtualFrame.cxx + pgWaitBar.cxx +) + +composite_sources(p3pgui P3PGUI_SOURCES) +add_library(p3pgui ${P3PGUI_SOURCES} ${P3PGUI_HEADERS}) +target_link_libraries(p3pgui p3tform) +target_interrogate(p3pgui ALL) + +#begin test_bin_target + #define TARGET test_pgentry + + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + + #define LOCAL_LIBS \ +# p3framework p3putil p3collide p3pgraph p3chan p3text \ +# p3pnmimage p3pnmimagetypes p3event p3gobj p3display \ +# p3mathutil p3putil p3express p3dgraph p3device p3tform \ +# p3linmath p3pstatclient panda + + #define UNIX_SYS_LIBS m + + #define SOURCES \ +# test_pgentry.cxx + +#end test_bin_target From b19d38f76003eb4e226f4e22c25781cfd21f9570 Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:44:38 -0700 Subject: [PATCH 125/744] Add CMakeLists for panda/recorder. --- panda/CMakeLists.txt | 1 + panda/src/recorder/CMakeLists.txt | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 panda/src/recorder/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 481ebbd80e..8da8e0de80 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -45,6 +45,7 @@ add_subdirectory(src/text) add_subdirectory(src/grutil) add_subdirectory(src/tform) add_subdirectory(src/pgui) +add_subdirectory(src/recorder) #add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt new file mode 100644 index 0000000000..8289ef7ecb --- /dev/null +++ b/panda/src/recorder/CMakeLists.txt @@ -0,0 +1,22 @@ +set(P3RECORDER_HEADERS + config_recorder.h + mouseRecorder.h + recorderBase.h recorderBase.I + recorderController.h recorderController.I + recorderFrame.h recorderFrame.I + recorderHeader.h recorderHeader.I + recorderTable.h recorderTable.I + socketStreamRecorder.h socketStreamRecorder.I +) +set(P3RECORDER_SOURCES + config_recorder.cxx + mouseRecorder.cxx + recorderBase.cxx recorderController.cxx + recorderFrame.cxx recorderHeader.cxx recorderTable.cxx + socketStreamRecorder.cxx +) + +composite_sources(p3recorder P3RECORDER_SOURCES) +add_library(p3recorder ${P3RECORDER_SOURCES} ${P3RECORDER_HEADERS}) +target_link_libraries(p3recorder p3dgraph p3downloader) +target_interrogate(p3recorder ALL) From 2aa16df9f28cb93cc463adf212c1ea419bd97b5c Mon Sep 17 00:00:00 2001 From: kestred Date: Tue, 21 Jan 2014 23:56:38 -0700 Subject: [PATCH 126/744] Add CMakeLists for panda/collide. --- panda/src/collide/CMakeLists.txt | 79 +++++++++++++++++++ panda/src/collide/collisionFloorMesh.cxx | 1 + .../collide/collisionHandlerFluidPusher.cxx | 1 + panda/src/collide/collisionParabola.cxx | 1 + panda/src/collide/collisionPlane.cxx | 1 + panda/src/collide/collisionPolygon.cxx | 1 + panda/src/collide/collisionSegment.cxx | 2 + panda/src/collide/collisionSphere.cxx | 1 + panda/src/collide/collisionTube.cxx | 1 + 9 files changed, 88 insertions(+) create mode 100644 panda/src/collide/CMakeLists.txt diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt new file mode 100644 index 0000000000..3b557b981b --- /dev/null +++ b/panda/src/collide/CMakeLists.txt @@ -0,0 +1,79 @@ +set(P3COLLIDE_HEADERS + collisionBox.I collisionBox.h + collisionEntry.I collisionEntry.h + collisionGeom.I collisionGeom.h + collisionHandler.I collisionHandler.h + collisionHandlerEvent.I collisionHandlerEvent.h + collisionHandlerHighestEvent.h + collisionHandlerFloor.I collisionHandlerFloor.h + collisionHandlerGravity.I collisionHandlerGravity.h + collisionHandlerPhysical.I collisionHandlerPhysical.h + collisionHandlerPusher.I collisionHandlerPusher.h + collisionHandlerFluidPusher.I collisionHandlerFluidPusher.h + collisionHandlerQueue.h + collisionInvSphere.I collisionInvSphere.h + collisionLine.I collisionLine.h + collisionLevelStateBase.I collisionLevelStateBase.h + collisionLevelState.I collisionLevelState.h + collisionNode.I collisionNode.h + collisionParabola.I collisionParabola.h + collisionPlane.I collisionPlane.h + collisionPolygon.I collisionPolygon.h + collisionFloorMesh.I collisionFloorMesh.h + collisionRay.I collisionRay.h + collisionRecorder.I collisionRecorder.h + collisionSegment.I collisionSegment.h + collisionSolid.I collisionSolid.h + collisionSphere.I collisionSphere.h + collisionTraverser.I collisionTraverser.h + collisionTube.I collisionTube.h + collisionVisualizer.I collisionVisualizer.h +) +set(P3COLLIDE_SOURCES + collisionBox.cxx + collisionEntry.cxx + collisionGeom.cxx + collisionHandler.cxx + collisionHandlerEvent.cxx + collisionHandlerHighestEvent.cxx + collisionHandlerFloor.cxx + collisionHandlerGravity.cxx + collisionHandlerPhysical.cxx + collisionHandlerPusher.cxx + collisionHandlerFluidPusher.cxx + collisionHandlerQueue.cxx + collisionLevelStateBase.cxx + collisionLevelState.cxx + collisionInvSphere.cxx + collisionLine.cxx + collisionNode.cxx + collisionParabola.cxx + collisionPlane.cxx + collisionPolygon.cxx + collisionFloorMesh.cxx + collisionRay.cxx + collisionRecorder.cxx + collisionSegment.cxx + collisionSolid.cxx + collisionSphere.cxx + collisionTraverser.cxx + collisionTube.cxx + collisionVisualizer.cxx + config_collide.cxx +) + +composite_sources(p3collide P3COLLIDE_SOURCES) +add_library(p3collide ${P3COLLIDE_SOURCES} ${P3COLLIDE_HEADERS}) +target_link_libraries(p3collide p3tform) +target_interrogate(p3collide ALL) + +#begin test_bin_target + #define TARGET test_collide + #define LOCAL_LIBS +# p3collide + #define OTHER_LIBS $[OTHER_LIBS] p3pystub + + #define SOURCES +# test_collide.cxx + +#end test_bin_target diff --git a/panda/src/collide/collisionFloorMesh.cxx b/panda/src/collide/collisionFloorMesh.cxx index d67df63c76..63dbfd8eca 100755 --- a/panda/src/collide/collisionFloorMesh.cxx +++ b/panda/src/collide/collisionFloorMesh.cxx @@ -28,6 +28,7 @@ #include "datagramIterator.h" #include "bamReader.h" #include "bamWriter.h" +#include "boundingBox.h" #include "boundingPlane.h" #include "geom.h" #include "geomTriangles.h" diff --git a/panda/src/collide/collisionHandlerFluidPusher.cxx b/panda/src/collide/collisionHandlerFluidPusher.cxx index b3bb2f6141..8deab17d6c 100755 --- a/panda/src/collide/collisionHandlerFluidPusher.cxx +++ b/panda/src/collide/collisionHandlerFluidPusher.cxx @@ -16,6 +16,7 @@ #include "collisionNode.h" #include "collisionEntry.h" #include "collisionPolygon.h" +#include "collisionSphere.h" #include "config_collide.h" #include "dcast.h" diff --git a/panda/src/collide/collisionParabola.cxx b/panda/src/collide/collisionParabola.cxx index 6beea29da0..4ad5023e3b 100644 --- a/panda/src/collide/collisionParabola.cxx +++ b/panda/src/collide/collisionParabola.cxx @@ -22,6 +22,7 @@ #include "geomLinestrips.h" #include "geomVertexWriter.h" #include "boundingHexahedron.h" +#include "boundingSphere.h" #include "look_at.h" PStatCollector CollisionParabola::_volume_pcollector( diff --git a/panda/src/collide/collisionPlane.cxx b/panda/src/collide/collisionPlane.cxx index e5bb1a5038..5d02de8670 100644 --- a/panda/src/collide/collisionPlane.cxx +++ b/panda/src/collide/collisionPlane.cxx @@ -20,6 +20,7 @@ #include "collisionLine.h" #include "collisionRay.h" #include "collisionSegment.h" +#include "collisionParabola.h" #include "config_collide.h" #include "pointerToArray.h" #include "geomNode.h" diff --git a/panda/src/collide/collisionPolygon.cxx b/panda/src/collide/collisionPolygon.cxx index d5358950a1..2e0bd42073 100644 --- a/panda/src/collide/collisionPolygon.cxx +++ b/panda/src/collide/collisionPolygon.cxx @@ -19,6 +19,7 @@ #include "collisionLine.h" #include "collisionRay.h" #include "collisionSegment.h" +#include "collisionParabola.h" #include "config_collide.h" #include "cullTraverserData.h" #include "boundingBox.h" diff --git a/panda/src/collide/collisionSegment.cxx b/panda/src/collide/collisionSegment.cxx index 6014ca288b..af4444a0b3 100644 --- a/panda/src/collide/collisionSegment.cxx +++ b/panda/src/collide/collisionSegment.cxx @@ -28,8 +28,10 @@ #include "bamWriter.h" #include "geom.h" #include "geomLines.h" +#include "boundingSphere.h" #include "boundingHexahedron.h" #include "geomVertexWriter.h" +#include "look_at.h" TypeHandle CollisionSegment::_type_handle; diff --git a/panda/src/collide/collisionSphere.cxx b/panda/src/collide/collisionSphere.cxx index 773b11c104..23e781ddeb 100644 --- a/panda/src/collide/collisionSphere.cxx +++ b/panda/src/collide/collisionSphere.cxx @@ -19,6 +19,7 @@ #include "collisionSegment.h" #include "collisionHandler.h" #include "collisionEntry.h" +#include "collisionParabola.h" #include "config_collide.h" #include "boundingSphere.h" #include "datagram.h" diff --git a/panda/src/collide/collisionTube.cxx b/panda/src/collide/collisionTube.cxx index 20feabc9a5..f99c513e93 100644 --- a/panda/src/collide/collisionTube.cxx +++ b/panda/src/collide/collisionTube.cxx @@ -19,6 +19,7 @@ #include "collisionSegment.h" #include "collisionHandler.h" #include "collisionEntry.h" +#include "collisionParabola.h" #include "config_collide.h" #include "look_at.h" #include "geom.h" From 73d89146e68cdfb4f92c24e01157f4337784ebae Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 22 Jan 2014 00:03:57 -0700 Subject: [PATCH 127/744] Add CMakeLists.txt for panda/framework. --- panda/CMakeLists.txt | 3 +- panda/src/framework/CMakeLists.txt | 61 +++++++++++++++++++ panda/src/framework/config_framework.h | 1 + panda/src/framework/pandaFramework.h | 1 + panda/src/framework/rock_floor.rgb_src.c | 1 + .../src/framework/shuttle_controls.bam_src.c | 2 +- 6 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 panda/src/framework/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 8da8e0de80..e04e1df191 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -46,6 +46,7 @@ add_subdirectory(src/grutil) add_subdirectory(src/tform) add_subdirectory(src/pgui) add_subdirectory(src/recorder) +add_subdirectory(src/collide) +add_subdirectory(src/framework) -#add_subdirectory(src/framework) #add_subdirectory(src/testbed) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt new file mode 100644 index 0000000000..2148fba29c --- /dev/null +++ b/panda/src/framework/CMakeLists.txt @@ -0,0 +1,61 @@ +set(P3FRAMEWORK_HEADERS + config_framework.h + pandaFramework.I pandaFramework.h + windowFramework.I windowFramework.h +) + +set(P3FRAMEWORK_SOURCES + config_framework.cxx + pandaFramework.cxx + windowFramework.cxx + rock_floor.rgb_src.c shuttle_controls.bam_src.c +) + + +set(P3FRAMEWORK_LINK_TARGETS p3char p3pgui p3recorder p3collide) #p3recorder p3collide p3pnmimagetypes +if(LINK_ALL_STATIC) + # If we're statically linking, we need to explicitly link with + # at least one of the available renderers. + if(HAVE_GL) + set(P3FRAMEWORK_LINK_TARGETS + ${P3FRAMEWORK_LINK_TARGETS} + pandagl + ) + elseif(HAVE_DX10) + set(P3FRAMEWORK_LINK_TARGETS + ${P3FRAMEWORK_LINK_TARGETS} + pandadx10 + ) + elseif(HAVE_DX9) + set(P3FRAMEWORK_LINK_TARGETS + ${P3FRAMEWORK_LINK_TARGETS} + pandadx9 + ) + elseif(HAVE_DX8) + set(P3FRAMEWORK_LINK_TARGETS + ${P3FRAMEWORK_LINK_TARGETS} + pandadx8 + ) + elseif(HAVE_TINYDISPLAY) + set(P3FRAMEWORK_LINK_TARGETS + ${P3FRAMEWORK_LINK_TARGETS} + p3tinydisplay + ) + else() + message(WARNING + "No renderer library available to link to p3framework." + ) + endif() + + # And we might like to have the p3egg loader available. + if(HAVE_EGG) + set(P3FRAMEWORK_LINK_TARGETS + ${P3FRAMEWORK_LINK_TARGETS} + pandaegg + ) + endif() +endif() + +composite_sources(p3framework P3FRAMEWORK_SOURCES) +add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) +target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) diff --git a/panda/src/framework/config_framework.h b/panda/src/framework/config_framework.h index 1cec0ac1e9..070bcfa721 100644 --- a/panda/src/framework/config_framework.h +++ b/panda/src/framework/config_framework.h @@ -28,6 +28,7 @@ NotifyCategoryDecl(framework, EXPCL_FRAMEWORK, EXPTP_FRAMEWORK); extern ConfigVariableDouble aspect_ratio; extern ConfigVariableBool show_frame_rate_meter; extern ConfigVariableBool show_scene_graph_analyzer_meter; +extern ConfigVariableString window_type; extern ConfigVariableString record_session; extern ConfigVariableString playback_session; diff --git a/panda/src/framework/pandaFramework.h b/panda/src/framework/pandaFramework.h index 775e994b86..b675edd3dd 100644 --- a/panda/src/framework/pandaFramework.h +++ b/panda/src/framework/pandaFramework.h @@ -16,6 +16,7 @@ #define PANDAFRAMEWORK_H #include "pandabase.h" +#include "config_framework.h" #include "windowFramework.h" diff --git a/panda/src/framework/rock_floor.rgb_src.c b/panda/src/framework/rock_floor.rgb_src.c index 455e091be6..2613b73b54 100755 --- a/panda/src/framework/rock_floor.rgb_src.c +++ b/panda/src/framework/rock_floor.rgb_src.c @@ -1,3 +1,4 @@ +#include "stddef.h" // size_t /* * This table was generated by the command: diff --git a/panda/src/framework/shuttle_controls.bam_src.c b/panda/src/framework/shuttle_controls.bam_src.c index 7456af0c5b..90812eb186 100755 --- a/panda/src/framework/shuttle_controls.bam_src.c +++ b/panda/src/framework/shuttle_controls.bam_src.c @@ -1,4 +1,4 @@ - +#include "stddef.h" // size_t /* * This table was generated by the command: * From 1bb8ad8a2d43bce602edb70cd57750879f4101d1 Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 22 Jan 2014 00:27:36 -0700 Subject: [PATCH 128/744] Remove (filename)_src.c includes from panda/text CMakeLists. These files are included in other .cxx files. --- panda/src/text/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 1a318581ce..16762eb088 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -30,7 +30,6 @@ set(P3TEXT_SOURCES textNode.cxx textProperties.cxx textPropertiesManager.cxx - cmss12.bam_src.c cmss12.bam.pz_src.c persans.ttf_src.c ) composite_sources(p3text P3TEXT_SOURCES) From e363266573ac9f8eaf54fda542b257e2da144012 Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 22 Jan 2014 00:31:33 -0700 Subject: [PATCH 129/744] Remove extra '}' from panda/mathutil/CMakeLists.txt that was causing linking errors. --- panda/src/mathutil/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 939038a79a..0df4773681 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -62,7 +62,7 @@ set(P3MATHUTIL_SOURCES composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}}) +target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}) target_interrogate(p3mathutil ALL) #begin test_bin_target From 25771c66297aa178aca36718e0fb015d20c8baf7 Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 22 Jan 2014 00:53:32 -0700 Subject: [PATCH 130/744] Cleanup some dtool/package.cmake find variables. --- dtool/Package.cmake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 0cbd91ad45..4bfbcf5f13 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -52,17 +52,23 @@ package_option(GTK) find_package(wxWidgets QUIET) if(WXWIDGETS_FOUND) set(WX_FOUND TRUE) # Mangle for convenience - - # Cleanup after builtin FindWx - mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) - mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) endif() +# Cleanup after builtin FindWx +mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) +mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) #config_package(WX "WxWidgets") package_option(WX) # Find and configure FLTK set(OpenGL_FIND_QUIETLY TRUE) # Fix for builtin FindFLTK find_package(FLTK QUIET) +mark_as_advanced(FLTK_BASE_LIBRARY) # Cleanup after builtin FLTK +mark_as_advanced(FLTK_CONFIG_SCRIPT) # Cleanup after builtin FLTK +mark_as_advanced(FLTK_FLUID_EXECUTABLE) # Cleanup after builtin FLTK +mark_as_advanced(FLTK_FORMS_LIBRARY) # Cleanup after builtin FLTK +mark_as_advanced(FLTK_GL_LIBRARY) # Cleanup after builtin FLTK +mark_as_advanced(FLTK_IMAGES_LIBRARY) # Cleanup after builtin FLTK +mark_as_advanced(FLTK_INCLUDE_DIR) # Cleanup after builtin FLTK #config_package(FLTK) package_option(FLTK) From 2475e995aecc0fd78e4bb4ce133d5652c887977b Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 22 Jan 2014 00:58:07 -0700 Subject: [PATCH 131/744] Remove unnecessary link target from panda/downloader/CMakeLists --- panda/src/downloader/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 7aad0126ad..03c03b418d 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -28,7 +28,8 @@ set(P3DOWNLOADER_HEADERS stringStream.I stringStream.h urlSpec.h urlSpec.I virtualFileHTTP.I virtualFileHTTP.h - virtualFileMountHTTP.I virtualFileMountHTTP.h) + virtualFileMountHTTP.I virtualFileMountHTTP.h +) set(P3DOWNLOADER_SOURCES config_downloader.cxx @@ -58,10 +59,10 @@ set(P3DOWNLOADER_SOURCES stringStream.cxx urlSpec.cxx virtualFileHTTP.cxx - virtualFileMountHTTP.cxx) + virtualFileMountHTTP.cxx +) composite_sources(p3downloader P3DOWNLOADER_SOURCES) - add_library(p3downloader ${P3DOWNLOADER_SOURCES} ${P3DOWNLOADER_HEADERS}) -target_link_libraries(p3downloader p3express p3pandabase) +target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL) From fe62089192f32b0a8bec44d3c9fbf75b3a209392 Mon Sep 17 00:00:00 2001 From: kestred Date: Wed, 22 Jan 2014 01:01:32 -0700 Subject: [PATCH 132/744] Add CMakeLists.txt to pview, such that it will compile (but it does not link). --- panda/CMakeLists.txt | 3 +-- panda/src/testbed/CMakeLists.txt | 26 +++++++++++++++++++++++++- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index e04e1df191..093833fa8b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -48,5 +48,4 @@ add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) add_subdirectory(src/framework) - -#add_subdirectory(src/testbed) +add_subdirectory(src/testbed) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index c632347b29..e7b659bb17 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -1 +1,25 @@ -add_executable(pview pview.cxx) \ No newline at end of file +add_executable(pview pview.cxx) +target_link_libraries(pview p3framework p3pystub) + +#begin test_bin_target + #define TARGET pgrid + + #define SOURCES \ +# pgrid.cxx + #define UNIX_SYS_LIBS m +#end test_bin_target + +#begin test_bin_target + #define TARGET test_lod + #define SOURCES test_lod.cxx +#end test_bin_target + +#begin test_bin_target + #define TARGET test_texmem + #define SOURCES test_texmem.cxx +#end test_bin_target + +#begin test_bin_target + #define TARGET test_map + #define SOURCES test_map.cxx +#end test_bin_target From ba2d2defb2c9ce4e26116c747cb9ae44aae7d321 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 11:20:49 -0700 Subject: [PATCH 133/744] Add CMakeLists.txt for pnmimagetypes. --- panda/CMakeLists.txt | 6 ++++- panda/src/pnmimagetypes/CMakeLists.txt | 32 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 panda/src/pnmimagetypes/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 093833fa8b..93d61fdd74 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -30,6 +30,7 @@ add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/pnmimage) +add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) @@ -48,4 +49,7 @@ add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) add_subdirectory(src/framework) -add_subdirectory(src/testbed) +#add_subdirectory(src/testbed) + +# Include panda metalibs +#add_subdirectory(metalibs/panda) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt new file mode 100644 index 0000000000..a8d21dc84e --- /dev/null +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -0,0 +1,32 @@ +set(P3PNMIMAGETYPES_HEADERS + config_pnmimagetypes.h pnmFileTypeBMP.h + pnmFileTypeIMG.h + pnmFileTypePNG.h + pnmFileTypePNM.h + pnmFileTypePfm.h + pnmFileTypeSGI.h pnmFileTypeSoftImage.h + pnmFileTypeTGA.h + pnmFileTypeTIFF.h + pnmFileTypeJPG.h +) + +set(P3PNMIMAGETYPES_SOURCES + config_pnmimagetypes.cxx + pnmFileTypeBMPReader.cxx pnmFileTypeBMPWriter.cxx + pnmFileTypeBMP.cxx + pnmFileTypeIMG.cxx + pnmFileTypeJPG.cxx pnmFileTypeJPGReader.cxx pnmFileTypeJPGWriter.cxx + pnmFileTypePNG.cxx + pnmFileTypePNM.cxx + pnmFileTypePfm.cxx + pnmFileTypeSGI.cxx + pnmFileTypeSGIReader.cxx pnmFileTypeSGIWriter.cxx + pnmFileTypeSoftImage.cxx + pnmFileTypeTIFF.cxx + pnmFileTypeTGA.cxx +) + +composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) +add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) +target_link_libraries(p3pnmimagetypes p3pnmimage) +target_interrogate(p3pnmimagetypes ALL) From a27475b9a6ef995e954b22f9e9b216c3867f348f Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 11:22:18 -0700 Subject: [PATCH 134/744] Add CMakeLists.txt for panda/metalibs/panda --- panda/CMakeLists.txt | 2 +- panda/metalibs/panda/CMakeLists.txt | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 panda/metalibs/panda/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 93d61fdd74..26f0ad576c 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -52,4 +52,4 @@ add_subdirectory(src/framework) #add_subdirectory(src/testbed) # Include panda metalibs -#add_subdirectory(metalibs/panda) +add_subdirectory(metalibs/panda) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt new file mode 100644 index 0000000000..e212a7e60e --- /dev/null +++ b/panda/metalibs/panda/CMakeLists.txt @@ -0,0 +1,12 @@ +set(PANDA_LINK_TARGETS p3pnmimagetypes p3device) + +if(LINK_IN_PHYSX) + add_definitions(-DBUILDING_PANDAPHYSX) + set(PANDA_LINK_TARGETS + ${PANDA_LINK_TARGETS} + p3physx + ) +endif() + +add_library(panda panda.cxx) +target_link_libraries(panda ${PANDA_LINK_TARGETS}) From a0eeccf381b4a2cfb4e58f2a0545dc55f9accf6a Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 11:22:48 -0700 Subject: [PATCH 135/744] Add missing compiler define in CMakeLists for dtool/metalibs/dtoolconfig. --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 22ed64ed6d..a9ed486379 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,3 +1,5 @@ +add_definitions(-DBUILDING_DTOOLCONFIG) + if(HAVE_PYTHON) add_library(p3dtoolconfig dtoolconfig.cxx pydtool.cxx) target_link_libraries(p3dtoolconfig ${PYTHON_LIBRARIES}) From e24f7feb5a8e228431b89b193fdabd40fb536986 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 11:45:19 -0700 Subject: [PATCH 136/744] Add CMakeLists.txt for panda/glstuff and panda/glgsg --- panda/CMakeLists.txt | 4 ++++ panda/src/glgsg/CMakeLists.txt | 15 +++++++++++++ panda/src/glstuff/CMakeLists.txt | 37 ++++++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 panda/src/glgsg/CMakeLists.txt create mode 100644 panda/src/glstuff/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 26f0ad576c..9cd71ea20e 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -29,6 +29,8 @@ add_subdirectory(src/linmath) add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) +add_subdirectory(src/glstuff) +add_subdirectory(src/glgsg) add_subdirectory(src/pnmimage) add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) @@ -53,3 +55,5 @@ add_subdirectory(src/framework) # Include panda metalibs add_subdirectory(metalibs/panda) +#add_subdirectory(metalibs/pandagl) +#add_subdirectory(metalibs/pandaegg) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt new file mode 100644 index 0000000000..1863697573 --- /dev/null +++ b/panda/src/glgsg/CMakeLists.txt @@ -0,0 +1,15 @@ +if(HAVE_GL) + set(P3GLGSG_HEADERS + config_glgsg.h glgsg.h + ) + + set(P3GLGSG_SOURCES + config_glgsg.cxx + glgsg.cxx + ) + + composite_sources(p3glgsg P3GLGSG_SOURCES) + add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) + target_link_libraries(p3glgsg p3glstuff p3display) + target_interrogate(p3glgsg ALL) +endif() \ No newline at end of file diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt new file mode 100644 index 0000000000..23327d6c1f --- /dev/null +++ b/panda/src/glstuff/CMakeLists.txt @@ -0,0 +1,37 @@ +if(HAVE_GL) + set(P3GLSTUFF_HEADERS + glGeomContext_src.I + glGeomContext_src.h + glGeomMunger_src.I + glGeomMunger_src.h + glGraphicsStateGuardian_src.I + glGraphicsStateGuardian_src.h + glGraphicsBuffer_src.I + glGraphicsBuffer_src.h + glImmediateModeSender_src.I + glImmediateModeSender_src.h + glIndexBufferContext_src.I + glIndexBufferContext_src.h + glOcclusionQueryContext_src.I + glOcclusionQueryContext_src.h + glShaderContext_src.I + glShaderContext_src.h + glTextureContext_src.I + glTextureContext_src.h + glVertexBufferContext_src.I + glVertexBufferContext_src.h + glmisc_src.h + glstuff_src.h + glstuff_undef_src.h + panda_glext.h + ) + + set(P3GLSTUFF_SOURCES + glpure.cxx + ) + + composite_sources(p3glstuff P3GLSTUFF_SOURCES) + add_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) + target_link_libraries(p3glstuff p3pandabase) + target_interrogate(p3glstuff ALL) +endif() \ No newline at end of file From 7323dbc566158f3d0ee69a88e22880e2c4b3a442 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 11:45:35 -0700 Subject: [PATCH 137/744] Add missing compiler define in CMakeLists for panda/metalibs/panda --- panda/metalibs/panda/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index e212a7e60e..cd62d585c8 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,3 +1,4 @@ +add_definitions(-DBUILDING_PANDA) set(PANDA_LINK_TARGETS p3pnmimagetypes p3device) if(LINK_IN_PHYSX) From 77060a4fb8c16b60e1ed60e991aceca82d3abd58 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 12:52:37 -0700 Subject: [PATCH 138/744] Add CMakeLists for panda/metakubs/pandagl. Not yet built. --- panda/metalibs/pandagl/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 panda/metalibs/pandagl/CMakeLists.txt diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt new file mode 100644 index 0000000000..ecc86d95cd --- /dev/null +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -0,0 +1,7 @@ +if(HAVE_GL) + add_definitions(-DBUILDING_PANDAGL) + set(PANDAGL_LINK_TARGETS p3glgsg) + + add_library(pandagl pandagl.cxx) + target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) +endif() From 0ceb237c9c7c028fcb92c6c5a5c933713d329500 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 26 Jan 2014 14:38:44 -0700 Subject: [PATCH 139/744] Remove bin2c-converted files from CMake sources. These use static variables, and are only meant for include. --- panda/src/framework/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 2148fba29c..93f301a445 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -8,7 +8,6 @@ set(P3FRAMEWORK_SOURCES config_framework.cxx pandaFramework.cxx windowFramework.cxx - rock_floor.rgb_src.c shuttle_controls.bam_src.c ) From 0f89ef1e7bdce9f2f5290e8f3f0e2970984ae09b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 26 Jan 2014 18:06:37 -0700 Subject: [PATCH 140/744] In CMake, link a few libraries against other libraries that they depend on. --- dtool/src/prc/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 2 +- panda/src/pnmtext/CMakeLists.txt | 2 +- panda/src/text/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 64c9c8168a..e3fc7afac3 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -65,4 +65,4 @@ set(P3PRC_SOURCES composite_sources(p3prc P3PRC_SOURCES) add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) -target_link_libraries(p3prc p3dtoolutil p3dtoolbase) +target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${OPENSSL_LIBRARIES}) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 5c6e587628..34dbb3216d 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -143,7 +143,7 @@ set(P3GOBJ_SOURCES composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -target_link_libraries(p3gobj p3gsgbase p3pnmimage) +target_link_libraries(p3gobj p3gsgbase p3pnmimage ${ZLIB_LIBRARIES}) target_interrogate(p3gobj ALL) #begin test_bin_target diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 999b43b2b2..73e2e67a96 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -15,5 +15,5 @@ set(P3PNMTEXT_SOURCES composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) -target_link_libraries(p3pnmtext p3pnmimage) +target_link_libraries(p3pnmtext p3pnmimage ${FREETYPE_LIBRARIES}) target_interrogate(p3pnmtext ALL) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 16762eb088..cc6e5d1fcb 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -34,5 +34,5 @@ set(P3TEXT_SOURCES composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) -target_link_libraries(p3text p3pnmtext p3parametrics) +target_link_libraries(p3text p3pnmtext p3parametrics ${FREETYPE_LIBRARIES}) target_interrogate(p3text ALL) From 5b791ca358c254caa2bc4e75974d9b3f7907db4c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 26 Jan 2014 18:46:38 -0700 Subject: [PATCH 141/744] Get pandagl building under Linux on CMake. --- panda/CMakeLists.txt | 4 +++- panda/metalibs/pandagl/CMakeLists.txt | 5 +++++ panda/src/glgsg/CMakeLists.txt | 4 ++-- panda/src/glxdisplay/CMakeLists.txt | 27 +++++++++++++++++++++++++++ panda/src/x11display/CMakeLists.txt | 15 +++++++++++++++ 5 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 panda/src/glxdisplay/CMakeLists.txt create mode 100644 panda/src/x11display/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 9cd71ea20e..6614096da1 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -31,6 +31,8 @@ add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/glstuff) add_subdirectory(src/glgsg) +add_subdirectory(src/glxdisplay) +add_subdirectory(src/x11display) add_subdirectory(src/pnmimage) add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) @@ -55,5 +57,5 @@ add_subdirectory(src/framework) # Include panda metalibs add_subdirectory(metalibs/panda) -#add_subdirectory(metalibs/pandagl) +add_subdirectory(metalibs/pandagl) #add_subdirectory(metalibs/pandaegg) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index ecc86d95cd..9d321ef16f 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -2,6 +2,11 @@ if(HAVE_GL) add_definitions(-DBUILDING_PANDAGL) set(PANDAGL_LINK_TARGETS p3glgsg) + if(HAVE_GLX) + set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3glxdisplay) + endif() + + add_library(pandagl pandagl.cxx) target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) endif() diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 1863697573..c7519749aa 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -10,6 +10,6 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) - target_link_libraries(p3glgsg p3glstuff p3display) + target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES}) target_interrogate(p3glgsg ALL) -endif() \ No newline at end of file +endif() diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt new file mode 100644 index 0000000000..079c6baa1d --- /dev/null +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -0,0 +1,27 @@ +if(HAVE_GLX) + set(P3GLXDISPLAY_HEADERS + config_glxdisplay.h + glxGraphicsBuffer.h glxGraphicsBuffer.I + glxGraphicsPipe.h glxGraphicsPipe.I + glxGraphicsPixmap.h glxGraphicsPixmap.I + glxGraphicsWindow.h + glxGraphicsStateGuardian.h glxGraphicsStateGuardian.I + posixGraphicsStateGuardian.h posixGraphicsStateGuardian.I + panda_glxext.h + ) + + set(P3GLXDISPLAY_SOURCES + config_glxdisplay.cxx + glxGraphicsBuffer.cxx + glxGraphicsPipe.cxx + glxGraphicsPixmap.cxx + glxGraphicsWindow.cxx + glxGraphicsStateGuardian.cxx + posixGraphicsStateGuardian.cxx + ) + + composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) + add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) + target_link_libraries(p3glxdisplay p3glgsg p3x11display) + target_interrogate(p3glxdisplay ALL) +endif() diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt new file mode 100644 index 0000000000..849bef5e42 --- /dev/null +++ b/panda/src/x11display/CMakeLists.txt @@ -0,0 +1,15 @@ +if(HAVE_X11) + set(P3X11DISPLAY_HEADERS + config_x11display.h x11GraphicsPipe.I x11GraphicsPipe.h + x11GraphicsWindow.h x11GraphicsWindow.I + ) + + set(P3X11DISPLAY_SOURCES + config_x11display.cxx x11GraphicsPipe.cxx x11GraphicsWindow.cxx + ) + + composite_sources(p3x11display P3X11DISPLAY_SOURCES) + add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) + target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) + target_interrogate(p3x11display ALL) +endif() From 4a2ee83df96097144f2b04fa53e7797ab5c443f2 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 21:33:49 -0700 Subject: [PATCH 142/744] Rearrange Config.cmake and cotninue porting Config.pp --- dtool/Config.cmake | 400 +++++++++++++++++++++++--------------- dtool/Package.cmake | 13 -- dtool/PackageMacros.cmake | 0 3 files changed, 244 insertions(+), 169 deletions(-) delete mode 100644 dtool/PackageMacros.cmake diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a2ae2c0f55..9912c56142 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -195,6 +195,7 @@ mark_as_advanced(DEFAULT_PRC_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS # remaining variables are of general interest to everyone. # + option(HAVE_P3D_PLUGIN "You may define this to build or develop the plugin." OFF) @@ -210,6 +211,8 @@ endif() mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST) + + # The following options relate to interrogate, the tool that is # used to generate bindings for non-C++ languages. @@ -263,83 +266,6 @@ if(NOT CMAKE_CROSSCOMPILING) mark_as_advanced(INTERROGATE INTERROGATE_MODULE) endif() -# -# Now let's check for the presence of various thirdparty libraries. -# - -find_package(Eigen3) - -package_option(EIGEN - "Enables experimental support for the Eigen linear algebra library. -If this is provided, Panda will use this library as the fundamental -implementation of its own linmath library; otherwise, it will use -its own internal implementation. The primary advantage of using -Eigen is SSE2 support, which is only activated if LINMATH_ALIGN -is also enabled.") - -#option(USE_EIGEN -# "Enables experimental support for the Eigen linear algebra library. -#If this is provided, Panda will use this library as the fundamental -#implementation of its own linmath library; otherwise, it will use -#its own internal implementation. The primary advantage of using -#Eigen is SSE2 support, which is only activated if LINMATH_ALIGN -#is also enabled." ON) - -option(LINMATH_ALIGN - "This is required for activating SSE2 support using Eigen. -Activating this does constrain most objects in Panda to 16-byte -alignment, which could impact memory usage on very-low-memory -platforms. Currently experimental." ON) - -#if(USE_EIGEN) -# find_package(Eigen3) -# if(EIGEN3_FOUND) -# set(HAVE_EIGEN3 TRUE) -# endif() -#endif() - -find_package(PythonLibs) -find_package(PythonInterp) -set(PYTHON_FOUND ${PYTHONLIBS_FOUND}) - -package_option(PYTHON DEFAULT ON - "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE -is also enabled, Python bindings will be generated.") - -# Always include Python, because we include it pretty much everywhere -# though we don't usually want to link it in as well. -include_directories(${PYTHON_INCLUDE_DIRS}) - -#option(USE_PYTHON -# "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE -#is also enabled, Python bindings will be generated." ON) - -#if(USE_PYTHON) -# find_package(PythonLibs) -# find_package(PythonInterp) -# if(PYTHONLIBS_FOUND) -# set(HAVE_PYTHON TRUE) -# include_directories("${PYTHON_INCLUDE_DIR}") -# endif() -#endif() - -# By default, we'll assume the user only wants to run with Debug -# python if he has to--that is, on Windows when building a debug build. -if(WIN32 AND DO_DEBUG) - set(USE_DEBUG_PYTHON ON) -else() - set(USE_DEBUG_PYTHON OFF) -endif() - -set(GENPYCODE_LIBS "libpandaexpress;libpanda;libpandaphysics;libp3direct;libpandafx;libp3vision;libpandaode;libp3vrpn" CACHE STRING - "Define the default set of libraries to be instrumented by -genPyCode. You may wish to add to this list to add your own -libraries, or if you want to use some of the more obscure -interfaces like libpandaegg and libpandafx.") - -mark_as_advanced(GENPYCODE_LIBS) - -#TODO INSTALL_PYTHON_SOURCE? # # The following options have to do with the memory allocation system @@ -401,6 +327,220 @@ mark_as_advanced(DO_MEMORY_USAGE SIMULATE_NETWORK_DELAY SUPPORT_IMMEDIATE_MODE USE_MEMORY_DLMALLOC USE_MEMORY_PTMALLOC2 MEMORY_HOOK_DO_ALIGN ALTERNATIVE_MALLOC USE_DELETED_CHAIN) + +# +# This section relates to mobile-device/phone support and options +# + +# iPhone support +set(BUILD_IPHONE "" CACHE STRING + "Panda contains some experimental code to compile for IPhone. This +requires the Apple IPhone SDK, which is currently only available +for OS X platforms. Set this to either 'iPhoneSimulator' or +'iPhoneOS'. Note that this is still *experimental* and incomplete! +Don't enable this unless you know what you're doing!") +set_property(CACHE BUILD_IPHONE PROPERTY STRINGS iPhoneSimulator iPhoneOS) + + +# Android support +option(BUILD_ANDROID + "Panda contains some experimental code to compile for Android. +This requires the Google Android NDK. Besides BUILD_ANDROID, you'll +also have to set ANDROID_NDK_HOME." OFF) + +set(ANDROID_NDK_HOME "" CACHE STRING + "The location of the Android NDK directory. ANDROID_NDK_HOME may +not contain any spaces.") + +set(ANDROID_ABI "armeabi" CACHE STRING + "Can be be set to armeabi, armeabi-v7a, x86, or mips, +depending on which architecture should be targeted.") +set_property(CACHE ANDROID_ABI PROPERTY STRINGS + armeabi armeabi-v7a x86 mips) + +set(ANDROID_STL "gnustl_shared" CACHE STRING) +set(ANDROID_PLATFORM "android-9" CACHE STRING) +set(ANDROID_ARCH "arm" CACHE STRING) +if(ANDROID_ARCH STREQUAL "arm") + set(ANDROID_TOOLCHAIN "arm-linux-androideabi") +else() + set(ANDROID_TOOLCHAIN "") +endif() + +mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL + ANDROID_PLATFORM ANDROID_ARCH) + + +# +# Now let's check for the presence of various thirdparty libraries. +# + +# Is Eigen installed, and should Eigen replace internal linmath? +find_package(Eigen3) + +package_option(EIGEN + "Enables experimental support for the Eigen linear algebra library. +If this is provided, Panda will use this library as the fundamental +implementation of its own linmath library; otherwise, it will use +its own internal implementation. The primary advantage of using +Eigen is SSE2 support, which is only activated if LINMATH_ALIGN +is also enabled.") + +option(LINMATH_ALIGN + "This is required for activating SSE2 support using Eigen. +Activating this does constrain most objects in Panda to 16-byte +alignment, which could impact memory usage on very-low-memory +platforms. Currently experimental." ON) + + +# Is Python installed, and should Python interfaces be generated? +find_package(PythonLibs) +find_package(PythonInterp) +set(PYTHON_FOUND ${PYTHONLIBS_FOUND}) + +package_option(PYTHON DEFAULT ON + "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE +is also enabled, Python bindings will be generated.") + +# Always include Python, because we include it pretty much everywhere +# though we don't usually want to link it in as well. +include_directories(${PYTHON_INCLUDE_DIRS}) + +# By default, we'll assume the user only wants to run with Debug +# python if he has to--that is, on Windows when building a debug build. +if(WIN32 AND DO_DEBUG) + set(USE_DEBUG_PYTHON ON) +else() + set(USE_DEBUG_PYTHON OFF) +endif() + +set(GENPYCODE_LIBS + "libpandaexpress;libpanda;libpandaphysics;libp3direct;libpandafx;libp3vision;libpandaode;libp3vrpn" + CACHE STRING + "Define the default set of libraries to be instrumented by +genPyCode. You may wish to add to this list to add your own +libraries, or if you want to use some of the more obscure +interfaces like libpandaegg and libpandafx.") + +mark_as_advanced(GENPYCODE_LIBS) + +option(INSTALL_PYTHON_SOURCE + "Normally, Python source files are copied into the CMake library +install directory, along with the compiled C++ library objects, when +you make install. If you prefer not to copy these Python source +files, but would rather run them directly out of the source +directory (presumably so you can develop them and make changes +without having to reinstall), comment out this definition and put +your source directory on your PYTHONPATH.) + + +# Is OpenSSL installed, and where? +find_package(OpenSSL COMPONENTS ssl crypto) + +package_option(OPENSSL DEFAULT ON + "Enable OpenSSL support") + +option(REPORT_OPENSSL_ERRORS + "Define this true to include the OpenSSL code to report verbose +error messages when they occur." ${DO_DEBUG}) + + +# Is libjpeg installed, and where? +find_package(JPEG) + +package_option(JPEG DEFAULT ON + "Enable support for loading .jpg images.") + +# Some versions of libjpeg did not provide jpegint.h. Redefine this +# to false if you lack this header file. +#set(PHAVE_JPEGINT_H TRUE) + +option(HAVE_VIDEO4LINUX + "Set this to enable webcam support on Linux." ${IS_LINUX}) + + +# Is libpng installed, and where? +find_package(PNG) + +package_option(PNG DEFAULT ON + "Enable support for loading .png images.") + + +# Is libtiff installed, and where? +find_package(TIFF) + +package_option(TIFF + "Enable support for loading .tif images.") + + +# Is libtar installed, and where? +find_package(Tar) + +package_option(TAR + "This is used to optimize patch generation against tar files.") + + +# TODO: FFTW2 +# Is libfftw installed, and where? +#find_package(FFTW2) + +#package_option(FFTW +# "This enables support for lossless compression of animations in +#.bam files. This is rarely used, and you probably don't need it.") + +#TODO PHAVE_DRFFTW_H + + +# Is libsquish installed, and where? +find_package(Squish) + +package_option(SQUISH + "Enables support for automatic compression of DXT textures.") + + +# Is Cg installed, and where? +find_package(Cg QUIET) +package_option(CG "Enable support for Nvidia Cg Shading Language") +package_option(CGGL "Enable support for Nvidia Cg's OpenGL API.") +package_option(CGDX8 "Enable support for Nvidia Cg's DX8 API.") +package_option(CGDX9 "Enable support for Nvidia Cg's DX9 API.") +package_option(CGDX10 "Enable support for Nvidia Cg's DX10 API.") + + +# Is VRPN installed, and where? +find_package(VRPN) + +package_option(VRPN + "Enables support for connecting to VRPN servers.") + + +# TODO: Helix +# Is HELIX installed, and where? +#find_package(Helix) + +#package_option(HELIX +# "Enables support for Helix media playback.") + + +# Is ZLIB installed, and where? +find_package(ZLIB) + +package_option(ZLIB DEFAULT ON + "Enables support for compression of Panda assets.") + +# +# <<<<<< Insert the rest of the Config.pp +# port of third-party libs here <<<<<<< +# + + + + + +# +# Miscellaneous settings +# + option(HAVE_WIN_TOUCHINPUT "Define this if you are building on Windows 7 or better, and you want your Panda build to run only on Windows 7 or better, and you @@ -421,95 +561,43 @@ option(HAVE_EGG avoid building this, unless you really want to make a low-footprint build (such as, for instance, for the iPhone)." ON) -# Is OpenSSL installed, and where? -find_package(OpenSSL COMPONENTS ssl crypto) +# These image formats don't require the assistance of a third-party +# library to read and write, so there's normally no reason to disable +# them int he build, unless you are looking to reduce the memory footprint. +if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") + set(BUILD_TYPE_USE_IMAGES OFF) +else() + set(BUILD_TYPE_USE_IMAGES ON) +endif() -package_option(OPENSSL DEFAULT ON - "Enable OpenSSL support") +option(HAVE_SGI_RGB "Enable support for loading SGI RGB images." + ${BUILD_TYPE_USE_IMAGES}) +option(HAVE_TGA "Enable support for loading TGA images." + ${BUILD_TYPE_USE_IMAGES}) +option(HAVE_IMG "Enable support for loading IMG images." + ${BUILD_TYPE_USE_IMAGES}) +option(HAVE_SOFTIMAGE_PIC + "Enable support for loading SOFTIMAGE PIC images." + ${BUILD_TYPE_USE_IMAGES}) +option(HAVE_BMP "Enable support for loading BMP images." + ${BUILD_TYPE_USE_IMAGES}) +option(HAVE_PNM "Enable support for loading PNM images." + ${BUILD_TYPE_USE_IMAGES}) -option(REPORT_OPENSSL_ERRORS - "Define this true to include the OpenSSL code to report verbose -error messages when they occur." ${DO_DEBUG}) - -# Is libjpeg installed, and where? -find_package(JPEG) - -package_option(JPEG DEFAULT ON - "Enable support for loading .jpg images.") - -# Some versions of libjpeg did not provide jpegint.h. Redefine this -# to false if you lack this header file. -#set(PHAVE_JPEGINT_H TRUE) - -option(HAVE_VIDEO4LINUX - "Set this to enable webcam support on Linux." ${IS_LINUX}) - -# Is libpng installed, and where? -find_package(PNG) - -package_option(PNG DEFAULT ON - "Enable support for loading .png images.") - -# Is libtiff installed, and where? -find_package(TIFF) - -package_option(TIFF - "Enable support for loading .tif images.") - -# These image formats don't require the assistance of a -# third-party library to read and write, so there's normally no -# reason to disable them int he build, unless you are looking to -# reduce the memory footprint. - -option(HAVE_SGI_RGB "Enable support for loading SGI RGB images." ON) -option(HAVE_TGA "Enable support for loading TGA images." ON) -option(HAVE_IMG "Enable support for loading IMG images." ON) -option(HAVE_SOFTIMAGE_PIC "Enable support for loading SOFTIMAGE PIC images." ON) -option(HAVE_BMP "Enable support for loading BMP images." ON) -option(HAVE_PNM "Enable support for loading PNM images." ON) +unset(BUILD_TYPE_USE_IMAGES) mark_as_advanced(HAVE_SGI_RGB HAVE_TGA HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM) -# Is libtar installed, and where? -find_package(Tar) - -package_option(TAR - "This is used to optimize patch generation against tar files.") - -# Is libfftw installed, and where? -#find_package(FFTW2) - -#package_option(FFTW -# "This enables support for lossless compression of animations in -#.bam files. This is rarely used, and you probably don't need it.") - -#TODO PHAVE_DRFFTW_H - -# Is libsquish installed, and where? -find_package(Squish) - -package_option(SQUISH - "Enables support for automatic compression of DXT textures.") - -#TODO: Cg HERE! - -# Is VRPN installed, and where? -find_package(VRPN) - -package_option(VRPN - "Enables support for connecting to VRPN servers.") - -# Is ZLIB installed, and where? -find_package(ZLIB) - -package_option(ZLIB DEFAULT ON - "Enables support for compression of Panda assets.") # -# < Insert the rest of the Config.pp port here < +# <<<<< Insert the rest of the Config.pp +# port of miscellaneous settings here <<<<< # + + + # How to invoke bison and flex. Panda takes advantage of some # bison/flex features, and therefore specifically requires bison and # flex, not some other versions of yacc and lex. However, you only diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 4bfbcf5f13..951f9020aa 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,19 +1,6 @@ message(STATUS "") message(STATUS "Configuring support for the following optional third-party packages:") -# Find and configure Cg library -find_package(Cg QUIET) -#config_package(CG "Nvidia Cg Shading Langauge") -#config_package(CGGL "Cg OpenGL API") -#config_package(CGDX8 "Cg DX8 API") -#config_package(CGDX9 "Cg DX9 API") -#config_package(CGDX10 "Cg DX10 API") -package_option(CG) -package_option(CGGL) -package_option(CGDX8) -package_option(CGDX9) -package_option(CGDX10) - # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") diff --git a/dtool/PackageMacros.cmake b/dtool/PackageMacros.cmake deleted file mode 100644 index e69de29bb2..0000000000 From f1e218d2672f86ae63ba1c7b4f03b49282b46122 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 26 Jan 2014 21:45:44 -0700 Subject: [PATCH 143/744] Get p3pnmimagetypes to build (and link to p3framework) under CMake. --- panda/src/framework/CMakeLists.txt | 2 +- panda/src/pnmimagetypes/CMakeLists.txt | 24 +++++++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 93f301a445..38e79dbd32 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -11,7 +11,7 @@ set(P3FRAMEWORK_SOURCES ) -set(P3FRAMEWORK_LINK_TARGETS p3char p3pgui p3recorder p3collide) #p3recorder p3collide p3pnmimagetypes +set(P3FRAMEWORK_LINK_TARGETS p3char p3pgui p3recorder p3collide p3pnmimagetypes) if(LINK_ALL_STATIC) # If we're statically linking, we need to explicitly link with # at least one of the available renderers. diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index a8d21dc84e..367531eff1 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -26,7 +26,29 @@ set(P3PNMIMAGETYPES_SOURCES pnmFileTypeTGA.cxx ) +# We aggregate the PNMIMAGETYPES libraries depending on which image formats are +# compiled in. +unset(PNMIMAGETYPES_LINK_LIBRARIES) + +if(HAVE_JPEG) + set(PNMIMAGETYPES_LINK_LIBRARIES + ${PNMIMAGETYPES_LINK_LIBRARIES} + ${JPEG_LIBRARIES}) +endif() + +if(HAVE_TIFF) + set(PNMIMAGETYPES_LINK_LIBRARIES + ${PNMIMAGETYPES_LINK_LIBRARIES} + ${TIFF_LIBRARIES}) +endif() + +if(HAVE_PNG) + set(PNMIMAGETYPES_LINK_LIBRARIES + ${PNMIMAGETYPES_LINK_LIBRARIES} + ${PNG_LIBRARIES}) +endif() + composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -target_link_libraries(p3pnmimagetypes p3pnmimage) +target_link_libraries(p3pnmimagetypes p3pnmimage ${PNMIMAGETYPES_LINK_LIBRARIES}) target_interrogate(p3pnmimagetypes ALL) From 826b98f727dbc9a7015afbbfd69ae1bb27a393c4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 26 Jan 2014 21:52:18 -0700 Subject: [PATCH 144/744] Uncomment src/testbed in panda CMakeLists, to enable building pview. --- panda/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6614096da1..dfe39c0141 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -53,7 +53,7 @@ add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) add_subdirectory(src/framework) -#add_subdirectory(src/testbed) +add_subdirectory(src/testbed) # Include panda metalibs add_subdirectory(metalibs/panda) From d1c5c2098368583db09581506a2a639e9365ae80 Mon Sep 17 00:00:00 2001 From: kestred Date: Sun, 26 Jan 2014 22:21:00 -0700 Subject: [PATCH 145/744] Continue Config.pp port and cleanup build-type conditional defaults. --- dtool/Config.cmake | 199 ++++++++++++++++++++++++++++++++++++++------ dtool/Package.cmake | 23 ----- 2 files changed, 173 insertions(+), 49 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 9912c56142..96c58dfc0d 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -40,13 +40,29 @@ else() set(DEFAULT_PATHSEP ":") endif() -#TODO figure out what to do about release/debug vs OPTIMIZE level. +# TODO: Figure out what to do about release/debug vs OPTIMIZE level. if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "") set(DO_DEBUG ON) else() set(DO_DEBUG OFF) endif() +# Provide convenient boolean expression based on build type +if(CMAKE_BUILD_TYPE MATCHES "Debug") + set(IS_DEBUG_BUILD True) + set(IS_NOT_DEBUG_BUILD False) +else() + set(IS_DEBUG_BUILD False) + set(IS_NOT_DEBUG_BUILD True) +endif() + +if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") + set(IS_MINSIZE_BUILD True) + set(IS_NOT_MINSIZE_BUILD False) +else() + set(IS_MINSIZE_BUILD False) + set(IS_NOT_MINSIZE_BUILD True) +endif() # Panda uses prc files for runtime configuration. There are many # compiled-in options to customize the behavior of the prc config @@ -528,6 +544,152 @@ find_package(ZLIB) package_option(ZLIB DEFAULT ON "Enables support for compression of Panda assets.") + +# Is OpenGL installed, and where? +find_package(OpenGL QUIET) +set(GL_FOUND ${OPENGL_FOUND}) +package_option(GL "Enable OpenGL support.") + +# If you are having trouble linking in OpenGL extension functions at +# runtime for some reason, you can set this variable. It also, +# requires you to install the OpenGL header files and compile-time +# libraries appropriate to the version you want to compile against. +set(MIN_GL_VERSION "1 1" CACHE STRING + "The variable is the major, minor version of OpenGL, separated by a +space (instead of a dot). Thus, "1 1" means OpenGL version 1.1. + +This defines the minimum runtime version of OpenGL that Panda will +require. Setting it to a higher version will compile in hard +references to the extension functions provided by that OpenGL +version and below, which may reduce runtime portability to other +systems, but it will avoid issues with getting extension function +pointers.") + +# Is Mesa installed separately from OpenGL? Mesa is an open-source +# software-only OpenGL renderer. Panda can link with it +# independently from OpenGL (and if Mesa is built statically, and/or +# with -DUSE_MGL_NAMESPACE declared to rename gl* to mgl*, it can +# switch between the system OpenGL implementation and the Mesa +# implementation at runtime). + +# Also, Mesa includes some core libraries (in libOSMesa.so) that +# allow totally headless rendering, handy if you want to run a +# renderer as a batch service, and you don't want to insist that a +# user be logged on to the desktop or otherwise deal with X11 or +# Windows. + +# TODO: Mesa +#find_package(Mesa) + +#package_option(MESA +# "When set, will build libmesadisplay, which can be used in lieu of +#libpandagl or libpandadx to do rendering. However, for most +#applications, you don't need to do this, since (a) if you have +#hardware rendering capability, you probably don't want to use Mesa, +#since it's software-only, and (b) if you don't have hardware +#rendering, you can install Mesa as the system's OpenGL +#implementation, so you can just use the normal libpandagl. +#You only need to define HAVE_MESA if you want to run totally headless, +#or if you want to be able to easily switch between Mesa and the +#system OpenGL implementation at runtime. If you compiled Mesa with +#USE_MGL_NAMESPACE defined, define MESA_MGL here.") + +set(MIN_MESA_VERSION "1 1" CACHE STRING + "Similar to MIN_GL_VERSION, above.") + + +# Should build tinydisplay? +option(HAVE_TINYDISPLAY + "Builds TinyDisplay, a light software renderer based on TinyGL, +that is built into Panda. TinyDisplay is not as full-featured as Mesa +but is many times faster." ${IS_NOT_MINSIZE_BUILD}) + + +# TODO: OpenGL ES +# Is OpenGL ES 1.x installed, and where? +#find_package(OpenGLES) + +#package_option(GLES +# "Enable OpenGL ES 1.x support, a minimal subset of +#OpenGL for mobile devices.") + +# Is OpenGL ES 2.x installed, and where? +#find_package(OpenGLES) + +#package_option(GLES2 +# "Enable OpenGL ES 2.x support, a version of OpenGL ES but without +#fixed-function pipeline - everything is programmable there.") + +# Is EGL installed, and where? +#package_option(EGL +# "Enable EGL support. EGL is like GLX, but for OpenGL ES.") + + +# Is SDL installed, and where? +set(Threads_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +set(Eigen3_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +set(PythonLibs_FIND_QUIETLY TRUE) # Fix for builtin FindSDL +set(PythonInterp_FIND_QUIETLY TRUE) # Fix for builtin FindSDL + +find_package(SDL QUIET) + +package_option(SDL + "The SDL library is useful only for tinydisplay, and is not even +required for that, as tinydisplay is also supported natively on +each supported platform.") + +# Cleanup after builtin FindSDL +mark_as_advanced(SDLMAIN_LIBRARY) +mark_as_advanced(SDL_INCLUDE_DIR) +mark_as_advanced(SDL_LIBRARY) +mark_as_advanced(SDL_LIBRARY_TEMP) + + +# TODO: XF86DGA +# This defines if we have XF86DGA installed. +#find_package(XF86DGA QUIET) + +#package_option(XF86DGA +# "This enables smooth FPS-style mouse in x11display, +#when mouse mode M_relative is used.") + + +# TODO: XRANDR +#find_package(Xrandr QUIET) +#package_option(XRANDR +# "This enables resolution switching in x11display.") + + +# TODO: XCURSOR +#find_package(Xcursor QUIET) +#package_option(XCURSOR +# "This enables custom cursor support in x11display.") + +if(HAVE_GL AND HAVE_X11) + option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." ON) +else() + option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." OFF) +endif() + +option(LINK_IN_GLXGETPROCADDRESS + "Define this to compile in a reference to the glXGetProcAddress(). +This is only relevant from platforms using OpenGL under X." + OFF) + +if(WIN32 AND HAVE_GL) + option(HAVE_WGL "Enable WGL. Requires OpenGL on Windows." ON) +else() + option(HAVE_WGL "Enable WGL. Requires OpenGL on Windows." OFF) +endif() + +if(IS_OSX) + option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." ON) + option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." ON) +else() + option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." OFF) + option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." OFF) +endif() + # # <<<<<< Insert the rest of the Config.pp # port of third-party libs here <<<<<<< @@ -564,27 +726,19 @@ build (such as, for instance, for the iPhone)." ON) # These image formats don't require the assistance of a third-party # library to read and write, so there's normally no reason to disable # them int he build, unless you are looking to reduce the memory footprint. -if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") - set(BUILD_TYPE_USE_IMAGES OFF) -else() - set(BUILD_TYPE_USE_IMAGES ON) -endif() - option(HAVE_SGI_RGB "Enable support for loading SGI RGB images." - ${BUILD_TYPE_USE_IMAGES}) + ${IS_NOT_MINSIZE_BUILD}) option(HAVE_TGA "Enable support for loading TGA images." - ${BUILD_TYPE_USE_IMAGES}) + ${IS_NOT_MINSIZE_BUILD}) option(HAVE_IMG "Enable support for loading IMG images." - ${BUILD_TYPE_USE_IMAGES}) + ${IS_NOT_MINSIZE_BUILD}) option(HAVE_SOFTIMAGE_PIC "Enable support for loading SOFTIMAGE PIC images." - ${BUILD_TYPE_USE_IMAGES}) + ${IS_NOT_MINSIZE_BUILD}) option(HAVE_BMP "Enable support for loading BMP images." - ${BUILD_TYPE_USE_IMAGES}) + ${IS_NOT_MINSIZE_BUILD}) option(HAVE_PNM "Enable support for loading PNM images." - ${BUILD_TYPE_USE_IMAGES}) - -unset(BUILD_TYPE_USE_IMAGES) + ${IS_NOT_MINSIZE_BUILD}) mark_as_advanced(HAVE_SGI_RGB HAVE_TGA HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM) @@ -698,18 +852,11 @@ message(STATUS "") message(STATUS "See dtool_config.h for more details about the specified configuration.\n") ### Miscellaneous configuration -if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") - unset(COMPILE_IN_DEFAULT_FONT CACHE) - option(COMPILE_IN_DEFAULT_FONT - "If on, compiles in a default font, so that every TextNode will always +option(COMPILE_IN_DEFAULT_FONT + "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. -When turned off, the generated library will save a few kilobytes." OFF) -else() - option(COMPILE_IN_DEFAULT_FONT - "If on, compiles in a default font, so that every TextNode will always -have a font available without requiring the user to specify one. -When turned off, the generated library will save a few kilobytes." ON) -endif() +When turned off, the generated library will save a few kilobytes." + ${IS_NOT_MINSIZE_BUILD}) option(STDFLOAT_DOUBLE "Define this true to compile a special version of Panda to use a diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 951f9020aa..57794458b2 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -16,11 +16,6 @@ find_package(OpenAL QUIET) #config_package(OPENAL "OpenAL sound library") package_option(OPENAL) -# Find and configure OpenGL -find_package(OpenGL QUIET) -set(GL_FOUND ${OPENGL_FOUND}) -#config_package(GL "OpenGL") -package_option(GL) # Find and configure Freetype find_package(Freetype QUIET) @@ -63,20 +58,6 @@ package_option(FLTK) mark_as_advanced(FLTK_DIR) mark_as_advanced(FLTK_MATH_LIBRARY) -# Find and configure SDL -set(Threads_FIND_QUIETLY TRUE) # Fix for builtin FindSDL -set(Eigen3_FIND_QUIETLY TRUE) # Fix for builtin FindSDL -set(PythonLibs_FIND_QUIETLY TRUE) # Fix for builtin FindSDL -set(PythonInterp_FIND_QUIETLY TRUE) # Fix for builtin FindSDL -find_package(SDL QUIET) -#config_package(SDL) -package_option(SDL) - -# Cleanup after builtin FindSDL -mark_as_advanced(SDLMAIN_LIBRARY) -mark_as_advanced(SDL_INCLUDE_DIR) -mark_as_advanced(SDL_LIBRARY) -mark_as_advanced(SDL_LIBRARY_TEMP) ######## # TODO # @@ -110,10 +91,6 @@ mark_as_advanced(SDL_LIBRARY_TEMP) #find_package(DX11) #config_package(DX11 COMMENT "DirectX11") -# Find and configure Tinydisplay -#find_package(Tinydisplay) -#config_package(TINYDISPLAY COMMENT "Tinydisplay") - # Find and configure Mesa #find_package(Mesa) #config_package(MESA COMMENT "Mesa") From 456967069e14b63d3bdd87709d24e8a08196f794 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 10:09:07 -0700 Subject: [PATCH 146/744] Fix syntax problems in Config.cmake. --- dtool/Config.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 96c58dfc0d..4fc5e17b38 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -374,9 +374,9 @@ depending on which architecture should be targeted.") set_property(CACHE ANDROID_ABI PROPERTY STRINGS armeabi armeabi-v7a x86 mips) -set(ANDROID_STL "gnustl_shared" CACHE STRING) -set(ANDROID_PLATFORM "android-9" CACHE STRING) -set(ANDROID_ARCH "arm" CACHE STRING) +set(ANDROID_STL "gnustl_shared" CACHE STRING "") +set(ANDROID_PLATFORM "android-9" CACHE STRING "") +set(ANDROID_ARCH "arm" CACHE STRING "") if(ANDROID_ARCH STREQUAL "arm") set(ANDROID_TOOLCHAIN "arm-linux-androideabi") else() @@ -447,7 +447,7 @@ you make install. If you prefer not to copy these Python source files, but would rather run them directly out of the source directory (presumably so you can develop them and make changes without having to reinstall), comment out this definition and put -your source directory on your PYTHONPATH.) +your source directory on your PYTHONPATH.") # Is OpenSSL installed, and where? From bdbd2d5b135025e856b19ffaab8890395e74489e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 10:10:19 -0700 Subject: [PATCH 147/744] Fix ifdef/elif/elif chain to use if defined(...)/elif defined(...)/... --- panda/src/framework/pandaFramework.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/framework/pandaFramework.cxx b/panda/src/framework/pandaFramework.cxx index 5893f37b26..9225931e8b 100644 --- a/panda/src/framework/pandaFramework.cxx +++ b/panda/src/framework/pandaFramework.cxx @@ -92,16 +92,16 @@ open_framework(int &argc, char **&argv) { #ifdef LINK_ALL_STATIC // If we're statically linking, we need to explicitly link with // at least one of the available renderers. - #ifdef HAVE_GL + #if defined(HAVE_GL) extern EXPCL_PANDAGL void init_libpandagl(); init_libpandagl(); - #elif HAVE_DX9 + #elif defined(HAVE_DX9) extern EXPCL_PANDADX9 void init_libpandadx9(); init_libpandadx9(); - #elif HAVE_DX8 + #elif defined(HAVE_DX8) extern EXPCL_PANDADX8 void init_libpandadx8(); init_libpandadx8(); - #elif HAVE_TINYDISPLAY + #elif defined(HAVE_TINYDISPLAY) extern EXPCL_TINYDISPLAY void init_libtinydisplay(); init_libtinydisplay(); #endif From 84aad872eca6ded1d07ad9191ef067290735bb64 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 10:10:27 -0700 Subject: [PATCH 148/744] Define add_flex_target CMake macro. --- CMakeLists.txt | 1 + cmake/macros/AddFlexTarget.cmake | 73 ++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 cmake/macros/AddFlexTarget.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index b85a3ef6bf..c1d33035dd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") # Include global modules include(AutoInclude) # Implements automatic include_directories finding include(AddBisonTarget) # Defines add_bison_target function +include(AddFlexTarget) # Defines add_flex_target function include(CompositeSources) # Defines composite_sources function include(PackageConfig) # Defines package_option AND target_use_packages include(Interrogate) # Defines target_interrogate AND add_python_module diff --git a/cmake/macros/AddFlexTarget.cmake b/cmake/macros/AddFlexTarget.cmake new file mode 100644 index 0000000000..6f47fb8ab9 --- /dev/null +++ b/cmake/macros/AddFlexTarget.cmake @@ -0,0 +1,73 @@ +# Filename: AddFlexTarget.cmake +# Description: This file defines the function add_flex_target which instructs +# cmake to use flex on an input .lxx file. If flex is not available on +# the system, add_flex_target tries to use .prebuilt .cxx files instead. +# +# Usage: +# add_flex_target(output_cxx input_lxx [DEFINES output_h] [PREFIX prefix]) +# + +# Define add_flex_target() +function(add_flex_target output_cxx input_lxx) + set(arguments "") + set(outputs "${output_cxx}") + set(keyword "") + + # Parse the extra arguments to the function. + foreach(arg ${ARGN}) + if(arg STREQUAL "DEFINES") + set(keyword "DEFINES") + elseif(arg STREQUAL "PREFIX") + set(keyword "PREFIX") + + elseif(keyword STREQUAL "PREFIX") + set(arguments ${arguments} -P "${arg}") + elseif(keyword STREQUAL "DEFINES") + set(arguments ${arguments} --header-file="${arg}") + list(APPEND outputs "${arg}") + + else() + message(SEND_ERROR "Unexpected argument ${arg} to add_flex_target") + endif() + endforeach() + + if(keyword STREQUAL arg AND NOT keyword STREQUAL "") + message(SEND_ERROR "Expected argument after ${keyword}") + endif() + + if(HAVE_FLEX) + get_source_file_property(input_lxx "${input_lxx}" LOCATION) + + # If we have flex, we can of course just run it. + add_custom_command( + OUTPUT ${outputs} + COMMAND ${FLEX_EXECUTABLE} + -o "${output_cxx}" ${arguments} + "${input_lxx}" + MAIN_DEPENDENCY "${input_lxx}" + ) + + else() + # Look for prebuilt versions of the outputs. + set(commands "") + set(depends "") + + foreach(output ${outputs}) + set(prebuilt_file "${output}.prebuilt") + get_filename_component(prebuilt_file "${prebuilt_file}" ABSOLUTE) + + if(NOT EXISTS "${prebuilt_file}") + message(SEND_ERROR "Flex was not found and ${prebuilt_file} does not exist!") + endif() + + list(APPEND depends "${prebuilt_file}") + set(commands ${commands} COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) + endforeach() + + add_custom_command( + OUTPUT ${outputs} + ${commands} + DEPENDS ${depends} + ) + endif() +endfunction(add_flex_target) From ed08fd1902535f079ef56bea2f35a35e150f9d55 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 10:11:33 -0700 Subject: [PATCH 149/744] Get pandaegg to build under CMake. --- panda/CMakeLists.txt | 4 +- panda/metalibs/pandaegg/CMakeLists.txt | 6 ++ panda/src/egg/CMakeLists.txt | 97 ++++++++++++++++++++++++++ panda/src/egg2pg/CMakeLists.txt | 36 ++++++++++ 4 files changed, 142 insertions(+), 1 deletion(-) create mode 100644 panda/metalibs/pandaegg/CMakeLists.txt create mode 100644 panda/src/egg/CMakeLists.txt create mode 100644 panda/src/egg2pg/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index dfe39c0141..2b91951da3 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -27,6 +27,8 @@ add_subdirectory(src/putil) add_subdirectory(src/pstatclient) add_subdirectory(src/linmath) add_subdirectory(src/event) +add_subdirectory(src/egg) +add_subdirectory(src/egg2pg) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/glstuff) @@ -58,4 +60,4 @@ add_subdirectory(src/testbed) # Include panda metalibs add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandagl) -#add_subdirectory(metalibs/pandaegg) +add_subdirectory(metalibs/pandaegg) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt new file mode 100644 index 0000000000..3d17cbfd10 --- /dev/null +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -0,0 +1,6 @@ +if(HAVE_EGG) + set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) + + add_library(pandaegg pandaegg.cxx) + target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) +endif() diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt new file mode 100644 index 0000000000..774a33c33e --- /dev/null +++ b/panda/src/egg/CMakeLists.txt @@ -0,0 +1,97 @@ +if(HAVE_EGG) + add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) + add_flex_target(lexer.cxx lexer.lxx DEFINES lexer.h PREFIX eggyy) + + set(P3EGG_HEADERS + config_egg.h eggAnimData.I eggAnimData.h + eggAnimPreload.I eggAnimPreload.h + eggAttributes.Ig + eggAttributes.h eggBin.h eggBinMaker.h eggComment.Ig + eggComment.h + eggCompositePrimitive.I eggCompositePrimitive.h + eggCoordinateSystem.I eggCoordinateSystem.hg + eggCurve.I eggCurve.h eggData.I eggData.hg + eggExternalReference.I eggExternalReference.hg + eggFilenameNode.I eggFilenameNode.h eggGroup.I eggGroup.hg + eggGroupNode.I eggGroupNode.h eggGroupUniquifier.hg + eggLine.I eggLine.h + eggMaterial.I eggMaterial.h eggMaterialCollection.Ig + eggMaterialCollection.h + eggMesher.h eggMesher.I + eggMesherEdge.h eggMesherEdge.I + eggMesherFanMaker.h eggMesherFanMaker.I + eggMesherStrip.h eggMesherStrip.I + eggMiscFuncs.I eggMiscFuncs.hg + eggMorph.I eggMorph.h eggMorphList.I eggMorphList.hg + eggNamedObject.I eggNamedObject.h eggNameUniquifier.hg + eggNode.I eggNode.h eggNurbsCurve.I eggNurbsCurve.hg + eggNurbsSurface.I eggNurbsSurface.h eggObject.I eggObject.hg + eggParameters.h + eggPatch.I eggPatch.h + eggPoint.I eggPoint.h eggPolygon.Ig + eggPolygon.h eggPolysetMaker.h eggPoolUniquifier.h + eggPrimitive.I eggPrimitive.h + eggRenderMode.I eggRenderMode.hg + eggSAnimData.I eggSAnimData.h eggSurface.I eggSurface.hg + eggSwitchCondition.h eggTable.I eggTable.h eggTexture.Ig + eggTexture.h eggTextureCollection.I eggTextureCollection.hg + eggTriangleFan.I eggTriangleFan.h + eggTriangleStrip.I eggTriangleStrip.h + eggTransform.I eggTransform.h + eggUserData.I eggUserData.h + eggUtilities.I eggUtilities.h + eggVertex.I eggVertex.h + eggVertexAux.I eggVertexAux.h + eggVertexPool.I eggVertexPool.h + eggVertexUV.I eggVertexUV.h + eggXfmAnimData.Ig + eggXfmAnimData.h eggXfmSAnim.I eggXfmSAnim.h parserDefs.hg + parser.yxx lexerDefs.h lexer.lxx pt_EggMaterial.hg + vector_PT_EggMaterial.h pt_EggTexture.hg + vector_PT_EggTexture.h pt_EggVertex.h vector_PT_EggVertex.h + ) + + set(P3EGG_SOURCES + config_egg.cxx eggAnimData.cxx + eggAnimPreload.cxx + eggAttributes.cxx eggBin.cxxg + eggBinMaker.cxx eggComment.cxx + eggCompositePrimitive.cxx + eggCoordinateSystem.cxxg + eggCurve.cxx eggData.cxx eggExternalReference.cxxg + eggFilenameNode.cxx eggGroup.cxx eggGroupNode.cxxg + eggGroupUniquifier.cxx eggLine.cxx eggMaterial.cxxg + eggMaterialCollection.cxx + eggMesher.cxx + eggMesherEdge.cxx + eggMesherFanMaker.cxx + eggMesherStrip.cxx + eggMiscFuncs.cxx eggMorphList.cxxg + eggNamedObject.cxx eggNameUniquifier.cxx eggNode.cxxg + eggNurbsCurve.cxx eggNurbsSurface.cxx eggObject.cxxg + eggParameters.cxx + eggPatch.cxx + eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxxg + eggPoolUniquifier.cxx eggPrimitive.cxx eggRenderMode.cxxg + eggSAnimData.cxx eggSurface.cxx eggSwitchCondition.cxxg + eggTable.cxx eggTexture.cxx eggTextureCollection.cxxg + eggTransform.cxx + eggTriangleFan.cxx + eggTriangleStrip.cxx + eggUserData.cxx + eggUtilities.cxx eggVertex.cxx + eggVertexAux.cxx + eggVertexPool.cxx eggVertexUV.cxx + eggXfmAnimData.cxx eggXfmSAnim.cxx pt_EggMaterial.cxxg + vector_PT_EggMaterial.cxx pt_EggTexture.cxxg + vector_PT_EggTexture.cxx pt_EggVertex.cxxg + vector_PT_EggVertex.cxxg + lexer.cxx + parser.cxx + ) + + composite_sources(p3egg P3EGG_SOURCES) + add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES}) + target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) + target_interrogate(p3egg ALL) +endif() diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt new file mode 100644 index 0000000000..877cd20e12 --- /dev/null +++ b/panda/src/egg2pg/CMakeLists.txt @@ -0,0 +1,36 @@ +if(HAVE_EGG) + set(P3EGG2PG_HEADERS + animBundleMaker.h + characterMaker.h + config_egg2pg.h + deferredNodeProperty.h + eggBinner.h + eggLoader.h eggLoader.I + eggRenderState.h eggRenderState.I + eggSaver.h eggSaver.I + egg_parametrics.h + load_egg_file.h + save_egg_file.h + loaderFileTypeEgg.h + ) + + set(P3EGG2PG_SOURCES + animBundleMaker.cxx + characterMaker.cxx + config_egg2pg.cxx + deferredNodeProperty.cxx + eggBinner.cxx + eggLoader.cxx + eggRenderState.cxx + eggSaver.cxx + egg_parametrics.cxx + load_egg_file.cxx + save_egg_file.cxx + loaderFileTypeEgg.cxx + ) + + composite_sources(p3egg2pg P3EGG2PG_SOURCES) + add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) + target_link_libraries(p3egg2pg p3parametrics p3collide p3egg p3pgraph p3chan p3char) + target_interrogate(p3egg2pg ALL) +endif() From d8bc6d0da8da86cc70a979ac99f0328374127de4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 12:29:02 -0700 Subject: [PATCH 150/744] Use "NOT BUILD_SHARED_LIBS" in CMake rather than "LINK_ALL_STATIC" --- panda/src/framework/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 38e79dbd32..1863f00ff0 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -12,7 +12,7 @@ set(P3FRAMEWORK_SOURCES set(P3FRAMEWORK_LINK_TARGETS p3char p3pgui p3recorder p3collide p3pnmimagetypes) -if(LINK_ALL_STATIC) +if(NOT BUILD_SHARED_LIBS) # If we're statically linking, we need to explicitly link with # at least one of the available renderers. if(HAVE_GL) From d0844e0fb6f3b600640085d9c77b0d6a044a88c2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 22:30:57 -0700 Subject: [PATCH 151/744] Fix typos in egg's CMakeLists file. --- panda/src/egg/CMakeLists.txt | 76 ++++++++++++++++++------------------ 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 774a33c33e..dd146d0a84 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -5,36 +5,36 @@ if(HAVE_EGG) set(P3EGG_HEADERS config_egg.h eggAnimData.I eggAnimData.h eggAnimPreload.I eggAnimPreload.h - eggAttributes.Ig - eggAttributes.h eggBin.h eggBinMaker.h eggComment.Ig + eggAttributes.I + eggAttributes.h eggBin.h eggBinMaker.h eggComment.I eggComment.h eggCompositePrimitive.I eggCompositePrimitive.h - eggCoordinateSystem.I eggCoordinateSystem.hg - eggCurve.I eggCurve.h eggData.I eggData.hg - eggExternalReference.I eggExternalReference.hg - eggFilenameNode.I eggFilenameNode.h eggGroup.I eggGroup.hg - eggGroupNode.I eggGroupNode.h eggGroupUniquifier.hg + eggCoordinateSystem.I eggCoordinateSystem.h + eggCurve.I eggCurve.h eggData.I eggData.h + eggExternalReference.I eggExternalReference.h + eggFilenameNode.I eggFilenameNode.h eggGroup.I eggGroup.h + eggGroupNode.I eggGroupNode.h eggGroupUniquifier.h eggLine.I eggLine.h - eggMaterial.I eggMaterial.h eggMaterialCollection.Ig + eggMaterial.I eggMaterial.h eggMaterialCollection.I eggMaterialCollection.h eggMesher.h eggMesher.I eggMesherEdge.h eggMesherEdge.I eggMesherFanMaker.h eggMesherFanMaker.I eggMesherStrip.h eggMesherStrip.I - eggMiscFuncs.I eggMiscFuncs.hg - eggMorph.I eggMorph.h eggMorphList.I eggMorphList.hg - eggNamedObject.I eggNamedObject.h eggNameUniquifier.hg - eggNode.I eggNode.h eggNurbsCurve.I eggNurbsCurve.hg - eggNurbsSurface.I eggNurbsSurface.h eggObject.I eggObject.hg + eggMiscFuncs.I eggMiscFuncs.h + eggMorph.I eggMorph.h eggMorphList.I eggMorphList.h + eggNamedObject.I eggNamedObject.h eggNameUniquifier.h + eggNode.I eggNode.h eggNurbsCurve.I eggNurbsCurve.h + eggNurbsSurface.I eggNurbsSurface.h eggObject.I eggObject.h eggParameters.h eggPatch.I eggPatch.h - eggPoint.I eggPoint.h eggPolygon.Ig + eggPoint.I eggPoint.h eggPolygon.I eggPolygon.h eggPolysetMaker.h eggPoolUniquifier.h eggPrimitive.I eggPrimitive.h - eggRenderMode.I eggRenderMode.hg - eggSAnimData.I eggSAnimData.h eggSurface.I eggSurface.hg - eggSwitchCondition.h eggTable.I eggTable.h eggTexture.Ig - eggTexture.h eggTextureCollection.I eggTextureCollection.hg + eggRenderMode.I eggRenderMode.h + eggSAnimData.I eggSAnimData.h eggSurface.I eggSurface.h + eggSwitchCondition.h eggTable.I eggTable.h eggTexture.I + eggTexture.h eggTextureCollection.I eggTextureCollection.h eggTriangleFan.I eggTriangleFan.h eggTriangleStrip.I eggTriangleStrip.h eggTransform.I eggTransform.h @@ -44,37 +44,37 @@ if(HAVE_EGG) eggVertexAux.I eggVertexAux.h eggVertexPool.I eggVertexPool.h eggVertexUV.I eggVertexUV.h - eggXfmAnimData.Ig - eggXfmAnimData.h eggXfmSAnim.I eggXfmSAnim.h parserDefs.hg - parser.yxx lexerDefs.h lexer.lxx pt_EggMaterial.hg - vector_PT_EggMaterial.h pt_EggTexture.hg + eggXfmAnimData.I + eggXfmAnimData.h eggXfmSAnim.I eggXfmSAnim.h parserDefs.h + parser.yxx lexerDefs.h lexer.lxx pt_EggMaterial.h + vector_PT_EggMaterial.h pt_EggTexture.h vector_PT_EggTexture.h pt_EggVertex.h vector_PT_EggVertex.h ) set(P3EGG_SOURCES config_egg.cxx eggAnimData.cxx eggAnimPreload.cxx - eggAttributes.cxx eggBin.cxxg + eggAttributes.cxx eggBin.cxx eggBinMaker.cxx eggComment.cxx eggCompositePrimitive.cxx - eggCoordinateSystem.cxxg - eggCurve.cxx eggData.cxx eggExternalReference.cxxg - eggFilenameNode.cxx eggGroup.cxx eggGroupNode.cxxg - eggGroupUniquifier.cxx eggLine.cxx eggMaterial.cxxg + eggCoordinateSystem.cxx + eggCurve.cxx eggData.cxx eggExternalReference.cxx + eggFilenameNode.cxx eggGroup.cxx eggGroupNode.cxx + eggGroupUniquifier.cxx eggLine.cxx eggMaterial.cxx eggMaterialCollection.cxx eggMesher.cxx eggMesherEdge.cxx eggMesherFanMaker.cxx eggMesherStrip.cxx - eggMiscFuncs.cxx eggMorphList.cxxg - eggNamedObject.cxx eggNameUniquifier.cxx eggNode.cxxg - eggNurbsCurve.cxx eggNurbsSurface.cxx eggObject.cxxg + eggMiscFuncs.cxx eggMorphList.cxx + eggNamedObject.cxx eggNameUniquifier.cxx eggNode.cxx + eggNurbsCurve.cxx eggNurbsSurface.cxx eggObject.cxx eggParameters.cxx eggPatch.cxx - eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxxg - eggPoolUniquifier.cxx eggPrimitive.cxx eggRenderMode.cxxg - eggSAnimData.cxx eggSurface.cxx eggSwitchCondition.cxxg - eggTable.cxx eggTexture.cxx eggTextureCollection.cxxg + eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxx + eggPoolUniquifier.cxx eggPrimitive.cxx eggRenderMode.cxx + eggSAnimData.cxx eggSurface.cxx eggSwitchCondition.cxx + eggTable.cxx eggTexture.cxx eggTextureCollection.cxx eggTransform.cxx eggTriangleFan.cxx eggTriangleStrip.cxx @@ -82,10 +82,10 @@ if(HAVE_EGG) eggUtilities.cxx eggVertex.cxx eggVertexAux.cxx eggVertexPool.cxx eggVertexUV.cxx - eggXfmAnimData.cxx eggXfmSAnim.cxx pt_EggMaterial.cxxg - vector_PT_EggMaterial.cxx pt_EggTexture.cxxg - vector_PT_EggTexture.cxx pt_EggVertex.cxxg - vector_PT_EggVertex.cxxg + eggXfmAnimData.cxx eggXfmSAnim.cxx pt_EggMaterial.cxx + vector_PT_EggMaterial.cxx pt_EggTexture.cxx + vector_PT_EggTexture.cxx pt_EggVertex.cxx + vector_PT_EggVertex.cxx lexer.cxx parser.cxx ) From 163fd7ded64aa98ac8c0e54fa0ea06d342db7320 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 27 Jan 2014 22:43:41 -0700 Subject: [PATCH 152/744] Egg parser doesn't have/need lexer.h, don't build it under CMake. --- panda/src/egg/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index dd146d0a84..58a452f36c 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -1,6 +1,6 @@ if(HAVE_EGG) add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) - add_flex_target(lexer.cxx lexer.lxx DEFINES lexer.h PREFIX eggyy) + add_flex_target(lexer.cxx lexer.lxx PREFIX eggyy) set(P3EGG_HEADERS config_egg.h eggAnimData.I eggAnimData.h From a84213300281f65a77871f69eeda9fd1878a9592 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 29 Jan 2014 05:46:59 -0700 Subject: [PATCH 153/744] Build egg's lexer case-insensitve under CMake. Fixes parse errors. --- cmake/macros/AddFlexTarget.cmake | 2 ++ panda/src/egg/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/macros/AddFlexTarget.cmake b/cmake/macros/AddFlexTarget.cmake index 6f47fb8ab9..1df75d5859 100644 --- a/cmake/macros/AddFlexTarget.cmake +++ b/cmake/macros/AddFlexTarget.cmake @@ -19,6 +19,8 @@ function(add_flex_target output_cxx input_lxx) set(keyword "DEFINES") elseif(arg STREQUAL "PREFIX") set(keyword "PREFIX") + elseif(arg STREQUAL "CASE_INSENSITIVE") + set(arguments ${arguments} -i) elseif(keyword STREQUAL "PREFIX") set(arguments ${arguments} -P "${arg}") diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 58a452f36c..0a1800fd35 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -1,6 +1,6 @@ if(HAVE_EGG) add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) - add_flex_target(lexer.cxx lexer.lxx PREFIX eggyy) + add_flex_target(lexer.cxx lexer.lxx CASE_INSENSITIVE PREFIX eggyy) set(P3EGG_HEADERS config_egg.h eggAnimData.I eggAnimData.h From 82854ac1e8f61bc0faeeef86df9682ae5547fd09 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 29 Jan 2014 10:41:01 -0700 Subject: [PATCH 154/744] Under CMake, generate dtool_config.h into build/include/ instead of build/ and use build/include/ as the global include directory. --- CMakeLists.txt | 2 +- dtool/LocalSetup.cmake | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c1d33035dd..d7e0799c7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ include(PackageConfig) # Defines package_option AND target_use_packages include(Interrogate) # Defines target_interrogate AND add_python_module # Add the include path for source and header files generated by CMake -include_directories("${CMAKE_BINARY_DIR}") +include_directories("${CMAKE_BINARY_DIR}/include") # Configure Panda3D include(dtool/PandaVersion.cmake) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 978c79073b..009a45939f 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -212,6 +212,6 @@ endif() message("See dtool_config.h for more details about the specified configuration.") # Generate dtool_config.h -configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/dtool_config.h") -include_directories("${PROJECT_BINARY_DIR}") +configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") +include_directories("${PROJECT_BINARY_DIR}/include") #install(FILES "${PROJECT_BINARY_DIR}/dtool_config.h" DESTINATION include/panda3d) From 4fa6584fdf1e9253818985b7f9473a90914cac56 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 29 Jan 2014 14:39:15 -0700 Subject: [PATCH 155/744] Revise AutoInclude.cmake: My version of CMake, despite being >=2.8.11, doesn't actually support CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. --- cmake/modules/AutoInclude.cmake | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake index 3a2f2d74e0..40916f1e68 100644 --- a/cmake/modules/AutoInclude.cmake +++ b/cmake/modules/AutoInclude.cmake @@ -4,8 +4,12 @@ # behavior by default. # -# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. -if(CMAKE_VERSION VERSION_LESS 2.8.11) +# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior if +# this version doesn't define CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. +# CFSworks's version of CMake (2.8.12) doesn't have +# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE even though it should be supported, +# hence test if it's defined (as either ON or OFF) before trying to use it. +if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") # Replace some built-in functions in order to extend their functionality. function(add_library target) _add_library(${target} ${ARGN}) @@ -29,14 +33,16 @@ if(CMAKE_VERSION VERSION_LESS 2.8.11) endif() endforeach() - list(REMOVE_DUPLICATES interface_dirs) + if(interface_dirs) + list(REMOVE_DUPLICATES interface_dirs) - #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interface_dirs}) - include_directories(${interface_dirs}) + #NB. target_include_directories is new in 2.8.8. + #target_include_directories("${target}" ${interface_dirs}) + include_directories(${interface_dirs}) - # Update this target's interface inc dirs. - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") + # Update this target's interface inc dirs. + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") + endif() # Call to the built-in function we are overriding. _target_link_libraries(${target} ${ARGN}) From 72c180a82ce66d854c8373dfd646f3d8113afa3e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 29 Jan 2014 14:39:38 -0700 Subject: [PATCH 156/744] Massively update CMake's Interrogate macro. This gets several modules to build... --- cmake/macros/Interrogate.cmake | 98 ++++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 27 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index a118b3f945..0df62c0c5a 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -17,13 +17,21 @@ if(INTERROGATE_VERBOSE) list(APPEND IGATE_FLAGS "-v") endif() +if(INTERROGATE_PYTHON_INTERFACE AND PYTHON_NATIVE) + list(APPEND IGATE_FLAGS -python-native) +endif() + set(IMOD_FLAGS ${INTERROGATE_MODULE_OPTIONS}) +# This is a list of filename extensions that Interrogate will allow in the +# sources lists. +set(INTERROGATE_EXTENSIONS "cxx;h") + # # Function: target_interrogate(target [ALL] [source1 [source2 ...]]) -# NB. This doesn't actually invoke interrogate, but merely adds the -# sources to the list of scan sources associated with the target. -# Interrogate will be invoked when add_python_module is called. +# Currently, this adds the resultant TARGET_igate.cxx to the target by linking +# it as a library. This is only temporary until the codebase is cleaned up a +# bit more to reduce the dependency on interrogate. # If ALL is specified, all of the sources from the associated # target are added. # @@ -52,6 +60,19 @@ function(target_interrogate target) list(REMOVE_DUPLICATES sources) + # Also remove the non-whitelisted filename extensions from sources: + foreach(source ${sources}) + set(any_extension_matches OFF) + foreach(filex ${INTERROGATE_EXTENSIONS}) + if("${source}" MATCHES ".*\\.${filex}$") + set(any_extension_matches ON) + endif() + endforeach(filex) + if(NOT any_extension_matches) + list(REMOVE_ITEM sources "${source}") + endif() + endforeach(source) + # Go through the sources to determine the full name, # and also find out if there are any .N files to pick up. foreach(source ${sources}) @@ -69,9 +90,52 @@ function(target_interrogate target) endif() endforeach(source) - set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${sources}") - set_target_properties("${target}" PROPERTIES IGATE_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") - set_target_properties("${target}" PROPERTIES IGATE_DEPS "${deps}") + # Interrogate also needs to know the include paths of the current module, + # so we'll run over the include directories property and add those to the + # interrogate command line. + set(igate_includes) + get_target_property(target_includes "${target}" INTERFACE_INCLUDE_DIRECTORIES) + foreach(include_directory ${target_includes}) + set(igate_includes + ${igate_includes} -I "${include_directory}") + endforeach(include_directory) + + add_custom_command( + OUTPUT "${target}_igate.cxx" "${target}.in" + COMMAND interrogate + -od "${target}.in" + -oc "${target}_igate.cxx" + -library ${target} ${IGATE_FLAGS} + -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" + -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" + -S "${PROJECT_BINARY_DIR}/include/parser-inc" + -S "${PROJECT_BINARY_DIR}/include" + ${igate_includes} + ${sources} + DEPENDS interrogate ${deps} + COMMENT "Interrogating ${target}" + ) + + # Now that we've interrogated, let's associate the interrogate sources to + # the target: + set(igate_sources "${target}_igate.cxx") + # Also add all of the _ext sources: + foreach(source ${sources}) + if("${source}" MATCHES ".*_ext.*") + set(igate_sources ${igate_sources} "${source}") + endif() + endforeach(source) + + # Now record INTERROGATE_SOURCES to the target: + set_target_properties("${target}" PROPERTIES INTERROGATE_SOURCES ${igate_sources}) + + + # HACK: This is REALLY ugly, but we can't add the _igate.cxx to the existing + # target (or at least, when I tried, it ignored the additional file), so as + # a (very!) temporary workaround, add another library and link it in. + add_library("${target}_igate" ${igate_sources}) + target_link_libraries(${target} ${target}_igate) + endif() endfunction(target_interrogate) @@ -83,29 +147,9 @@ function(add_python_module module) if(HAVE_PYTHON AND HAVE_INTERROGATE) set(targets ${ARGN}) set(infiles) - set(sources) foreach(target ${targets}) - get_target_property(scansrc "${target}" IGATE_SOURCES) - get_target_property(srcdir "${target}" IGATE_SRCDIR) - get_target_property(deps "${target}" IGATE_DEPS) - - add_custom_command( - OUTPUT "${target}_igate.cxx" "${target}.in" - COMMAND interrogate - -od "${target}.in" - -oc "${target}_igate.cxx" - -module ${module} -library ${target} ${IGATE_FLAGS} - -srcdir "${srcdir}" - -I "${PROJECT_BINARY_DIR}/include" - -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" - -S "${PROJECT_BINARY_DIR}/include/parser-inc" - ${scansrc} - DEPENDS interrogate ${deps} - ) - list(APPEND infiles "${target}.in") - list(APPEND sources "${target}_igate.cxx") endforeach(target) add_custom_command( @@ -117,7 +161,7 @@ function(add_python_module module) DEPENDS interrogate_module ${infiles} ) - add_library(${module} MODULE "${module}_module.cxx" ${sources}) + add_library(${module} MODULE "${module}_module.cxx") target_link_libraries(${module} ${PYTHON_LIBRARIES}) target_link_libraries(${module} p3interrogatedb) From 2f89129ffd48fd26c1da55c895d17410cbf53d6f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 29 Jan 2014 14:40:06 -0700 Subject: [PATCH 157/744] Add *_ext.cxx and *_ext.h to p3express's CMakeLists. --- panda/src/express/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index d0c6970d02..ef4ce2c614 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -59,6 +59,7 @@ set(P3EXPRESS_HEADERS virtualFileMountSystem.h virtualFileMountSystem.I virtualFileSimple.h virtualFileSimple.I virtualFileSystem.h virtualFileSystem.I + virtualFileSystem_ext.h weakPointerCallback.I weakPointerCallback.h weakPointerTo.I weakPointerTo.h weakPointerToBase.I weakPointerToBase.h @@ -113,6 +114,7 @@ set(P3EXPRESS_SOURCES virtualFileMountRamdisk.cxx virtualFileMountSystem.cxx virtualFileSimple.cxx virtualFileSystem.cxx + virtualFileSystem_ext.cxx weakPointerCallback.cxx weakPointerTo.cxx weakPointerToBase.cxx From 99b476099189ce11f0a8010022875f38e2c823f7 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:01:57 -0700 Subject: [PATCH 158/744] dtool/Config.cmake: Add missing empty option to BUILD_IPHONE. --- dtool/Config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 4fc5e17b38..a49ba36e30 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -355,7 +355,7 @@ requires the Apple IPhone SDK, which is currently only available for OS X platforms. Set this to either 'iPhoneSimulator' or 'iPhoneOS'. Note that this is still *experimental* and incomplete! Don't enable this unless you know what you're doing!") -set_property(CACHE BUILD_IPHONE PROPERTY STRINGS iPhoneSimulator iPhoneOS) +set_property(CACHE BUILD_IPHONE PROPERTY STRINGS "" iPhoneSimulator iPhoneOS) # Android support From 9a9f06c98408f18aa1ad91f9eac2d2c724446770 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:16:26 -0700 Subject: [PATCH 159/744] Config.cmake: Add X11 location and option. --- dtool/Config.cmake | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a49ba36e30..a60ad6a8a3 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -645,6 +645,19 @@ mark_as_advanced(SDL_LIBRARY) mark_as_advanced(SDL_LIBRARY_TEMP) +# Is X11 insalled, and where? +find_package(X11) + +package_option(X11 + "Provides X-server support on Unix platforms. X11 may need to be linked +against for tinydisplay, but probably only on a Linux platform.") +if(NOT UNIX AND HAVE_X11) + message(SEND_ERROR + "X11 support is only supported on Unix platforms: +ie. Linux, BSD, OS X, Cygwin, etc...") +endif() + + # TODO: XF86DGA # This defines if we have XF86DGA installed. #find_package(XF86DGA QUIET) @@ -752,6 +765,8 @@ mark_as_advanced(HAVE_SGI_RGB HAVE_TGA + + # How to invoke bison and flex. Panda takes advantage of some # bison/flex features, and therefore specifically requires bison and # flex, not some other versions of yacc and lex. However, you only @@ -769,8 +784,11 @@ find_package(FLEX QUIET) set(HAVE_BISON ${BISON_FOUND}) set(HAVE_FLEX ${FLEX_FOUND}) + # -# +# >>>>> Below is entirely temporary config information +# until the port of Config.pp is finished. +# It should be re-arranged for above. >>>>>> # ### Configure threading support ### From c20f38c38357948e58b8b58ccfa3fb95236bcd3e Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:37:48 -0700 Subject: [PATCH 160/744] Add additional output, CG_LIBRARIES, to FindCg.cmake. --- cmake/modules/FindCg.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 757eb52603..3fdfe757ca 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -10,6 +10,7 @@ # CG_INCLUDE_DIRS - directories for all NvidiaCg components # CG_LIBRARY_DIR - the NvidiaCg library directory # CG_LIBRARY - the path to the library binary +# CG_LIBRARIES - the paths to the Cg library and each library below. # # CGGL_FOUND - system has CgGL # CGGL_INCLUDE_DIR - the CgGL include directory @@ -157,4 +158,8 @@ if(CG_INCLUDE_DIR AND CG_LIBRARY_DIR) find_cgdx8() find_cgdx9() find_cgdx10() -endif() \ No newline at end of file + + set(CG_LIBRARIES ${CG_LIBRARY} ${CGGL_LIBRARY} + ${CGDX8_LIBRARY} ${CGDX9_LIBRARY} ${CGDX10_LIBRARY}) + mark_as_advanced(CG_LIBRARIES) +endif() From c75b104ce762f60cc2562a40436cb513cf81defc Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:38:14 -0700 Subject: [PATCH 161/744] In CMake builds, link glgsg with CG_LIBRARIES. --- panda/src/glgsg/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index c7519749aa..ba0cb410d1 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -10,6 +10,7 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) - target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES}) + target_link_libraries(p3glgsg p3glstuff p3display + ${OPENGL_LIBRARIES} ${CG_LIBRARIES}) target_interrogate(p3glgsg ALL) endif() From 80b1a7e306b192559e0d1cd8e697d664ad44bca0 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:39:10 -0700 Subject: [PATCH 162/744] Add header to CMake panda/metalibs/pandagl that causes an error when it is being built without proper support. --- panda/metalibs/pandagl/CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 9d321ef16f..96eb7465cc 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -1,4 +1,12 @@ if(HAVE_GL) + # Check that we actually have a display subsystem. + if(NOT HAVE_WGL AND NOT HAVE_COCOA AND NOT HAVE_CARBON AND NOT HAVE_GLX) + message("") # Add extra line before error + message(SEND_ERROR + "When compiling with OpenGL (HAVE_GL), at least one of: + HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") + endif() + add_definitions(-DBUILDING_PANDAGL) set(PANDAGL_LINK_TARGETS p3glgsg) From 7c8062a88a627b1cc5ed4ebbffcaf34728a1c76e Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:44:23 -0700 Subject: [PATCH 163/744] In CMake builds, link gobj with Squish (when enabled). --- panda/src/gobj/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 34dbb3216d..ef1d2bedd6 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -143,7 +143,8 @@ set(P3GOBJ_SOURCES composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -target_link_libraries(p3gobj p3gsgbase p3pnmimage ${ZLIB_LIBRARIES}) +target_link_libraries(p3gobj p3gsgbase p3pnmimage + ${ZLIB_LIBRARIES} ${SQUISH_LIBRARY}) target_interrogate(p3gobj ALL) #begin test_bin_target From a6332e3cae29447a4cc8ceea0b67128a13d77e6f Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 04:47:08 -0700 Subject: [PATCH 164/744] In CMake builds, link panda/express with Tar (when enabled). --- panda/src/express/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index d0c6970d02..199fd39a6d 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -124,7 +124,8 @@ set(P3EXPRESS_SOURCES composite_sources(p3express P3EXPRESS_SOURCES) add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig) +target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig + ${TAR_LIBRARY}) target_interrogate(p3express ALL) #add_executable(p3expressTestTypes test_types.cxx) From 8d3e7541ef854200426c42810c79178e6cacb0a4 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 05:06:11 -0700 Subject: [PATCH 165/744] Update documentation for CMake build system. --- cmake/README.md | 34 +++++++++++++++++----------------- cmake/TODO | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 5b46309b87..a632418ff5 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -8,7 +8,7 @@ make [sudo] make install ``` -It is recommended to create a separate directory to build Panda3D: +Instead, it is recommended to create a separate directory to build Panda3D: ```sh mkdir build cd build/ @@ -28,11 +28,10 @@ Panda subpackage building is handled by: ``` BUILD_=True/False # Example: BUILD_DTOOL, BUILD_PANDA ``` -Other configuration settings use more direct names (same names as in-source): +Other configuration settings use their historical names (same names as in-source): ``` # Examples PANDA_DISTRIBUTOR="MyDistributor" - DTOOL_INSTALL="/usr/local/panda" LINMATH_ALIGN=On # ... etc ... @@ -41,19 +40,20 @@ Other configuration settings use more direct names (same names as in-source): For example, `makepanda.py --distributor X` becomes `cmake -DPANDA_DISTRIBUTOR=X` -All third-party libraries are enabled by default and Panda3D will -be compiled with any third-party library that is found. -Third-party libraries can be enabled or disabled through -configuration with the cmake gui or cli. +All found third-party libraries are enabled by default. +Most config settings are set to a sensible default for typical +a PC/desktop Panda3D distribution. +Third-party libraries and other settings can be enabled or disabled +through configuration with the cmake gui or cli. -To quickly enable or disable all third-party libraries, run: -```sh -cmake -DEVERYTHING=True . # or .. if you are in a separate build/ dir -# OR -cmake -DNOTHING=True . # or .. if you are in a separate build/ dir -``` +Running Panda3D with `-DCMAKE_BUILD_TYPE=` and one of `Release`, `Debug`, +`MinSizeRel`, or `RelWithDebInfo` will cause some configuration settings +to change their defaults to more appropriate values. -To use all available packages, and silence output for missing packages, run: -```sh -cmake -DDISCOVERED=True . # or .. if you are in a separate build/ dir -``` +If cmake has already been generated, changing the build type will not cause +some of these values to change to their expected values, because the values +are cached so that they don't overwrite custom settings. + +To reset CMake's config to defaults, delete the CMakeCache.txt file, and rerun +CMake with the preferred build mode specified +(example: `cmake .. -DCMAKE_BUILD_TYPE=Debug`). diff --git a/cmake/TODO b/cmake/TODO index d612816b78..8a57cd4ea8 100644 --- a/cmake/TODO +++ b/cmake/TODO @@ -1,4 +1,4 @@ # List of things which may appear done but actually still need work! Test Miles Sound System support Add DirectX support for Nvidia Cg - +Finish Config.pp conversion to Config.cmake From 995688760bc4692f8acf591567dc1804e076a0f6 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 06:21:50 -0700 Subject: [PATCH 166/744] In panda config, unset libraries we're not using so that they're not used as link targets. --- cmake/macros/PackageConfig.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index e55a83ef01..dd313685c8 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -73,6 +73,10 @@ function(package_option name) # Create the option. option("HAVE_${name}" "${cache_string}" "${default}") + if(NOT HAVE_${name}) + unset(${name}_LIBRARY) + unset(${name}_LIBRARIES) + endif() endfunction() # From b04ebdda98b0170736fc895f2f4a31ddf396f5de Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 06:47:09 -0700 Subject: [PATCH 167/744] Have package_option automatically generate option library targets instead of checking in every instance they're used. --- cmake/macros/PackageConfig.cmake | 13 +++++++----- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 +- dtool/src/interrogate/CMakeLists.txt | 2 +- dtool/src/prc/CMakeLists.txt | 2 +- panda/src/express/CMakeLists.txt | 3 ++- panda/src/glgsg/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 2 +- panda/src/pnmimagetypes/CMakeLists.txt | 25 ++--------------------- panda/src/pnmtext/CMakeLists.txt | 2 +- panda/src/text/CMakeLists.txt | 2 +- 10 files changed, 19 insertions(+), 36 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index dd313685c8..20e408df2d 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -73,9 +73,12 @@ function(package_option name) # Create the option. option("HAVE_${name}" "${cache_string}" "${default}") - if(NOT HAVE_${name}) - unset(${name}_LIBRARY) - unset(${name}_LIBRARIES) + if(HAVE_${name}) + set(_${name}_LIBRARY ${${name}_LIBRARY} CACHE INTERNAL "") + set(_${name}_LIBRARIES ${${name}_LIBRARIES} CACHE INTERNAL "") + else() + unset(_${name}_LIBRARY CACHE) + unset(_${name}_LIBRARIES CACHE) endif() endfunction() @@ -93,9 +96,9 @@ macro(target_use_packages target) if(HAVE_${lib}) target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") if(${lib}_LIBRARIES) - target_link_libraries("${target}" ${${lib}_LIBRARIES}) + target_link_libraries("${target}" ${_${lib}_LIBRARIES}) else() - target_link_libraries("${target}" ${${lib}_LIBRARY}) + target_link_libraries("${target}" ${_${lib}_LIBRARY}) endif() endif() endforeach(lib) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index a9ed486379..054d2095bc 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -2,7 +2,7 @@ add_definitions(-DBUILDING_DTOOLCONFIG) if(HAVE_PYTHON) add_library(p3dtoolconfig dtoolconfig.cxx pydtool.cxx) - target_link_libraries(p3dtoolconfig ${PYTHON_LIBRARIES}) + target_link_libraries(p3dtoolconfig ${_PYTHON_LIBRARIES}) else() add_library(p3dtoolconfig dtoolconfig.cxx) endif() diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 7444dfbab3..fd28d48ca9 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -50,4 +50,4 @@ composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${OPENSSL_LIBRARIES}) + p3pystub ${_OPENSSL_LIBRARIES}) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index e3fc7afac3..57cea800b0 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -65,4 +65,4 @@ set(P3PRC_SOURCES composite_sources(p3prc P3PRC_SOURCES) add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) -target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${OPENSSL_LIBRARIES}) +target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES}) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 8f93753e4d..7921b23578 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -125,9 +125,10 @@ set(P3EXPRESS_SOURCES composite_sources(p3express P3EXPRESS_SOURCES) +message("TAR ${_TAR_LIBRARY}") add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig - ${TAR_LIBRARY}) + ${_TAR_LIBRARY}) target_interrogate(p3express ALL) #add_executable(p3expressTestTypes test_types.cxx) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index ba0cb410d1..06645e18e1 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -11,6 +11,6 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff p3display - ${OPENGL_LIBRARIES} ${CG_LIBRARIES}) + ${OPENGL_LIBRARIES} ${_CG_LIBRARIES}) target_interrogate(p3glgsg ALL) endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index ef1d2bedd6..117527ba96 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -144,7 +144,7 @@ set(P3GOBJ_SOURCES composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage - ${ZLIB_LIBRARIES} ${SQUISH_LIBRARY}) + ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY}) target_interrogate(p3gobj ALL) #begin test_bin_target diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 367531eff1..02f89a3a6d 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -26,29 +26,8 @@ set(P3PNMIMAGETYPES_SOURCES pnmFileTypeTGA.cxx ) -# We aggregate the PNMIMAGETYPES libraries depending on which image formats are -# compiled in. -unset(PNMIMAGETYPES_LINK_LIBRARIES) - -if(HAVE_JPEG) - set(PNMIMAGETYPES_LINK_LIBRARIES - ${PNMIMAGETYPES_LINK_LIBRARIES} - ${JPEG_LIBRARIES}) -endif() - -if(HAVE_TIFF) - set(PNMIMAGETYPES_LINK_LIBRARIES - ${PNMIMAGETYPES_LINK_LIBRARIES} - ${TIFF_LIBRARIES}) -endif() - -if(HAVE_PNG) - set(PNMIMAGETYPES_LINK_LIBRARIES - ${PNMIMAGETYPES_LINK_LIBRARIES} - ${PNG_LIBRARIES}) -endif() - composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -target_link_libraries(p3pnmimagetypes p3pnmimage ${PNMIMAGETYPES_LINK_LIBRARIES}) +target_link_libraries(p3pnmimagetypes p3pnmimage ${_JPEG_LIBRARIES} + ${_TIFF_LIBRARIES} ${_PNG_LIBRARIES}) target_interrogate(p3pnmimagetypes ALL) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 73e2e67a96..534b9a80e3 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -15,5 +15,5 @@ set(P3PNMTEXT_SOURCES composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) -target_link_libraries(p3pnmtext p3pnmimage ${FREETYPE_LIBRARIES}) +target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) target_interrogate(p3pnmtext ALL) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index cc6e5d1fcb..1815b6e529 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -34,5 +34,5 @@ set(P3TEXT_SOURCES composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) -target_link_libraries(p3text p3pnmtext p3parametrics ${FREETYPE_LIBRARIES}) +target_link_libraries(p3text p3pnmtext p3parametrics ${_FREETYPE_LIBRARIES}) target_interrogate(p3text ALL) From 146c532f47b94f270db97ba846e1c2684b2195ed Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 06:48:42 -0700 Subject: [PATCH 168/744] Remove debugging Message from panda/express/CmakeLists.txt --- panda/src/express/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 7921b23578..34645871ae 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -125,7 +125,6 @@ set(P3EXPRESS_SOURCES composite_sources(p3express P3EXPRESS_SOURCES) -message("TAR ${_TAR_LIBRARY}") add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY}) From f0a7a4d12bca04d16be4351f153e375b67336749 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 07:00:01 -0700 Subject: [PATCH 169/744] Removed outmoded DO_DEBUG for IS_DEBUG_BUILD --- dtool/Config.cmake | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a60ad6a8a3..bea77a37d1 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -40,13 +40,6 @@ else() set(DEFAULT_PATHSEP ":") endif() -# TODO: Figure out what to do about release/debug vs OPTIMIZE level. -if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR CMAKE_BUILD_TYPE STREQUAL "") - set(DO_DEBUG ON) -else() - set(DO_DEBUG OFF) -endif() - # Provide convenient boolean expression based on build type if(CMAKE_BUILD_TYPE MATCHES "Debug") set(IS_DEBUG_BUILD True) @@ -293,13 +286,13 @@ option(DO_MEMORY_USAGE enables you to define the variable 'track-memory-usage' at runtime to help track memory leaks, and also report total memory usage on PStats. There is some small overhead for having this ability -available, even if it is unused." ${DO_DEBUG}) +available, even if it is unused." ${IS_DEBUG_BUILD}) option(SIMULATE_NETWORK_DELAY "This option compiles in support for simulating network delay via the min-lag and max-lag prc variables. It adds a tiny bit of overhead even when it is not activated, so it is typically enabled -only in a development build." ${DO_DEBUG}) +only in a development build." ${IS_DEBUG_BUILD}) option(SUPPORT_IMMEDIATE_MODE "This option compiles in support for immediate-mode OpenGL @@ -307,7 +300,7 @@ rendering. Since this is normally useful only for researching buggy drivers, and since there is a tiny bit of per-primitive overhead to have this option available even if it is unused, it is by default enabled only in a development build. This has no effect -on DirectX rendering." ${DO_DEBUG}) +on DirectX rendering." ${IS_DEBUG_BUILD}) option(USE_MEMORY_DLMALLOC "This is an optional alternative memory-allocation scheme @@ -424,7 +417,7 @@ include_directories(${PYTHON_INCLUDE_DIRS}) # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. -if(WIN32 AND DO_DEBUG) +if(WIN32 AND IS_DEBUG_BUILD) set(USE_DEBUG_PYTHON ON) else() set(USE_DEBUG_PYTHON OFF) @@ -458,7 +451,7 @@ package_option(OPENSSL DEFAULT ON option(REPORT_OPENSSL_ERRORS "Define this true to include the OpenSSL code to report verbose -error messages when they occur." ${DO_DEBUG}) +error messages when they occur." ${IS_DEBUG_BUILD}) # Is libjpeg installed, and where? From b2f928ade5a758caea44e944d8be656fc1934043 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 08:55:19 -0700 Subject: [PATCH 170/744] Add "Distribution" build type, and improve doc/organization for basic CMake stuff. --- dtool/Config.cmake | 57 ++++++++++++++++++++++++++++++---------------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index bea77a37d1..5c974e64b8 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -7,38 +7,26 @@ # # Define the plaform we are building on. +# The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN" +# are automatically provided by CMAKE. "APPLE" is also provided by +# CMAKE but may be True on systems that are not OS X. if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(IS_LINUX 1) endif() - if(CMAKE_SYSTEM_NAME MATCHES "Darwin") set(IS_OSX 1) endif() - if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(IS_FREEBSD 1) endif() -# The character used to separate components of an OS-specific -# directory name depends on the platform (it is '/' on Unix, '\' on -# Windows). That character selection is hardcoded into Panda and -# cannot be changed here. (Note that an internal Panda filename -# always uses the forward slash, '/', to separate the components of a -# directory name.) -# There's a different character used to separate the complete -# directory names in a search path specification. On Unix, the -# normal convention is ':', on Windows, it has to be ';', because the -# colon is already used to mark the drive letter. This character is -# selectable here. Most users won't want to change this. If -# multiple characters are placed in this string, any one of them may -# be used as a separator character. - -if(WIN32) - set(DEFAULT_PATHSEP ";") -else() - set(DEFAULT_PATHSEP ":") +# Define the type of build we are setting up. +if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) endif() +set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + Release RelWithDebInfo Debug MinSizeRel Distribution) # Provide convenient boolean expression based on build type if(CMAKE_BUILD_TYPE MATCHES "Debug") @@ -57,6 +45,35 @@ else() set(IS_NOT_MINSIZE_BUILD True) endif() +if(CMAKE_BUILD_TYPE MATCHES "Distribution") + set(IS_DIST_BUILD True) + set(IS_NOT_DIST_BUILD False) +else() + set(IS_DIST_BUILD False) + set(IS_NOT_DIST_BUILD True) +endif() + + +# The character used to separate components of an OS-specific +# directory name depends on the platform (it is '/' on Unix, '\' on +# Windows). That character selection is hardcoded into Panda and +# cannot be changed here. (Note that an internal Panda filename +# always uses the forward slash, '/', to separate the components of a +# directory name.) + +# There's a different character used to separate the complete +# directory names in a search path specification. On Unix, the +# normal convention is ':', on Windows, it has to be ';', because the +# colon is already used to mark the drive letter. This character is +# selectable here. Most users won't want to change this. If +# multiple characters are placed in this string, any one of them may +# be used as a separator character. +if(WIN32) + set(DEFAULT_PATHSEP ";") +else() + set(DEFAULT_PATHSEP ":") +endif() + # Panda uses prc files for runtime configuration. There are many # compiled-in options to customize the behavior of the prc config # system; most users won't need to change any of them. Feel free to From bb19d8cb23e955c7742f738bf9eece47b2cdb74d Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 09:33:20 -0700 Subject: [PATCH 171/744] Enable package filtering by license in Distribution builds, and disable most packages by default in MinSizeRel builds. --- cmake/macros/PackageConfig.cmake | 40 ++++++++++++++++++++++++++++---- dtool/Config.cmake | 7 ++++-- dtool/PandaVersion.cmake | 11 ++++++++- 3 files changed, 51 insertions(+), 7 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 20e408df2d..f0399abe87 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -7,11 +7,14 @@ # # Function: package_option # Usage: -# package_option(package_name DOCSTRING [DEFAULT ON | OFF]) +# package_option(package_name DOCSTRING +# [DEFAULT ON | OFF] +# [LICENSE license]) # Examples: -# add_library(mylib ${SOURCES}) +# package_option(LIBNAME "Enables LIBNAME support." DEFAULT OFF) # -# If no default is given, the default is whether the package was found. +# If no default is given, the default in normal +# builds is to enable all found third-party packages. # # # Function: target_use_packages @@ -29,6 +32,7 @@ function(package_option name) # Parse the arguments. set(command) set(default) + set(license) set(cache_string) foreach(arg ${ARGN}) @@ -36,9 +40,16 @@ function(package_option name) set(default "${arg}") set(command) + elseif(command STREQUAL "LICENSE") + set(license "${arg}") + set(command) + elseif(arg STREQUAL "DEFAULT") set(command "DEFAULT") + elseif(arg STREQUAL "LICENSE") + set(command "LICENSE") + else() # Yes, a list, because semicolons can be in there, and # that gets split up into multiple args, so we have to @@ -54,7 +65,28 @@ function(package_option name) # If the default is not set, we set it. if(NOT DEFINED default) - set(default "${${name}_FOUND}") + if(IS_DIST_BUILD) + # Accept things that don't have a configured license + if(license STREQUAL "") + set(default "${${name}_FOUND}") + + else() + list(FIND PANDA_DIST_USE_LICENSES ${license} license_index) + # If the license isn't in the accept listed, don't use the package + if(license_index EQUAL -1) + set(default OFF) + else + set(default "${${name}_FOUND}") + endif() + endif() + + elseif(IS_MINSIZE_BUILD) + set(default OFF) + + else() + set(default "${${name}_FOUND}") + + endif() endif() # If it was set by the user but not found, display an error. diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 5c974e64b8..d4cd435331 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -74,6 +74,7 @@ else() set(DEFAULT_PATHSEP ":") endif() + # Panda uses prc files for runtime configuration. There are many # compiled-in options to customize the behavior of the prc config # system; most users won't need to change any of them. Feel free to @@ -410,7 +411,8 @@ If this is provided, Panda will use this library as the fundamental implementation of its own linmath library; otherwise, it will use its own internal implementation. The primary advantage of using Eigen is SSE2 support, which is only activated if LINMATH_ALIGN -is also enabled.") +is also enabled." + LICENSE "MPL-2") option(LINMATH_ALIGN "This is required for activating SSE2 support using Eigen. @@ -537,7 +539,8 @@ package_option(CGDX10 "Enable support for Nvidia Cg's DX10 API.") find_package(VRPN) package_option(VRPN - "Enables support for connecting to VRPN servers.") + "Enables support for connecting to VRPN servers." + LICENSE "Nvidia") # TODO: Helix diff --git a/dtool/PandaVersion.cmake b/dtool/PandaVersion.cmake index bfdc73590d..bf79443406 100644 --- a/dtool/PandaVersion.cmake +++ b/dtool/PandaVersion.cmake @@ -19,6 +19,14 @@ set(PANDA_DISTRIBUTOR homebuilt CACHE STRING It should be set by whoever provides a particular distribution of Panda. If you build your own Panda, leave this unchanged.") +set(PANDA_DIST_USE_LICENSES "BSD-3;BSD-2;MIT" CACHE STRING + "This is a list of allowed licenses for 3rd-party packages to build +support for when performing a Distribution build of Panda3d. +Note: This only is checked for packages that CMake has declared with a +particular license. Some packages don't have a listed license because +they are almost always required/used, or because they are only used in +plugins that can be easily removed (eg. directx, ffmpeg, fmod, ...).") + set(PANDA_PACKAGE_VERSION CACHE STRING "This string is used to describe the Panda3D \"package\" associated with this current build of Panda. It should increment with major @@ -48,7 +56,8 @@ the first three matching the plugin version, and the fourth integer being incremented with each new Core API revision.") mark_as_advanced(PANDA_VERSION PANDA_OFFICIAL_VERSION - PANDA_PACKAGE_VERSION P3D_PLUGIN_VERSION P3D_COREAPI_VERSION) + PANDA_PACKAGE_VERSION P3D_PLUGIN_VERSION P3D_COREAPI_VERSION + PANDA_DIST_USE_LICENSES) # Separate the Panda3D version into its three components. string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}") From f8b901f60a1ea651a163d7b50c402e5b0aa18649 Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 09:39:29 -0700 Subject: [PATCH 172/744] Fix incorrect licensing and add missing parens after else. --- cmake/macros/PackageConfig.cmake | 7 ++++--- dtool/Config.cmake | 20 +++++++++++++------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index f0399abe87..dc88e2ac13 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -32,7 +32,7 @@ function(package_option name) # Parse the arguments. set(command) set(default) - set(license) + set(license "") set(cache_string) foreach(arg ${ARGN}) @@ -73,9 +73,10 @@ function(package_option name) else() list(FIND PANDA_DIST_USE_LICENSES ${license} license_index) # If the license isn't in the accept listed, don't use the package - if(license_index EQUAL -1) + message("INDEX for ${name}: ${license_index}") + if(${license_index} EQUAL "-1") set(default OFF) - else + else() set(default "${${name}_FOUND}") endif() endif() diff --git a/dtool/Config.cmake b/dtool/Config.cmake index d4cd435331..dea237f89d 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -528,19 +528,25 @@ package_option(SQUISH # Is Cg installed, and where? find_package(Cg QUIET) -package_option(CG "Enable support for Nvidia Cg Shading Language") -package_option(CGGL "Enable support for Nvidia Cg's OpenGL API.") -package_option(CGDX8 "Enable support for Nvidia Cg's DX8 API.") -package_option(CGDX9 "Enable support for Nvidia Cg's DX9 API.") -package_option(CGDX10 "Enable support for Nvidia Cg's DX10 API.") +package_option(CG + "Enable support for Nvidia Cg Shading Language" + LICENSE "Nvidia") +package_option(CGGL + "Enable support for Nvidia Cg's OpenGL API." + LICENSE "Nvidia") +package_option(CGDX8 "Enable support for Nvidia Cg's DX8 API." + LICENSE "Nvidia") +package_option(CGDX9 "Enable support for Nvidia Cg's DX9 API." + LICENSE "Nvidia") +package_option(CGDX10 "Enable support for Nvidia Cg's DX10 API." + LICENSE "Nvidia") # Is VRPN installed, and where? find_package(VRPN) package_option(VRPN - "Enables support for connecting to VRPN servers." - LICENSE "Nvidia") + "Enables support for connecting to VRPN servers.") # TODO: Helix From f5fbe257244c9385bb4cb10fa45a0ac348b399eb Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 10:32:25 -0700 Subject: [PATCH 173/744] Build shared libs by default in cmake builds. --- dtool/Config.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index dea237f89d..f2dfa07993 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -54,6 +54,13 @@ else() endif() +# Are we building with static or dynamic linking? +option(BUILD_SHARED_LIBS + "Causes subpackes to be built separately -- setup for dynamic linking. +Utilities/tools/binaries/etc are then dynamically linked to the +libraries instead of being statically linked." ON) + + # The character used to separate components of an OS-specific # directory name depends on the platform (it is '/' on Unix, '\' on # Windows). That character selection is hardcoded into Panda and From a8207d109ae8667a198a1169b99a5b0d4d2dc77f Mon Sep 17 00:00:00 2001 From: kestred Date: Thu, 30 Jan 2014 10:32:52 -0700 Subject: [PATCH 174/744] Add missing optional Cg library link target to gobj. --- panda/src/gobj/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 117527ba96..52ab97b586 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -144,7 +144,7 @@ set(P3GOBJ_SOURCES composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage - ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY}) + ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARIES}) target_interrogate(p3gobj ALL) #begin test_bin_target From c9a4228811dabab923a555ac224981f65d557587 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 06:27:37 -0700 Subject: [PATCH 175/744] When interrogating under CMake, record INTERROGATE_DATABASE as a target property. --- cmake/macros/Interrogate.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 0df62c0c5a..aca30e3148 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -126,8 +126,9 @@ function(target_interrogate target) endif() endforeach(source) - # Now record INTERROGATE_SOURCES to the target: + # Now record INTERROGATE_SOURCES and INTERROGATE_DATABASE to the target: set_target_properties("${target}" PROPERTIES INTERROGATE_SOURCES ${igate_sources}) + set_target_properties("${target}" PROPERTIES INTERROGATE_DATABASE "${target}.in") # HACK: This is REALLY ugly, but we can't add the _igate.cxx to the existing From 4a9c9bf67c385cf9b8d04fa51c40dd101e358d69 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 12:25:07 -0700 Subject: [PATCH 176/744] Under CMake: Don't interrogate component libs that shouldn't be interrogated! --- panda/src/glgsg/CMakeLists.txt | 1 - panda/src/glstuff/CMakeLists.txt | 5 ++--- panda/src/glxdisplay/CMakeLists.txt | 1 - panda/src/pnmimagetypes/CMakeLists.txt | 1 - panda/src/x11display/CMakeLists.txt | 1 - 5 files changed, 2 insertions(+), 7 deletions(-) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 06645e18e1..6f2fbd9aa7 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -12,5 +12,4 @@ if(HAVE_GL) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES} ${_CG_LIBRARIES}) - target_interrogate(p3glgsg ALL) endif() diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 23327d6c1f..dd983c0801 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -32,6 +32,5 @@ if(HAVE_GL) composite_sources(p3glstuff P3GLSTUFF_SOURCES) add_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) - target_link_libraries(p3glstuff p3pandabase) - target_interrogate(p3glstuff ALL) -endif() \ No newline at end of file + target_link_libraries(p3glstuff p3pandabase p3gobj) +endif() diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 079c6baa1d..975be01ad4 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -23,5 +23,4 @@ if(HAVE_GLX) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) - target_interrogate(p3glxdisplay ALL) endif() diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 02f89a3a6d..295cba0ddb 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -30,4 +30,3 @@ composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) target_link_libraries(p3pnmimagetypes p3pnmimage ${_JPEG_LIBRARIES} ${_TIFF_LIBRARIES} ${_PNG_LIBRARIES}) -target_interrogate(p3pnmimagetypes ALL) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 849bef5e42..bae6e338fc 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -11,5 +11,4 @@ if(HAVE_X11) composite_sources(p3x11display P3X11DISPLAY_SOURCES) add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) - target_interrogate(p3x11display ALL) endif() From 7fa2279eebf6484537254df72168d438cd574a92 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 12:41:01 -0700 Subject: [PATCH 177/744] CMake: Add forgotten multitexReducer.cxx to grutil. --- panda/src/grutil/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 1324beea89..d7d2dd44ce 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -27,6 +27,7 @@ set(P3GRUTIL_SOURCES geoMipTerrain.cxx sceneGraphAnalyzerMeter.cxx heightfieldTesselator.cxx + multitexReducer.cxx nodeVertexTransform.cxx pfmVizzer.cxx pipeOcclusionCullTraverser.cxx From 3960f330ab38fe38463a89bfdbb690c8bcca4dcd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 12:41:13 -0700 Subject: [PATCH 178/744] CMake: Link pgraph against all libraries that it needs. --- panda/src/pgraph/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index b18557fc7f..0eeb65dddc 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -198,9 +198,8 @@ set(P3PGRAPH_SOURCES composite_sources(p3pgraph P3PGRAPH_SOURCES) add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) -target_link_libraries(p3pgraph p3gobj) +target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL) - # p3gobj p3event p3gsgbase p3putil p3linmath p3downloader #begin test_bin_target From 33142e0b595a31691cccd6b39cc3619fc1d9fc06 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 12:41:34 -0700 Subject: [PATCH 179/744] CMake: Build interrogate_module. --- dtool/src/interrogate/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index fd28d48ca9..f5404dc028 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -51,3 +51,8 @@ add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${_OPENSSL_LIBRARIES}) + +add_executable(interrogate_module interrogate_module.cxx) +target_link_libraries(interrogate_module + p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase + p3pystub ${OPENSSL_LIBRARIES}) From cebdcd1d4354615696ca676451cd0bf58382e7a3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 13:47:44 -0700 Subject: [PATCH 180/744] Revert "Revise AutoInclude.cmake: My version of CMake, despite being >=2.8.11, doesn't actually support CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE." This reverts commit 6a38e3c95df00da728cbd253c0bf80c22d0c419b. --- cmake/modules/AutoInclude.cmake | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake index 40916f1e68..3a2f2d74e0 100644 --- a/cmake/modules/AutoInclude.cmake +++ b/cmake/modules/AutoInclude.cmake @@ -4,12 +4,8 @@ # behavior by default. # -# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior if -# this version doesn't define CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. -# CFSworks's version of CMake (2.8.12) doesn't have -# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE even though it should be supported, -# hence test if it's defined (as either ON or OFF) before trying to use it. -if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") +# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. +if(CMAKE_VERSION VERSION_LESS 2.8.11) # Replace some built-in functions in order to extend their functionality. function(add_library target) _add_library(${target} ${ARGN}) @@ -33,16 +29,14 @@ if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") endif() endforeach() - if(interface_dirs) - list(REMOVE_DUPLICATES interface_dirs) + list(REMOVE_DUPLICATES interface_dirs) - #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interface_dirs}) - include_directories(${interface_dirs}) + #NB. target_include_directories is new in 2.8.8. + #target_include_directories("${target}" ${interface_dirs}) + include_directories(${interface_dirs}) - # Update this target's interface inc dirs. - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") - endif() + # Update this target's interface inc dirs. + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") # Call to the built-in function we are overriding. _target_link_libraries(${target} ${ARGN}) From f9d4a3ccef634a3487b512d7878371926462d564 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 15:47:00 -0700 Subject: [PATCH 181/744] CMake: Revert back to rdb's Interrogate. This can be done cleaner. --- cmake/macros/Interrogate.cmake | 99 ++++++++++------------------------ 1 file changed, 27 insertions(+), 72 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index aca30e3148..a118b3f945 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -17,21 +17,13 @@ if(INTERROGATE_VERBOSE) list(APPEND IGATE_FLAGS "-v") endif() -if(INTERROGATE_PYTHON_INTERFACE AND PYTHON_NATIVE) - list(APPEND IGATE_FLAGS -python-native) -endif() - set(IMOD_FLAGS ${INTERROGATE_MODULE_OPTIONS}) -# This is a list of filename extensions that Interrogate will allow in the -# sources lists. -set(INTERROGATE_EXTENSIONS "cxx;h") - # # Function: target_interrogate(target [ALL] [source1 [source2 ...]]) -# Currently, this adds the resultant TARGET_igate.cxx to the target by linking -# it as a library. This is only temporary until the codebase is cleaned up a -# bit more to reduce the dependency on interrogate. +# NB. This doesn't actually invoke interrogate, but merely adds the +# sources to the list of scan sources associated with the target. +# Interrogate will be invoked when add_python_module is called. # If ALL is specified, all of the sources from the associated # target are added. # @@ -60,19 +52,6 @@ function(target_interrogate target) list(REMOVE_DUPLICATES sources) - # Also remove the non-whitelisted filename extensions from sources: - foreach(source ${sources}) - set(any_extension_matches OFF) - foreach(filex ${INTERROGATE_EXTENSIONS}) - if("${source}" MATCHES ".*\\.${filex}$") - set(any_extension_matches ON) - endif() - endforeach(filex) - if(NOT any_extension_matches) - list(REMOVE_ITEM sources "${source}") - endif() - endforeach(source) - # Go through the sources to determine the full name, # and also find out if there are any .N files to pick up. foreach(source ${sources}) @@ -90,53 +69,9 @@ function(target_interrogate target) endif() endforeach(source) - # Interrogate also needs to know the include paths of the current module, - # so we'll run over the include directories property and add those to the - # interrogate command line. - set(igate_includes) - get_target_property(target_includes "${target}" INTERFACE_INCLUDE_DIRECTORIES) - foreach(include_directory ${target_includes}) - set(igate_includes - ${igate_includes} -I "${include_directory}") - endforeach(include_directory) - - add_custom_command( - OUTPUT "${target}_igate.cxx" "${target}.in" - COMMAND interrogate - -od "${target}.in" - -oc "${target}_igate.cxx" - -library ${target} ${IGATE_FLAGS} - -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" - -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" - -S "${PROJECT_BINARY_DIR}/include/parser-inc" - -S "${PROJECT_BINARY_DIR}/include" - ${igate_includes} - ${sources} - DEPENDS interrogate ${deps} - COMMENT "Interrogating ${target}" - ) - - # Now that we've interrogated, let's associate the interrogate sources to - # the target: - set(igate_sources "${target}_igate.cxx") - # Also add all of the _ext sources: - foreach(source ${sources}) - if("${source}" MATCHES ".*_ext.*") - set(igate_sources ${igate_sources} "${source}") - endif() - endforeach(source) - - # Now record INTERROGATE_SOURCES and INTERROGATE_DATABASE to the target: - set_target_properties("${target}" PROPERTIES INTERROGATE_SOURCES ${igate_sources}) - set_target_properties("${target}" PROPERTIES INTERROGATE_DATABASE "${target}.in") - - - # HACK: This is REALLY ugly, but we can't add the _igate.cxx to the existing - # target (or at least, when I tried, it ignored the additional file), so as - # a (very!) temporary workaround, add another library and link it in. - add_library("${target}_igate" ${igate_sources}) - target_link_libraries(${target} ${target}_igate) - + set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${sources}") + set_target_properties("${target}" PROPERTIES IGATE_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") + set_target_properties("${target}" PROPERTIES IGATE_DEPS "${deps}") endif() endfunction(target_interrogate) @@ -148,9 +83,29 @@ function(add_python_module module) if(HAVE_PYTHON AND HAVE_INTERROGATE) set(targets ${ARGN}) set(infiles) + set(sources) foreach(target ${targets}) + get_target_property(scansrc "${target}" IGATE_SOURCES) + get_target_property(srcdir "${target}" IGATE_SRCDIR) + get_target_property(deps "${target}" IGATE_DEPS) + + add_custom_command( + OUTPUT "${target}_igate.cxx" "${target}.in" + COMMAND interrogate + -od "${target}.in" + -oc "${target}_igate.cxx" + -module ${module} -library ${target} ${IGATE_FLAGS} + -srcdir "${srcdir}" + -I "${PROJECT_BINARY_DIR}/include" + -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" + -S "${PROJECT_BINARY_DIR}/include/parser-inc" + ${scansrc} + DEPENDS interrogate ${deps} + ) + list(APPEND infiles "${target}.in") + list(APPEND sources "${target}_igate.cxx") endforeach(target) add_custom_command( @@ -162,7 +117,7 @@ function(add_python_module module) DEPENDS interrogate_module ${infiles} ) - add_library(${module} MODULE "${module}_module.cxx") + add_library(${module} MODULE "${module}_module.cxx" ${sources}) target_link_libraries(${module} ${PYTHON_LIBRARIES}) target_link_libraries(${module} p3interrogatedb) From 82a74dc2816573bf61a90445bc608788ecd66710 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 16:47:00 -0700 Subject: [PATCH 182/744] Revert "Revert "Revise AutoInclude.cmake: My version of CMake, despite being >=2.8.11, doesn't actually support CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE."" This reverts commit a40bfdb9061ceb06925d2756166640b368896946. --- cmake/modules/AutoInclude.cmake | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake index 3a2f2d74e0..40916f1e68 100644 --- a/cmake/modules/AutoInclude.cmake +++ b/cmake/modules/AutoInclude.cmake @@ -4,8 +4,12 @@ # behavior by default. # -# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior. -if(CMAKE_VERSION VERSION_LESS 2.8.11) +# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior if +# this version doesn't define CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. +# CFSworks's version of CMake (2.8.12) doesn't have +# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE even though it should be supported, +# hence test if it's defined (as either ON or OFF) before trying to use it. +if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") # Replace some built-in functions in order to extend their functionality. function(add_library target) _add_library(${target} ${ARGN}) @@ -29,14 +33,16 @@ if(CMAKE_VERSION VERSION_LESS 2.8.11) endif() endforeach() - list(REMOVE_DUPLICATES interface_dirs) + if(interface_dirs) + list(REMOVE_DUPLICATES interface_dirs) - #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interface_dirs}) - include_directories(${interface_dirs}) + #NB. target_include_directories is new in 2.8.8. + #target_include_directories("${target}" ${interface_dirs}) + include_directories(${interface_dirs}) - # Update this target's interface inc dirs. - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") + # Update this target's interface inc dirs. + set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") + endif() # Call to the built-in function we are overriding. _target_link_libraries(${target} ${ARGN}) From 5fd958a9be7ceb7769b66c3176bb6abdd6022542 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 18:55:14 -0700 Subject: [PATCH 183/744] CMake: Completely re-do the Interrogate macro. --- cmake/macros/Interrogate.cmake | 138 +++++++++++++++++++++++---------- 1 file changed, 96 insertions(+), 42 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index a118b3f945..c0d45aa103 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -8,7 +8,14 @@ # add_python_module(module [lib1 [lib2 ...]]) # -set(IGATE_FLAGS ${INTERROGATE_OPTIONS} -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable) +set(IGATE_FLAGS ${INTERROGATE_OPTIONS} -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable -python-native) + +# This is a list of regexes that are applied to every filename. If one of the +# regexes matches, that file will not be passed to Interrogate. +set(INTERROGATE_EXCLUDE_REGEXES + ".*\\.I$" + ".*\\.N$" + ".*_src\\..*") if(WIN32) list(APPEND IGATE_FLAGS -longlong __int64 -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32) @@ -17,7 +24,8 @@ if(INTERROGATE_VERBOSE) list(APPEND IGATE_FLAGS "-v") endif() -set(IMOD_FLAGS ${INTERROGATE_MODULE_OPTIONS}) +set(IMOD_FLAGS ${INTERROGATE_MODULE_OPTIONS} -python-native) + # # Function: target_interrogate(target [ALL] [source1 [source2 ...]]) @@ -31,11 +39,6 @@ function(target_interrogate target) if(HAVE_PYTHON AND HAVE_INTERROGATE) set(sources) set(want_all OFF) - - # Find any .N files that would normally be picked up by interrogate. - # We let CMake add these as dependencies too, to allow rebuilding - # the wrappers when the .N files have been modified. - set(deps) foreach(arg ${ARGV}) if(arg STREQUAL "ALL") set(want_all ON) @@ -52,28 +55,95 @@ function(target_interrogate target) list(REMOVE_DUPLICATES sources) - # Go through the sources to determine the full name, - # and also find out if there are any .N files to pick up. + # Now let's get everything's absolute path, so that it can be passed + # through a property while still preserving the reference. + set(absolute_sources) foreach(source ${sources}) - get_source_file_property(exclude "${source}" WRAP_EXCLUDE) + get_source_file_property(location "${source}" LOCATION) + set(absolute_sources ${absolute_sources} ${location}) + endforeach(source) + + set_target_properties("${target}" PROPERTIES IGATE_SOURCES + "${absolute_sources}") + endif() +endfunction(target_interrogate) + +# +# Function: interrogate_sources(target output database module) +# +# This function actually runs a component-level interrogation against 'target'. +# It generates the outfile.cxx (output) and dbfile.in (database) files, which +# can then be used during the interrogate_module step to produce language +# bindings. +# +# The target must first have had sources selected with target_interrogate. +# Failure to do so will result in an error. +# +function(interrogate_sources target output database module) + if(HAVE_PYTHON AND HAVE_INTERROGATE) + get_target_property(sources "${target}" IGATE_SOURCES) + + if(sources STREQUAL "sources-NOTFOUND") + message(FATAL_ERROR + "Cannot interrogate ${target} unless it's run through target_interrogate first!") + endif() + + set(scan_sources) + foreach(source ${sources}) + get_filename_component(source_basename "${source}" NAME) + + # Only certain sources should actually be scanned by Interrogate. The + # rest are merely dependencies. This uses the exclusion regex above in + # order to determine what files are okay: + set(exclude OFF) + foreach(regex ${INTERROGATE_EXCLUDE_REGEXES}) + if("${source_basename}" MATCHES "${regex}") + set(exclude ON) + endif() + endforeach(regex) + + get_source_file_property(source_excluded ${source} WRAP_EXCLUDE) + if(source_excluded) + set(exclude ON) + endif() if(NOT exclude) - get_filename_component(basename "${source}" NAME_WE) - if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${basename}.N") - list(APPEND deps "${CMAKE_CURRENT_SOURCE_DIR}/${basename}.N") - endif() - - # Add the full path to the source file itself. - get_source_file_property(location "${source}" LOCATION) - list(APPEND deps "${location}") + # This file is to be scanned by Interrogate. In order to avoid + # cluttering up the command line, we should first make it relative: + file(RELATIVE_PATH rel_source "${CMAKE_CURRENT_BINARY_DIR}" "${source}") + list(APPEND scan_sources "${rel_source}") endif() endforeach(source) - set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${sources}") - set_target_properties("${target}" PROPERTIES IGATE_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") - set_target_properties("${target}" PROPERTIES IGATE_DEPS "${deps}") + # Interrogate also needs the include paths, so we'll extract them from the + # target: + set(include_flags) + get_target_property(include_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) + foreach(include_dir ${include_dirs}) + # To keep the command-line small, also make this relative: + file(RELATIVE_PATH rel_include_dir "${CMAKE_CURRENT_BINARY_DIR}" "${include_dir}") + list(APPEND include_flags "-I${rel_include_dir}") + endforeach(include_dir) + # The above must also be included when compiling the resulting _igate.cxx file: + include_directories(${include_dirs}) + + + add_custom_command( + OUTPUT "${output}" "${database}" + COMMAND interrogate + -oc "${output}" + -od "${database}" + -module ${module} -library ${target} ${IGATE_FLAGS} + -S "${PROJECT_BINARY_DIR}/include" + -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" + -S "${PROJECT_BINARY_DIR}/include/parser-inc" + ${include_flags} + ${scan_sources} + DEPENDS interrogate ${sources} + COMMENT "Interrogating ${target}" + ) endif() -endfunction(target_interrogate) +endfunction(interrogate_sources) # # Function: add_python_module(module [lib1 [lib2 ...]]) @@ -86,24 +156,7 @@ function(add_python_module module) set(sources) foreach(target ${targets}) - get_target_property(scansrc "${target}" IGATE_SOURCES) - get_target_property(srcdir "${target}" IGATE_SRCDIR) - get_target_property(deps "${target}" IGATE_DEPS) - - add_custom_command( - OUTPUT "${target}_igate.cxx" "${target}.in" - COMMAND interrogate - -od "${target}.in" - -oc "${target}_igate.cxx" - -module ${module} -library ${target} ${IGATE_FLAGS} - -srcdir "${srcdir}" - -I "${PROJECT_BINARY_DIR}/include" - -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" - -S "${PROJECT_BINARY_DIR}/include/parser-inc" - ${scansrc} - DEPENDS interrogate ${deps} - ) - + interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" "${module}") list(APPEND infiles "${target}.in") list(APPEND sources "${target}_igate.cxx") endforeach(target) @@ -115,11 +168,12 @@ function(add_python_module module) -module ${module} -library ${module} ${IMOD_FLAGS} ${infiles} DEPENDS interrogate_module ${infiles} + COMMENT "Generating module ${module}" ) add_library(${module} MODULE "${module}_module.cxx" ${sources}) - target_link_libraries(${module} ${PYTHON_LIBRARIES}) - target_link_libraries(${module} p3interrogatedb) + target_link_libraries(${module} + ${targets} ${PYTHON_LIBRARIES} p3interrogatedb) set_target_properties(${module} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" From 3f045f85f5625bc58c6013dfbe8bd8112ce18e49 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 18:55:40 -0700 Subject: [PATCH 184/744] CMake: Hack up the Interrogate macro to work when the codebase depends on the Dtool_* stubs. --- cmake/macros/Interrogate.cmake | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index c0d45aa103..b245d19779 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -65,6 +65,9 @@ function(target_interrogate target) set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${absolute_sources}") + + # HACK HACK HACK -- this is part of the below hack. + target_link_libraries(${target} ${target}_igate) endif() endfunction(target_interrogate) @@ -154,11 +157,25 @@ function(add_python_module module) set(targets ${ARGN}) set(infiles) set(sources) + set(HACKlinklibs) foreach(target ${targets}) interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" "${module}") list(APPEND infiles "${target}.in") - list(APPEND sources "${target}_igate.cxx") + #list(APPEND sources "${target}_igate.cxx") + + # HACK HACK HACK: + # Currently, the codebase has dependencies on the Interrogate-generated + # code when HAVE_PYTHON is enabled. rdb is working to remove this, but + # until then, the generated code must somehow be made available to the + # modules themselves. The workaround here is to put the _igate.cxx into + # its own micro-library, which is linked both here on the module and + # against the component library in question. + add_library(${target}_igate ${target}_igate.cxx) + list(APPEND HACKlinklibs "${target}_igate") + + get_target_property(target_links "${target}" INTERFACE_LINK_LIBRARIES) + target_link_libraries(${target}_igate ${target_links}) endforeach(target) add_custom_command( @@ -174,6 +191,7 @@ function(add_python_module module) add_library(${module} MODULE "${module}_module.cxx" ${sources}) target_link_libraries(${module} ${targets} ${PYTHON_LIBRARIES} p3interrogatedb) + target_link_libraries(${module} ${HACKlinklibs}) set_target_properties(${module} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" From ba4f2ac3e83812eb0a63aacc8b467ae992a19abb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 30 Jan 2014 18:58:21 -0700 Subject: [PATCH 185/744] CMake: Add the 'core' Python module for all of the currently-built component libraries. --- panda/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 2b91951da3..b982d2668d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -61,3 +61,8 @@ add_subdirectory(src/testbed) add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandagl) add_subdirectory(metalibs/pandaegg) + +add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph + p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath + p3mathutil p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage + p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) From 20daa755f048f4ef8d8fbb90f686936f71bfd3e7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 31 Jan 2014 09:10:23 -0700 Subject: [PATCH 186/744] CMake: Update Interrogate macro to make paths relative to CMake source directory. --- cmake/macros/Interrogate.cmake | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index b245d19779..320bc400b7 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -66,6 +66,15 @@ function(target_interrogate target) set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${absolute_sources}") + # CMake has no property for determining the source directory where the + # target was originally added. interrogate_sources makes use of this + # property (if it is set) in order to make all paths on the command-line + # relative to it, thereby shortening the command-line even more. + # Since this is not an Interrogate-specific property, it is not named with + # an IGATE_ prefix. + set_target_properties("${target}" PROPERTIES TARGET_SRCDIR + "${CMAKE_CURRENT_SOURCE_DIR}") + # HACK HACK HACK -- this is part of the below hack. target_link_libraries(${target} ${target}_igate) endif() @@ -91,6 +100,13 @@ function(interrogate_sources target output database module) "Cannot interrogate ${target} unless it's run through target_interrogate first!") endif() + get_target_property(srcdir "${target}" TARGET_SRCDIR) + if(srcdir STREQUAL "srcdir-NOTFOUND") + # No TARGET_SRCDIR was set, so we'll do everything relative to our + # current binary dir instead: + set(srcdir "${CMAKE_CURRENT_BINARY_DIR}") + endif() + set(scan_sources) foreach(source ${sources}) get_filename_component(source_basename "${source}" NAME) @@ -113,7 +129,7 @@ function(interrogate_sources target output database module) if(NOT exclude) # This file is to be scanned by Interrogate. In order to avoid # cluttering up the command line, we should first make it relative: - file(RELATIVE_PATH rel_source "${CMAKE_CURRENT_BINARY_DIR}" "${source}") + file(RELATIVE_PATH rel_source "${srcdir}" "${source}") list(APPEND scan_sources "${rel_source}") endif() endforeach(source) @@ -124,6 +140,8 @@ function(interrogate_sources target output database module) get_target_property(include_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) foreach(include_dir ${include_dirs}) # To keep the command-line small, also make this relative: + # Note that Interrogate does NOT handle -I paths relative to -srcdir, so + # we make them relative to the directory where it's invoked. file(RELATIVE_PATH rel_include_dir "${CMAKE_CURRENT_BINARY_DIR}" "${include_dir}") list(APPEND include_flags "-I${rel_include_dir}") endforeach(include_dir) @@ -136,6 +154,7 @@ function(interrogate_sources target output database module) COMMAND interrogate -oc "${output}" -od "${database}" + -srcdir "${srcdir}" -module ${module} -library ${target} ${IGATE_FLAGS} -S "${PROJECT_BINARY_DIR}/include" -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" From 75c1b937f83453d285ff2a131b8c464261bd6011 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 31 Jan 2014 12:36:52 -0700 Subject: [PATCH 187/744] CMake: Use "NOT varname" instead of testing for equality to -NOTFOUND. --- cmake/macros/Interrogate.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 320bc400b7..5c3877b1e4 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -95,13 +95,13 @@ function(interrogate_sources target output database module) if(HAVE_PYTHON AND HAVE_INTERROGATE) get_target_property(sources "${target}" IGATE_SOURCES) - if(sources STREQUAL "sources-NOTFOUND") + if(NOT sources) message(FATAL_ERROR "Cannot interrogate ${target} unless it's run through target_interrogate first!") endif() get_target_property(srcdir "${target}" TARGET_SRCDIR) - if(srcdir STREQUAL "srcdir-NOTFOUND") + if(NOT srcdir) # No TARGET_SRCDIR was set, so we'll do everything relative to our # current binary dir instead: set(srcdir "${CMAKE_CURRENT_BINARY_DIR}") From 57944c58d176d0932cf36891797c61699c8c518e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 31 Jan 2014 13:30:47 -0700 Subject: [PATCH 188/744] CMake: Invoke Interrogate with the same compiler definitions as the source itself. --- cmake/macros/Interrogate.cmake | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 5c3877b1e4..3dce5256b0 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -148,6 +148,19 @@ function(interrogate_sources target output database module) # The above must also be included when compiling the resulting _igate.cxx file: include_directories(${include_dirs}) + # Get the compiler definition flags. These must be passed to Interrogate + # in the same way that they are passed to the compiler so that Interrogate + # will preprocess each file in the same way. + set(define_flags) + get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) + foreach(target_define ${target_defines}) + list(APPEND define_flags "-D${target_define}") + endforeach(target_define) + # If this is a release build that has NDEBUG defined, we need that too: + string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) + if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") + list(APPEND define_flags "-DNDEBUG") + endif() add_custom_command( OUTPUT "${output}" "${database}" @@ -155,7 +168,9 @@ function(interrogate_sources target output database module) -oc "${output}" -od "${database}" -srcdir "${srcdir}" - -module ${module} -library ${target} ${IGATE_FLAGS} + -module ${module} -library ${target} + ${IGATE_FLAGS} + ${define_flags} -S "${PROJECT_BINARY_DIR}/include" -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" -S "${PROJECT_BINARY_DIR}/include/parser-inc" From e3cee4f5cde3be0d24e254f3ebe37786a7269b54 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 31 Jan 2014 13:41:01 -0700 Subject: [PATCH 189/744] CMake: Add .N files to deps for Interrogate command. --- cmake/macros/Interrogate.cmake | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 3dce5256b0..a74a20079d 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -108,6 +108,7 @@ function(interrogate_sources target output database module) endif() set(scan_sources) + set(nfiles) foreach(source ${sources}) get_filename_component(source_basename "${source}" NAME) @@ -131,6 +132,16 @@ function(interrogate_sources target output database module) # cluttering up the command line, we should first make it relative: file(RELATIVE_PATH rel_source "${srcdir}" "${source}") list(APPEND scan_sources "${rel_source}") + + # Also see if this file has a .N counterpart, which has directives + # specific for Interrogate. If there is a .N file, we add it as a dep, + # so that CMake will rerun Interrogate if the .N files are modified: + get_filename_component(source_path "${source}" PATH) + get_filename_component(source_name_we "${source}" NAME_WE) + set(nfile "${source_path}/${source_name_we}.N") + if(EXISTS "${nfile}") + list(APPEND nfiles "${nfile}") + endif() endif() endforeach(source) @@ -176,7 +187,7 @@ function(interrogate_sources target output database module) -S "${PROJECT_BINARY_DIR}/include/parser-inc" ${include_flags} ${scan_sources} - DEPENDS interrogate ${sources} + DEPENDS interrogate ${sources} ${nfiles} COMMENT "Interrogating ${target}" ) endif() From e150492355dc6f4aa7b2a006a9ddf4be3d8f2042 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 1 Feb 2014 14:24:22 -0700 Subject: [PATCH 190/744] CMake: Use LINK_LIBRARIES instead of INTERFACE_LINK_LIBRARIES in Interrogate macro, for compatibility with CMake < 2.8.12. --- cmake/macros/Interrogate.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index a74a20079d..486fdb0f84 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -219,7 +219,7 @@ function(add_python_module module) add_library(${target}_igate ${target}_igate.cxx) list(APPEND HACKlinklibs "${target}_igate") - get_target_property(target_links "${target}" INTERFACE_LINK_LIBRARIES) + get_target_property(target_links "${target}" LINK_LIBRARIES) target_link_libraries(${target}_igate ${target_links}) endforeach(target) From 6e86570b9a14673bf13dc59049f3108ab5ea2e36 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 2 Feb 2014 10:12:18 +0100 Subject: [PATCH 191/744] ppremake-style output report --- dtool/LocalSetup.cmake | 278 +++++++++++++++++++++++++++++++++++++++-- dtool/Package.cmake | 3 - 2 files changed, 270 insertions(+), 11 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 009a45939f..43c626dcc7 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -180,15 +180,276 @@ else() endif() # Now go through all the packages and report whether we have them. -message(STATUS "Configuring support for the following optional third-party packages:") - -#report_package(EIGEN "Eigen linear algebra library") -if(LINMATH_ALIGN) - message("+ (vectorization enabled in build)") +message("") +message("Configuring support for the following optional third-party packages:") +if(HAVE_EIGEN) + message("+ Eigen linear algebra library") + if(LINMATH_ALIGN) + message("+ (vectorization enabled in build)") + else() + message("- (vectorization NOT enabled in build)") + endif() else() - message("- (vectorization NOT enabled in build)") + message("- Did not find Eigen linear algebra library") endif() +if(HAVE_OPENSSL) + message("+ OpenSSL") +else() + message("- Did not find OpenSSL") +endif() + +if(HAVE_JPEG) + message("+ libjpeg") +else() + message("- Did not find libjpeg") +endif() + +if(HAVE_PNG) + message("+ libpng") +else() + message("- Did not find libpng") +endif() + +if(HAVE_TIFF) + message("+ libtiff") +else() + message("- Did not find libtiff") +endif() + +if(HAVE_TAR) + message("+ libtar") +else() + message("- Did not find libtar") +endif() + +if(HAVE_FFTW) + message("+ fftw") +else() + message("- Did not find fftw") +endif() + +if(HAVE_SQUISH) + message("+ squish") +else() + message("- Did not find squish") +endif() + +if(HAVE_CG) + message("+ Nvidia Cg High Level Shading Language") +else() + message("- Did not find Nvidia Cg High Level Shading Language") +endif() + +if(HAVE_CGGL) + message("+ Cg OpenGL API") +else() + message("- Did not find Cg OpenGL API") +endif() + +if(HAVE_CGDX8) + message("+ Cg DX8 API") +else() + message("- Did not find Cg DX8 API") +endif() + +if(HAVE_CGDX9) + message("+ Cg DX9 API") +else() + message("- Did not find Cg DX9 API") +endif() + +if(HAVE_CGDX10) + message("+ Cg DX10 API") +else() + message("- Did not find Cg DX10 API") +endif() + +if(HAVE_VRPN) + message("+ VRPN") +else() + message("- Did not find VRPN") +endif() + +if(HAVE_ZLIB) + message("+ zlib") +else() + message("- Did not find zlib") +endif() + +if(HAVE_RAD_MSS) + message("+ Miles Sound System") +else() + message("- Did not find Miles Sound System") +endif() + +if(HAVE_FMODEX) + message("+ FMOD Ex sound library") +else() + message("- Did not find FMOD Ex sound library") +endif() + +if(HAVE_OPENAL) + message("+ OpenAL sound library") +else() + message("- Did not find OpenAL sound library") +endif() + +if(HAVE_PHYSX) + message("+ Ageia PhysX") +else() + message("- Did not find Ageia PhysX") +endif() + +if(HAVE_SPEEDTREE) + message("+ SpeedTree") +else() + message("- Did not find SpeedTree") +endif() + +if(HAVE_GTK) + message("+ gtk+-2") +else() + message("- Did not find gtk+-2") +endif() + +if(HAVE_FREETYPE) + message("+ Freetype") +else() + message("- Did not find Freetype") +endif() + +if(HAVE_WX) + message("+ WxWidgets") +else() + message("- Did not find WxWidgets") +endif() + +if(HAVE_FLTK) + message("+ FLTK") +else() + message("- Did not find FLTK") +endif() + +if(HAVE_GL) + message("+ OpenGL") +else() + message("- Did not find OpenGL") +endif() + +if(HAVE_GLES) + message("+ OpenGL ES 1") +else() + message("- Did not find OpenGL ES 1") +endif() + +if(HAVE_GLES2) + message("+ OpenGL ES 2") +else() + message("- Did not find OpenGL ES 2") +endif() + +if(HAVE_DX8) + message("+ DirectX8") +else() + message("- Did not find DirectX8") +endif() + +if(HAVE_DX9) + message("+ DirectX9") +else() + message("- Did not find DirectX9") +endif() + +if(HAVE_TINYDISPLAY) + message("+ Tinydisplay") +else() + message("- Not building Tinydisplay") +endif() + +if(HAVE_X11) + message("+ X11") +else() + message("- Did not find X11") +endif() + +if(HAVE_MESA) + message("+ Mesa") +else() + message("- Did not find Mesa") +endif() + +if(HAVE_OPENCV) + message("+ OpenCV") +else() + message("- Did not find OpenCV") +endif() + +if(HAVE_FFMPEG) + message("+ FFMPEG") +else() + message("- Did not find FFMPEG") +endif() + +if(HAVE_ODE) + message("+ ODE") +else() + message("- Did not find ODE") +endif() + +if(HAVE_AWESOMIUM) + message("+ AWESOMIUM") +else() + message("- Did not find AWESOMIUM") +endif() + +if(HAVE_MAYA) + message("+ OpenMaya") +else() + message("- Did not find OpenMaya") +endif() + +if(HAVE_FCOLLADA) + message("+ FCollada") +else() + message("- Did not find FCollada") +endif() + +if(HAVE_ASSIMP) + message("+ Assimp") +else() + message("- Did not find Assimp") +endif() + +if(HAVE_ARTOOLKIT) + message("+ ARToolKit") +else() + message("- Did not find ARToolKit") +endif() + +if(HAVE_ROCKET) + if(HAVE_ROCKET_PYTHON) + message("+ libRocket with Python bindings") + else() + message("+ libRocket without Python bindings") + endif() +else() + message("- Did not find libRocket") +endif() + +if(HAVE_BULLET) + message("+ Bullet Physics") +else() + message("- Did not find Bullet Physics") +endif() + +if(HAVE_VORBIS) + message("+ libvorbis (Ogg Vorbis Decoder)") +else() + message("- Did not find libvorbis (Ogg Vorbis Decoder)") +endif() + +message("") if(HAVE_INTERROGATE AND HAVE_PYTHON) message("Compilation will generate Python interfaces.") else() @@ -198,10 +459,8 @@ endif() if(HAVE_THREADS) if(SIMPLE_THREADS) message("Compilation will include simulated threading support.") - elseif(DO_PIPELINING) message("Compilation will include full, pipelined threading support.") - else() message("Compilation will include nonpipelined threading support.") endif() @@ -209,8 +468,11 @@ else() message("Configuring Panda without threading support.") endif() +message("") message("See dtool_config.h for more details about the specified configuration.") +message("") + # Generate dtool_config.h configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") include_directories("${PROJECT_BINARY_DIR}/include") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 57794458b2..7a56ce1edb 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,6 +1,3 @@ -message(STATUS "") -message(STATUS "Configuring support for the following optional third-party packages:") - # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From 710568fb286e882db2376560dcd2c2d275e1bf63 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 2 Feb 2014 12:31:06 +0100 Subject: [PATCH 192/744] HAVE_GTK -> HAVE_GTK2 --- dtool/LocalSetup.cmake | 2 +- dtool/Package.cmake | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 43c626dcc7..0e64a6eeb6 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -307,7 +307,7 @@ else() message("- Did not find SpeedTree") endif() -if(HAVE_GTK) +if(HAVE_GTK2) message("+ gtk+-2") else() message("- Did not find gtk+-2") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 7a56ce1edb..35447f9dab 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -23,9 +23,8 @@ package_option(FREETYPE) 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) -set(GTK_FOUND ${GTK2_FOUND}) # Mangle for convenience -#config_package(GTK "gtk+-2") -package_option(GTK) +#config_package(GTK2 "gtk+-2") +package_option(GTK2) # Find and configure WxWidgets find_package(wxWidgets QUIET) From fd9aec6ee74abe01853f6342d9cc4a140378f698 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Feb 2014 12:24:18 -0700 Subject: [PATCH 193/744] CMake: Fix Interrogate's dependency on the *_composite#.cxx files by creating an explicit target that can be used to do composite generation. --- cmake/macros/CompositeSources.cmake | 8 +++++++- cmake/macros/Interrogate.cmake | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index f2fc29426d..631de638f9 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -84,7 +84,7 @@ function(composite_sources target sources_var) -DCOMPOSITE_FILE="${composite_file}" -DCOMPOSITE_SOURCES="${composite_sources}" -P "${COMPOSITE_GENERATOR}" - DEPENDS ${composite_sources}) + DEPENDS ${composite_sources}) # Reset for the next composite file. set(composite_sources "") @@ -93,6 +93,12 @@ function(composite_sources target sources_var) endif() endwhile() + # This exists for Interrogate's benefit, which needs the composite files to + # exist before it can run. Unfortunately, CMake does not expose the + # add_custom_command outputs as targets outside of the directory, so we have + # to create our own pseudotarget that gets exposed. + add_custom_target(${target}_composite DEPENDS ${composite_files}) + #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) # The new files are added to the existing files, which means the old files diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 486fdb0f84..47509f96de 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -173,6 +173,14 @@ function(interrogate_sources target output database module) list(APPEND define_flags "-DNDEBUG") endif() + # CMake offers no way to directly depend on the composite files from here, + # because the composite files are created in a different directory from + # where CMake itself is run. Therefore, we need to depend on the + # TARGET_composite target, if it exists. + if(TARGET ${target}_composite) + set(sources ${target}_composite ${sources}) + endif() + add_custom_command( OUTPUT "${output}" "${database}" COMMAND interrogate From df69bba34aa3b59c84570ba94365f03a15b12a5f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Feb 2014 14:55:17 -0700 Subject: [PATCH 194/744] CMake: Fix typos in Interrogate. --- cmake/macros/Interrogate.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 47509f96de..e4c4c03af4 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -15,6 +15,8 @@ set(IGATE_FLAGS ${INTERROGATE_OPTIONS} -DCPPPARSER -D__cplusplus -Dvolatile -Dmu set(INTERROGATE_EXCLUDE_REGEXES ".*\\.I$" ".*\\.N$" + ".*\\.lxx$" + ".*\\.yxx$" ".*_src\\..*") if(WIN32) @@ -39,11 +41,11 @@ function(target_interrogate target) if(HAVE_PYTHON AND HAVE_INTERROGATE) set(sources) set(want_all OFF) - foreach(arg ${ARGV}) + foreach(arg ${ARGN}) if(arg STREQUAL "ALL") set(want_all ON) else() - list(APPEND sources "${source}") + list(APPEND sources "${arg}") endif() endforeach() From 2872c14c8f5f5d83451337cb41bf58259a2e30a4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Feb 2014 14:55:43 -0700 Subject: [PATCH 195/744] CMake: Get egg to interrogate. --- panda/CMakeLists.txt | 5 +++-- panda/src/egg/CMakeLists.txt | 11 +++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b982d2668d..f648f44d2c 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -27,8 +27,6 @@ add_subdirectory(src/putil) add_subdirectory(src/pstatclient) add_subdirectory(src/linmath) add_subdirectory(src/event) -add_subdirectory(src/egg) -add_subdirectory(src/egg2pg) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) add_subdirectory(src/glstuff) @@ -54,6 +52,8 @@ add_subdirectory(src/tform) add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) +add_subdirectory(src/egg) +add_subdirectory(src/egg2pg) add_subdirectory(src/framework) add_subdirectory(src/testbed) @@ -66,3 +66,4 @@ add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) +add_python_module(egg p3egg p3egg2pg) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 0a1800fd35..c397beb6b4 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -86,12 +86,15 @@ if(HAVE_EGG) vector_PT_EggMaterial.cxx pt_EggTexture.cxx vector_PT_EggTexture.cxx pt_EggVertex.cxx vector_PT_EggVertex.cxx - lexer.cxx - parser.cxx ) + # These cannot be interrogated, and are excluded from the composites. + set(P3EGG_PARSER_SOURCES + parser.cxx + lexer.cxx) + composite_sources(p3egg P3EGG_SOURCES) - add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES}) + add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) - target_interrogate(p3egg ALL) + target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES}) endif() From 8cd41a48af6b6bb95aa04fc21f1df656c6c99b0b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Feb 2014 11:54:51 -0700 Subject: [PATCH 196/744] CMake: Detect 64-bit vs. 32-bit when running Interrogate. --- cmake/macros/Interrogate.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index e4c4c03af4..19d678a8e6 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -174,6 +174,10 @@ function(interrogate_sources target output database module) if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") list(APPEND define_flags "-DNDEBUG") endif() + # In addition, Interrogate needs to know if this is a 64-bit build: + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + list(APPEND define_flags "-D_LP64") + endif() # CMake offers no way to directly depend on the composite files from here, # because the composite files are created in a different directory from From c4ade7f8b995a2bcacaeef08971c1ab8a8c0a91e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Feb 2014 12:09:20 -0700 Subject: [PATCH 197/744] Move OpenSSL parser-inc files to openssl/ subdirectory. --- dtool/src/parser-inc/{ => openssl}/crypto.h | 0 dtool/src/parser-inc/{ => openssl}/err.h | 0 dtool/src/parser-inc/{ => openssl}/evp.h | 0 dtool/src/parser-inc/{ => openssl}/md5.h | 0 dtool/src/parser-inc/{ => openssl}/pem.h | 0 dtool/src/parser-inc/{ => openssl}/rand.h | 0 dtool/src/parser-inc/{ => openssl}/rsa.h | 0 dtool/src/parser-inc/{ => openssl}/ssl.h | 0 dtool/src/parser-inc/{ => openssl}/x509.h | 0 dtool/src/parser-inc/{ => openssl}/x509v3.h | 0 10 files changed, 0 insertions(+), 0 deletions(-) rename dtool/src/parser-inc/{ => openssl}/crypto.h (100%) rename dtool/src/parser-inc/{ => openssl}/err.h (100%) rename dtool/src/parser-inc/{ => openssl}/evp.h (100%) rename dtool/src/parser-inc/{ => openssl}/md5.h (100%) rename dtool/src/parser-inc/{ => openssl}/pem.h (100%) rename dtool/src/parser-inc/{ => openssl}/rand.h (100%) rename dtool/src/parser-inc/{ => openssl}/rsa.h (100%) rename dtool/src/parser-inc/{ => openssl}/ssl.h (100%) rename dtool/src/parser-inc/{ => openssl}/x509.h (100%) rename dtool/src/parser-inc/{ => openssl}/x509v3.h (100%) diff --git a/dtool/src/parser-inc/crypto.h b/dtool/src/parser-inc/openssl/crypto.h similarity index 100% rename from dtool/src/parser-inc/crypto.h rename to dtool/src/parser-inc/openssl/crypto.h diff --git a/dtool/src/parser-inc/err.h b/dtool/src/parser-inc/openssl/err.h similarity index 100% rename from dtool/src/parser-inc/err.h rename to dtool/src/parser-inc/openssl/err.h diff --git a/dtool/src/parser-inc/evp.h b/dtool/src/parser-inc/openssl/evp.h similarity index 100% rename from dtool/src/parser-inc/evp.h rename to dtool/src/parser-inc/openssl/evp.h diff --git a/dtool/src/parser-inc/md5.h b/dtool/src/parser-inc/openssl/md5.h similarity index 100% rename from dtool/src/parser-inc/md5.h rename to dtool/src/parser-inc/openssl/md5.h diff --git a/dtool/src/parser-inc/pem.h b/dtool/src/parser-inc/openssl/pem.h similarity index 100% rename from dtool/src/parser-inc/pem.h rename to dtool/src/parser-inc/openssl/pem.h diff --git a/dtool/src/parser-inc/rand.h b/dtool/src/parser-inc/openssl/rand.h similarity index 100% rename from dtool/src/parser-inc/rand.h rename to dtool/src/parser-inc/openssl/rand.h diff --git a/dtool/src/parser-inc/rsa.h b/dtool/src/parser-inc/openssl/rsa.h similarity index 100% rename from dtool/src/parser-inc/rsa.h rename to dtool/src/parser-inc/openssl/rsa.h diff --git a/dtool/src/parser-inc/ssl.h b/dtool/src/parser-inc/openssl/ssl.h similarity index 100% rename from dtool/src/parser-inc/ssl.h rename to dtool/src/parser-inc/openssl/ssl.h diff --git a/dtool/src/parser-inc/x509.h b/dtool/src/parser-inc/openssl/x509.h similarity index 100% rename from dtool/src/parser-inc/x509.h rename to dtool/src/parser-inc/openssl/x509.h diff --git a/dtool/src/parser-inc/x509v3.h b/dtool/src/parser-inc/openssl/x509v3.h similarity index 100% rename from dtool/src/parser-inc/x509v3.h rename to dtool/src/parser-inc/openssl/x509v3.h From 3dc38e0f612c3ab63ff81f34ee78543f471f7f01 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Feb 2014 21:39:06 -0700 Subject: [PATCH 198/744] CMake: Move ${INTERROGATE_*_OPTIONS} expansion to the add_custom_command proper; other CMake files may wish to set this after Interrogate.cmake is loaded. --- cmake/macros/Interrogate.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 19d678a8e6..7857425c2b 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -8,7 +8,7 @@ # add_python_module(module [lib1 [lib2 ...]]) # -set(IGATE_FLAGS ${INTERROGATE_OPTIONS} -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable -python-native) +set(IGATE_FLAGS -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable -python-native) # This is a list of regexes that are applied to every filename. If one of the # regexes matches, that file will not be passed to Interrogate. @@ -26,7 +26,7 @@ if(INTERROGATE_VERBOSE) list(APPEND IGATE_FLAGS "-v") endif() -set(IMOD_FLAGS ${INTERROGATE_MODULE_OPTIONS} -python-native) +set(IMOD_FLAGS -python-native) # @@ -194,6 +194,7 @@ function(interrogate_sources target output database module) -od "${database}" -srcdir "${srcdir}" -module ${module} -library ${target} + ${INTERROGATE_OPTIONS} ${IGATE_FLAGS} ${define_flags} -S "${PROJECT_BINARY_DIR}/include" @@ -242,6 +243,7 @@ function(add_python_module module) COMMAND interrogate_module -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" -module ${module} -library ${module} + ${INTERROGATE_MODULE_OPTIONS} ${IMOD_FLAGS} ${infiles} DEPENDS interrogate_module ${infiles} COMMENT "Generating module ${module}" From eced41b7c3100ceed7736c15ed0c1770ddf6b600 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Feb 2014 21:47:27 -0700 Subject: [PATCH 199/744] CMake: Move Interrogate.cmake's _LP64 detection to the top of the script, where it gets added to IGATE_FLAGS. --- cmake/macros/Interrogate.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 7857425c2b..20e10282cc 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -10,6 +10,12 @@ set(IGATE_FLAGS -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable -python-native) +# In addition, Interrogate needs to know if this is a 64-bit build: +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + list(APPEND IGATE_FLAGS "-D_LP64") +endif() + + # This is a list of regexes that are applied to every filename. If one of the # regexes matches, that file will not be passed to Interrogate. set(INTERROGATE_EXCLUDE_REGEXES @@ -174,10 +180,6 @@ function(interrogate_sources target output database module) if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") list(APPEND define_flags "-DNDEBUG") endif() - # In addition, Interrogate needs to know if this is a 64-bit build: - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - list(APPEND define_flags "-D_LP64") - endif() # CMake offers no way to directly depend on the composite files from here, # because the composite files are created in a different directory from From de9ea2a750af710b40d9184c22d14fdc8ff90dd8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Feb 2014 21:57:27 -0700 Subject: [PATCH 200/744] CMake: For Interrogate 64/32-bit detection, check sizeof(long) rather than sizeof(void*). --- cmake/macros/Interrogate.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 20e10282cc..3d9d7d3386 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -11,7 +11,9 @@ set(IGATE_FLAGS -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable -python-native) # In addition, Interrogate needs to know if this is a 64-bit build: -if(CMAKE_SIZEOF_VOID_P EQUAL 8) +include(CheckTypeSize) +check_type_size(long CMAKE_SIZEOF_LONG) +if(CMAKE_SIZEOF_LONG EQUAL 8) list(APPEND IGATE_FLAGS "-D_LP64") endif() From 2a85cd7a5b2f826d20e2ac86e7543e682eaf18c4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 11:28:06 -0700 Subject: [PATCH 201/744] CMake: dtoolbase/dtoolutil may need to link against Python. --- dtool/src/dtoolbase/CMakeLists.txt | 4 +++- dtool/src/dtoolutil/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 92edf9886e..98c7ed19e9 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -62,4 +62,6 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) - +if(HAVE_PYTHON) + target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES}) +endif() diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index c631b027ea..a7c94098ac 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -52,3 +52,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) +if(HAVE_PYTHON) + target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) +endif() From 918e2eed664da8e7315deb31750f394e6beb74e2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 11:28:42 -0700 Subject: [PATCH 202/744] CMake: Begin work on direct, get autorestart to compile. --- CMakeLists.txt | 2 ++ direct/CMakeLists.txt | 14 ++++++++++++++ direct/src/autorestart/CMakeLists.txt | 3 +++ 3 files changed, 19 insertions(+) create mode 100644 direct/CMakeLists.txt create mode 100644 direct/src/autorestart/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index d7e0799c7c..8c242ea016 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,3 +37,5 @@ endif() if(BUILD_PANDA) add_subdirectory(panda) endif() + +add_subdirectory(direct) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt new file mode 100644 index 0000000000..dc68056ab3 --- /dev/null +++ b/direct/CMakeLists.txt @@ -0,0 +1,14 @@ +# Include source directories which have C++ components: +add_subdirectory(src/autorestart) +#add_subdirectory(src/dcparser) +#add_subdirectory(src/dcparse) +#add_subdirectory(src/deadrec) +#add_subdirectory(src/directbase) +#add_subdirectory(src/directdServer) +#add_subdirectory(src/directd) +#add_subdirectory(src/distributed) +#add_subdirectory(src/heapq) +#add_subdirectory(src/http) +#add_subdirectory(src/interval) +#add_subdirectory(src/motiontrail) +#add_subdirectory(src/showbase) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt new file mode 100644 index 0000000000..8847a518cc --- /dev/null +++ b/direct/src/autorestart/CMakeLists.txt @@ -0,0 +1,3 @@ +add_definitions(-DWITHIN_PANDA) +add_executable(autorestart autorestart.c) +target_link_libraries(autorestart p3dtool) From 95e25af828be83f4bf234e2d7ae34f612586f743 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:56:04 -0700 Subject: [PATCH 203/744] CMake: Update Interrogate.cmake macro's use of COMPILE_DEFINITIONS: - Slightly older versions of CMake default this to NOTFOUND, so test before iterating. - Add to local definitions for building the _igate sources. --- cmake/macros/Interrogate.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 3d9d7d3386..3a9c998226 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -174,9 +174,13 @@ function(interrogate_sources target output database module) # will preprocess each file in the same way. set(define_flags) get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) - foreach(target_define ${target_defines}) - list(APPEND define_flags "-D${target_define}") - endforeach(target_define) + if(target_defines) + foreach(target_define ${target_defines}) + list(APPEND define_flags "-D${target_define}") + # And add the same definition when we compile the _igate.cxx file: + add_definitions("-D${target_define}") + endforeach(target_define) + endif() # If this is a release build that has NDEBUG defined, we need that too: string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") From 470611a473bdc377fa54e30db09439dc7a63f0de Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:57:03 -0700 Subject: [PATCH 204/744] CMake: Interrogate/build nativenet, net. --- panda/CMakeLists.txt | 6 ++++-- panda/src/nativenet/CMakeLists.txt | 30 ++++++++++++++++++++++++++++ panda/src/net/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 panda/src/nativenet/CMakeLists.txt create mode 100644 panda/src/net/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f648f44d2c..30ddcd6877 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -52,6 +52,8 @@ add_subdirectory(src/tform) add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) +add_subdirectory(src/nativenet) +add_subdirectory(src/net) add_subdirectory(src/egg) add_subdirectory(src/egg2pg) add_subdirectory(src/framework) @@ -64,6 +66,6 @@ add_subdirectory(metalibs/pandaegg) add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath - p3mathutil p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage - p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) + p3mathutil p3nativenet p3net p3parametrics p3pgraph p3pgraphnodes p3pgui + p3pipeline p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) add_python_module(egg p3egg p3egg2pg) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt new file mode 100644 index 0000000000..3e13361410 --- /dev/null +++ b/panda/src/nativenet/CMakeLists.txt @@ -0,0 +1,30 @@ +if(WANT_NATIVE_NET) + set(P3NATIVENET_HEADERS + buffered_datagramconnection.h + buffered_datagramreader.h buffered_datagramreader.i + ringbuffer.h ringbuffer.i socket_ip.h + socket_tcp_listen.h time_accumulator.h time_out.h + socket_address.h + socket_portable.h time_base.h time_span.h buffered_datagramwriter.h + socket_base.h socket_selector.h + socket_udp.h + socket_udp_incoming.h time_clock.h + membuffer.h membuffer.i socket_fdset.h socket_tcp.h + socket_udp_outgoing.h time_general.h) + + set(P3NATIVENET_SOURCES + config_nativenet.cxx + buffered_datagramconnection.cxx + socket_ip.cxx + socket_tcp.cxx + socket_tcp_listen.cxx + socket_tcp_ssl.cxx + socket_udp.cxx + socket_udp_incoming.cxx + socket_udp_outgoing.cxx) + + composite_sources(p3nativenet P3NATIVENET_SOURCES) + add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) + target_link_libraries(p3nativenet p3express p3pandabase) + target_interrogate(p3nativenet ALL) +endif() diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt new file mode 100644 index 0000000000..9fec4780fc --- /dev/null +++ b/panda/src/net/CMakeLists.txt @@ -0,0 +1,32 @@ +if(HAVE_NET AND WANT_NATIVE_NET) + set(P3NET_HEADERS + config_net.h connection.h connectionListener.h + connectionManager.N connectionManager.h + connectionReader.I connectionReader.h + connectionWriter.h datagramQueue.h + datagramTCPHeader.I datagramTCPHeader.h + datagramUDPHeader.I datagramUDPHeader.h + netAddress.h netDatagram.I netDatagram.h + datagramGeneratorNet.I datagramGeneratorNet.h + datagramSinkNet.I datagramSinkNet.h + queuedConnectionListener.I + queuedConnectionListener.h queuedConnectionManager.h + queuedConnectionReader.h recentConnectionReader.h + queuedReturn.h queuedReturn.I) + + set(P3NET_SOURCES + config_net.cxx connection.cxx connectionListener.cxx + connectionManager.cxx connectionReader.cxx + connectionWriter.cxx datagramQueue.cxx datagramTCPHeader.cxx + datagramUDPHeader.cxx netAddress.cxx netDatagram.cxx + datagramGeneratorNet.cxx + datagramSinkNet.cxx + queuedConnectionListener.cxx + queuedConnectionManager.cxx queuedConnectionReader.cxx + recentConnectionReader.cxx) + + composite_sources(p3net P3NET_SOURCES) + add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) + target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) + target_interrogate(p3net ALL) +endif() From 89797d78d6463280fa2c9c850caaa776a982557b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:58:52 -0700 Subject: [PATCH 205/744] CMake: Work on direct; get dcparse, dcparser, deadrec, directbase, distributed to build+Interrogate. --- direct/CMakeLists.txt | 12 +++--- direct/src/dcparse/CMakeLists.txt | 3 ++ direct/src/dcparser/CMakeLists.txt | 53 +++++++++++++++++++++++++++ direct/src/deadrec/CMakeLists.txt | 11 ++++++ direct/src/directbase/CMakeLists.txt | 11 ++++++ direct/src/distributed/CMakeLists.txt | 24 ++++++++++++ 6 files changed, 109 insertions(+), 5 deletions(-) create mode 100644 direct/src/dcparse/CMakeLists.txt create mode 100644 direct/src/dcparser/CMakeLists.txt create mode 100644 direct/src/deadrec/CMakeLists.txt create mode 100644 direct/src/directbase/CMakeLists.txt create mode 100644 direct/src/distributed/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index dc68056ab3..284ed72f7f 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -1,14 +1,16 @@ # Include source directories which have C++ components: +add_subdirectory(src/directbase) add_subdirectory(src/autorestart) -#add_subdirectory(src/dcparser) -#add_subdirectory(src/dcparse) -#add_subdirectory(src/deadrec) -#add_subdirectory(src/directbase) +add_subdirectory(src/dcparser) +add_subdirectory(src/dcparse) +add_subdirectory(src/deadrec) #add_subdirectory(src/directdServer) #add_subdirectory(src/directd) -#add_subdirectory(src/distributed) +add_subdirectory(src/distributed) #add_subdirectory(src/heapq) #add_subdirectory(src/http) #add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) #add_subdirectory(src/showbase) + +add_python_module(direct p3dcparser p3deadrec p3distributed) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt new file mode 100644 index 0000000000..a50ebdb3b1 --- /dev/null +++ b/direct/src/dcparse/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(dcparse dcparse.cxx) +set_target_properties(dcparse PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_link_libraries(dcparse p3dcparser) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt new file mode 100644 index 0000000000..1838865b81 --- /dev/null +++ b/direct/src/dcparser/CMakeLists.txt @@ -0,0 +1,53 @@ +add_bison_target(dcParser.cxx dcParser.yxx DEFINES dcParser.h PREFIX dcyy) +add_flex_target(dcLexer.cxx dcLexer.lxx CASE_INSENSITIVE PREFIX dcyy) + +set(P3DCPARSER_HEADERS + dcAtomicField.h dcAtomicField.I dcClass.h dcClass.I + dcDeclaration.h + dcField.h dcField.I + dcFile.h dcFile.I + dcKeyword.h dcKeywordList.h + dcLexer.lxx + dcLexerDefs.h dcMolecularField.h dcParser.yxx dcParserDefs.h + dcSubatomicType.h + dcPackData.h dcPackData.I + dcPacker.h dcPacker.I + dcPackerCatalog.h dcPackerCatalog.I + dcPackerInterface.h dcPackerInterface.I + dcParameter.h dcClassParameter.h dcArrayParameter.h + dcSimpleParameter.h dcSwitchParameter.h + dcNumericRange.h dcNumericRange.I + dcSwitch.h + dcTypedef.h + dcPython.h + dcbase.h dcindent.h hashGenerator.h + primeNumberGenerator.h) + +set(P3DCPARSER_SOURCES + dcAtomicField.cxx dcClass.cxx + dcDeclaration.cxx + dcField.cxx dcFile.cxx + dcKeyword.cxx dcKeywordList.cxx + dcMolecularField.cxx dcSubatomicType.cxx + dcPackData.cxx + dcPacker.cxx + dcPackerCatalog.cxx + dcPackerInterface.cxx + dcParameter.cxx dcClassParameter.cxx dcArrayParameter.cxx + dcSimpleParameter.cxx dcSwitchParameter.cxx + dcSwitch.cxx + dcTypedef.cxx + dcindent.cxx + hashGenerator.cxx primeNumberGenerator.cxx) + +# These cannot be interrogated, and are excluded from the composites. +set(P3DCPARSER_PARSER_SOURCES + dcParser.cxx + dcLexer.cxx) + +composite_sources(p3dcparser P3DCPARSER_SOURCES) +add_library(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS} + ${P3DCPARSER_PARSER_SOURCES}) +set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) +target_interrogate(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS}) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt new file mode 100644 index 0000000000..043fc62cd6 --- /dev/null +++ b/direct/src/deadrec/CMakeLists.txt @@ -0,0 +1,11 @@ +set(P3DEADREC_HEADERS + config_deadrec.h + smoothMover.h smoothMover.I) + +set(P3DEADREC_SOURCES + config_deadrec.cxx + smoothMover.cxx) + +add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) +target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) +target_interrogate(p3deadrec ALL) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt new file mode 100644 index 0000000000..1be8a56434 --- /dev/null +++ b/direct/src/directbase/CMakeLists.txt @@ -0,0 +1,11 @@ +set(P3DIRECTBASE_SOURCES + directbase.cxx +) + +set(P3DIRECTBASE_HEADERS + directbase.h directsymbols.h +) + +# Not worth compositing sources, there's really only one. +add_library(p3directbase ${P3DIRECTBASE_SOURCES} ${P3DIRECTBASE_HEADERS}) +target_link_libraries(p3directbase p3pandabase) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt new file mode 100644 index 0000000000..681004e608 --- /dev/null +++ b/direct/src/distributed/CMakeLists.txt @@ -0,0 +1,24 @@ +if(HAVE_PYTHON) + set(P3DISTRIBUTED_HEADERS + config_distributed.h + cConnectionRepository.I + cConnectionRepository.h + cDistributedSmoothNodeBase.I + cDistributedSmoothNodeBase.h) + + set(P3DISTRIBUTED_SOURCES + config_distributed.cxx + cConnectionRepository.cxx + cDistributedSmoothNodeBase.cxx) + + add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) + set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_link_libraries(p3distributed p3directbase p3dcparser p3pgraph) + if(WANT_NATIVE_NET) + target_link_libraries(p3distributed p3nativenet) + endif() + if(HAVE_NET) + target_link_libraries(p3distributed p3net) + endif() + target_interrogate(p3distributed ALL) +endif() From 8a31b4b6a1157e506e7838947fbb1e5953a26140 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 14:59:32 -0700 Subject: [PATCH 206/744] CMake: Update autorestart's CMakeLists to match the COMPILE_DEFINITIONS (rather than add_definitions) of the other components' CMakeLists files. --- direct/src/autorestart/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 8847a518cc..31524487c5 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,3 @@ -add_definitions(-DWITHIN_PANDA) add_executable(autorestart autorestart.c) +set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(autorestart p3dtool) From 2898f4da33a44811de5a4b2ec9a3a6464ea3d410 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 16:42:43 -0700 Subject: [PATCH 207/744] CMake: Get direct's 'interval' component library to build+Interrogate. --- direct/CMakeLists.txt | 4 +-- direct/src/interval/CMakeLists.txt | 41 ++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 direct/src/interval/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 284ed72f7f..4f32ebb6b0 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -9,8 +9,8 @@ add_subdirectory(src/deadrec) add_subdirectory(src/distributed) #add_subdirectory(src/heapq) #add_subdirectory(src/http) -#add_subdirectory(src/interval) +add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) #add_subdirectory(src/showbase) -add_python_module(direct p3dcparser p3deadrec p3distributed) +add_python_module(direct p3dcparser p3deadrec p3distributed p3interval) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt new file mode 100644 index 0000000000..03b9feddf0 --- /dev/null +++ b/direct/src/interval/CMakeLists.txt @@ -0,0 +1,41 @@ +set(P3INTERVAL_HEADERS + config_interval.h + cInterval.I cInterval.h + cIntervalManager.I cIntervalManager.h + cConstraintInterval.I cConstraintInterval.h + cConstrainTransformInterval.I cConstrainTransformInterval.h + cConstrainPosInterval.I cConstrainPosInterval.h + cConstrainHprInterval.I cConstrainHprInterval.h + cConstrainPosHprInterval.I cConstrainPosHprInterval.h + cLerpInterval.I cLerpInterval.h + cLerpNodePathInterval.I cLerpNodePathInterval.h + cLerpAnimEffectInterval.I cLerpAnimEffectInterval.h + cMetaInterval.I cMetaInterval.h + hideInterval.I hideInterval.h + lerpblend.h + showInterval.I showInterval.h + waitInterval.I waitInterval.h + lerp_helpers.h) + +set(P3INTERVAL_SOURCES + config_interval.cxx + cInterval.cxx + cIntervalManager.cxx + cConstraintInterval.cxx + cConstrainTransformInterval.cxx + cConstrainPosInterval.cxx + cConstrainHprInterval.cxx + cConstrainPosHprInterval.cxx + cLerpInterval.cxx + cLerpNodePathInterval.cxx + cLerpAnimEffectInterval.cxx + cMetaInterval.cxx + hideInterval.cxx + lerpblend.cxx + showInterval.cxx + waitInterval.cxx) + +composite_sources(p3interval P3INTERVAL_SOURCES) +add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) +target_link_libraries(p3interval p3directbase p3pstatclient p3pgraph p3chan p3dconfig p3prc) +target_interrogate(p3interval ALL) From 9da0bb6912dd5c9e73717819721d4684cfd881ed Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 18:23:45 -0700 Subject: [PATCH 208/744] CMake: Add audio/movies components. --- panda/CMakeLists.txt | 24 +++++++++++++++----- panda/src/audio/CMakeLists.txt | 24 ++++++++++++++++++++ panda/src/grutil/CMakeLists.txt | 5 ++++- panda/src/movies/CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++ 4 files changed, 86 insertions(+), 6 deletions(-) create mode 100644 panda/src/audio/CMakeLists.txt create mode 100644 panda/src/movies/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 30ddcd6877..2f4ce7439d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,6 +40,8 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/movies) +add_subdirectory(src/audio) add_subdirectory(src/chan) add_subdirectory(src/char) add_subdirectory(src/dgraph) @@ -64,8 +66,20 @@ add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandagl) add_subdirectory(metalibs/pandaegg) -add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph - p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath - p3mathutil p3nativenet p3net p3parametrics p3pgraph p3pgraphnodes p3pgui - p3pipeline p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) -add_python_module(egg p3egg p3egg2pg) + +# Now add the Python modules: +set(CORE_MODULE_COMPONENTS + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader + p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet + p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) + +if(HAVE_AUDIO) + list(APPEND CORE_MODULE_COMPONENTS p3audio) +endif() + +add_python_module(core ${CORE_MODULE_COMPONENTS}) + +if(HAVE_EGG) + add_python_module(egg p3egg p3egg2pg) +endif() diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt new file mode 100644 index 0000000000..9503acc783 --- /dev/null +++ b/panda/src/audio/CMakeLists.txt @@ -0,0 +1,24 @@ +if(HAVE_AUDIO) + set(P3AUDIO_HEADERS + config_audio.h + filterProperties.h filterProperties.I + audioLoadRequest.h audioLoadRequest.I + audioManager.h audioManager.I + audioSound.h audioSound.I + nullAudioManager.h + nullAudioSound.h) + + set(P3AUDIO_SOURCES + config_audio.cxx + filterProperties.cxx + audioLoadRequest.cxx + audioManager.cxx + audioSound.cxx + nullAudioManager.cxx + nullAudioSound.cxx) + + composite_sources(p3audio P3AUDIO_SOURCES) + add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) + target_link_libraries(p3audio p3putil p3event p3movies p3linmath) + target_interrogate(p3audio ALL) +endif() diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d7d2dd44ce..d4f2087cd3 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -37,5 +37,8 @@ set(P3GRUTIL_SOURCES composite_sources(p3grutil P3GRUTIL_SOURCES) add_library(p3grutil ${P3GRUTIL_SOURCES} ${P3GRUTIL_HEADERS}) -target_link_libraries(p3grutil p3display p3text) +target_link_libraries(p3grutil p3display p3text p3movies) +if(HAVE_AUDIO) + target_link_libraries(p3grutil p3audio) +endif() target_interrogate(p3grutil ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt new file mode 100644 index 0000000000..4ae884c012 --- /dev/null +++ b/panda/src/movies/CMakeLists.txt @@ -0,0 +1,39 @@ +set(P3MOVIES_HEADERS + config_movies.h + inkblotVideo.h inkblotVideo.I + inkblotVideoCursor.h inkblotVideoCursor.I + microphoneAudio.h microphoneAudio.I + movieAudio.h movieAudio.I + movieAudioCursor.h movieAudioCursor.I + movieTypeRegistry.h movieTypeRegistry.I + movieVideo.h movieVideo.I + movieVideoCursor.h movieVideoCursor.I + userDataAudio.h userDataAudio.I + userDataAudioCursor.h userDataAudioCursor.I + vorbisAudio.h vorbisAudio.I + vorbisAudioCursor.h vorbisAudioCursor.I + wavAudio.h wavAudio.I + wavAudioCursor.h wavAudioCursor.I) + +set(P3MOVIES_SOURCES + config_movies.cxx + inkblotVideo.cxx + inkblotVideoCursor.cxx + microphoneAudio.cxx + microphoneAudioDS.cxx + movieAudio.cxx + movieAudioCursor.cxx + movieTypeRegistry.cxx + movieVideo.cxx + movieVideoCursor.cxx + userDataAudio.cxx + userDataAudioCursor.cxx + vorbisAudio.cxx + vorbisAudioCursor.cxx + wavAudio.cxx + wavAudioCursor.cxx) + +composite_sources(p3movies P3MOVIES_SOURCES) +add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) +target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) +target_interrogate(p3movies ALL) From ff62637101b08cbf9fb8fc92f9cb68b972e3b162 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 19:09:33 -0700 Subject: [PATCH 209/744] CMake: Build+Interrogate p3showbase. --- direct/CMakeLists.txt | 4 ++-- direct/src/showbase/CMakeLists.txt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 direct/src/showbase/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 4f32ebb6b0..904bf6f9ae 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -11,6 +11,6 @@ add_subdirectory(src/distributed) #add_subdirectory(src/http) add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) -#add_subdirectory(src/showbase) +add_subdirectory(src/showbase) -add_python_module(direct p3dcparser p3deadrec p3distributed p3interval) +add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt new file mode 100644 index 0000000000..36e4f70b25 --- /dev/null +++ b/direct/src/showbase/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(p3showbase showBase.cxx showBase.h) +target_link_libraries(p3showbase p3directbase p3express p3event p3chan p3display p3dconfig p3prc) +target_interrogate(p3showbase ALL) From 5e77793b0f981ab418ee875ec754367b33937113 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 22:43:23 -0700 Subject: [PATCH 210/744] CMake: Add some install(...) directives. --- direct/src/autorestart/CMakeLists.txt | 1 + direct/src/dcparse/CMakeLists.txt | 1 + direct/src/dcparser/CMakeLists.txt | 2 ++ direct/src/deadrec/CMakeLists.txt | 2 ++ direct/src/directbase/CMakeLists.txt | 2 ++ direct/src/distributed/CMakeLists.txt | 2 ++ direct/src/interval/CMakeLists.txt | 2 ++ direct/src/showbase/CMakeLists.txt | 2 ++ dtool/metalibs/dtool/CMakeLists.txt | 2 ++ dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 ++ dtool/src/cppparser/CMakeLists.txt | 2 ++ dtool/src/dconfig/CMakeLists.txt | 2 ++ dtool/src/dtoolbase/CMakeLists.txt | 2 ++ dtool/src/dtoolutil/CMakeLists.txt | 2 ++ dtool/src/interrogate/CMakeLists.txt | 2 ++ dtool/src/interrogatedb/CMakeLists.txt | 2 ++ dtool/src/prc/CMakeLists.txt | 2 ++ panda/metalibs/panda/CMakeLists.txt | 2 ++ panda/metalibs/pandaegg/CMakeLists.txt | 2 ++ panda/metalibs/pandagl/CMakeLists.txt | 2 ++ panda/src/audio/CMakeLists.txt | 2 ++ panda/src/chan/CMakeLists.txt | 2 ++ panda/src/char/CMakeLists.txt | 2 ++ panda/src/collide/CMakeLists.txt | 2 ++ panda/src/cull/CMakeLists.txt | 2 ++ panda/src/device/CMakeLists.txt | 2 ++ panda/src/dgraph/CMakeLists.txt | 2 ++ panda/src/display/CMakeLists.txt | 2 ++ panda/src/downloader/CMakeLists.txt | 2 ++ panda/src/egg/CMakeLists.txt | 2 ++ panda/src/egg2pg/CMakeLists.txt | 2 ++ panda/src/event/CMakeLists.txt | 4 +++- panda/src/express/CMakeLists.txt | 2 ++ panda/src/framework/CMakeLists.txt | 2 ++ panda/src/glgsg/CMakeLists.txt | 2 ++ panda/src/glstuff/CMakeLists.txt | 2 ++ panda/src/glxdisplay/CMakeLists.txt | 2 ++ panda/src/gobj/CMakeLists.txt | 2 ++ panda/src/grutil/CMakeLists.txt | 2 ++ panda/src/gsgbase/CMakeLists.txt | 2 ++ panda/src/linmath/CMakeLists.txt | 2 ++ panda/src/mathutil/CMakeLists.txt | 2 ++ panda/src/movies/CMakeLists.txt | 2 ++ panda/src/nativenet/CMakeLists.txt | 2 ++ panda/src/net/CMakeLists.txt | 2 ++ panda/src/pandabase/CMakeLists.txt | 2 ++ panda/src/parametrics/CMakeLists.txt | 2 ++ panda/src/pgraph/CMakeLists.txt | 2 ++ panda/src/pgraphnodes/CMakeLists.txt | 2 ++ panda/src/pgui/CMakeLists.txt | 2 ++ panda/src/pipeline/CMakeLists.txt | 2 ++ panda/src/pnmimage/CMakeLists.txt | 2 ++ panda/src/pnmimagetypes/CMakeLists.txt | 2 ++ panda/src/pnmtext/CMakeLists.txt | 2 ++ panda/src/pstatclient/CMakeLists.txt | 2 ++ panda/src/putil/CMakeLists.txt | 2 ++ panda/src/recorder/CMakeLists.txt | 2 ++ panda/src/testbed/CMakeLists.txt | 1 + panda/src/text/CMakeLists.txt | 2 ++ panda/src/tform/CMakeLists.txt | 2 ++ panda/src/x11display/CMakeLists.txt | 2 ++ 61 files changed, 120 insertions(+), 1 deletion(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 31524487c5..eef609e69c 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,4 @@ add_executable(autorestart autorestart.c) set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(autorestart p3dtool) +install(TARGETS autorestart DESTINATION bin) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index a50ebdb3b1..947c67dfec 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,4 @@ add_executable(dcparse dcparse.cxx) set_target_properties(dcparse PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(dcparse p3dcparser) +install(TARGETS dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 1838865b81..36ef2541e0 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -51,3 +51,5 @@ add_library(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS} set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) target_interrogate(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS}) + +install(TARGETS p3dcparser DESTINATION lib) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 043fc62cd6..669d98b28f 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -9,3 +9,5 @@ set(P3DEADREC_SOURCES add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) target_interrogate(p3deadrec ALL) + +install(TARGETS p3deadrec DESTINATION lib) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 1be8a56434..3e1d332ab5 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -9,3 +9,5 @@ set(P3DIRECTBASE_HEADERS # Not worth compositing sources, there's really only one. add_library(p3directbase ${P3DIRECTBASE_SOURCES} ${P3DIRECTBASE_HEADERS}) target_link_libraries(p3directbase p3pandabase) + +install(TARGETS p3directbase DESTINATION lib) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 681004e608..0da55087a1 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -21,4 +21,6 @@ if(HAVE_PYTHON) target_link_libraries(p3distributed p3net) endif() target_interrogate(p3distributed ALL) + + install(TARGETS p3distributed DESTINATION lib) endif() diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 03b9feddf0..6931de86c9 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -39,3 +39,5 @@ composite_sources(p3interval P3INTERVAL_SOURCES) add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) target_link_libraries(p3interval p3directbase p3pstatclient p3pgraph p3chan p3dconfig p3prc) target_interrogate(p3interval ALL) + +install(TARGETS p3interval DESTINATION lib) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 36e4f70b25..879a23918e 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,3 +1,5 @@ add_library(p3showbase showBase.cxx showBase.h) target_link_libraries(p3showbase p3directbase p3express p3event p3chan p3display p3dconfig p3prc) target_interrogate(p3showbase ALL) + +install(TARGETS p3showbase DESTINATION lib) diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 54f02f0045..1ace855669 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,2 +1,4 @@ add_library(p3dtool dtool.cxx) target_link_libraries(p3dtool p3dtoolutil p3dtoolbase) + +install(TARGETS p3dtool DESTINATION lib) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 054d2095bc..cf791fbde9 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -8,3 +8,5 @@ else() endif() target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb) + +install(TARGETS p3dtoolconfig DESTINATION lib) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 1e6ba9e511..9e1f20a186 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -40,3 +40,5 @@ composite_sources(p3cppParser P3CPPPARSER_SOURCES) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) target_link_libraries(p3cppParser p3dtoolutil) + +install(TARGETS p3cppParser DESTINATION lib) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 7c71d68d82..f07c356b58 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -8,3 +8,5 @@ composite_sources(p3dconfig P3DCONFIG_SOURCES) add_library(p3dconfig ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) target_link_libraries(p3dconfig p3prc) + +install(TARGETS p3dconfig DESTINATION lib) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 98c7ed19e9..8a93e83399 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -65,3 +65,5 @@ add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) if(HAVE_PYTHON) target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES}) endif() + +install(TARGETS p3dtoolbase DESTINATION lib) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index a7c94098ac..04a4e0ce6c 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -55,3 +55,5 @@ target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) if(HAVE_PYTHON) target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) endif() + +install(TARGETS p3dtoolutil DESTINATION lib) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index f5404dc028..7ff12f5850 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -51,8 +51,10 @@ add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${_OPENSSL_LIBRARIES}) +install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${OPENSSL_LIBRARIES}) +install(TARGETS interrogate DESTINATION bin) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 58477d2ad7..01b34cd51f 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -31,3 +31,5 @@ composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) + +install(TARGETS p3interrogatedb DESTINATION lib) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 57cea800b0..ad2213024f 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -66,3 +66,5 @@ composite_sources(p3prc P3PRC_SOURCES) add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES}) + +install(TARGETS p3prc DESTINATION lib) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index cd62d585c8..3170a4717e 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -11,3 +11,5 @@ endif() add_library(panda panda.cxx) target_link_libraries(panda ${PANDA_LINK_TARGETS}) + +install(TARGETS panda DESTINATION lib) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 3d17cbfd10..a8684b4fe9 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -3,4 +3,6 @@ if(HAVE_EGG) add_library(pandaegg pandaegg.cxx) target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) + + install(TARGETS pandaegg DESTINATION lib) endif() diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 96eb7465cc..2134f350eb 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -17,4 +17,6 @@ if(HAVE_GL) add_library(pandagl pandagl.cxx) target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) + + install(TARGETS pandagl DESTINATION lib) endif() diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index 9503acc783..b674c313f7 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -21,4 +21,6 @@ if(HAVE_AUDIO) add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) + + install(TARGETS p3audio DESTINATION lib) endif() diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 53f4f64fc9..4bf13ea0c6 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -54,3 +54,5 @@ composite_sources(p3chan P3CHAN_SOURCES) add_library(p3chan ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) + +install(TARGETS p3chan DESTINATION lib) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 421573ed54..8196969d63 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -22,3 +22,5 @@ composite_sources(p3char P3CHAR_SOURCES) add_library(p3char ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) + +install(TARGETS p3char DESTINATION lib) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 3b557b981b..dd3994ff9b 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -67,6 +67,8 @@ add_library(p3collide ${P3COLLIDE_SOURCES} ${P3COLLIDE_HEADERS}) target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) +install(TARGETS p3collide DESTINATION lib) + #begin test_bin_target #define TARGET test_collide #define LOCAL_LIBS diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index f41ca915a8..4b8001920f 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -24,3 +24,5 @@ composite_sources(p3cull P3CULL_SOURCES) add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) + +install(TARGETS p3cull DESTINATION lib) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 0b7eaedb1e..16dc4b9164 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -30,3 +30,5 @@ composite_sources(p3device P3DEVICE_SOURCES) add_library(p3device ${P3DEVICE_SOURCES} ${P3DEVICE_HEADERS}) target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) + +install(TARGETS p3device DESTINATION lib) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 0117da0334..c085c0e8e1 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -15,3 +15,5 @@ composite_sources(p3dgraph P3DGRAPH_SOURCES) add_library(p3dgraph ${P3DGRAPH_SOURCES} ${P3DGRAPH_HEADERS}) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) + +install(TARGETS p3dgraph DESTINATION lib) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index b9f9813cc3..106fab5646 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -91,6 +91,8 @@ add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL) +install(TARGETS p3display DESTINATION lib) + if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) # We build a static library of just these files, so the plugin can # link with it in direct/src/plugin, without pulling in the rest of diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 03c03b418d..cc4c747f92 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -66,3 +66,5 @@ composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_library(p3downloader ${P3DOWNLOADER_SOURCES} ${P3DOWNLOADER_HEADERS}) target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL) + +install(TARGETS p3downloader DESTINATION lib) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index c397beb6b4..99103a9e54 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -97,4 +97,6 @@ if(HAVE_EGG) add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES}) + + install(TARGETS p3egg DESTINATION lib) endif() diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 877cd20e12..71d91c3365 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -33,4 +33,6 @@ if(HAVE_EGG) add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) target_link_libraries(p3egg2pg p3parametrics p3collide p3egg p3pgraph p3chan p3char) target_interrogate(p3egg2pg ALL) + + install(TARGETS p3egg2pg DESTINATION lib) endif() diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 3a3b293356..d3cc6dff51 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -41,6 +41,8 @@ add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL) +install(TARGETS p3event DESTINATION lib) + #begin test_bin_target #define TARGET test_task #define LOCAL_LIBS $[LOCAL_LIBS] p3mathutil @@ -51,4 +53,4 @@ target_interrogate(p3event ALL) #define SOURCES \ # test_task.cxx -#end test_bin_target \ No newline at end of file +#end test_bin_target diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 34645871ae..631078215f 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -130,6 +130,8 @@ target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY}) target_interrogate(p3express ALL) +install(TARGETS p3express DESTINATION lib) + #add_executable(p3expressTestTypes test_types.cxx) #target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) #add_test(p3express_test_types p3expressTestTypes) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 1863f00ff0..75ececfec9 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -58,3 +58,5 @@ endif() composite_sources(p3framework P3FRAMEWORK_SOURCES) add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) + +install(TARGETS p3framework DESTINATION lib) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 6f2fbd9aa7..676ee264eb 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -12,4 +12,6 @@ if(HAVE_GL) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES} ${_CG_LIBRARIES}) + + install(TARGETS p3glgsg DESTINATION lib) endif() diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index dd983c0801..527e9e827f 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -33,4 +33,6 @@ if(HAVE_GL) composite_sources(p3glstuff P3GLSTUFF_SOURCES) add_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) target_link_libraries(p3glstuff p3pandabase p3gobj) + + install(TARGETS p3glstuff DESTINATION lib) endif() diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 975be01ad4..b7f6019786 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -23,4 +23,6 @@ if(HAVE_GLX) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) + + install(TARGETS p3glxdisplay DESTINATION lib) endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 52ab97b586..2cdb133c77 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -147,6 +147,8 @@ target_link_libraries(p3gobj p3gsgbase p3pnmimage ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARIES}) target_interrogate(p3gobj ALL) +install(TARGETS p3gobj DESTINATION lib) + #begin test_bin_target #define TARGET test_gobj #define LOCAL_LIBS \ diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d4f2087cd3..cb9bfa75d8 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -42,3 +42,5 @@ if(HAVE_AUDIO) target_link_libraries(p3grutil p3audio) endif() target_interrogate(p3grutil ALL) + +install(TARGETS p3grutil DESTINATION lib) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 53ba50d152..8c5d8cf105 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -17,6 +17,8 @@ add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) target_link_libraries(p3gsgbase p3linmath) target_interrogate(p3gsgbase ALL) +install(TARGETS p3gsgbase DESTINATION lib) + #begin test_bin_target #define TARGET test_gsgbase #define LOCAL_LIBS diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 5b08370b99..630ea6e7ce 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -47,6 +47,8 @@ add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3putil) target_interrogate(p3linmath ALL) +install(TARGETS p3linmath DESTINATION lib) + #begin test_bin_target #define TARGET test_math #define LOCAL_LIBS \ diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 0df4773681..7a482eda35 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -65,6 +65,8 @@ add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}) target_interrogate(p3mathutil ALL) +install(TARGETS p3mathutil DESTINATION lib) + #begin test_bin_target #define TARGET test_mathutil #define LOCAL_LIBS \ diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 4ae884c012..3f31767fa0 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -37,3 +37,5 @@ composite_sources(p3movies P3MOVIES_SOURCES) add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) target_interrogate(p3movies ALL) + +install(TARGETS p3movies DESTINATION lib) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 3e13361410..565d4ccb1c 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -27,4 +27,6 @@ if(WANT_NATIVE_NET) add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) target_link_libraries(p3nativenet p3express p3pandabase) target_interrogate(p3nativenet ALL) + + install(TARGETS p3nativenet DESTINATION lib) endif() diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 9fec4780fc..68eac47634 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -29,4 +29,6 @@ if(HAVE_NET AND WANT_NATIVE_NET) add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) target_interrogate(p3net ALL) + + install(TARGETS p3net DESTINATION lib) endif() diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index bcb2d1f85d..d43bb13e17 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -8,3 +8,5 @@ set(P3PANDABASE_SOURCES add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) target_link_libraries(p3pandabase p3dtoolbase) + +install(TARGETS p3pandabase DESTINATION lib) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 5b204e752b..1a61873e96 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -38,6 +38,8 @@ add_library(p3parametrics ${P3PARAMETRICS_SOURCES} ${P3PARAMETRICS_HEADERS}) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) +install(TARGETS p3parametrics DESTINATION lib) + #begin test_bin_target #define TARGET test_parametrics #define LOCAL_LIBS diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 0eeb65dddc..c75b90c966 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -201,6 +201,8 @@ add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL) +install(TARGETS p3pgraph DESTINATION lib) + #begin test_bin_target #define TARGET test_pgraph diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 22961aa9f1..1f42f992e4 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -42,3 +42,5 @@ composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) add_library(p3pgraphnodes ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) + +install(TARGETS p3pgraphnodes DESTINATION lib) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 55839744cb..15bbfdb736 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -44,6 +44,8 @@ add_library(p3pgui ${P3PGUI_SOURCES} ${P3PGUI_HEADERS}) target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) +install(TARGETS p3pgui DESTINATION lib) + #begin test_bin_target #define TARGET test_pgentry diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 2f008e5d41..29e5dfc586 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -140,6 +140,8 @@ add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) target_link_libraries(p3pipeline p3express) target_interrogate(p3pipeline ALL) +install(TARGETS p3pipeline DESTINATION lib) + #begin test_bin_target #define TARGET test_threaddata #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index e23f01f69a..52f6246a2d 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -28,3 +28,5 @@ composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL) + +install(TARGETS p3pnmimage DESTINATION lib) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 295cba0ddb..680b767ecb 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -30,3 +30,5 @@ composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) target_link_libraries(p3pnmimagetypes p3pnmimage ${_JPEG_LIBRARIES} ${_TIFF_LIBRARIES} ${_PNG_LIBRARIES}) + +install(TARGETS p3pnmimagetypes DESTINATION lib) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 534b9a80e3..9af9df2714 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -17,3 +17,5 @@ composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) target_interrogate(p3pnmtext ALL) + +install(TARGETS p3pnmtext DESTINATION lib) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 13f8e8ae3d..007e73d03c 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -27,6 +27,8 @@ add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) target_link_libraries(p3pstatclient p3putil) target_interrogate(p3pstatclient ALL) +install(TARGETS p3pstatclient DESTINATION lib) + #begin test_bin_target #define LOCAL_LIBS \ # p3pstatclient diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index c77cac1d7d..116522b457 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -117,6 +117,8 @@ add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) target_link_libraries(p3putil p3pipeline) target_interrogate(p3putil ALL) +install(TARGETS p3putil DESTINATION lib) + #begin test_bin_target #define TARGET test_bamRead #define LOCAL_LIBS diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 8289ef7ecb..8590e3ab83 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -20,3 +20,5 @@ composite_sources(p3recorder P3RECORDER_SOURCES) add_library(p3recorder ${P3RECORDER_SOURCES} ${P3RECORDER_HEADERS}) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) + +install(TARGETS p3recorder DESTINATION lib) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index e7b659bb17..21e15e788c 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -1,5 +1,6 @@ add_executable(pview pview.cxx) target_link_libraries(pview p3framework p3pystub) +install(TARGETS pview DESTINATION bin) #begin test_bin_target #define TARGET pgrid diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 1815b6e529..5bbe2e8ef1 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -36,3 +36,5 @@ composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) target_link_libraries(p3text p3pnmtext p3parametrics ${_FREETYPE_LIBRARIES}) target_interrogate(p3text ALL) + +install(TARGETS p3text DESTINATION lib) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index 1de7ffe237..abc730148b 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -28,3 +28,5 @@ composite_sources(p3tform P3TFORM_SOURCES) add_library(p3tform ${P3TFORM_SOURCES} ${P3TFORM_HEADERS}) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) + +install(TARGETS p3tform DESTINATION lib) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index bae6e338fc..8c66448497 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -11,4 +11,6 @@ if(HAVE_X11) composite_sources(p3x11display P3X11DISPLAY_SOURCES) add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) + + install(TARGETS p3x11display DESTINATION lib) endif() From 1d2561b0121ae51db2462f85b411f86f883514dc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Feb 2014 23:10:56 -0700 Subject: [PATCH 211/744] CMake: Install the Interrogated _igate libraries. (Temporary; part of the dependency hack.) --- cmake/macros/Interrogate.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 3a9c998226..b4b9812115 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -241,6 +241,7 @@ function(add_python_module module) # against the component library in question. add_library(${target}_igate ${target}_igate.cxx) list(APPEND HACKlinklibs "${target}_igate") + install(TARGETS ${target}_igate DESTINATION lib) get_target_property(target_links "${target}" LINK_LIBRARIES) target_link_libraries(${target}_igate ${target_links}) From dc898f4d78bbb77cb7d1fabc675ea352b6e540bb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 17:08:05 -0700 Subject: [PATCH 212/744] CMake: Add audio/movies components. --- panda/CMakeLists.txt | 23 ++++++++++++++----- panda/src/audio/CMakeLists.txt | 24 ++++++++++++++++++++ panda/src/grutil/CMakeLists.txt | 5 ++++- panda/src/movies/CMakeLists.txt | 39 +++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 6 deletions(-) create mode 100644 panda/src/audio/CMakeLists.txt create mode 100644 panda/src/movies/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f648f44d2c..650bcaede2 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,6 +40,8 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/movies) +add_subdirectory(src/audio) add_subdirectory(src/chan) add_subdirectory(src/char) add_subdirectory(src/dgraph) @@ -62,8 +64,19 @@ add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandagl) add_subdirectory(metalibs/pandaegg) -add_python_module(core p3chan p3char p3collide p3cull p3device p3dgraph - p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath - p3mathutil p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage - p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) -add_python_module(egg p3egg p3egg2pg) +# Now add the Python modules: +set(CORE_MODULE_COMPONENTS + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader + p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet + p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) + +if(HAVE_AUDIO) + list(APPEND CORE_MODULE_COMPONENTS p3audio) +endif() + +add_python_module(core ${CORE_MODULE_COMPONENTS}) + +if(HAVE_EGG) + add_python_module(egg p3egg p3egg2pg) +endif() diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt new file mode 100644 index 0000000000..9503acc783 --- /dev/null +++ b/panda/src/audio/CMakeLists.txt @@ -0,0 +1,24 @@ +if(HAVE_AUDIO) + set(P3AUDIO_HEADERS + config_audio.h + filterProperties.h filterProperties.I + audioLoadRequest.h audioLoadRequest.I + audioManager.h audioManager.I + audioSound.h audioSound.I + nullAudioManager.h + nullAudioSound.h) + + set(P3AUDIO_SOURCES + config_audio.cxx + filterProperties.cxx + audioLoadRequest.cxx + audioManager.cxx + audioSound.cxx + nullAudioManager.cxx + nullAudioSound.cxx) + + composite_sources(p3audio P3AUDIO_SOURCES) + add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) + target_link_libraries(p3audio p3putil p3event p3movies p3linmath) + target_interrogate(p3audio ALL) +endif() diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d7d2dd44ce..d4f2087cd3 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -37,5 +37,8 @@ set(P3GRUTIL_SOURCES composite_sources(p3grutil P3GRUTIL_SOURCES) add_library(p3grutil ${P3GRUTIL_SOURCES} ${P3GRUTIL_HEADERS}) -target_link_libraries(p3grutil p3display p3text) +target_link_libraries(p3grutil p3display p3text p3movies) +if(HAVE_AUDIO) + target_link_libraries(p3grutil p3audio) +endif() target_interrogate(p3grutil ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt new file mode 100644 index 0000000000..4ae884c012 --- /dev/null +++ b/panda/src/movies/CMakeLists.txt @@ -0,0 +1,39 @@ +set(P3MOVIES_HEADERS + config_movies.h + inkblotVideo.h inkblotVideo.I + inkblotVideoCursor.h inkblotVideoCursor.I + microphoneAudio.h microphoneAudio.I + movieAudio.h movieAudio.I + movieAudioCursor.h movieAudioCursor.I + movieTypeRegistry.h movieTypeRegistry.I + movieVideo.h movieVideo.I + movieVideoCursor.h movieVideoCursor.I + userDataAudio.h userDataAudio.I + userDataAudioCursor.h userDataAudioCursor.I + vorbisAudio.h vorbisAudio.I + vorbisAudioCursor.h vorbisAudioCursor.I + wavAudio.h wavAudio.I + wavAudioCursor.h wavAudioCursor.I) + +set(P3MOVIES_SOURCES + config_movies.cxx + inkblotVideo.cxx + inkblotVideoCursor.cxx + microphoneAudio.cxx + microphoneAudioDS.cxx + movieAudio.cxx + movieAudioCursor.cxx + movieTypeRegistry.cxx + movieVideo.cxx + movieVideoCursor.cxx + userDataAudio.cxx + userDataAudioCursor.cxx + vorbisAudio.cxx + vorbisAudioCursor.cxx + wavAudio.cxx + wavAudioCursor.cxx) + +composite_sources(p3movies P3MOVIES_SOURCES) +add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) +target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) +target_interrogate(p3movies ALL) From 1a2be0dbeee2b51f30c11516f819c9ffe26f9d13 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 17:09:26 -0700 Subject: [PATCH 213/744] CMake: Only attempt to build pnmtext if HAVE_FREETYPE. --- panda/CMakeLists.txt | 5 ++++- panda/src/pnmtext/CMakeLists.txt | 38 +++++++++++++++++--------------- panda/src/text/CMakeLists.txt | 5 ++++- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 650bcaede2..cd4c40221b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -69,11 +69,14 @@ set(CORE_MODULE_COMPONENTS p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline - p3pnmimage p3pnmtext p3pstatclient p3putil p3recorder p3text p3tform) + p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform) if(HAVE_AUDIO) list(APPEND CORE_MODULE_COMPONENTS p3audio) endif() +if(HAVE_FREETYPE) + list(APPEND CORE_MODULE_COMPONENTS p3pnmtext) +endif() add_python_module(core ${CORE_MODULE_COMPONENTS}) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 534b9a80e3..33a332389f 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -1,19 +1,21 @@ -set(P3PNMTEXT_HEADERS - config_pnmtext.h - freetypeFace.h freetypeFace.I - freetypeFont.h freetypeFont.I - pnmTextGlyph.h pnmTextGlyph.I - pnmTextMaker.h pnmTextMaker.I -) -set(P3PNMTEXT_SOURCES - config_pnmtext.cxx - freetypeFace.cxx - freetypeFont.cxx - pnmTextGlyph.cxx - pnmTextMaker.cxx -) +if(HAVE_FREETYPE) + set(P3PNMTEXT_HEADERS + config_pnmtext.h + freetypeFace.h freetypeFace.I + freetypeFont.h freetypeFont.I + pnmTextGlyph.h pnmTextGlyph.I + pnmTextMaker.h pnmTextMaker.I + ) + set(P3PNMTEXT_SOURCES + config_pnmtext.cxx + freetypeFace.cxx + freetypeFont.cxx + pnmTextGlyph.cxx + pnmTextMaker.cxx + ) -composite_sources(p3pnmtext P3PNMTEXT_SOURCES) -add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) -target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) -target_interrogate(p3pnmtext ALL) + composite_sources(p3pnmtext P3PNMTEXT_SOURCES) + add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) + target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) + target_interrogate(p3pnmtext ALL) +endif() diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 1815b6e529..1fa5fe5155 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -34,5 +34,8 @@ set(P3TEXT_SOURCES composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) -target_link_libraries(p3text p3pnmtext p3parametrics ${_FREETYPE_LIBRARIES}) +target_link_libraries(p3text p3parametrics) +if(HAVE_FREETYPE) + target_link_libraries(p3text p3pnmtext ${_FREETYPE_LIBRARIES}) +endif() target_interrogate(p3text ALL) From f5f2f39a30054d2199e0fd7c1a51b562bbfe2f0b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 18:09:18 -0700 Subject: [PATCH 214/744] CMake: Remove PYTHON_LIBRARIES link from interrogatedb; it's unused there. --- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 01b34cd51f..5de820961d 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -30,6 +30,6 @@ set(P3INTERROGATEDB_SOURCES composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) +target_link_libraries(p3interrogatedb p3dconfig) install(TARGETS p3interrogatedb DESTINATION lib) From e940c43b3e8670147e293c4d92f16acce48e3937 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 18:10:16 -0700 Subject: [PATCH 215/744] CMake: Remove PYTHON_LIBRARIES link from interrogatedb; it's unused there. --- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 58477d2ad7..927fea94a0 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -30,4 +30,4 @@ set(P3INTERROGATEDB_SOURCES composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3dconfig ${PYTHON_LIBRARIES}) +target_link_libraries(p3interrogatedb p3dconfig) From 50a6ab2a4d0a9aa0f4f1f441e4593a85b29449df Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 22:27:46 -0700 Subject: [PATCH 216/744] CMake: Rearrange panda/CMakeLists.txt for dependency order; older CMakes insist on it. --- panda/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index da3023c357..1a0c7ded18 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -29,10 +29,6 @@ add_subdirectory(src/linmath) add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) -add_subdirectory(src/glstuff) -add_subdirectory(src/glgsg) -add_subdirectory(src/glxdisplay) -add_subdirectory(src/x11display) add_subdirectory(src/pnmimage) add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) @@ -40,6 +36,10 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/glstuff) +add_subdirectory(src/glgsg) +add_subdirectory(src/x11display) +add_subdirectory(src/glxdisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/chan) From 1ffd204b006afaca9d76ff924e7033bde8b4324b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 22:27:46 -0700 Subject: [PATCH 217/744] CMake: Rearrange panda/CMakeLists.txt for dependency order; older CMakes insist on it. --- panda/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index cd4c40221b..a0d1673699 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -29,10 +29,6 @@ add_subdirectory(src/linmath) add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) -add_subdirectory(src/glstuff) -add_subdirectory(src/glgsg) -add_subdirectory(src/glxdisplay) -add_subdirectory(src/x11display) add_subdirectory(src/pnmimage) add_subdirectory(src/pnmimagetypes) add_subdirectory(src/gobj) @@ -40,6 +36,10 @@ add_subdirectory(src/pgraph) add_subdirectory(src/pgraphnodes) add_subdirectory(src/cull) add_subdirectory(src/display) +add_subdirectory(src/glstuff) +add_subdirectory(src/glgsg) +add_subdirectory(src/x11display) +add_subdirectory(src/glxdisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/chan) From 74bc1248672a1b4bfba3d32361c805e9956789f7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 23:28:28 -0700 Subject: [PATCH 218/744] CMake: Add support for building WGL display output. --- panda/CMakeLists.txt | 2 ++ panda/metalibs/pandagl/CMakeLists.txt | 5 ++++- panda/src/wgldisplay/CMakeLists.txt | 21 +++++++++++++++++++++ panda/src/windisplay/CMakeLists.txt | 17 +++++++++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 panda/src/wgldisplay/CMakeLists.txt create mode 100644 panda/src/windisplay/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index a0d1673699..3923e863c3 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,6 +40,8 @@ add_subdirectory(src/glstuff) add_subdirectory(src/glgsg) add_subdirectory(src/x11display) add_subdirectory(src/glxdisplay) +add_subdirectory(src/windisplay) +add_subdirectory(src/wgldisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/chan) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 96eb7465cc..9ee26ce33f 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -11,7 +11,10 @@ if(HAVE_GL) set(PANDAGL_LINK_TARGETS p3glgsg) if(HAVE_GLX) - set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3glxdisplay) + list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay) + endif() + if(HAVE_WGL) + list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay) endif() diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt new file mode 100644 index 0000000000..f6e83b06af --- /dev/null +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -0,0 +1,21 @@ +if(HAVE_WGL) + set(P3WGLDISPLAY_HEADERS + config_wgldisplay.h + wglGraphicsBuffer.I wglGraphicsBuffer.h + wglGraphicsPipe.I wglGraphicsPipe.h + wglGraphicsStateGuardian.I wglGraphicsStateGuardian.h + wglGraphicsWindow.I wglGraphicsWindow.h + wglext.h) + + set(P3WGLDISPLAY_SOURCES + config_wgldisplay.cxx + wglGraphicsBuffer.cxx + wglGraphicsPipe.cxx + wglGraphicsStateGuardian.cxx + wglGraphicsWindow.cxx) + + + composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) + add_library(p3wgldisplay ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) + target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg) +endif() diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt new file mode 100644 index 0000000000..3d07b6f9a9 --- /dev/null +++ b/panda/src/windisplay/CMakeLists.txt @@ -0,0 +1,17 @@ +if(WIN32) + set(P3WINDISPLAY_HEADERS + config_windisplay.h + winGraphicsPipe.I winGraphicsPipe.h + winGraphicsWindow.I winGraphicsWindow.h + winDetectDx.h) + + set(P3WINDISPLAY_SOURCES + config_windisplay.cxx winGraphicsPipe.cxx + winGraphicsWindow.cxx + winDetectDx9.cxx winDetectDx8.cxx) + + composite_sources(p3windisplay P3WINDISPLAY_SOURCES) + add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) + target_link_libraries(p3windisplay p3display p3putil + Coreimm.lib) +endif() From b64feda7296b4f2074617ef92266ba4ac37c72e2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Feb 2014 23:29:49 -0700 Subject: [PATCH 219/744] CMake: Add Windows platform libraries when building on Win32. --- panda/src/express/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 34645871ae..67f374fe0f 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -130,6 +130,10 @@ target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY}) target_interrogate(p3express ALL) +if(WIN32) + target_link_libraries(p3express advapi32.lib ws2_32.lib) +endif() + #add_executable(p3expressTestTypes test_types.cxx) #target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) #add_test(p3express_test_types p3expressTestTypes) From f9b590045a7ff80948b2f9251a1c03f8bceff0a0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 13:36:33 -0700 Subject: [PATCH 220/744] CMake: Fix typo. --- dtool/src/interrogate/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index f5404dc028..6d3752afae 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -55,4 +55,4 @@ target_link_libraries(interrogate add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${OPENSSL_LIBRARIES}) + p3pystub ${_OPENSSL_LIBRARIES}) From cc7e03f5eb56c74f4c0806eb06007852c2af3f87 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 13:37:46 -0700 Subject: [PATCH 221/744] CMake: Fix typo. --- dtool/src/interrogate/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 7ff12f5850..ce48803a04 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -56,5 +56,5 @@ install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${OPENSSL_LIBRARIES}) + p3pystub ${_OPENSSL_LIBRARIES}) install(TARGETS interrogate DESTINATION bin) From 6e0dc789b6a42cf62194a0cc8f23fea278940f67 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 16:32:37 -0700 Subject: [PATCH 222/744] CMake: Rearrange root CMakeLists; some includes may depend on dtool config. --- CMakeLists.txt | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c242ea016..80561e2182 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,22 +9,24 @@ enable_testing() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") -# Include global modules -include(AutoInclude) # Implements automatic include_directories finding -include(AddBisonTarget) # Defines add_bison_target function -include(AddFlexTarget) # Defines add_flex_target function -include(CompositeSources) # Defines composite_sources function +# Include global modules needed for configure scripts include(PackageConfig) # Defines package_option AND target_use_packages -include(Interrogate) # Defines target_interrogate AND add_python_module - -# Add the include path for source and header files generated by CMake -include_directories("${CMAKE_BINARY_DIR}/include") # Configure Panda3D include(dtool/PandaVersion.cmake) include(dtool/Package.cmake) include(dtool/Config.cmake) +# Include global modules +include(AutoInclude) # Implements automatic include_directories finding +include(AddBisonTarget) # Defines add_bison_target function +include(AddFlexTarget) # Defines add_flex_target function +include(CompositeSources) # Defines composite_sources function +include(Interrogate) # Defines target_interrogate AND add_python_module + +# Add the include path for source and header files generated by CMake +include_directories("${CMAKE_BINARY_DIR}/include") + # Determine which trees to build. option(BUILD_DTOOL "Build the dtool source tree." ON) option(BUILD_PANDA "Build the panda source tree." ON) From 5e78a80acc732546bfc4a7366a349333d3e32627 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 16:33:27 -0700 Subject: [PATCH 223/744] CMake: When HAVE_PYTHON, detect the Python install directories. Also, only include Python directories if HAVE_PYTHON. --- dtool/Config.cmake | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index f2dfa07993..a5595f22fc 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -437,9 +437,28 @@ package_option(PYTHON DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE is also enabled, Python bindings will be generated.") -# Always include Python, because we include it pretty much everywhere -# though we don't usually want to link it in as well. -include_directories(${PYTHON_INCLUDE_DIRS}) +# Also detect the optimal install paths: +if(HAVE_PYTHON) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print get_python_lib(False)" + OUTPUT_VARIABLE _LIB_DIR) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)" + OUTPUT_VARIABLE _ARCH_DIR) + + set(PYTHON_LIB_INSTALL_DIR "${_LIB_DIR}" CACHE STRING + "Path to the Python architecture-independent package directory.") + + set(PYTHON_ARCH_INSTALL_DIR "${_ARCH_DIR}" CACHE STRING + "Path to the Python architecture-dependent package directory.") + + # Always include Python, because we include it pretty much everywhere + # though we don't usually want to link it in as well. + include_directories(${PYTHON_INCLUDE_DIRS}) +endif() + # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. From e5a6259e46f47a0335014e84bed0883e850d3b72 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Feb 2014 16:33:34 -0700 Subject: [PATCH 224/744] CMake: Get Interrogated modules to install. --- cmake/macros/Interrogate.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index b4b9812115..8fdb80e2dd 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -272,3 +272,14 @@ function(add_python_module module) endif() endif() endfunction(add_python_module) + + +if(HAVE_PYTHON) + # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' + # as a package. + file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "") + + # The Interrogate path needs to be installed to the architecture-dependent + # Python directory. + install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_LIB_INSTALL_DIR}") +endif() From 6c5dcb0a7536c176f6266156fd6c26d8e6c4bd23 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 13:36:03 -0700 Subject: [PATCH 225/744] CMake: Install 'direct'. --- direct/CMakeLists.txt | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 904bf6f9ae..e14c11ad14 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -14,3 +14,25 @@ add_subdirectory(src/interval) add_subdirectory(src/showbase) add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) + +# Installation: +if(HAVE_PYTHON) + set(DIRECT_INSTALL_DIRECTORIES + actor cluster controls directbase directdevices directnotify directscripts + directtools directutil distributed extensions extensions_native ffi filter + fsm gui http interval leveleditor motiontrail p3d particles physics pyinst + showbase showutil stdpy task test tkpanels tkwidgets wxwidgets) + + foreach(dir ${DIRECT_INSTALL_DIRECTORIES}) + install( + DIRECTORY "src/${dir}" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct" + PATTERN "*.py") + endforeach() + + # We also need an __init__.py file, which we have to generate: + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "") + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") +endif() From 9fc2e6829b31e4f5153b8cd70c8cd2c8debe80c0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 14:30:46 -0700 Subject: [PATCH 226/744] CMake: Generate and install 'pandac' for backwards-compatibility. --- cmake/macros/Interrogate.cmake | 7 ++++++- direct/CMakeLists.txt | 3 +++ direct/src/pandac/CMakeLists.txt | 15 +++++++++++++++ direct/src/pandac/__init__.py | 5 +++++ 4 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 direct/src/pandac/CMakeLists.txt create mode 100644 direct/src/pandac/__init__.py diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 8fdb80e2dd..72b595ec1c 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -36,6 +36,8 @@ endif() set(IMOD_FLAGS -python-native) +# This stores the names of every module added to the Interrogate system: +set(ALL_INTERROGATE_MODULES CACHE INTERNAL "Internal variable") # # Function: target_interrogate(target [ALL] [source1 [source2 ...]]) @@ -270,6 +272,9 @@ function(add_python_module module) if(WIN32 AND NOT CYGWIN) set_target_properties(${module} PROPERTIES SUFFIX ".pyd") endif() + + list(APPEND ALL_INTERROGATE_MODULES "${module}") + set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endif() endfunction(add_python_module) @@ -281,5 +286,5 @@ if(HAVE_PYTHON) # The Interrogate path needs to be installed to the architecture-dependent # Python directory. - install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_LIB_INSTALL_DIR}") + install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}") endif() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index e14c11ad14..9bf1cbdb19 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -36,3 +36,6 @@ if(HAVE_PYTHON) FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") endif() + +# pandac has its own installation steps necessary: +add_subdirectory(src/pandac) diff --git a/direct/src/pandac/CMakeLists.txt b/direct/src/pandac/CMakeLists.txt new file mode 100644 index 0000000000..62969e7acf --- /dev/null +++ b/direct/src/pandac/CMakeLists.txt @@ -0,0 +1,15 @@ +if(HAVE_PYTHON) + # Generate PandaModules: + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" + "# Generated by CMake; edits not preserved\n") + foreach(module ${ALL_INTERROGATE_MODULES}) + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" + "from panda3d.${module} import *\n") + endforeach() + + # Now install ourselves: + file(GLOB python_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.py") + install( + FILES ${python_sources} "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac") +endif() diff --git a/direct/src/pandac/__init__.py b/direct/src/pandac/__init__.py new file mode 100644 index 0000000000..d313bda3dd --- /dev/null +++ b/direct/src/pandac/__init__.py @@ -0,0 +1,5 @@ +# N.B. PandaModules is generated at build time by CMake +from PandaModules import * + +# Now import all extensions: + From b7ddeacc8bfd111b77216dfc666acf1c9489d095 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 14:36:48 -0700 Subject: [PATCH 227/744] direct: libpandaexpress -> panda3d.core --- direct/src/directnotify/DirectNotify.py | 6 ++---- direct/src/directnotify/Notifier.py | 4 ++-- direct/src/showbase/Messenger.py | 2 +- direct/src/showbase/ProfileSession.py | 2 +- direct/src/showbase/PythonUtil.py | 2 +- direct/src/showbase/VFSImporter.py | 2 +- 6 files changed, 8 insertions(+), 10 deletions(-) diff --git a/direct/src/directnotify/DirectNotify.py b/direct/src/directnotify/DirectNotify.py index f2b8e351d1..d61420e3f5 100644 --- a/direct/src/directnotify/DirectNotify.py +++ b/direct/src/directnotify/DirectNotify.py @@ -61,10 +61,8 @@ class DirectNotify: """ # We use ConfigVariableString instead of base.config, in case - # we're running before ShowBase has finished initializing; and - # we import it directly from libpandaexpress, in case we're - # running before libpanda.dll is available. - from libpandaexpress import ConfigVariableString + # we're running before ShowBase has finished initializing + from panda3d.core import ConfigVariableString dconfigParam = ("notify-level-" + categoryName) cvar = ConfigVariableString(dconfigParam, "") diff --git a/direct/src/directnotify/Notifier.py b/direct/src/directnotify/Notifier.py index 5b1508fa99..eb91d5244e 100644 --- a/direct/src/directnotify/Notifier.py +++ b/direct/src/directnotify/Notifier.py @@ -4,7 +4,7 @@ for the programmer/user """ from LoggerGlobal import defaultLogger from direct.showbase import PythonUtil -from libpandaexpress import ConfigVariableBool +from panda3d.core import ConfigVariableBool import time import types import sys @@ -18,7 +18,7 @@ class Notifier: # with the C++ notify system. streamWriter = None if ConfigVariableBool('notify-integrate', True): - from libpandaexpress import StreamWriter, Notify + from panda3d.core import StreamWriter, Notify streamWriter = StreamWriter(Notify.out(), False) showTime = ConfigVariableBool('notify-timestamp', False) diff --git a/direct/src/showbase/Messenger.py b/direct/src/showbase/Messenger.py index 56ec2958de..44248e6a4e 100644 --- a/direct/src/showbase/Messenger.py +++ b/direct/src/showbase/Messenger.py @@ -7,7 +7,7 @@ from PythonUtil import * from direct.directnotify import DirectNotifyGlobal import types -from libpandaexpress import ConfigVariableBool +from panda3d.core import ConfigVariableBool # If using the Toontown ActiveX launcher, this must be set true. # Also, Panda must be compiled with SIMPLE_THREADS or no HAVE_THREADS diff --git a/direct/src/showbase/ProfileSession.py b/direct/src/showbase/ProfileSession.py index ad2cdc2606..c2cd4f7b67 100755 --- a/direct/src/showbase/ProfileSession.py +++ b/direct/src/showbase/ProfileSession.py @@ -1,4 +1,4 @@ -from pandac.libpandaexpressModules import TrueClock +from panda3d.core import TrueClock from direct.directnotify.DirectNotifyGlobal import directNotify from direct.showbase.PythonUtil import ( StdoutCapture, _installProfileCustomFuncs,_removeProfileCustomFuncs, diff --git a/direct/src/showbase/PythonUtil.py b/direct/src/showbase/PythonUtil.py index 418bb86f6b..84ca4c32f6 100644 --- a/direct/src/showbase/PythonUtil.py +++ b/direct/src/showbase/PythonUtil.py @@ -63,7 +63,7 @@ from direct.directutil import Verify # Don't import libpandaexpressModules, which doesn't get built until # genPyCode. import direct.extensions_native.extension_native_helpers -from libpandaexpress import ConfigVariableBool +from panda3d.core import ConfigVariableBool ScalarTypes = (types.FloatType, types.IntType, types.LongType) diff --git a/direct/src/showbase/VFSImporter.py b/direct/src/showbase/VFSImporter.py index 3bf8275cfc..f9cc552a59 100644 --- a/direct/src/showbase/VFSImporter.py +++ b/direct/src/showbase/VFSImporter.py @@ -1,4 +1,4 @@ -from libpandaexpress import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream +from panda3d.core import Filename, VirtualFileSystem, VirtualFileMountSystem, OFileStream, copyStream import sys import os import marshal From 211f4cb49843ef3605a0ec943e17c448dbca8fef Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 15:54:39 -0700 Subject: [PATCH 228/744] direct: Kind of hacky, but make 'pandac' install the extensions. --- direct/src/pandac/__init__.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/direct/src/pandac/__init__.py b/direct/src/pandac/__init__.py index d313bda3dd..4b79eb4dce 100644 --- a/direct/src/pandac/__init__.py +++ b/direct/src/pandac/__init__.py @@ -1,5 +1,32 @@ # N.B. PandaModules is generated at build time by CMake from PandaModules import * +import __builtin__ # Now import all extensions: +from direct.extensions_native.extension_native_helpers import * +extensions = [ + 'CInterval', 'EggGroupNode', 'EggPrimitive', 'HTTPChannel', 'Mat3', + 'NodePath', 'NodePathCollection', 'OdeBody', 'OdeGeom', 'OdeJoint', + 'OdeSpace', 'Ramfile', 'StreamReader', 'VBase3', 'VBase4' +] +# Prior to importing, we need to make the Dtool_funcToMethod function and +# the extended class available globally. This is hacky, but tacking it on +# __builtin__ works just fine: +import __builtin__ +__builtin__.Dtool_funcToMethod = Dtool_funcToMethod +__builtin__.Dtool_ObjectToDict = Dtool_ObjectToDict + +for extension in extensions: + if extension not in locals(): + # Not a class we have compiled in, skip it! + continue + + module = 'direct.extensions_native.%s_extensions' % extension + + setattr(__builtin__, extension, locals()[extension]) + __import__(module) + del __builtin__.__dict__[extension] + +del __builtin__.Dtool_funcToMethod +del __builtin__.Dtool_ObjectToDict From b5d9b8658d1b4529da92b95be54a90e626ec299d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Feb 2014 18:19:05 -0700 Subject: [PATCH 229/744] CMake: Panda3D physics and particlesystem. --- panda/CMakeLists.txt | 7 ++++ panda/metalibs/pandaphysics/CMakeLists.txt | 4 ++ panda/src/particlesystem/CMakeLists.txt | 45 ++++++++++++++++++++++ panda/src/physics/CMakeLists.txt | 43 +++++++++++++++++++++ 4 files changed, 99 insertions(+) create mode 100644 panda/metalibs/pandaphysics/CMakeLists.txt create mode 100644 panda/src/particlesystem/CMakeLists.txt create mode 100644 panda/src/physics/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 1a0c7ded18..74a1f8bc34 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -61,10 +61,15 @@ add_subdirectory(src/egg2pg) add_subdirectory(src/framework) add_subdirectory(src/testbed) +# For other metalibs +add_subdirectory(src/physics) +add_subdirectory(src/particlesystem) + # Include panda metalibs add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandagl) add_subdirectory(metalibs/pandaegg) +add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: @@ -86,3 +91,5 @@ add_python_module(core ${CORE_MODULE_COMPONENTS}) if(HAVE_EGG) add_python_module(egg p3egg p3egg2pg) endif() + +add_python_module(physics p3physics p3particlesystem) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt new file mode 100644 index 0000000000..f48411820c --- /dev/null +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -0,0 +1,4 @@ +add_library(pandaphysics pandaphysics.cxx) +target_link_libraries(pandaphysics p3physics p3particlesystem) + +install(TARGETS pandaphysics DESTINATION lib) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt new file mode 100644 index 0000000000..f2e405b41b --- /dev/null +++ b/panda/src/particlesystem/CMakeLists.txt @@ -0,0 +1,45 @@ +set(P3PARTICLESYSTEM_HEADERS + baseParticle.I baseParticle.h baseParticleEmitter.I + baseParticleEmitter.h baseParticleFactory.I + baseParticleFactory.h baseParticleRenderer.I + baseParticleRenderer.h arcEmitter.I arcEmitter.h + boxEmitter.I boxEmitter.h + config_particlesystem.h discEmitter.I discEmitter.h + geomParticleRenderer.I geomParticleRenderer.h lineEmitter.I + lineEmitter.h lineParticleRenderer.I lineParticleRenderer.h + particleSystem.I particleSystem.h particleSystemManager.I + particleSystemManager.h pointEmitter.I pointEmitter.h + pointParticle.h pointParticleFactory.h + pointParticleRenderer.I pointParticleRenderer.h + rectangleEmitter.I rectangleEmitter.h ringEmitter.I + ringEmitter.h sparkleParticleRenderer.I + sparkleParticleRenderer.h sphereSurfaceEmitter.I + sphereSurfaceEmitter.h sphereVolumeEmitter.I + sphereVolumeEmitter.h spriteParticleRenderer.I + spriteParticleRenderer.h tangentRingEmitter.I + tangentRingEmitter.h zSpinParticle.I zSpinParticle.h + zSpinParticleFactory.I zSpinParticleFactory.h + particleCommonFuncs.h colorInterpolationManager.I + colorInterpolationManager.h) + +set(P3PARTICLESYSTEM_SOURCES + baseParticle.cxx baseParticleEmitter.cxx baseParticleFactory.cxx + baseParticleRenderer.cxx boxEmitter.cxx arcEmitter.cxx + config_particlesystem.cxx discEmitter.cxx + geomParticleRenderer.cxx lineEmitter.cxx + lineParticleRenderer.cxx particleSystem.cxx + particleSystemManager.cxx pointEmitter.cxx pointParticle.cxx + pointParticleFactory.cxx pointParticleRenderer.cxx + rectangleEmitter.cxx ringEmitter.cxx + sparkleParticleRenderer.cxx sphereSurfaceEmitter.cxx + sphereVolumeEmitter.cxx spriteParticleRenderer.cxx + tangentRingEmitter.cxx zSpinParticle.cxx + zSpinParticleFactory.cxx colorInterpolationManager.cxx) + + +composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) +add_library(p3particlesystem ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) +target_link_libraries(p3particlesystem p3pgraph p3physics) +target_interrogate(p3particlesystem ALL) + +install(TARGETS p3particlesystem DESTINATION lib) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt new file mode 100644 index 0000000000..3353864326 --- /dev/null +++ b/panda/src/physics/CMakeLists.txt @@ -0,0 +1,43 @@ +set(P3PHYSICS_HEADERS + actorNode.I actorNode.h angularEulerIntegrator.h angularForce.h + angularIntegrator.h angularVectorForce.I + angularVectorForce.h baseForce.I baseForce.h + baseIntegrator.I baseIntegrator.h config_physics.h + forceNode.I forceNode.h + linearControlForce.I linearControlForce.h + linearCylinderVortexForce.I linearCylinderVortexForce.h + linearDistanceForce.I + linearDistanceForce.h linearEulerIntegrator.h linearForce.I + linearForce.h linearFrictionForce.I linearFrictionForce.h + linearIntegrator.h linearJitterForce.h linearNoiseForce.I + linearNoiseForce.h linearRandomForce.I linearRandomForce.h + linearSinkForce.h linearSourceForce.h + linearUserDefinedForce.I linearUserDefinedForce.h + linearVectorForce.I linearVectorForce.h physical.I + physical.h physicalNode.I physicalNode.h + physicsCollisionHandler.I physicsCollisionHandler.h + physicsManager.I physicsManager.h + physicsObject.I physicsObject.h + physicsObjectCollection.I physicsObjectCollection.h) + +set(P3PHYSICS_SOURCES + actorNode.cxx angularEulerIntegrator.cxx angularForce.cxx + angularIntegrator.cxx angularVectorForce.cxx baseForce.cxx + baseIntegrator.cxx config_physics.cxx forceNode.cxx + linearControlForce.cxx + linearCylinderVortexForce.cxx linearDistanceForce.cxx + linearEulerIntegrator.cxx linearForce.cxx + linearFrictionForce.cxx linearIntegrator.cxx + linearJitterForce.cxx linearNoiseForce.cxx + linearRandomForce.cxx linearSinkForce.cxx + linearSourceForce.cxx linearUserDefinedForce.cxx + linearVectorForce.cxx physical.cxx physicalNode.cxx + physicsCollisionHandler.cxx physicsManager.cxx physicsObject.cxx + physicsObjectCollection.cxx) + +composite_sources(p3physics P3PHYSICS_SOURCES) +add_library(p3physics ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) +target_link_libraries(p3physics p3pgraph p3linmath p3collide) +target_interrogate(p3physics ALL) + +install(TARGETS p3physics DESTINATION lib) From f97222135747cbfc2e553842964668b50bc94b7d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 16:20:57 -0700 Subject: [PATCH 230/744] CMake: Detect ODE. --- cmake/modules/FindODE.cmake | 80 +++++++++++++++++++++++++++++++++++++ dtool/Config.cmake | 5 +++ 2 files changed, 85 insertions(+) create mode 100644 cmake/modules/FindODE.cmake diff --git a/cmake/modules/FindODE.cmake b/cmake/modules/FindODE.cmake new file mode 100644 index 0000000000..6c70f69de7 --- /dev/null +++ b/cmake/modules/FindODE.cmake @@ -0,0 +1,80 @@ +# Filename: FindODE.cmake +# Author: CFSworks (7 Feb, 2014) +# +# Usage: +# find_package(ODE [REQUIRED] [QUIET]) +# +# Once done this will define: +# ODE_FOUND - system has ode +# ODE_INCLUDE_DIR - the ode include directory +# ODE_LIBRARY_DIR - the ode library directory +# ODE_LIBRARY - the path to the library binary +# +# ODE_RELEASE_LIBRARY - the filepath of the ode release library +# ODE_DEBUG_LIBRARY - the filepath of the ode debug library +# + +if(NOT ODE_INCLUDE_DIR OR NOT ODE_LIBRARY_DIR) + # Find the libode include files + find_path(ODE_INCLUDE_DIR + NAMES "ode.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "" "ode" + ) + + # Find the libode library built for release + find_library(ODE_RELEASE_LIBRARY + NAMES "ode" "libode" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + # Find the libode library built for debug + find_library(ODE_DEBUG_LIBRARY + NAMES "oded" "liboded" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + + mark_as_advanced(ODE_INCLUDE_DIR) + mark_as_advanced(ODE_RELEASE_LIBRARY) + mark_as_advanced(ODE_DEBUG_LIBRARY) +endif() + +# Choose library +if(CMAKE_BUILD_TYPE MATCHES "Debug" AND ODE_DEBUG_LIBRARY) + set(ODE_LIBRARY ${ODE_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libode's library binary.") +elseif(ODE_RELEASE_LIBRARY) + set(ODE_LIBRARY ${ODE_RELEASE_LIBRARY} CACHE FILEPATH "The filepath to libode's library binary.") +elseif(ODE_DEBUG_LIBRARY) + set(ODE_LIBRARY ${ODE_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libode's library binary.") +endif() + +# Translate library into library directory +if(ODE_LIBRARY) + unset(ODE_LIBRARY_DIR CACHE) + get_filename_component(ODE_LIBRARY_DIR "${ODE_LIBRARY}" PATH) + set(ODE_LIBRARY_DIR "${ODE_LIBRARY_DIR}" CACHE PATH "The path to libode's library directory.") # Library path +endif() + +mark_as_advanced(ODE_LIBRARY) +mark_as_advanced(ODE_LIBRARY_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ODE DEFAULT_MSG ODE_LIBRARY ODE_INCLUDE_DIR ODE_LIBRARY_DIR) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a5595f22fc..5851928cfc 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -589,6 +589,11 @@ find_package(ZLIB) package_option(ZLIB DEFAULT ON "Enables support for compression of Panda assets.") +# Is ODE installed, and where? +find_package(ODE) + +package_option(ODE DEFAULT ON + "Enables support for ridid-body physics using the Open Dynamics Engine.") # Is OpenGL installed, and where? find_package(OpenGL QUIET) From 3c240ae0cd5a94909397f2deacb1171d31404b6f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 16:21:49 -0700 Subject: [PATCH 231/744] CMake: Build panda3d.ode. --- panda/CMakeLists.txt | 9 ++++- panda/src/ode/CMakeLists.txt | 76 ++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100755 panda/src/ode/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 74a1f8bc34..c057dc6539 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -61,9 +61,12 @@ add_subdirectory(src/egg2pg) add_subdirectory(src/framework) add_subdirectory(src/testbed) -# For other metalibs +# For other components +# physics add_subdirectory(src/physics) add_subdirectory(src/particlesystem) +# ode +add_subdirectory(src/ode) # Include panda metalibs add_subdirectory(metalibs/panda) @@ -93,3 +96,7 @@ if(HAVE_EGG) endif() add_python_module(physics p3physics p3particlesystem) + +if(HAVE_ODE) + add_python_module(ode p3ode) +endif() diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt new file mode 100755 index 0000000000..9e17af5b24 --- /dev/null +++ b/panda/src/ode/CMakeLists.txt @@ -0,0 +1,76 @@ +if(HAVE_ODE) + set(P3ODE_HEADERS + ode_includes.h config_ode.h + odeWorld.I odeWorld.h + odeMass.I odeMass.h + odeBody.I odeBody.h + odeJointGroup.I odeJointGroup.h + odeJoint.I odeJoint.h + odeUtil.h + odeSpace.I odeSpace.h + odeGeom.I odeGeom.h + odeSurfaceParameters.I odeSurfaceParameters.h + odeContactGeom.I odeContactGeom.h + odeContact.I odeContact.h + odeAMotorJoint.I odeAMotorJoint.h + odeBallJoint.I odeBallJoint.h + odeContactJoint.I odeContactJoint.h + odeFixedJoint.I odeFixedJoint.h + odeHingeJoint.I odeHingeJoint.h + odeHinge2Joint.I odeHinge2Joint.h + odeLMotorJoint.I odeLMotorJoint.h + odeNullJoint.I odeNullJoint.h + odePlane2dJoint.I odePlane2dJoint.h + odeSliderJoint.I odeSliderJoint.h + odeUniversalJoint.I odeUniversalJoint.h + odeJointCollection.I odeJointCollection.h + odeSimpleSpace.I odeSimpleSpace.h + odeHashSpace.I odeHashSpace.h + odeQuadTreeSpace.I odeQuadTreeSpace.h + odeSphereGeom.I odeSphereGeom.h + odeBoxGeom.I odeBoxGeom.h + odePlaneGeom.I odePlaneGeom.h + odeCappedCylinderGeom.I odeCappedCylinderGeom.h + odeCylinderGeom.I odeCylinderGeom.h + odeRayGeom.I odeRayGeom.h + odeTriMeshData.I odeTriMeshData.h + odeTriMeshGeom.I odeTriMeshGeom.h + odeCollisionEntry.I odeCollisionEntry.h + odeHelperStructs.h) + + set(P3ODE_SOURCES + config_ode.cxx + odeWorld.cxx odeMass.cxx odeBody.cxx + odeJointGroup.cxx odeJoint.cxx + odeUtil.cxx + odeSpace.cxx + odeGeom.cxx + odeSurfaceParameters.cxx + odeContactGeom.cxx odeContact.cxx + odeAMotorJoint.cxx odeBallJoint.cxx + odeContactJoint.cxx odeFixedJoint.cxx + odeHingeJoint.cxx odeHinge2Joint.cxx + odeLMotorJoint.cxx odeNullJoint.cxx + odePlane2dJoint.cxx odeSliderJoint.cxx + odeUniversalJoint.cxx odeJointCollection.cxx + odeSimpleSpace.cxx + odeHashSpace.cxx odeQuadTreeSpace.cxx + odeSphereGeom.cxx odeBoxGeom.cxx + odePlaneGeom.cxx odeCappedCylinderGeom.cxx + odeCylinderGeom.cxx odeRayGeom.cxx + odeTriMeshData.cxx odeTriMeshGeom.cxx + odeCollisionEntry.cxx) + + set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") + list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h") + list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHeightFieldGeom.h") + list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") + + composite_sources(p3ode P3ODE_SOURCES) + add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) + set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) + target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) + target_interrogate(p3ode ${P3ODE_IGATE_SOURCES}) + + install(TARGETS p3ode DESTINATION lib) +endif() From 87cae490cd3b906b28fc068e317daebee5411b0d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:51:05 -0700 Subject: [PATCH 232/744] CMake: Only build 'direct' if BUILD_DIRECT is on. --- CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c242ea016..d7ca1c4600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,8 +26,9 @@ include(dtool/Package.cmake) include(dtool/Config.cmake) # Determine which trees to build. -option(BUILD_DTOOL "Build the dtool source tree." ON) -option(BUILD_PANDA "Build the panda source tree." ON) +option(BUILD_DTOOL "Build the dtool source tree." ON) +option(BUILD_PANDA "Build the panda source tree." ON) +option(BUILD_DIRECT "Build the direct source tree." ON) # Include Panda3D packages if(BUILD_DTOOL) @@ -38,4 +39,6 @@ if(BUILD_PANDA) add_subdirectory(panda) endif() -add_subdirectory(direct) +if(BUILD_DIRECT) + add_subdirectory(direct) +endif() From e2a03d6435f94afc390bdc1b73e8be4542199c33 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:51:14 -0700 Subject: [PATCH 233/744] CMake: 'direct' depends on 'panda' --- direct/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 904bf6f9ae..28f09f3c8c 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT BUILD_PANDA) + message(FATAL_ERROR "Cannot build direct without panda! Please enable the BUILD_PANDA option.") +endif() + # Include source directories which have C++ components: add_subdirectory(src/directbase) add_subdirectory(src/autorestart) From 9035f7aa85f02b0f3f90c50dd82a157978b3a65e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 8 Feb 2014 17:59:12 -0700 Subject: [PATCH 234/744] CMake: Only build 'autorestart' on UNIX. --- direct/src/autorestart/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt index 31524487c5..3293a08e08 100644 --- a/direct/src/autorestart/CMakeLists.txt +++ b/direct/src/autorestart/CMakeLists.txt @@ -1,3 +1,5 @@ -add_executable(autorestart autorestart.c) -set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) -target_link_libraries(autorestart p3dtool) +if(UNIX) + add_executable(autorestart autorestart.c) + set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_link_libraries(autorestart p3dtool) +endif() From 9f8ab63e754b1bf893a524b305fbb3ae5e033591 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 14 Feb 2014 06:23:05 -0700 Subject: [PATCH 235/744] CMake: Build audiotraits. --- panda/CMakeLists.txt | 1 + panda/src/audiotraits/CMakeLists.txt | 64 ++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 panda/src/audiotraits/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index c057dc6539..98c570bd4f 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -42,6 +42,7 @@ add_subdirectory(src/x11display) add_subdirectory(src/glxdisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) +add_subdirectory(src/audiotraits) add_subdirectory(src/chan) add_subdirectory(src/char) add_subdirectory(src/dgraph) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt new file mode 100644 index 0000000000..e4a28424fe --- /dev/null +++ b/panda/src/audiotraits/CMakeLists.txt @@ -0,0 +1,64 @@ +if(HAVE_AUDIO) + + if(HAVE_RAD_MSS) + set(P3MILES_HEADERS + config_milesAudio.h + milesAudioManager.h + milesAudioSound.I milesAudioSound.h + milesAudioSample.I milesAudioSample.h + milesAudioSequence.I milesAudioSequence.h + milesAudioStream.I milesAudioStream.h + globalMilesManager.I globalMilesManager.h) + + set(P3MILES_SOURCES + config_milesAudio.cxx milesAudioManager.cxx milesAudioSound.cxx + milesAudioStream.cxx globalMilesManager.cxx milesAudioSample.cxx + milesAudioSequence.cxx) + + composite_sources(p3miles_audio P3MILES_SOURCES) + include_directories(${MILES_INCLUDE_DIR}) + add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) + target_link_libraries(p3miles_audio p3audio p3event p3pipeline + ${_MILES_LIBRARY}) + + install(TARGETS p3miles_audio DESTINATION lib) + endif() + + if(HAVE_FMODEX) + set(P3FMOD_HEADERS + config_fmodAudio.h + fmodAudioManager.h + fmodAudioSound.I fmodAudioSound.h) + + set(P3FMOD_SOURCES + config_fmodAudio.cxx fmodAudioManager.cxx fmodAudioSound.cxx) + + composite_sources(p3fmod_audio P3FMOD_SOURCES) + include_directories(${FMODEX_INCLUDE_DIR}) + add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) + target_link_libraries(p3fmod_audio p3audio p3event + ${_FMODEX_LIBRARY}) + + install(TARGETS p3fmod_audio DESTINATION lib) + endif() + + if(HAVE_OPENAL) + set(P3OPENAL_HEADERS + config_openalAudio.h + openalAudioManager.h + openalAudioSound.I openalAudioSound.h) + + set(P3OPENAL_SOURCES + config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx) + + + composite_sources(p3openal_audio P3OPENAL_SOURCES) + include_directories(${OPENAL_INCLUDE_DIR}) + add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) + target_link_libraries(p3openal_audio p3audio p3event + ${_OPENAL_LIBRARY}) + + install(TARGETS p3openal_audio DESTINATION lib) + endif() + +endif() From 3969d0e1acda6cdff8ec3cdc3d2b72af7d27df87 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 18:33:00 -0700 Subject: [PATCH 236/744] CMake: Link Interrogate bindings against metalibs. --- cmake/macros/Interrogate.cmake | 26 ++++++++++++++++++++++---- panda/CMakeLists.txt | 2 +- panda/metalibs/panda/CMakeLists.txt | 13 ++++++++++++- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 72b595ec1c..0025cc9161 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -219,16 +219,34 @@ function(interrogate_sources target output database module) endfunction(interrogate_sources) # -# Function: add_python_module(module [lib1 [lib2 ...]]) -# Uses interrogate to create a Python module. +# Function: add_python_module(module [lib1 [lib2 ...]] [LINK lib1 ...]) +# Uses interrogate to create a Python module. If the LINK keyword is specified, +# the Python module is linked against the specified libraries instead of those +# listed before. # function(add_python_module module) if(HAVE_PYTHON AND HAVE_INTERROGATE) - set(targets ${ARGN}) + set(targets) + set(link_targets) set(infiles) set(sources) set(HACKlinklibs) + set(link_keyword OFF) + foreach(arg ${ARGN}) + if(arg STREQUAL "LINK") + set(link_keyword ON) + elseif(link_keyword) + list(APPEND link_targets "${arg}") + else() + list(APPEND targets "${arg}") + endif() + endforeach(arg) + + if(NOT link_keyword) + set(link_targets ${targets}) + endif() + foreach(target ${targets}) interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" "${module}") list(APPEND infiles "${target}.in") @@ -262,7 +280,7 @@ function(add_python_module module) add_library(${module} MODULE "${module}_module.cxx" ${sources}) target_link_libraries(${module} - ${targets} ${PYTHON_LIBRARIES} p3interrogatedb) + ${link_targets} ${PYTHON_LIBRARIES} p3interrogatedb) target_link_libraries(${module} ${HACKlinklibs}) set_target_properties(${module} PROPERTIES diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 98c570bd4f..3f7ac5b30d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -90,7 +90,7 @@ if(HAVE_FREETYPE) list(APPEND CORE_MODULE_COMPONENTS p3pnmtext) endif() -add_python_module(core ${CORE_MODULE_COMPONENTS}) +add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) if(HAVE_EGG) add_python_module(egg p3egg p3egg2pg) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 3170a4717e..a44ef0cdd0 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,5 +1,16 @@ add_definitions(-DBUILDING_PANDA) -set(PANDA_LINK_TARGETS p3pnmimagetypes p3device) +set(PANDA_LINK_TARGETS + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader + p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet + p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) + +if(HAVE_AUDIO) + list(APPEND PANDA_LINK_TARGETS p3audio) +endif() +if(HAVE_FREETYPE) + list(APPEND PANDA_LINK_TARGETS p3pnmtext) +endif() if(LINK_IN_PHYSX) add_definitions(-DBUILDING_PANDAPHYSX) From 0c04655f86a37261c08e7d5a8a9ca1ae96efa3a0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 18:33:47 -0700 Subject: [PATCH 237/744] CMake: Explicitly require Python 2.x. --- dtool/Config.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 5851928cfc..a21bbee98c 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -429,8 +429,8 @@ platforms. Currently experimental." ON) # Is Python installed, and should Python interfaces be generated? -find_package(PythonLibs) -find_package(PythonInterp) +find_package(PythonLibs 2.5) +find_package(PythonInterp 2.5) set(PYTHON_FOUND ${PYTHONLIBS_FOUND}) package_option(PYTHON DEFAULT ON From 161beda242c29245144757ab7870d6ff73eb0cb9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 21:53:15 -0700 Subject: [PATCH 238/744] CMake: Add missing quotes in FindCg module. --- cmake/modules/FindCg.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 3fdfe757ca..f7c43884a2 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -141,7 +141,7 @@ if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIRS) set(CG_LIBRARY_DIR "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path endif() - string(REGEX REPLACE "/Cg$" "" CG_BASE_INCLUDE_DIR ${CG_INCLUDE_DIR}) + string(REGEX REPLACE "/Cg$" "" CG_BASE_INCLUDE_DIR "${CG_INCLUDE_DIR}") set(CG_INCLUDE_DIRS ${CG_BASE_INCLUDE_DIR} ${CG_INCLUDE_DIR}) mark_as_advanced(CG_INCLUDE_DIRS) From 301ee4b8c3fc0d0b00163ee232e56e3fe1eb1a8b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 21:53:35 -0700 Subject: [PATCH 239/744] CMake: Add missing dependency on zlib from p3express. --- panda/src/express/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 631078215f..56d324bcbf 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -127,7 +127,7 @@ composite_sources(p3express P3EXPRESS_SOURCES) add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig - ${_TAR_LIBRARY}) + ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) target_interrogate(p3express ALL) install(TARGETS p3express DESTINATION lib) From 0bcce442c3bb4b74df5360ef8d409258d41885d5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 21:57:15 -0700 Subject: [PATCH 240/744] CMake: Properly link against the proper frameworks on OS X. --- dtool/src/dtoolutil/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 04a4e0ce6c..f68db48a5b 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -56,4 +56,10 @@ if(HAVE_PYTHON) target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) endif() +if(APPLE) + find_library(FOUNDATION_LIBRARY Foundation) + find_library(APPKIT_LIBRARY AppKit) + target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY}) +endif() + install(TARGETS p3dtoolutil DESTINATION lib) From cfe06ed30fb83c7406cb93c92aaeb68025fe6079 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 22:07:32 -0700 Subject: [PATCH 241/744] CMake: Fix building p3display under OSX. --- panda/src/display/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 106fab5646..583b60f79e 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -78,12 +78,17 @@ if(HAVE_PYTHON) ) endif() -if(OSX_PLATFORM) - set(P3DISPLAY_HEADER +if(APPLE) + set(P3DISPLAY_HEADERS ${P3DISPLAY_HEADERS} subprocessWindowBuffer.h subprocessWindowBuffer.I ) + + set(P3DISPLAY_SOURCES + ${P3DISPLAY_SOURCES} + subprocessWindowBuffer.cxx + ) endif() composite_sources(p3display P3DISPLAY_SOURCES) From 56d180c26e0a9ad6213e767718685ecb20db44fa Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Mar 2014 22:11:29 -0700 Subject: [PATCH 242/744] CMake: Adjust indentation. --- panda/src/display/CMakeLists.txt | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 583b60f79e..245f076ea1 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -68,27 +68,27 @@ set(P3DISPLAY_SOURCES ) if(HAVE_PYTHON) - set(P3DISPLAY_HEADERS - ${P3DISPLAY_HEADERS} - pythonGraphicsWindowProc.h - ) - set(P3DISPLAY_SOURCES - ${P3DISPLAY_SOURCES} - pythonGraphicsWindowProc.cxx - ) + set(P3DISPLAY_HEADERS + ${P3DISPLAY_HEADERS} + pythonGraphicsWindowProc.h + ) + set(P3DISPLAY_SOURCES + ${P3DISPLAY_SOURCES} + pythonGraphicsWindowProc.cxx + ) endif() if(APPLE) - set(P3DISPLAY_HEADERS - ${P3DISPLAY_HEADERS} - subprocessWindowBuffer.h - subprocessWindowBuffer.I - ) + set(P3DISPLAY_HEADERS + ${P3DISPLAY_HEADERS} + subprocessWindowBuffer.h + subprocessWindowBuffer.I + ) - set(P3DISPLAY_SOURCES - ${P3DISPLAY_SOURCES} - subprocessWindowBuffer.cxx - ) + set(P3DISPLAY_SOURCES + ${P3DISPLAY_SOURCES} + subprocessWindowBuffer.cxx + ) endif() composite_sources(p3display P3DISPLAY_SOURCES) From ea48d3d7a6e92437ffa5e42e0189aefa26871709 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Mar 2014 03:27:39 -0700 Subject: [PATCH 243/744] CMake: Build OS X display modules. --- panda/CMakeLists.txt | 2 ++ panda/metalibs/pandagl/CMakeLists.txt | 7 +++++++ panda/src/cocoadisplay/CMakeLists.txt | 29 +++++++++++++++++++++++++++ panda/src/osxdisplay/CMakeLists.txt | 27 +++++++++++++++++++++++++ 4 files changed, 65 insertions(+) create mode 100644 panda/src/cocoadisplay/CMakeLists.txt create mode 100644 panda/src/osxdisplay/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 3f7ac5b30d..c0f544b3a8 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -40,6 +40,8 @@ add_subdirectory(src/glstuff) add_subdirectory(src/glgsg) add_subdirectory(src/x11display) add_subdirectory(src/glxdisplay) +add_subdirectory(src/osxdisplay) +add_subdirectory(src/cocoadisplay) add_subdirectory(src/movies) add_subdirectory(src/audio) add_subdirectory(src/audiotraits) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 2134f350eb..8a2c3248e7 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -14,6 +14,13 @@ if(HAVE_GL) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3glxdisplay) endif() + if(HAVE_COCOA) + set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3cocoadisplay) + endif() + + if(HAVE_CARBON) + set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3osxdisplay) + endif() add_library(pandagl pandagl.cxx) target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt new file mode 100644 index 0000000000..d8fb78d894 --- /dev/null +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -0,0 +1,29 @@ +if(APPLE AND HAVE_GL AND HAVE_COCOA) + set(P3COCOADISPLAY_HEADERS + config_cocoadisplay.h + cocoaGraphicsPipe.h cocoaGraphicsPipe.I + cocoaGraphicsWindow.h cocoaGraphicsWindow.I + cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I + cocoaPandaView.h cocoaPandaWindowDelegate.h) + + set(P3COCOADISPLAY_SOURCES + config_cocoadisplay.mm + cocoaGraphicsPipe.mm + cocoaGraphicsStateGuardian.mm + cocoaGraphicsWindow.mm + cocoaPandaView.mm + cocoaPandaWindow.mm + cocoaPandaWindowDelegate.mm) + + #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) + add_library(p3cocoadisplay ${P3COCOADISPLAY_SOURCES} ${P3COCOADISPLAY_HEADERS}) + target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) + + # Frameworks: + find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) + find_library(APPKIT_LIBRARY AppKit) + target_link_libraries(p3cocoadisplay + ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY}) + + install(TARGETS p3cocoadisplay DESTINATION lib) +endif() diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt new file mode 100644 index 0000000000..2a16f6c3ce --- /dev/null +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -0,0 +1,27 @@ +if(APPLE AND HAVE_GL AND HAVE_CARBON) + set(P3OSXDISPLAY_HEADERS + config_osxdisplay.h + osxGraphicsPipe.h + osxGraphicsWindow.h osxGraphicsWindow.I + osxGraphicsStateGuardian.h) + + set(P3OSXDISPLAY_SOURCES + config_osxdisplay.cxx osxGraphicsPipe.cxx osxGraphicsStateGuardian.cxx + osxGraphicsBuffer.cxx) + + composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) + add_library(p3osxdisplay ${P3OSXDISPLAY_SOURCES} ${P3OSXDISPLAY_HEADERS}) + target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) + + # Frameworks: + find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) + find_library(CARBON_LIBRARY Carbon) + find_library(AGL_LIBRARY AGL) + find_library(CORESERVICES_LIBRARY CoreServices) + find_library(COCOA_LIBRARY Cocoa) + target_link_libraries(p3osxdisplay + ${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} + ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) + + install(TARGETS p3osxdisplay DESTINATION lib) +endif() From c8797058cb173f2528ac21c46c4025dd940bbf70 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Mar 2014 03:27:57 -0700 Subject: [PATCH 244/744] Fix missing imports/includes in cocoadisplay. --- panda/src/cocoadisplay/cocoaGraphicsWindow.mm | 1 + panda/src/cocoadisplay/cocoaPandaView.h | 3 +++ panda/src/cocoadisplay/cocoaPandaView.mm | 1 + panda/src/cocoadisplay/cocoaPandaWindowDelegate.h | 2 ++ 4 files changed, 7 insertions(+) diff --git a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm index e314fbe4a0..c34215233f 100644 --- a/panda/src/cocoadisplay/cocoaGraphicsWindow.mm +++ b/panda/src/cocoadisplay/cocoaGraphicsWindow.mm @@ -38,6 +38,7 @@ #import #import #import +#import #import //#import diff --git a/panda/src/cocoadisplay/cocoaPandaView.h b/panda/src/cocoadisplay/cocoaPandaView.h index f892c6a685..05ac92bc81 100644 --- a/panda/src/cocoadisplay/cocoaPandaView.h +++ b/panda/src/cocoadisplay/cocoaPandaView.h @@ -12,7 +12,10 @@ // //////////////////////////////////////////////////////////////////// +#include "graphicsWindow.h" + #import +#import class CocoaGraphicsWindow; diff --git a/panda/src/cocoadisplay/cocoaPandaView.mm b/panda/src/cocoadisplay/cocoaPandaView.mm index 05c73213e5..bb7d03c832 100644 --- a/panda/src/cocoadisplay/cocoaPandaView.mm +++ b/panda/src/cocoadisplay/cocoaPandaView.mm @@ -12,6 +12,7 @@ // //////////////////////////////////////////////////////////////////// +#include "config_cocoadisplay.h" #import "cocoaPandaView.h" #import "cocoaGraphicsWindow.h" diff --git a/panda/src/cocoadisplay/cocoaPandaWindowDelegate.h b/panda/src/cocoadisplay/cocoaPandaWindowDelegate.h index 78c8c2eabe..fd7333bed0 100644 --- a/panda/src/cocoadisplay/cocoaPandaWindowDelegate.h +++ b/panda/src/cocoadisplay/cocoaPandaWindowDelegate.h @@ -14,6 +14,8 @@ #import +#import "cocoaGraphicsWindow.h" + class CocoaGraphicsWindow; #if __MAC_OS_X_VERSION_MAX_ALLOWED >= 1060 From df6f76f4944c9bb64de6d212c1fca69bbe843ef1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 00:48:50 -0600 Subject: [PATCH 245/744] CMake: Add new _ext.* files to interrogate. --- panda/src/display/CMakeLists.txt | 7 ++++++- panda/src/egg/CMakeLists.txt | 9 +++++++-- panda/src/express/CMakeLists.txt | 14 +++++++++++--- panda/src/pgraph/CMakeLists.txt | 11 ++++++++++- panda/src/pnmimage/CMakeLists.txt | 7 ++++++- panda/src/putil/CMakeLists.txt | 6 +++++- 6 files changed, 45 insertions(+), 9 deletions(-) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 106fab5646..38258dce86 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -67,6 +67,11 @@ set(P3DISPLAY_SOURCES touchInfo.cxx ) +set(P3DISPLAY_IGATEEXT + graphicsStateGuardian_ext.cxx + graphicsStateGuardian_ext.h +) + if(HAVE_PYTHON) set(P3DISPLAY_HEADERS ${P3DISPLAY_HEADERS} @@ -87,7 +92,7 @@ if(OSX_PLATFORM) endif() composite_sources(p3display P3DISPLAY_SOURCES) -add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) +add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES} ${P3DISPLAY_IGATEEXT}) target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 99103a9e54..66c67b1ae5 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -88,15 +88,20 @@ if(HAVE_EGG) vector_PT_EggVertex.cxx ) + set(P3EGG_IGATEEXT + eggGroupNode_ext.cxx + eggGroupNode_ext.h + ) + # These cannot be interrogated, and are excluded from the composites. set(P3EGG_PARSER_SOURCES parser.cxx lexer.cxx) composite_sources(p3egg P3EGG_SOURCES) - add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) + add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_IGATEEXT} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) - target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES}) + target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} eggGroupNode_ext.h) install(TARGETS p3egg DESTINATION lib) endif() diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index ff7b47fe65..63aa31baa4 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -59,7 +59,6 @@ set(P3EXPRESS_HEADERS virtualFileMountSystem.h virtualFileMountSystem.I virtualFileSimple.h virtualFileSimple.I virtualFileSystem.h virtualFileSystem.I - virtualFileSystem_ext.h weakPointerCallback.I weakPointerCallback.h weakPointerTo.I weakPointerTo.h weakPointerToBase.I weakPointerToBase.h @@ -114,7 +113,6 @@ set(P3EXPRESS_SOURCES virtualFileMountRamdisk.cxx virtualFileMountSystem.cxx virtualFileSimple.cxx virtualFileSystem.cxx - virtualFileSystem_ext.cxx weakPointerCallback.cxx weakPointerTo.cxx weakPointerToBase.cxx @@ -123,9 +121,19 @@ set(P3EXPRESS_SOURCES windowsRegistry.cxx zStream.cxx zStreamBuf.cxx) +set(P3EXPRESS_IGATEEXT + memoryUsagePointers_ext.cxx + memoryUsagePointers_ext.h + ramfile_ext.cxx + ramfile_ext.h + streamReader_ext.cxx + streamReader_ext.h + virtualFileSystem_ext.cxx + virtualFileSystem_ext.h) + composite_sources(p3express P3EXPRESS_SOURCES) -add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) +add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS} ${P3EXPRESS_IGATEEXT}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY}) target_interrogate(p3express ALL) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index c75b90c966..2c66887118 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -196,8 +196,17 @@ set(P3PGRAPH_SOURCES workingNodePath.cxx ) +set(P3PGRAPH_IGATEEXT + nodePathCollection_ext.cxx + nodePathCollection_ext.h + nodePathCollection_ext.I + nodePath_ext.cxx + nodePath_ext.h + nodePath_ext.I +) + composite_sources(p3pgraph P3PGRAPH_SOURCES) -add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) +add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES} ${P3PGRAPH_IGATEEXT}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 52f6246a2d..211172bdd7 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -24,8 +24,13 @@ set(P3PNMIMAGE_SOURCES ppmcmap.cxx ) +set(P3PNMIMAGE_IGATEEXT + pfmFile_ext.cxx + pfmFile_ext.h +) + composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) -add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) +add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} ${P3PNMIMAGE_IGATEEXT}) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 116522b457..0a9cc12849 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -111,9 +111,13 @@ set(P3PUTIL_SOURCES writableConfigurable.cxx writableParam.cxx ) +set(P3PUTIL_IGATEEXT + typedWritable_ext.cxx + typedWritable_ext.h +) composite_sources(p3putil P3PUTIL_SOURCES) -add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) +add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES} ${P3PUTIL_IGATEEXT}) target_link_libraries(p3putil p3pipeline) target_interrogate(p3putil ALL) From cc6720e6c4ef50261b023044c7373204ab67d1d3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 00:49:45 -0600 Subject: [PATCH 246/744] CMake: Fix trailing-newline issue with autodetected Python install paths. --- dtool/Config.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a5595f22fc..e65cc9602e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -442,11 +442,13 @@ if(HAVE_PYTHON) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(False)" - OUTPUT_VARIABLE _LIB_DIR) + OUTPUT_VARIABLE _LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)" - OUTPUT_VARIABLE _ARCH_DIR) + OUTPUT_VARIABLE _ARCH_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) set(PYTHON_LIB_INSTALL_DIR "${_LIB_DIR}" CACHE STRING "Path to the Python architecture-independent package directory.") From 4937dfe1b85be7f77882afd88fd1a6d5a8677593 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 02:16:39 -0600 Subject: [PATCH 247/744] CMake: Add _ext.* to ODE. --- panda/src/ode/CMakeLists.txt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 9e17af5b24..5405857def 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -61,16 +61,30 @@ if(HAVE_ODE) odeTriMeshData.cxx odeTriMeshGeom.cxx odeCollisionEntry.cxx) + set(P3ODE_IGATEEXT + odeBody_ext.h + odeBody_ext.I + odeGeom_ext.cxx + odeGeom_ext.h + odeGeom_ext.I + odeJoint_ext.cxx + odeJoint_ext.h + odeSpace_ext.cxx + odeSpace_ext.h + odeSpace_ext.I + odeUtil_ext.cxx + odeUtil_ext.h) + set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h") list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHeightFieldGeom.h") list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") composite_sources(p3ode P3ODE_SOURCES) - add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) + add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS} ${P3ODE_IGATEEXT}) set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) - target_interrogate(p3ode ${P3ODE_IGATE_SOURCES}) + target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} ${P3ODE_IGATEEXT}) install(TARGETS p3ode DESTINATION lib) endif() From 98bfa250f367d193bfbc31c482212d88ed2f61a3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 02:16:50 -0600 Subject: [PATCH 248/744] ODE: Fix missing include. --- panda/src/ode/odeJointCollection.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/ode/odeJointCollection.h b/panda/src/ode/odeJointCollection.h index 38bab187fd..3c39163384 100755 --- a/panda/src/ode/odeJointCollection.h +++ b/panda/src/ode/odeJointCollection.h @@ -15,7 +15,7 @@ #ifndef ODEJOINTCOLLECTION_H #define ODEJOINTCOLLECTION_H -class OdeJoint; +#include "odeJoint.h" //////////////////////////////////////////////////////////////////// // Class : OdeJointCollection From 5314183bba3785c21d33fb0fe0f135887367985c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 04:17:16 -0600 Subject: [PATCH 249/744] CMake: Don't compile Interrogate extensions into the component libraries. --- panda/src/display/CMakeLists.txt | 4 ++-- panda/src/egg/CMakeLists.txt | 4 ++-- panda/src/express/CMakeLists.txt | 4 ++-- panda/src/ode/CMakeLists.txt | 2 +- panda/src/pgraph/CMakeLists.txt | 4 ++-- panda/src/pnmimage/CMakeLists.txt | 4 ++-- panda/src/putil/CMakeLists.txt | 4 ++-- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 2f0004a5ce..2b37249258 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -97,9 +97,9 @@ if(APPLE) endif() composite_sources(p3display P3DISPLAY_SOURCES) -add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES} ${P3DISPLAY_IGATEEXT}) +add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) -target_interrogate(p3display ALL) +target_interrogate(p3display ALL ${P3DISPLAY_IGATEEXT}) install(TARGETS p3display DESTINATION lib) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 66c67b1ae5..dec290f287 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -99,9 +99,9 @@ if(HAVE_EGG) lexer.cxx) composite_sources(p3egg P3EGG_SOURCES) - add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_IGATEEXT} ${P3EGG_PARSER_SOURCES}) + add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) - target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} eggGroupNode_ext.h) + target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_IGATEEXT}) install(TARGETS p3egg DESTINATION lib) endif() diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index dc6ec21b51..855126cd45 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -133,10 +133,10 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) -add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS} ${P3EXPRESS_IGATEEXT}) +add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) -target_interrogate(p3express ALL) +target_interrogate(p3express ALL ${P3EXPRESS_IGATEEXT}) if(WIN32) target_link_libraries(p3express advapi32.lib ws2_32.lib) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 5405857def..da02eac238 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -81,7 +81,7 @@ if(HAVE_ODE) list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") composite_sources(p3ode P3ODE_SOURCES) - add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS} ${P3ODE_IGATEEXT}) + add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} ${P3ODE_IGATEEXT}) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 2c66887118..8eca8b5c7b 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -206,9 +206,9 @@ set(P3PGRAPH_IGATEEXT ) composite_sources(p3pgraph P3PGRAPH_SOURCES) -add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES} ${P3PGRAPH_IGATEEXT}) +add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) -target_interrogate(p3pgraph ALL) +target_interrogate(p3pgraph ALL ${P3PGRAPH_IGATEEXT}) install(TARGETS p3pgraph DESTINATION lib) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 211172bdd7..bf88128a0c 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -30,8 +30,8 @@ set(P3PNMIMAGE_IGATEEXT ) composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) -add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} ${P3PNMIMAGE_IGATEEXT}) +add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) -target_interrogate(p3pnmimage ALL) +target_interrogate(p3pnmimage ALL ${P3PNMIMAGE_IGATEEXT}) install(TARGETS p3pnmimage DESTINATION lib) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 0a9cc12849..d38094029e 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -117,9 +117,9 @@ set(P3PUTIL_IGATEEXT ) composite_sources(p3putil P3PUTIL_SOURCES) -add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES} ${P3PUTIL_IGATEEXT}) +add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) target_link_libraries(p3putil p3pipeline) -target_interrogate(p3putil ALL) +target_interrogate(p3putil ALL ${P3PUTIL_IGATEEXT}) install(TARGETS p3putil DESTINATION lib) From 31d420515af885e2cd44059c4fcd4e56ff8c3439 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 04:47:18 -0600 Subject: [PATCH 250/744] egg: Add CPPPARSER ifndef to eggGroupNode_ext.cxx to fix parse error. --- panda/src/egg/eggGroupNode_ext.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/egg/eggGroupNode_ext.cxx b/panda/src/egg/eggGroupNode_ext.cxx index 457ea73ba3..e554bb243c 100644 --- a/panda/src/egg/eggGroupNode_ext.cxx +++ b/panda/src/egg/eggGroupNode_ext.cxx @@ -16,7 +16,9 @@ #ifdef HAVE_PYTHON +#ifndef CPPPARSER IMPORT_THIS struct Dtool_PyTypedObject Dtool_EggNode; +#endif //////////////////////////////////////////////////////////////////// // Function: EggGroupNode::get_children From b30084858935f6a1e90149e5da673998a700058c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 04:49:52 -0600 Subject: [PATCH 251/744] CMake: Add new "EXTENSIONS" syntax to target_interrogate(...) macro. --- cmake/macros/Interrogate.cmake | 52 +++++++++++++------------------ panda/src/display/CMakeLists.txt | 2 +- panda/src/egg/CMakeLists.txt | 2 +- panda/src/express/CMakeLists.txt | 2 +- panda/src/ode/CMakeLists.txt | 2 +- panda/src/pgraph/CMakeLists.txt | 2 +- panda/src/pnmimage/CMakeLists.txt | 2 +- panda/src/putil/CMakeLists.txt | 2 +- 8 files changed, 29 insertions(+), 37 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 0025cc9161..b88d6272d8 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -50,10 +50,16 @@ set(ALL_INTERROGATE_MODULES CACHE INTERNAL "Internal variable") function(target_interrogate target) if(HAVE_PYTHON AND HAVE_INTERROGATE) set(sources) + set(extensions) set(want_all OFF) + set(extensions_keyword OFF) foreach(arg ${ARGN}) if(arg STREQUAL "ALL") set(want_all ON) + elseif(arg STREQUAL "EXTENSIONS") + set(extensions_keyword ON) + elseif(extensions_keyword) + list(APPEND extensions "${arg}") else() list(APPEND sources "${arg}") endif() @@ -70,13 +76,20 @@ function(target_interrogate target) # Now let's get everything's absolute path, so that it can be passed # through a property while still preserving the reference. set(absolute_sources) + set(absolute_extensions) foreach(source ${sources}) get_source_file_property(location "${source}" LOCATION) - set(absolute_sources ${absolute_sources} ${location}) + list(APPEND absolute_sources ${location}) endforeach(source) + foreach(extension ${extensions}) + get_source_file_property(location "${extension}" LOCATION) + list(APPEND absolute_extensions ${location}) + endforeach(extension) set_target_properties("${target}" PROPERTIES IGATE_SOURCES "${absolute_sources}") + set_target_properties("${target}" PROPERTIES IGATE_EXTENSIONS + "${absolute_extensions}") # CMake has no property for determining the source directory where the # target was originally added. interrogate_sources makes use of this @@ -86,9 +99,6 @@ function(target_interrogate target) # an IGATE_ prefix. set_target_properties("${target}" PROPERTIES TARGET_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") - - # HACK HACK HACK -- this is part of the below hack. - target_link_libraries(${target} ${target}_igate) endif() endfunction(target_interrogate) @@ -106,6 +116,7 @@ endfunction(target_interrogate) function(interrogate_sources target output database module) if(HAVE_PYTHON AND HAVE_INTERROGATE) get_target_property(sources "${target}" IGATE_SOURCES) + get_target_property(extensions "${target}" IGATE_EXTENSIONS) if(NOT sources) message(FATAL_ERROR @@ -189,14 +200,6 @@ function(interrogate_sources target output database module) list(APPEND define_flags "-DNDEBUG") endif() - # CMake offers no way to directly depend on the composite files from here, - # because the composite files are created in a different directory from - # where CMake itself is run. Therefore, we need to depend on the - # TARGET_composite target, if it exists. - if(TARGET ${target}_composite) - set(sources ${target}_composite ${sources}) - endif() - add_custom_command( OUTPUT "${output}" "${database}" COMMAND interrogate @@ -212,7 +215,8 @@ function(interrogate_sources target output database module) -S "${PROJECT_BINARY_DIR}/include/parser-inc" ${include_flags} ${scan_sources} - DEPENDS interrogate ${sources} ${nfiles} + ${extensions} + DEPENDS interrogate ${sources} ${extensions} ${nfiles} COMMENT "Interrogating ${target}" ) endif() @@ -230,7 +234,6 @@ function(add_python_module module) set(link_targets) set(infiles) set(sources) - set(HACKlinklibs) set(link_keyword OFF) foreach(arg ${ARGN}) @@ -249,22 +252,12 @@ function(add_python_module module) foreach(target ${targets}) interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" "${module}") + get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) list(APPEND infiles "${target}.in") - #list(APPEND sources "${target}_igate.cxx") + list(APPEND sources "${target}_igate.cxx" ${target_extensions}) - # HACK HACK HACK: - # Currently, the codebase has dependencies on the Interrogate-generated - # code when HAVE_PYTHON is enabled. rdb is working to remove this, but - # until then, the generated code must somehow be made available to the - # modules themselves. The workaround here is to put the _igate.cxx into - # its own micro-library, which is linked both here on the module and - # against the component library in question. - add_library(${target}_igate ${target}_igate.cxx) - list(APPEND HACKlinklibs "${target}_igate") - install(TARGETS ${target}_igate DESTINATION lib) - - get_target_property(target_links "${target}" LINK_LIBRARIES) - target_link_libraries(${target}_igate ${target_links}) + #get_target_property(target_links "${target}" LINK_LIBRARIES) + #target_link_libraries(${target}_igate ${target_links}) endforeach(target) add_custom_command( @@ -278,10 +271,9 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - add_library(${module} MODULE "${module}_module.cxx" ${sources}) + add_library(${module} "${module}_module.cxx" ${sources}) target_link_libraries(${module} ${link_targets} ${PYTHON_LIBRARIES} p3interrogatedb) - target_link_libraries(${module} ${HACKlinklibs}) set_target_properties(${module} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 2b37249258..e2b71d3eee 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -99,7 +99,7 @@ endif() composite_sources(p3display P3DISPLAY_SOURCES) add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) -target_interrogate(p3display ALL ${P3DISPLAY_IGATEEXT}) +target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) install(TARGETS p3display DESTINATION lib) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index dec290f287..caa59abeef 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -101,7 +101,7 @@ if(HAVE_EGG) composite_sources(p3egg P3EGG_SOURCES) add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) - target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_IGATEEXT}) + target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) install(TARGETS p3egg DESTINATION lib) endif() diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 855126cd45..1b0fd5673f 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -136,7 +136,7 @@ composite_sources(p3express P3EXPRESS_SOURCES) add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) -target_interrogate(p3express ALL ${P3EXPRESS_IGATEEXT}) +target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(WIN32) target_link_libraries(p3express advapi32.lib ws2_32.lib) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index da02eac238..25795f4fc0 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -84,7 +84,7 @@ if(HAVE_ODE) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) - target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} ${P3ODE_IGATEEXT}) + target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) install(TARGETS p3ode DESTINATION lib) endif() diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 8eca8b5c7b..bdc6c4d201 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -208,7 +208,7 @@ set(P3PGRAPH_IGATEEXT composite_sources(p3pgraph P3PGRAPH_SOURCES) add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) -target_interrogate(p3pgraph ALL ${P3PGRAPH_IGATEEXT}) +target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) install(TARGETS p3pgraph DESTINATION lib) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index bf88128a0c..d6fe2c0d4e 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -32,6 +32,6 @@ set(P3PNMIMAGE_IGATEEXT composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) -target_interrogate(p3pnmimage ALL ${P3PNMIMAGE_IGATEEXT}) +target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) install(TARGETS p3pnmimage DESTINATION lib) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index d38094029e..05a4fea19d 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -119,7 +119,7 @@ set(P3PUTIL_IGATEEXT composite_sources(p3putil P3PUTIL_SOURCES) add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) target_link_libraries(p3putil p3pipeline) -target_interrogate(p3putil ALL ${P3PUTIL_IGATEEXT}) +target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) install(TARGETS p3putil DESTINATION lib) From 1421627dd93d9a41d86496e9fa21690b101a4322 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 04:50:14 -0600 Subject: [PATCH 252/744] CMake: Deprecate the FOO_composite pseudotarget -- the hack that needed it is no longer around. --- cmake/macros/CompositeSources.cmake | 6 ------ 1 file changed, 6 deletions(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 631de638f9..241a2a3d64 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -93,12 +93,6 @@ function(composite_sources target sources_var) endif() endwhile() - # This exists for Interrogate's benefit, which needs the composite files to - # exist before it can run. Unfortunately, CMake does not expose the - # add_custom_command outputs as targets outside of the directory, so we have - # to create our own pseudotarget that gets exposed. - add_custom_target(${target}_composite DEPENDS ${composite_files}) - #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) # The new files are added to the existing files, which means the old files From 841f3b8a49d99e778c34c326dfd4732883166bd4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Mar 2014 04:51:38 -0600 Subject: [PATCH 253/744] CMake: Link Interrogate modules against 'core'. --- direct/CMakeLists.txt | 1 + panda/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 6fc755a522..b293728ee1 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -18,6 +18,7 @@ add_subdirectory(src/interval) add_subdirectory(src/showbase) add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) +target_link_libraries(direct core) # Installation: if(HAVE_PYTHON) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 84184d1295..1283fa1b80 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -97,10 +97,13 @@ add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) if(HAVE_EGG) add_python_module(egg p3egg p3egg2pg) + target_link_libraries(egg core) endif() add_python_module(physics p3physics p3particlesystem) +target_link_libraries(physics core) if(HAVE_ODE) add_python_module(ode p3ode) + target_link_libraries(ode core) endif() From 5ce217390343b10a2ffa025346ad8941c4049034 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 31 Mar 2014 20:31:08 -0600 Subject: [PATCH 254/744] CMake: Fix typo. --- dtool/src/interrogate/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index ce48803a04..9d9ccf094c 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -57,4 +57,4 @@ add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase p3pystub ${_OPENSSL_LIBRARIES}) -install(TARGETS interrogate DESTINATION bin) +install(TARGETS interrogate_module DESTINATION bin) From 21ecc1fc0486ad0acfb725fca0220313701db2bc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 3 Apr 2014 15:10:31 -0600 Subject: [PATCH 255/744] CMake: Default HAVE_AUDIO on. --- dtool/Config.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 6ee2e344a9..8554a186a1 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -788,6 +788,9 @@ option(HAVE_EGG avoid building this, unless you really want to make a low-footprint build (such as, for instance, for the iPhone)." ON) +option(HAVE_AUDIO + "Do you want to build the audio interface?" ON) + # These image formats don't require the assistance of a third-party # library to read and write, so there's normally no reason to disable # them int he build, unless you are looking to reduce the memory footprint. From c53a656b4b6833174762c56c8597c0f3cf9142bf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Apr 2014 03:37:46 -0600 Subject: [PATCH 256/744] cmake: Fix typo in PackageConfig. --- cmake/macros/PackageConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index dc88e2ac13..31a64d92e4 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -128,7 +128,7 @@ macro(target_use_packages target) foreach(lib ${libs}) if(HAVE_${lib}) target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") - if(${lib}_LIBRARIES) + if(_${lib}_LIBRARIES) target_link_libraries("${target}" ${_${lib}_LIBRARIES}) else() target_link_libraries("${target}" ${_${lib}_LIBRARY}) From 127dfe7c4d528d6a98a2550de526ecd3161eb013 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Apr 2014 03:38:08 -0600 Subject: [PATCH 257/744] cmake: Add FFMPEG compilation support. --- cmake/modules/FindFFMPEG.cmake | 93 ++++++++++++++++++++++++++++++ cmake/modules/FindSWResample.cmake | 52 +++++++++++++++++ cmake/modules/FindSWScale.cmake | 52 +++++++++++++++++ dtool/Config.cmake | 12 ++++ panda/CMakeLists.txt | 1 + panda/src/ffmpeg/CMakeLists.txt | 26 +++++++++ 6 files changed, 236 insertions(+) create mode 100644 cmake/modules/FindFFMPEG.cmake create mode 100644 cmake/modules/FindSWResample.cmake create mode 100644 cmake/modules/FindSWScale.cmake create mode 100644 panda/src/ffmpeg/CMakeLists.txt diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake new file mode 100644 index 0000000000..ee4c8bdc1c --- /dev/null +++ b/cmake/modules/FindFFMPEG.cmake @@ -0,0 +1,93 @@ +# Filename: FindFFMPEG.cmake +# Author: CFSworks (10 Apr, 2014) +# +# Usage: +# find_package(FFMPEG [REQUIRED] [QUIET]) +# +# Once done this will define: +# FFMPEG_FOUND - system has ffmpeg +# FFMPEG_INCLUDE_DIR - the ffmpeg include directory +# FFMPEG_LIBRARIES - the path to the library binary +# +# FFMPEG_LIBAVCODEC - the path to the libavcodec library binary +# FFMPEG_LIBAVFORMAT - the path to the libavformat library binary +# FFMPEG_LIBAVUTIL - the path to the libavutil library binary +# + +if(NOT FFMPEG_INCLUDE_DIR OR NOT FFMPEG_LIBRARY_DIR) + # Find the libffmpeg include files + find_path(FFMPEG_INCLUDE_DIR + NAMES "libavcodec/avcodec.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "libav" "ffmpeg" + ) + + # Find the libavcodec library + find_library(FFMPEG_LIBAVCODEC + NAMES "avcodec" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + # Find the libavformat library + find_library(FFMPEG_LIBAVFORMAT + NAMES "avformat" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + # Find the libavutil library + find_library(FFMPEG_LIBAVUTIL + NAMES "avutil" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + mark_as_advanced(FFMPEG_INCLUDE_DIR) + mark_as_advanced(FFMPEG_LIBAVCODEC) + mark_as_advanced(FFMPEG_LIBAVFORMAT) + mark_as_advanced(FFMPEG_LIBAVUTIL) +endif() + +# Translate library into library directory +if(FFMPEG_LIBAVCODEC) + unset(FFMPEG_LIBRARY_DIR CACHE) + get_filename_component(FFMPEG_LIBRARY_DIR "${FFMPEG_LIBAVCODEC}" PATH) + set(FFMPEG_LIBRARY_DIR "${FFMPEG_LIBRARY_DIR}" CACHE PATH "The path to libffmpeg's library directory.") # Library path +endif() + +set(FFMPEG_LIBRARIES) +if(FFMPEG_LIBAVCODEC) + list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVCODEC}") +endif() +if(FFMPEG_LIBAVFORMAT) + list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVFORMAT}") +endif() +if(FFMPEG_LIBAVUTIL) + list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVUTIL}") +endif() + +mark_as_advanced(FFMPEG_LIBRARY_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FFMPEG DEFAULT_MSG FFMPEG_LIBRARIES FFMPEG_LIBAVCODEC FFMPEG_LIBAVFORMAT FFMPEG_LIBAVUTIL FFMPEG_INCLUDE_DIR FFMPEG_LIBRARY_DIR) diff --git a/cmake/modules/FindSWResample.cmake b/cmake/modules/FindSWResample.cmake new file mode 100644 index 0000000000..827758835e --- /dev/null +++ b/cmake/modules/FindSWResample.cmake @@ -0,0 +1,52 @@ +# Filename: FindSWResample.cmake +# Author: CFSworks (10 Apr, 2014) +# +# Usage: +# find_package(SWResample [REQUIRED] [QUIET]) +# +# Once done this will define: +# SWRESAMPLE_FOUND - system has ffmpeg's libswresample +# SWRESAMPLE_INCLUDE_DIR - the libswresample include directory +# SWRESAMPLE_LIBRARY - the path to the library binary +# + +if(NOT SWRESAMPLE_INCLUDE_DIR OR NOT SWRESAMPLE_LIBRARY) + # Find the libswresample include files + find_path(SWRESAMPLE_INCLUDE_DIR + NAMES "libswresample/swresample.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "libav" "ffmpeg" + ) + + # Find the libswresample library + find_library(SWRESAMPLE_LIBRARY + NAMES "swresample" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + mark_as_advanced(SWRESAMPLE_INCLUDE_DIR) + mark_as_advanced(SWRESAMPLE_LIBRARY) +endif() + +# Translate library into library directory +if(SWRESAMPLE_LIBRARY) + unset(SWRESAMPLE_LIBRARY_DIR CACHE) + get_filename_component(SWRESAMPLE_LIBRARY_DIR "${SWRESAMPLE_LIBRARY}" PATH) + set(SWRESAMPLE_LIBRARY_DIR "${SWRESAMPLE_LIBRARY_DIR}" CACHE PATH "The path to libffmpeg's library directory.") # Library path +endif() + +mark_as_advanced(SWRESAMPLE_LIBRARY_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SWResample DEFAULT_MSG SWRESAMPLE_LIBRARY SWRESAMPLE_INCLUDE_DIR SWRESAMPLE_LIBRARY_DIR) diff --git a/cmake/modules/FindSWScale.cmake b/cmake/modules/FindSWScale.cmake new file mode 100644 index 0000000000..2fca4c441d --- /dev/null +++ b/cmake/modules/FindSWScale.cmake @@ -0,0 +1,52 @@ +# Filename: FindSWScale.cmake +# Author: CFSworks (10 Apr, 2014) +# +# Usage: +# find_package(SWScale [REQUIRED] [QUIET]) +# +# Once done this will define: +# SWSCALE_FOUND - system has ffmpeg's libswscale +# SWSCALE_INCLUDE_DIR - the libswscale include directory +# SWSCALE_LIBRARY - the path to the library binary +# + +if(NOT SWSCALE_INCLUDE_DIR OR NOT SWSCALE_LIBRARY) + # Find the libswscale include files + find_path(SWSCALE_INCLUDE_DIR + NAMES "libswscale/swscale.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "libav" "ffmpeg" + ) + + # Find the libswscale library + find_library(SWSCALE_LIBRARY + NAMES "swscale" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + mark_as_advanced(SWSCALE_INCLUDE_DIR) + mark_as_advanced(SWSCALE_LIBRARY) +endif() + +# Translate library into library directory +if(SWSCALE_LIBRARY) + unset(SWSCALE_LIBRARY_DIR CACHE) + get_filename_component(SWSCALE_LIBRARY_DIR "${SWSCALE_LIBRARY}" PATH) + set(SWSCALE_LIBRARY_DIR "${SWSCALE_LIBRARY_DIR}" CACHE PATH "The path to libffmpeg's library directory.") # Library path +endif() + +mark_as_advanced(SWSCALE_LIBRARY_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(SWSCALE DEFAULT_MSG SWSCALE_LIBRARY SWSCALE_INCLUDE_DIR SWSCALE_LIBRARY_DIR) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 8554a186a1..98bc05dbce 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -591,6 +591,18 @@ find_package(ZLIB) package_option(ZLIB DEFAULT ON "Enables support for compression of Panda assets.") +# Is FFMPEG installed, and where? +find_package(FFMPEG) +find_package(SWScale) +find_package(SWResample) + +package_option(FFMPEG DEFAULT ON + "Enables support for audio- and video-decoding using the FFMPEG library.") +package_option(SWSCALE DEFAULT ON + "Enables support for FFMPEG's libswscale for video rescaling.") +package_option(SWRESAMPLE DEFAULT ON + "Enables support for FFMPEG's libresample for audio resampling.") + # Is ODE installed, and where? find_package(ODE) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 84184d1295..6ce34f47c5 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -45,6 +45,7 @@ add_subdirectory(src/wgldisplay) add_subdirectory(src/osxdisplay) add_subdirectory(src/cocoadisplay) add_subdirectory(src/movies) +add_subdirectory(src/ffmpeg) add_subdirectory(src/audio) add_subdirectory(src/audiotraits) add_subdirectory(src/chan) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt new file mode 100644 index 0000000000..932e080782 --- /dev/null +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -0,0 +1,26 @@ +if(HAVE_FFMPEG) + + set(P3FFMPEG_HEADERS + config_ffmpeg.h + ffmpegVideo.h ffmpegVideo.I + ffmpegVideoCursor.h ffmpegVideoCursor.I + ffmpegAudio.h ffmpegAudio.I + ffmpegAudioCursor.h ffmpegAudioCursor.I + ffmpegVirtualFile.h ffmpegVirtualFile.I) + + + set(P3FFMPEG_SOURCES + config_ffmpeg.cxx + ffmpegVideo.cxx + ffmpegVideoCursor.cxx + ffmpegAudio.cxx + ffmpegAudioCursor.cxx + ffmpegVirtualFile.cxx) + + composite_sources(p3ffmpeg P3FFMPEG_SOURCES) + add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) + target_link_libraries(p3ffmpeg p3movies) + target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) + + install(TARGETS p3ffmpeg DESTINATION lib) +endif() From 1f02b2da01967384f5fb9c3aa22fddb0286f0174 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 Apr 2014 06:06:24 -0600 Subject: [PATCH 258/744] cmake: Always be consistent with putting headers before sources. --- direct/src/dcparser/CMakeLists.txt | 4 ++-- direct/src/directbase/CMakeLists.txt | 2 +- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/collide/CMakeLists.txt | 2 +- panda/src/device/CMakeLists.txt | 2 +- panda/src/dgraph/CMakeLists.txt | 2 +- panda/src/downloader/CMakeLists.txt | 2 +- panda/src/express/CMakeLists.txt | 2 +- panda/src/grutil/CMakeLists.txt | 2 +- panda/src/ode/CMakeLists.txt | 2 +- panda/src/osxdisplay/CMakeLists.txt | 2 +- panda/src/parametrics/CMakeLists.txt | 2 +- panda/src/pgui/CMakeLists.txt | 2 +- panda/src/pnmtext/CMakeLists.txt | 2 +- panda/src/recorder/CMakeLists.txt | 2 +- panda/src/text/CMakeLists.txt | 2 +- panda/src/tform/CMakeLists.txt | 2 +- 17 files changed, 18 insertions(+), 18 deletions(-) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 36ef2541e0..cfb105bfcf 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -46,10 +46,10 @@ set(P3DCPARSER_PARSER_SOURCES dcLexer.cxx) composite_sources(p3dcparser P3DCPARSER_SOURCES) -add_library(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS} +add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) -target_interrogate(p3dcparser ${P3DCPARSER_SOURCES} ${P3DCPARSER_HEADERS}) +target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) install(TARGETS p3dcparser DESTINATION lib) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 3e1d332ab5..d8722cb41d 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3DIRECTBASE_HEADERS ) # Not worth compositing sources, there's really only one. -add_library(p3directbase ${P3DIRECTBASE_SOURCES} ${P3DIRECTBASE_HEADERS}) +add_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) target_link_libraries(p3directbase p3pandabase) install(TARGETS p3directbase DESTINATION lib) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index d8fb78d894..82c5539d72 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -16,7 +16,7 @@ if(APPLE AND HAVE_GL AND HAVE_COCOA) cocoaPandaWindowDelegate.mm) #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) - add_library(p3cocoadisplay ${P3COCOADISPLAY_SOURCES} ${P3COCOADISPLAY_HEADERS}) + add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) # Frameworks: diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index dd3994ff9b..5ba2b5cae7 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -63,7 +63,7 @@ set(P3COLLIDE_SOURCES ) composite_sources(p3collide P3COLLIDE_SOURCES) -add_library(p3collide ${P3COLLIDE_SOURCES} ${P3COLLIDE_HEADERS}) +add_library(p3collide ${P3COLLIDE_HEADERS} ${P3COLLIDE_SOURCES}) target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 16dc4b9164..91e7dfbee1 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -27,7 +27,7 @@ set(P3DEVICE_SOURCES ) composite_sources(p3device P3DEVICE_SOURCES) -add_library(p3device ${P3DEVICE_SOURCES} ${P3DEVICE_HEADERS}) +add_library(p3device ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index c085c0e8e1..592d34acff 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -12,7 +12,7 @@ set(P3DGRAPH_SOURCES ) composite_sources(p3dgraph P3DGRAPH_SOURCES) -add_library(p3dgraph ${P3DGRAPH_SOURCES} ${P3DGRAPH_HEADERS}) +add_library(p3dgraph ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index cc4c747f92..5095ee9323 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -63,7 +63,7 @@ set(P3DOWNLOADER_SOURCES ) composite_sources(p3downloader P3DOWNLOADER_SOURCES) -add_library(p3downloader ${P3DOWNLOADER_SOURCES} ${P3DOWNLOADER_HEADERS}) +add_library(p3downloader ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index dc6ec21b51..db3b0a3696 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -133,7 +133,7 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) -add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS} ${P3EXPRESS_IGATEEXT}) +add_library(p3express ${P3EXPRESS_HEADERS} ${P3EXPRESS_SOURCES} ${P3EXPRESS_IGATEEXT}) target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) target_interrogate(p3express ALL) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index cb9bfa75d8..d65d9cc349 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -36,7 +36,7 @@ set(P3GRUTIL_SOURCES ) composite_sources(p3grutil P3GRUTIL_SOURCES) -add_library(p3grutil ${P3GRUTIL_SOURCES} ${P3GRUTIL_HEADERS}) +add_library(p3grutil ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) target_link_libraries(p3grutil p3display p3text p3movies) if(HAVE_AUDIO) target_link_libraries(p3grutil p3audio) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 5405857def..da1c5df4e7 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -81,7 +81,7 @@ if(HAVE_ODE) list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") composite_sources(p3ode P3ODE_SOURCES) - add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS} ${P3ODE_IGATEEXT}) + add_library(p3ode ${P3ODE_HEADERS} ${P3ODE_SOURCES} ${P3ODE_IGATEEXT}) set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} ${P3ODE_IGATEEXT}) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index 2a16f6c3ce..8727804cdd 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -10,7 +10,7 @@ if(APPLE AND HAVE_GL AND HAVE_CARBON) osxGraphicsBuffer.cxx) composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) - add_library(p3osxdisplay ${P3OSXDISPLAY_SOURCES} ${P3OSXDISPLAY_HEADERS}) + add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) # Frameworks: diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 1a61873e96..ed92d61f8c 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -34,7 +34,7 @@ set(P3PARAMETRICS_SOURCES ) composite_sources(p3parametrics P3PARAMETRICS_SOURCES) -add_library(p3parametrics ${P3PARAMETRICS_SOURCES} ${P3PARAMETRICS_HEADERS}) +add_library(p3parametrics ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 15bbfdb736..19b83ad110 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -40,7 +40,7 @@ set(P3PGUI_SOURCES ) composite_sources(p3pgui P3PGUI_SOURCES) -add_library(p3pgui ${P3PGUI_SOURCES} ${P3PGUI_HEADERS}) +add_library(p3pgui ${P3PGUI_HEADERS} ${P3PGUI_SOURCES}) target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 1ad94e17ee..86764755d2 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -15,7 +15,7 @@ if(HAVE_FREETYPE) ) composite_sources(p3pnmtext P3PNMTEXT_SOURCES) - add_library(p3pnmtext ${P3PNMTEXT_SOURCES} ${P3PNMTEXT_HEADERS}) + add_library(p3pnmtext ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) target_interrogate(p3pnmtext ALL) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 8590e3ab83..b7b982136b 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -17,7 +17,7 @@ set(P3RECORDER_SOURCES ) composite_sources(p3recorder P3RECORDER_SOURCES) -add_library(p3recorder ${P3RECORDER_SOURCES} ${P3RECORDER_HEADERS}) +add_library(p3recorder ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 82b9030695..4feb48af74 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -33,7 +33,7 @@ set(P3TEXT_SOURCES ) composite_sources(p3text P3TEXT_SOURCES) -add_library(p3text ${P3TEXT_SOURCES} ${P3TEXT_HEADERS}) +add_library(p3text ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) target_link_libraries(p3text p3parametrics) if(HAVE_FREETYPE) target_link_libraries(p3text p3pnmtext ${_FREETYPE_LIBRARIES}) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index abc730148b..a814cb415c 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -25,7 +25,7 @@ set(P3TFORM_SOURCES ) composite_sources(p3tform P3TFORM_SOURCES) -add_library(p3tform ${P3TFORM_SOURCES} ${P3TFORM_HEADERS}) +add_library(p3tform ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) From 374d9575d3df15a4894d0e41dba3c85d90adf7ba Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 Apr 2014 06:06:42 -0600 Subject: [PATCH 259/744] cmake: Add missing header in express. --- panda/src/express/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index db3b0a3696..15c9a8dfe7 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -12,6 +12,7 @@ set(P3EXPRESS_HEADERS dcast.T dcast.h encrypt_string.h error_utils.h + export_dtool.h fileReference.h fileReference.I hashGeneratorBase.I hashGeneratorBase.h hashVal.I hashVal.h From c82c0df266370accb6bb462edf74404804da5b8e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 Apr 2014 06:07:24 -0600 Subject: [PATCH 260/744] cmake: Fix Interrogate macro bug causing component sources to get scanned along with their composite counterparts. --- cmake/macros/Interrogate.cmake | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 0025cc9161..66398fb772 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -71,8 +71,11 @@ function(target_interrogate target) # through a property while still preserving the reference. set(absolute_sources) foreach(source ${sources}) - get_source_file_property(location "${source}" LOCATION) - set(absolute_sources ${absolute_sources} ${location}) + get_source_file_property(exclude "${source}" WRAP_EXCLUDE) + if(NOT exclude) + get_source_file_property(location "${source}" LOCATION) + list(APPEND absolute_sources ${location}) + endif() endforeach(source) set_target_properties("${target}" PROPERTIES IGATE_SOURCES @@ -134,11 +137,6 @@ function(interrogate_sources target output database module) endif() endforeach(regex) - get_source_file_property(source_excluded ${source} WRAP_EXCLUDE) - if(source_excluded) - set(exclude ON) - endif() - if(NOT exclude) # This file is to be scanned by Interrogate. In order to avoid # cluttering up the command line, we should first make it relative: From ea4043d689d2c2335e961357f75b7802d08faa2e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 Apr 2014 06:31:04 -0600 Subject: [PATCH 261/744] cmake: Build pstatclient. --- dtool/Config.cmake | 3 ++ panda/CMakeLists.txt | 4 +-- panda/src/pstatclient/CMakeLists.txt | 53 ++++++++++------------------ 3 files changed, 24 insertions(+), 36 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 98bc05dbce..3a22fc9da4 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -803,6 +803,9 @@ build (such as, for instance, for the iPhone)." ON) option(HAVE_AUDIO "Do you want to build the audio interface?" ON) +option(DO_PSTATS + "Enable the pstats client?" ON) + # These image formats don't require the assistance of a third-party # library to read and write, so there's normally no reason to disable # them int he build, unless you are looking to reduce the memory footprint. diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6ce34f47c5..b2a11da21d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -23,6 +23,8 @@ add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) add_subdirectory(src/pipeline) +add_subdirectory(src/nativenet) +add_subdirectory(src/net) add_subdirectory(src/putil) add_subdirectory(src/pstatclient) add_subdirectory(src/linmath) @@ -60,8 +62,6 @@ add_subdirectory(src/tform) add_subdirectory(src/pgui) add_subdirectory(src/recorder) add_subdirectory(src/collide) -add_subdirectory(src/nativenet) -add_subdirectory(src/net) add_subdirectory(src/egg) add_subdirectory(src/egg2pg) add_subdirectory(src/framework) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 007e73d03c..d534c32f60 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -1,43 +1,28 @@ set(P3PSTATCLIENT_HEADERS - config_pstats.h pStatClient.I pStatClient.h - pStatClientImpl.I pStatClientImpl.h - pStatClientVersion.I - pStatClientVersion.h pStatClientControlMessage.h - pStatCollector.I pStatCollector.h pStatCollectorDef.h - pStatCollectorForward.I pStatCollectorForward.h - pStatFrameData.I pStatFrameData.h pStatProperties.h - pStatServerControlMessage.h pStatThread.I pStatThread.h - pStatTimer.I pStatTimer.h -) + config_pstats.h pStatClient.I pStatClient.h + pStatClientImpl.I pStatClientImpl.h + pStatClientVersion.I + pStatClientVersion.h pStatClientControlMessage.h + pStatCollector.I pStatCollector.h pStatCollectorDef.h + pStatCollectorForward.I pStatCollectorForward.h + pStatFrameData.I pStatFrameData.h pStatProperties.h + pStatServerControlMessage.h pStatThread.I pStatThread.h + pStatTimer.I pStatTimer.h) set(P3PSTATCLIENT_SOURCES - config_pstats.cxx pStatClient.cxx pStatClientImpl.cxx - pStatClientVersion.cxx - pStatClientControlMessage.cxx - pStatCollector.cxx - pStatCollectorDef.cxx - pStatCollectorForward.cxx - pStatFrameData.cxx pStatProperties.cxx - pStatServerControlMessage.cxx - pStatThread.cxx -) + config_pstats.cxx pStatClient.cxx pStatClientImpl.cxx + pStatClientVersion.cxx + pStatClientControlMessage.cxx + pStatCollector.cxx + pStatCollectorDef.cxx + pStatCollectorForward.cxx + pStatFrameData.cxx pStatProperties.cxx + pStatServerControlMessage.cxx + pStatThread.cxx) composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) -target_link_libraries(p3pstatclient p3putil) +target_link_libraries(p3pstatclient p3net p3putil p3express) target_interrogate(p3pstatclient ALL) install(TARGETS p3pstatclient DESTINATION lib) - -#begin test_bin_target - #define LOCAL_LIBS \ - # p3pstatclient - #define OTHER_LIBS \ - # $[OTHER_LIBS] p3pystub - - #define TARGET test_client - - #define SOURCES \ - # test_client.cxx - -#end test_bin_target From df24806a2ebba86cf1939a14df1418a512c7755d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 17 Apr 2014 01:34:03 -0600 Subject: [PATCH 262/744] dtool: Move all parser-inc includes to their proper subdirectories. --- dtool/src/parser-inc/{ => Cg}/cg.h | 0 dtool/src/parser-inc/{ => Cg}/cgGL.h | 0 dtool/src/parser-inc/{ => Core}/Core.h | 0 dtool/src/parser-inc/{ => Eigen}/Dense | 0 dtool/src/parser-inc/{ => Eigen}/StdVector | 0 dtool/src/parser-inc/{ => Forest}/Forest.h | 0 dtool/src/parser-inc/{ => Renderers/OpenGL}/DirectX9Renderer.h | 0 dtool/src/parser-inc/{ => Renderers/OpenGL}/OpenGLRenderer.h | 0 dtool/src/parser-inc/{ => Rocket/Core}/RenderInterface.h | 0 dtool/src/parser-inc/{ => glew}/glew.h | 0 dtool/src/parser-inc/{ => netinet}/ip.h | 0 dtool/src/parser-inc/{ => netinet}/tcp.h | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename dtool/src/parser-inc/{ => Cg}/cg.h (100%) rename dtool/src/parser-inc/{ => Cg}/cgGL.h (100%) rename dtool/src/parser-inc/{ => Core}/Core.h (100%) rename dtool/src/parser-inc/{ => Eigen}/Dense (100%) rename dtool/src/parser-inc/{ => Eigen}/StdVector (100%) rename dtool/src/parser-inc/{ => Forest}/Forest.h (100%) rename dtool/src/parser-inc/{ => Renderers/OpenGL}/DirectX9Renderer.h (100%) rename dtool/src/parser-inc/{ => Renderers/OpenGL}/OpenGLRenderer.h (100%) rename dtool/src/parser-inc/{ => Rocket/Core}/RenderInterface.h (100%) rename dtool/src/parser-inc/{ => glew}/glew.h (100%) rename dtool/src/parser-inc/{ => netinet}/ip.h (100%) rename dtool/src/parser-inc/{ => netinet}/tcp.h (100%) diff --git a/dtool/src/parser-inc/cg.h b/dtool/src/parser-inc/Cg/cg.h similarity index 100% rename from dtool/src/parser-inc/cg.h rename to dtool/src/parser-inc/Cg/cg.h diff --git a/dtool/src/parser-inc/cgGL.h b/dtool/src/parser-inc/Cg/cgGL.h similarity index 100% rename from dtool/src/parser-inc/cgGL.h rename to dtool/src/parser-inc/Cg/cgGL.h diff --git a/dtool/src/parser-inc/Core.h b/dtool/src/parser-inc/Core/Core.h similarity index 100% rename from dtool/src/parser-inc/Core.h rename to dtool/src/parser-inc/Core/Core.h diff --git a/dtool/src/parser-inc/Dense b/dtool/src/parser-inc/Eigen/Dense similarity index 100% rename from dtool/src/parser-inc/Dense rename to dtool/src/parser-inc/Eigen/Dense diff --git a/dtool/src/parser-inc/StdVector b/dtool/src/parser-inc/Eigen/StdVector similarity index 100% rename from dtool/src/parser-inc/StdVector rename to dtool/src/parser-inc/Eigen/StdVector diff --git a/dtool/src/parser-inc/Forest.h b/dtool/src/parser-inc/Forest/Forest.h similarity index 100% rename from dtool/src/parser-inc/Forest.h rename to dtool/src/parser-inc/Forest/Forest.h diff --git a/dtool/src/parser-inc/DirectX9Renderer.h b/dtool/src/parser-inc/Renderers/OpenGL/DirectX9Renderer.h similarity index 100% rename from dtool/src/parser-inc/DirectX9Renderer.h rename to dtool/src/parser-inc/Renderers/OpenGL/DirectX9Renderer.h diff --git a/dtool/src/parser-inc/OpenGLRenderer.h b/dtool/src/parser-inc/Renderers/OpenGL/OpenGLRenderer.h similarity index 100% rename from dtool/src/parser-inc/OpenGLRenderer.h rename to dtool/src/parser-inc/Renderers/OpenGL/OpenGLRenderer.h diff --git a/dtool/src/parser-inc/RenderInterface.h b/dtool/src/parser-inc/Rocket/Core/RenderInterface.h similarity index 100% rename from dtool/src/parser-inc/RenderInterface.h rename to dtool/src/parser-inc/Rocket/Core/RenderInterface.h diff --git a/dtool/src/parser-inc/glew.h b/dtool/src/parser-inc/glew/glew.h similarity index 100% rename from dtool/src/parser-inc/glew.h rename to dtool/src/parser-inc/glew/glew.h diff --git a/dtool/src/parser-inc/ip.h b/dtool/src/parser-inc/netinet/ip.h similarity index 100% rename from dtool/src/parser-inc/ip.h rename to dtool/src/parser-inc/netinet/ip.h diff --git a/dtool/src/parser-inc/tcp.h b/dtool/src/parser-inc/netinet/tcp.h similarity index 100% rename from dtool/src/parser-inc/tcp.h rename to dtool/src/parser-inc/netinet/tcp.h From 9d1254d44064b41a37919bb2d0598ce861db0d65 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 17 Apr 2014 02:18:46 -0600 Subject: [PATCH 263/744] cmake: Fix Eigen3 detection and support. --- cmake/modules/FindEigen3.cmake | 5 +++-- panda/src/linmath/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index 73b0b90062..a03f5ddf3f 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -25,5 +25,6 @@ include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR) if(EIGEN3_FOUND) - set(EIGEN_FOUND TRUE) -endif() \ No newline at end of file + set(EIGEN_FOUND TRUE) + set(EIGEN_INCLUDE_DIR ${EIGEN3_INCLUDE_DIR}) +endif() diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 630ea6e7ce..d45048316a 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -45,6 +45,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3putil) +target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) install(TARGETS p3linmath DESTINATION lib) From 8524676032c5db2b56a92add8bf1d159d4bf12a1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 17 Apr 2014 01:29:56 -0600 Subject: [PATCH 264/744] cmake: Begin work on building pandatool. --- CMakeLists.txt | 5 +++++ pandatool/CMakeLists.txt | 7 +++++++ pandatool/src/pandatoolbase/CMakeLists.txt | 22 ++++++++++++++++++++++ pandatool/src/progbase/CMakeLists.txt | 17 +++++++++++++++++ 4 files changed, 51 insertions(+) create mode 100644 pandatool/CMakeLists.txt create mode 100644 pandatool/src/pandatoolbase/CMakeLists.txt create mode 100644 pandatool/src/progbase/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index fccef3ea18..d1755b6919 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,7 @@ include_directories("${CMAKE_BINARY_DIR}/include") option(BUILD_DTOOL "Build the dtool source tree." ON) option(BUILD_PANDA "Build the panda source tree." ON) option(BUILD_DIRECT "Build the direct source tree." ON) +option(BUILD_PANDATOOL "Build the pandatool source tree." ON) # Include Panda3D packages if(BUILD_DTOOL) @@ -44,3 +45,7 @@ endif() if(BUILD_DIRECT) add_subdirectory(direct) endif() + +if(BUILD_PANDATOOL) + add_subdirectory(pandatool) +endif() diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt new file mode 100644 index 0000000000..785a35bdb1 --- /dev/null +++ b/pandatool/CMakeLists.txt @@ -0,0 +1,7 @@ +if(NOT BUILD_PANDA) + message(FATAL_ERROR "Cannot build pandatool without panda! Please enable the BUILD_PANDA option.") +endif() + +# Include pandatool source directories +add_subdirectory(src/pandatoolbase) +add_subdirectory(src/progbase) diff --git a/pandatool/src/pandatoolbase/CMakeLists.txt b/pandatool/src/pandatoolbase/CMakeLists.txt new file mode 100644 index 0000000000..d4a7aff55a --- /dev/null +++ b/pandatool/src/pandatoolbase/CMakeLists.txt @@ -0,0 +1,22 @@ +set(P3PANDATOOLBASE_HEADERS + animationConvert.h + config_pandatoolbase.h + distanceUnit.h + pandatoolbase.h pandatoolsymbols.h + pathReplace.I pathReplace.h + pathStore.h) + +set(P3PANDATOOLBASE_SOURCES + animationConvert.cxx + config_pandatoolbase.cxx + distanceUnit.cxx + pandatoolbase.cxx + pathReplace.cxx + pathStore.cxx) + +composite_sources(p3pandatoolbase P3PANDATOOLBASE_SOURCES) +add_library(p3pandatoolbase STATIC ${P3PANDATOOLBASE_HEADERS} ${P3PANDATOOLBASE_SOURCES}) +target_link_libraries(p3pandatoolbase p3pandabase p3putil) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/progbase/CMakeLists.txt b/pandatool/src/progbase/CMakeLists.txt new file mode 100644 index 0000000000..8b245f2b2d --- /dev/null +++ b/pandatool/src/progbase/CMakeLists.txt @@ -0,0 +1,17 @@ +set(P3PROGBASE_HEADERS + programBase.I programBase.h + withOutputFile.I withOutputFile.h + wordWrapStream.h wordWrapStreamBuf.I + wordWrapStreamBuf.h) + +set(P3PROGBASE_SOURCES + programBase.cxx withOutputFile.cxx wordWrapStream.cxx + wordWrapStreamBuf.cxx) + +composite_sources(p3progbase P3PROGBASE_SOURCES) +add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) +target_link_libraries(p3progbase p3pandatoolbase p3pnmimage) +target_use_packages(p3progbase ZLIB) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. From ad5b1212ca30e8aa2f5ca4036bd7bf633c31333d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 17 Apr 2014 02:56:34 -0600 Subject: [PATCH 265/744] cmake: Build GTK pstats server. --- pandatool/CMakeLists.txt | 2 ++ pandatool/src/gtk-stats/CMakeLists.txt | 38 ++++++++++++++++++++++++ pandatool/src/pstatserver/CMakeLists.txt | 26 ++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 pandatool/src/gtk-stats/CMakeLists.txt create mode 100644 pandatool/src/pstatserver/CMakeLists.txt diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 785a35bdb1..9b90217e03 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -5,3 +5,5 @@ endif() # Include pandatool source directories add_subdirectory(src/pandatoolbase) add_subdirectory(src/progbase) +add_subdirectory(src/pstatserver) +add_subdirectory(src/gtk-stats) diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt new file mode 100644 index 0000000000..40561bd856 --- /dev/null +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -0,0 +1,38 @@ +if(HAVE_GTK2 AND HAVE_NET) + set(GTKSTATS_HEADERS + gtkStatsChartMenu.h + gtkStatsGraph.h + gtkStatsLabel.h + gtkStatsLabelStack.h + gtkStatsMenuId.h + gtkStatsMonitor.h gtkStatsMonitor.I + gtkStatsPianoRoll.h + gtkStatsServer.h + gtkStatsStripChart.h) + + set(GTKSTATS_SOURCES + gtkStats.cxx + gtkStatsChartMenu.cxx + gtkStatsGraph.cxx + gtkStatsLabel.cxx + gtkStatsLabelStack.cxx + gtkStatsMonitor.cxx + gtkStatsPianoRoll.cxx + gtkStatsServer.cxx + gtkStatsStripChart.cxx) + + composite_sources(gtkstats GTKSTATS_SOURCES) + add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) + target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub) + target_use_packages(gtkstats GTK2) + + # This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and + # pstats everywhere else (as the Win32 GUI is not built). + if(WIN32) + set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats-gtk") + else() + set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats") + endif() + + install(TARGETS gtkstats DESTINATION bin) +endif() diff --git a/pandatool/src/pstatserver/CMakeLists.txt b/pandatool/src/pstatserver/CMakeLists.txt new file mode 100644 index 0000000000..560cddece9 --- /dev/null +++ b/pandatool/src/pstatserver/CMakeLists.txt @@ -0,0 +1,26 @@ +if(HAVE_NET) + set(P3PSTATSERVER_HEADERS + pStatClientData.h pStatGraph.I + pStatGraph.h pStatListener.h pStatMonitor.I + pStatMonitor.h pStatPianoRoll.I + pStatPianoRoll.h pStatReader.h + pStatServer.h pStatStripChart.I + pStatStripChart.h pStatThreadData.I + pStatThreadData.h pStatView.I pStatView.h + pStatViewLevel.I pStatViewLevel.h) + + set(P3PSTATSERVER_SOURCES + pStatClientData.cxx pStatGraph.cxx + pStatListener.cxx + pStatMonitor.cxx pStatPianoRoll.cxx + pStatReader.cxx pStatServer.cxx + pStatStripChart.cxx pStatThreadData.cxx + pStatView.cxx pStatViewLevel.cxx) + + composite_sources(p3pstatserver P3PSTATSERVER_SOURCES) + add_library(p3pstatserver STATIC ${P3PSTATSERVER_HEADERS} ${P3PSTATSERVER_SOURCES}) + target_link_libraries(p3pstatserver p3pandatoolbase p3pstatclient p3linmath) + + # This is only needed for binaries in the pandatool package. It is not useful + # for user applications, so it is not installed. +endif() From 036dcb91b067a3ab8c88126ab4076f1d5335c403 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 23 Apr 2014 21:48:10 -0600 Subject: [PATCH 266/744] cmake: Update CMakeLists files for latest Panda3D changes. --- panda/src/pgraph/CMakeLists.txt | 6 ++++++ panda/src/putil/CMakeLists.txt | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 2c66887118..2e14103da5 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -203,6 +203,12 @@ set(P3PGRAPH_IGATEEXT nodePath_ext.cxx nodePath_ext.h nodePath_ext.I + pandaNode_ext.cxx + pandaNode_ext.h + renderState_ext.cxx + renderState_ext.h + transformState_ext.cxx + transformState_ext.h ) composite_sources(p3pgraph P3PGRAPH_SOURCES) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 0a9cc12849..21beca3703 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -11,8 +11,9 @@ set(P3PUTIL_HEADERS bamWriter.I bamWriter.h bitArray.I bitArray.h bitMask.I bitMask.h - buttonHandle.I - buttonHandle.h buttonRegistry.I buttonRegistry.h + buttonHandle.I buttonHandle.h + buttonMap.I buttonMap.h + buttonRegistry.I buttonRegistry.h cachedTypedWritableReferenceCount.h cachedTypedWritableReferenceCount.I callbackData.h callbackData.I callbackObject.h callbackObject.I @@ -74,7 +75,7 @@ set(P3PUTIL_SOURCES bamWriter.cxx bitArray.cxx bitMask.cxx - buttonHandle.cxx buttonRegistry.cxx + buttonHandle.cxx buttonMap.cxx buttonRegistry.cxx cachedTypedWritableReferenceCount.cxx callbackData.cxx callbackObject.cxx From a26df45c38e9549e1a56a1160f3daf6bf883ca29 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 28 Apr 2014 16:21:10 -0600 Subject: [PATCH 267/744] cmake: Fix Interrogate installation so that runtime paths are properly removed. --- cmake/macros/Interrogate.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 66398fb772..4b208f09bd 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -289,6 +289,8 @@ function(add_python_module module) set_target_properties(${module} PROPERTIES SUFFIX ".pyd") endif() + install(TARGETS ${module} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + list(APPEND ALL_INTERROGATE_MODULES "${module}") set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endif() @@ -302,5 +304,5 @@ if(HAVE_PYTHON) # The Interrogate path needs to be installed to the architecture-dependent # Python directory. - install(DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}") + install(FILES "${PROJECT_BINARY_DIR}/panda3d/__init__.py" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") endif() From 3ed813f42f14e6c7e486a0cf8543de0fe5492c91 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 28 Apr 2014 16:22:50 -0600 Subject: [PATCH 268/744] cmake: Fix typo in direct's install directive. --- direct/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 6fc755a522..04e8da3ab5 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -31,7 +31,7 @@ if(HAVE_PYTHON) install( DIRECTORY "src/${dir}" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct" - PATTERN "*.py") + FILES_MATCHING PATTERN "*.py") endforeach() # We also need an __init__.py file, which we have to generate: From 5e2f3f777b918f37bef248e65b003a9a9da206bb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 6 May 2014 21:04:18 -0600 Subject: [PATCH 269/744] CMake: Build bam2egg and egg2bam. --- pandatool/CMakeLists.txt | 3 +++ pandatool/src/bam/CMakeLists.txt | 16 ++++++++++++++++ pandatool/src/converter/CMakeLists.txt | 9 +++++++++ pandatool/src/eggbase/CMakeLists.txt | 19 +++++++++++++++++++ 4 files changed, 47 insertions(+) create mode 100644 pandatool/src/bam/CMakeLists.txt create mode 100644 pandatool/src/converter/CMakeLists.txt create mode 100644 pandatool/src/eggbase/CMakeLists.txt diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 9b90217e03..f89483ed3f 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -5,5 +5,8 @@ endif() # Include pandatool source directories add_subdirectory(src/pandatoolbase) add_subdirectory(src/progbase) +add_subdirectory(src/converter) +add_subdirectory(src/eggbase) +add_subdirectory(src/bam) add_subdirectory(src/pstatserver) add_subdirectory(src/gtk-stats) diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt new file mode 100644 index 0000000000..be3299b0d2 --- /dev/null +++ b/pandatool/src/bam/CMakeLists.txt @@ -0,0 +1,16 @@ +add_executable(bam-info bamInfo.cxx bamInfo.h) +target_link_libraries(bam-info p3progbase p3pgraph p3pgraphnodes p3recorder p3pystub + p3display) # This is a HACK for now -- fix Interrogate +install(TARGETS bam-info DESTINATION bin) + +add_executable(egg2bam eggToBam.cxx eggToBam.h) +target_link_libraries(egg2bam p3eggbase p3progbase) +install(TARGETS egg2bam DESTINATION bin) + +add_executable(bam2egg bamToEgg.cxx bamToEgg.h) +target_link_libraries(bam2egg p3converter p3eggbase p3progbase) +install(TARGETS bam2egg DESTINATION bin) + +add_executable(pts2bam ptsToBam.cxx ptsToBam.h) +target_link_libraries(pts2bam p3progbase p3pgraph p3pgraphnodes p3egg2pg p3pystub) +install(TARGETS pts2bam DESTINATION bin) diff --git a/pandatool/src/converter/CMakeLists.txt b/pandatool/src/converter/CMakeLists.txt new file mode 100644 index 0000000000..3470760573 --- /dev/null +++ b/pandatool/src/converter/CMakeLists.txt @@ -0,0 +1,9 @@ +set(P3CONVERTER_HEADERS + somethingToEggConverter.I somethingToEggConverter.h + eggToSomethingConverter.I eggToSomethingConverter.h) + +set(P3CONVERTER_SOURCES + somethingToEggConverter.cxx eggToSomethingConverter.cxx) + +add_library(p3converter STATIC ${P3CONVERTER_HEADERS} ${P3CONVERTER_SOURCES}) +target_link_libraries(p3converter p3pandatoolbase p3egg2pg p3recorder p3pystub) diff --git a/pandatool/src/eggbase/CMakeLists.txt b/pandatool/src/eggbase/CMakeLists.txt new file mode 100644 index 0000000000..c3dda64cd3 --- /dev/null +++ b/pandatool/src/eggbase/CMakeLists.txt @@ -0,0 +1,19 @@ +set(P3EGGBASE_HEADERS + eggBase.h eggConverter.h eggFilter.h + eggMakeSomething.h + eggMultiBase.h eggMultiFilter.h + eggReader.h eggSingleBase.h + eggToSomething.h eggWriter.h + somethingToEgg.h) + +set(P3EGGBASE_SOURCES + eggBase.cxx eggConverter.cxx eggFilter.cxx + eggMakeSomething.cxx + eggMultiBase.cxx + eggMultiFilter.cxx eggReader.cxx eggSingleBase.cxx + eggToSomething.cxx + eggWriter.cxx somethingToEgg.cxx) + +composite_sources(p3eggbase P3EGGBASE_SOURCES) +add_library(p3eggbase STATIC ${P3EGGBASE_HEADERS} ${P3EGGBASE_SOURCES}) +target_link_libraries(p3eggbase p3progbase p3converter) From ed0b42983ff028cad19cd4c9e853af64cd035abd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 6 May 2014 21:16:34 -0600 Subject: [PATCH 270/744] CMake: Depend p3converter on the pandaegg metalib directly. --- pandatool/src/converter/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandatool/src/converter/CMakeLists.txt b/pandatool/src/converter/CMakeLists.txt index 3470760573..45cf7a9e30 100644 --- a/pandatool/src/converter/CMakeLists.txt +++ b/pandatool/src/converter/CMakeLists.txt @@ -6,4 +6,4 @@ set(P3CONVERTER_SOURCES somethingToEggConverter.cxx eggToSomethingConverter.cxx) add_library(p3converter STATIC ${P3CONVERTER_HEADERS} ${P3CONVERTER_SOURCES}) -target_link_libraries(p3converter p3pandatoolbase p3egg2pg p3recorder p3pystub) +target_link_libraries(p3converter p3pandatoolbase pandaegg p3pystub) From e9f4e44e99b394e1ce4f0de5f5252276af54e1d9 Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 30 May 2014 12:27:21 +0200 Subject: [PATCH 271/744] Add panda/src/configfiles --- dtool/Config.cmake | 10 +-- dtool/src/dtoolbase/CMakeLists.txt | 4 +- panda/CMakeLists.txt | 1 + panda/src/configfiles/CMakeLists.txt | 31 +++++++ panda/src/configfiles/panda.prc.in | 125 +++++++++++++++++++++++++++ 5 files changed, 163 insertions(+), 8 deletions(-) create mode 100644 panda/src/configfiles/CMakeLists.txt create mode 100644 panda/src/configfiles/panda.prc.in diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3a22fc9da4..b6514f8380 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -596,17 +596,17 @@ find_package(FFMPEG) find_package(SWScale) find_package(SWResample) -package_option(FFMPEG DEFAULT ON +package_option(FFMPEG "Enables support for audio- and video-decoding using the FFMPEG library.") -package_option(SWSCALE DEFAULT ON +package_option(SWSCALE "Enables support for FFMPEG's libswscale for video rescaling.") -package_option(SWRESAMPLE DEFAULT ON +package_option(SWRESAMPLE "Enables support for FFMPEG's libresample for audio resampling.") # Is ODE installed, and where? find_package(ODE) -package_option(ODE DEFAULT ON +package_option(ODE "Enables support for ridid-body physics using the Open Dynamics Engine.") # Is OpenGL installed, and where? @@ -620,7 +620,7 @@ package_option(GL "Enable OpenGL support.") # libraries appropriate to the version you want to compile against. set(MIN_GL_VERSION "1 1" CACHE STRING "The variable is the major, minor version of OpenGL, separated by a -space (instead of a dot). Thus, "1 1" means OpenGL version 1.1. +space (instead of a dot). Thus, \"1 1\" means OpenGL version 1.1. This defines the minimum runtime version of OpenGL that Panda will require. Setting it to a higher version will compile in hard diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 8a93e83399..9b4ccc020e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -62,8 +62,6 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -if(HAVE_PYTHON) - target_link_libraries(p3dtoolbase ${PYTHON_LIBRARIES}) -endif() +target_use_packages(p3dtoolbase THREADS PYTHON) install(TARGETS p3dtoolbase DESTINATION lib) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b2a11da21d..b17abfa521 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -19,6 +19,7 @@ if(HAVE_FREETYPE) endif() # Include panda source directories +add_subdirectory(src/configfiles) add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt new file mode 100644 index 0000000000..adfa257544 --- /dev/null +++ b/panda/src/configfiles/CMakeLists.txt @@ -0,0 +1,31 @@ +# Set some variables that are used in panda.prc.in. +set(AUX_DISPLAYS) + +if(HAVE_GL) + set(AUX_DISPLAYS "${AUX_DISPLAYS} +aux-display pandagl") +endif() + +if(HAVE_DX9) + set(AUX_DISPLAYS "${AUX_DISPLAYS} +aux-display pandadx9") +endif() + +if(HAVE_TINYDISPLAY) + set(AUX_DISPLAYS "${AUX_DISPLAYS} +aux-display p3tinydisplay") +endif() + +if(HAVE_RAD_MSS) + set(AUDIO_LIBRARY_NAME p3miles_audio) +elseif(HAVE_FMODEX) + set(AUDIO_LIBRARY_NAME p3fmod_audio) +elseif(HAVE_OPENAL) + set(AUDIO_LIBRARY_NAME p3openal_audio) +else() + set(AUDIO_LIBRARY_NAME none) +endif() + +configure_file(panda.prc.in "${CMAKE_BINARY_DIR}/etc/20_panda.prc") + +install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" DESTINATION etc) diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in new file mode 100644 index 0000000000..ffbce72552 --- /dev/null +++ b/panda/src/configfiles/panda.prc.in @@ -0,0 +1,125 @@ +// +// panda.prc.in +// +// This file defines the script to auto-generate panda.prc at +// CMake time. This is intended to fill in some of the default +// parameters, in particular the default display types. +// + +#output 20_panda.prc notouch +#### Generated automatically by CMake ${CMAKE_VERSION} from panda.prc.in. +################################# DO NOT EDIT ########################### + +plugin-path $THIS_PRC_DIR/../lib + +# Let's set up a default window size of 800x600. The user can +# override this in his or her personal prc file. +win-size 800 600 + +# Define the display types that have been compiled in. Panda will +# pick one of these by going through the list in this order until one +# is found that works, unless the user specifically requests a +# particular display type with the load-display directive. +${AUX_DISPLAYS} + +# Define an appropriate default audio library. +audio-library-name ${AUDIO_LIBRARY_NAME} + +# The egg loader is handy to have available by default. This allows +# clients to load egg files. (The bam loader is built-in so bam files +# are always loadable). + +# By qualifying with the extension "egg", we indicate the egg loader +# should be made available only if you explicitly name a file with an +# .egg extension. + +# Also see ptloader, which is built as part of pandatool; it allows +# files of more exotic types (like .flt, .mb, .lwo, and .dxf) to be +# loaded directly into Panda. + +load-file-type egg pandaegg + + +# These entries work very similar to load-file-type, except they are +# used by the MovieVideo and MovieAudio code to determine which module +# should be loaded in order to decode files of the given extension. + +# ffmpeg is added by default because it used to be compiled in. +# The * is a special catch-all extension that is consulted unless a +# loader has been defined with an explicit extension. + +load-audio-type * p3ffmpeg +load-video-type * p3ffmpeg + + +# The following lines define some handy object types to use within the +# egg syntax. This remaps { name } into whatever egg +# syntax is given by egg-object-type-name, which makes a handy +# abbreviation for modeling packages (like Maya) to insert +# sophisticated egg syntax into the generated egg file, using a single +# object type string. + +egg-object-type-portal portal { 1 } +egg-object-type-polylight polylight { 1 } +egg-object-type-seq24 { 1 } fps { 24 } +egg-object-type-seq12 { 1 } fps { 12 } +egg-object-type-seq10 { 1 } fps { 10 } +egg-object-type-seq8 { 1 } fps { 8 } +egg-object-type-seq6 { 1} fps { 6 } +egg-object-type-seq4 { 1} fps { 4 } +egg-object-type-seq2 { 1} fps { 2 } +egg-object-type-indexed indexed { 1 } + +egg-object-type-binary alpha { binary } +egg-object-type-dual alpha { dual } +egg-object-type-glass alpha { blend_no_occlude } + +# These are just shortcuts to define the Model and DCS flags, which +# indicate nodes that should not be flattened out of the hierarchy +# during the conversion process. DCS goes one step further and +# indicates that the node's transform is important and should be +# preserved (DCS stands for Dynamic Coordinate System). Notouch is +# even stronger, and means not to do any flattening below the node at +# all. +egg-object-type-model { 1 } +egg-object-type-dcs { 1 } +egg-object-type-notouch { no_touch } + +# The following define various kinds of collision geometry. These +# mark the geometry at this level and below as invisible collision +# polygons, which can be used by Panda's collision system to detect +# collisions more optimally than regular visible polygons. +egg-object-type-barrier { Polyset descend } +egg-object-type-sphere { Sphere descend } +egg-object-type-invsphere { InvSphere descend } +egg-object-type-tube { Tube descend } + +# As above, but these are flagged to be "intangible", so that they +# will trigger an event but not stop an object from passing through. +egg-object-type-trigger { Polyset descend intangible } +egg-object-type-trigger-sphere { Sphere descend intangible } + +# "floor" and "dupefloor" define the nodes in question as floor +# polygons. dupefloor means to duplicate the geometry first so that +# the same polygons serve both as visible geometry and as collision +# polygons. +egg-object-type-floor { Polyset descend level } +egg-object-type-dupefloor { Polyset keep descend level } + +# "bubble" puts an invisible bubble around an object, but does not +# otherwise remove the geometry. +egg-object-type-bubble { Sphere keep descend } + +# "ghost" turns off the normal collide bit that is set on visible +# geometry by default, so that if you are using visible geometry for +# collisions, this particular geometry will not be part of those +# collisions--it is ghostlike. +egg-object-type-ghost collide-mask { 0 } + +# "glow" is useful for halo effects and things of that ilk. It +# renders the object in add mode instead of the normal opaque mode. +egg-object-type-glow blend { add } + +# This isn't used in the egg loader, it controls a setting only within +# maya2egg itself. So if it appears in an egg file, it means nothing. +egg-object-type-keep-all-uvsets From 4f244aa934b4b986fa817fff94de54b589bc4864 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 6 May 2014 21:18:02 -0600 Subject: [PATCH 272/744] CMake: Add dependency from pandaegg to panda. --- panda/metalibs/pandaegg/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index a8684b4fe9..946229d919 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -1,5 +1,5 @@ if(HAVE_EGG) - set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) + set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg panda) add_library(pandaegg pandaegg.cxx) target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) From f6f80213b2554d468388576cec72b0aa2fd55f24 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 11 May 2014 12:32:16 -0600 Subject: [PATCH 273/744] CMake: Build downloadertools. --- panda/CMakeLists.txt | 1 + panda/src/downloadertools/CMakeLists.txt | 35 ++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 panda/src/downloadertools/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b17abfa521..dcb015d012 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -23,6 +23,7 @@ add_subdirectory(src/configfiles) add_subdirectory(src/pandabase) add_subdirectory(src/express) add_subdirectory(src/downloader) +add_subdirectory(src/downloadertools) add_subdirectory(src/pipeline) add_subdirectory(src/nativenet) add_subdirectory(src/net) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt new file mode 100644 index 0000000000..3df202569e --- /dev/null +++ b/panda/src/downloadertools/CMakeLists.txt @@ -0,0 +1,35 @@ +if(HAVE_OPENSSL) + add_executable(apply_patch apply_patch.cxx) + target_link_libraries(apply_patch p3downloader p3express p3pystub) + add_executable(build_patch build_patch.cxx) + target_link_libraries(build_patch p3downloader p3express p3pystub) + add_executable(show_ddb show_ddb.cxx) + target_link_libraries(show_ddb p3downloader p3express p3pystub) + add_executable(check_md5 check_md5.cxx) + target_link_libraries(check_md5 p3downloader p3express p3pystub) + add_executable(pencrypt pencrypt.cxx) + target_link_libraries(pencrypt p3downloader p3express p3pystub) + add_executable(pdecrypt pdecrypt.cxx) + target_link_libraries(pdecrypt p3downloader p3express p3pystub) + + install(TARGETS apply_patch build_patch show_ddb check_md5 pencrypt pdecrypt + DESTINATION bin) +endif() + +if(HAVE_ZLIB) + add_executable(check_adler check_adler.cxx) + target_link_libraries(check_adler p3downloader p3express p3pystub) + add_executable(check_crc check_crc.cxx) + target_link_libraries(check_crc p3downloader p3express p3pystub) + add_executable(pzip pzip.cxx) + target_link_libraries(pzip p3downloader p3express p3pystub) + add_executable(punzip punzip.cxx) + target_link_libraries(punzip p3downloader p3express p3pystub) + + install(TARGETS check_adler check_crc pzip punzip + DESTINATION bin) +endif() + +add_executable(multify multify.cxx) +target_link_libraries(multify p3downloader p3express p3pystub) +install(TARGETS multify DESTINATION bin) From cecae46c4540b0cd3b86b7773e71926bb82725d5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 26 Jul 2014 12:42:28 -0700 Subject: [PATCH 274/744] CMake: Update to latest upstream Panda3D changes. --- panda/src/pgraphnodes/CMakeLists.txt | 2 ++ panda/src/putil/pythonCallbackObject.h | 1 + 2 files changed, 3 insertions(+) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 1f42f992e4..5458489c31 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -1,6 +1,7 @@ set(P3PGRAPHNODES_HEADERS ambientLight.h ambientLight.I callbackNode.h callbackNode.I + computeNode.h computeNode.I config_pgraphnodes.h directionalLight.h directionalLight.I fadeLodNode.I fadeLodNode.h fadeLodNodeData.h @@ -21,6 +22,7 @@ set(P3PGRAPHNODES_HEADERS set(P3PGRAPHNODES_SOURCES ambientLight.cxx callbackNode.cxx + computeNode.cxx config_pgraphnodes.cxx directionalLight.cxx fadeLodNode.cxx fadeLodNodeData.cxx diff --git a/panda/src/putil/pythonCallbackObject.h b/panda/src/putil/pythonCallbackObject.h index a6e11b3e35..4e1c03889f 100644 --- a/panda/src/putil/pythonCallbackObject.h +++ b/panda/src/putil/pythonCallbackObject.h @@ -19,6 +19,7 @@ #ifdef HAVE_PYTHON +#include "py_panda.h" #include "callbackObject.h" //////////////////////////////////////////////////////////////////// From cf1a9f180722cc12e95f747582a8e1863db99eeb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 26 Jul 2014 15:09:11 -0700 Subject: [PATCH 275/744] general: Fix up include structure to resolve errors when building without composites. --- dtool/src/dtoolutil/filename.cxx | 4 ++++ dtool/src/dtoolutil/globPattern.cxx | 4 ++++ panda/src/audiotraits/fmodAudioManager.cxx | 1 + panda/src/audiotraits/fmodAudioSound.cxx | 2 ++ panda/src/audiotraits/fmodAudioSound.h | 1 + panda/src/audiotraits/openalAudioSound.h | 1 + panda/src/egg/eggGroupNode.cxx | 3 +++ panda/src/egg/eggNode.cxx | 1 + panda/src/egg/eggParameters.h | 2 ++ panda/src/egg2pg/eggSaver.h | 1 + panda/src/ffmpeg/config_ffmpeg.h | 7 +++++++ panda/src/ffmpeg/ffmpegAudio.cxx | 1 + panda/src/ffmpeg/ffmpegAudioCursor.cxx | 1 + panda/src/ffmpeg/ffmpegVideo.cxx | 2 +- panda/src/ffmpeg/ffmpegVideoCursor.cxx | 2 +- panda/src/ffmpeg/ffmpegVirtualFile.cxx | 2 +- panda/src/gobj/geomPrimitive.cxx | 1 + panda/src/gobj/shader.h | 1 + panda/src/movies/movieTypeRegistry.cxx | 1 + panda/src/movies/wavAudioCursor.cxx | 1 + panda/src/movies/wavAudioCursor.h | 2 +- panda/src/nativenet/socket_tcp_listen.h | 1 + panda/src/nativenet/socket_tcp_ssl.h | 1 + panda/src/nativenet/socket_udp_outgoing.h | 3 +++ panda/src/net/connectionListener.cxx | 1 + panda/src/net/connectionManager.cxx | 2 ++ panda/src/net/connectionReader.cxx | 1 + panda/src/net/datagramGeneratorNet.h | 1 + panda/src/ode/odeBody.cxx | 1 + panda/src/ode/odeGeom.cxx | 12 ++++++++++++ panda/src/ode/odeJoint.cxx | 12 ++++++++++++ panda/src/ode/odeSpace.cxx | 5 +++++ panda/src/ode/odeWorld.cxx | 1 + panda/src/pgraphnodes/computeNode.h | 1 + panda/src/pipeline/lightMutexDirect.h | 1 + panda/src/putil/buttonMap.cxx | 1 + 36 files changed, 81 insertions(+), 4 deletions(-) diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index b7d7c51e53..73e796b8c0 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -49,6 +49,10 @@ #include #endif +#ifdef HAVE_PYTHON +#include "Python.h" +#endif + TextEncoder::Encoding Filename::_filesystem_encoding = TextEncoder::E_utf8; TVOLATILE AtomicAdjust::Pointer Filename::_home_directory; diff --git a/dtool/src/dtoolutil/globPattern.cxx b/dtool/src/dtoolutil/globPattern.cxx index 4260625139..5db2ee9df2 100644 --- a/dtool/src/dtoolutil/globPattern.cxx +++ b/dtool/src/dtoolutil/globPattern.cxx @@ -15,6 +15,10 @@ #include "globPattern.h" #include +#ifdef HAVE_PYTHON +#include "Python.h" +#endif + //////////////////////////////////////////////////////////////////// // Function: GlobPattern::has_glob_characters // Access: Published diff --git a/panda/src/audiotraits/fmodAudioManager.cxx b/panda/src/audiotraits/fmodAudioManager.cxx index 13420c56fa..f5c190689a 100644 --- a/panda/src/audiotraits/fmodAudioManager.cxx +++ b/panda/src/audiotraits/fmodAudioManager.cxx @@ -17,6 +17,7 @@ #include "pandabase.h" #include "config_audio.h" +#include "config_fmodAudio.h" #include "dcast.h" #ifdef HAVE_FMODEX //[ diff --git a/panda/src/audiotraits/fmodAudioSound.cxx b/panda/src/audiotraits/fmodAudioSound.cxx index ff1fe1309e..7eb0fd269f 100644 --- a/panda/src/audiotraits/fmodAudioSound.cxx +++ b/panda/src/audiotraits/fmodAudioSound.cxx @@ -23,10 +23,12 @@ //Panda Headers #include "config_audio.h" +#include "config_fmodAudio.h" #include "fmodAudioSound.h" #include "string_utils.h" #include "subfileInfo.h" #include "reMutexHolder.h" +#include "virtualFileSystem.h" TypeHandle FmodAudioSound::_type_handle; diff --git a/panda/src/audiotraits/fmodAudioSound.h b/panda/src/audiotraits/fmodAudioSound.h index 436ad2c6c1..46aac1c2a3 100644 --- a/panda/src/audiotraits/fmodAudioSound.h +++ b/panda/src/audiotraits/fmodAudioSound.h @@ -77,6 +77,7 @@ #include "audioSound.h" #include "reMutex.h" +#include "fmodAudioManager.h" #include #include diff --git a/panda/src/audiotraits/openalAudioSound.h b/panda/src/audiotraits/openalAudioSound.h index 3d04677ec3..5922e0d49b 100644 --- a/panda/src/audiotraits/openalAudioSound.h +++ b/panda/src/audiotraits/openalAudioSound.h @@ -25,6 +25,7 @@ #include "audioSound.h" #include "movieAudioCursor.h" #include "trueClock.h" +#include "openalAudioManager.h" // OSX uses the OpenAL framework #ifdef IS_OSX diff --git a/panda/src/egg/eggGroupNode.cxx b/panda/src/egg/eggGroupNode.cxx index 13da740b27..93a77db7bd 100644 --- a/panda/src/egg/eggGroupNode.cxx +++ b/panda/src/egg/eggGroupNode.cxx @@ -13,11 +13,13 @@ //////////////////////////////////////////////////////////////////// #include "eggGroupNode.h" +#include "eggGroup.h" #include "eggCoordinateSystem.h" #include "eggData.h" #include "eggFilenameNode.h" #include "eggExternalReference.h" #include "eggPrimitive.h" +#include "eggPoint.h" #include "eggPolygon.h" #include "eggCompositePrimitive.h" #include "eggMesher.h" @@ -30,6 +32,7 @@ #include "config_egg.h" #include "dSearchPath.h" +#include "virtualFileSystem.h" #include "deg_2_rad.h" #include "dcast.h" #include "bamCacheRecord.h" diff --git a/panda/src/egg/eggNode.cxx b/panda/src/egg/eggNode.cxx index d93d510081..4077561239 100644 --- a/panda/src/egg/eggNode.cxx +++ b/panda/src/egg/eggNode.cxx @@ -14,6 +14,7 @@ #include "eggNode.h" #include "eggGroupNode.h" +#include "lightMutexHolder.h" #include "config_egg.h" #include "eggTextureCollection.h" #include "dcast.h" diff --git a/panda/src/egg/eggParameters.h b/panda/src/egg/eggParameters.h index b813fd684b..56ba5799a1 100644 --- a/panda/src/egg/eggParameters.h +++ b/panda/src/egg/eggParameters.h @@ -17,6 +17,8 @@ #include "pandabase.h" +#include "numeric_types.h" + //////////////////////////////////////////////////////////////////// // Class : EggParameters // Description : The values stored in this structure are global diff --git a/panda/src/egg2pg/eggSaver.h b/panda/src/egg2pg/eggSaver.h index 2cd5064cf4..c565b258af 100755 --- a/panda/src/egg2pg/eggSaver.h +++ b/panda/src/egg2pg/eggSaver.h @@ -18,6 +18,7 @@ #include "pandabase.h" #include "luse.h" +#include "eggData.h" #include "eggTextureCollection.h" #include "eggMaterialCollection.h" diff --git a/panda/src/ffmpeg/config_ffmpeg.h b/panda/src/ffmpeg/config_ffmpeg.h index 76527c7f38..85d0c28696 100644 --- a/panda/src/ffmpeg/config_ffmpeg.h +++ b/panda/src/ffmpeg/config_ffmpeg.h @@ -26,6 +26,13 @@ ConfigureDecl(config_ffmpeg, EXPCL_FFMPEG, EXPTP_FFMPEG); NotifyCategoryDecl(ffmpeg, EXPCL_FFMPEG, EXPTP_FFMPEG); +extern ConfigVariableInt ffmpeg_max_readahead_frames; +extern ConfigVariableBool ffmpeg_show_seek_frames; +extern ConfigVariableBool ffmpeg_support_seek; +extern ConfigVariableBool ffmpeg_global_lock; +extern ConfigVariableEnum ffmpeg_thread_priority; +extern ConfigVariableInt ffmpeg_read_buffer_size; + extern EXPCL_FFMPEG void init_libffmpeg(); #endif /* CONFIG_FFMPEG_H */ diff --git a/panda/src/ffmpeg/ffmpegAudio.cxx b/panda/src/ffmpeg/ffmpegAudio.cxx index 3f2c751673..86a69622f9 100644 --- a/panda/src/ffmpeg/ffmpegAudio.cxx +++ b/panda/src/ffmpeg/ffmpegAudio.cxx @@ -12,6 +12,7 @@ // //////////////////////////////////////////////////////////////////// +#include "config_ffmpeg.h" #include "ffmpegAudio.h" #include "ffmpegAudioCursor.h" #include "dcast.h" diff --git a/panda/src/ffmpeg/ffmpegAudioCursor.cxx b/panda/src/ffmpeg/ffmpegAudioCursor.cxx index 7269209763..5cddb016c8 100644 --- a/panda/src/ffmpeg/ffmpegAudioCursor.cxx +++ b/panda/src/ffmpeg/ffmpegAudioCursor.cxx @@ -12,6 +12,7 @@ // //////////////////////////////////////////////////////////////////// +#include "config_ffmpeg.h" #include "ffmpegAudioCursor.h" #include "ffmpegAudio.h" diff --git a/panda/src/ffmpeg/ffmpegVideo.cxx b/panda/src/ffmpeg/ffmpegVideo.cxx index 2c35ce5658..c7756c435d 100644 --- a/panda/src/ffmpeg/ffmpegVideo.cxx +++ b/panda/src/ffmpeg/ffmpegVideo.cxx @@ -14,7 +14,7 @@ #include "ffmpegVideo.h" #include "ffmpegVideoCursor.h" -#include "config_movies.h" +#include "config_ffmpeg.h" #include "bamReader.h" #include "dcast.h" diff --git a/panda/src/ffmpeg/ffmpegVideoCursor.cxx b/panda/src/ffmpeg/ffmpegVideoCursor.cxx index 221987ae8e..a02dac184b 100644 --- a/panda/src/ffmpeg/ffmpegVideoCursor.cxx +++ b/panda/src/ffmpeg/ffmpegVideoCursor.cxx @@ -13,7 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "ffmpegVideoCursor.h" -#include "config_movies.h" +#include "config_ffmpeg.h" #include "pStatCollector.h" #include "pStatTimer.h" #include "mutexHolder.h" diff --git a/panda/src/ffmpeg/ffmpegVirtualFile.cxx b/panda/src/ffmpeg/ffmpegVirtualFile.cxx index 8b459384a2..5d0affbfcd 100644 --- a/panda/src/ffmpeg/ffmpegVirtualFile.cxx +++ b/panda/src/ffmpeg/ffmpegVirtualFile.cxx @@ -14,7 +14,7 @@ #include "pandabase.h" -#include "config_movies.h" +#include "config_ffmpeg.h" #include "ffmpegVirtualFile.h" #include "virtualFileSystem.h" diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx index 86d07499d0..90891fe0c1 100644 --- a/panda/src/gobj/geomPrimitive.cxx +++ b/panda/src/gobj/geomPrimitive.cxx @@ -14,6 +14,7 @@ #include "geomPrimitive.h" #include "geom.h" +#include "geomPatches.h" #include "geomVertexData.h" #include "geomVertexArrayFormat.h" #include "geomVertexColumn.h" diff --git a/panda/src/gobj/shader.h b/panda/src/gobj/shader.h index 04ae46ffc2..7ecf2efb07 100755 --- a/panda/src/gobj/shader.h +++ b/panda/src/gobj/shader.h @@ -21,6 +21,7 @@ #include "namable.h" #include "graphicsStateGuardianBase.h" #include "internalName.h" +#include "pta_int.h" #include "pta_float.h" #include "pta_double.h" #include "pta_stdfloat.h" diff --git a/panda/src/movies/movieTypeRegistry.cxx b/panda/src/movies/movieTypeRegistry.cxx index 751b6c5e6e..f9efd97b88 100644 --- a/panda/src/movies/movieTypeRegistry.cxx +++ b/panda/src/movies/movieTypeRegistry.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "movieTypeRegistry.h" +#include "string_utils.h" #include "config_movies.h" #include "config_util.h" #include "load_dso.h" diff --git a/panda/src/movies/wavAudioCursor.cxx b/panda/src/movies/wavAudioCursor.cxx index 4133b2af74..15da3a00c3 100644 --- a/panda/src/movies/wavAudioCursor.cxx +++ b/panda/src/movies/wavAudioCursor.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "wavAudioCursor.h" +#include "config_movies.h" #include "virtualFileSystem.h" // Tables for decompressing mu-law and A-law wav files. diff --git a/panda/src/movies/wavAudioCursor.h b/panda/src/movies/wavAudioCursor.h index f8d220160e..e0afd76772 100644 --- a/panda/src/movies/wavAudioCursor.h +++ b/panda/src/movies/wavAudioCursor.h @@ -19,7 +19,7 @@ #include "movieAudioCursor.h" #include "streamReader.h" -class WavAudio; +#include "wavAudio.h" //////////////////////////////////////////////////////////////////// // Class : WavAudioCursor diff --git a/panda/src/nativenet/socket_tcp_listen.h b/panda/src/nativenet/socket_tcp_listen.h index 5b9f48ab32..070493ed5e 100755 --- a/panda/src/nativenet/socket_tcp_listen.h +++ b/panda/src/nativenet/socket_tcp_listen.h @@ -3,6 +3,7 @@ #include "pandabase.h" #include "socket_ip.h" +#include "socket_tcp.h" ///////////////////////////////////////////////////////////////////// // Class : Socket_TCP_Listen diff --git a/panda/src/nativenet/socket_tcp_ssl.h b/panda/src/nativenet/socket_tcp_ssl.h index eed8379db5..6845e1a383 100755 --- a/panda/src/nativenet/socket_tcp_ssl.h +++ b/panda/src/nativenet/socket_tcp_ssl.h @@ -2,6 +2,7 @@ #define __SOCKET_TCP_SSL_H__ #include "pandabase.h" +#include "config_nativenet.h" #include "socket_ip.h" #include "numeric_types.h" diff --git a/panda/src/nativenet/socket_udp_outgoing.h b/panda/src/nativenet/socket_udp_outgoing.h index 75fba03eb8..d804a79d7a 100755 --- a/panda/src/nativenet/socket_udp_outgoing.h +++ b/panda/src/nativenet/socket_udp_outgoing.h @@ -1,6 +1,9 @@ #ifndef __SOCKET_UDP_OUTGOING_H__ #define __SOCKET_UDP_OUTGOING_H__ +#include "config_nativenet.h" +#include "socket_ip.h" + ///////////////////////////////////////////////////////////////////// // Class : Socket_UDP_Outgoing // diff --git a/panda/src/net/connectionListener.cxx b/panda/src/net/connectionListener.cxx index b4059ecb71..08ea7d4d17 100644 --- a/panda/src/net/connectionListener.cxx +++ b/panda/src/net/connectionListener.cxx @@ -12,6 +12,7 @@ // //////////////////////////////////////////////////////////////////// +#include "dcast.h" #include "connectionListener.h" #include "connection.h" #include "connectionManager.h" diff --git a/panda/src/net/connectionManager.cxx b/panda/src/net/connectionManager.cxx index fd4d63a169..56d1b1f881 100644 --- a/panda/src/net/connectionManager.cxx +++ b/panda/src/net/connectionManager.cxx @@ -18,6 +18,8 @@ #include "connectionWriter.h" #include "netAddress.h" #include "config_net.h" +#include "socket_udp.h" +#include "socket_tcp_listen.h" #include "lightMutexHolder.h" #include "trueClock.h" diff --git a/panda/src/net/connectionReader.cxx b/panda/src/net/connectionReader.cxx index 1d277403cc..e0a8b35fa7 100644 --- a/panda/src/net/connectionReader.cxx +++ b/panda/src/net/connectionReader.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "connectionReader.h" +#include "dcast.h" #include "connectionManager.h" #include "netDatagram.h" #include "datagramTCPHeader.h" diff --git a/panda/src/net/datagramGeneratorNet.h b/panda/src/net/datagramGeneratorNet.h index 1709ebab67..b26be45ff1 100644 --- a/panda/src/net/datagramGeneratorNet.h +++ b/panda/src/net/datagramGeneratorNet.h @@ -22,6 +22,7 @@ #include "queuedReturn.h" #include "pmutex.h" #include "conditionVar.h" +#include "netDatagram.h" EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_NET, EXPTP_PANDA_NET, QueuedReturn); diff --git a/panda/src/ode/odeBody.cxx b/panda/src/ode/odeBody.cxx index cbb35977ae..377ffe152a 100755 --- a/panda/src/ode/odeBody.cxx +++ b/panda/src/ode/odeBody.cxx @@ -14,6 +14,7 @@ #include "config_ode.h" #include "odeBody.h" +#include "odeJoint.h" TypeHandle OdeBody::_type_handle; diff --git a/panda/src/ode/odeGeom.cxx b/panda/src/ode/odeGeom.cxx index f7a539c1c5..ea538178d2 100755 --- a/panda/src/ode/odeGeom.cxx +++ b/panda/src/ode/odeGeom.cxx @@ -14,6 +14,18 @@ #include "config_ode.h" #include "odeGeom.h" +#include "odeSimpleSpace.h" +#include "odeQuadTreeSpace.h" +#include "odeHashSpace.h" + +#include "odeTriMeshGeom.h" +#include "odeTriMeshData.h" +#include "odeBoxGeom.h" +#include "odeCappedCylinderGeom.h" +#include "odeCylinderGeom.h" +#include "odePlaneGeom.h" +#include "odeRayGeom.h" +#include "odeSphereGeom.h" //OdeGeom::GeomSurfaceMap OdeGeom::_geom_surface_map; //OdeGeom::GeomCollideIdMap OdeGeom::_geom_collide_id_map; diff --git a/panda/src/ode/odeJoint.cxx b/panda/src/ode/odeJoint.cxx index 8aa287e30a..6d12fa3b13 100755 --- a/panda/src/ode/odeJoint.cxx +++ b/panda/src/ode/odeJoint.cxx @@ -14,6 +14,18 @@ #include "config_ode.h" #include "odeJoint.h" +#include "odeBallJoint.h" +#include "odeHingeJoint.h" +#include "odeHinge2Joint.h" +#include "odeSliderJoint.h" +#include "odeContactJoint.h" +#include "odeUniversalJoint.h" +#include "odeFixedJoint.h" +#include "odeNullJoint.h" +#include "odePlane2dJoint.h" +#include "odeAMotorJoint.h" +#include "odeLMotorJoint.h" +#include "odeBody.h" TypeHandle OdeJoint::_type_handle; diff --git a/panda/src/ode/odeSpace.cxx b/panda/src/ode/odeSpace.cxx index e98086c711..1fd4d3fe25 100755 --- a/panda/src/ode/odeSpace.cxx +++ b/panda/src/ode/odeSpace.cxx @@ -14,6 +14,11 @@ #include "config_ode.h" #include "odeSpace.h" +#include "odeGeom.h" +#include "odeCollisionEntry.h" +#include "odeSimpleSpace.h" +#include "odeQuadTreeSpace.h" +#include "odeHashSpace.h" #include "throw_event.h" diff --git a/panda/src/ode/odeWorld.cxx b/panda/src/ode/odeWorld.cxx index e9ef94a72f..b7d76fd5b7 100755 --- a/panda/src/ode/odeWorld.cxx +++ b/panda/src/ode/odeWorld.cxx @@ -14,6 +14,7 @@ #include "config_ode.h" #include "odeWorld.h" +#include "odeBody.h" TypeHandle OdeWorld::_type_handle; diff --git a/panda/src/pgraphnodes/computeNode.h b/panda/src/pgraphnodes/computeNode.h index 1a24b6df7f..d6b835d6ce 100644 --- a/panda/src/pgraphnodes/computeNode.h +++ b/panda/src/pgraphnodes/computeNode.h @@ -18,6 +18,7 @@ #include "pandabase.h" #include "pandaNode.h" #include "callbackObject.h" +#include "callbackNode.h" #include "pointerTo.h" //////////////////////////////////////////////////////////////////// diff --git a/panda/src/pipeline/lightMutexDirect.h b/panda/src/pipeline/lightMutexDirect.h index b145661604..bd2ee35071 100644 --- a/panda/src/pipeline/lightMutexDirect.h +++ b/panda/src/pipeline/lightMutexDirect.h @@ -17,6 +17,7 @@ #include "pandabase.h" #include "mutexImpl.h" +#include "mutexTrueImpl.h" #include "pnotify.h" class Thread; diff --git a/panda/src/putil/buttonMap.cxx b/panda/src/putil/buttonMap.cxx index 40f609760c..db88e6df24 100644 --- a/panda/src/putil/buttonMap.cxx +++ b/panda/src/putil/buttonMap.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "buttonMap.h" +#include "indent.h" TypeHandle ButtonMap::_type_handle; From 07760ade84f0e947b54052371ba42a25c1f80d18 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 26 Jul 2014 15:23:12 -0700 Subject: [PATCH 276/744] movies: Move wavAudio.h include from wavAudioCursor.h to .cxx, per rdb's suggestion. --- panda/src/movies/wavAudioCursor.cxx | 1 + panda/src/movies/wavAudioCursor.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/movies/wavAudioCursor.cxx b/panda/src/movies/wavAudioCursor.cxx index 15da3a00c3..ec5dca3178 100644 --- a/panda/src/movies/wavAudioCursor.cxx +++ b/panda/src/movies/wavAudioCursor.cxx @@ -15,6 +15,7 @@ #include "wavAudioCursor.h" #include "config_movies.h" #include "virtualFileSystem.h" +#include "wavAudio.h" // Tables for decompressing mu-law and A-law wav files. static PN_int16 mulaw_table[256] = { diff --git a/panda/src/movies/wavAudioCursor.h b/panda/src/movies/wavAudioCursor.h index e0afd76772..f8d220160e 100644 --- a/panda/src/movies/wavAudioCursor.h +++ b/panda/src/movies/wavAudioCursor.h @@ -19,7 +19,7 @@ #include "movieAudioCursor.h" #include "streamReader.h" -#include "wavAudio.h" +class WavAudio; //////////////////////////////////////////////////////////////////// // Class : WavAudioCursor From 1fa1eb63cbb9ab966d2142f43838b1bd176f13d0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 2 Aug 2014 20:26:15 -0700 Subject: [PATCH 277/744] CMake: Don't use target_include_directories, it's not supported on CMake 2.8.4. --- cmake/macros/PackageConfig.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 31a64d92e4..478cae0d61 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -127,7 +127,9 @@ macro(target_use_packages target) foreach(lib ${libs}) if(HAVE_${lib}) - target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") + # N.B. target_include_directories is new in CMake 2.8.11; we target 2.8.4. + #target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") + include_directories("${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") if(_${lib}_LIBRARIES) target_link_libraries("${target}" ${_${lib}_LIBRARIES}) else() From de8eb894b75246934de2139a283505a44b281462 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 22 Sep 2014 21:40:53 -0700 Subject: [PATCH 278/744] CMake: Update CMakeLists files to match recent changes to Sources.pp files. --- dtool/src/cppparser/CMakeLists.txt | 4 ++-- dtool/src/dtoolbase/CMakeLists.txt | 3 ++- dtool/src/dtoolutil/CMakeLists.txt | 2 ++ panda/src/gsgbase/CMakeLists.txt | 2 +- panda/src/linmath/CMakeLists.txt | 2 +- panda/src/putil/CMakeLists.txt | 2 -- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 9e1f20a186..020c72c817 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3CPPPARSER_HEADERS cppExpressionParser.h cppExtensionType.h cppFile.h cppFunctionGroup.h cppFunctionType.h cppGlobals.h cppIdentifier.h cppInstance.h cppInstanceIdentifier.h - cppMakeSeq.h cppManifest.h + cppMakeProperty.h cppMakeSeq.h cppManifest.h cppNameComponent.h cppNamespace.h cppParameterList.h cppParser.h cppPointerType.h cppPreprocessor.h cppReferenceType.h cppScope.h @@ -25,7 +25,7 @@ set(P3CPPPARSER_SOURCES cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx cppInstance.cxx cppInstanceIdentifier.cxx - cppMakeSeq.cxx cppManifest.cxx + cppMakeProperty.cxx cppMakeSeq.cxx cppManifest.cxx cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 9b4ccc020e..53aa3caf3d 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -31,7 +31,8 @@ set(P3DTOOLBASE_HEADERS typeRegistryNode.I typeRegistryNode.h typedObject.I typedObject.h pallocator.T pallocator.h - pdeque.h plist.h pmap.h pset.h pvector.h + pdeque.h plist.h pmap.h pset.h + pvector.h epvector.h lookup3.h ) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index f68db48a5b..c314a635ab 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -16,6 +16,7 @@ set(P3DTOOLUTIL_HEADERS panda_getopt.h panda_getopt_long.h panda_getopt_impl.h pfstream.h pfstream.I pfstreamBuf.h preprocess_argv.h + string_utils.h string_utils.I stringDecoder.h stringDecoder.I textEncoder.h textEncoder.I unicodeLatinMap.h @@ -41,6 +42,7 @@ set(P3DTOOLUTIL_SOURCES panda_getopt_impl.cxx pfstreamBuf.cxx pfstream.cxx preprocess_argv.cxx + string_utils.cxx stringDecoder.cxx textEncoder.cxx unicodeLatinMap.cxx diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 8c5d8cf105..e10fc246e6 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -14,7 +14,7 @@ set(P3GSGBASE_SOURCES composite_sources(p3gsgbase P3GSGBASE_SOURCES) add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) -target_link_libraries(p3gsgbase p3linmath) +target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) install(TARGETS p3gsgbase DESTINATION lib) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index d45048316a..267ea360d3 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -44,7 +44,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) -target_link_libraries(p3linmath p3putil) +target_link_libraries(p3linmath p3express p3pandabase) target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 21beca3703..22b01dbad9 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -53,7 +53,6 @@ set(P3PUTIL_HEADERS pythonCallbackObject.h pythonCallbackObject.I simpleHashMap.I simpleHashMap.h sparseArray.I sparseArray.h - string_utils.I string_utils.h timedCycle.I timedCycle.h typedWritable.I typedWritable.h typedWritableReferenceCount.I typedWritableReferenceCount.h updateSeq.I updateSeq.h @@ -103,7 +102,6 @@ set(P3PUTIL_SOURCES pythonCallbackObject.cxx simpleHashMap.cxx sparseArray.cxx - string_utils.cxx timedCycle.cxx typedWritable.cxx typedWritableReferenceCount.cxx updateSeq.cxx uniqueIdAllocator.cxx From 7c876e03aef3731667dd9f2c7cabec64aed1c67d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 11 Oct 2014 18:13:20 -0700 Subject: [PATCH 279/744] CMake: Update CMakeLists for new upstream changes. --- panda/src/display/CMakeLists.txt | 1 + panda/src/gobj/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 2f0004a5ce..b188b51694 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -23,6 +23,7 @@ set(P3DISPLAY_HEADERS lru.h nativeWindowHandle.I nativeWindowHandle.h parasiteBuffer.I parasiteBuffer.h + pStatGPUTimer.I pStatGPUTimer.h windowHandle.I windowHandle.h windowProperties.I windowProperties.h renderBuffer.h diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 2cdb133c77..ec5619ef3d 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -31,6 +31,7 @@ set(P3GOBJ_HEADERS geomVertexWriter.h geomVertexWriter.I indexBufferContext.I indexBufferContext.h internalName.I internalName.h + internalName_ext.h internalName_ext.cxx lens.h lens.I material.I material.h materialPool.I materialPool.h matrixLens.I matrixLens.h @@ -54,6 +55,7 @@ set(P3GOBJ_HEADERS textureReloadRequest.I textureReloadRequest.h textureStage.I textureStage.h textureStagePool.I textureStagePool.h + timerQueryContext.I timerQueryContext.h transformBlend.I transformBlend.h transformBlendTable.I transformBlendTable.h transformTable.I transformTable.h @@ -125,6 +127,7 @@ set(P3GOBJ_SOURCES textureReloadRequest.cxx textureStage.cxx textureStagePool.cxx + timerQueryContext.cxx transformBlend.cxx transformBlendTable.cxx transformTable.cxx From eaa323aa65a8d1befd18b3482921fe0111bd6094 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 11 Oct 2014 20:38:48 -0700 Subject: [PATCH 280/744] display: Migrate the Python window func stuff to an extension. --- makepanda/makepanda.py | 2 + panda/src/display/CMakeLists.txt | 15 ++---- panda/src/display/Sources.pp | 1 + panda/src/display/graphicsWindow.cxx | 48 ------------------ panda/src/display/graphicsWindow.h | 11 +---- panda/src/display/graphicsWindow_ext.cxx | 63 ++++++++++++++++++++++++ panda/src/display/graphicsWindow_ext.h | 42 ++++++++++++++++ 7 files changed, 114 insertions(+), 68 deletions(-) create mode 100644 panda/src/display/graphicsWindow_ext.cxx create mode 100644 panda/src/display/graphicsWindow_ext.h diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index f729f0b355..5eb8b493cb 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -3276,6 +3276,7 @@ if (not RUNTIME): TargetAdd('libp3display.in', opts=['IMOD:panda3d.core', 'ILIB:libp3display', 'SRCDIR:panda/src/display']) TargetAdd('libp3display_igate.obj', input='libp3display.in', opts=["DEPENDENCYONLY"]) TargetAdd('p3display_graphicsStateGuardian_ext.obj', opts=OPTS, input='graphicsStateGuardian_ext.cxx') + TargetAdd('p3display_graphicsWindow_ext.obj', opts=OPTS, input='graphicsWindow_ext.cxx') if RTDIST and GetTarget() == 'darwin': OPTS=['DIR:panda/src/display'] @@ -3551,6 +3552,7 @@ if (not RUNTIME): TargetAdd('libpanda.dll', input='p3gobj_internalName_ext.obj') TargetAdd('libpanda.dll', input='p3pgraph_ext_composite.obj') TargetAdd('libpanda.dll', input='p3display_graphicsStateGuardian_ext.obj') + TargetAdd('libpanda.dll', input='p3display_graphicsWindow_ext.obj') if PkgSkip("FREETYPE")==0: TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj") diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 31027d89ea..79f3d935e9 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -71,19 +71,12 @@ set(P3DISPLAY_SOURCES set(P3DISPLAY_IGATEEXT graphicsStateGuardian_ext.cxx graphicsStateGuardian_ext.h + graphicsWindow_ext.cxx + graphicsWindow_ext.h + pythonGraphicsWindowProc.cxx + pythonGraphicsWindowProc.h ) -if(HAVE_PYTHON) - set(P3DISPLAY_HEADERS - ${P3DISPLAY_HEADERS} - pythonGraphicsWindowProc.h - ) - set(P3DISPLAY_SOURCES - ${P3DISPLAY_SOURCES} - pythonGraphicsWindowProc.cxx - ) -endif() - if(APPLE) set(P3DISPLAY_HEADERS ${P3DISPLAY_HEADERS} diff --git a/panda/src/display/Sources.pp b/panda/src/display/Sources.pp index dfad1153c1..118e87be77 100644 --- a/panda/src/display/Sources.pp +++ b/panda/src/display/Sources.pp @@ -31,6 +31,7 @@ graphicsStateGuardian_ext.cxx graphicsStateGuardian_ext.h \ graphicsThreadingModel.I graphicsThreadingModel.h \ graphicsWindow.I graphicsWindow.h \ + graphicsWindow_ext.cxx graphicsWindow_ext.h \ graphicsWindowInputDevice.I \ graphicsWindowInputDevice.h \ graphicsWindowProc.h \ diff --git a/panda/src/display/graphicsWindow.cxx b/panda/src/display/graphicsWindow.cxx index cd4e3c3e43..caee3ea4ed 100644 --- a/panda/src/display/graphicsWindow.cxx +++ b/panda/src/display/graphicsWindow.cxx @@ -903,54 +903,6 @@ mouse_mode_absolute() { } -#ifdef HAVE_PYTHON - -//////////////////////////////////////////////////////////////////// -// Function: GraphicsWindow::add_custom_event_handler -// Access: Published -// Description: Adds a python event handler to be called -// when a window event occurs. -// -//////////////////////////////////////////////////////////////////// -void GraphicsWindow:: -add_python_event_handler(PyObject* handler, PyObject* name){ - PythonGraphicsWindowProc* pgwp = new PythonGraphicsWindowProc(handler, name); - _python_window_proc_classes.insert(pgwp); - add_window_proc(pgwp); -} - -//////////////////////////////////////////////////////////////////// -// Function: GraphicsWindow::remove_custom_event_handler -// Access: Published -// Description: Removes the specified python event handler. -// -//////////////////////////////////////////////////////////////////// -void GraphicsWindow:: -remove_python_event_handler(PyObject* name){ - list toRemove; - PythonWinProcClasses::iterator iter; - for (iter = _python_window_proc_classes.begin(); iter != _python_window_proc_classes.end(); ++iter) { - PythonGraphicsWindowProc* pgwp = *iter; - if (PyObject_RichCompareBool(pgwp->get_name(), name, Py_EQ) == 1) { - toRemove.push_back(pgwp); - } -#if PY_MAJOR_VERSION < 3 - else if (PyObject_Compare(pgwp->get_name(), name) == 0) { - toRemove.push_back(pgwp); - } -#endif - } - list::iterator iter2; - for (iter2 = toRemove.begin(); iter2 != toRemove.end(); ++iter2) { - PythonGraphicsWindowProc* pgwp = *iter2; - remove_window_proc(pgwp); - _python_window_proc_classes.erase(pgwp); - delete pgwp; - } -} - -#endif // HAVE_PYTHON - //////////////////////////////////////////////////////////////////// // Function: GraphicsWindow::is_touch_event // Access: Published, Virtual diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index 2dfe1c3f60..f30d721075 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -21,9 +21,6 @@ #include "graphicsWindowInputDevice.h" #include "graphicsWindowProc.h" #include "graphicsWindowProcCallbackData.h" -#ifdef HAVE_PYTHON -#include "pythonGraphicsWindowProc.h" -#endif #include "windowProperties.h" #include "mouseData.h" #include "modifierButtons.h" @@ -94,11 +91,6 @@ PUBLISHED: virtual bool move_pointer(int device, int x, int y); virtual void close_ime(); -#ifdef HAVE_PYTHON - void add_python_event_handler(PyObject* handler, PyObject* name); - void remove_python_event_handler(PyObject* name); -#endif - public: // No need to publish these. bool has_button_event(int device) const; @@ -169,7 +161,7 @@ private: bool _unexposed_draw; #ifdef HAVE_PYTHON - typedef pset PythonWinProcClasses; + typedef pset PythonWinProcClasses; PythonWinProcClasses _python_window_proc_classes; #endif @@ -191,6 +183,7 @@ private: static TypeHandle _type_handle; friend class GraphicsEngine; + friend class Extension; }; #include "graphicsWindow.I" diff --git a/panda/src/display/graphicsWindow_ext.cxx b/panda/src/display/graphicsWindow_ext.cxx new file mode 100644 index 0000000000..da7b4d231e --- /dev/null +++ b/panda/src/display/graphicsWindow_ext.cxx @@ -0,0 +1,63 @@ +// Filename: graphicsWindow_ext.cxx +// Created by: CFSworks (11Oct14) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "graphicsWindow_ext.h" + +#ifdef HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: Extension::add_custom_event_handler +// Access: Published +// Description: Adds a python event handler to be called +// when a window event occurs. +// +//////////////////////////////////////////////////////////////////// +void Extension:: +add_python_event_handler(PyObject* handler, PyObject* name){ + PythonGraphicsWindowProc* pgwp = new PythonGraphicsWindowProc(handler, name); + _this->_python_window_proc_classes.insert(pgwp); + _this->add_window_proc(pgwp); +} + +//////////////////////////////////////////////////////////////////// +// Function: Extension::remove_custom_event_handler +// Access: Published +// Description: Removes the specified python event handler. +// +//////////////////////////////////////////////////////////////////// +void Extension:: +remove_python_event_handler(PyObject* name){ + list toRemove; + GraphicsWindow::PythonWinProcClasses::iterator iter; + for (iter = _this->_python_window_proc_classes.begin(); iter != _this->_python_window_proc_classes.end(); ++iter) { + PythonGraphicsWindowProc* pgwp = (PythonGraphicsWindowProc*)*iter; + if (PyObject_RichCompareBool(pgwp->get_name(), name, Py_EQ) == 1) { + toRemove.push_back(pgwp); + } +#if PY_MAJOR_VERSION < 3 + else if (PyObject_Compare(pgwp->get_name(), name) == 0) { + toRemove.push_back(pgwp); + } +#endif + } + list::iterator iter2; + for (iter2 = toRemove.begin(); iter2 != toRemove.end(); ++iter2) { + PythonGraphicsWindowProc* pgwp = *iter2; + _this->remove_window_proc(pgwp); + _this->_python_window_proc_classes.erase(pgwp); + delete pgwp; + } +} + +#endif // HAVE_PYTHON diff --git a/panda/src/display/graphicsWindow_ext.h b/panda/src/display/graphicsWindow_ext.h new file mode 100644 index 0000000000..c96ce3c445 --- /dev/null +++ b/panda/src/display/graphicsWindow_ext.h @@ -0,0 +1,42 @@ +// Filename: renderState_ext.h +// Created by: CFSworks (11Oct14) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef GRAPHICSWINDOW_EXT_H +#define GRAPHICSWINDOW_EXT_H + +#include "dtoolbase.h" + +#ifdef HAVE_PYTHON + +#include "extension.h" +#include "graphicsWindow.h" +#include "pythonGraphicsWindowProc.h" +#include "py_panda.h" + +//////////////////////////////////////////////////////////////////// +// Class : Extension +// Description : This class defines the extension methods for +// GraphicsWindow, which are called instead of +// any C++ methods with the same prototype. +//////////////////////////////////////////////////////////////////// +template<> +class Extension : public ExtensionBase { +public: + void add_python_event_handler(PyObject* handler, PyObject* name); + void remove_python_event_handler(PyObject* name); +}; + +#endif // HAVE_PYTHON + +#endif // GRAPHICSWINDOW_EXT_H From 52dc814a3bdcf9a973d0593098ce5e6d814100b5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 11 Oct 2014 20:45:16 -0700 Subject: [PATCH 281/744] interrogate: Isolate out remaining Python objects from the Panda3D core libraries to the Interrogate extensions. --- panda/src/display/config_display.cxx | 6 ------ panda/src/display/pythonGraphicsWindowProc.cxx | 5 +++++ panda/src/event/CMakeLists.txt | 10 +++++++--- panda/src/event/config_event.cxx | 4 ---- panda/src/event/pythonTask.cxx | 5 +++++ panda/src/putil/CMakeLists.txt | 5 +++-- panda/src/putil/config_util.cxx | 4 ---- panda/src/putil/pythonCallbackObject.cxx | 5 +++++ 8 files changed, 25 insertions(+), 19 deletions(-) diff --git a/panda/src/display/config_display.cxx b/panda/src/display/config_display.cxx index 6cfa88dec8..012a323317 100644 --- a/panda/src/display/config_display.cxx +++ b/panda/src/display/config_display.cxx @@ -24,9 +24,6 @@ #include "graphicsBuffer.h" #include "graphicsWindow.h" #include "graphicsDevice.h" -#ifdef HAVE_PYTHON -#include "pythonGraphicsWindowProc.h" -#endif #include "graphicsWindowProcCallbackData.h" #include "nativeWindowHandle.h" #include "parasiteBuffer.h" @@ -493,9 +490,6 @@ init_libdisplay() { GraphicsPipe::init_type(); GraphicsStateGuardian::init_type(); GraphicsWindow::init_type(); -#ifdef HAVE_PYTHON - PythonGraphicsWindowProc::init_type(); -#endif GraphicsWindowProcCallbackData::init_type(); NativeWindowHandle::init_type(); ParasiteBuffer::init_type(); diff --git a/panda/src/display/pythonGraphicsWindowProc.cxx b/panda/src/display/pythonGraphicsWindowProc.cxx index 0037641a50..2a9ad1dff2 100644 --- a/panda/src/display/pythonGraphicsWindowProc.cxx +++ b/panda/src/display/pythonGraphicsWindowProc.cxx @@ -15,6 +15,11 @@ #include "pythonGraphicsWindowProc.h" #include "graphicsWindowProcCallbackData.h" +ConfigureDef(config_pythonGraphicsWindowProc); +ConfigureFn(config_pythonGraphicsWindowProc) { + PythonGraphicsWindowProc::init_type(); +} + TypeHandle PythonGraphicsWindowProc::_type_handle; //////////////////////////////////////////////////////////////////// diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index d3cc6dff51..b2976a4136 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -11,7 +11,6 @@ set(P3EVENT_HEADERS genericAsyncTask.h genericAsyncTask.I pointerEvent.I pointerEvent.h pointerEventList.I pointerEventList.h - pythonTask.h pythonTask.I event.I event.h eventHandler.h eventHandler.I eventParameter.I eventParameter.h eventQueue.I eventQueue.h eventReceiver.h @@ -30,16 +29,21 @@ set(P3EVENT_SOURCES genericAsyncTask.cxx pointerEvent.cxx pointerEventList.cxx - pythonTask.cxx config_event.cxx event.cxx eventHandler.cxx eventParameter.cxx eventQueue.cxx eventReceiver.cxx pt_Event.cxx ) +set(P3EVENT_IGATEEXT + pythonTask.cxx + pythonTask.h + pythonTask.I +) + composite_sources(p3event P3EVENT_SOURCES) add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) -target_interrogate(p3event ALL) +target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) install(TARGETS p3event DESTINATION lib) diff --git a/panda/src/event/config_event.cxx b/panda/src/event/config_event.cxx index 1b241f462d..9f6ef94d35 100644 --- a/panda/src/event/config_event.cxx +++ b/panda/src/event/config_event.cxx @@ -24,7 +24,6 @@ #include "eventParameter.h" #include "genericAsyncTask.h" #include "pointerEventList.h" -#include "pythonTask.h" #include "dconfig.h" @@ -49,9 +48,6 @@ ConfigureFn(config_event) { EventStoreWstring::init_type("EventStoreWstring"); EventStoreTypedRefCount::init_type(); GenericAsyncTask::init_type(); -#ifdef HAVE_PYTHON - PythonTask::init_type(); -#endif ButtonEventList::register_with_read_factory(); EventStoreInt::register_with_read_factory(); diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index 4ae81b5a1a..a51601edea 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -19,6 +19,11 @@ #ifdef HAVE_PYTHON #include "py_panda.h" +ConfigureDef(config_pythonTask); +ConfigureFn(config_pythonTask) { + PythonTask::init_type(); +} + TypeHandle PythonTask::_type_handle; #ifndef CPPPARSER diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 149fc79840..c2701ba7ef 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -50,7 +50,6 @@ set(P3PUTIL_HEADERS pbitops.I pbitops.h portalMask.h pta_ushort.h - pythonCallbackObject.h pythonCallbackObject.I simpleHashMap.I simpleHashMap.h sparseArray.I sparseArray.h timedCycle.I timedCycle.h typedWritable.I @@ -99,7 +98,6 @@ set(P3PUTIL_SOURCES nodeCachedReferenceCount.cxx pbitops.cxx pta_ushort.cxx - pythonCallbackObject.cxx simpleHashMap.cxx sparseArray.cxx timedCycle.cxx typedWritable.cxx @@ -113,6 +111,9 @@ set(P3PUTIL_SOURCES set(P3PUTIL_IGATEEXT typedWritable_ext.cxx typedWritable_ext.h + pythonCallbackObject.cxx + pythonCallbackObject.h + pythonCallbackObject.I ) composite_sources(p3putil P3PUTIL_SOURCES) diff --git a/panda/src/putil/config_util.cxx b/panda/src/putil/config_util.cxx index 89b71a6b3f..62b16fca3c 100644 --- a/panda/src/putil/config_util.cxx +++ b/panda/src/putil/config_util.cxx @@ -34,7 +34,6 @@ #include "factoryParam.h" #include "namable.h" #include "nodeCachedReferenceCount.h" -#include "pythonCallbackObject.h" #include "referenceCount.h" #include "sparseArray.h" #include "typedObject.h" @@ -200,9 +199,6 @@ init_libputil() { FactoryParam::init_type(); Namable::init_type(); NodeCachedReferenceCount::init_type(); -#ifdef HAVE_PYTHON - PythonCallbackObject::init_type(); -#endif QuadBitMaskNative::init_type(); ReferenceCount::init_type(); SparseArray::init_type(); diff --git a/panda/src/putil/pythonCallbackObject.cxx b/panda/src/putil/pythonCallbackObject.cxx index 1160877901..2651f91fff 100644 --- a/panda/src/putil/pythonCallbackObject.cxx +++ b/panda/src/putil/pythonCallbackObject.cxx @@ -20,6 +20,11 @@ #include "callbackData.h" #include "config_util.h" +ConfigureDef(config_pythonCallbackObject); +ConfigureFn(config_pythonCallbackObject) { + PythonCallbackObject::init_type(); +} + TypeHandle PythonCallbackObject::_type_handle; #ifndef CPPPARSER From 43036db55408386a00d34cbc3d02ba43c75c3947 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Oct 2014 00:57:23 -0700 Subject: [PATCH 282/744] cmake: Bring cocoadisplay back up to parity with ppremake. --- panda/src/cocoadisplay/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 82c5539d72..ce855a82c4 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -4,13 +4,14 @@ if(APPLE AND HAVE_GL AND HAVE_COCOA) cocoaGraphicsPipe.h cocoaGraphicsPipe.I cocoaGraphicsWindow.h cocoaGraphicsWindow.I cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I - cocoaPandaView.h cocoaPandaWindowDelegate.h) + cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h) set(P3COCOADISPLAY_SOURCES config_cocoadisplay.mm cocoaGraphicsPipe.mm cocoaGraphicsStateGuardian.mm cocoaGraphicsWindow.mm + cocoaPandaApp.mm cocoaPandaView.mm cocoaPandaWindow.mm cocoaPandaWindowDelegate.mm) @@ -22,8 +23,9 @@ if(APPLE AND HAVE_GL AND HAVE_COCOA) # Frameworks: find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) find_library(APPKIT_LIBRARY AppKit) + find_library(CARBON_LIBRARY Carbon) target_link_libraries(p3cocoadisplay - ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY}) + ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) install(TARGETS p3cocoadisplay DESTINATION lib) endif() From 53f5455d4daa2430745487bf75071532a8ffa1ef Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Oct 2014 01:09:18 -0700 Subject: [PATCH 283/744] cocoadisplay: Add missing #import for NSEvent. --- panda/src/cocoadisplay/cocoaPandaApp.h | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/cocoadisplay/cocoaPandaApp.h b/panda/src/cocoadisplay/cocoaPandaApp.h index a15d77a543..ab3aca2d37 100644 --- a/panda/src/cocoadisplay/cocoaPandaApp.h +++ b/panda/src/cocoadisplay/cocoaPandaApp.h @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #import +#import // This class solely exists so that we can override sendEvent in order // to prevent NSApplication from eating certain keyboard events. From d1c6d453ba74d75dcc9d97731609d54d20f1b95d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Oct 2014 01:28:46 -0700 Subject: [PATCH 284/744] CMake: Update pandac.__init__ to match the extensions_native. --- direct/src/pandac/__init__.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/direct/src/pandac/__init__.py b/direct/src/pandac/__init__.py index 4b79eb4dce..cfbd9209a4 100644 --- a/direct/src/pandac/__init__.py +++ b/direct/src/pandac/__init__.py @@ -5,9 +5,7 @@ import __builtin__ # Now import all extensions: from direct.extensions_native.extension_native_helpers import * extensions = [ - 'CInterval', 'EggGroupNode', 'EggPrimitive', 'HTTPChannel', 'Mat3', - 'NodePath', 'NodePathCollection', 'OdeBody', 'OdeGeom', 'OdeJoint', - 'OdeSpace', 'Ramfile', 'StreamReader', 'VBase3', 'VBase4' + 'CInterval', 'HTTPChannel', 'Mat3', 'NodePath', 'VBase3', 'VBase4' ] # Prior to importing, we need to make the Dtool_funcToMethod function and From eaeff009015ea520742eba0f2b7c329046a70e4d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 18 Oct 2014 16:53:13 -0700 Subject: [PATCH 285/744] dtool: Undo a few changes to dtoolbase that aren't strictly necessary, to better parallel upstream. --- dtool/src/cppparser/cppBison.yxx | 2 +- dtool/src/dtoolbase/dlmalloc.h | 6 ------ dtool/src/dtoolbase/dlmalloc_src.cxx | 7 ------- dtool/src/dtoolbase/dtoolbase.h | 18 +++--------------- 4 files changed, 4 insertions(+), 29 deletions(-) diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 29a230245b..238c4f578b 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -195,7 +195,7 @@ pop_struct() { /* This is a bison-specific declaration to enable recursive calls to yyparse(). It changes the calling sequence to yylex(), passing pointers to the current yylval and yylloc. */ -%pure-parser +%pure_parser %token REAL %token INTEGER diff --git a/dtool/src/dtoolbase/dlmalloc.h b/dtool/src/dtoolbase/dlmalloc.h index 9b3d4e628d..1bb3ed8abc 100644 --- a/dtool/src/dtoolbase/dlmalloc.h +++ b/dtool/src/dtoolbase/dlmalloc.h @@ -148,15 +148,9 @@ void* dlvalloc(size_t); */ int dlmallopt(int, int); -#ifndef M_TRIM_THRESHOLD #define M_TRIM_THRESHOLD (-1) -#endif - #define M_GRANULARITY (-2) - -#ifndef M_MMAP_THRESHOLD #define M_MMAP_THRESHOLD (-3) -#endif /* diff --git a/dtool/src/dtoolbase/dlmalloc_src.cxx b/dtool/src/dtoolbase/dlmalloc_src.cxx index 56c901251d..93e843ea75 100644 --- a/dtool/src/dtoolbase/dlmalloc_src.cxx +++ b/dtool/src/dtoolbase/dlmalloc_src.cxx @@ -597,15 +597,9 @@ DEFAULT_MMAP_THRESHOLD default: 256K malloc does support the following options. */ -#ifndef M_TRIM_THRESHOLD #define M_TRIM_THRESHOLD (-1) -#endif - #define M_GRANULARITY (-2) - -#ifndef M_MMAP_THRESHOLD #define M_MMAP_THRESHOLD (-3) -#endif /* ------------------------ Mallinfo declarations ------------------------ */ @@ -1186,7 +1180,6 @@ int mspace_mallopt(int, int); #include #endif /* ABORT_ON_ASSERT_FAILURE */ #else /* DEBUG */ -#undef assert #define assert(x) #endif /* DEBUG */ #ifndef LACKS_STRING_H diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index 92a76c34f4..8dfb7e2127 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -104,21 +104,9 @@ #endif #ifdef HAVE_PYTHON -# undef _POSIX_C_SOURCE -# undef _XOPEN_SOURCE -// Some versions of python also define HAVE_LOCKF -# ifdef HAVE_LOCKF -# define PANDA_HAVE_LOCKF -# undef HAVE_LOCKF -# endif -# include "pyconfig.h" -// Restore our HAVE_LOCKF if python didn't define it -# ifdef PANDA_HAVE_LOCKF -# undef PANDA_HAVE_LOCKF -# ifndef HAVE_LOCKF -# define HAVE_LOCKF 1 -# endif -# endif +#undef _POSIX_C_SOURCE +#undef _XOPEN_SOURCE +#include "pyconfig.h" #endif #ifndef HAVE_EIGEN From 442f58986d6b445c8b16278d89df7c3acde68f8b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 18 Oct 2014 16:08:10 -0700 Subject: [PATCH 286/744] include: Fix a couple more missing includes... --- dtool/src/cppparser/cppMakeProperty.h | 1 + dtool/src/interrogatedb/interrogateElement.cxx | 1 + 2 files changed, 2 insertions(+) diff --git a/dtool/src/cppparser/cppMakeProperty.h b/dtool/src/cppparser/cppMakeProperty.h index 816f9d4958..8fecfc071c 100644 --- a/dtool/src/cppparser/cppMakeProperty.h +++ b/dtool/src/cppparser/cppMakeProperty.h @@ -18,6 +18,7 @@ #include "dtoolbase.h" #include "cppDeclaration.h" +#include "cppIdentifier.h" /////////////////////////////////////////////////////////////////// // Class : CPPMakeProperty diff --git a/dtool/src/interrogatedb/interrogateElement.cxx b/dtool/src/interrogatedb/interrogateElement.cxx index 1c74a208d6..8dff1f4251 100644 --- a/dtool/src/interrogatedb/interrogateElement.cxx +++ b/dtool/src/interrogatedb/interrogateElement.cxx @@ -13,6 +13,7 @@ //////////////////////////////////////////////////////////////////// #include "interrogateElement.h" +#include "interrogateDatabase.h" #include "indexRemapper.h" #include "interrogate_datafile.h" From 1db28bb0c81207aa1ebccf49f2e83f886692259b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 18 Oct 2014 16:43:42 -0700 Subject: [PATCH 287/744] ode: Remove erroneous INLINE declarations. --- panda/src/ode/odeWorld.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/ode/odeWorld.h b/panda/src/ode/odeWorld.h index 7a51ba6d9a..8d7f365cf4 100755 --- a/panda/src/ode/odeWorld.h +++ b/panda/src/ode/odeWorld.h @@ -95,10 +95,10 @@ PUBLISHED: operator bool () const; public: - INLINE sSurfaceParams& get_surface(PN_uint8 surface1, PN_uint8 surface2); - INLINE void set_surface(int pos1, int pos2, sSurfaceParams& entry); - INLINE sBodyParams get_surface_body(dBodyID id); - INLINE void set_dampen_on_bodies(dBodyID id1, dBodyID id2,dReal damp); + sSurfaceParams& get_surface(PN_uint8 surface1, PN_uint8 surface2); + void set_surface(int pos1, int pos2, sSurfaceParams& entry); + sBodyParams get_surface_body(dBodyID id); + void set_dampen_on_bodies(dBodyID id1, dBodyID id2,dReal damp); private: From edd2a45d38248e724248d52329e4bddcab88f2bf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 18 Oct 2014 20:19:16 -0700 Subject: [PATCH 288/744] CMake: Don't test host system's /proc paths for availability on target. This allows better cross-compilation. --- dtool/LocalSetup.cmake | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 0e64a6eeb6..9f5fe2ed1e 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -110,25 +110,15 @@ set(HAVE_IOS_TYPEDEFS 1) # Can we read the file /proc/self/[*] to determine our # environment variables at static init time? -if(EXISTS "/proc/self/exe") +if(IS_LINUX) set(HAVE_PROC_SELF_EXE 1) -endif() -if(EXISTS "/proc/self/maps") set(HAVE_PROC_SELF_MAPS 1) -endif() -if(EXISTS "/proc/self/environ") set(HAVE_PROC_SELF_ENVIRON 1) -endif() -if(EXISTS "/proc/self/cmdline") set(HAVE_PROC_SELF_CMDLINE 1) endif() -if(EXISTS "/proc/curproc/file") +if(IS_FREEBSD) set(HAVE_PROC_CURPROC_FILE 1) -endif() -if(EXISTS "/proc/curproc/map") set(HAVE_PROC_CURPROC_MAP 1) -endif() -if(EXISTS "/proc/curproc/cmdline") set(HAVE_PROC_CURPROC_CMDLINE 1) endif() From e8164d3b063221ecb084726f15cdb1c718891816 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 22 Oct 2014 00:22:11 -0700 Subject: [PATCH 289/744] include: Revert a couple of include changes that are no longer needed since the last upstream merge. --- panda/src/framework/rock_floor.rgb_src.c | 1 - panda/src/framework/shuttle_controls.bam_src.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/panda/src/framework/rock_floor.rgb_src.c b/panda/src/framework/rock_floor.rgb_src.c index bf718765fc..3896731def 100755 --- a/panda/src/framework/rock_floor.rgb_src.c +++ b/panda/src/framework/rock_floor.rgb_src.c @@ -1,4 +1,3 @@ -#include "stddef.h" // size_t /* * This table was generated by the command: diff --git a/panda/src/framework/shuttle_controls.bam_src.c b/panda/src/framework/shuttle_controls.bam_src.c index 38f61c8ec0..a9e14c91ee 100755 --- a/panda/src/framework/shuttle_controls.bam_src.c +++ b/panda/src/framework/shuttle_controls.bam_src.c @@ -1,4 +1,4 @@ -#include "stddef.h" // size_t + /* * This table was generated by the command: * From 9b98df1ef5d2d301490cb9e3e524923c4c5e562e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 11 Feb 2015 10:55:36 -0800 Subject: [PATCH 290/744] CMake: Update for recent changes. --- direct/CMakeLists.txt | 1 - direct/src/autorestart/CMakeLists.txt | 7 ------- panda/CMakeLists.txt | 2 +- panda/src/display/CMakeLists.txt | 2 -- panda/src/event/pythonTask.cxx | 5 ----- panda/src/express/CMakeLists.txt | 1 + panda/src/framework/CMakeLists.txt | 5 ----- panda/src/gobj/CMakeLists.txt | 21 ++++++++++++++++----- panda/src/linmath/CMakeLists.txt | 5 +++-- panda/src/pgraph/CMakeLists.txt | 3 --- panda/src/putil/CMakeLists.txt | 5 +++-- panda/src/putil/pythonCallbackObject.cxx | 5 ----- panda/src/tform/CMakeLists.txt | 6 ++++-- panda/src/windisplay/CMakeLists.txt | 2 +- 14 files changed, 29 insertions(+), 41 deletions(-) delete mode 100644 direct/src/autorestart/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 5843bacf6d..f3debd7d08 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -4,7 +4,6 @@ endif() # Include source directories which have C++ components: add_subdirectory(src/directbase) -add_subdirectory(src/autorestart) add_subdirectory(src/dcparser) add_subdirectory(src/dcparse) add_subdirectory(src/deadrec) diff --git a/direct/src/autorestart/CMakeLists.txt b/direct/src/autorestart/CMakeLists.txt deleted file mode 100644 index 665e9be1c7..0000000000 --- a/direct/src/autorestart/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -if(UNIX) - add_executable(autorestart autorestart.c) - set_target_properties(autorestart PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) - target_link_libraries(autorestart p3dtool) - - install(TARGETS autorestart DESTINATION bin) -endif() diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 96a32262c9..51f821c2c5 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -27,9 +27,9 @@ add_subdirectory(src/downloadertools) add_subdirectory(src/pipeline) add_subdirectory(src/nativenet) add_subdirectory(src/net) +add_subdirectory(src/linmath) add_subdirectory(src/putil) add_subdirectory(src/pstatclient) -add_subdirectory(src/linmath) add_subdirectory(src/event) add_subdirectory(src/mathutil) add_subdirectory(src/gsgbase) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 79f3d935e9..da38641472 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -27,7 +27,6 @@ set(P3DISPLAY_HEADERS windowHandle.I windowHandle.h windowProperties.I windowProperties.h renderBuffer.h - stencilRenderStates.h stereoDisplayRegion.I stereoDisplayRegion.h displaySearchParameters.h displayInformation.h @@ -62,7 +61,6 @@ set(P3DISPLAY_SOURCES parasiteBuffer.cxx windowHandle.cxx windowProperties.cxx - stencilRenderStates.cxx stereoDisplayRegion.cxx subprocessWindow.cxx touchInfo.cxx diff --git a/panda/src/event/pythonTask.cxx b/panda/src/event/pythonTask.cxx index eb49a6cfed..53be111dfa 100644 --- a/panda/src/event/pythonTask.cxx +++ b/panda/src/event/pythonTask.cxx @@ -19,11 +19,6 @@ #ifdef HAVE_PYTHON #include "py_panda.h" -ConfigureDef(config_pythonTask); -ConfigureFn(config_pythonTask) { - PythonTask::init_type(); -} - TypeHandle PythonTask::_type_handle; Configure(config_pythonTask); diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index cfa57d0712..3ff0a29374 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -125,6 +125,7 @@ set(P3EXPRESS_SOURCES set(P3EXPRESS_IGATEEXT memoryUsagePointers_ext.cxx memoryUsagePointers_ext.h + pointerToArray_ext.h ramfile_ext.cxx ramfile_ext.h streamReader_ext.cxx diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 75ececfec9..cf74d523d9 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -30,11 +30,6 @@ if(NOT BUILD_SHARED_LIBS) ${P3FRAMEWORK_LINK_TARGETS} pandadx9 ) - elseif(HAVE_DX8) - set(P3FRAMEWORK_LINK_TARGETS - ${P3FRAMEWORK_LINK_TARGETS} - pandadx8 - ) elseif(HAVE_TINYDISPLAY) set(P3FRAMEWORK_LINK_TARGETS ${P3FRAMEWORK_LINK_TARGETS} diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index ec5619ef3d..3ee081e828 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -18,7 +18,6 @@ set(P3GOBJ_HEADERS geomLinestrips.h geomPoints.h geomVertexArrayData.h geomVertexArrayData.I - geomVertexArrayData_ext.h geomVertexArrayData_ext.cxx geomVertexArrayFormat.h geomVertexArrayFormat.I geomCacheEntry.h geomCacheEntry.I geomCacheManager.h geomCacheManager.I @@ -31,13 +30,13 @@ set(P3GOBJ_HEADERS geomVertexWriter.h geomVertexWriter.I indexBufferContext.I indexBufferContext.h internalName.I internalName.h - internalName_ext.h internalName_ext.cxx lens.h lens.I material.I material.h materialPool.I materialPool.h matrixLens.I matrixLens.h occlusionQueryContext.I occlusionQueryContext.h - orthographicLens.I orthographicLens.h perspectiveLens.I - perspectiveLens.h + orthographicLens.I orthographicLens.h + paramTexture.I paramTexture.h + perspectiveLens.I perspectiveLens.h preparedGraphicsObjects.I preparedGraphicsObjects.h queryContext.I queryContext.h savedContext.I savedContext.h @@ -109,9 +108,12 @@ set(P3GOBJ_SOURCES materialPool.cxx matrixLens.cxx occlusionQueryContext.cxx orthographicLens.cxx + paramTexture.cxx perspectiveLens.cxx preparedGraphicsObjects.cxx queryContext.cxx + samplerContext.cxx + samplerState.cxx savedContext.cxx shader.cxx shaderContext.cxx @@ -144,11 +146,20 @@ set(P3GOBJ_SOURCES videoTexture.cxx ) +set(P3GOBJ_IGATEEXT + internalName_ext.cxx + internalName_ext.h + geomVertexArrayData_ext.cxx + geomVertexArrayData_ext.h + textureCollection_ext.cxx + textureCollection_ext.h +) + composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARIES}) -target_interrogate(p3gobj ALL) +target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) install(TARGETS p3gobj DESTINATION lib) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 267ea360d3..f1716de7f8 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -2,6 +2,7 @@ set(P3LINMATH_HEADERS aa_luse.h compose_matrix.h compose_matrix_src.I compose_matrix_src.h config_linmath.h + configVariableColor.h configVariableColor.I coordinateSystem.h dbl2fltnames.h dblnames.h deg_2_rad.h deg_2_rad.I flt2dblnames.h fltnames.h lcast_to.h lcast_to_src.h @@ -34,8 +35,8 @@ set(P3LINMATH_HEADERS ) set(P3LINMATH_SOURCES - compose_matrix.cxx config_linmath.cxx coordinateSystem.cxx - lmatrix.cxx + compose_matrix.cxx config_linmath.cxx configVariableColor.cxx + coordinateSystem.cxx lmatrix.cxx lorientation.cxx lpoint2.cxx lpoint3.cxx lpoint4.cxx lquaternion.cxx lrotation.cxx luse.cxx lvecBase2.cxx lvecBase3.cxx lvecBase4.cxx diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index a067ffbb25..d6e5756012 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -32,7 +32,6 @@ set(P3PGRAPH_HEADERS depthOffsetAttrib.I depthOffsetAttrib.h depthTestAttrib.I depthTestAttrib.h depthWriteAttrib.I depthWriteAttrib.h - eventStorePandaNode.I eventStorePandaNode.h findApproxLevelEntry.I findApproxLevelEntry.h findApproxPath.I findApproxPath.h fog.I fog.h @@ -131,7 +130,6 @@ set(P3PGRAPH_SOURCES depthOffsetAttrib.cxx depthTestAttrib.cxx depthWriteAttrib.cxx - eventStorePandaNode.cxx findApproxLevelEntry.cxx findApproxPath.cxx fog.cxx @@ -199,7 +197,6 @@ set(P3PGRAPH_SOURCES set(P3PGRAPH_IGATEEXT nodePathCollection_ext.cxx nodePathCollection_ext.h - nodePathCollection_ext.I nodePath_ext.cxx nodePath_ext.h nodePath_ext.I diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index c2701ba7ef..d7143ccd18 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -47,6 +47,7 @@ set(P3PUTIL_HEADERS modifierButtons.I modifierButtons.h mouseButton.h mouseData.I mouseData.h nameUniquifier.I nameUniquifier.h nodeCachedReferenceCount.h nodeCachedReferenceCount.I + paramValue.I paramValue.h pbitops.I pbitops.h portalMask.h pta_ushort.h @@ -96,6 +97,7 @@ set(P3PUTIL_SOURCES modifierButtons.cxx mouseButton.cxx mouseData.cxx nameUniquifier.cxx nodeCachedReferenceCount.cxx + paramValue.cxx pbitops.cxx pta_ushort.cxx simpleHashMap.cxx @@ -113,12 +115,11 @@ set(P3PUTIL_IGATEEXT typedWritable_ext.h pythonCallbackObject.cxx pythonCallbackObject.h - pythonCallbackObject.I ) composite_sources(p3putil P3PUTIL_SOURCES) add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) -target_link_libraries(p3putil p3pipeline) +target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) install(TARGETS p3putil DESTINATION lib) diff --git a/panda/src/putil/pythonCallbackObject.cxx b/panda/src/putil/pythonCallbackObject.cxx index 32a24d3f1f..48b0bbbbe3 100644 --- a/panda/src/putil/pythonCallbackObject.cxx +++ b/panda/src/putil/pythonCallbackObject.cxx @@ -21,11 +21,6 @@ #include "callbackData.h" #include "config_util.h" -ConfigureDef(config_pythonCallbackObject); -ConfigureFn(config_pythonCallbackObject) { - PythonCallbackObject::init_type(); -} - TypeHandle PythonCallbackObject::_type_handle; Configure(config_pythonCallbackObject); diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index a814cb415c..bc83ac1088 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -5,7 +5,7 @@ set(P3TFORM_HEADERS mouseInterfaceNode.I mouseInterfaceNode.h mouseSubregion.I mouseSubregion.h mouseWatcher.I mouseWatcher.h - mouseWatcherGroup.h + mouseWatcherBase.h mouseWatcherGroup.h mouseWatcherParameter.I mouseWatcherParameter.h mouseWatcherRegion.I mouseWatcherRegion.h trackball.h @@ -18,8 +18,10 @@ set(P3TFORM_SOURCES mouseInterfaceNode.cxx mouseSubregion.cxx mouseWatcher.cxx + mouseWatcherBase.cxx mouseWatcherGroup.cxx - mouseWatcherParameter.cxx mouseWatcherRegion.cxx + mouseWatcherParameter.cxx + mouseWatcherRegion.cxx trackball.cxx transform2sg.cxx ) diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index 3d07b6f9a9..b7290c8bc6 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -8,7 +8,7 @@ if(WIN32) set(P3WINDISPLAY_SOURCES config_windisplay.cxx winGraphicsPipe.cxx winGraphicsWindow.cxx - winDetectDx9.cxx winDetectDx8.cxx) + winDetectDx9.cxx) composite_sources(p3windisplay P3WINDISPLAY_SOURCES) add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) From edb51f3e17731648b2918e4fd242641824fca1ad Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 6 Mar 2015 17:34:05 -0800 Subject: [PATCH 291/744] CMake: Update for recent upstream changes. --- panda/src/pgraph/CMakeLists.txt | 2 ++ panda/src/pnmimage/CMakeLists.txt | 5 ++++- panda/src/putil/CMakeLists.txt | 5 +++-- panda/src/putil/callbackObject_ext.h | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index d6e5756012..4c5f7fed5f 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -64,6 +64,7 @@ set(P3PGRAPH_HEADERS pandaNode.I pandaNode.h pandaNodeChain.I pandaNodeChain.h planeNode.I planeNode.h + paramNodePath.I paramNodePath.h polylightEffect.I polylightEffect.h polylightNode.I polylightNode.h portalNode.I portalNode.h @@ -161,6 +162,7 @@ set(P3PGRAPH_SOURCES pandaNode.cxx pandaNodeChain.cxx planeNode.cxx + paramNodePath.cxx polylightEffect.cxx polylightNode.cxx portalNode.cxx diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index d6fe2c0d4e..3372d009f1 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -13,6 +13,7 @@ set(P3PNMIMAGE_HEADERS set(P3PNMIMAGE_SOURCES config_pnmimage.cxx + convert_srgb.cxx pfmFile.cxx pnm-image-filter.cxx pnmbitio.cxx @@ -29,8 +30,10 @@ set(P3PNMIMAGE_IGATEEXT pfmFile_ext.h ) +set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES COMPILE_FLAGS -msse2) + composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) -add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) +add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index d7143ccd18..2026cc1d4f 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -111,10 +111,11 @@ set(P3PUTIL_SOURCES ) set(P3PUTIL_IGATEEXT - typedWritable_ext.cxx - typedWritable_ext.h + callbackObject_ext.h pythonCallbackObject.cxx pythonCallbackObject.h + typedWritable_ext.cxx + typedWritable_ext.h ) composite_sources(p3putil P3PUTIL_SOURCES) diff --git a/panda/src/putil/callbackObject_ext.h b/panda/src/putil/callbackObject_ext.h index 1e0ceac72f..0ecc0e0e76 100644 --- a/panda/src/putil/callbackObject_ext.h +++ b/panda/src/putil/callbackObject_ext.h @@ -16,6 +16,7 @@ #define CALLBACKOBJECT_EXT_H #include "dtoolbase.h" +#include "pointerTo.h" #ifdef HAVE_PYTHON From a0f704b67aad52e8be651c2c35e4657570f8e17f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 28 Mar 2015 11:16:19 -0700 Subject: [PATCH 292/744] CMake: Update CMakeLists for recent upstream changes. --- dtool/src/cppparser/CMakeLists.txt | 4 +- dtool/src/dtoolutil/CMakeLists.txt | 77 ++++++++++++++++-------------- panda/src/express/CMakeLists.txt | 6 +++ panda/src/putil/CMakeLists.txt | 7 +-- 4 files changed, 52 insertions(+), 42 deletions(-) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 020c72c817..80d5bdcfff 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -14,7 +14,7 @@ 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 cppTypedefType.h cppUsing.h cppVisibility.h ) set(P3CPPPARSER_SOURCES @@ -32,7 +32,7 @@ set(P3CPPPARSER_SOURCES cppStructType.cxx cppTBDType.cxx cppTemplateParameterList.cxx cppTemplateScope.cxx cppToken.cxx cppType.cxx cppTypeDeclaration.cxx - cppTypeParser.cxx cppTypeProxy.cxx cppTypedef.cxx + cppTypeParser.cxx cppTypeProxy.cxx cppTypedefType.cxx cppUsing.cxx cppVisibility.cxx ) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index c314a635ab..bcfa1c04a2 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -3,51 +3,54 @@ configure_file(checkPandaVersion.h.in checkPandaVersion.h) configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) set(P3DTOOLUTIL_HEADERS - ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h - config_dtoolutil.h - dSearchPath.I dSearchPath.h - executionEnvironment.I executionEnvironment.h filename.I - filename.h - globPattern.I globPattern.h - load_dso.h - pandaFileStream.h pandaFileStream.I - pandaFileStreamBuf.h - pandaSystem.h pandaVersion.h - panda_getopt.h panda_getopt_long.h panda_getopt_impl.h - pfstream.h pfstream.I pfstreamBuf.h - preprocess_argv.h + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h + config_dtoolutil.h + dSearchPath.I dSearchPath.h + executionEnvironment.I executionEnvironment.h filename.I + filename.h + globPattern.I globPattern.h + lineStream.I lineStream.h + lineStreamBuf.I lineStreamBuf.h + load_dso.h + pandaFileStream.h pandaFileStream.I + pandaFileStreamBuf.h + pandaSystem.h pandaVersion.h + panda_getopt.h panda_getopt_long.h panda_getopt_impl.h + pfstream.h pfstream.I pfstreamBuf.h + preprocess_argv.h string_utils.h string_utils.I - stringDecoder.h stringDecoder.I - textEncoder.h textEncoder.I - unicodeLatinMap.h - vector_string.h - vector_src.h - win32ArgParser.h + stringDecoder.h stringDecoder.I + textEncoder.h textEncoder.I + unicodeLatinMap.h + vector_string.h + vector_src.h + win32ArgParser.h ) if(APPLE) - set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} - filename_assist.mm filename_assist.h) + set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} + filename_assist.mm filename_assist.h) endif() set(P3DTOOLUTIL_SOURCES - ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx - config_dtoolutil.cxx - dSearchPath.cxx - executionEnvironment.cxx filename.cxx - globPattern.cxx - load_dso.cxx - pandaFileStream.cxx pandaFileStreamBuf.cxx - pandaSystem.cxx - panda_getopt_impl.cxx - pfstreamBuf.cxx pfstream.cxx - preprocess_argv.cxx + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx + config_dtoolutil.cxx + dSearchPath.cxx + executionEnvironment.cxx filename.cxx + globPattern.cxx + lineStream.cxx lineStreamBuf.cxx + load_dso.cxx + pandaFileStream.cxx pandaFileStreamBuf.cxx + pandaSystem.cxx + panda_getopt_impl.cxx + pfstreamBuf.cxx pfstream.cxx + preprocess_argv.cxx string_utils.cxx - stringDecoder.cxx - textEncoder.cxx - unicodeLatinMap.cxx - vector_string.cxx - win32ArgParser.cxx + stringDecoder.cxx + textEncoder.cxx + unicodeLatinMap.cxx + vector_string.cxx + win32ArgParser.cxx ) composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 3ff0a29374..e5e77eee9b 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -123,6 +123,10 @@ set(P3EXPRESS_SOURCES zStream.cxx zStreamBuf.cxx) set(P3EXPRESS_IGATEEXT + filename_ext.cxx + filename_ext.h + globPattern_ext.cxx + globPattern_ext.h memoryUsagePointers_ext.cxx memoryUsagePointers_ext.h pointerToArray_ext.h @@ -130,6 +134,8 @@ set(P3EXPRESS_IGATEEXT ramfile_ext.h streamReader_ext.cxx streamReader_ext.h + typeHandle_ext.cxx + typeHandle_ext.h virtualFileSystem_ext.cxx virtualFileSystem_ext.h) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 2026cc1d4f..5dfa232549 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -19,6 +19,7 @@ set(P3PUTIL_HEADERS callbackObject.h callbackObject.I clockObject.h clockObject.I collideMask.h + colorSpace.h copyOnWriteObject.h copyOnWriteObject.I copyOnWritePointer.h copyOnWritePointer.I compareTo.I compareTo.h @@ -39,8 +40,7 @@ set(P3PUTIL_HEADERS indirectCompareSort.I indirectCompareSort.h indirectCompareTo.I indirectCompareTo.h ioPtaDatagramFloat.h ioPtaDatagramInt.h - ioPtaDatagramShort.h keyboardButton.h lineStream.I - lineStream.h lineStreamBuf.I lineStreamBuf.h + ioPtaDatagramShort.h keyboardButton.h linkedListNode.I linkedListNode.h load_prc_file.h loaderOptions.I loaderOptions.h @@ -79,6 +79,7 @@ set(P3PUTIL_SOURCES callbackData.cxx callbackObject.cxx clockObject.cxx + colorSpace.cxx copyOnWriteObject.cxx copyOnWritePointer.cxx config_util.cxx configurable.cxx @@ -90,7 +91,7 @@ set(P3PUTIL_SOURCES globalPointerRegistry.cxx ioPtaDatagramFloat.cxx ioPtaDatagramInt.cxx ioPtaDatagramShort.cxx - keyboardButton.cxx lineStream.cxx lineStreamBuf.cxx + keyboardButton.cxx linkedListNode.cxx load_prc_file.cxx loaderOptions.cxx From 41d8e26549be7ad67fda3c009146115a9c561fa9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 28 Mar 2015 11:16:40 -0700 Subject: [PATCH 293/744] general: Add missing includes and forward-declarations. --- dtool/src/cppparser/cppTypedefType.h | 1 + dtool/src/interrogate/functionRemap.cxx | 1 + dtool/src/interrogate/interfaceMakerPythonNative.cxx | 7 +++++++ panda/src/egg2pg/eggSaver.h | 1 + panda/src/pgraph/shaderAttrib.cxx | 1 + 5 files changed, 11 insertions(+) diff --git a/dtool/src/cppparser/cppTypedefType.h b/dtool/src/cppparser/cppTypedefType.h index eb6ab016cf..ad6c33ffa2 100644 --- a/dtool/src/cppparser/cppTypedefType.h +++ b/dtool/src/cppparser/cppTypedefType.h @@ -19,6 +19,7 @@ #include "cppType.h" class CPPIdentifier; +class CPPInstanceIdentifier; /////////////////////////////////////////////////////////////////// // Class : CPPTypedefType diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index e1abae2c06..a1636b592e 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -23,6 +23,7 @@ #include "interrogateDatabase.h" #include "cppInstance.h" +#include "cppConstType.h" #include "cppFunctionType.h" #include "cppParameterList.h" #include "cppReferenceType.h" diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index 7770cd748a..b3776e6f12 100644 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -21,10 +21,17 @@ #include "interrogateDatabase.h" #include "interrogateType.h" #include "interrogateFunction.h" +#include "cppArrayType.h" +#include "cppConstType.h" +#include "cppEnumType.h" #include "cppFunctionType.h" +#include "cppFunctionGroup.h" #include "cppPointerType.h" #include "cppTypeDeclaration.h" +#include "cppTypedefType.h" +#include "cppSimpleType.h" #include "cppStructType.h" +#include "cppExpression.h" #include "vector" #include "cppParameterList.h" #include "algorithm" diff --git a/panda/src/egg2pg/eggSaver.h b/panda/src/egg2pg/eggSaver.h index 0dfbdc8838..7cb52908cd 100755 --- a/panda/src/egg2pg/eggSaver.h +++ b/panda/src/egg2pg/eggSaver.h @@ -40,6 +40,7 @@ class GeomVertexData; class GeomPrimitive; class PandaNode; class RenderState; +class Material; class Texture; class CharacterJoint; class EggVertex; diff --git a/panda/src/pgraph/shaderAttrib.cxx b/panda/src/pgraph/shaderAttrib.cxx index f0a3631af4..ad9b1a6eef 100755 --- a/panda/src/pgraph/shaderAttrib.cxx +++ b/panda/src/pgraph/shaderAttrib.cxx @@ -23,6 +23,7 @@ #include "bamWriter.h" #include "datagram.h" #include "datagramIterator.h" +#include "nodePath.h" TypeHandle ShaderAttrib::_type_handle; int ShaderAttrib::_attrib_slot; From a10a7cf6d1ab9cbafef6f2720aaa7a9d648db41c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 2 May 2015 11:49:30 -0700 Subject: [PATCH 294/744] dtoolbase: Rename pdtoa.c -> pdtoa.cxx. It's actually a C++ file (contains C++-only constructs) and should have the proper file extension so it compiles with the appropriate language. --- dtool/src/dtoolbase/p3dtoolbase_composite2.cxx | 2 +- dtool/src/dtoolbase/{pdtoa.c => pdtoa.cxx} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename dtool/src/dtoolbase/{pdtoa.c => pdtoa.cxx} (100%) diff --git a/dtool/src/dtoolbase/p3dtoolbase_composite2.cxx b/dtool/src/dtoolbase/p3dtoolbase_composite2.cxx index 145c86d801..8cd964b4fd 100644 --- a/dtool/src/dtoolbase/p3dtoolbase_composite2.cxx +++ b/dtool/src/dtoolbase/p3dtoolbase_composite2.cxx @@ -2,7 +2,7 @@ #include "mutexWin32Impl.cxx" #include "mutexSpinlockImpl.cxx" #include "neverFreeMemory.cxx" -#include "pdtoa.c" +#include "pdtoa.cxx" #include "pstrtod.cxx" #include "register_type.cxx" #include "typeHandle.cxx" diff --git a/dtool/src/dtoolbase/pdtoa.c b/dtool/src/dtoolbase/pdtoa.cxx similarity index 100% rename from dtool/src/dtoolbase/pdtoa.c rename to dtool/src/dtoolbase/pdtoa.cxx From 98db603b665615c6922929061516ec614464a7b5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 2 May 2015 12:05:30 -0700 Subject: [PATCH 295/744] general: Fix missing includes. --- panda/src/gobj/geomPrimitive.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/panda/src/gobj/geomPrimitive.cxx b/panda/src/gobj/geomPrimitive.cxx index 83ae80b266..80408a18c5 100644 --- a/panda/src/gobj/geomPrimitive.cxx +++ b/panda/src/gobj/geomPrimitive.cxx @@ -22,6 +22,8 @@ #include "geomVertexWriter.h" #include "geomVertexRewriter.h" #include "geomPoints.h" +#include "geomLines.h" +#include "geomTriangles.h" #include "preparedGraphicsObjects.h" #include "internalName.h" #include "bamReader.h" From 66e47bea0ded4c0f7f0d917661a6c3dc3a25becc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 2 May 2015 12:23:22 -0700 Subject: [PATCH 296/744] CMake: Update for recent upstream changes. --- dtool/src/dtoolbase/CMakeLists.txt | 2 ++ panda/src/display/CMakeLists.txt | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 53aa3caf3d..e4deb8a11c 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -22,6 +22,7 @@ set(P3DTOOLBASE_HEADERS nearly_zero.h neverFreeMemory.h neverFreeMemory.I numeric_types.h + pdtoa.h pstrtod.h register_type.I register_type.h selectThreadImpl.h @@ -53,6 +54,7 @@ set(P3DTOOLBASE_SOURCES mutexWin32Impl.cxx mutexSpinlockImpl.cxx neverFreeMemory.cxx + pdtoa.cxx pstrtod.cxx register_type.cxx typeHandle.cxx diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index da38641472..245e8c8ce7 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -20,7 +20,6 @@ set(P3DISPLAY_HEADERS graphicsWindowInputDevice.I graphicsWindowInputDevice.h graphicsWindowProc.h graphicsWindowProcCallbackData.I graphicsWindowProcCallbackData.h - lru.h nativeWindowHandle.I nativeWindowHandle.h parasiteBuffer.I parasiteBuffer.h pStatGPUTimer.I pStatGPUTimer.h @@ -56,7 +55,6 @@ set(P3DISPLAY_SOURCES graphicsWindowProc.cxx graphicsWindowProcCallbackData.cxx graphicsDevice.cxx - lru.cxx nativeWindowHandle.cxx parasiteBuffer.cxx windowHandle.cxx From 8b8743164a18e350fc47b0070ef60d487e32a590 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 2 May 2015 12:37:08 -0700 Subject: [PATCH 297/744] direct: Resolve missing import in Actor. --- direct/src/actor/Actor.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/direct/src/actor/Actor.py b/direct/src/actor/Actor.py index 8fc6557cf4..7802ebc3eb 100644 --- a/direct/src/actor/Actor.py +++ b/direct/src/actor/Actor.py @@ -4,6 +4,7 @@ __all__ = ['Actor'] from pandac.PandaModules import * from direct.showbase.DirectObject import DirectObject +from direct.directnotify import DirectNotifyGlobal from pandac.PandaModules import LODNode import types, copy @@ -12,7 +13,7 @@ class Actor(DirectObject, NodePath): Actor class: Contains methods for creating, manipulating and playing animations on characters """ - notify = directNotify.newCategory("Actor") + notify = DirectNotifyGlobal.directNotify.newCategory("Actor") partPrefix = "__Actor_" modelLoaderOptions = LoaderOptions(LoaderOptions.LFSearch | From a92a972af0a96d66de9e96bc06a8ad6a5e94e545 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Jul 2015 19:28:08 -0700 Subject: [PATCH 298/744] CMake: Adjust for upstream Panda3D changes. --- dtool/Config.cmake | 5 +++++ dtool/dtool_config.h.in | 3 +++ dtool/src/interrogatedb/CMakeLists.txt | 6 ++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index b6514f8380..4e960e11a5 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -327,6 +327,11 @@ overhead to have this option available even if it is unused, it is by default enabled only in a development build. This has no effect on DirectX rendering." ${IS_DEBUG_BUILD}) +option(SUPPORT_FIXED_FUNCTION + "This option compiles in support for the fixed-function OpenGL +pipeline. It is only really useful to turn this off if you are targeting +an OpenGL ES 2 system." ON) + option(USE_MEMORY_DLMALLOC "This is an optional alternative memory-allocation scheme available within Panda. You can experiment with it to see diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index ab42a14059..889871ff42 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -239,6 +239,9 @@ /* Define if we want to allow immediate mode OpenGL rendering. */ #cmakedefine SUPPORT_IMMEDIATE_MODE +/* Define if we want to support fixed-function OpenGL rendering. */ +#cmakedefine SUPPORT_FIXED_FUNCTION + /* Define for either of the alternative malloc schemes. */ #cmakedefine USE_MEMORY_DLMALLOC #cmakedefine USE_MEMORY_PTMALLOC2 diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 5de820961d..47a9ed14dd 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -10,8 +10,7 @@ set(P3INTERROGATEDB_HEADERS interrogateType.I interrogateType.h interrogate_datafile.I interrogate_datafile.h interrogate_interface.h interrogate_request.h - extension.h py_panda.h - vector_int.h ) + extension.h py_panda.h) set(P3INTERROGATEDB_SOURCES config_interrogatedb.cxx @@ -24,8 +23,7 @@ set(P3INTERROGATEDB_SOURCES interrogateManifest.cxx interrogateType.cxx interrogate_datafile.cxx interrogate_interface.cxx interrogate_request.cxx - py_panda.cxx - vector_int.cxx) + py_panda.cxx) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) From 8427f95c18a486cad03c8f41b197523b7d79bef6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 7 Nov 2015 20:07:24 -0800 Subject: [PATCH 299/744] cmake: Update for upstream changes. --- dtool/src/interrogate/CMakeLists.txt | 8 ++++++-- panda/src/downloader/CMakeLists.txt | 7 ++++++- panda/src/express/CMakeLists.txt | 6 +++++- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 9d9ccf094c..272b81e869 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -19,7 +19,9 @@ set(INTERROGATE_HEADERS parameterRemapPTToPointer.h parameterRemapReferenceToConcrete.h parameterRemapReferenceToPointer.h parameterRemapThis.h - parameterRemapToString.h parameterRemapUnchanged.h + parameterRemapToString.h + parameterRemapHandleToInt.h + parameterRemapUnchanged.h typeManager.h) set(INTERROGATE_SOURCES @@ -42,7 +44,9 @@ set(INTERROGATE_SOURCES parameterRemapEnumToInt.cxx parameterRemapPTToPointer.cxx parameterRemapReferenceToConcrete.cxx parameterRemapReferenceToPointer.cxx parameterRemapThis.cxx - parameterRemapToString.cxx parameterRemapUnchanged.cxx + parameterRemapToString.cxx + parameterRemapHandleToInt.cxx + parameterRemapUnchanged.cxx typeManager.cxx) composite_sources(interrogate INTERROGATE_SOURCES) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 5095ee9323..f82ed55333 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -62,9 +62,14 @@ set(P3DOWNLOADER_SOURCES virtualFileMountHTTP.cxx ) +set(P3DOWNLOADER_IGATEEXT + stringStream_ext.cxx + stringStream_ext.h +) + composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_library(p3downloader ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) target_link_libraries(p3downloader p3express) -target_interrogate(p3downloader ALL) +target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) install(TARGETS p3downloader DESTINATION lib) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index e5e77eee9b..78b0bd196d 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -134,10 +134,14 @@ set(P3EXPRESS_IGATEEXT ramfile_ext.h streamReader_ext.cxx streamReader_ext.h + streamWriter_ext.cxx + streamWriter_ext.h typeHandle_ext.cxx typeHandle_ext.h virtualFileSystem_ext.cxx - virtualFileSystem_ext.h) + virtualFileSystem_ext.h + virtualFile_ext.cxx + virtualFile_ext.h) composite_sources(p3express P3EXPRESS_SOURCES) From df446a8a23fc179863fe1b0919c7f4983c695796 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 8 Nov 2015 18:43:04 +0100 Subject: [PATCH 300/744] Fix makepanda in cmake branch - parser-inc moves are no longer necessary --- .../parser-inc/{ => opencv2/core}/core.hpp | 0 .../{ => opencv2/highgui}/highgui.hpp | 0 makepanda/makepanda.py | 29 ------------------- 3 files changed, 29 deletions(-) rename dtool/src/parser-inc/{ => opencv2/core}/core.hpp (100%) rename dtool/src/parser-inc/{ => opencv2/highgui}/highgui.hpp (100%) diff --git a/dtool/src/parser-inc/core.hpp b/dtool/src/parser-inc/opencv2/core/core.hpp similarity index 100% rename from dtool/src/parser-inc/core.hpp rename to dtool/src/parser-inc/opencv2/core/core.hpp diff --git a/dtool/src/parser-inc/highgui.hpp b/dtool/src/parser-inc/opencv2/highgui/highgui.hpp similarity index 100% rename from dtool/src/parser-inc/highgui.hpp rename to dtool/src/parser-inc/opencv2/highgui/highgui.hpp diff --git a/makepanda/makepanda.py b/makepanda/makepanda.py index 69d9d6171c..ab72d3d9de 100755 --- a/makepanda/makepanda.py +++ b/makepanda/makepanda.py @@ -2852,35 +2852,6 @@ if not PkgSkip("EIGEN") and GetTarget() == "windows" and GetThirdpartyDir(): ######################################################################## CopyTree(GetOutputDir()+'/include/parser-inc','dtool/src/parser-inc') -MakeDirectory(GetOutputDir()+'/include/parser-inc/openssl') -MakeDirectory(GetOutputDir()+'/include/parser-inc/netinet') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Cg') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Core') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Forest') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Renderers') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Renderers/OpenGL') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Renderers/DirectX9') -MakeDirectory(GetOutputDir()+'/include/parser-inc/glew') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Eigen') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Rocket') -MakeDirectory(GetOutputDir()+'/include/parser-inc/Rocket/Core') -MakeDirectory(GetOutputDir()+'/include/parser-inc/opencv2') -MakeDirectory(GetOutputDir()+'/include/parser-inc/opencv2/core') -MakeDirectory(GetOutputDir()+'/include/parser-inc/opencv2/highgui') -CopyAllFiles(GetOutputDir()+'/include/parser-inc/openssl/','dtool/src/parser-inc/') -CopyAllFiles(GetOutputDir()+'/include/parser-inc/netinet/','dtool/src/parser-inc/') -CopyFile(GetOutputDir()+'/include/parser-inc/Cg/','dtool/src/parser-inc/cg.h') -CopyFile(GetOutputDir()+'/include/parser-inc/Cg/','dtool/src/parser-inc/cgGL.h') -CopyFile(GetOutputDir()+'/include/parser-inc/Core/','dtool/src/parser-inc/Core.h') -CopyFile(GetOutputDir()+'/include/parser-inc/Forest/','dtool/src/parser-inc/Forest.h') -CopyFile(GetOutputDir()+'/include/parser-inc/Renderers/OpenGL/','dtool/src/parser-inc/OpenGLRenderer.h') -CopyFile(GetOutputDir()+'/include/parser-inc/Renderers/DirectX9/','dtool/src/parser-inc/DirectX9Renderer.h') -CopyFile(GetOutputDir()+'/include/parser-inc/glew/','dtool/src/parser-inc/glew.h') -CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/Dense') -CopyFile(GetOutputDir()+'/include/parser-inc/Eigen/','dtool/src/parser-inc/StdVector') -CopyFile(GetOutputDir()+'/include/parser-inc/Rocket/Core/','dtool/src/parser-inc/RenderInterface.h') -CopyFile(GetOutputDir()+'/include/parser-inc/opencv2/core/','dtool/src/parser-inc/core.hpp') -CopyFile(GetOutputDir()+'/include/parser-inc/opencv2/highgui/','dtool/src/parser-inc/highgui.hpp') DeleteVCS(GetOutputDir()+'/include/parser-inc') ######################################################################## From 5734f61f7eb20ce86125938036df312388d35018 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 8 Nov 2015 22:50:53 +0100 Subject: [PATCH 301/744] Fix Eigen compile issue in CMake --- dtool/Config.cmake | 5 +++++ panda/src/linmath/CMakeLists.txt | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 4e960e11a5..89ffca166a 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -432,6 +432,11 @@ Activating this does constrain most objects in Panda to 16-byte alignment, which could impact memory usage on very-low-memory platforms. Currently experimental." ON) +# Always include Eigen, because we include it pretty much everywhere. +if(EIGEN3_FOUND) + include_directories(${EIGEN3_INCLUDE_DIR}) +endif() + # Is Python installed, and should Python interfaces be generated? find_package(PythonLibs 2.5) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index f1716de7f8..ae085bc6db 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -46,7 +46,6 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3express p3pandabase) -target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) install(TARGETS p3linmath DESTINATION lib) From 7f9e25fb845f05fac47e44f16f775a90da00f96a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 9 Nov 2015 16:42:03 -0800 Subject: [PATCH 302/744] CMake: Move pandac compatibility-shim generation to a more sensible place. --- CMakeLists.txt | 30 ++++++++++++++++++++++++++++++ direct/CMakeLists.txt | 3 --- direct/src/pandac/CMakeLists.txt | 15 --------------- direct/src/pandac/__init__.py | 30 ------------------------------ 4 files changed, 30 insertions(+), 48 deletions(-) delete mode 100644 direct/src/pandac/CMakeLists.txt delete mode 100644 direct/src/pandac/__init__.py diff --git a/CMakeLists.txt b/CMakeLists.txt index d1755b6919..b7d551edb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -49,3 +49,33 @@ endif() if(BUILD_PANDATOOL) add_subdirectory(pandatool) endif() + +# This bit is to generate the 'pandac' compatibility shim. It's deprecated now, +# but in older versions of Panda3D, one would use +# from pandac.PandaModules import * +# instead of +# from panda3d.FOO import * +if(HAVE_PYTHON) + # Generate PandaModules: + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" + "\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\" + +print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") + + foreach(module ${ALL_INTERROGATE_MODULES}) + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" " +try: + from panda3d.${module} import * +except ImportError as err: + if \"No module named %s\" not in str(err): + raise +") + endforeach() + + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pandac/__init__.py" "") + + # Now install ourselves: + install( + FILES "${CMAKE_CURRENT_BINARY_DIR}/pandac/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac") +endif() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index f3debd7d08..7d89af1a93 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -40,6 +40,3 @@ if(HAVE_PYTHON) FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") endif() - -# pandac has its own installation steps necessary: -add_subdirectory(src/pandac) diff --git a/direct/src/pandac/CMakeLists.txt b/direct/src/pandac/CMakeLists.txt deleted file mode 100644 index 62969e7acf..0000000000 --- a/direct/src/pandac/CMakeLists.txt +++ /dev/null @@ -1,15 +0,0 @@ -if(HAVE_PYTHON) - # Generate PandaModules: - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" - "# Generated by CMake; edits not preserved\n") - foreach(module ${ALL_INTERROGATE_MODULES}) - file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" - "from panda3d.${module} import *\n") - endforeach() - - # Now install ourselves: - file(GLOB python_sources "${CMAKE_CURRENT_SOURCE_DIR}/*.py") - install( - FILES ${python_sources} "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" - DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac") -endif() diff --git a/direct/src/pandac/__init__.py b/direct/src/pandac/__init__.py deleted file mode 100644 index cfbd9209a4..0000000000 --- a/direct/src/pandac/__init__.py +++ /dev/null @@ -1,30 +0,0 @@ -# N.B. PandaModules is generated at build time by CMake -from PandaModules import * -import __builtin__ - -# Now import all extensions: -from direct.extensions_native.extension_native_helpers import * -extensions = [ - 'CInterval', 'HTTPChannel', 'Mat3', 'NodePath', 'VBase3', 'VBase4' -] - -# Prior to importing, we need to make the Dtool_funcToMethod function and -# the extended class available globally. This is hacky, but tacking it on -# __builtin__ works just fine: -import __builtin__ -__builtin__.Dtool_funcToMethod = Dtool_funcToMethod -__builtin__.Dtool_ObjectToDict = Dtool_ObjectToDict - -for extension in extensions: - if extension not in locals(): - # Not a class we have compiled in, skip it! - continue - - module = 'direct.extensions_native.%s_extensions' % extension - - setattr(__builtin__, extension, locals()[extension]) - __import__(module) - del __builtin__.__dict__[extension] - -del __builtin__.Dtool_funcToMethod -del __builtin__.Dtool_ObjectToDict From 28a60ff52e8524ceed3cbcd24594b6ee2f56d180 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 11 Nov 2015 12:53:35 -0800 Subject: [PATCH 303/744] general: Remove a few hacked-in includes once needed for CMake to build properly. --- dtool/src/dtoolutil/filename.cxx | 4 ---- dtool/src/dtoolutil/globPattern.cxx | 4 ---- panda/src/putil/callbackObject_ext.h | 1 - 3 files changed, 9 deletions(-) diff --git a/dtool/src/dtoolutil/filename.cxx b/dtool/src/dtoolutil/filename.cxx index bc8b1dc00a..143bbde0a3 100644 --- a/dtool/src/dtoolutil/filename.cxx +++ b/dtool/src/dtoolutil/filename.cxx @@ -49,10 +49,6 @@ #include #endif -#ifdef HAVE_PYTHON -#include "Python.h" -#endif - TextEncoder::Encoding Filename::_filesystem_encoding = TextEncoder::E_utf8; TVOLATILE AtomicAdjust::Pointer Filename::_home_directory; diff --git a/dtool/src/dtoolutil/globPattern.cxx b/dtool/src/dtoolutil/globPattern.cxx index 732b724c11..7f7d23a53b 100644 --- a/dtool/src/dtoolutil/globPattern.cxx +++ b/dtool/src/dtoolutil/globPattern.cxx @@ -15,10 +15,6 @@ #include "globPattern.h" #include -#ifdef HAVE_PYTHON -#include "Python.h" -#endif - //////////////////////////////////////////////////////////////////// // Function: GlobPattern::has_glob_characters // Access: Published diff --git a/panda/src/putil/callbackObject_ext.h b/panda/src/putil/callbackObject_ext.h index 1d3af19cea..d72713da19 100644 --- a/panda/src/putil/callbackObject_ext.h +++ b/panda/src/putil/callbackObject_ext.h @@ -16,7 +16,6 @@ #define CALLBACKOBJECT_EXT_H #include "dtoolbase.h" -#include "pointerTo.h" #ifdef HAVE_PYTHON From 166ac72b968b1cf04012fd2f254768a3dfaa09a1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 11 Nov 2015 13:53:34 -0800 Subject: [PATCH 304/744] CMake: Only define Python modules when HAVE_PYTHON is on. --- direct/CMakeLists.txt | 6 ++++-- panda/CMakeLists.txt | 26 ++++++++++++++------------ 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 7d89af1a93..e5481d9415 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -16,8 +16,10 @@ add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) add_subdirectory(src/showbase) -add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) -target_link_libraries(direct core) +if(HAVE_PYTHON) + add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) + target_link_libraries(direct core) +endif() # Installation: if(HAVE_PYTHON) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 51f821c2c5..e386e55853 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -96,17 +96,19 @@ if(HAVE_FREETYPE) list(APPEND CORE_MODULE_COMPONENTS p3pnmtext) endif() -add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) +if(HAVE_PYTHON) + add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) -if(HAVE_EGG) - add_python_module(egg p3egg p3egg2pg) - target_link_libraries(egg core) -endif() - -add_python_module(physics p3physics p3particlesystem) -target_link_libraries(physics core) - -if(HAVE_ODE) - add_python_module(ode p3ode) - target_link_libraries(ode core) + if(HAVE_EGG) + add_python_module(egg p3egg p3egg2pg) + target_link_libraries(egg core) + endif() + + add_python_module(physics p3physics p3particlesystem) + target_link_libraries(physics core) + + if(HAVE_ODE) + add_python_module(ode p3ode) + target_link_libraries(ode core) + endif() endif() From cdf3e21025352cf5dacd741ccfd7cc8476844d4e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 11 Nov 2015 14:35:24 -0800 Subject: [PATCH 305/744] CMake: Test that the compiler has SSE2 support. --- dtool/LocalSetup.cmake | 4 ++++ panda/src/pnmimage/CMakeLists.txt | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 9f5fe2ed1e..b5ebc89576 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -159,6 +159,10 @@ check_include_file_cxx(typeinfo HAVE_RTTI) # Do we have Posix threads? #set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) +# Do we have SSE2 support? +include(CheckCXXCompilerFlag) +check_cxx_compiler_flag(-msse2 HAVE_SSE2) + #/* Define if needed to have 64-bit file i/o */ #$[cdefine __USE_LARGEFILE64] diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 3372d009f1..a813a6fd1e 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -30,7 +30,9 @@ set(P3PNMIMAGE_IGATEEXT pfmFile_ext.h ) -set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES COMPILE_FLAGS -msse2) +if(HAVE_SSE2) + set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES COMPILE_FLAGS -msse2) +endif() composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) From 64c55cf92c2f36f6feb9207c64badb849349b82f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 15 Nov 2015 22:52:28 -0800 Subject: [PATCH 306/744] CMake: Library link changes for Windows. --- panda/src/net/CMakeLists.txt | 4 ++++ panda/src/windisplay/CMakeLists.txt | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 68eac47634..e052940e8e 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -30,5 +30,9 @@ if(HAVE_NET AND WANT_NATIVE_NET) target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) target_interrogate(p3net ALL) + if(WIN32) + target_link_libraries(p3net Iphlpapi.lib) + endif() + install(TARGETS p3net DESTINATION lib) endif() diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index b7290c8bc6..bd123d3ed7 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -13,5 +13,5 @@ if(WIN32) composite_sources(p3windisplay P3WINDISPLAY_SOURCES) add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) target_link_libraries(p3windisplay p3display p3putil - Coreimm.lib) + Imm32.lib) endif() From c6096c26901f46fd3a660616df7865311f54fefe Mon Sep 17 00:00:00 2001 From: rdb Date: Fri, 5 Feb 2016 17:44:06 +0100 Subject: [PATCH 307/744] Bring CMakeLists files up to date to match latest master --- panda/src/nativenet/CMakeLists.txt | 6 +++--- panda/src/pnmtext/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index dd682762d1..78da36d243 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -1,15 +1,15 @@ if(WANT_NATIVE_NET) set(P3NATIVENET_HEADERS buffered_datagramconnection.h - buffered_datagramreader.h buffered_datagramreader.i - ringbuffer.h ringbuffer.i socket_ip.h + buffered_datagramreader.h buffered_datagramreader.I + ringbuffer.h ringbuffer.I socket_ip.h socket_tcp_listen.h time_accumulator.h time_out.h socket_address.I socket_address.h socket_portable.h time_base.h time_span.h buffered_datagramwriter.h socket_base.h socket_selector.h socket_udp.h socket_udp_incoming.h time_clock.h - membuffer.h membuffer.i socket_fdset.h socket_tcp.h + membuffer.h membuffer.I socket_fdset.h socket_tcp.h socket_udp_outgoing.h time_general.h) set(P3NATIVENET_SOURCES diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 86764755d2..ffb3388961 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -16,7 +16,7 @@ if(HAVE_FREETYPE) composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) - target_link_libraries(p3pnmtext p3pnmimage ${_FREETYPE_LIBRARIES}) + target_link_libraries(p3pnmtext p3parametrics p3pnmimage ${_FREETYPE_LIBRARIES}) target_interrogate(p3pnmtext ALL) install(TARGETS p3pnmtext DESTINATION lib) From e20aeabf509307e2267e403efce4930333f19482 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 15 Mar 2016 21:23:56 -0700 Subject: [PATCH 308/744] CMake: Build pnmtext *after* parametrics. --- panda/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index e386e55853..786260f343 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -56,8 +56,8 @@ add_subdirectory(src/chan) add_subdirectory(src/char) add_subdirectory(src/dgraph) add_subdirectory(src/device) -add_subdirectory(src/pnmtext) add_subdirectory(src/parametrics) +add_subdirectory(src/pnmtext) add_subdirectory(src/text) add_subdirectory(src/grutil) add_subdirectory(src/tform) From f41f401961a65ffe41e7ef75e4c8324e61c50529 Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 13 Apr 2016 11:38:31 +0200 Subject: [PATCH 309/744] Update cmake port to build ShaderMeshTerrain and LogicOpAttrib --- panda/src/grutil/CMakeLists.txt | 2 ++ panda/src/ode/CMakeLists.txt | 2 +- panda/src/pgraph/CMakeLists.txt | 10 ++++++---- panda/src/putil/CMakeLists.txt | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d65d9cc349..e4090fa2a4 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -10,6 +10,7 @@ set(P3GRUTIL_HEADERS geoMipTerrain.I geoMipTerrain.h sceneGraphAnalyzerMeter.I sceneGraphAnalyzerMeter.h heightfieldTesselator.I heightfieldTesselator.h + shaderTerrainMesh.I shaderTerrainMesh.h lineSegs.I lineSegs.h multitexReducer.I multitexReducer.h nodeVertexTransform.I nodeVertexTransform.h @@ -27,6 +28,7 @@ set(P3GRUTIL_SOURCES geoMipTerrain.cxx sceneGraphAnalyzerMeter.cxx heightfieldTesselator.cxx + shaderTerrainMesh.cxx multitexReducer.cxx nodeVertexTransform.cxx pfmVizzer.cxx diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 25795f4fc0..95791acc5c 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -82,7 +82,7 @@ if(HAVE_ODE) composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) - set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) + #set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 4c5f7fed5f..fdff3841d9 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -44,10 +44,11 @@ set(P3PGRAPH_HEADERS light.I light.h lightAttrib.I lightAttrib.h lightRampAttrib.I lightRampAttrib.h - loader.I loader.h + loader.I loader.h loaderFileType.h - loaderFileTypeBam.h + loaderFileTypeBam.h loaderFileTypeRegistry.h + logicOpAttrib.I logicOpAttrib.h materialAttrib.I materialAttrib.h materialCollection.I materialCollection.h modelFlattenRequest.I modelFlattenRequest.h @@ -144,9 +145,10 @@ set(P3PGRAPH_SOURCES lightAttrib.cxx lightRampAttrib.cxx loader.cxx - loaderFileType.cxx + loaderFileType.cxx loaderFileTypeBam.cxx - loaderFileTypeRegistry.cxx + loaderFileTypeRegistry.cxx + logicOpAttrib.cxx materialAttrib.cxx materialCollection.cxx modelFlattenRequest.cxx diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 5dfa232549..c0a213add5 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -112,6 +112,8 @@ set(P3PUTIL_SOURCES ) set(P3PUTIL_IGATEEXT + bamReader_ext.cxx + bamReader_ext.h callbackObject_ext.h pythonCallbackObject.cxx pythonCallbackObject.h From 50f89f5fd5213a557251c4fbe5a5ed87ffbd0aaa Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 25 Jun 2016 19:10:18 -0700 Subject: [PATCH 310/744] cmake: Adjust for upstream changes. --- panda/CMakeLists.txt | 2 +- panda/src/downloader/CMakeLists.txt | 2 +- panda/src/movies/CMakeLists.txt | 4 ++++ panda/src/nativenet/CMakeLists.txt | 3 ++- panda/src/ode/CMakeLists.txt | 2 +- panda/src/pgraphnodes/CMakeLists.txt | 2 ++ panda/src/pnmimagetypes/CMakeLists.txt | 4 ++++ 7 files changed, 15 insertions(+), 4 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 786260f343..26531e4661 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -22,9 +22,9 @@ endif() add_subdirectory(src/configfiles) add_subdirectory(src/pandabase) add_subdirectory(src/express) +add_subdirectory(src/pipeline) add_subdirectory(src/downloader) add_subdirectory(src/downloadertools) -add_subdirectory(src/pipeline) add_subdirectory(src/nativenet) add_subdirectory(src/net) add_subdirectory(src/linmath) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index f82ed55333..34f0037cd3 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -69,7 +69,7 @@ set(P3DOWNLOADER_IGATEEXT composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_library(p3downloader ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) -target_link_libraries(p3downloader p3express) +target_link_libraries(p3downloader p3express p3pipeline) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) install(TARGETS p3downloader DESTINATION lib) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 3f31767fa0..24f0ccebf2 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -1,5 +1,7 @@ set(P3MOVIES_HEADERS config_movies.h + flacAudio.h flacAudio.I + flacAudioCursor.h flacAudioCursor.I inkblotVideo.h inkblotVideo.I inkblotVideoCursor.h inkblotVideoCursor.I microphoneAudio.h microphoneAudio.I @@ -17,6 +19,8 @@ set(P3MOVIES_HEADERS set(P3MOVIES_SOURCES config_movies.cxx + flacAudio.cxx + flacAudioCursor.cxx inkblotVideo.cxx inkblotVideoCursor.cxx microphoneAudio.cxx diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 78da36d243..128d2aaff9 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -15,6 +15,7 @@ if(WANT_NATIVE_NET) set(P3NATIVENET_SOURCES config_nativenet.cxx buffered_datagramconnection.cxx + socket_address.cxx socket_ip.cxx socket_tcp.cxx socket_tcp_listen.cxx @@ -25,7 +26,7 @@ if(WANT_NATIVE_NET) composite_sources(p3nativenet P3NATIVENET_SOURCES) add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) - target_link_libraries(p3nativenet p3express p3pandabase) + target_link_libraries(p3nativenet p3express p3pandabase p3downloader) target_interrogate(p3nativenet ALL) install(TARGETS p3nativenet DESTINATION lib) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 95791acc5c..25795f4fc0 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -82,7 +82,7 @@ if(HAVE_ODE) composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) - #set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) + set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 5458489c31..8e09ca530c 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -14,6 +14,7 @@ set(P3PGRAPHNODES_HEADERS selectiveChildNode.h selectiveChildNode.I sequenceNode.h sequenceNode.I shaderGenerator.h shaderGenerator.I + sphereLight.h sphereLight.I spotlight.h spotlight.I switchNode.h switchNode.I uvScrollNode.I uvScrollNode.h @@ -35,6 +36,7 @@ set(P3PGRAPHNODES_SOURCES selectiveChildNode.cxx sequenceNode.cxx shaderGenerator.cxx + sphereLight.cxx spotlight.cxx switchNode.cxx uvScrollNode.cxx diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 680b767ecb..5466a5a826 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -1,10 +1,12 @@ set(P3PNMIMAGETYPES_HEADERS config_pnmimagetypes.h pnmFileTypeBMP.h + pnmFileTypeEXR.h pnmFileTypeIMG.h pnmFileTypePNG.h pnmFileTypePNM.h pnmFileTypePfm.h pnmFileTypeSGI.h pnmFileTypeSoftImage.h + pnmFileTypeStbImage.h pnmFileTypeTGA.h pnmFileTypeTIFF.h pnmFileTypeJPG.h @@ -14,6 +16,7 @@ set(P3PNMIMAGETYPES_SOURCES config_pnmimagetypes.cxx pnmFileTypeBMPReader.cxx pnmFileTypeBMPWriter.cxx pnmFileTypeBMP.cxx + pnmFileTypeEXR.cxx pnmFileTypeIMG.cxx pnmFileTypeJPG.cxx pnmFileTypeJPGReader.cxx pnmFileTypeJPGWriter.cxx pnmFileTypePNG.cxx @@ -22,6 +25,7 @@ set(P3PNMIMAGETYPES_SOURCES pnmFileTypeSGI.cxx pnmFileTypeSGIReader.cxx pnmFileTypeSGIWriter.cxx pnmFileTypeSoftImage.cxx + pnmFileTypeStbImage.cxx pnmFileTypeTIFF.cxx pnmFileTypeTGA.cxx ) From f45b4a7917400ffd37c908b13156ab900e4f2521 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 30 Nov 2016 19:22:06 -0800 Subject: [PATCH 311/744] cmake: Update for new files added in master. --- panda/src/chan/CMakeLists.txt | 2 ++ panda/src/gobj/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 4bf13ea0c6..63af290c67 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -3,6 +3,7 @@ set(P3CHAN_HEADERS animBundleNode.I animBundleNode.h animChannel.I animChannel.h animChannelBase.I animChannelBase.h + animChannelFixed.I animChannelFixed.h animChannelMatrixDynamic.I animChannelMatrixDynamic.h animChannelMatrixFixed.I animChannelMatrixFixed.h animChannelMatrixXfmTable.I animChannelMatrixXfmTable.h @@ -31,6 +32,7 @@ set(P3CHAN_SOURCES animBundleNode.cxx animChannel.cxx animChannelBase.cxx + animChannelFixed.cxx animChannelMatrixDynamic.cxx animChannelMatrixFixed.cxx animChannelMatrixXfmTable.cxx diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 3ee081e828..6d3fffcabb 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -151,6 +151,8 @@ set(P3GOBJ_IGATEEXT internalName_ext.h geomVertexArrayData_ext.cxx geomVertexArrayData_ext.h + texture_ext.cxx + texture_ext.h textureCollection_ext.cxx textureCollection_ext.h ) From e58697bee4e511f53655a724a67fc82171937ec9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 1 Dec 2016 02:36:40 -0800 Subject: [PATCH 312/744] cmake: Fix AutoInclude workaround always being used irrespective of version. Also fixes Interrogate's reliance on the INTERFACE_INCLUDE_DIRECTORIES target property before generation time by using a generator expression to determine Interrogate's include flags. --- cmake/macros/Interrogate.cmake | 17 ++++++----------- cmake/modules/AutoInclude.cmake | 13 ++++++------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 6387a5ca30..0305d04218 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -167,18 +167,13 @@ function(interrogate_sources target output database module) endforeach(source) # Interrogate also needs the include paths, so we'll extract them from the - # target: - set(include_flags) - get_target_property(include_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) - foreach(include_dir ${include_dirs}) - # To keep the command-line small, also make this relative: - # Note that Interrogate does NOT handle -I paths relative to -srcdir, so - # we make them relative to the directory where it's invoked. - file(RELATIVE_PATH rel_include_dir "${CMAKE_CURRENT_BINARY_DIR}" "${include_dir}") - list(APPEND include_flags "-I${rel_include_dir}") - endforeach(include_dir) + # target using a generator expression. + # Note, the \t is a workaround for a CMake bug where using a plain space in + # a JOIN will cause it to be escaped. Tabs are not escaped and will + # separate correctly. + set(include_flags "-I$,\t-I>") # The above must also be included when compiling the resulting _igate.cxx file: - include_directories(${include_dirs}) + include_directories("$") # Get the compiler definition flags. These must be passed to Interrogate # in the same way that they are passed to the compiler so that Interrogate diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake index 40916f1e68..c703734bfc 100644 --- a/cmake/modules/AutoInclude.cmake +++ b/cmake/modules/AutoInclude.cmake @@ -6,10 +6,7 @@ # Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior if # this version doesn't define CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. -# CFSworks's version of CMake (2.8.12) doesn't have -# CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE even though it should be supported, -# hence test if it's defined (as either ON or OFF) before trying to use it. -if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") +if(CMAKE_VERSION VERSION_LESS 2.8.11) # Replace some built-in functions in order to extend their functionality. function(add_library target) _add_library(${target} ${ARGN}) @@ -26,10 +23,12 @@ if("${CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE}" STREQUAL "") get_target_property(target_interface_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) foreach(lib ${ARGN}) - get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) + if(TARGET "${lib}") + get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) - if(lib_interface_dirs) - list(APPEND interface_dirs ${lib_interface_dirs}) + if(lib_interface_dirs) + list(APPEND interface_dirs ${lib_interface_dirs}) + endif() endif() endforeach() From 3dcde42540491e3439bde110f61a6ebf0875fe67 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 2 Dec 2016 18:00:02 -0800 Subject: [PATCH 313/744] travis: Add CMake buildsystem to Travis config. --- .travis.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8176d293b..eb9d2a8645 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,11 +3,15 @@ sudo: false matrix: include: - compiler: gcc - env: PYTHONV=python2.7 FLAGS=--optimize=4 + env: BUILDSYSTEM=makepanda PYTHONV=python2.7 FLAGS=--optimize=4 - compiler: clang - env: PYTHONV=python3 FLAGS=--installer + env: BUILDSYSTEM=makepanda PYTHONV=python3 FLAGS=--installer - compiler: clang - env: PYTHONV=python2.7 FLAGS=--override=STDFLOAT_DOUBLE=1 + env: BUILDSYSTEM=makepanda PYTHONV=python2.7 FLAGS=--override=STDFLOAT_DOUBLE=1 + - compiler: gcc + env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + - compiler: clang + env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives addons: apt: packages: @@ -28,7 +32,9 @@ addons: - python-dev - python3-dev - zlib1g-dev -script: $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py +script: +- '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' +- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && cmake $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/usr/lib*/python*/site-packages python ../makepanda/test_imports.py )' notifications: irc: channels: From e46890010a786805bbf68c7eb3194d60d0d0d077 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 2 Dec 2016 20:41:22 -0800 Subject: [PATCH 314/744] cmake: Don't rely on $ in CMake < 2.8.10. --- cmake/macros/Interrogate.cmake | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 0305d04218..eebe62abb5 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -167,13 +167,28 @@ function(interrogate_sources target output database module) endforeach(source) # Interrogate also needs the include paths, so we'll extract them from the - # target using a generator expression. - # Note, the \t is a workaround for a CMake bug where using a plain space in - # a JOIN will cause it to be escaped. Tabs are not escaped and will - # separate correctly. - set(include_flags "-I$,\t-I>") - # The above must also be included when compiling the resulting _igate.cxx file: - include_directories("$") + # target. Usually these are available via a generator expression, however + # versions of CMake before 2.8.10 don't support the TARGET_PROPERTY genex + # so we have to extract the property at configuration-time. Versions after + # 2.8.11 support CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE which ONLY makes + # this information available at generator-time (i.e. after + # configuration-time) so the generator expression is necessary then. + if(CMAKE_VERSION VERSION_LESS 2.8.10) + set(include_flags) + get_target_property(include_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) + foreach(include_dir ${include_dirs}) + list(APPEND include_flags "-I${include_dir}") + endforeach(include_dir) + # The above must also be included when compiling the resulting _igate.cxx file: + include_directories(${include_dirs}) + else() + # Note, the \t is a workaround for a CMake bug where using a plain space in + # a JOIN will cause it to be escaped. Tabs are not escaped and will + # separate correctly. + set(include_flags "-I$,\t-I>") + # The above must also be included when compiling the resulting _igate.cxx file: + include_directories("$") + endif() # Get the compiler definition flags. These must be passed to Interrogate # in the same way that they are passed to the compiler so that Interrogate From 57fc514bab7f9210fd7bebfe3b437952eb775e14 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Dec 2016 15:05:29 -0800 Subject: [PATCH 315/744] pnmimagetypes: Try to work around the INLINE macro getting redefined by jpeglib. --- panda/src/pnmimagetypes/pnmFileTypeJPG.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panda/src/pnmimagetypes/pnmFileTypeJPG.h b/panda/src/pnmimagetypes/pnmFileTypeJPG.h index 2dcd506322..60afc861d0 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeJPG.h +++ b/panda/src/pnmimagetypes/pnmFileTypeJPG.h @@ -37,11 +37,17 @@ #endif +// jpeglib sometimes redefines the INLINE macro and breaks inlining +// (on e.g. Ubuntu 12.04) so we need to preserve it somehow - this uses the +// MSVC push_macro/pop_macro pragmas, which are also supported on GCC and +// Clang, but may not be cross-compiler enough to merge up to master. Hrm. :/ +#pragma push_macro("INLINE") extern "C" { #include // jpeglib requires this to be included first. #include #include } +#pragma pop_macro("INLINE") /** * For reading and writing Jpeg files. From a32ace739121aa8e63cee3b336b42b680b6338e7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Dec 2016 15:39:21 -0800 Subject: [PATCH 316/744] travis: Fix faulty HAVE_GTK2 detection. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eb9d2a8645..702ef01e6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ addons: - zlib1g-dev script: - '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' -- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && cmake $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/usr/lib*/python*/site-packages python ../makepanda/test_imports.py )' +- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && cmake -DHAVE_GTK2=NO $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/usr/lib*/python*/site-packages python ../makepanda/test_imports.py )' notifications: irc: channels: From ae10462b58b27d7c34be526cd06e32445757b447 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Dec 2016 15:59:59 -0800 Subject: [PATCH 317/744] cmake: Clean up some pandatool link hacks. --- pandatool/src/bam/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index be3299b0d2..56d0e49261 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -1,6 +1,5 @@ add_executable(bam-info bamInfo.cxx bamInfo.h) -target_link_libraries(bam-info p3progbase p3pgraph p3pgraphnodes p3recorder p3pystub - p3display) # This is a HACK for now -- fix Interrogate +target_link_libraries(bam-info p3progbase p3pgraphnodes p3recorder) install(TARGETS bam-info DESTINATION bin) add_executable(egg2bam eggToBam.cxx eggToBam.h) @@ -12,5 +11,5 @@ target_link_libraries(bam2egg p3converter p3eggbase p3progbase) install(TARGETS bam2egg DESTINATION bin) add_executable(pts2bam ptsToBam.cxx ptsToBam.h) -target_link_libraries(pts2bam p3progbase p3pgraph p3pgraphnodes p3egg2pg p3pystub) +target_link_libraries(pts2bam p3progbase p3pgraph p3pgraphnodes p3egg2pg) install(TARGETS pts2bam DESTINATION bin) From 1f5a53619e4a655aab4c98c651ac347d7e840ec9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Dec 2016 17:10:54 -0800 Subject: [PATCH 318/744] cmake: Fix PandaModules generation. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b7d551edb1..f6a0702a68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,7 +63,7 @@ if(HAVE_PYTHON) print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") foreach(module ${ALL_INTERROGATE_MODULES}) - file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/PandaModules.py" " + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" " try: from panda3d.${module} import * except ImportError as err: From 7ee00365a0f4212c8a34cfd713bb18a3a415dcdb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Dec 2016 17:12:06 -0800 Subject: [PATCH 319/744] travis: Fix PYTHONPATH for tests. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 702ef01e6e..41c00f919a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,7 +34,7 @@ addons: - zlib1g-dev script: - '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' -- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && cmake -DHAVE_GTK2=NO $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/usr/lib*/python*/site-packages python ../makepanda/test_imports.py )' +- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && cmake -DHAVE_GTK2=NO -DPYTHON_ARCH_INSTALL_DIR=/pypath -DPYTHON_LIB_INSTALL_DIR=/pypath $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/pypath python ../makepanda/test_imports.py )' notifications: irc: channels: From 0cbfbe02de890f40909ea9453aebe4056231ad0a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Dec 2016 14:36:27 -0800 Subject: [PATCH 320/744] cmake: Make sure p3gobj doesn't depend on CgGL. --- panda/src/gobj/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 6d3fffcabb..2d352f5c6a 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -160,7 +160,7 @@ set(P3GOBJ_IGATEEXT composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage - ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARIES}) + ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARY}) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) install(TARGETS p3gobj DESTINATION lib) From e1dfd4ee3dffb84d57ff14abc39be02ea933f153 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Dec 2016 15:19:40 -0800 Subject: [PATCH 321/744] cmake: Oops, turn on USE_PANDAFILESTREAM by default. --- dtool/Config.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 89ffca166a..1d04802404 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -816,6 +816,9 @@ option(HAVE_AUDIO option(DO_PSTATS "Enable the pstats client?" ON) +option(USE_PANDAFILESTREAM + "Enable the PandaFileStream implementation of pfstream etc.?" ON) + # These image formats don't require the assistance of a third-party # library to read and write, so there's normally no reason to disable # them int he build, unless you are looking to reduce the memory footprint. From 53c407e4701e3d52030a182b3661efc5318adc97 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Dec 2016 15:21:28 -0800 Subject: [PATCH 322/744] travis: Build with CMake on Ubuntu trusty + precise. --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.travis.yml b/.travis.yml index 41c00f919a..7149d5aa5e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,16 @@ matrix: - compiler: clang env: BUILDSYSTEM=makepanda PYTHONV=python2.7 FLAGS=--override=STDFLOAT_DOUBLE=1 - compiler: gcc + dist: precise env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives - compiler: clang + dist: precise + env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + - compiler: gcc + dist: trusty + env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + - compiler: clang + dist: trusty env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives addons: apt: From 41f532bea6446b4dec43cc1233ff5d96fb2e937d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Dec 2016 16:57:29 -0800 Subject: [PATCH 323/744] cmake: Build p3dxml. --- panda/CMakeLists.txt | 3 ++- panda/src/dxml/CMakeLists.txt | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 panda/src/dxml/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 26531e4661..f860fe194f 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -22,6 +22,7 @@ endif() add_subdirectory(src/configfiles) add_subdirectory(src/pandabase) add_subdirectory(src/express) +add_subdirectory(src/dxml) add_subdirectory(src/pipeline) add_subdirectory(src/downloader) add_subdirectory(src/downloadertools) @@ -84,7 +85,7 @@ add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: set(CORE_MODULE_COMPONENTS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt new file mode 100644 index 0000000000..6a9007bf67 --- /dev/null +++ b/panda/src/dxml/CMakeLists.txt @@ -0,0 +1,18 @@ +set(P3DXML_HEADERS + config_dxml.h + tinyxml.h +) + +set(P3DXML_SOURCES + config_dxml.cxx + tinyxml.cpp + tinyxmlerror.cpp + tinyxmlparser.cpp +) + +composite_sources(p3dxml P3DXML_SOURCES) +add_library(p3dxml ${P3DXML_HEADERS} ${P3DXML_SOURCES}) +target_link_libraries(p3dxml p3express) +target_interrogate(p3dxml ALL) + +install(TARGETS p3dxml DESTINATION lib) From 2cca9f5e354dc8ee80395e99cd42756d874cbae0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Dec 2016 17:14:24 -0800 Subject: [PATCH 324/744] cmake: Build dxml with TIXML_USE_STL. --- panda/src/dxml/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 6a9007bf67..1c889c3351 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -11,6 +11,7 @@ set(P3DXML_SOURCES ) composite_sources(p3dxml P3DXML_SOURCES) +add_definitions(-DTIXML_USE_STL) add_library(p3dxml ${P3DXML_HEADERS} ${P3DXML_SOURCES}) target_link_libraries(p3dxml p3express) target_interrogate(p3dxml ALL) From 2ecb06e48da928cce72b0bbe0ea7b2fa2ac88c1d Mon Sep 17 00:00:00 2001 From: rdb Date: Wed, 7 Dec 2016 23:43:11 +0100 Subject: [PATCH 325/744] cmake: Add p3dxml to libpanda --- panda/metalibs/panda/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index a44ef0cdd0..06ac3b525a 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,6 +1,6 @@ add_definitions(-DBUILDING_PANDA) set(PANDA_LINK_TARGETS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) From b326c6e12dc430e5f655ad152f0199c487da477a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 15 Dec 2016 04:08:57 -0800 Subject: [PATCH 326/744] CMake: Implement test for HAVE_IOS_BINARY. --- dtool/LocalSetup.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index b5ebc89576..e9a0853089 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -101,8 +101,11 @@ int main(int argc, char *argv[]) { return 0; } set(HAVE_IOS_TYPEDEFS 1) # Define if the C++ iostream library defines ios::binary. -#TODO make test case -#$[cdefine HAVE_IOS_BINARY] +check_cxx_source_compiles(" +#include +std::ios::openmode binary = std::ios::binary; +int main(int argc, char *argv[]) { return 0; } +" HAVE_IOS_BINARY) # Can we safely call getenv() at static init time? #TODO make test case? can we make a reliable one? From e730b8be560913f43fcd4b56d2981831f0b4ac2d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 14:11:23 -0700 Subject: [PATCH 327/744] makepanda: Add a "self-destruct" script for removing makepanda specifics --- makepanda/selfdestruct.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100755 makepanda/selfdestruct.py diff --git a/makepanda/selfdestruct.py b/makepanda/selfdestruct.py new file mode 100755 index 0000000000..636f23dee5 --- /dev/null +++ b/makepanda/selfdestruct.py @@ -0,0 +1,38 @@ +#!/usr/bin/env python2 + +import os +import re +import sys +import shutil + +# Ensure user WANTS th +if len(sys.argv) < 2 or sys.argv[1] != '--yes': + print('======== MAKEPANDA SELF-DESTRUCT ========') + print('This script will destroy every trace of') + print('makepanda from the Panda3D directory that') + print('contains it. This is for testing CMake\'s') + print('dependencies and fully removing makepanda') + print('should the latter buildsystem no longer') + print('be desired.') + print('') + print('If you are sure, pass --yes') + sys.exit(1) + +# Some sanity-checks to make sure this script is in the right location: +scriptdir = os.path.abspath(os.path.dirname(__file__)) +assert os.path.split(scriptdir)[1] == 'makepanda' +root = os.path.dirname(scriptdir) +assert os.path.isfile(os.path.join(root, 'LICENSE')) +assert os.path.isdir(os.path.join(root, 'pandatool')) + +# Now we get to work! First, the makepanda directory isn't needed: +shutil.rmtree(os.path.join(root, 'makepanda')) + +# Then we look under each of the separate project trees: +projects = ['contrib', 'direct', 'dtool', 'panda', 'pandatool'] +for project in projects: + for path, dirs, files in os.walk(os.path.join(root, project)): + # Get rid of _composite#.cxx files + for filename in files: + if re.match(r'.*_composite[0-9]+\.cxx', filename): + os.unlink(os.path.join(path, filename)) From 53d946ff87f7c45c9350def10afb23c54d5da570 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 14:15:04 -0700 Subject: [PATCH 328/744] travis: Self-destruct makepanda before testing cmake build --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7149d5aa5e..baf84af18e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ addons: - zlib1g-dev script: - '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' -- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && cmake -DHAVE_GTK2=NO -DPYTHON_ARCH_INSTALL_DIR=/pypath -DPYTHON_LIB_INSTALL_DIR=/pypath $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/pypath python ../makepanda/test_imports.py )' +- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && mv ../makepanda/test_imports.py . && ../makepanda/selfdestruct.py --yes && cmake -DHAVE_GTK2=NO -DPYTHON_ARCH_INSTALL_DIR=/pypath -DPYTHON_LIB_INSTALL_DIR=/pypath $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/pypath python test_imports.py )' notifications: irc: channels: From 2288a602aebf7b2440a8b63db9a186fd13065982 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 14:47:58 -0700 Subject: [PATCH 329/744] makepanda: Amend self-destruct to catch some missing composite files --- makepanda/selfdestruct.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/makepanda/selfdestruct.py b/makepanda/selfdestruct.py index 636f23dee5..79518a72d4 100755 --- a/makepanda/selfdestruct.py +++ b/makepanda/selfdestruct.py @@ -34,5 +34,5 @@ for project in projects: for path, dirs, files in os.walk(os.path.join(root, project)): # Get rid of _composite#.cxx files for filename in files: - if re.match(r'.*_composite[0-9]+\.cxx', filename): + if re.match(r'.*_composite[0-9]*\.(cxx|h|mm)', filename): os.unlink(os.path.join(path, filename)) From e204c884011aa92c561ec22d70feed11a2242afc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 15:01:04 -0700 Subject: [PATCH 330/744] CMake: Put an __init__.py in BUILDDIR/direct/ to point back to direct/src/ --- direct/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index e5481d9415..9f0772633b 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -19,6 +19,10 @@ add_subdirectory(src/showbase) if(HAVE_PYTHON) add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) target_link_libraries(direct core) + + # Make an __init__.py pointing at the source directory so users can run + # Panda3D code straight from their build path: + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "__path__.insert(0,r\"${CMAKE_CURRENT_SOURCE_DIR}/src\")") endif() # Installation: @@ -37,8 +41,8 @@ if(HAVE_PYTHON) endforeach() # We also need an __init__.py file, which we have to generate: - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/src/__init__.py" "") install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" + FILES "${CMAKE_CURRENT_BINARY_DIR}/src/__init__.py" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") endif() From a02357baefc9906e6c5c7bf9f926917bed47c774 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 15:02:53 -0700 Subject: [PATCH 331/744] travis: Don't bother "installing" Panda3D; run tests from build dir instead --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index baf84af18e..b25277107f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ addons: - zlib1g-dev script: - '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' -- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && mv ../makepanda/test_imports.py . && ../makepanda/selfdestruct.py --yes && cmake -DHAVE_GTK2=NO -DPYTHON_ARCH_INSTALL_DIR=/pypath -DPYTHON_LIB_INSTALL_DIR=/pypath $FLAGS .. && make -j4 && make install DESTDIR=installdir && LD_LIBRARY_PATH=installdir/usr/local/lib PYTHONPATH=installdir/pypath python test_imports.py )' +- '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && mv ../makepanda/test_imports.py . && ../makepanda/selfdestruct.py --yes && cmake -DHAVE_GTK2=NO $FLAGS .. && make -j4 && python test_imports.py )' notifications: irc: channels: From ee3644f8f33b125601486120adc2aad47679be46 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 17:22:37 -0700 Subject: [PATCH 332/744] CMake: Update for upstream changes. --- panda/src/gobj/CMakeLists.txt | 2 ++ panda/src/pgraphnodes/CMakeLists.txt | 2 ++ 2 files changed, 4 insertions(+) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 2d352f5c6a..f05b1d65c9 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -41,6 +41,7 @@ set(P3GOBJ_HEADERS queryContext.I queryContext.h savedContext.I savedContext.h shader.I shader.h + shaderBuffer.h shaderBuffer.I shaderContext.h shaderContext.I simpleAllocator.h simpleAllocator.I simpleLru.h simpleLru.I @@ -116,6 +117,7 @@ set(P3GOBJ_SOURCES samplerState.cxx savedContext.cxx shader.cxx + shaderBuffer.cxx shaderContext.cxx simpleAllocator.cxx simpleLru.cxx diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 8e09ca530c..ceb9abe1a3 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -10,6 +10,7 @@ set(P3PGRAPHNODES_HEADERS lodNode.I lodNode.h lodNodeType.h nodeCullCallbackData.h nodeCullCallbackData.I pointLight.h pointLight.I + rectangleLight.h rectangleLight.I sceneGraphAnalyzer.h sceneGraphAnalyzer.I selectiveChildNode.h selectiveChildNode.I sequenceNode.h sequenceNode.I @@ -32,6 +33,7 @@ set(P3PGRAPHNODES_SOURCES lodNode.cxx lodNodeType.cxx nodeCullCallbackData.cxx pointLight.cxx + rectangleLight.cxx sceneGraphAnalyzer.cxx selectiveChildNode.cxx sequenceNode.cxx From 43e005ad05d2bc97a04892d860a7b0d6064c8d9d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 17:37:02 -0700 Subject: [PATCH 333/744] general: Fix missing includes. --- panda/src/gobj/shaderBuffer.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/gobj/shaderBuffer.h b/panda/src/gobj/shaderBuffer.h index 5faa4322ac..549ebdc536 100644 --- a/panda/src/gobj/shaderBuffer.h +++ b/panda/src/gobj/shaderBuffer.h @@ -15,8 +15,11 @@ #define SHADERBUFFER_H #include "pandabase.h" +#include "typedWritableReferenceCount.h" #include "namable.h" #include "geomEnums.h" +#include "graphicsStateGuardianBase.h" +#include "factoryParams.h" class BufferContext; class PreparedGraphicsObjects; From 0e45b3288ebccd0d41c453a75862bf4de2d8c26b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 26 Dec 2016 18:10:43 -0700 Subject: [PATCH 334/744] CMake: Disable in-source builds. --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f6a0702a68..e144257a37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,8 @@ # We require 2.8.4 because earlier releases had a bug # with invalid HEADER_FILE_ONLY behavior in MSVC 2010. cmake_minimum_required(VERSION 2.8.4) +set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below +set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below project(Panda3D) enable_testing() From 19b448e09e34e8bdabb6767d7ca4a6fad125e4c4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 15 Feb 2017 03:18:19 -0700 Subject: [PATCH 335/744] CMake: Update master CMakeLists to compile for C++11 --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e144257a37..558dcbff1b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,6 +6,20 @@ set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below project(Panda3D) enable_testing() +# Panda3D is now a C++11 project. Newer versions of CMake support this out of +# the box; for older versions we take a shot in the dark: +if(CMAKE_VERSION VERSION_LESS "3.1") + include(CheckCXXCompilerFlag) + check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11) + if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + endif() +else() + set(CMAKE_CXX_STANDARD 11) +endif() + # Add generic modules to cmake module path, # and add Panda3D specific modules to cmake module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") From dd490656a097ae97424913353bf4aecad9b24698 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 15 Feb 2017 01:40:28 -0700 Subject: [PATCH 336/744] CMake: Update for upstream changes --- dtool/src/cppparser/CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 80d5bdcfff..4384f756e9 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -2,12 +2,13 @@ add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) set(P3CPPPARSER_HEADERS cppArrayType.h cppBison.yxx cppBisonDefs.h - cppClassTemplateParameter.h cppCommentBlock.h cppConstType.h + cppClassTemplateParameter.h cppCommentBlock.h + cppClosureType.h cppConstType.h cppDeclaration.h cppEnumType.h cppExpression.h cppExpressionParser.h cppExtensionType.h cppFile.h cppFunctionGroup.h cppFunctionType.h cppGlobals.h cppIdentifier.h cppInstance.h cppInstanceIdentifier.h - cppMakeProperty.h cppMakeSeq.h cppManifest.h + cppMakeProperty.h cppMakeSeq.h cppManifest.h cppNameComponent.h cppNamespace.h cppParameterList.h cppParser.h cppPointerType.h cppPreprocessor.h cppReferenceType.h cppScope.h @@ -20,12 +21,12 @@ set(P3CPPPARSER_HEADERS set(P3CPPPARSER_SOURCES cppArrayType.cxx ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx cppClassTemplateParameter.cxx - cppCommentBlock.cxx cppConstType.cxx cppDeclaration.cxx + cppCommentBlock.cxx cppClosureType.cxx cppConstType.cxx cppDeclaration.cxx cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx cppInstance.cxx cppInstanceIdentifier.cxx - cppMakeProperty.cxx cppMakeSeq.cxx cppManifest.cxx + cppMakeProperty.cxx cppMakeSeq.cxx cppManifest.cxx cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx From de03c2f7ff97b21a6912f040c69db545e81b7482 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 15 Feb 2017 04:00:37 -0700 Subject: [PATCH 337/744] CMake: Use gnu++* instead of c++* This is for consistency with the CMake 3.1+ behavior and allows the use of GNU extensions. Thanks @rdb! --- CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 558dcbff1b..1d36d8624d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,11 +10,11 @@ enable_testing() # the box; for older versions we take a shot in the dark: if(CMAKE_VERSION VERSION_LESS "3.1") include(CheckCXXCompilerFlag) - check_cxx_compiler_flag("-std=c++11" COMPILER_SUPPORTS_CXX11) + check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") endif() else() set(CMAKE_CXX_STANDARD 11) From 88dd3389ee13e5921622d3d4003e9d7fcbf365a4 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 19 Feb 2017 23:42:48 +0100 Subject: [PATCH 338/744] cmake: install header files --- direct/src/dcparser/CMakeLists.txt | 1 + direct/src/deadrec/CMakeLists.txt | 1 + direct/src/directbase/CMakeLists.txt | 1 + direct/src/distributed/CMakeLists.txt | 1 + direct/src/interval/CMakeLists.txt | 1 + dtool/src/dconfig/CMakeLists.txt | 1 + dtool/src/dtoolbase/CMakeLists.txt | 1 + dtool/src/dtoolutil/CMakeLists.txt | 4 +++- dtool/src/interrogatedb/CMakeLists.txt | 1 + dtool/src/prc/CMakeLists.txt | 1 + dtool/src/pystub/CMakeLists.txt | 1 + panda/src/audio/CMakeLists.txt | 1 + panda/src/chan/CMakeLists.txt | 1 + panda/src/char/CMakeLists.txt | 1 + panda/src/collide/CMakeLists.txt | 1 + panda/src/cull/CMakeLists.txt | 1 + panda/src/device/CMakeLists.txt | 1 + panda/src/dgraph/CMakeLists.txt | 1 + panda/src/display/CMakeLists.txt | 1 + panda/src/downloader/CMakeLists.txt | 1 + panda/src/dxml/CMakeLists.txt | 1 + panda/src/egg/CMakeLists.txt | 1 + panda/src/egg2pg/CMakeLists.txt | 1 + panda/src/event/CMakeLists.txt | 1 + panda/src/express/CMakeLists.txt | 1 + panda/src/ffmpeg/CMakeLists.txt | 1 + panda/src/framework/CMakeLists.txt | 1 + panda/src/glgsg/CMakeLists.txt | 1 + panda/src/glstuff/CMakeLists.txt | 1 + panda/src/gobj/CMakeLists.txt | 1 + panda/src/grutil/CMakeLists.txt | 1 + panda/src/gsgbase/CMakeLists.txt | 1 + panda/src/linmath/CMakeLists.txt | 1 + panda/src/mathutil/CMakeLists.txt | 1 + panda/src/movies/CMakeLists.txt | 1 + panda/src/nativenet/CMakeLists.txt | 1 + panda/src/net/CMakeLists.txt | 1 + panda/src/ode/CMakeLists.txt | 1 + panda/src/pandabase/CMakeLists.txt | 1 + panda/src/parametrics/CMakeLists.txt | 1 + panda/src/particlesystem/CMakeLists.txt | 1 + panda/src/pgraph/CMakeLists.txt | 1 + panda/src/pgraphnodes/CMakeLists.txt | 1 + panda/src/pgui/CMakeLists.txt | 1 + panda/src/physics/CMakeLists.txt | 1 + panda/src/pipeline/CMakeLists.txt | 1 + panda/src/pnmimage/CMakeLists.txt | 1 + panda/src/pnmtext/CMakeLists.txt | 1 + panda/src/pstatclient/CMakeLists.txt | 1 + panda/src/putil/CMakeLists.txt | 1 + panda/src/recorder/CMakeLists.txt | 1 + panda/src/text/CMakeLists.txt | 1 + panda/src/tform/CMakeLists.txt | 1 + 53 files changed, 55 insertions(+), 1 deletion(-) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index cfb105bfcf..917d517774 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -53,3 +53,4 @@ target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) install(TARGETS p3dcparser DESTINATION lib) +install(FILES ${P3DCPARSER_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 669d98b28f..26e745268d 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -11,3 +11,4 @@ target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) target_interrogate(p3deadrec ALL) install(TARGETS p3deadrec DESTINATION lib) +install(FILES ${P3DEADREC_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index d8722cb41d..7db522fc65 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -11,3 +11,4 @@ add_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) target_link_libraries(p3directbase p3pandabase) install(TARGETS p3directbase DESTINATION lib) +install(FILES ${P3DIRECTBASE_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 0da55087a1..1b4c06be44 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -23,4 +23,5 @@ if(HAVE_PYTHON) target_interrogate(p3distributed ALL) install(TARGETS p3distributed DESTINATION lib) + install(FILES ${P3DISTRIBUTED_HEADERS} DESTINATION include/panda3d) endif() diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 6931de86c9..346222657e 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -41,3 +41,4 @@ target_link_libraries(p3interval p3directbase p3pstatclient p3pgraph p3chan p3dc target_interrogate(p3interval ALL) install(TARGETS p3interval DESTINATION lib) +install(FILES ${P3INTERVAL_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index f07c356b58..9a4280f7a7 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -10,3 +10,4 @@ add_library(p3dconfig ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) target_link_libraries(p3dconfig p3prc) install(TARGETS p3dconfig DESTINATION lib) +install(FILES ${P3DCONFIG_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index e4deb8a11c..fa6f94b6b1 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -68,3 +68,4 @@ add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) target_use_packages(p3dtoolbase THREADS PYTHON) install(TARGETS p3dtoolbase DESTINATION lib) +install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index bcfa1c04a2..de973ec598 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -4,6 +4,7 @@ configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) set(P3DTOOLUTIL_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h + ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h config_dtoolutil.h dSearchPath.I dSearchPath.h executionEnvironment.I executionEnvironment.h filename.I @@ -14,7 +15,7 @@ set(P3DTOOLUTIL_HEADERS load_dso.h pandaFileStream.h pandaFileStream.I pandaFileStreamBuf.h - pandaSystem.h pandaVersion.h + pandaSystem.h panda_getopt.h panda_getopt_long.h panda_getopt_impl.h pfstream.h pfstream.I pfstreamBuf.h preprocess_argv.h @@ -68,3 +69,4 @@ if(APPLE) endif() install(TARGETS p3dtoolutil DESTINATION lib) +install(FILES ${P3DTOOLUTIL_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 47a9ed14dd..fddc089a3e 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -31,3 +31,4 @@ add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES target_link_libraries(p3interrogatedb p3dconfig) install(TARGETS p3interrogatedb DESTINATION lib) +install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index ad2213024f..14f9d2959c 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -68,3 +68,4 @@ add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES}) install(TARGETS p3prc DESTINATION lib) +install(FILES ${P3PRC_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index 0054a7a948..09cc066b09 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -3,3 +3,4 @@ set(P3PYSTUB_SOURCES pystub.cxx) add_library(p3pystub STATIC ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) target_link_libraries(p3pystub p3dtoolbase) +install(FILES ${P3PYSTUB_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index b674c313f7..b382e1ab8c 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -23,4 +23,5 @@ if(HAVE_AUDIO) target_interrogate(p3audio ALL) install(TARGETS p3audio DESTINATION lib) + install(FILES ${P3AUDIO_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 63af290c67..2a1522b0d7 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -58,3 +58,4 @@ target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) install(TARGETS p3chan DESTINATION lib) +install(FILES ${P3CHAN_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 8196969d63..fa4af297d2 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -24,3 +24,4 @@ target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) install(TARGETS p3char DESTINATION lib) +install(FILES ${P3CHAR_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 5ba2b5cae7..e8c511531c 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -68,6 +68,7 @@ target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) install(TARGETS p3collide DESTINATION lib) +install(FILES ${P3COLLIDE_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_collide diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index 4b8001920f..22e0e6d1a9 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -26,3 +26,4 @@ target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) install(TARGETS p3cull DESTINATION lib) +install(FILES ${P3CULL_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 91e7dfbee1..5e2daf8d23 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -32,3 +32,4 @@ target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) install(TARGETS p3device DESTINATION lib) +install(FILES ${P3DEVICE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 592d34acff..2be765d73a 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -17,3 +17,4 @@ target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) install(TARGETS p3dgraph DESTINATION lib) +install(FILES ${P3DGRAPH_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 245e8c8ce7..c4d562692c 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -92,6 +92,7 @@ target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) install(TARGETS p3display DESTINATION lib) +install(FILES ${P3DISPLAY_HEADERS} DESTINATION include/panda3d) if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) # We build a static library of just these files, so the plugin can diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 34f0037cd3..f6a4917ba0 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -73,3 +73,4 @@ target_link_libraries(p3downloader p3express p3pipeline) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) install(TARGETS p3downloader DESTINATION lib) +install(FILES ${P3DOWNLOADER_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 1c889c3351..1ed083a8e0 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -17,3 +17,4 @@ target_link_libraries(p3dxml p3express) target_interrogate(p3dxml ALL) install(TARGETS p3dxml DESTINATION lib) +install(FILES ${P3DXML_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index caa59abeef..08f881044f 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -104,4 +104,5 @@ if(HAVE_EGG) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) install(TARGETS p3egg DESTINATION lib) + install(FILES ${P3EGG_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 71d91c3365..c7b23c8acf 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -35,4 +35,5 @@ if(HAVE_EGG) target_interrogate(p3egg2pg ALL) install(TARGETS p3egg2pg DESTINATION lib) + install(FILES ${P3EGG2PG_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index b2976a4136..fd65faf346 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -46,6 +46,7 @@ target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) install(TARGETS p3event DESTINATION lib) +install(FILES ${P3EVENT_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_task diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 78b0bd196d..6304ae8be6 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -155,6 +155,7 @@ if(WIN32) endif() install(TARGETS p3express DESTINATION lib) +install(FILES ${P3EXPRESS_HEADERS} DESTINATION include/panda3d) #add_executable(p3expressTestTypes test_types.cxx) #target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 932e080782..b8a41c2b6e 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -23,4 +23,5 @@ if(HAVE_FFMPEG) target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) install(TARGETS p3ffmpeg DESTINATION lib) + install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index cf74d523d9..ff441c724a 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -55,3 +55,4 @@ add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) install(TARGETS p3framework DESTINATION lib) +install(FILES ${P3FRAMEWORK_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 676ee264eb..94817a9805 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -14,4 +14,5 @@ if(HAVE_GL) ${OPENGL_LIBRARIES} ${_CG_LIBRARIES}) install(TARGETS p3glgsg DESTINATION lib) + install(FILES ${P3GLGSG_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 527e9e827f..6326195a0e 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -35,4 +35,5 @@ if(HAVE_GL) target_link_libraries(p3glstuff p3pandabase p3gobj) install(TARGETS p3glstuff DESTINATION lib) + install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index f05b1d65c9..5064b2263d 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -166,6 +166,7 @@ target_link_libraries(p3gobj p3gsgbase p3pnmimage target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) install(TARGETS p3gobj DESTINATION lib) +install(FILES ${P3GOBJ_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_gobj diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index e4090fa2a4..38c21a3c2c 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -46,3 +46,4 @@ endif() target_interrogate(p3grutil ALL) install(TARGETS p3grutil DESTINATION lib) +install(FILES ${P3GRUTIL_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index e10fc246e6..b6b0e1a93b 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -18,6 +18,7 @@ target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) install(TARGETS p3gsgbase DESTINATION lib) +install(FILES ${P3GSGBASE_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_gsgbase diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index ae085bc6db..be69df108f 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -49,6 +49,7 @@ target_link_libraries(p3linmath p3express p3pandabase) target_interrogate(p3linmath ALL) install(TARGETS p3linmath DESTINATION lib) +install(FILES ${P3LINMATH_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_math diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 7a482eda35..6227880573 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -66,6 +66,7 @@ target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}) target_interrogate(p3mathutil ALL) install(TARGETS p3mathutil DESTINATION lib) +install(FILES ${P3MATHUTIL_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_mathutil diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 24f0ccebf2..d03f166479 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -43,3 +43,4 @@ target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dcon target_interrogate(p3movies ALL) install(TARGETS p3movies DESTINATION lib) +install(FILES ${P3MOVIES_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 128d2aaff9..ce3cb8191e 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -30,4 +30,5 @@ if(WANT_NATIVE_NET) target_interrogate(p3nativenet ALL) install(TARGETS p3nativenet DESTINATION lib) + install(FILES ${P3NATIVENET_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index e052940e8e..c119cea610 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -35,4 +35,5 @@ if(HAVE_NET AND WANT_NATIVE_NET) endif() install(TARGETS p3net DESTINATION lib) + install(FILES ${P3NET_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 25795f4fc0..b5ed1e9840 100755 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -87,4 +87,5 @@ if(HAVE_ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) install(TARGETS p3ode DESTINATION lib) + install(FILES ${P3ODE_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index d43bb13e17..89eb1483ec 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -10,3 +10,4 @@ add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) target_link_libraries(p3pandabase p3dtoolbase) install(TARGETS p3pandabase DESTINATION lib) +install(FILES ${P3PANDABASE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index ed92d61f8c..8e214964c5 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -39,6 +39,7 @@ target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) install(TARGETS p3parametrics DESTINATION lib) +install(FILES ${P3PARAMETRICS_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_parametrics diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index f2e405b41b..75b970d4bd 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -43,3 +43,4 @@ target_link_libraries(p3particlesystem p3pgraph p3physics) target_interrogate(p3particlesystem ALL) install(TARGETS p3particlesystem DESTINATION lib) +install(FILES ${P3PARTICLESYSTEM_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index fdff3841d9..67da31fb98 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -218,6 +218,7 @@ target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3down target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) install(TARGETS p3pgraph DESTINATION lib) +install(FILES ${P3PGRAPH_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index ceb9abe1a3..b1c745838f 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -50,3 +50,4 @@ target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) install(TARGETS p3pgraphnodes DESTINATION lib) +install(FILES ${P3PGRAPHNODES_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 19b83ad110..d7d425a087 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -45,6 +45,7 @@ target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) install(TARGETS p3pgui DESTINATION lib) +install(FILES ${P3PGUI_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_pgentry diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 3353864326..c74b40e6de 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -41,3 +41,4 @@ target_link_libraries(p3physics p3pgraph p3linmath p3collide) target_interrogate(p3physics ALL) install(TARGETS p3physics DESTINATION lib) +install(FILES ${P3PHYSICS_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 29e5dfc586..141cb6ae4a 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -141,6 +141,7 @@ target_link_libraries(p3pipeline p3express) target_interrogate(p3pipeline ALL) install(TARGETS p3pipeline DESTINATION lib) +install(FILES ${P3PIPELINE_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_threaddata diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index a813a6fd1e..1cf9cc11b3 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -40,3 +40,4 @@ target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) install(TARGETS p3pnmimage DESTINATION lib) +install(FILES ${P3PNMIMAGE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index ffb3388961..6ad9d8372a 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -20,4 +20,5 @@ if(HAVE_FREETYPE) target_interrogate(p3pnmtext ALL) install(TARGETS p3pnmtext DESTINATION lib) + install(FILES ${P3PNMTEXT_HEADERS} DESTINATION include/panda3d) endif() diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index d534c32f60..701913c88a 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -26,3 +26,4 @@ target_link_libraries(p3pstatclient p3net p3putil p3express) target_interrogate(p3pstatclient ALL) install(TARGETS p3pstatclient DESTINATION lib) +install(FILES ${P3PSTATCLIENT_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index c0a213add5..ea32bcd1c7 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -127,6 +127,7 @@ target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) install(TARGETS p3putil DESTINATION lib) +install(FILES ${P3PUTIL_HEADERS} DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_bamRead diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index b7b982136b..e5258ba0ee 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -22,3 +22,4 @@ target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) install(TARGETS p3recorder DESTINATION lib) +install(FILES ${P3RECORDER_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 4feb48af74..2c8e1f6b35 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -41,3 +41,4 @@ endif() target_interrogate(p3text ALL) install(TARGETS p3text DESTINATION lib) +install(FILES ${P3TEXT_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index bc83ac1088..d45f162f0e 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -32,3 +32,4 @@ target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) install(TARGETS p3tform DESTINATION lib) +install(FILES ${P3TFORM_HEADERS} DESTINATION include/panda3d) From 1e30cf6c16095295796fdf80efd94b39cec73a30 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Mar 2017 01:20:02 -0700 Subject: [PATCH 339/744] CMake: Build PythonThread as an IGATEEXT This frees up a dependency from p3pipeline proper against Python --- panda/src/pipeline/CMakeLists.txt | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 141cb6ae4a..9775c4b891 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -124,21 +124,15 @@ if(WIN32) ) endif() -if(HAVE_PYTHON) - set(P3PIPELINE_HEADERS - ${P3PIPELINE_HEADERS} - pythonThread.h - ) - set(P3PIPELINE_SOURCES - ${P3PIPELINE_SOURCES} +set(P3PIPELINE_IGATEEXT pythonThread.cxx - ) -endif() + pythonThread.h +) composite_sources(p3pipeline P3PIPELINE_SOURCES) add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) target_link_libraries(p3pipeline p3express) -target_interrogate(p3pipeline ALL) +target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) install(TARGETS p3pipeline DESTINATION lib) install(FILES ${P3PIPELINE_HEADERS} DESTINATION include/panda3d) From 02c8d261505c7e356223c67efc426e5644f89970 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Mar 2017 01:35:25 -0700 Subject: [PATCH 340/744] CMake: Don't depend on metalibs The metalibs may be phased out and should really be thought of as a user convenience for the time being. --- panda/src/express/CMakeLists.txt | 3 ++- pandatool/src/converter/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 6304ae8be6..60a258b4c8 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -146,8 +146,9 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -target_link_libraries(p3express p3pandabase p3dtool p3dtoolconfig +target_link_libraries(p3express p3pandabase p3dtool p3prc p3dconfig ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) +target_include_directories(p3express PUBLIC $) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(WIN32) diff --git a/pandatool/src/converter/CMakeLists.txt b/pandatool/src/converter/CMakeLists.txt index 45cf7a9e30..4dd62fb15c 100644 --- a/pandatool/src/converter/CMakeLists.txt +++ b/pandatool/src/converter/CMakeLists.txt @@ -6,4 +6,4 @@ set(P3CONVERTER_SOURCES somethingToEggConverter.cxx eggToSomethingConverter.cxx) add_library(p3converter STATIC ${P3CONVERTER_HEADERS} ${P3CONVERTER_SOURCES}) -target_link_libraries(p3converter p3pandatoolbase pandaegg p3pystub) +target_link_libraries(p3converter p3pandatoolbase p3egg2pg p3pystub) From 6926fbfbe69520fd23ae4ff4cc2641185fa09a26 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Mar 2017 01:44:27 -0700 Subject: [PATCH 341/744] CMake: Push Python links back to where they're actually needed This keeps the Panda3D core free of any Python-specific linkage --- direct/src/dcparser/CMakeLists.txt | 1 + direct/src/distributed/CMakeLists.txt | 1 + dtool/src/dtoolbase/CMakeLists.txt | 2 +- dtool/src/dtoolutil/CMakeLists.txt | 3 --- dtool/src/interrogatedb/CMakeLists.txt | 1 + 5 files changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 917d517774..a959ba7695 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -50,6 +50,7 @@ add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) +target_use_packages(p3dcparser PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) install(TARGETS p3dcparser DESTINATION lib) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 1b4c06be44..a04ba893a4 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -14,6 +14,7 @@ if(HAVE_PYTHON) add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser p3pgraph) + target_use_packages(p3distributed PYTHON) if(WANT_NATIVE_NET) target_link_libraries(p3distributed p3nativenet) endif() diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index fa6f94b6b1..95e9c2e2e0 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -65,7 +65,7 @@ set(P3DTOOLBASE_SOURCES composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -target_use_packages(p3dtoolbase THREADS PYTHON) +target_use_packages(p3dtoolbase THREADS) install(TARGETS p3dtoolbase DESTINATION lib) install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index de973ec598..3a6b01c1e7 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -58,9 +58,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) -if(HAVE_PYTHON) - target_link_libraries(p3dtoolutil ${PYTHON_LIBRARIES}) -endif() if(APPLE) find_library(FOUNDATION_LIBRARY Foundation) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index fddc089a3e..798335b2b5 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -29,6 +29,7 @@ composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) +target_use_packages(p3interrogatedb PYTHON) install(TARGETS p3interrogatedb DESTINATION lib) install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) From 9d9558ff4e6b3c18c0fbf9158bf8dcbc39f29650 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Mar 2017 06:38:31 -0700 Subject: [PATCH 342/744] CMake: Don't use target_include_directories in CMake < 2.8.11 --- panda/src/express/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 60a258b4c8..339a5cbf4f 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -145,10 +145,20 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) -add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) +# p3express needs to include from p3interrogatedb for py_panda.h and extension.h +if(CMAKE_VERSION VERSION_LESS 2.8.11) + get_target_property(interrogatedb_interface_dirs p3interrogatedb INTERFACE_INCLUDE_DIRECTORIES) + include_directories(${interrogatedb_interface_dirs}) + add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) + set_target_properties(p3express PROPERTIES INTERFACE_INCLUDE_DIRECTORIES + "${interrogatedb_interface_dirs};${CMAKE_CURRENT_SOURCE_DIR}") +else() + add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) + target_include_directories(p3express PUBLIC + $) +endif() target_link_libraries(p3express p3pandabase p3dtool p3prc p3dconfig ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) -target_include_directories(p3express PUBLIC $) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(WIN32) From cbbfbfd0bb48e93eb1de092bef9f3be3337a3e43 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 5 Aug 2017 23:09:35 -0600 Subject: [PATCH 343/744] CMake: Build FLT programs --- pandatool/CMakeLists.txt | 4 ++ pandatool/src/cvscopy/CMakeLists.txt | 11 ++++ pandatool/src/flt/CMakeLists.txt | 85 +++++++++++++++++++++++++++ pandatool/src/fltegg/CMakeLists.txt | 13 ++++ pandatool/src/fltprogs/CMakeLists.txt | 19 ++++++ 5 files changed, 132 insertions(+) create mode 100644 pandatool/src/cvscopy/CMakeLists.txt create mode 100644 pandatool/src/flt/CMakeLists.txt create mode 100644 pandatool/src/fltegg/CMakeLists.txt create mode 100644 pandatool/src/fltprogs/CMakeLists.txt diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index f89483ed3f..3a33e46e67 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -6,7 +6,11 @@ endif() add_subdirectory(src/pandatoolbase) add_subdirectory(src/progbase) add_subdirectory(src/converter) +add_subdirectory(src/cvscopy) add_subdirectory(src/eggbase) add_subdirectory(src/bam) +add_subdirectory(src/flt) +add_subdirectory(src/fltegg) +add_subdirectory(src/fltprogs) add_subdirectory(src/pstatserver) add_subdirectory(src/gtk-stats) diff --git a/pandatool/src/cvscopy/CMakeLists.txt b/pandatool/src/cvscopy/CMakeLists.txt new file mode 100644 index 0000000000..68b0a30ed1 --- /dev/null +++ b/pandatool/src/cvscopy/CMakeLists.txt @@ -0,0 +1,11 @@ +set(P3CVSCOPY_HEADERS + cvsCopy.h cvsSourceDirectory.h cvsSourceTree.h) + +set(P3CVSCOPY_SOURCES + cvsCopy.cxx cvsSourceDirectory.cxx cvsSourceTree.cxx) + +add_library(p3cvscopy STATIC ${P3CVSCOPY_HEADERS} ${P3CVSCOPY_SOURCES}) +target_link_libraries(p3cvscopy p3progbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/flt/CMakeLists.txt b/pandatool/src/flt/CMakeLists.txt new file mode 100644 index 0000000000..be35f038f3 --- /dev/null +++ b/pandatool/src/flt/CMakeLists.txt @@ -0,0 +1,85 @@ +set(P3FLT_HEADERS + config_flt.h + fltBead.h + fltBeadID.h + fltCurve.I fltCurve.h + fltError.h + fltExternalReference.h + fltEyepoint.h + fltFace.I fltFace.h + fltGeometry.I fltGeometry.h + fltGroup.h + fltHeader.h + fltInstanceDefinition.h + fltInstanceRef.h + fltLightSourceDefinition.h + fltLocalVertexPool.I fltLocalVertexPool.h + fltLOD.h + fltMaterial.h + fltMesh.I fltMesh.h + fltMeshPrimitive.I fltMeshPrimitive.h + fltObject.h + fltOpcode.h + fltPackedColor.I fltPackedColor.h + fltRecord.I fltRecord.h + fltRecordReader.h + fltRecordWriter.h + fltTexture.h + fltTrackplane.h + fltTransformGeneralMatrix.h + fltTransformPut.h + fltTransformRecord.h + fltTransformRotateAboutEdge.h + fltTransformRotateAboutPoint.h + fltTransformRotateScale.h + fltTransformScale.h + fltTransformTranslate.h + fltUnsupportedRecord.h + fltVectorRecord.h + fltVertex.I fltVertex.h + fltVertexList.h) + +set(P3FLT_SOURCES + config_flt.cxx + fltBead.cxx + fltBeadID.cxx + fltCurve.cxx + fltError.cxx + fltExternalReference.cxx + fltEyepoint.cxx + fltFace.cxx + fltGeometry.cxx + fltGroup.cxx + fltHeader.cxx + fltInstanceDefinition.cxx + fltInstanceRef.cxx + fltLightSourceDefinition.cxx + fltLocalVertexPool.cxx + fltLOD.cxx + fltMaterial.cxx + fltMesh.cxx + fltMeshPrimitive.cxx + fltObject.cxx + fltOpcode.cxx + fltPackedColor.cxx + fltRecord.cxx + fltRecordReader.cxx + fltRecordWriter.cxx + fltTexture.cxx + fltTrackplane.cxx + fltTransformGeneralMatrix.cxx + fltTransformPut.cxx + fltTransformRecord.cxx + fltTransformRotateAboutEdge.cxx + fltTransformRotateAboutPoint.cxx + fltTransformRotateScale.cxx + fltTransformScale.cxx + fltTransformTranslate.cxx + fltUnsupportedRecord.cxx + fltVectorRecord.cxx + fltVertex.cxx + fltVertexList.cxx) + +composite_sources(p3flt P3FLT_SOURCES) +add_library(p3flt STATIC ${P3FLT_HEADERS} ${P3FLT_SOURCES}) +target_link_libraries(p3flt p3pandatoolbase p3mathutil) diff --git a/pandatool/src/fltegg/CMakeLists.txt b/pandatool/src/fltegg/CMakeLists.txt new file mode 100644 index 0000000000..c68bfca000 --- /dev/null +++ b/pandatool/src/fltegg/CMakeLists.txt @@ -0,0 +1,13 @@ +set(P3FLTEGG_HEADERS + fltToEggConverter.I fltToEggConverter.h + fltToEggLevelState.I fltToEggLevelState.h) + +set(P3FLTEGG_SOURCES + fltToEggConverter.cxx + fltToEggLevelState.cxx) + +add_library(p3fltegg STATIC ${P3FLTEGG_HEADERS} ${P3FLTEGG_SOURCES}) +target_link_libraries(p3fltegg p3flt p3converter) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/fltprogs/CMakeLists.txt b/pandatool/src/fltprogs/CMakeLists.txt new file mode 100644 index 0000000000..6e4058b504 --- /dev/null +++ b/pandatool/src/fltprogs/CMakeLists.txt @@ -0,0 +1,19 @@ +add_executable(flt-info fltInfo.cxx fltInfo.h) +target_link_libraries(flt-info p3progbase p3flt) +install(TARGETS flt-info DESTINATION bin) + +add_executable(flt-trans fltTrans.cxx fltTrans.h) +target_link_libraries(flt-trans p3progbase p3flt) +install(TARGETS flt-trans DESTINATION bin) + +add_executable(fltcopy fltCopy.cxx fltCopy.h) +target_link_libraries(fltcopy p3progbase p3cvscopy p3flt) +install(TARGETS fltcopy DESTINATION bin) + +add_executable(egg2flt eggToFlt.cxx eggToFlt.h) +target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase) +install(TARGETS egg2flt DESTINATION bin) + +add_executable(flt2egg fltToEgg.cxx fltToEgg.h) +target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase) +install(TARGETS flt2egg DESTINATION bin) From 4fdcaef59f4bf75ee216a79dfea494d3572f4ad2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 7 Aug 2017 18:36:11 -0600 Subject: [PATCH 344/744] CMake: Build DXF programs --- pandatool/CMakeLists.txt | 3 +++ pandatool/src/dxf/CMakeLists.txt | 15 +++++++++++++++ pandatool/src/dxfegg/CMakeLists.txt | 13 +++++++++++++ pandatool/src/dxfprogs/CMakeLists.txt | 11 +++++++++++ 4 files changed, 42 insertions(+) create mode 100644 pandatool/src/dxf/CMakeLists.txt create mode 100644 pandatool/src/dxfegg/CMakeLists.txt create mode 100644 pandatool/src/dxfprogs/CMakeLists.txt diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 3a33e46e67..3eb7202250 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -12,5 +12,8 @@ add_subdirectory(src/bam) add_subdirectory(src/flt) add_subdirectory(src/fltegg) add_subdirectory(src/fltprogs) +add_subdirectory(src/dxf) +add_subdirectory(src/dxfegg) +add_subdirectory(src/dxfprogs) add_subdirectory(src/pstatserver) add_subdirectory(src/gtk-stats) diff --git a/pandatool/src/dxf/CMakeLists.txt b/pandatool/src/dxf/CMakeLists.txt new file mode 100644 index 0000000000..d190b1bea9 --- /dev/null +++ b/pandatool/src/dxf/CMakeLists.txt @@ -0,0 +1,15 @@ +set(P3DXF_HEADERS + dxfFile.h + dxfLayer.h + dxfLayerMap.h + dxfVertex.h) + +set(P3DXF_SOURCES + dxfFile.cxx + dxfLayer.cxx + dxfLayerMap.cxx + dxfVertex.cxx) + +composite_sources(p3dxf P3DXF_SOURCES) +add_library(p3dxf STATIC ${P3DXF_HEADERS} ${P3DXF_SOURCES}) +target_link_libraries(p3dxf p3pandatoolbase) diff --git a/pandatool/src/dxfegg/CMakeLists.txt b/pandatool/src/dxfegg/CMakeLists.txt new file mode 100644 index 0000000000..43f32316df --- /dev/null +++ b/pandatool/src/dxfegg/CMakeLists.txt @@ -0,0 +1,13 @@ +set(P3DXFEGG_HEADERS + dxfToEggConverter.h + dxfToEggLayer.h) + +set(P3DXFEGG_SOURCES + dxfToEggConverter.cxx + dxfToEggLayer.cxx) + +add_library(p3dxfegg STATIC ${P3DXFEGG_HEADERS} ${P3DXFEGG_SOURCES}) +target_link_libraries(p3dxfegg p3dxf p3converter) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/dxfprogs/CMakeLists.txt b/pandatool/src/dxfprogs/CMakeLists.txt new file mode 100644 index 0000000000..8968b24fb4 --- /dev/null +++ b/pandatool/src/dxfprogs/CMakeLists.txt @@ -0,0 +1,11 @@ +add_executable(dxf-points dxfPoints.cxx dxfPoints.h) +target_link_libraries(dxf-points p3progbase p3dxf) +install(TARGETS dxf-points DESTINATION bin) + +add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h) +target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase) +install(TARGETS egg2dxf DESTINATION bin) + +add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h) +target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase) +install(TARGETS dxf2egg DESTINATION bin) From 0f3b52c51fa2f93ae4b08c35e3645d49747413d0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 30 Aug 2017 21:00:31 -0600 Subject: [PATCH 345/744] CMake: Define NOTIFY_DEBUG option --- dtool/Config.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 1d04802404..82c8831031 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -327,6 +327,11 @@ overhead to have this option available even if it is unused, it is by default enabled only in a development build. This has no effect on DirectX rendering." ${IS_DEBUG_BUILD}) +option(NOTIFY_DEBUG + "Do you want to include the 'debug' and 'spam' Notify messages? +Normally, these are stripped out when we build for release, but sometimes it's +useful to keep them around. Turn this setting on to achieve that." ${IS_DEBUG_BUILD}) + option(SUPPORT_FIXED_FUNCTION "This option compiles in support for the fixed-function OpenGL pipeline. It is only really useful to turn this off if you are targeting From 3e56ac48bf19aaf4ff754f80bda99d3ef3791cbe Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Feb 2018 16:27:10 -0700 Subject: [PATCH 346/744] general: Remove errant execute mode from CMakeLists.txt --- panda/src/ode/CMakeLists.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 panda/src/ode/CMakeLists.txt diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt old mode 100755 new mode 100644 From 8d1b20b9743d5d9eb71aeded38e018257e1dc17e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Feb 2018 15:56:14 -0700 Subject: [PATCH 347/744] CMake: Adjust for upstream changes --- dtool/src/dtoolutil/CMakeLists.txt | 8 ++++++++ dtool/src/interrogatedb/CMakeLists.txt | 6 ++++-- panda/src/cocoadisplay/CMakeLists.txt | 1 + panda/src/event/CMakeLists.txt | 4 ++++ panda/src/express/CMakeLists.txt | 25 ++++++++++++------------- panda/src/gsgbase/CMakeLists.txt | 2 -- panda/src/movies/CMakeLists.txt | 4 ++++ panda/src/pgraph/CMakeLists.txt | 4 ++++ panda/src/pipeline/CMakeLists.txt | 2 -- panda/src/putil/CMakeLists.txt | 2 ++ 10 files changed, 39 insertions(+), 19 deletions(-) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 3a6b01c1e7..6bdf9be8ff 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -23,7 +23,11 @@ set(P3DTOOLUTIL_HEADERS stringDecoder.h stringDecoder.I textEncoder.h textEncoder.I unicodeLatinMap.h + vector_double.h + vector_float.h + vector_int.h vector_string.h + vector_uchar.h vector_src.h win32ArgParser.h ) @@ -50,7 +54,11 @@ set(P3DTOOLUTIL_SOURCES stringDecoder.cxx textEncoder.cxx unicodeLatinMap.cxx + vector_double.cxx + vector_float.cxx + vector_int.cxx vector_string.cxx + vector_uchar.cxx win32ArgParser.cxx ) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 798335b2b5..eb13d2b302 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -10,7 +10,7 @@ set(P3INTERROGATEDB_HEADERS interrogateType.I interrogateType.h interrogate_datafile.I interrogate_datafile.h interrogate_interface.h interrogate_request.h - extension.h py_panda.h) + extension.h py_compat.h py_panda.h py_wrappers.h) set(P3INTERROGATEDB_SOURCES config_interrogatedb.cxx @@ -23,7 +23,9 @@ set(P3INTERROGATEDB_SOURCES interrogateManifest.cxx interrogateType.cxx interrogate_datafile.cxx interrogate_interface.cxx interrogate_request.cxx - py_panda.cxx) + py_compat.cxx + py_panda.cxx + py_wrappers.cxx) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index ce855a82c4..90bf13cf95 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -8,6 +8,7 @@ if(APPLE AND HAVE_GL AND HAVE_COCOA) set(P3COCOADISPLAY_SOURCES config_cocoadisplay.mm + cocoaGraphicsBuffer.mm cocoaGraphicsPipe.mm cocoaGraphicsStateGuardian.mm cocoaGraphicsWindow.mm diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index fd65faf346..c29fa3bcd8 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -1,4 +1,5 @@ set(P3EVENT_HEADERS + asyncFuture.h asyncFuture.I asyncTask.h asyncTask.I asyncTaskChain.h asyncTaskChain.I asyncTaskCollection.h asyncTaskCollection.I @@ -18,6 +19,7 @@ set(P3EVENT_HEADERS ) set(P3EVENT_SOURCES + asyncFuture.cxx asyncTask.cxx asyncTaskChain.cxx asyncTaskCollection.cxx @@ -35,6 +37,8 @@ set(P3EVENT_SOURCES ) set(P3EVENT_IGATEEXT + asyncFuture_ext.cxx + asyncFuture_ext.h pythonTask.cxx pythonTask.h pythonTask.I diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 339a5cbf4f..15f27dc53b 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -50,8 +50,6 @@ set(P3EXPRESS_HEADERS threadSafePointerToBase.I threadSafePointerToBase.h trueClock.I trueClock.h typedReferenceCount.I typedReferenceCount.h typedef.h - vector_uchar.h vector_double.h vector_float.h - vector_stdfloat.h virtualFile.I virtualFileList.I virtualFileList.h virtualFileMount.h virtualFileComposite.h virtualFileComposite.I virtualFile.h virtualFileMount.I virtualFileMountMultifile.h @@ -107,7 +105,6 @@ set(P3EXPRESS_SOURCES threadSafePointerToBase.cxx trueClock.cxx typedReferenceCount.cxx - vector_uchar.cxx vector_double.cxx vector_float.cxx virtualFileComposite.cxx virtualFile.cxx virtualFileList.cxx virtualFileMount.cxx virtualFileMountMultifile.cxx @@ -122,22 +119,24 @@ set(P3EXPRESS_SOURCES windowsRegistry.cxx zStream.cxx zStreamBuf.cxx) +# Some of these reside in dtoolbase/dtoolutil. But dtool isn't run through +# Interrogate; Panda is. So we're responsible for providing the extensions. set(P3EXPRESS_IGATEEXT - filename_ext.cxx - filename_ext.h - globPattern_ext.cxx - globPattern_ext.h + ../../../dtool/src/dtoolutil/filename_ext.cxx + ../../../dtool/src/dtoolutil/filename_ext.h + ../../../dtool/src/dtoolutil/globPattern_ext.cxx + ../../../dtool/src/dtoolutil/globPattern_ext.h memoryUsagePointers_ext.cxx memoryUsagePointers_ext.h pointerToArray_ext.h ramfile_ext.cxx ramfile_ext.h - streamReader_ext.cxx - streamReader_ext.h - streamWriter_ext.cxx - streamWriter_ext.h - typeHandle_ext.cxx - typeHandle_ext.h + ../../../dtool/src/prc/streamReader_ext.cxx + ../../../dtool/src/prc/streamReader_ext.h + ../../../dtool/src/prc/streamWriter_ext.cxx + ../../../dtool/src/prc/streamWriter_ext.h + ../../../dtool/src/dtoolbase/typeHandle_ext.cxx + ../../../dtool/src/dtoolbase/typeHandle_ext.h virtualFileSystem_ext.cxx virtualFileSystem_ext.h virtualFile_ext.cxx diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index b6b0e1a93b..37f54fe4b9 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -1,13 +1,11 @@ set(P3GSGBASE_HEADERS config_gsgbase.h - displayRegionBase.I displayRegionBase.h graphicsOutputBase.I graphicsOutputBase.h graphicsStateGuardianBase.h ) set(P3GSGBASE_SOURCES config_gsgbase.cxx - displayRegionBase.cxx graphicsOutputBase.cxx graphicsStateGuardianBase.cxx ) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index d03f166479..21273d25d6 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -10,6 +10,8 @@ set(P3MOVIES_HEADERS movieTypeRegistry.h movieTypeRegistry.I movieVideo.h movieVideo.I movieVideoCursor.h movieVideoCursor.I + opusAudio.h opusAudio.I + opusAudioCursor.h opusAudioCursor.I userDataAudio.h userDataAudio.I userDataAudioCursor.h userDataAudioCursor.I vorbisAudio.h vorbisAudio.I @@ -30,6 +32,8 @@ set(P3MOVIES_SOURCES movieTypeRegistry.cxx movieVideo.cxx movieVideoCursor.cxx + opusAudio.cxx + opusAudioCursor.cxx userDataAudio.cxx userDataAudioCursor.cxx vorbisAudio.cxx diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 67da31fb98..7d88a7adca 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -208,6 +208,10 @@ set(P3PGRAPH_IGATEEXT pandaNode_ext.h renderState_ext.cxx renderState_ext.h + shaderAttrib_ext.cxx + shaderAttrib_ext.h + shaderInput_ext.cxx + shaderInput_ext.h transformState_ext.cxx transformState_ext.h ) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 9775c4b891..a2c2abb089 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -1,5 +1,4 @@ set(P3PIPELINE_HEADERS - asyncTaskBase.h asyncTaskBase.I contextSwitch.h blockerSimple.h blockerSimple.I conditionVar.h conditionVar.I @@ -57,7 +56,6 @@ set(P3PIPELINE_HEADERS ) set(P3PIPELINE_SOURCES - asyncTaskBase.cxx contextSwitch.c conditionVar.cxx conditionVarDebug.cxx diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index ea32bcd1c7..e79254aa7b 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -25,6 +25,7 @@ set(P3PUTIL_HEADERS compareTo.I compareTo.h config_util.N config_util.h configurable.h cPointerCallbackObject.h cPointerCallbackObject.I + datagramBuffer.I datagramBuffer.h datagramInputFile.I datagramInputFile.h datagramOutputFile.I datagramOutputFile.h doubleBitMask.I doubleBitMask.h @@ -84,6 +85,7 @@ set(P3PUTIL_SOURCES copyOnWritePointer.cxx config_util.cxx configurable.cxx cPointerCallbackObject.cxx + datagramBuffer.cxx datagramInputFile.cxx datagramOutputFile.cxx doubleBitMask.cxx factoryBase.cxx From 3636339500174901cef3856a0a9d9c9b71f918e1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Feb 2018 17:43:07 -0700 Subject: [PATCH 348/744] pnmimagetypes: Get rid of my INLINE macro push/pop now that master has it --- panda/src/pnmimagetypes/pnmFileTypeJPG.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/panda/src/pnmimagetypes/pnmFileTypeJPG.h b/panda/src/pnmimagetypes/pnmFileTypeJPG.h index 24fc95842e..b82534189a 100644 --- a/panda/src/pnmimagetypes/pnmFileTypeJPG.h +++ b/panda/src/pnmimagetypes/pnmFileTypeJPG.h @@ -41,17 +41,11 @@ #pragma push_macro("INLINE") #endif -// jpeglib sometimes redefines the INLINE macro and breaks inlining -// (on e.g. Ubuntu 12.04) so we need to preserve it somehow - this uses the -// MSVC push_macro/pop_macro pragmas, which are also supported on GCC and -// Clang, but may not be cross-compiler enough to merge up to master. Hrm. :/ -#pragma push_macro("INLINE") extern "C" { #include // jpeglib requires this to be included first. #include #include } -#pragma pop_macro("INLINE") // Restore our own INLINE definition. #ifdef __GNUC__ From 54dad6c72a5bee45c73dce34d6a0520d01508d57 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Feb 2018 18:21:57 -0700 Subject: [PATCH 349/744] travis: Oops, fix the CMake travis.yml config somewhat --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8a5deba8a3..2f48634bcd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,23 +13,22 @@ matrix: - export CXX=g++-4.7 - compiler: gcc dist: precise - env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + env: BUILDSYSTEM=cmake PYTHONV=python2.7 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives before_install: - export CC=gcc-4.7 - export CXX=g++-4.7 - compiler: clang dist: precise - env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives - compiler: gcc dist: trusty - env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives before_install: - export CC=gcc-4.7 - export CXX=g++-4.7 - compiler: clang dist: trusty - env: BUILDSYSTEM=cmake FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives - env: PYTHONV=python2.7 FLAGS=--override=STDFLOAT_DOUBLE=1 + env: BUILDSYSTEM=cmake PYTHONV=python2.7 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives addons: apt: sources: From 34f5674ae568620d647eae997d7452a54c655954 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 4 Feb 2018 09:59:16 -0700 Subject: [PATCH 350/744] CMake: Use target_use_packages where appropriate --- panda/src/audiotraits/CMakeLists.txt | 12 ++++++------ panda/src/express/CMakeLists.txt | 4 ++-- panda/src/glgsg/CMakeLists.txt | 3 ++- panda/src/gobj/CMakeLists.txt | 4 ++-- panda/src/pnmimagetypes/CMakeLists.txt | 4 ++-- panda/src/pnmtext/CMakeLists.txt | 3 ++- panda/src/text/CMakeLists.txt | 2 +- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index e4a28424fe..42732d182f 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -18,8 +18,8 @@ if(HAVE_AUDIO) composite_sources(p3miles_audio P3MILES_SOURCES) include_directories(${MILES_INCLUDE_DIR}) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) - target_link_libraries(p3miles_audio p3audio p3event p3pipeline - ${_MILES_LIBRARY}) + target_link_libraries(p3miles_audio p3audio p3event p3pipeline) + target_use_packages(p3miles_audio MILES) install(TARGETS p3miles_audio DESTINATION lib) endif() @@ -36,8 +36,8 @@ if(HAVE_AUDIO) composite_sources(p3fmod_audio P3FMOD_SOURCES) include_directories(${FMODEX_INCLUDE_DIR}) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) - target_link_libraries(p3fmod_audio p3audio p3event - ${_FMODEX_LIBRARY}) + target_link_libraries(p3fmod_audio p3audio p3event) + target_use_packages(p3fmod_audio FMODEX) install(TARGETS p3fmod_audio DESTINATION lib) endif() @@ -55,8 +55,8 @@ if(HAVE_AUDIO) composite_sources(p3openal_audio P3OPENAL_SOURCES) include_directories(${OPENAL_INCLUDE_DIR}) add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) - target_link_libraries(p3openal_audio p3audio p3event - ${_OPENAL_LIBRARY}) + target_link_libraries(p3openal_audio p3audio p3event) + target_use_packages(p3openal_audio OPENAL) install(TARGETS p3openal_audio DESTINATION lib) endif() diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 15f27dc53b..ff7cc014ee 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -156,8 +156,8 @@ else() target_include_directories(p3express PUBLIC $) endif() -target_link_libraries(p3express p3pandabase p3dtool p3prc p3dconfig - ${_TAR_LIBRARY} ${_ZLIB_LIBRARY}) +target_link_libraries(p3express p3pandabase p3dtool p3prc p3dconfig) +target_use_packages(p3express TAR ZLIB) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(WIN32) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 94817a9805..d3c5567281 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -11,7 +11,8 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff p3display - ${OPENGL_LIBRARIES} ${_CG_LIBRARIES}) + ${OPENGL_LIBRARIES}) + target_use_packages(p3glgsg CG) install(TARGETS p3glgsg DESTINATION lib) install(FILES ${P3GLGSG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 5064b2263d..7cefb48391 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -161,8 +161,8 @@ set(P3GOBJ_IGATEEXT composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -target_link_libraries(p3gobj p3gsgbase p3pnmimage - ${_ZLIB_LIBRARIES} ${_SQUISH_LIBRARY} ${_CG_LIBRARY}) +target_link_libraries(p3gobj p3gsgbase p3pnmimage) +target_use_packages(p3gobj ZLIB SQUISH CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) install(TARGETS p3gobj DESTINATION lib) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 5466a5a826..509d13bd11 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -32,7 +32,7 @@ set(P3PNMIMAGETYPES_SOURCES composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -target_link_libraries(p3pnmimagetypes p3pnmimage ${_JPEG_LIBRARIES} - ${_TIFF_LIBRARIES} ${_PNG_LIBRARIES}) +target_link_libraries(p3pnmimagetypes p3pnmimage) +target_use_packages(p3pnmimagetypes JPEG TIFF PNG) install(TARGETS p3pnmimagetypes DESTINATION lib) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 6ad9d8372a..cfd2a0f24e 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -16,7 +16,8 @@ if(HAVE_FREETYPE) composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) - target_link_libraries(p3pnmtext p3parametrics p3pnmimage ${_FREETYPE_LIBRARIES}) + target_link_libraries(p3pnmtext p3parametrics p3pnmimage) + target_use_packages(p3pnmtext FREETYPE) target_interrogate(p3pnmtext ALL) install(TARGETS p3pnmtext DESTINATION lib) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 2c8e1f6b35..f6a6a9c3a3 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -36,7 +36,7 @@ composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) target_link_libraries(p3text p3parametrics) if(HAVE_FREETYPE) - target_link_libraries(p3text p3pnmtext ${_FREETYPE_LIBRARIES}) + target_link_libraries(p3text p3pnmtext) endif() target_interrogate(p3text ALL) From d66f5fa8e2ac946b0d320c0f371158862dbf2543 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 5 Feb 2018 11:27:31 -0700 Subject: [PATCH 351/744] CMake: Kill support for <2.8.12 The rationale for this is in a comment at the top of the main CMakeLists.txt file. It was getting harder to maintain support for a version this old, and pretty much no current system has CMake <3. Good riddance. --- CMakeLists.txt | 17 +++++++--- cmake/macros/Interrogate.cmake | 30 +++++------------ cmake/modules/AutoInclude.cmake | 55 ------------------------------- cmake/scripts/MakeComposite.cmake | 2 -- panda/src/express/CMakeLists.txt | 15 +++------ 5 files changed, 25 insertions(+), 94 deletions(-) delete mode 100644 cmake/modules/AutoInclude.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d36d8624d..3d948ac50f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,12 @@ -# We require 2.8.4 because earlier releases had a bug -# with invalid HEADER_FILE_ONLY behavior in MSVC 2010. -cmake_minimum_required(VERSION 2.8.4) +# We require 2.8.12+ for three reasons: +# 1) CMake 3 is so common these days that it's really not a burden on the user +# to expect them to have it. +# 2) As of this writing, this is the oldest version included in a supported +# release of Ubuntu. Older versions are actually somewhat difficult to track +# down, so we don't test against them. +# 3) CMake's INTERFACE_INCLUDE_DIRECTORIES feature, which we rely on +# extensively, finally became stable in this release. +cmake_minimum_required(VERSION 2.8.12) set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below project(Panda3D) @@ -25,6 +31,10 @@ endif() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") +# Set certain CMake flags we expect +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option AND target_use_packages @@ -34,7 +44,6 @@ include(dtool/Package.cmake) include(dtool/Config.cmake) # Include global modules -include(AutoInclude) # Implements automatic include_directories finding include(AddBisonTarget) # Defines add_bison_target function include(AddFlexTarget) # Defines add_flex_target function include(CompositeSources) # Defines composite_sources function diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index eebe62abb5..aac4eec8c4 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -167,28 +167,14 @@ function(interrogate_sources target output database module) endforeach(source) # Interrogate also needs the include paths, so we'll extract them from the - # target. Usually these are available via a generator expression, however - # versions of CMake before 2.8.10 don't support the TARGET_PROPERTY genex - # so we have to extract the property at configuration-time. Versions after - # 2.8.11 support CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE which ONLY makes - # this information available at generator-time (i.e. after - # configuration-time) so the generator expression is necessary then. - if(CMAKE_VERSION VERSION_LESS 2.8.10) - set(include_flags) - get_target_property(include_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) - foreach(include_dir ${include_dirs}) - list(APPEND include_flags "-I${include_dir}") - endforeach(include_dir) - # The above must also be included when compiling the resulting _igate.cxx file: - include_directories(${include_dirs}) - else() - # Note, the \t is a workaround for a CMake bug where using a plain space in - # a JOIN will cause it to be escaped. Tabs are not escaped and will - # separate correctly. - set(include_flags "-I$,\t-I>") - # The above must also be included when compiling the resulting _igate.cxx file: - include_directories("$") - endif() + # target. These are available via a generator expression. + + # Note, the \t is a workaround for a CMake bug where using a plain space in + # a JOIN will cause it to be escaped. Tabs are not escaped and will + # separate correctly. + set(include_flags "-I$,\t-I>") + # The above must also be included when compiling the resulting _igate.cxx file: + include_directories("$") # Get the compiler definition flags. These must be passed to Interrogate # in the same way that they are passed to the compiler so that Interrogate diff --git a/cmake/modules/AutoInclude.cmake b/cmake/modules/AutoInclude.cmake deleted file mode 100644 index c703734bfc..0000000000 --- a/cmake/modules/AutoInclude.cmake +++ /dev/null @@ -1,55 +0,0 @@ -# Filename: AutoInclude.cmake -# Description: This file backports the CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE -# introduced in CMake 2.8.11 to previous versions of cmake, and enables the -# behavior by default. -# - -# Emulate CMake 2.8.11's CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE behavior if -# this version doesn't define CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE. -if(CMAKE_VERSION VERSION_LESS 2.8.11) - # Replace some built-in functions in order to extend their functionality. - function(add_library target) - _add_library(${target} ${ARGN}) - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - function(add_executable target) - _add_executable(${target} ${ARGN}) - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}") - endfunction() - - function(target_link_libraries target) - set(interface_dirs) - get_target_property(target_interface_dirs "${target}" INTERFACE_INCLUDE_DIRECTORIES) - - foreach(lib ${ARGN}) - if(TARGET "${lib}") - get_target_property(lib_interface_dirs "${lib}" INTERFACE_INCLUDE_DIRECTORIES) - - if(lib_interface_dirs) - list(APPEND interface_dirs ${lib_interface_dirs}) - endif() - endif() - endforeach() - - if(interface_dirs) - list(REMOVE_DUPLICATES interface_dirs) - - #NB. target_include_directories is new in 2.8.8. - #target_include_directories("${target}" ${interface_dirs}) - include_directories(${interface_dirs}) - - # Update this target's interface inc dirs. - set_target_properties("${target}" PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${target_interface_dirs};${interface_dirs}") - endif() - - # Call to the built-in function we are overriding. - _target_link_libraries(${target} ${ARGN}) - endfunction() - -else() - # 2.8.11 supports this natively. - set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) -endif() - -set(CMAKE_INCLUDE_CURRENT_DIR ON) diff --git a/cmake/scripts/MakeComposite.cmake b/cmake/scripts/MakeComposite.cmake index 11b618dad0..fb4d88f6b6 100644 --- a/cmake/scripts/MakeComposite.cmake +++ b/cmake/scripts/MakeComposite.cmake @@ -10,8 +10,6 @@ # if(CMAKE_SCRIPT_MODE_FILE) - #cmake_minimum_required(VERSION 2.8.4) - if(NOT DEFINED COMPOSITE_FILE) message(FATAL_ERROR "COMPOSITE_FILE should be defined when running MakeComposite.cmake!") return() diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index ff7cc014ee..7fa891c805 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -144,18 +144,11 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) +add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) + # p3express needs to include from p3interrogatedb for py_panda.h and extension.h -if(CMAKE_VERSION VERSION_LESS 2.8.11) - get_target_property(interrogatedb_interface_dirs p3interrogatedb INTERFACE_INCLUDE_DIRECTORIES) - include_directories(${interrogatedb_interface_dirs}) - add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) - set_target_properties(p3express PROPERTIES INTERFACE_INCLUDE_DIRECTORIES - "${interrogatedb_interface_dirs};${CMAKE_CURRENT_SOURCE_DIR}") -else() - add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) - target_include_directories(p3express PUBLIC - $) -endif() +target_include_directories(p3express PUBLIC + $) target_link_libraries(p3express p3pandabase p3dtool p3prc p3dconfig) target_use_packages(p3express TAR ZLIB) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) From 556c03c0c12bb0ca1cb02c4485fafbb836459c11 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 6 Feb 2018 10:36:41 -0700 Subject: [PATCH 352/744] CMake: Take care of panda3d.interrogatedb module --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 13 +++++++++++-- dtool/src/dtoolbase/CMakeLists.txt | 9 +++++++++ dtool/src/dtoolutil/CMakeLists.txt | 11 +++++++++++ dtool/src/interrogatedb/CMakeLists.txt | 12 ++++++++++++ dtool/src/prc/CMakeLists.txt | 10 ++++++++++ panda/CMakeLists.txt | 3 ++- 6 files changed, 55 insertions(+), 3 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index cf791fbde9..568c451f47 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -2,11 +2,20 @@ add_definitions(-DBUILDING_DTOOLCONFIG) if(HAVE_PYTHON) add_library(p3dtoolconfig dtoolconfig.cxx pydtool.cxx) - target_link_libraries(p3dtoolconfig ${_PYTHON_LIBRARIES}) else() add_library(p3dtoolconfig dtoolconfig.cxx) endif() +target_use_packages(p3dtoolconfig PYTHON) target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb) +set_target_properties(p3dtoolconfig PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + PREFIX "" + OUTPUT_NAME "interrogatedb" +) -install(TARGETS p3dtoolconfig DESTINATION lib) +if(HAVE_PYTHON) + install(TARGETS p3dtoolconfig DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") +else() + install(TARGETS p3dtoolconfig DESTINATION lib) +endif() diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 95e9c2e2e0..642f1d95e6 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -62,10 +62,19 @@ set(P3DTOOLBASE_SOURCES typedObject.cxx ) +set(P3DTOOLBASE_IGATEEXT + typeHandle_ext.cxx + typeHandle_ext.h +) + composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) +# The extensions need py_panda.h and extension.h from interrogatedb +target_include_directories(p3dtoolbase PUBLIC + $) target_use_packages(p3dtoolbase THREADS) +target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) install(TARGETS p3dtoolbase DESTINATION lib) install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 6bdf9be8ff..de5e45581d 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -62,10 +62,21 @@ set(P3DTOOLUTIL_SOURCES win32ArgParser.cxx ) +set(P3DTOOLUTIL_IGATEEXT + filename_ext.cxx + filename_ext.h + globPattern_ext.cxx + globPattern_ext.h +) + composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) +# The extensions need py_panda.h and extension.h from interrogatedb +target_include_directories(p3dtoolutil PUBLIC + $) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) +target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT}) if(APPLE) find_library(FOUNDATION_LIBRARY Foundation) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index eb13d2b302..2e15dce1ea 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -29,9 +29,21 @@ set(P3INTERROGATEDB_SOURCES composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) +set(P3INTERROGATEDB_IGATE_SOURCES + config_interrogatedb.cxx + indexRemapper.cxx + interrogateComponent.cxx interrogateDatabase.cxx + interrogateElement.cxx interrogateFunction.cxx + interrogateFunctionWrapper.cxx + interrogateMakeSeq.cxx + interrogateManifest.cxx + interrogateType.cxx interrogate_datafile.cxx + interrogate_interface.cxx interrogate_request.cxx) + add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) target_use_packages(p3interrogatedb PYTHON) +target_interrogate(p3interrogatedb ${P3INTERROGATEDB_IGATE_SOURCES}) install(TARGETS p3interrogatedb DESTINATION lib) install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 14f9d2959c..474680e486 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -62,10 +62,20 @@ set(P3PRC_SOURCES reversedNumericData.cxx streamReader.cxx streamWrapper.cxx streamWriter.cxx) +set(P3PRC_IGATEEXT + streamReader_ext.cxx + streamReader_ext.h + streamWriter_ext.cxx + streamWriter_ext.h) + composite_sources(p3prc P3PRC_SOURCES) add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) +# The extensions need py_panda.h and extension.h from interrogatedb +target_include_directories(p3prc PUBLIC + $) target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES}) +target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) install(TARGETS p3prc DESTINATION lib) install(FILES ${P3PRC_HEADERS} DESTINATION include/panda3d) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f860fe194f..6dca58d075 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -88,7 +88,8 @@ set(CORE_MODULE_COMPONENTS p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline - p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform) + p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform + p3prc p3dtoolutil p3dtoolbase) if(HAVE_AUDIO) list(APPEND CORE_MODULE_COMPONENTS p3audio) From bed9c40283faae20d4263faeda713a7c34f0031e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 7 Feb 2018 11:18:37 -0700 Subject: [PATCH 353/744] CMake: Restructure output directory to mimic makepanda --- CMakeLists.txt | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3d948ac50f..d1c8594a46 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,12 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) +# Set up the output directory structure, mimicking that of makepanda +set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option AND target_use_packages @@ -50,7 +56,7 @@ include(CompositeSources) # Defines composite_sources function include(Interrogate) # Defines target_interrogate AND add_python_module # Add the include path for source and header files generated by CMake -include_directories("${CMAKE_BINARY_DIR}/include") +include_directories("${PROJECT_BINARY_DIR}/include") # Determine which trees to build. option(BUILD_DTOOL "Build the dtool source tree." ON) @@ -60,19 +66,19 @@ option(BUILD_PANDATOOL "Build the pandatool source tree." ON) # Include Panda3D packages if(BUILD_DTOOL) - add_subdirectory(dtool) + add_subdirectory(dtool "${CMAKE_BINARY_DIR}/dtool") endif() if(BUILD_PANDA) - add_subdirectory(panda) + add_subdirectory(panda "${CMAKE_BINARY_DIR}/panda") endif() if(BUILD_DIRECT) - add_subdirectory(direct) + add_subdirectory(direct "${CMAKE_BINARY_DIR}/direct") endif() if(BUILD_PANDATOOL) - add_subdirectory(pandatool) + add_subdirectory(pandatool "${CMAKE_BINARY_DIR}/pandatool") endif() # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, @@ -82,13 +88,13 @@ endif() # from panda3d.FOO import * if(HAVE_PYTHON) # Generate PandaModules: - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" + file(WRITE "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" "\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\" print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") foreach(module ${ALL_INTERROGATE_MODULES}) - file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" " + file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" " try: from panda3d.${module} import * except ImportError as err: @@ -97,10 +103,10 @@ except ImportError as err: ") endforeach() - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pandac/__init__.py" "") + file(WRITE "${PROJECT_BINARY_DIR}/pandac/__init__.py" "") # Now install ourselves: install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/pandac/__init__.py" "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" + FILES "${PROJECT_BINARY_DIR}/pandac/__init__.py" "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac") endif() From a89059ec984a92a7724bbc59699418b3a90d6454 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 7 Feb 2018 17:30:40 -0700 Subject: [PATCH 354/744] CMake: Copy in the "direct" tree to the build directory --- direct/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 9f0772633b..fc9f74f019 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -34,6 +34,10 @@ if(HAVE_PYTHON) showbase showutil stdpy task test tkpanels tkwidgets wxwidgets) foreach(dir ${DIRECT_INSTALL_DIRECTORIES}) + file(COPY + DIRECTORY "src/${dir}" + DESTINATION "${PROJECT_BINARY_DIR}/direct" + FILES_MATCHING PATTERN "*.py") install( DIRECTORY "src/${dir}" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct" @@ -41,8 +45,8 @@ if(HAVE_PYTHON) endforeach() # We also need an __init__.py file, which we have to generate: - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/src/__init__.py" "") + file(WRITE "${PROJECT_BINARY_DIR}/direct/__init__.py" "") install( - FILES "${CMAKE_CURRENT_BINARY_DIR}/src/__init__.py" + FILES "${PROJECT_BINARY_DIR}/direct/__init__.py" DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") endif() From 1d666a9841f98f79ade19e9bca77af67a898a42d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 7 Feb 2018 18:19:56 -0700 Subject: [PATCH 355/744] CMake: Build the models, makepanda-style --- CMakeLists.txt | 25 +++++++++++++++++++++++++ cmake/macros/RunPzip.cmake | 23 +++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 cmake/macros/RunPzip.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index d1c8594a46..d8f2aa77d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,7 @@ include(AddBisonTarget) # Defines add_bison_target function include(AddFlexTarget) # Defines add_flex_target function include(CompositeSources) # Defines composite_sources function include(Interrogate) # Defines target_interrogate AND add_python_module +include(RunPzip) # Defines run_pzip function # Add the include path for source and header files generated by CMake include_directories("${PROJECT_BINARY_DIR}/include") @@ -63,6 +64,7 @@ option(BUILD_DTOOL "Build the dtool source tree." ON) option(BUILD_PANDA "Build the panda source tree." ON) option(BUILD_DIRECT "Build the direct source tree." ON) option(BUILD_PANDATOOL "Build the pandatool source tree." ON) +option(BUILD_MODELS "Build/install the built-in models." ON) # Include Panda3D packages if(BUILD_DTOOL) @@ -81,6 +83,29 @@ if(BUILD_PANDATOOL) add_subdirectory(pandatool "${CMAKE_BINARY_DIR}/pandatool") endif() +if(BUILD_MODELS) + # We don't really "build" the models, just pzip them + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" + DESTINATION "${PROJECT_BINARY_DIR}/models/maps" + ) + run_pzip(models + "${CMAKE_CURRENT_SOURCE_DIR}/models" + "${PROJECT_BINARY_DIR}/models" + *.egg + ) + file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" + DESTINATION "${PROJECT_BINARY_DIR}/models" + FILES_MATCHING PATTERN *.rgb PATTERN *.png PATTERN *.jpg PATTERN *.wav + ) + run_pzip(dmodels + "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src" + "${PROJECT_BINARY_DIR}/models" + *.egg + ) + install(DIRECTORY "${PROJECT_BINARY_DIR}/models" + DESTINATION share/panda3d) +endif() + # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, # but in older versions of Panda3D, one would use # from pandac.PandaModules import * diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake new file mode 100644 index 0000000000..ef428b92d6 --- /dev/null +++ b/cmake/macros/RunPzip.cmake @@ -0,0 +1,23 @@ +function(run_pzip target_name source destination glob) + file(GLOB_RECURSE files RELATIVE "${source}" "${source}/${glob}") + + set(dstfiles "") + foreach(srcfile ${files}) + file(RELATIVE_PATH srcfile_rel "${destination}" "${source}/${srcfile}") + file(RELATIVE_PATH dstfile_rel "${destination}" "${destination}/${srcfile}.pz") + + list(APPEND dstfiles "${dstfile_rel}") + add_custom_command(OUTPUT "${dstfile_rel}" + COMMAND pzip -c > "${dstfile_rel}" < "${srcfile_rel}" + WORKING_DIRECTORY "${destination}" + DEPENDS pzip + COMMENT "") + + get_filename_component(dstdir "${destination}/${dstfile_rel}" DIRECTORY) + file(MAKE_DIRECTORY "${dstdir}") + endforeach(srcfile) + + add_custom_target(${target_name} ALL + DEPENDS ${dstfiles} + WORKING_DIRECTORY "${destination}") +endfunction(run_pzip) From 3ac61eaf66b616cf48c007fe41ef866ad286af20 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 7 Feb 2018 18:33:24 -0700 Subject: [PATCH 356/744] CMake: Adjust generated 20_panda.prc for models installation --- panda/src/configfiles/panda.prc.in | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index ffbce72552..3ce806bd72 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -10,7 +10,9 @@ #### Generated automatically by CMake ${CMAKE_VERSION} from panda.prc.in. ################################# DO NOT EDIT ########################### +# Some paths first... plugin-path $THIS_PRC_DIR/../lib +model-path $THIS_PRC_DIR/../share/panda3d/models # Let's set up a default window size of 800x600. The user can # override this in his or her personal prc file. @@ -38,6 +40,7 @@ audio-library-name ${AUDIO_LIBRARY_NAME} # loaded directly into Panda. load-file-type egg pandaegg +default-model-extension .egg # These entries work very similar to load-file-type, except they are From a03fef59cda49f8e58ec7840f2ee40a2cb0a4791 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 8 Feb 2018 15:03:10 -0700 Subject: [PATCH 357/744] travis: Use a consistent output directory for makepanda/cmake output --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2f48634bcd..cf9279a716 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,7 @@ install: - $PYTHONV -m pip install pytest script: - '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' - - '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir build && cd build && mv ../makepanda/test_imports.py . && ../makepanda/selfdestruct.py --yes && cmake -DHAVE_GTK2=NO $FLAGS .. && make -j4 && $PYTHONV test_imports.py && cd .. )' + - '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir built && cd built && mv ../makepanda/test_imports.py . && ../makepanda/selfdestruct.py --yes && cmake -DHAVE_GTK2=NO $FLAGS .. && make -j4 && $PYTHONV test_imports.py && cd .. )' - LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV -m pytest tests notifications: irc: From ef9e117e5ac301509e1f309991d4e8ccbe6fc5dc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Feb 2018 22:05:53 -0700 Subject: [PATCH 358/744] travis: Remove 'dist: precise' builds; its version of CMake is too old --- .travis.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index cf9279a716..c5dbf0966c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,22 +12,18 @@ matrix: - export CC=gcc-4.7 - export CXX=g++-4.7 - compiler: gcc - dist: precise env: BUILDSYSTEM=cmake PYTHONV=python2.7 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives before_install: - export CC=gcc-4.7 - export CXX=g++-4.7 - compiler: clang - dist: precise env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives - compiler: gcc - dist: trusty env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives before_install: - export CC=gcc-4.7 - export CXX=g++-4.7 - compiler: clang - dist: trusty env: BUILDSYSTEM=cmake PYTHONV=python2.7 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives addons: apt: From b68b6caeb0f0ac440d0ec60cc210ed3b21be8ccb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Feb 2018 22:06:14 -0700 Subject: [PATCH 359/744] CMake: Support targeting Python 3 --- cmake/macros/Interrogate.cmake | 2 +- dtool/Config.cmake | 17 ++++++++++++----- dtool/LocalSetup.cmake | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index aac4eec8c4..525897886c 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -206,7 +206,7 @@ function(interrogate_sources target output database module) ${define_flags} -S "${PROJECT_BINARY_DIR}/include" -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" - -S "${PROJECT_BINARY_DIR}/include/parser-inc" + -S "${PYTHON_INCLUDE_DIRS}" ${include_flags} ${scan_sources} ${extensions} diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 82c8831031..7eadc11c7c 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -444,9 +444,16 @@ endif() # Is Python installed, and should Python interfaces be generated? -find_package(PythonLibs 2.5) -find_package(PythonInterp 2.5) -set(PYTHON_FOUND ${PYTHONLIBS_FOUND}) +set(WANT_PYTHON_VERSION "2.7" + CACHE STRING "Which Python version to seek out for building Panda3D against.") + +find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) +find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) +if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) + set(PYTHON_FOUND ON) +else() + set(PYTHON_FOUND OFF) +endif() package_option(PYTHON DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE @@ -456,12 +463,12 @@ is also enabled, Python bindings will be generated.") if(HAVE_PYTHON) execute_process( COMMAND ${PYTHON_EXECUTABLE} - -c "from distutils.sysconfig import get_python_lib; print get_python_lib(False)" + -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False))" OUTPUT_VARIABLE _LIB_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( COMMAND ${PYTHON_EXECUTABLE} - -c "from distutils.sysconfig import get_python_lib; print get_python_lib(True)" + -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE _ARCH_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index e9a0853089..37c7cb2094 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -448,7 +448,7 @@ endif() message("") if(HAVE_INTERROGATE AND HAVE_PYTHON) - message("Compilation will generate Python interfaces.") + message("Compilation will generate Python interfaces for Python ${PYTHON_VERSION_STRING}.") else() message("Configuring Panda WITHOUT Python interfaces.") endif() From a0a5f3a915b732ae680a77c493089b5f80c68769 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Feb 2018 22:07:07 -0700 Subject: [PATCH 360/744] travis: Fix build rules for Python 3 on CMake --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index c5dbf0966c..b55b7d8cdc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,9 @@ matrix: - export CC=gcc-4.7 - export CXX=g++-4.7 - compiler: clang - env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS='-DWANT_PYTHON_VERSION=3 -DCOMPOSITE_SOURCE_LIMIT=0' # Disable unity builds to catch missing #include directives - compiler: gcc - env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS='-DWANT_PYTHON_VERSION=3 -DCOMPOSITE_SOURCE_LIMIT=0' # Disable unity builds to catch missing #include directives before_install: - export CC=gcc-4.7 - export CXX=g++-4.7 From 7b4698cd7a5b4bcee515b1a94c85471c8669c3e3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Feb 2018 22:30:54 -0700 Subject: [PATCH 361/744] CMake: Quiet all find_package commands --- dtool/Config.cmake | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 7eadc11c7c..241da0bf14 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -420,7 +420,7 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # # Is Eigen installed, and should Eigen replace internal linmath? -find_package(Eigen3) +find_package(Eigen3 QUIET) package_option(EIGEN "Enables experimental support for the Eigen linear algebra library. @@ -513,7 +513,7 @@ your source directory on your PYTHONPATH.") # Is OpenSSL installed, and where? -find_package(OpenSSL COMPONENTS ssl crypto) +find_package(OpenSSL COMPONENTS ssl crypto QUIET) package_option(OPENSSL DEFAULT ON "Enable OpenSSL support") @@ -524,7 +524,7 @@ error messages when they occur." ${IS_DEBUG_BUILD}) # Is libjpeg installed, and where? -find_package(JPEG) +find_package(JPEG QUIET) package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") @@ -538,21 +538,21 @@ option(HAVE_VIDEO4LINUX # Is libpng installed, and where? -find_package(PNG) +find_package(PNG QUIET) package_option(PNG DEFAULT ON "Enable support for loading .png images.") # Is libtiff installed, and where? -find_package(TIFF) +find_package(TIFF QUIET) package_option(TIFF "Enable support for loading .tif images.") # Is libtar installed, and where? -find_package(Tar) +find_package(Tar QUIET) package_option(TAR "This is used to optimize patch generation against tar files.") @@ -560,7 +560,7 @@ package_option(TAR # TODO: FFTW2 # Is libfftw installed, and where? -#find_package(FFTW2) +#find_package(FFTW2 QUIET) #package_option(FFTW # "This enables support for lossless compression of animations in @@ -570,7 +570,7 @@ package_option(TAR # Is libsquish installed, and where? -find_package(Squish) +find_package(Squish QUIET) package_option(SQUISH "Enables support for automatic compression of DXT textures.") @@ -593,7 +593,7 @@ package_option(CGDX10 "Enable support for Nvidia Cg's DX10 API." # Is VRPN installed, and where? -find_package(VRPN) +find_package(VRPN QUIET) package_option(VRPN "Enables support for connecting to VRPN servers.") @@ -608,15 +608,15 @@ package_option(VRPN # Is ZLIB installed, and where? -find_package(ZLIB) +find_package(ZLIB QUIET) package_option(ZLIB DEFAULT ON "Enables support for compression of Panda assets.") # Is FFMPEG installed, and where? -find_package(FFMPEG) -find_package(SWScale) -find_package(SWResample) +find_package(FFMPEG QUIET) +find_package(SWScale QUIET) +find_package(SWResample QUIET) package_option(FFMPEG "Enables support for audio- and video-decoding using the FFMPEG library.") @@ -626,7 +626,7 @@ package_option(SWRESAMPLE "Enables support for FFMPEG's libresample for audio resampling.") # Is ODE installed, and where? -find_package(ODE) +find_package(ODE QUIET) package_option(ODE "Enables support for ridid-body physics using the Open Dynamics Engine.") @@ -732,7 +732,7 @@ mark_as_advanced(SDL_LIBRARY_TEMP) # Is X11 insalled, and where? -find_package(X11) +find_package(X11 QUIET) package_option(X11 "Provides X-server support on Unix platforms. X11 may need to be linked @@ -887,7 +887,7 @@ set(HAVE_FLEX ${FLEX_FOUND}) # ### Configure threading support ### -find_package(Threads) +find_package(Threads QUIET) # Add basic use flag for threading if(THREADS_FOUND) From b9f717e79043b9f4d06a0de106005551a0fd4e7e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Feb 2018 22:40:52 -0700 Subject: [PATCH 362/744] CMake: Remove redundant pipeline/thread support message --- dtool/Config.cmake | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 241da0bf14..e510a92e87 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -947,23 +947,6 @@ but it is a hybrid between user-space threads and os-provided threads." ON) ### Configure pipelining ### option(DO_PIPELINING "If on, compile with pipelined rendering." ON) - -### Report on threading and pipelining status ### -if(SIMPLE_THREADS) - message(STATUS "Compilation will include simulated threading support.") -elseif(HAVE_THREADS) - if(DO_PIPELINING) - message(STATUS "Compilation will include full, pipelined threading support.") - else() - message(STATUS "Compilation will include nonpipelined threading support.") - endif() -else(NOT SIMPLE_THREADS) - message(STATUS "Configuring Panda without threading support.") -endif() - -message(STATUS "") -message(STATUS "See dtool_config.h for more details about the specified configuration.\n") - ### Miscellaneous configuration option(COMPILE_IN_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always From 0b940b0588b9fc6a3215d3e273b40f0e2ffd88f4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 10 Feb 2018 12:34:28 -0700 Subject: [PATCH 363/744] CMake: Take care of some of the TODO tests in LocalSetup --- dtool/LocalSetup.cmake | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 37c7cb2094..fd8c2c1164 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -24,12 +24,17 @@ test_big_endian(WORDS_BIGENDIAN) set(HAVE_NAMESPACE ${CMAKE_STD_NAMESPACE}) # Define if fstream::open() accepts a third parameter for umask. -#TODO make test case -#$[cdefine HAVE_OPEN_MASK] +check_cxx_source_compiles(" +#include +std::fstream fs; +int main(int argc, char *argv[]) { fs.open(\"file\", std::fstream::out, 0644); return 0; } +" HAVE_OPEN_MASK) # Define if we have lockf(). -#TODO make test case -set(HAVE_LOCKF 1) +check_cxx_source_compiles(" +#include +int main(int argc, char *argv[]) { lockf(0, F_LOCK, 0); return 0; } +" HAVE_LOCKF) # Check if we have a wchar_t type. check_type_size(wchar_t HAVE_WCHAR_T) @@ -42,7 +47,7 @@ int main(int argc, char *argv[]) { return 0; } " HAVE_WSTRING) # Define if the C++ compiler supports the typename keyword. -#TODO make test case (I had one but it broke) +# Since we now require C++11, this is a given. set(HAVE_TYPENAME 1) # Define if we can trust the compiler not to insert extra bytes in @@ -97,8 +102,12 @@ int main(int argc, char *argv[]) { return 0; } # Do the system headers define key ios typedefs like ios::openmode # and ios::fmtflags? -#TODO make test case -set(HAVE_IOS_TYPEDEFS 1) +check_cxx_source_compiles(" +#include +std::ios::openmode foo; +std::ios::fmtflags bar; +int main(int argc, char *argv[]) { return 0; } +" HAVE_IOS_TYPEDEFS) # Define if the C++ iostream library defines ios::binary. check_cxx_source_compiles(" @@ -108,8 +117,9 @@ int main(int argc, char *argv[]) { return 0; } " HAVE_IOS_BINARY) # Can we safely call getenv() at static init time? -#TODO make test case? can we make a reliable one? -#$[cdefine STATIC_INIT_GETENV] +if(WIN32 OR UNIX) + set(STATIC_INIT_GETENV 1) +endif() # Can we read the file /proc/self/[*] to determine our # environment variables at static init time? @@ -127,11 +137,12 @@ endif() # Do we have a global pair of argc/argv variables that we can read at # static init time? Should we prototype them? What are they called? -#TODO make test case -#$[cdefine HAVE_GLOBAL_ARGV] -#$[cdefine PROTOTYPE_GLOBAL_ARGV] -#$[cdefine GLOBAL_ARGV] -#$[cdefine GLOBAL_ARGC] +if(WIN32) + set(HAVE_GLOBAL_ARGV ON) + set(PROTOTYPE_GLOBAL_ARGV OFF) + set(GLOBAL_ARGV __argv) + set(GLOBAL_ARGC __argc) +endif() # Do we have all these header files? check_include_file_cxx(io.h PHAVE_IO_H) From 897e3b9e5b501f5697437372c65c20dca2c14c87 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 10 Feb 2018 21:15:41 -0700 Subject: [PATCH 364/744] CMake: Nuke PYTHON_NATIVE The old Python bindings aren't a thing anymore. This is assumed ON. --- dtool/Config.cmake | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index e510a92e87..ed4c6a906d 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -256,13 +256,6 @@ This is only necessary if you plan to make calls into Panda from a program written in Python. This is done only if HAVE_PYTHON is also true." ON) -set(PYTHON_NATIVE - "Define this true to use the new interrogate feature to generate -Python-native objects directly, rather than requiring a separate -FFI step. This loads and runs much more quickly than the original -mechanism. Define this false (that is, empty) to use the original -interfaces." ON) - set(INTERROGATE_C_INTERFACE "Do you want to generate a C-callable interrogate interface? This generates an interface similar to the Python interface above, with @@ -294,7 +287,7 @@ and cannot run the built version), specify its name instead.") set(INTERROGATE_MODULE "interrogate_module" CACHE STRING "Same as INTERROGATE, except for the interrogate_module binary.") -mark_as_advanced(PYTHON_NATIVE INTERROGATE_OPTIONS) +mark_as_advanced(INTERROGATE_OPTIONS) if(NOT CMAKE_CROSSCOMPILING) mark_as_advanced(INTERROGATE INTERROGATE_MODULE) From f8c63dbe2b32f047f952913d6a8fb3f084e493fa Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 11 Feb 2018 12:48:17 -0700 Subject: [PATCH 365/744] CMake: Refactor interrogate.cmake a little In particular, rely on INTERROGATE_PYTHON_INTERFACE, not HAVE_PYTHON AND HAVE_INTERROGATE. --- cmake/macros/Interrogate.cmake | 305 ++++++++++++++++----------------- 1 file changed, 150 insertions(+), 155 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 525897886c..fd3dcae53d 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -8,7 +8,7 @@ # add_python_module(module [lib1 [lib2 ...]]) # -set(IGATE_FLAGS -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable -python-native) +set(IGATE_FLAGS -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable) # In addition, Interrogate needs to know if this is a 64-bit build: include(CheckTypeSize) @@ -48,65 +48,63 @@ set(ALL_INTERROGATE_MODULES CACHE INTERNAL "Internal variable") # target are added. # function(target_interrogate target) - if(HAVE_PYTHON AND HAVE_INTERROGATE) - set(sources) - set(extensions) - set(want_all OFF) - set(extensions_keyword OFF) - foreach(arg ${ARGN}) - if(arg STREQUAL "ALL") - set(want_all ON) - elseif(arg STREQUAL "EXTENSIONS") - set(extensions_keyword ON) - elseif(extensions_keyword) - list(APPEND extensions "${arg}") - else() - list(APPEND sources "${arg}") - endif() - endforeach() - - # If ALL was specified, pull in all sources from the target. - if(want_all) - get_target_property(target_sources "${target}" SOURCES) - list(APPEND sources ${target_sources}) + set(sources) + set(extensions) + set(want_all OFF) + set(extensions_keyword OFF) + foreach(arg ${ARGN}) + if(arg STREQUAL "ALL") + set(want_all ON) + elseif(arg STREQUAL "EXTENSIONS") + set(extensions_keyword ON) + elseif(extensions_keyword) + list(APPEND extensions "${arg}") + else() + list(APPEND sources "${arg}") endif() + endforeach() - list(REMOVE_DUPLICATES sources) - - # Now let's get everything's absolute path, so that it can be passed - # through a property while still preserving the reference. - set(absolute_sources) - set(absolute_extensions) - foreach(source ${sources}) - get_source_file_property(exclude "${source}" WRAP_EXCLUDE) - if(NOT exclude) - get_source_file_property(location "${source}" LOCATION) - list(APPEND absolute_sources ${location}) - endif() - endforeach(source) - foreach(extension ${extensions}) - get_source_file_property(location "${extension}" LOCATION) - list(APPEND absolute_extensions ${location}) - endforeach(extension) - - set_target_properties("${target}" PROPERTIES IGATE_SOURCES - "${absolute_sources}") - set_target_properties("${target}" PROPERTIES IGATE_EXTENSIONS - "${absolute_extensions}") - - # CMake has no property for determining the source directory where the - # target was originally added. interrogate_sources makes use of this - # property (if it is set) in order to make all paths on the command-line - # relative to it, thereby shortening the command-line even more. - # Since this is not an Interrogate-specific property, it is not named with - # an IGATE_ prefix. - set_target_properties("${target}" PROPERTIES TARGET_SRCDIR - "${CMAKE_CURRENT_SOURCE_DIR}") + # If ALL was specified, pull in all sources from the target. + if(want_all) + get_target_property(target_sources "${target}" SOURCES) + list(APPEND sources ${target_sources}) endif() + + list(REMOVE_DUPLICATES sources) + + # Now let's get everything's absolute path, so that it can be passed + # through a property while still preserving the reference. + set(absolute_sources) + set(absolute_extensions) + foreach(source ${sources}) + get_source_file_property(exclude "${source}" WRAP_EXCLUDE) + if(NOT exclude) + get_source_file_property(location "${source}" LOCATION) + list(APPEND absolute_sources ${location}) + endif() + endforeach(source) + foreach(extension ${extensions}) + get_source_file_property(location "${extension}" LOCATION) + list(APPEND absolute_extensions ${location}) + endforeach(extension) + + set_target_properties("${target}" PROPERTIES IGATE_SOURCES + "${absolute_sources}") + set_target_properties("${target}" PROPERTIES IGATE_EXTENSIONS + "${absolute_extensions}") + + # CMake has no property for determining the source directory where the + # target was originally added. interrogate_sources makes use of this + # property (if it is set) in order to make all paths on the command-line + # relative to it, thereby shortening the command-line even more. + # Since this is not an Interrogate-specific property, it is not named with + # an IGATE_ prefix. + set_target_properties("${target}" PROPERTIES TARGET_SRCDIR + "${CMAKE_CURRENT_SOURCE_DIR}") endfunction(target_interrogate) # -# Function: interrogate_sources(target output database module) +# Function: interrogate_sources(target output database language_flags module) # # This function actually runs a component-level interrogation against 'target'. # It generates the outfile.cxx (output) and dbfile.in (database) files, which @@ -116,104 +114,103 @@ endfunction(target_interrogate) # The target must first have had sources selected with target_interrogate. # Failure to do so will result in an error. # -function(interrogate_sources target output database module) - if(HAVE_PYTHON AND HAVE_INTERROGATE) - get_target_property(sources "${target}" IGATE_SOURCES) - get_target_property(extensions "${target}" IGATE_EXTENSIONS) +function(interrogate_sources target output database language_flags) + get_target_property(sources "${target}" IGATE_SOURCES) + get_target_property(extensions "${target}" IGATE_EXTENSIONS) - if(NOT sources) - message(FATAL_ERROR - "Cannot interrogate ${target} unless it's run through target_interrogate first!") - endif() - - get_target_property(srcdir "${target}" TARGET_SRCDIR) - if(NOT srcdir) - # No TARGET_SRCDIR was set, so we'll do everything relative to our - # current binary dir instead: - set(srcdir "${CMAKE_CURRENT_BINARY_DIR}") - endif() - - set(scan_sources) - set(nfiles) - foreach(source ${sources}) - get_filename_component(source_basename "${source}" NAME) - - # Only certain sources should actually be scanned by Interrogate. The - # rest are merely dependencies. This uses the exclusion regex above in - # order to determine what files are okay: - set(exclude OFF) - foreach(regex ${INTERROGATE_EXCLUDE_REGEXES}) - if("${source_basename}" MATCHES "${regex}") - set(exclude ON) - endif() - endforeach(regex) - - if(NOT exclude) - # This file is to be scanned by Interrogate. In order to avoid - # cluttering up the command line, we should first make it relative: - file(RELATIVE_PATH rel_source "${srcdir}" "${source}") - list(APPEND scan_sources "${rel_source}") - - # Also see if this file has a .N counterpart, which has directives - # specific for Interrogate. If there is a .N file, we add it as a dep, - # so that CMake will rerun Interrogate if the .N files are modified: - get_filename_component(source_path "${source}" PATH) - get_filename_component(source_name_we "${source}" NAME_WE) - set(nfile "${source_path}/${source_name_we}.N") - if(EXISTS "${nfile}") - list(APPEND nfiles "${nfile}") - endif() - endif() - endforeach(source) - - # Interrogate also needs the include paths, so we'll extract them from the - # target. These are available via a generator expression. - - # Note, the \t is a workaround for a CMake bug where using a plain space in - # a JOIN will cause it to be escaped. Tabs are not escaped and will - # separate correctly. - set(include_flags "-I$,\t-I>") - # The above must also be included when compiling the resulting _igate.cxx file: - include_directories("$") - - # Get the compiler definition flags. These must be passed to Interrogate - # in the same way that they are passed to the compiler so that Interrogate - # will preprocess each file in the same way. - set(define_flags) - get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) - if(target_defines) - foreach(target_define ${target_defines}) - list(APPEND define_flags "-D${target_define}") - # And add the same definition when we compile the _igate.cxx file: - add_definitions("-D${target_define}") - endforeach(target_define) - endif() - # If this is a release build that has NDEBUG defined, we need that too: - string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) - if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") - list(APPEND define_flags "-DNDEBUG") - endif() - - add_custom_command( - OUTPUT "${output}" "${database}" - COMMAND interrogate - -oc "${output}" - -od "${database}" - -srcdir "${srcdir}" - -module ${module} -library ${target} - ${INTERROGATE_OPTIONS} - ${IGATE_FLAGS} - ${define_flags} - -S "${PROJECT_BINARY_DIR}/include" - -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" - -S "${PYTHON_INCLUDE_DIRS}" - ${include_flags} - ${scan_sources} - ${extensions} - DEPENDS interrogate ${sources} ${extensions} ${nfiles} - COMMENT "Interrogating ${target}" - ) + if(NOT sources) + message(FATAL_ERROR + "Cannot interrogate ${target} unless it's run through target_interrogate first!") endif() + + get_target_property(srcdir "${target}" TARGET_SRCDIR) + if(NOT srcdir) + # No TARGET_SRCDIR was set, so we'll do everything relative to our + # current binary dir instead: + set(srcdir "${CMAKE_CURRENT_BINARY_DIR}") + endif() + + set(scan_sources) + set(nfiles) + foreach(source ${sources}) + get_filename_component(source_basename "${source}" NAME) + + # Only certain sources should actually be scanned by Interrogate. The + # rest are merely dependencies. This uses the exclusion regex above in + # order to determine what files are okay: + set(exclude OFF) + foreach(regex ${INTERROGATE_EXCLUDE_REGEXES}) + if("${source_basename}" MATCHES "${regex}") + set(exclude ON) + endif() + endforeach(regex) + + if(NOT exclude) + # This file is to be scanned by Interrogate. In order to avoid + # cluttering up the command line, we should first make it relative: + file(RELATIVE_PATH rel_source "${srcdir}" "${source}") + list(APPEND scan_sources "${rel_source}") + + # Also see if this file has a .N counterpart, which has directives + # specific for Interrogate. If there is a .N file, we add it as a dep, + # so that CMake will rerun Interrogate if the .N files are modified: + get_filename_component(source_path "${source}" PATH) + get_filename_component(source_name_we "${source}" NAME_WE) + set(nfile "${source_path}/${source_name_we}.N") + if(EXISTS "${nfile}") + list(APPEND nfiles "${nfile}") + endif() + endif() + endforeach(source) + + # Interrogate also needs the include paths, so we'll extract them from the + # target. These are available via a generator expression. + + # Note, the \t is a workaround for a CMake bug where using a plain space in + # a JOIN will cause it to be escaped. Tabs are not escaped and will + # separate correctly. + set(include_flags "-I$,\t-I>") + # The above must also be included when compiling the resulting _igate.cxx file: + include_directories("$") + + # Get the compiler definition flags. These must be passed to Interrogate + # in the same way that they are passed to the compiler so that Interrogate + # will preprocess each file in the same way. + set(define_flags) + get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) + if(target_defines) + foreach(target_define ${target_defines}) + list(APPEND define_flags "-D${target_define}") + # And add the same definition when we compile the _igate.cxx file: + add_definitions("-D${target_define}") + endforeach(target_define) + endif() + # If this is a release build that has NDEBUG defined, we need that too: + string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) + if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") + list(APPEND define_flags "-DNDEBUG") + endif() + + add_custom_command( + OUTPUT "${output}" "${database}" + COMMAND interrogate + -oc "${output}" + -od "${database}" + -srcdir "${srcdir}" + -library ${target} + ${INTERROGATE_OPTIONS} + ${IGATE_FLAGS} + ${language_flags} + ${define_flags} + -S "${PROJECT_BINARY_DIR}/include" + -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" + -S "${PYTHON_INCLUDE_DIRS}" + ${include_flags} + ${scan_sources} + ${extensions} + DEPENDS interrogate ${sources} ${extensions} ${nfiles} + COMMENT "Interrogating ${target}" + ) endfunction(interrogate_sources) # @@ -223,7 +220,7 @@ endfunction(interrogate_sources) # listed before. # function(add_python_module module) - if(HAVE_PYTHON AND HAVE_INTERROGATE) + if(INTERROGATE_PYTHON_INTERFACE) set(targets) set(link_targets) set(infiles) @@ -245,13 +242,11 @@ function(add_python_module module) endif() foreach(target ${targets}) - interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" "${module}") + interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" + -python-native -module "panda3d.${module}") get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) list(APPEND infiles "${target}.in") list(APPEND sources "${target}_igate.cxx" ${target_extensions}) - - #get_target_property(target_links "${target}" LINK_LIBRARIES) - #target_link_libraries(${target}_igate ${target_links}) endforeach(target) add_custom_command( From b11e15cec5e1fa0883aae82b17e7a6204dfc12c6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Feb 2018 14:38:00 -0700 Subject: [PATCH 366/744] CMake: HAVE_MESA isn't really a thing anymore --- dtool/Config.cmake | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index ed4c6a906d..80548f5cad 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -644,38 +644,6 @@ version and below, which may reduce runtime portability to other systems, but it will avoid issues with getting extension function pointers.") -# Is Mesa installed separately from OpenGL? Mesa is an open-source -# software-only OpenGL renderer. Panda can link with it -# independently from OpenGL (and if Mesa is built statically, and/or -# with -DUSE_MGL_NAMESPACE declared to rename gl* to mgl*, it can -# switch between the system OpenGL implementation and the Mesa -# implementation at runtime). - -# Also, Mesa includes some core libraries (in libOSMesa.so) that -# allow totally headless rendering, handy if you want to run a -# renderer as a batch service, and you don't want to insist that a -# user be logged on to the desktop or otherwise deal with X11 or -# Windows. - -# TODO: Mesa -#find_package(Mesa) - -#package_option(MESA -# "When set, will build libmesadisplay, which can be used in lieu of -#libpandagl or libpandadx to do rendering. However, for most -#applications, you don't need to do this, since (a) if you have -#hardware rendering capability, you probably don't want to use Mesa, -#since it's software-only, and (b) if you don't have hardware -#rendering, you can install Mesa as the system's OpenGL -#implementation, so you can just use the normal libpandagl. -#You only need to define HAVE_MESA if you want to run totally headless, -#or if you want to be able to easily switch between Mesa and the -#system OpenGL implementation at runtime. If you compiled Mesa with -#USE_MGL_NAMESPACE defined, define MESA_MGL here.") - -set(MIN_MESA_VERSION "1 1" CACHE STRING - "Similar to MIN_GL_VERSION, above.") - # Should build tinydisplay? option(HAVE_TINYDISPLAY From 021728f4b39df405ffde89bb85c6d9dacc46fd9f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Feb 2018 16:32:13 -0700 Subject: [PATCH 367/744] CMake: Start the process of organizing packages into Package.cmake --- cmake/macros/PackageConfig.cmake | 97 ++++++++++++++++++++++++++++++-- dtool/Config.cmake | 18 ------ dtool/LocalSetup.cmake | 13 +---- dtool/Package.cmake | 24 ++++++++ 4 files changed, 117 insertions(+), 35 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 478cae0d61..8b14b86269 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -1,13 +1,14 @@ # Filename: PackageConfig.cmake # -# This modules defines functions which find and configures libraries -# and packages for Panda3Ds configuration file headers (.h files). +# This module defines functions which find and configure libraries +# and packages for Panda3D. # -# Assumes the file has already been found with find_package(). +# Assumes an attempt to find the package has already been made with +# find_package(). (i.e. relies on packagename_FOUND variable) # # Function: package_option # Usage: -# package_option(package_name DOCSTRING +# package_option(package_name package_doc_string # [DEFAULT ON | OFF] # [LICENSE license]) # Examples: @@ -15,6 +16,24 @@ # # If no default is given, the default in normal # builds is to enable all found third-party packages. +# In builds for redistribution, there is the additional requirement that +# the package be suitably-licensed. +# +# +# Function: config_package +# Usage: +# config_package(package_name "Package description" ["Config summary"]) +# Examples: +# config_package(OpenAL "OpenAL Audio Output") +# config_package(ROCKET "Rocket" "without Python bindings") +# +# +# Function: show_packages +# Usage: +# show_packages() +# +# This prints the package usage report using the information provided in +# calls to config_package above. # # # Function: target_use_packages @@ -24,10 +43,18 @@ # target_use_packages(mylib PYTHON PNG) # - # # package_option # +# In order to make sure no third-party licenses are inadvertently violated, +# this imposes a few rules regarding license: +# 1) If there is no license, no special restrictions. +# 2) If there is a license, but the build is not flagged for redistribution, +# no special restrictions. +# 3) If there is a license, and this is for redistribution, the package is +# forcibly defaulted off and must be explicitly enabled, unless the license +# matches a list of licenses suitable for redistribution. +# function(package_option name) # Parse the arguments. set(command) @@ -104,6 +131,8 @@ function(package_option name) set(PANDA_DID_SET_OPTION_${name} TRUE PARENT_SCOPE) endif() + set(PANDA_PACKAGE_DEFAULT_${name} "${default}") + # Create the option. option("HAVE_${name}" "${cache_string}" "${default}") if(HAVE_${name}) @@ -115,6 +144,64 @@ function(package_option name) endif() endfunction() +set(_ALL_CONFIG_PACKAGES CACHE INTERNAL "Internal variable") + +# +# config_package +# +function(config_package name desc) + set(note "") + foreach(arg ${ARGN}) + set(note "${arg}") + endforeach() + + if(NOT PANDA_DID_SET_OPTION_${name}) + message(SEND_ERROR "config_package(${name}) was called before package_option(${name}). + This is a bug in the cmake build scripts.") + endif() + + list(FIND _ALL_CONFIG_PACKAGES "${name}" called_twice) + if(called_twice GREATER -1) + message(SEND_ERROR "config_package(${name}) was called twice. + This is a bug in the cmake build scripts.") + else() + list(APPEND _ALL_CONFIG_PACKAGES "${name}") + set(_ALL_CONFIG_PACKAGES "${_ALL_CONFIG_PACKAGES}" CACHE INTERNAL "Internal variable") + endif() + + set(PANDA_PACKAGE_DESC_${name} "${desc}" PARENT_SCOPE) + set(PANDA_PACKAGE_NOTE_${name} "${note}" PARENT_SCOPE) +endfunction() + +# +# show_packages +# +function(show_packages) + message("") + message("Configuring support for the following optional third-party packages:") + + foreach(package ${_ALL_CONFIG_PACKAGES}) + set(desc "${PANDA_PACKAGE_DESC_${package}}") + set(note "${PANDA_PACKAGE_NOTE_${package}}") + if(HAVE_${package}) + if(NOT note STREQUAL "") + message("+ ${desc} (${note})") + else() + message("+ ${desc}") + endif() + else() + if(NOT ${package}_FOUND) + set(reason "not found") + elseif(PANDA_PACKAGE_DEFAULT_${package}) + set(reason "not requested") + else() + set(reason "disabled") + endif() + message("- ${desc} (${reason})") + endif() + endforeach() +endfunction() + # # target_use_packages # diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 80548f5cad..af5ebf81e1 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -412,24 +412,6 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # Now let's check for the presence of various thirdparty libraries. # -# Is Eigen installed, and should Eigen replace internal linmath? -find_package(Eigen3 QUIET) - -package_option(EIGEN - "Enables experimental support for the Eigen linear algebra library. -If this is provided, Panda will use this library as the fundamental -implementation of its own linmath library; otherwise, it will use -its own internal implementation. The primary advantage of using -Eigen is SSE2 support, which is only activated if LINMATH_ALIGN -is also enabled." - LICENSE "MPL-2") - -option(LINMATH_ALIGN - "This is required for activating SSE2 support using Eigen. -Activating this does constrain most objects in Panda to 16-byte -alignment, which could impact memory usage on very-low-memory -platforms. Currently experimental." ON) - # Always include Eigen, because we include it pretty much everywhere. if(EIGEN3_FOUND) include_directories(${EIGEN3_INCLUDE_DIR}) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index fd8c2c1164..854de90914 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -188,18 +188,7 @@ else() endif() # Now go through all the packages and report whether we have them. -message("") -message("Configuring support for the following optional third-party packages:") -if(HAVE_EIGEN) - message("+ Eigen linear algebra library") - if(LINMATH_ALIGN) - message("+ (vectorization enabled in build)") - else() - message("- (vectorization NOT enabled in build)") - endif() -else() - message("- Did not find Eigen linear algebra library") -endif() +show_packages() if(HAVE_OPENSSL) message("+ OpenSSL") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 35447f9dab..7ab874cf8a 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,3 +1,27 @@ +# Eigen +find_package(Eigen3 QUIET) +if(Eigen3_FOUND) + set(EIGEN_FOUND ON) +endif() +package_option(EIGEN + "Enables experimental support for the Eigen linear algebra library. +If this is provided, Panda will use this library as the fundamental +implementation of its own linmath library; otherwise, it will use +its own internal implementation. The primary advantage of using +Eigen is SSE2 support, which is only activated if LINMATH_ALIGN +is also enabled." + LICENSE "MPL-2") +option(LINMATH_ALIGN + "This is required for activating SSE2 support using Eigen. +Activating this does constrain most objects in Panda to 16-byte +alignment, which could impact memory usage on very-low-memory +platforms. Currently experimental." ON) +if(LINMATH_ALIGN) + config_package(EIGEN "Eigen linear algebra library" "vectorization enabled in build") +else() + config_package(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build") +endif() + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From 0b68316b3f6aa7c04771e9c57bffc904ce2dd148 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Feb 2018 16:41:40 -0700 Subject: [PATCH 368/744] CMake: Migrate OpenSSL detection to Package.cmake --- dtool/Config.cmake | 11 ----------- dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 26 +++++++++++++++++++++++++- 3 files changed, 25 insertions(+), 18 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index af5ebf81e1..8932cef6b6 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -487,17 +487,6 @@ without having to reinstall), comment out this definition and put your source directory on your PYTHONPATH.") -# Is OpenSSL installed, and where? -find_package(OpenSSL COMPONENTS ssl crypto QUIET) - -package_option(OPENSSL DEFAULT ON - "Enable OpenSSL support") - -option(REPORT_OPENSSL_ERRORS - "Define this true to include the OpenSSL code to report verbose -error messages when they occur." ${IS_DEBUG_BUILD}) - - # Is libjpeg installed, and where? find_package(JPEG QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 854de90914..5d2f4280e9 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -190,12 +190,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_OPENSSL) - message("+ OpenSSL") -else() - message("- Did not find OpenSSL") -endif() - if(HAVE_JPEG) message("+ libjpeg") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 7ab874cf8a..a5561ea7db 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,8 +1,12 @@ -# Eigen +# +# ------------ Eigen ------------ +# find_package(Eigen3 QUIET) + if(Eigen3_FOUND) set(EIGEN_FOUND ON) endif() + package_option(EIGEN "Enables experimental support for the Eigen linear algebra library. If this is provided, Panda will use this library as the fundamental @@ -11,17 +15,37 @@ its own internal implementation. The primary advantage of using Eigen is SSE2 support, which is only activated if LINMATH_ALIGN is also enabled." LICENSE "MPL-2") + option(LINMATH_ALIGN "This is required for activating SSE2 support using Eigen. Activating this does constrain most objects in Panda to 16-byte alignment, which could impact memory usage on very-low-memory platforms. Currently experimental." ON) + if(LINMATH_ALIGN) config_package(EIGEN "Eigen linear algebra library" "vectorization enabled in build") else() config_package(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build") endif() +# +# ------------ OpenSSL ------------ +# +find_package(OpenSSL COMPONENTS ssl crypto QUIET) + +package_option(OPENSSL DEFAULT ON + "Enable OpenSSL support") + +option(REPORT_OPENSSL_ERRORS + "Define this true to include the OpenSSL code to report verbose +error messages when they occur." ${IS_DEBUG_BUILD}) + +if(REPORT_OPENSSL_ERRORS) + config_package(OPENSSL "OpenSSL" "with verbose error reporting") +else() + config_package(OPENSSL "OpenSSL") +endif() + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From 68cb9534796ae52b4aba5468b39753ce195c262c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Feb 2018 17:27:50 -0700 Subject: [PATCH 369/744] CMake: Migrate JPEG/PNG/TIFF discovery to Package.cmake --- dtool/Config.cmake | 24 ------------------------ dtool/LocalSetup.cmake | 18 ------------------ dtool/Package.cmake | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 8932cef6b6..16a0a619aa 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -487,34 +487,10 @@ without having to reinstall), comment out this definition and put your source directory on your PYTHONPATH.") -# Is libjpeg installed, and where? -find_package(JPEG QUIET) - -package_option(JPEG DEFAULT ON - "Enable support for loading .jpg images.") - -# Some versions of libjpeg did not provide jpegint.h. Redefine this -# to false if you lack this header file. -#set(PHAVE_JPEGINT_H TRUE) - option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is libpng installed, and where? -find_package(PNG QUIET) - -package_option(PNG DEFAULT ON - "Enable support for loading .png images.") - - -# Is libtiff installed, and where? -find_package(TIFF QUIET) - -package_option(TIFF - "Enable support for loading .tif images.") - - # Is libtar installed, and where? find_package(Tar QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 5d2f4280e9..ea5557a026 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -190,24 +190,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_JPEG) - message("+ libjpeg") -else() - message("- Did not find libjpeg") -endif() - -if(HAVE_PNG) - message("+ libpng") -else() - message("- Did not find libpng") -endif() - -if(HAVE_TIFF) - message("+ libtiff") -else() - message("- Did not find libtiff") -endif() - if(HAVE_TAR) message("+ libtar") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index a5561ea7db..d3de122735 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -46,6 +46,25 @@ else() config_package(OPENSSL "OpenSSL") endif() +# +# ------------ IMAGE FORMATS ------------ +# + +# JPEG: +find_package(JPEG QUIET) +package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") +config_package(JPEG "libjpeg") + +# PNG: +find_package(PNG QUIET) +package_option(PNG DEFAULT ON "Enable support for loading .png images.") +config_package(PNG "libpng") + +# TIFF: +find_package(TIFF QUIET) +package_option(TIFF "Enable support for loading .tif images.") +config_package(TIFF "libtiff") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From f2e9e25230ac51e0151c6bd6d29b121eeb521770 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Feb 2018 17:29:04 -0700 Subject: [PATCH 370/744] CMake: Remove lingering references to Helix --- dtool/Config.cmake | 8 -------- dtool/dtool_config.h.in | 3 --- 2 files changed, 11 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 16a0a619aa..68866ab738 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -539,14 +539,6 @@ package_option(VRPN "Enables support for connecting to VRPN servers.") -# TODO: Helix -# Is HELIX installed, and where? -#find_package(Helix) - -#package_option(HELIX -# "Enables support for Helix media playback.") - - # Is ZLIB installed, and where? find_package(ZLIB QUIET) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 889871ff42..a328367234 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -92,9 +92,6 @@ /* Define if we have Berkeley DB installed. */ #cmakedefine HAVE_BDB -/* Define if we have HELIX installed. */ -#cmakedefine HAVE_HELIX - /* Define if we have CG installed. */ #cmakedefine HAVE_CG From 5c1ff5fdbc29f8582fb0fc93276a615568000664 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Feb 2018 17:38:25 -0700 Subject: [PATCH 371/744] CMake: Migrate detection of libtar --- dtool/Config.cmake | 7 ------- dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 8 ++++++++ 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 68866ab738..8ad74df904 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -491,13 +491,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is libtar installed, and where? -find_package(Tar QUIET) - -package_option(TAR - "This is used to optimize patch generation against tar files.") - - # TODO: FFTW2 # Is libfftw installed, and where? #find_package(FFTW2 QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index ea5557a026..fb0537ff31 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -190,12 +190,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_TAR) - message("+ libtar") -else() - message("- Did not find libtar") -endif() - if(HAVE_FFTW) message("+ fftw") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index d3de122735..244c739846 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -65,6 +65,14 @@ find_package(TIFF QUIET) package_option(TIFF "Enable support for loading .tif images.") config_package(TIFF "libtiff") +# +# ------------ LIBTAR ------------ +# +find_package(Tar QUIET) +package_option(TAR + "This is used to optimize patch generation against tar files.") +config_package(TAR "libtar") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From f75e245b1f0505e24cba3718f499906313f3d2b0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 16 Feb 2018 01:45:39 -0700 Subject: [PATCH 372/744] CMake: Enhance PackageConfig's include directory processing and name separation --- cmake/macros/PackageConfig.cmake | 45 ++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 8b14b86269..ed6544a52f 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -10,6 +10,7 @@ # Usage: # package_option(package_name package_doc_string # [DEFAULT ON | OFF] +# [FOUND_AS find_name] # [LICENSE license]) # Examples: # package_option(LIBNAME "Enables LIBNAME support." DEFAULT OFF) @@ -19,6 +20,9 @@ # In builds for redistribution, there is the additional requirement that # the package be suitably-licensed. # +# FOUND_AS indicates the name of the CMake find_package() module, which +# may differ from Panda3D's internal name for that package. +# # # Function: config_package # Usage: @@ -59,6 +63,7 @@ function(package_option name) # Parse the arguments. set(command) set(default) + set(found_as "${name}") set(license "") set(cache_string) @@ -67,6 +72,10 @@ function(package_option name) set(default "${arg}") set(command) + elseif(command STREQUAL "FOUND_AS") + set(found_as "${arg}") + set(command) + elseif(command STREQUAL "LICENSE") set(license "${arg}") set(command) @@ -74,6 +83,9 @@ function(package_option name) elseif(arg STREQUAL "DEFAULT") set(command "DEFAULT") + elseif(arg STREQUAL "FOUND_AS") + set(command "FOUND_AS") + elseif(arg STREQUAL "LICENSE") set(command "LICENSE") @@ -95,7 +107,7 @@ function(package_option name) if(IS_DIST_BUILD) # Accept things that don't have a configured license if(license STREQUAL "") - set(default "${${name}_FOUND}") + set(default "${${found_as}_FOUND}") else() list(FIND PANDA_DIST_USE_LICENSES ${license} license_index) @@ -104,7 +116,7 @@ function(package_option name) if(${license_index} EQUAL "-1") set(default OFF) else() - set(default "${${name}_FOUND}") + set(default "${${found_as}_FOUND}") endif() endif() @@ -112,13 +124,13 @@ function(package_option name) set(default OFF) else() - set(default "${${name}_FOUND}") + set(default "${${found_as}_FOUND}") endif() endif() # If it was set by the user but not found, display an error. - if(HAVE_${name} AND NOT ${name}_FOUND) + if(HAVE_${name} AND NOT ${found_as}_FOUND) message(SEND_ERROR "NOT FOUND: ${name}. Disable HAVE_${name} to continue.") endif() @@ -131,15 +143,20 @@ function(package_option name) set(PANDA_DID_SET_OPTION_${name} TRUE PARENT_SCOPE) endif() - set(PANDA_PACKAGE_DEFAULT_${name} "${default}") + set(PANDA_PACKAGE_DEFAULT_${name} "${default}" PARENT_SCOPE) # Create the option. option("HAVE_${name}" "${cache_string}" "${default}") if(HAVE_${name}) - set(_${name}_LIBRARY ${${name}_LIBRARY} CACHE INTERNAL "") - set(_${name}_LIBRARIES ${${name}_LIBRARIES} CACHE INTERNAL "") + set(_${name}_INCLUDES ${${found_as}_INCLUDE_DIRS} ${${found_as}_INCLUDE_DIR} + CACHE INTERNAL "") + if(${found_as}_LIBRARIES) + set(_${name}_LIBRARIES ${${found_as}_LIBRARIES} CACHE INTERNAL "") + else() + set(_${name}_LIBRARIES "${${found_as}_LIBRARY}" CACHE INTERNAL "") + endif() else() - unset(_${name}_LIBRARY CACHE) + unset(_${name}_INCLUDES CACHE) unset(_${name}_LIBRARIES CACHE) endif() endfunction() @@ -192,7 +209,7 @@ function(show_packages) else() if(NOT ${package}_FOUND) set(reason "not found") - elseif(PANDA_PACKAGE_DEFAULT_${package}) + elseif(NOT PANDA_PACKAGE_DEFAULT_${package}) set(reason "not requested") else() set(reason "disabled") @@ -214,14 +231,8 @@ macro(target_use_packages target) foreach(lib ${libs}) if(HAVE_${lib}) - # N.B. target_include_directories is new in CMake 2.8.11; we target 2.8.4. - #target_include_directories("${target}" PUBLIC "${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") - include_directories("${${lib}_INCLUDE_DIRS};${${lib}_INCLUDE_DIR}") - if(_${lib}_LIBRARIES) - target_link_libraries("${target}" ${_${lib}_LIBRARIES}) - else() - target_link_libraries("${target}" ${_${lib}_LIBRARY}) - endif() + target_include_directories("${target}" PUBLIC ${_${lib}_INCLUDES}) + target_link_libraries("${target}" ${_${lib}_LIBRARIES}) endif() endforeach(lib) endmacro(target_use_packages) From 23996559206445a8016032d207bfbea320ff088e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 17 Feb 2018 16:56:10 -0700 Subject: [PATCH 373/744] CMake: Make sure Interrogate doesn't see package include directories --- cmake/macros/Interrogate.cmake | 17 ++++++++++++++++- cmake/macros/PackageConfig.cmake | 7 ++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index fd3dcae53d..1bb6b08005 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -166,10 +166,25 @@ function(interrogate_sources target output database language_flags) # Interrogate also needs the include paths, so we'll extract them from the # target. These are available via a generator expression. + # When we read the INTERFACE_INCLUDE_DIRECTORIES property, we need to read it + # from a target that has the IS_INTERROGATE=1 property. + # (See PackageConfig.cmake for an explanation why.) + # The problem is, custom commands are not targets, so we can't put target + # properties on them. And if you try to use the $ + # generator expression from the context of a custom command, it'll instead + # read the property from the most recent actual target. As a workaround for + # this, we create a fake target with the IS_INTERROGATE property set and pull + # the INTERFACE_INCLUDE_DIRECTORIES property out through that. + # I hate it, but such is CMake. + add_custom_target(${target}_igate_internal EXCLUDE_FROM_ALL) + set_target_properties(${target}_igate_internal PROPERTIES + IS_INTERROGATE 1 + INTERFACE_INCLUDE_DIRECTORIES "$") + # Note, the \t is a workaround for a CMake bug where using a plain space in # a JOIN will cause it to be escaped. Tabs are not escaped and will # separate correctly. - set(include_flags "-I$,\t-I>") + set(include_flags "-I$,\t-I>") # The above must also be included when compiling the resulting _igate.cxx file: include_directories("$") diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index ed6544a52f..28ed2a516b 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -231,8 +231,13 @@ macro(target_use_packages target) foreach(lib ${libs}) if(HAVE_${lib}) - target_include_directories("${target}" PUBLIC ${_${lib}_INCLUDES}) target_link_libraries("${target}" ${_${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 + $<$>>:${_${lib}_INCLUDES}>) endif() endforeach(lib) endmacro(target_use_packages) From 5c4ef25bb79d2e07b49a1342313a231d731bc59f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 15 Feb 2018 15:25:15 -0700 Subject: [PATCH 374/744] CMake: Use proper target_use_packages definitions for Eigen --- dtool/Config.cmake | 6 ------ dtool/Package.cmake | 5 +---- dtool/src/dtoolbase/CMakeLists.txt | 2 +- panda/CMakeLists.txt | 3 --- panda/src/linmath/CMakeLists.txt | 1 + 5 files changed, 3 insertions(+), 14 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 8ad74df904..a20434d80b 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -412,12 +412,6 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # Now let's check for the presence of various thirdparty libraries. # -# Always include Eigen, because we include it pretty much everywhere. -if(EIGEN3_FOUND) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() - - # Is Python installed, and should Python interfaces be generated? set(WANT_PYTHON_VERSION "2.7" CACHE STRING "Which Python version to seek out for building Panda3D against.") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 244c739846..a115cb118e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -3,10 +3,6 @@ # find_package(Eigen3 QUIET) -if(Eigen3_FOUND) - set(EIGEN_FOUND ON) -endif() - package_option(EIGEN "Enables experimental support for the Eigen linear algebra library. If this is provided, Panda will use this library as the fundamental @@ -14,6 +10,7 @@ implementation of its own linmath library; otherwise, it will use its own internal implementation. The primary advantage of using Eigen is SSE2 support, which is only activated if LINMATH_ALIGN is also enabled." + FOUND_AS EIGEN3 LICENSE "MPL-2") option(LINMATH_ALIGN diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 642f1d95e6..29605d602e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -73,7 +73,7 @@ add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolbase PUBLIC $) -target_use_packages(p3dtoolbase THREADS) +target_use_packages(p3dtoolbase THREADS EIGEN) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) install(TARGETS p3dtoolbase DESTINATION lib) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6dca58d075..e781ae96a3 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -5,9 +5,6 @@ endif() # Not sure where I want to hide these inludes yet, but it is annoying # to have to add them to every CMakeLists that either directly, or # recursively includes linmath, and other libraries etc... -if(HAVE_EIGEN) - include_directories(${EIGEN3_INCLUDE_DIR}) -endif() if(HAVE_FFTW) include_directories(${FFTW2_INCLUDE_DIR}) endif() diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index be69df108f..be9d1dcfa5 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -46,6 +46,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3express p3pandabase) +target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) install(TARGETS p3linmath DESTINATION lib) From 283db1fb7ac6363f4fa8bb00d1e357e1d5cff30d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 17 Feb 2018 23:35:43 -0700 Subject: [PATCH 375/744] CMake: Implement detection for FFTW3 --- cmake/modules/FindFFTW3.cmake | 2 +- dtool/Config.cmake | 11 ----------- dtool/LocalSetup.cmake | 7 ------- dtool/Package.cmake | 15 +++++++++++++++ dtool/dtool_config.h.in | 5 +---- panda/CMakeLists.txt | 3 --- panda/src/mathutil/CMakeLists.txt | 3 ++- 7 files changed, 19 insertions(+), 27 deletions(-) diff --git a/cmake/modules/FindFFTW3.cmake b/cmake/modules/FindFFTW3.cmake index 619c580828..fbd572fbfc 100644 --- a/cmake/modules/FindFFTW3.cmake +++ b/cmake/modules/FindFFTW3.cmake @@ -106,4 +106,4 @@ if(NOT FFTW3_INCLUDE_DIR OR NOT FFTW3_LIBRARY_DIR) endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(FFTW DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR) \ No newline at end of file +find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index a20434d80b..6b1ebd89cb 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -485,17 +485,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# TODO: FFTW2 -# Is libfftw installed, and where? -#find_package(FFTW2 QUIET) - -#package_option(FFTW -# "This enables support for lossless compression of animations in -#.bam files. This is rarely used, and you probably don't need it.") - -#TODO PHAVE_DRFFTW_H - - # Is libsquish installed, and where? find_package(Squish QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index fb0537ff31..1da3ec113b 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -163,7 +163,6 @@ check_include_file_cxx(unistd.h PHAVE_UNISTD_H) check_include_file_cxx(utime.h PHAVE_UTIME_H) check_include_file_cxx(glob.h PHAVE_GLOB_H) check_include_file_cxx(dirent.h PHAVE_DIRENT_H) -check_include_file_cxx(drfftw.h PHAVE_DRFFTW_H) check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) #TODO doesn't work on OSX, use sys/ucontext.h check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) @@ -190,12 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_FFTW) - message("+ fftw") -else() - message("- Did not find fftw") -endif() - if(HAVE_SQUISH) message("+ squish") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index a115cb118e..f72eb3a398 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -70,6 +70,21 @@ package_option(TAR "This is used to optimize patch generation against tar files.") config_package(TAR "libtar") +# +# ------------ FFTW ------------ +# + +find_package(FFTW3 QUIET) + +package_option(FFTW + "This enables support for compression of animations in .bam files. + This is only necessary for creating or reading .bam files containing + compressed animations." + FOUND_AS "FFTW3" + LICENSE "GPL") + +config_package(FFTW "FFTW") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index a328367234..4cfc7d70c7 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -83,7 +83,7 @@ /* Define if we have libtar installed. */ #cmakedefine HAVE_TAR -/* Define if we have libfftw installed. */ +/* Define if we have libfftw3 installed. */ #cmakedefine HAVE_FFTW /* Define if we have libsquish installed. */ @@ -406,9 +406,6 @@ /* Define if you have the header file. */ #cmakedefine PHAVE_DIRENT_H -/* Define if you have the header file. */ -#cmakedefine PHAVE_DRFFTW_H - /* Do we have (and presumably a Linux-style audio interface)? */ #cmakedefine PHAVE_SYS_SOUNDCARD_H diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index e781ae96a3..ab8ff038a6 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -5,9 +5,6 @@ endif() # Not sure where I want to hide these inludes yet, but it is annoying # to have to add them to every CMakeLists that either directly, or # recursively includes linmath, and other libraries etc... -if(HAVE_FFTW) - include_directories(${FFTW2_INCLUDE_DIR}) -endif() if(HAVE_CG) include_directories(${CG_INCLUDE_DIRS}) endif() diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 6227880573..fcc9f55dea 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -62,7 +62,8 @@ set(P3MATHUTIL_SOURCES composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -target_link_libraries(p3mathutil p3event ${FFTW2_LIBRARY_DIR}) +target_link_libraries(p3mathutil p3event) +target_use_packages(p3mathutil FFTW) target_interrogate(p3mathutil ALL) install(TARGETS p3mathutil DESTINATION lib) From 6907eb5207849511e128fd7abcf6c955772ede85 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 18 Feb 2018 03:57:56 -0700 Subject: [PATCH 376/744] CMake: Fix Interrogate -module panda3d.${module} flag missing --- cmake/macros/Interrogate.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 1bb6b08005..6f33fb2150 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -258,7 +258,7 @@ function(add_python_module module) foreach(target ${targets}) interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" - -python-native -module "panda3d.${module}") + "-python-native;-module;panda3d.${module}") get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) list(APPEND infiles "${target}.in") list(APPEND sources "${target}_igate.cxx" ${target_extensions}) From 0783013ecdfe16c58a817f1a6c9469f1c1ab3577 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 18 Feb 2018 20:24:27 -0700 Subject: [PATCH 377/744] CMake: Custom targets don't need EXCLUDE_FROM_ALL --- cmake/macros/Interrogate.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 6f33fb2150..817a2b6cda 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -176,7 +176,7 @@ function(interrogate_sources target output database language_flags) # this, we create a fake target with the IS_INTERROGATE property set and pull # the INTERFACE_INCLUDE_DIRECTORIES property out through that. # I hate it, but such is CMake. - add_custom_target(${target}_igate_internal EXCLUDE_FROM_ALL) + add_custom_target(${target}_igate_internal) set_target_properties(${target}_igate_internal PROPERTIES IS_INTERROGATE 1 INTERFACE_INCLUDE_DIRECTORIES "$") From 71836f09e3dfbe5cfaf7cc2dceae37144b2f69e0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 18 Feb 2018 20:42:59 -0700 Subject: [PATCH 378/744] CMake: Remove references to genPyCode --- dtool/Config.cmake | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 6b1ebd89cb..8b48b1e97d 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -461,16 +461,6 @@ else() set(USE_DEBUG_PYTHON OFF) endif() -set(GENPYCODE_LIBS - "libpandaexpress;libpanda;libpandaphysics;libp3direct;libpandafx;libp3vision;libpandaode;libp3vrpn" - CACHE STRING - "Define the default set of libraries to be instrumented by -genPyCode. You may wish to add to this list to add your own -libraries, or if you want to use some of the more obscure -interfaces like libpandaegg and libpandafx.") - -mark_as_advanced(GENPYCODE_LIBS) - option(INSTALL_PYTHON_SOURCE "Normally, Python source files are copied into the CMake library install directory, along with the compiled C++ library objects, when From a9717cf3ab4b3b13e8ed77c8ea6bb9e50ca36909 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 18 Feb 2018 21:41:33 -0700 Subject: [PATCH 379/744] CMake: Migrate detection of libsquish --- dtool/Config.cmake | 7 ------- dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 11 +++++++++++ 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 8b48b1e97d..445cca4f09 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -475,13 +475,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is libsquish installed, and where? -find_package(Squish QUIET) - -package_option(SQUISH - "Enables support for automatic compression of DXT textures.") - - # Is Cg installed, and where? find_package(Cg QUIET) package_option(CG diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 1da3ec113b..e875342c5d 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,12 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_SQUISH) - message("+ squish") -else() - message("- Did not find squish") -endif() - if(HAVE_CG) message("+ Nvidia Cg High Level Shading Language") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index f72eb3a398..f703c50f16 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -85,6 +85,17 @@ package_option(FFTW config_package(FFTW "FFTW") +# +# ------------ libsquish ------------ +# + +find_package(Squish QUIET) + +package_option(SQUISH + "Enables support for automatic compression of DXT textures.") + +config_package(SQUISH "libsquish") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From ecfd924f0de9dd43ba57408398cd03b58754c944 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 18 Feb 2018 23:34:02 -0700 Subject: [PATCH 380/744] CMake: Remove references to unsupported versions of DirectX. --- dtool/Config.cmake | 4 ---- dtool/LocalSetup.cmake | 18 ------------------ dtool/dtool_config.h.in | 9 --------- panda/src/framework/CMakeLists.txt | 5 ----- 4 files changed, 36 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 445cca4f09..7ba8afc0d9 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -483,12 +483,8 @@ package_option(CG package_option(CGGL "Enable support for Nvidia Cg's OpenGL API." LICENSE "Nvidia") -package_option(CGDX8 "Enable support for Nvidia Cg's DX8 API." - LICENSE "Nvidia") package_option(CGDX9 "Enable support for Nvidia Cg's DX9 API." LICENSE "Nvidia") -package_option(CGDX10 "Enable support for Nvidia Cg's DX10 API." - LICENSE "Nvidia") # Is VRPN installed, and where? diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index e875342c5d..1d6d442e43 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -201,24 +201,12 @@ else() message("- Did not find Cg OpenGL API") endif() -if(HAVE_CGDX8) - message("+ Cg DX8 API") -else() - message("- Did not find Cg DX8 API") -endif() - if(HAVE_CGDX9) message("+ Cg DX9 API") else() message("- Did not find Cg DX9 API") endif() -if(HAVE_CGDX10) - message("+ Cg DX10 API") -else() - message("- Did not find Cg DX10 API") -endif() - if(HAVE_VRPN) message("+ VRPN") else() @@ -303,12 +291,6 @@ else() message("- Did not find OpenGL ES 2") endif() -if(HAVE_DX8) - message("+ DirectX8") -else() - message("- Did not find DirectX8") -endif() - if(HAVE_DX9) message("+ DirectX9") else() diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 4cfc7d70c7..63b2e23dcf 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -98,15 +98,9 @@ /* Define if we have CGGL installed. */ #cmakedefine HAVE_CGGL -/* Define if we have CGDX8 installed. */ -#cmakedefine HAVE_CGDX8 - /* Define if we have CGDX9 installed. */ #cmakedefine HAVE_CGDX9 -/* Define if we have CGDX10 installed. */ -#cmakedefine HAVE_CGDX10 - /* Define for dxerr.h instead of dxerr9.h. */ #cmakedefine USE_GENERIC_DXERR_LIBRARY @@ -158,9 +152,6 @@ /* Define if we have Windows-GL installed and want to build for Wgl. */ #cmakedefine HAVE_WGL -/* Define if we have DirectX installed and want to build for DX. */ -#cmakedefine HAVE_DX8 - /* Define if we have DirectX installed and want to build for DX. */ #cmakedefine HAVE_DX9 diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index ff441c724a..a2444365a1 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -20,11 +20,6 @@ if(NOT BUILD_SHARED_LIBS) ${P3FRAMEWORK_LINK_TARGETS} pandagl ) - elseif(HAVE_DX10) - set(P3FRAMEWORK_LINK_TARGETS - ${P3FRAMEWORK_LINK_TARGETS} - pandadx10 - ) elseif(HAVE_DX9) set(P3FRAMEWORK_LINK_TARGETS ${P3FRAMEWORK_LINK_TARGETS} From 75366484b0ab0118461fc0cbe030866e0465996f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 19 Feb 2018 00:05:49 -0700 Subject: [PATCH 381/744] CMake: Migrate over Nvidia Cg package detection --- dtool/Config.cmake | 12 ------------ dtool/LocalSetup.cmake | 18 ------------------ dtool/Package.cmake | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 30 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 7ba8afc0d9..3181818630 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -475,18 +475,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is Cg installed, and where? -find_package(Cg QUIET) -package_option(CG - "Enable support for Nvidia Cg Shading Language" - LICENSE "Nvidia") -package_option(CGGL - "Enable support for Nvidia Cg's OpenGL API." - LICENSE "Nvidia") -package_option(CGDX9 "Enable support for Nvidia Cg's DX9 API." - LICENSE "Nvidia") - - # Is VRPN installed, and where? find_package(VRPN QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 1d6d442e43..08417bbcbc 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,24 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_CG) - message("+ Nvidia Cg High Level Shading Language") -else() - message("- Did not find Nvidia Cg High Level Shading Language") -endif() - -if(HAVE_CGGL) - message("+ Cg OpenGL API") -else() - message("- Did not find Cg OpenGL API") -endif() - -if(HAVE_CGDX9) - message("+ Cg DX9 API") -else() - message("- Did not find Cg DX9 API") -endif() - if(HAVE_VRPN) message("+ VRPN") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index f703c50f16..f9f96e8765 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -96,6 +96,33 @@ package_option(SQUISH config_package(SQUISH "libsquish") +# +# ------------ Nvidia Cg ------------ +# + +find_package(Cg QUIET) + +package_option(CG + "Enable support for Nvidia Cg Shading Language" + LICENSE "Nvidia") +package_option(CGGL + "Enable support for Nvidia Cg's OpenGL API." + LICENSE "Nvidia") +package_option(CGDX9 + "Enable support for Nvidia Cg's DirectX 9 API." + LICENSE "Nvidia") + +if(HAVE_CGGL AND HAVE_CGDX9) + set(cg_apis "supporting OpenGL and DirectX 9") +elseif(HAVE_CGGL) + set(cg_apis "supporting OpenGL") +elseif(HAVE_CGDX9) + set(cg_apis "supporting DirectX 9") +else() + set(cg_apis "WITHOUT rendering backend support") +endif() +config_package(CG "Nvidia Cg Shading Language" "${cg_apis}") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From e8820884213f1582fc1f82dfdc0dafebd4ef0f2e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 13:55:28 -0700 Subject: [PATCH 382/744] CMake: Remove INSTALL_PYTHON_SOURCE option It's unused and easy to run "make" in between changes anyway --- dtool/Config.cmake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3181818630..bc7474b1c5 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -461,15 +461,6 @@ else() set(USE_DEBUG_PYTHON OFF) endif() -option(INSTALL_PYTHON_SOURCE - "Normally, Python source files are copied into the CMake library -install directory, along with the compiled C++ library objects, when -you make install. If you prefer not to copy these Python source -files, but would rather run them directly out of the source -directory (presumably so you can develop them and make changes -without having to reinstall), comment out this definition and put -your source directory on your PYTHONPATH.") - option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) From 0ed64c72ce0d1322076996d03ab20c1031b84e04 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 17:02:17 -0700 Subject: [PATCH 383/744] CMake: Migrate over VRPN detection --- dtool/Config.cmake | 7 ------- dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 12 ++++++++++++ 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index bc7474b1c5..b4acfeb745 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -466,13 +466,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is VRPN installed, and where? -find_package(VRPN QUIET) - -package_option(VRPN - "Enables support for connecting to VRPN servers.") - - # Is ZLIB installed, and where? find_package(ZLIB QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 08417bbcbc..d0177b6e65 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,12 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_VRPN) - message("+ VRPN") -else() - message("- Did not find VRPN") -endif() - if(HAVE_ZLIB) message("+ zlib") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index f9f96e8765..97303013ce 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -123,6 +123,18 @@ else() endif() config_package(CG "Nvidia Cg Shading Language" "${cg_apis}") +# +# ------------ VRPN ------------ +# + +find_package(VRPN QUIET) + +package_option(VRPN + "Enables support for connecting to VRPN servers. This is only needed if you + are building Panda3D for a fixed VRPN-based VR installation.") + +config_package(VRPN "VRPN") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From 72d668e05a36fc0b281040e7d66b6f4fb63ded36 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 17:19:21 -0700 Subject: [PATCH 384/744] CMake: Migrate zlib package detection --- dtool/Config.cmake | 6 ------ dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 11 +++++++++++ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index b4acfeb745..d38e394f87 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -466,12 +466,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is ZLIB installed, and where? -find_package(ZLIB QUIET) - -package_option(ZLIB DEFAULT ON - "Enables support for compression of Panda assets.") - # Is FFMPEG installed, and where? find_package(FFMPEG QUIET) find_package(SWScale QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index d0177b6e65..1c7d4beffc 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,12 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_ZLIB) - message("+ zlib") -else() - message("- Did not find zlib") -endif() - if(HAVE_RAD_MSS) message("+ Miles Sound System") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 97303013ce..6160db69de 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -135,6 +135,17 @@ package_option(VRPN config_package(VRPN "VRPN") +# +# ------------ zlib ------------ +# + +find_package(zlib QUIET) + +package_option(ZLIB + "Enables support for compression of Panda assets.") + +config_package(ZLIB "zlib") + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From 3210302caf1df3ebcf98f898afb4c934ec085456 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 17:50:00 -0700 Subject: [PATCH 385/744] CMake: Migrate FFmpeg package detection --- dtool/Config.cmake | 12 ------------ dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index d38e394f87..d1225f12b9 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -466,18 +466,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is FFMPEG installed, and where? -find_package(FFMPEG QUIET) -find_package(SWScale QUIET) -find_package(SWResample QUIET) - -package_option(FFMPEG - "Enables support for audio- and video-decoding using the FFMPEG library.") -package_option(SWSCALE - "Enables support for FFMPEG's libswscale for video rescaling.") -package_option(SWRESAMPLE - "Enables support for FFMPEG's libresample for audio resampling.") - # Is ODE installed, and where? find_package(ODE QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 1c7d4beffc..f35c6b8d62 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -291,12 +291,6 @@ else() message("- Did not find OpenCV") endif() -if(HAVE_FFMPEG) - message("+ FFMPEG") -else() - message("- Did not find FFMPEG") -endif() - if(HAVE_ODE) message("+ ODE") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 6160db69de..626b0db4a8 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -146,6 +146,33 @@ package_option(ZLIB config_package(ZLIB "zlib") +# +# ------------ FFmpeg ------------ +# + +find_package(FFMPEG QUIET) +find_package(SWScale QUIET) +find_package(SWResample QUIET) + +package_option(FFMPEG + "Enables support for audio- and video-decoding using the FFmpeg library.") +package_option(SWSCALE + "Enables support for FFmpeg's libswscale for video rescaling.") +package_option(SWRESAMPLE + "Enables support for FFmpeg's libresample for audio resampling.") + +if(HAVE_SWSCALE AND HAVE_SWRESAMPLE) + set(ffmpeg_features "with swscale and swresample") +elseif(HAVE_SWSCALE) + set(ffmpeg_features "with swscale") +elseif(HAVE_SWRESAMPLE) + set(ffmpeg_features "with swresample") +else() + set(ffmpeg_features "without resampling/rescaling support") +endif() +config_package(FFMPEG "FFmpeg" "${ffmpeg_features}") + + # Find and configure Miles Sound System find_package(Miles QUIET) #config_package(RAD_MSS "Miles Sound System") From 769fd30119f2fee67a46f20ba93765bb97418662 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 17:50:29 -0700 Subject: [PATCH 386/744] CMake: Remove more HAVE_MESA references --- dtool/LocalSetup.cmake | 6 ------ dtool/dtool_config.h.in | 8 -------- 2 files changed, 14 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index f35c6b8d62..9adc77afd9 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -279,12 +279,6 @@ else() message("- Did not find X11") endif() -if(HAVE_MESA) - message("+ Mesa") -else() - message("- Did not find Mesa") -endif() - if(HAVE_OPENCV) message("+ OpenCV") else() diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 63b2e23dcf..834d3a4467 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -135,14 +135,6 @@ /* Define if we have AWESOMIUM installed and want to build for AWESOMIUM. */ #cmakedefine HAVE_AWESOMIUM -/* Define if we have Mesa installed and want to build mesadisplay. */ -#cmakedefine HAVE_MESA -#cmakedefine MESA_MGL -#if HAVE_MESA -#cmakedefine MIN_MESA_VERSION_MAJOR -#cmakedefine MIN_MESA_VERSION_MINOR -#endif - /* Define if we have GLX installed and want to build for GLX. */ #cmakedefine HAVE_GLX From 2717c24ffc31c673a96e7569a29c9f5c9d255f4a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 18:19:45 -0700 Subject: [PATCH 387/744] CMake: Migrate detection of the audio libraries --- dtool/LocalSetup.cmake | 18 -------------- dtool/Package.cmake | 35 ++++++++++++++++++++-------- panda/src/audiotraits/CMakeLists.txt | 5 ++++ 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 9adc77afd9..b9d331e92e 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,24 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_RAD_MSS) - message("+ Miles Sound System") -else() - message("- Did not find Miles Sound System") -endif() - -if(HAVE_FMODEX) - message("+ FMOD Ex sound library") -else() - message("- Did not find FMOD Ex sound library") -endif() - -if(HAVE_OPENAL) - message("+ OpenAL sound library") -else() - message("- Did not find OpenAL sound library") -endif() - if(HAVE_PHYSX) message("+ Ageia PhysX") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 626b0db4a8..b965c0244c 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -172,22 +172,37 @@ else() endif() config_package(FFMPEG "FFmpeg" "${ffmpeg_features}") +# +# ------------ Audio libraries ------------ +# -# Find and configure Miles Sound System +# Miles Sound System find_package(Miles QUIET) -#config_package(RAD_MSS "Miles Sound System") -package_option(RAD_MSS) +package_option(RAD_MSS + "This enables support for audio output via the Miles Sound System, + by RAD Game Tools. This requires a commercial license to use, so you'll know + if you need to enable this option." + FOUND_AS Miles + LICENSE "Miles") +config_package(RAD_MSS "Miles Sound System") -# Find and configure FMOD Ex +# FMOD Ex find_package(FMODEx QUIET) -#config_package(FMODEX "FMOD Ex sound library") -package_option(FMODEX) +package_option(FMODEX + "This enables support for the FMOD Ex sound library, + from Firelight Technologies. This audio library is free for non-commercial + use." + LICENSE "FMOD") +config_package(FMODEX "FMOD Ex sound library") -# Find and configure OpenAL +# OpenAL find_package(OpenAL QUIET) -#config_package(OPENAL "OpenAL sound library") -package_option(OPENAL) - +package_option(OPENAL + "This enables support for audio output via OpenAL. Some platforms, such as + macOS, provide their own OpenAL implementation, which Panda3D can use. But, + on most platforms this will imply OpenAL Soft, which is LGPL licensed." + LICENSE "LGPL") +config_package(OPENAL "OpenAL sound library") # Find and configure Freetype find_package(Freetype QUIET) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 42732d182f..52d090e794 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -61,4 +61,9 @@ if(HAVE_AUDIO) install(TARGETS p3openal_audio DESTINATION lib) endif() + if(NOT HAVE_RAD_MSS AND NOT HAVE_FMODEX AND NOT HAVE_OPENAL) + message(SEND_ERROR + "You must have an audio backend for audio support! Turn off HAVE_AUDIO to ignore this.") + endif() + endif() From 8b9d2c0f33b8a578fb430881cdf709ecf47e3abf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 18:19:56 -0700 Subject: [PATCH 388/744] CMake: Delete FindEigen2, we rely on Eigen3+ --- cmake/modules/FindEigen2.cmake | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 cmake/modules/FindEigen2.cmake diff --git a/cmake/modules/FindEigen2.cmake b/cmake/modules/FindEigen2.cmake deleted file mode 100644 index 8cf93e94d5..0000000000 --- a/cmake/modules/FindEigen2.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# Filename: FindEigen2.cmake -# Authors: kestred (13 Dec, 2013) -# -# Usage: -# find_package(Eigen2 [REQUIRED] [QUIET]) -# -# Once done this will define: -# EIGEN_FOUND - system has any version of Eigen -# EIGEN2_FOUND - system has Eigen2 -# EIGEN2_INCLUDE_DIR - the Eigen2 include directory -# - -if(NOT EIGEN2_INCLUDE_DIR) - find_path(EIGEN2_INCLUDE_DIR - NAMES Eigen/Core - PATHS ${INCLUDE_INSTALL_DIR} - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen2 - ) - - mark_as_advanced(EIGEN2_INCLUDE_DIR) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Eigen2 DEFAULT_MSG EIGEN2_INCLUDE_DIR) - -if(EIGEN2_FOUND) - set(EIGEN_FOUND TRUE) -endif() \ No newline at end of file From 590523ac8cd095b0a4865ffe98520504ec478927 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 18:58:52 -0700 Subject: [PATCH 389/744] CMake: Rename FindSquish to FindLibSquish CMake already has a "FindSquish" for finding the GUI testing product. This minimizes the chances of the wrong module being run on accident. --- cmake/modules/FindLibSquish.cmake | 80 +++++++++++++++++++++++++++++++ cmake/modules/FindSquish.cmake | 80 ------------------------------- dtool/Package.cmake | 5 +- 3 files changed, 83 insertions(+), 82 deletions(-) create mode 100644 cmake/modules/FindLibSquish.cmake delete mode 100644 cmake/modules/FindSquish.cmake diff --git a/cmake/modules/FindLibSquish.cmake b/cmake/modules/FindLibSquish.cmake new file mode 100644 index 0000000000..9a21d65852 --- /dev/null +++ b/cmake/modules/FindLibSquish.cmake @@ -0,0 +1,80 @@ +# Filename: FindLibSquish.cmake +# Author: kestred (7 Dec, 2013) +# +# Usage: +# find_package(LibSquish [REQUIRED] [QUIET]) +# +# Once done this will define: +# LIBSQUISH_FOUND - system has libsquish +# LIBSQUISH_INCLUDE_DIR - the libsquish include directory +# LIBSQUISH_LIBRARY_DIR - the libsquish library directory +# LIBSQUISH_LIBRARY - the path to the library binary +# +# LIBSQUISH_RELEASE_LIBRARY - the filepath of the libsquish release library +# LIBSQUISH_DEBUG_LIBRARY - the filepath of the libsquish debug library +# + +if(NOT LIBSQUISH_INCLUDE_DIR OR NOT LIBSQUISH_LIBRARY_DIR) + # Find the libsquish include files + find_path(LIBSQUISH_INCLUDE_DIR + NAMES "squish.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "" "cppunit" + ) + + # Find the libsquish library built for release + find_library(LIBSQUISH_RELEASE_LIBRARY + NAMES "squish" "libsquish" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + # Find the libsquish library built for debug + find_library(LIBSQUISH_DEBUG_LIBRARY + NAMES "squishd" "libsquishd" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" + ) + + + mark_as_advanced(LIBSQUISH_INCLUDE_DIR) + mark_as_advanced(LIBSQUISH_RELEASE_LIBRARY) + mark_as_advanced(LIBSQUISH_DEBUG_LIBRARY) +endif() + +# Choose library +if(CMAKE_BUILD_TYPE MATCHES "Debug" AND LIBSQUISH_DEBUG_LIBRARY) + set(LIBSQUISH_LIBRARY ${LIBSQUISH_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libsquish's library binary.") +elseif(LIBSQUISH_RELEASE_LIBRARY) + set(LIBSQUISH_LIBRARY ${LIBSQUISH_RELEASE_LIBRARY} CACHE FILEPATH "The filepath to libsquish's library binary.") +elseif(LIBSQUISH_DEBUG_LIBRARY) + set(LIBSQUISH_LIBRARY ${LIBSQUISH_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libsquish's library binary.") +endif() + +# Translate library into library directory +if(LIBSQUISH_LIBRARY) + unset(LIBSQUISH_LIBRARY_DIR CACHE) + get_filename_component(LIBSQUISH_LIBRARY_DIR "${LIBSQUISH_LIBRARY}" PATH) + set(LIBSQUISH_LIBRARY_DIR "${LIBSQUISH_LIBRARY_DIR}" CACHE PATH "The path to libsquish's library directory.") # Library path +endif() + +mark_as_advanced(LIBSQUISH_LIBRARY) +mark_as_advanced(LIBSQUISH_LIBRARY_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibSquish DEFAULT_MSG LIBSQUISH_LIBRARY LIBSQUISH_INCLUDE_DIR LIBSQUISH_LIBRARY_DIR) diff --git a/cmake/modules/FindSquish.cmake b/cmake/modules/FindSquish.cmake deleted file mode 100644 index 9a0acb80ae..0000000000 --- a/cmake/modules/FindSquish.cmake +++ /dev/null @@ -1,80 +0,0 @@ -# Filename: FindSquish.cmake -# Author: kestred (7 Dec, 2013) -# -# Usage: -# find_package(Squish [REQUIRED] [QUIET]) -# -# Once done this will define: -# SQUISH_FOUND - system has squish -# SQUISH_INCLUDE_DIR - the squish include directory -# SQUISH_LIBRARY_DIR - the squish library directory -# 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 -# - -if(NOT SQUISH_INCLUDE_DIR OR NOT SQUISH_LIBRARY_DIR) - # Find the libsquish include files - find_path(SQUISH_INCLUDE_DIR - NAMES "squish.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - PATH_SUFFIXES "" "cppunit" - ) - - # Find the libsquish library built for release - find_library(SQUISH_RELEASE_LIBRARY - NAMES "squish" "libsquish" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) - - # Find the libsquish library built for debug - find_library(SQUISH_DEBUG_LIBRARY - NAMES "squishd" "libsquishd" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) - - - mark_as_advanced(SQUISH_INCLUDE_DIR) - mark_as_advanced(SQUISH_RELEASE_LIBRARY) - mark_as_advanced(SQUISH_DEBUG_LIBRARY) -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) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index b965c0244c..26b2e8ac05 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -89,10 +89,11 @@ config_package(FFTW "FFTW") # ------------ libsquish ------------ # -find_package(Squish QUIET) +find_package(LibSquish QUIET) package_option(SQUISH - "Enables support for automatic compression of DXT textures.") + "Enables support for automatic compression of DXT textures." + FOUND_AS LIBSQUISH) config_package(SQUISH "libsquish") From 17d56279f5640d4c505cdd71da1da383c2be4524 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 19:28:32 -0700 Subject: [PATCH 390/744] CMake: Migrate FreeType package detection --- dtool/LocalSetup.cmake | 6 ------ dtool/Package.cmake | 14 +++++++++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index b9d331e92e..87d8739a15 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -207,12 +207,6 @@ else() message("- Did not find gtk+-2") endif() -if(HAVE_FREETYPE) - message("+ Freetype") -else() - message("- Did not find Freetype") -endif() - if(HAVE_WX) message("+ WxWidgets") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 26b2e8ac05..1684126405 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -205,10 +205,18 @@ package_option(OPENAL LICENSE "LGPL") config_package(OPENAL "OpenAL sound library") -# Find and configure Freetype + +# +# ------------ FreeType ------------ +# + find_package(Freetype QUIET) -#config_package(FREETYPE "Freetype") -package_option(FREETYPE) + +package_option(FREETYPE + "This enables support for the FreeType font-rendering library. If disabled, + Panda3D will only be able to read fonts specially made with egg-mkfont.") + +config_package(FREETYPE "FreeType") # Find and configure GTK set(Freetype_FIND_QUIETLY TRUE) # Fix for builtin FindGTK2 From 196d780820e7e3abe091ac74d45147cbc7ec1a49 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 20 Feb 2018 23:38:39 -0700 Subject: [PATCH 391/744] CMake: Remove commented-out TODOs regarding unsupported rendering backends --- dtool/Package.cmake | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 1684126405..fa768d5f22 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -274,22 +274,10 @@ mark_as_advanced(FLTK_MATH_LIBRARY) #find_package(GLES) #config_package(GLES COMMENT "OpenGL ES 2") -# Find and configure DirectX 8 -#find_package(DX8) -#config_package(DX8 COMMENT "DirectX8") - # Find and configure DirectX 9 #find_package(DX9) #config_package(DX9 COMMENT "DirectX9") -# Find and configure DirectX 11 -#find_package(DX11) -#config_package(DX11 COMMENT "DirectX11") - -# Find and configure Mesa -#find_package(Mesa) -#config_package(MESA COMMENT "Mesa") - # Find and configure OpenCV #find_package(OpenCV) #config_package(OPENCV COMMENT "OpenCV") From 9e841800ee7a1f0ad1708b80dbd020411fdbbf41 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Feb 2018 02:38:54 -0700 Subject: [PATCH 392/744] CMake: Migrate detection for the physics packages --- dtool/Config.cmake | 6 ------ dtool/LocalSetup.cmake | 18 ------------------ dtool/Package.cmake | 30 ++++++++++++++++++++++++++++++ 3 files changed, 30 insertions(+), 24 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index d1225f12b9..73a6988eb6 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -466,12 +466,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is ODE installed, and where? -find_package(ODE QUIET) - -package_option(ODE - "Enables support for ridid-body physics using the Open Dynamics Engine.") - # Is OpenGL installed, and where? find_package(OpenGL QUIET) set(GL_FOUND ${OPENGL_FOUND}) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 87d8739a15..134c47f153 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -189,12 +189,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_PHYSX) - message("+ Ageia PhysX") -else() - message("- Did not find Ageia PhysX") -endif() - if(HAVE_SPEEDTREE) message("+ SpeedTree") else() @@ -261,12 +255,6 @@ else() message("- Did not find OpenCV") endif() -if(HAVE_ODE) - message("+ ODE") -else() - message("- Did not find ODE") -endif() - if(HAVE_AWESOMIUM) message("+ AWESOMIUM") else() @@ -307,12 +295,6 @@ else() message("- Did not find libRocket") endif() -if(HAVE_BULLET) - message("+ Bullet Physics") -else() - message("- Did not find Bullet Physics") -endif() - if(HAVE_VORBIS) message("+ libvorbis (Ogg Vorbis Decoder)") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index fa768d5f22..b2935ce165 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -225,6 +225,36 @@ find_package(GTK2 QUIET COMPONENTS gtk) #config_package(GTK2 "gtk+-2") package_option(GTK2) +# +# ------------ Physics engines ------------ +# + +# Bullet +find_package(Bullet QUIET) + +package_option(Bullet + "Enable this option to support game dynamics with the Bullet physics library.") + +config_package(Bullet "Bullet physics") + +# ODE +find_package(ODE QUIET) + +package_option(ODE + "Enable this option to support game dynamics with the Open Dynamics Engine (ODE)." + LICENSE "BSD-3") + +config_package(ODE "Open Dynamics Engine") + +# PhysX +find_package(PhysX QUIET) + +package_option(PhysX + "Enable this option to support game dynamics with Nvidia PhysX." + LICENSE "Nvidia") + +config_package(PhysX "Nvidia PhysX") + # Find and configure WxWidgets find_package(wxWidgets QUIET) if(WXWIDGETS_FOUND) From 540c4fc2cd3af718bcacb8320bc317dadeaf6de9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Feb 2018 02:54:09 -0700 Subject: [PATCH 393/744] CMake: Delete excess spaces --- cmake/macros/PackageConfig.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 28ed2a516b..8fca34bf37 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -99,7 +99,7 @@ function(package_option name) endforeach() if(command STREQUAL "DEFAULT") - message(SEND_ERROR "DEFAULT in package_option takes an argument") + message(SEND_ERROR "DEFAULT in package_option takes an argument") endif() # If the default is not set, we set it. From df0c889092a479974865867ce8581bad60dfe9cb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 23 Feb 2018 19:52:37 -0700 Subject: [PATCH 394/744] distributed: Fix the import test (and syntax on Python 3) --- direct/src/distributed/DistributedObjectAI.py | 4 ++-- direct/src/distributed/DistributedObjectUD.py | 4 ++-- makepanda/test_imports.py | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/direct/src/distributed/DistributedObjectAI.py b/direct/src/distributed/DistributedObjectAI.py index 847c0d7657..32b2374fc5 100644 --- a/direct/src/distributed/DistributedObjectAI.py +++ b/direct/src/distributed/DistributedObjectAI.py @@ -340,10 +340,10 @@ class DistributedObjectAI(DistributedObjectBase): self.air.sendUpdate(self, fieldName, args) def GetPuppetConnectionChannel(self, doId): - return doId + (1001L << 32) + return doId + (1001 << 32) def GetAccountConnectionChannel(self, doId): - return doId + (1003L << 32) + return doId + (1003 << 32) def GetAccountIDFromChannelCode(self, channel): return channel >> 32 diff --git a/direct/src/distributed/DistributedObjectUD.py b/direct/src/distributed/DistributedObjectUD.py index e9e717a557..99762cc1d3 100755 --- a/direct/src/distributed/DistributedObjectUD.py +++ b/direct/src/distributed/DistributedObjectUD.py @@ -270,10 +270,10 @@ class DistributedObjectUD(DistributedObjectBase): self.air.sendUpdate(self, fieldName, args) def GetPuppetConnectionChannel(self, doId): - return doId + (1001L << 32) + return doId + (1001 << 32) def GetAccountConnectionChannel(self, doId): - return doId + (1003L << 32) + return doId + (1003 << 32) def GetAccountIDFromChannelCode(self, channel): return channel >> 32 diff --git a/makepanda/test_imports.py b/makepanda/test_imports.py index 290ec03e13..ecd87cbb66 100644 --- a/makepanda/test_imports.py +++ b/makepanda/test_imports.py @@ -98,7 +98,6 @@ import direct.distributed.InterestWatcher import direct.distributed.MsgTypes import direct.distributed.MsgTypesCMU import direct.distributed.NetMessenger -import direct.distributed.OldClientRepository import direct.distributed.ParentMgr import direct.distributed.PyDatagram import direct.distributed.PyDatagramIterator From dd423716102425f729b408aa1e7044eecdf7033d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 31 Mar 2018 03:41:04 -0600 Subject: [PATCH 395/744] CMake: Update for upstream changes --- dtool/dtool_config.h.in | 4 ---- dtool/src/dtoolutil/checkPandaVersion.cxx.in | 2 +- dtool/src/dtoolutil/checkPandaVersion.h.in | 2 +- panda/src/gobj/CMakeLists.txt | 8 ++++++++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 834d3a4467..cd87d171b5 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -233,10 +233,6 @@ to compile them out. */ #cmakedefine NOTIFY_DEBUG -/* Define if we want to export template classes from the DLL. Only - makes sense to MSVC++. */ -#cmakedefine EXPORT_TEMPLATES - /* Define if we are linking PANDAPHYSX in with PANDA. */ #cmakedefine LINK_IN_PHYSX diff --git a/dtool/src/dtoolutil/checkPandaVersion.cxx.in b/dtool/src/dtoolutil/checkPandaVersion.cxx.in index f268bfbd21..e986a719ea 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.cxx.in +++ b/dtool/src/dtoolutil/checkPandaVersion.cxx.in @@ -18,4 +18,4 @@ #include "dtoolbase.h" -EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@ = 0; +EXPCL_DTOOL_DTOOLUTIL int @PANDA_VERSION_SYMBOL@ = 0; diff --git a/dtool/src/dtoolutil/checkPandaVersion.h.in b/dtool/src/dtoolutil/checkPandaVersion.h.in index 583f3b00f6..162e16704a 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.h.in +++ b/dtool/src/dtoolutil/checkPandaVersion.h.in @@ -28,7 +28,7 @@ #include "dtoolbase.h" -extern EXPCL_DTOOL int @PANDA_VERSION_SYMBOL@; +extern EXPCL_DTOOL_DTOOLUTIL int @PANDA_VERSION_SYMBOL@; #ifndef WIN32 /* For Windows, exporting the symbol from the DLL is sufficient; the diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 7cefb48391..e308ba8c6d 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -12,10 +12,14 @@ set(P3GOBJ_HEADERS geomPrimitive.h geomPrimitive.I geomPatches.h geomTriangles.h + geomTrianglesAdjacency.h geomTristrips.h + geomTristripsAdjacency.h geomTrifans.h geomLines.h + geomLinesAdjacency.h geomLinestrips.h + geomLinestripsAdjacency.h geomPoints.h geomVertexArrayData.h geomVertexArrayData.I geomVertexArrayFormat.h geomVertexArrayFormat.I @@ -86,10 +90,14 @@ set(P3GOBJ_SOURCES geomPrimitive.cxx geomPatches.cxx geomTriangles.cxx + geomTrianglesAdjacency.cxx geomTristrips.cxx + geomTristripsAdjacency.cxx geomTrifans.cxx geomLines.cxx + geomLinesAdjacency.cxx geomLinestrips.cxx + geomLinestripsAdjacency.cxx geomPoints.cxx geomVertexArrayData.cxx geomVertexArrayFormat.cxx From 449195a33df8353e150c746a33bfcb3d8eccfb01 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 31 Mar 2018 03:55:16 -0600 Subject: [PATCH 396/744] CMake: Define appropriate BUILDING_ symbols --- direct/src/deadrec/CMakeLists.txt | 1 + direct/src/distributed/CMakeLists.txt | 1 + direct/src/interval/CMakeLists.txt | 1 + direct/src/showbase/CMakeLists.txt | 1 + dtool/src/dconfig/CMakeLists.txt | 1 + dtool/src/dtoolbase/CMakeLists.txt | 1 + dtool/src/dtoolutil/CMakeLists.txt | 1 + dtool/src/prc/CMakeLists.txt | 1 + panda/metalibs/panda/CMakeLists.txt | 2 +- panda/src/audio/CMakeLists.txt | 1 + panda/src/audiotraits/CMakeLists.txt | 3 +++ panda/src/chan/CMakeLists.txt | 1 + panda/src/char/CMakeLists.txt | 1 + panda/src/cocoadisplay/CMakeLists.txt | 1 + panda/src/collide/CMakeLists.txt | 1 + panda/src/cull/CMakeLists.txt | 1 + panda/src/device/CMakeLists.txt | 1 + panda/src/dgraph/CMakeLists.txt | 1 + panda/src/display/CMakeLists.txt | 1 + panda/src/downloader/CMakeLists.txt | 1 + panda/src/dxml/CMakeLists.txt | 1 + panda/src/egg/CMakeLists.txt | 1 + panda/src/egg2pg/CMakeLists.txt | 1 + panda/src/event/CMakeLists.txt | 1 + panda/src/express/CMakeLists.txt | 1 + panda/src/ffmpeg/CMakeLists.txt | 1 + panda/src/framework/CMakeLists.txt | 1 + panda/src/glgsg/CMakeLists.txt | 1 + panda/src/glxdisplay/CMakeLists.txt | 1 + panda/src/gobj/CMakeLists.txt | 1 + panda/src/grutil/CMakeLists.txt | 1 + panda/src/gsgbase/CMakeLists.txt | 1 + panda/src/linmath/CMakeLists.txt | 1 + panda/src/mathutil/CMakeLists.txt | 1 + panda/src/movies/CMakeLists.txt | 1 + panda/src/nativenet/CMakeLists.txt | 1 + panda/src/net/CMakeLists.txt | 1 + panda/src/ode/CMakeLists.txt | 1 + panda/src/osxdisplay/CMakeLists.txt | 1 + panda/src/parametrics/CMakeLists.txt | 1 + panda/src/particlesystem/CMakeLists.txt | 1 + panda/src/pgraph/CMakeLists.txt | 1 + panda/src/pgraphnodes/CMakeLists.txt | 1 + panda/src/pgui/CMakeLists.txt | 1 + panda/src/physics/CMakeLists.txt | 1 + panda/src/pipeline/CMakeLists.txt | 1 + panda/src/pnmimage/CMakeLists.txt | 1 + panda/src/pnmimagetypes/CMakeLists.txt | 1 + panda/src/pnmtext/CMakeLists.txt | 1 + panda/src/pstatclient/CMakeLists.txt | 1 + panda/src/putil/CMakeLists.txt | 1 + panda/src/recorder/CMakeLists.txt | 1 + panda/src/text/CMakeLists.txt | 1 + panda/src/tform/CMakeLists.txt | 1 + panda/src/wgldisplay/CMakeLists.txt | 1 + panda/src/windisplay/CMakeLists.txt | 1 + panda/src/x11display/CMakeLists.txt | 1 + 57 files changed, 59 insertions(+), 1 deletion(-) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 26e745268d..fd373bb05c 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -7,6 +7,7 @@ set(P3DEADREC_SOURCES smoothMover.cxx) add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) +set_target_properties(p3deadrec PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DEADREC) target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) target_interrogate(p3deadrec ALL) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index a04ba893a4..6b2803a7df 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -12,6 +12,7 @@ if(HAVE_PYTHON) cDistributedSmoothNodeBase.cxx) add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) + set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED) set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser p3pgraph) target_use_packages(p3distributed PYTHON) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 346222657e..3ac8beea25 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -37,6 +37,7 @@ set(P3INTERVAL_SOURCES composite_sources(p3interval P3INTERVAL_SOURCES) add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) +set_target_properties(p3interval PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_INTERVAL) target_link_libraries(p3interval p3directbase p3pstatclient p3pgraph p3chan p3dconfig p3prc) target_interrogate(p3interval ALL) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 879a23918e..3e7018fe33 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,4 +1,5 @@ add_library(p3showbase showBase.cxx showBase.h) +set_target_properties(p3showbase PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_SHOWBASE) target_link_libraries(p3showbase p3directbase p3express p3event p3chan p3display p3dconfig p3prc) target_interrogate(p3showbase ALL) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 9a4280f7a7..642619c0b9 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -7,6 +7,7 @@ set(P3DCONFIG_SOURCES composite_sources(p3dconfig P3DCONFIG_SOURCES) add_library(p3dconfig ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) +set_target_properties(p3dconfig PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_DCONFIG) target_link_libraries(p3dconfig p3prc) install(TARGETS p3dconfig DESTINATION lib) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 29605d602e..7e7f1fd3cd 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -70,6 +70,7 @@ set(P3DTOOLBASE_IGATEEXT composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) +set_target_properties(p3dtoolbase PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_DTOOLBASE) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolbase PUBLIC $) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index de5e45581d..6b0a72e248 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -72,6 +72,7 @@ set(P3DTOOLUTIL_IGATEEXT composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) +set_target_properties(p3dtoolutil PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_DTOOLUTIL) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolutil PUBLIC $) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 474680e486..e295f1fa37 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -71,6 +71,7 @@ set(P3PRC_IGATEEXT composite_sources(p3prc P3PRC_SOURCES) add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) +set_target_properties(p3prc PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_PRC) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3prc PUBLIC $) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 06ac3b525a..ad9651bca3 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,4 +1,3 @@ -add_definitions(-DBUILDING_PANDA) set(PANDA_LINK_TARGETS p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet @@ -21,6 +20,7 @@ if(LINK_IN_PHYSX) endif() add_library(panda panda.cxx) +set_target_properties(panda PROPERTIES DEFINE_SYMBOL BUILDING_LIBPANDA) target_link_libraries(panda ${PANDA_LINK_TARGETS}) install(TARGETS panda DESTINATION lib) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index b382e1ab8c..ca7f6d941b 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -19,6 +19,7 @@ if(HAVE_AUDIO) composite_sources(p3audio P3AUDIO_SOURCES) add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) + set_target_properties(p3audio PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_AUDIO) target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 52d090e794..9084f8e70d 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -18,6 +18,7 @@ if(HAVE_AUDIO) composite_sources(p3miles_audio P3MILES_SOURCES) include_directories(${MILES_INCLUDE_DIR}) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) + set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) target_link_libraries(p3miles_audio p3audio p3event p3pipeline) target_use_packages(p3miles_audio MILES) @@ -36,6 +37,7 @@ if(HAVE_AUDIO) composite_sources(p3fmod_audio P3FMOD_SOURCES) include_directories(${FMODEX_INCLUDE_DIR}) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) + set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) target_link_libraries(p3fmod_audio p3audio p3event) target_use_packages(p3fmod_audio FMODEX) @@ -55,6 +57,7 @@ if(HAVE_AUDIO) composite_sources(p3openal_audio P3OPENAL_SOURCES) include_directories(${OPENAL_INCLUDE_DIR}) add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) + set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) target_link_libraries(p3openal_audio p3audio p3event) target_use_packages(p3openal_audio OPENAL) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 2a1522b0d7..add157fd3b 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -54,6 +54,7 @@ set(P3CHAN_SOURCES composite_sources(p3chan P3CHAN_SOURCES) add_library(p3chan ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) +set_target_properties(p3chan PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CHAN) target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index fa4af297d2..752ddc2307 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -20,6 +20,7 @@ set(P3CHAR_SOURCES composite_sources(p3char P3CHAR_SOURCES) add_library(p3char ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) +set_target_properties(p3char PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CHAR) target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 90bf13cf95..7d5d5f1bd7 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -19,6 +19,7 @@ if(APPLE AND HAVE_GL AND HAVE_COCOA) #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) + set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) # Frameworks: diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index e8c511531c..7308b23a8c 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -64,6 +64,7 @@ set(P3COLLIDE_SOURCES composite_sources(p3collide P3COLLIDE_SOURCES) add_library(p3collide ${P3COLLIDE_HEADERS} ${P3COLLIDE_SOURCES}) +set_target_properties(p3collide PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_COLLIDE) target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index 22e0e6d1a9..dc01cb1768 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -22,6 +22,7 @@ set(P3CULL_SOURCES composite_sources(p3cull P3CULL_SOURCES) add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) +set_target_properties(p3cull PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CULL) target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 5e2daf8d23..73cf7a5712 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -28,6 +28,7 @@ set(P3DEVICE_SOURCES composite_sources(p3device P3DEVICE_SOURCES) add_library(p3device ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) +set_target_properties(p3device PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DEVICE) target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 2be765d73a..a1eaeb484f 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -13,6 +13,7 @@ set(P3DGRAPH_SOURCES composite_sources(p3dgraph P3DGRAPH_SOURCES) add_library(p3dgraph ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) +set_target_properties(p3dgraph PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DGRAPH) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index c4d562692c..3bb1c5d795 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -88,6 +88,7 @@ endif() composite_sources(p3display P3DISPLAY_SOURCES) add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) +set_target_properties(p3display PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DISPLAY) target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index f6a4917ba0..63ac5da787 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -69,6 +69,7 @@ set(P3DOWNLOADER_IGATEEXT composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_library(p3downloader ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) +set_target_properties(p3downloader PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEXPRESS) target_link_libraries(p3downloader p3express p3pipeline) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 1ed083a8e0..8da15454d7 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -13,6 +13,7 @@ set(P3DXML_SOURCES composite_sources(p3dxml P3DXML_SOURCES) add_definitions(-DTIXML_USE_STL) add_library(p3dxml ${P3DXML_HEADERS} ${P3DXML_SOURCES}) +set_target_properties(p3dxml PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DXML) target_link_libraries(p3dxml p3express) target_interrogate(p3dxml ALL) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 08f881044f..0da2748074 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -100,6 +100,7 @@ if(HAVE_EGG) composite_sources(p3egg P3EGG_SOURCES) add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) + set_target_properties(p3egg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index c7b23c8acf..9e0e038476 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -31,6 +31,7 @@ if(HAVE_EGG) composite_sources(p3egg2pg P3EGG2PG_SOURCES) add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) + set_target_properties(p3egg2pg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) target_link_libraries(p3egg2pg p3parametrics p3collide p3egg p3pgraph p3chan p3char) target_interrogate(p3egg2pg ALL) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index c29fa3bcd8..3857ceb704 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -46,6 +46,7 @@ set(P3EVENT_IGATEEXT composite_sources(p3event P3EVENT_SOURCES) add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) +set_target_properties(p3event PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_EVENT) target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 7fa891c805..2319c79c81 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -145,6 +145,7 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) +set_target_properties(p3express PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEXPRESS) # p3express needs to include from p3interrogatedb for py_panda.h and extension.h target_include_directories(p3express PUBLIC diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index b8a41c2b6e..5b3ae8c396 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -19,6 +19,7 @@ if(HAVE_FFMPEG) composite_sources(p3ffmpeg P3FFMPEG_SOURCES) add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) + set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) target_link_libraries(p3ffmpeg p3movies) target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index a2444365a1..3a969ca746 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -47,6 +47,7 @@ endif() composite_sources(p3framework P3FRAMEWORK_SOURCES) add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) +set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) install(TARGETS p3framework DESTINATION lib) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index d3c5567281..87192401e4 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -10,6 +10,7 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) + set_target_properties(p3glgsg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) target_link_libraries(p3glgsg p3glstuff p3display ${OPENGL_LIBRARIES}) target_use_packages(p3glgsg CG) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index b7f6019786..3525402f91 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -22,6 +22,7 @@ if(HAVE_GLX) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) + set_target_properties(p3glxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) target_link_libraries(p3glxdisplay p3glgsg p3x11display) install(TARGETS p3glxdisplay DESTINATION lib) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index e308ba8c6d..5f6a6749c5 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -169,6 +169,7 @@ set(P3GOBJ_IGATEEXT composite_sources(p3gobj P3GOBJ_SOURCES) add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) +set_target_properties(p3gobj PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GOBJ) target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_use_packages(p3gobj ZLIB SQUISH CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 38c21a3c2c..17cf54ca5c 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -39,6 +39,7 @@ set(P3GRUTIL_SOURCES composite_sources(p3grutil P3GRUTIL_SOURCES) add_library(p3grutil ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) +set_target_properties(p3grutil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GRUTIL) target_link_libraries(p3grutil p3display p3text p3movies) if(HAVE_AUDIO) target_link_libraries(p3grutil p3audio) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 37f54fe4b9..97e492c4ca 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -12,6 +12,7 @@ set(P3GSGBASE_SOURCES composite_sources(p3gsgbase P3GSGBASE_SOURCES) add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) +set_target_properties(p3gsgbase PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GSGBASE) target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index be9d1dcfa5..b2211657ca 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -45,6 +45,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) +set_target_properties(p3linmath PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_LINMATH) target_link_libraries(p3linmath p3express p3pandabase) target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index fcc9f55dea..90fcd5fccd 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -62,6 +62,7 @@ set(P3MATHUTIL_SOURCES composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) +set_target_properties(p3mathutil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_MATHUTIL) target_link_libraries(p3mathutil p3event) target_use_packages(p3mathutil FFTW) target_interrogate(p3mathutil ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 21273d25d6..e5dabb63a8 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -43,6 +43,7 @@ set(P3MOVIES_SOURCES composite_sources(p3movies P3MOVIES_SOURCES) add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) +set_target_properties(p3movies PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_MOVIES) target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) target_interrogate(p3movies ALL) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index ce3cb8191e..8c3a1b4b1f 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -26,6 +26,7 @@ if(WANT_NATIVE_NET) composite_sources(p3nativenet P3NATIVENET_SOURCES) add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) + set_target_properties(p3nativenet PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_NATIVENET) target_link_libraries(p3nativenet p3express p3pandabase p3downloader) target_interrogate(p3nativenet ALL) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index c119cea610..9a2eca80c9 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -27,6 +27,7 @@ if(HAVE_NET AND WANT_NATIVE_NET) composite_sources(p3net P3NET_SOURCES) add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) + set_target_properties(p3net PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_NET) target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) target_interrogate(p3net ALL) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index b5ed1e9840..edca403ec1 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -82,6 +82,7 @@ if(HAVE_ODE) composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) + set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index 8727804cdd..ac03c9620d 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -11,6 +11,7 @@ if(APPLE AND HAVE_GL AND HAVE_CARBON) composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) + set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) # Frameworks: diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 8e214964c5..6b5e9a0337 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -35,6 +35,7 @@ set(P3PARAMETRICS_SOURCES composite_sources(p3parametrics P3PARAMETRICS_SOURCES) add_library(p3parametrics ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) +set_target_properties(p3parametrics PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PARAMETRICS) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 75b970d4bd..bbd2818582 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -39,6 +39,7 @@ set(P3PARTICLESYSTEM_SOURCES composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) add_library(p3particlesystem ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) +set_target_properties(p3particlesystem PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) target_link_libraries(p3particlesystem p3pgraph p3physics) target_interrogate(p3particlesystem ALL) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 7d88a7adca..a6830270ea 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -218,6 +218,7 @@ set(P3PGRAPH_IGATEEXT composite_sources(p3pgraph P3PGRAPH_SOURCES) add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) +set_target_properties(p3pgraph PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGRAPH) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index b1c745838f..f33280dffe 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -46,6 +46,7 @@ set(P3PGRAPHNODES_SOURCES composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) add_library(p3pgraphnodes ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) +set_target_properties(p3pgraphnodes PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGRAPHNODES) target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index d7d425a087..129536eaa9 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -41,6 +41,7 @@ set(P3PGUI_SOURCES composite_sources(p3pgui P3PGUI_SOURCES) add_library(p3pgui ${P3PGUI_HEADERS} ${P3PGUI_SOURCES}) +set_target_properties(p3pgui PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGUI) target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index c74b40e6de..06b4f999c6 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -37,6 +37,7 @@ set(P3PHYSICS_SOURCES composite_sources(p3physics P3PHYSICS_SOURCES) add_library(p3physics ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) +set_target_properties(p3physics PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) target_link_libraries(p3physics p3pgraph p3linmath p3collide) target_interrogate(p3physics ALL) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index a2c2abb089..a36f01dc1e 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -129,6 +129,7 @@ set(P3PIPELINE_IGATEEXT composite_sources(p3pipeline P3PIPELINE_SOURCES) add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) +set_target_properties(p3pipeline PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PIPELINE) target_link_libraries(p3pipeline p3express) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 1cf9cc11b3..2865296c74 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -36,6 +36,7 @@ endif() composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) +set_target_properties(p3pnmimage PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMIMAGE) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 509d13bd11..21e4f98285 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -32,6 +32,7 @@ set(P3PNMIMAGETYPES_SOURCES composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) +set_target_properties(p3pnmimagetypes PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMIMAGETYPES) target_link_libraries(p3pnmimagetypes p3pnmimage) target_use_packages(p3pnmimagetypes JPEG TIFF PNG) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index cfd2a0f24e..3256654fd8 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -16,6 +16,7 @@ if(HAVE_FREETYPE) composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_library(p3pnmtext ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) + set_target_properties(p3pnmtext PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMTEXT) target_link_libraries(p3pnmtext p3parametrics p3pnmimage) target_use_packages(p3pnmtext FREETYPE) target_interrogate(p3pnmtext ALL) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 701913c88a..82572d3def 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -22,6 +22,7 @@ set(P3PSTATCLIENT_SOURCES composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) +set_target_properties(p3pstatclient PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PSTATCLIENT) target_link_libraries(p3pstatclient p3net p3putil p3express) target_interrogate(p3pstatclient ALL) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index e79254aa7b..f6071a41f7 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -125,6 +125,7 @@ set(P3PUTIL_IGATEEXT composite_sources(p3putil P3PUTIL_SOURCES) add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) +set_target_properties(p3putil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PUTIL) target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index e5258ba0ee..1409685ab7 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -18,6 +18,7 @@ set(P3RECORDER_SOURCES composite_sources(p3recorder P3RECORDER_SOURCES) add_library(p3recorder ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) +set_target_properties(p3recorder PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_RECORDER) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index f6a6a9c3a3..0f3ded3729 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -34,6 +34,7 @@ set(P3TEXT_SOURCES composite_sources(p3text P3TEXT_SOURCES) add_library(p3text ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) +set_target_properties(p3text PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_TEXT) target_link_libraries(p3text p3parametrics) if(HAVE_FREETYPE) target_link_libraries(p3text p3pnmtext) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index d45f162f0e..bb20b821ed 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -28,6 +28,7 @@ set(P3TFORM_SOURCES composite_sources(p3tform P3TFORM_SOURCES) add_library(p3tform ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) +set_target_properties(p3tform PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_TFORM) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index f6e83b06af..0370beadab 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -17,5 +17,6 @@ if(HAVE_WGL) composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) add_library(p3wgldisplay ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) + set_target_properties(p3wgldisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg) endif() diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index bd123d3ed7..92c5748301 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -12,6 +12,7 @@ if(WIN32) composite_sources(p3windisplay P3WINDISPLAY_SOURCES) add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) + set_target_properties(p3windisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAWIN) target_link_libraries(p3windisplay p3display p3putil Imm32.lib) endif() diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 8c66448497..3053e81677 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -10,6 +10,7 @@ if(HAVE_X11) composite_sources(p3x11display P3X11DISPLAY_SOURCES) add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) + set_target_properties(p3x11display PROPERTIES DEFINE_SYMBOL BUILDING_PANDAX11) target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) install(TARGETS p3x11display DESTINATION lib) From aed544bf5fe11690e2c7ba0144153c74d392ccbd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 1 Apr 2018 19:59:20 -0600 Subject: [PATCH 397/744] CMake: Have CMake itself track versions --- CMakeLists.txt | 12 ++---------- dtool/PandaVersion.cmake | 15 +++------------ dtool/src/dtoolutil/pandaVersion.h.in | 8 ++++---- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d8f2aa77d0..68e9ea7a68 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,15 +1,7 @@ -# We require 2.8.12+ for three reasons: -# 1) CMake 3 is so common these days that it's really not a burden on the user -# to expect them to have it. -# 2) As of this writing, this is the oldest version included in a supported -# release of Ubuntu. Older versions are actually somewhat difficult to track -# down, so we don't test against them. -# 3) CMake's INTERFACE_INCLUDE_DIRECTORIES feature, which we rely on -# extensively, finally became stable in this release. -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0.2) set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below -project(Panda3D) +project(Panda3D VERSION 1.10.0) enable_testing() # Panda3D is now a C++11 project. Newer versions of CMake support this out of diff --git a/dtool/PandaVersion.cmake b/dtool/PandaVersion.cmake index bf79443406..88a21cc286 100644 --- a/dtool/PandaVersion.cmake +++ b/dtool/PandaVersion.cmake @@ -2,9 +2,6 @@ # by the top CMakeLists.txt, which puts it in the global namespace for # all CMake scripts for Panda. -set(PANDA_VERSION "1.9.0" CACHE STRING - "Use dots to separate the major, minor, and sequence numbers.") - option(PANDA_OFFICIAL_VERSION "This variable will be defined to false in the CVS repository, but scripts that generate source tarballs and/or binary releases for @@ -59,12 +56,6 @@ mark_as_advanced(PANDA_VERSION PANDA_OFFICIAL_VERSION PANDA_PACKAGE_VERSION P3D_PLUGIN_VERSION P3D_COREAPI_VERSION PANDA_DIST_USE_LICENSES) -# Separate the Panda3D version into its three components. -string(REPLACE "." ";" PANDA_VERSION_LIST "${PANDA_VERSION}") -list(GET PANDA_VERSION_LIST 0 PANDA_MAJOR_VERSION) -list(GET PANDA_VERSION_LIST 1 PANDA_MINOR_VERSION) -list(GET PANDA_VERSION_LIST 2 PANDA_SEQUENCE_VERSION) - # The version gets a "c" at the end if it's not an official one. if(PANDA_OFFICIAL_VERSION) set(VERSION_SUFFIX "") @@ -72,15 +63,15 @@ else() set(VERSION_SUFFIX "c") endif() -set(PANDA_VERSION_STR "${PANDA_VERSION}${VERSION_SUFFIX}") +set(PANDA_VERSION_STR "${PROJECT_VERSION}${VERSION_SUFFIX}") # This symbol is used to enforce ABI incompatibility between # major versions of Panda3D. -set(PANDA_VERSION_SYMBOL panda_version_${PANDA_MAJOR_VERSION}_${PANDA_MINOR_VERSION}) +set(PANDA_VERSION_SYMBOL panda_version_${PROJECT_VERSION_MAJOR}_${PROJECT_VERSION_MINOR}) # The Panda version as a number, with three digits reserved # for each component. -math(EXPR PANDA_NUMERIC_VERSION "${PANDA_MAJOR_VERSION}*1000000 + ${PANDA_MINOR_VERSION}*1000 + ${PANDA_SEQUENCE_VERSION}") +math(EXPR PANDA_NUMERIC_VERSION "${PROJECT_VERSION_MAJOR}*1000000 + ${PROJECT_VERSION_MINOR}*1000 + ${PROJECT_VERSION_PATCH}") # Separate the plugin version into its three components. string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}") diff --git a/dtool/src/dtoolutil/pandaVersion.h.in b/dtool/src/dtoolutil/pandaVersion.h.in index 350a229e4e..c544ae7fdf 100644 --- a/dtool/src/dtoolutil/pandaVersion.h.in +++ b/dtool/src/dtoolutil/pandaVersion.h.in @@ -33,9 +33,9 @@ included in a .h file, then any other files which also include that .h file will need to be rebuilt when the version number changes. */ -#define PANDA_MAJOR_VERSION @PANDA_MAJOR_VERSION@ -#define PANDA_MINOR_VERSION @PANDA_MINOR_VERSION@ -#define PANDA_SEQUENCE_VERSION @PANDA_SEQUENCE_VERSION@ +#define PANDA_MAJOR_VERSION @PROJECT_VERSION_MAJOR@ +#define PANDA_MINOR_VERSION @PROJECT_VERSION_MINOR@ +#define PANDA_SEQUENCE_VERSION @PROJECT_VERSION_PATCH@ /* Define if this is an "official" version, undefine otherwise. */ #cmakedefine PANDA_OFFICIAL_VERSION @@ -53,7 +53,7 @@ This usually means the major and minor version. It should be the same for Panda3D versions that are supposed to be backward ABI compatible with each other. */ -#define PANDA_ABI_VERSION_STR "@PANDA_MAJOR_VERSION@.@PANDA_MINOR_VERSION@" +#define PANDA_ABI_VERSION_STR "@PROJECT_VERSION_MAJOR@.@PROJECT_VERSION_MINOR@" /* This is a string indicating who has provided this distribution. */ #define PANDA_DISTRIBUTOR "@PANDA_DISTRIBUTOR@" From 2f6c79b9e6681c3abe530e9874b2628150c28df3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 2 Apr 2018 15:49:05 -0600 Subject: [PATCH 398/744] CMake: Build libraries with VERSION/SOVERSION This takes advantage of SONAME and versioning on platforms that support it. --- CMakeLists.txt | 1 + cmake/macros/Versioning.cmake | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 cmake/macros/Versioning.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 68e9ea7a68..28a970ec64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,6 +47,7 @@ include(AddFlexTarget) # Defines add_flex_target function include(CompositeSources) # Defines composite_sources function include(Interrogate) # Defines target_interrogate AND add_python_module include(RunPzip) # Defines run_pzip function +include(Versioning) # Hooks 'add_library' to apply VERSION/SOVERSION # Add the include path for source and header files generated by CMake include_directories("${PROJECT_BINARY_DIR}/include") diff --git a/cmake/macros/Versioning.cmake b/cmake/macros/Versioning.cmake new file mode 100644 index 0000000000..b32e5a3201 --- /dev/null +++ b/cmake/macros/Versioning.cmake @@ -0,0 +1,6 @@ +function(add_library target_name) + _add_library("${target_name}" ${ARGN}) + set_target_properties("${target_name}" PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +endfunction(add_library) From 411e0ee93f3864e6430f7f7c85da4c7f9250a852 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 5 Apr 2018 16:02:19 -0600 Subject: [PATCH 399/744] CMake: Use interrogate's -import instead of linking directly --- cmake/macros/Interrogate.cmake | 15 +++++++++++++-- direct/CMakeLists.txt | 3 +-- panda/CMakeLists.txt | 9 +++------ 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 817a2b6cda..0eaf61f2aa 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -229,24 +229,34 @@ function(interrogate_sources target output database language_flags) endfunction(interrogate_sources) # -# Function: add_python_module(module [lib1 [lib2 ...]] [LINK lib1 ...]) +# Function: add_python_module(module [lib1 [lib2 ...]] [LINK lib1 ...] +# [IMPORT mod1 ...]) # Uses interrogate to create a Python module. If the LINK keyword is specified, # the Python module is linked against the specified libraries instead of those -# listed before. +# listed before. The IMPORT keyword makes the output module import another +# Python module when it's initialized. # function(add_python_module module) if(INTERROGATE_PYTHON_INTERFACE) set(targets) set(link_targets) + set(import_flags) set(infiles) set(sources) set(link_keyword OFF) + set(import_keyword OFF) foreach(arg ${ARGN}) if(arg STREQUAL "LINK") set(link_keyword ON) + set(import_keyword OFF) + elseif(arg STREQUAL "IMPORT") + set(link_keyword OFF) + set(import_keyword ON) elseif(link_keyword) list(APPEND link_targets "${arg}") + elseif(import_keyword) + list(APPEND import_flags "-import" "${arg}") else() list(APPEND targets "${arg}") endif() @@ -269,6 +279,7 @@ function(add_python_module module) COMMAND interrogate_module -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" -module ${module} -library ${module} + ${import_flags} ${INTERROGATE_MODULE_OPTIONS} ${IMOD_FLAGS} ${infiles} DEPENDS interrogate_module ${infiles} diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index fc9f74f019..9fe7a24c65 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -17,8 +17,7 @@ add_subdirectory(src/interval) add_subdirectory(src/showbase) if(HAVE_PYTHON) - add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase) - target_link_libraries(direct core) + add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase IMPORT panda3d.core) # Make an __init__.py pointing at the source directory so users can run # Panda3D code straight from their build path: diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index ab8ff038a6..31d219f22b 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -96,15 +96,12 @@ if(HAVE_PYTHON) add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) if(HAVE_EGG) - add_python_module(egg p3egg p3egg2pg) - target_link_libraries(egg core) + add_python_module(egg p3egg p3egg2pg IMPORT panda3d.core) endif() - add_python_module(physics p3physics p3particlesystem) - target_link_libraries(physics core) + add_python_module(physics p3physics p3particlesystem IMPORT panda3d.core) if(HAVE_ODE) - add_python_module(ode p3ode) - target_link_libraries(ode core) + add_python_module(ode p3ode IMPORT panda3d.core) endif() endif() From cfd603bb8db9822c9882ff7f706d36550ad05278 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 5 Apr 2018 16:06:16 -0600 Subject: [PATCH 400/744] CMake: Build Python binary modules as MODULE, never SHARED --- cmake/macros/Interrogate.cmake | 6 +++++- dtool/metalibs/dtoolconfig/CMakeLists.txt | 12 +++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 0eaf61f2aa..5e29837756 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -286,7 +286,11 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - add_library(${module} "${module}_module.cxx" ${sources}) + if(BUILD_SHARED_LIBS) + add_library(${module} MODULE "${module}_module.cxx" ${sources}) + else() + add_library(${module} STATIC "${module}_module.cxx" ${sources}) + endif() target_link_libraries(${module} ${link_targets} ${PYTHON_LIBRARIES} p3interrogatedb) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 568c451f47..658cb91cc7 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,9 +1,15 @@ add_definitions(-DBUILDING_DTOOLCONFIG) -if(HAVE_PYTHON) - add_library(p3dtoolconfig dtoolconfig.cxx pydtool.cxx) +if(BUILD_SHARED_LIBS) + set(libtype MODULE) else() - add_library(p3dtoolconfig dtoolconfig.cxx) + set(libtype STATIC) +endif() + +if(HAVE_PYTHON) + add_library(p3dtoolconfig ${libtype} dtoolconfig.cxx pydtool.cxx) +else() + add_library(p3dtoolconfig ${libtype} dtoolconfig.cxx) endif() target_use_packages(p3dtoolconfig PYTHON) From 1401a1cc480cffbee204f9f10a1bb74dd329426f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 5 Apr 2018 16:10:19 -0600 Subject: [PATCH 401/744] CMake: Don't use (SO)VERSION for modules --- cmake/macros/Versioning.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/cmake/macros/Versioning.cmake b/cmake/macros/Versioning.cmake index b32e5a3201..056667c958 100644 --- a/cmake/macros/Versioning.cmake +++ b/cmake/macros/Versioning.cmake @@ -1,6 +1,9 @@ function(add_library target_name) _add_library("${target_name}" ${ARGN}) - set_target_properties("${target_name}" PROPERTIES - VERSION "${PROJECT_VERSION}" - SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") + get_target_property(type "${target_name}" TYPE) + if(type STREQUAL "SHARED_LIBRARY") + set_target_properties("${target_name}" PROPERTIES + VERSION "${PROJECT_VERSION}" + SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") + endif() endfunction(add_library) From c0b8b3c54205d15cda38a32d3b51c2638d94c215 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 15 Apr 2018 00:35:49 -0600 Subject: [PATCH 402/744] CMake: Interrogate bugfix for LINK and IMPORT keywords together --- cmake/macros/Interrogate.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 5e29837756..39b5cbe3dc 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -262,7 +262,7 @@ function(add_python_module module) endif() endforeach(arg) - if(NOT link_keyword) + if(NOT link_targets) set(link_targets ${targets}) endif() From d642ca4fa09781beae7aa935c3c9140d893ed69c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 15 Apr 2018 00:49:40 -0600 Subject: [PATCH 403/744] CMake: Change linkages to go through metalibs This changes the target_link_libraries() declarations so they only go directly to a component library if it's in the same metalib. If it's outside of the metalib, the correct thing to do is link against the metalib. CMake takes care of the transitive linking for us, so there isn't actually any big change here. --- direct/src/dcparser/CMakeLists.txt | 2 +- direct/src/deadrec/CMakeLists.txt | 2 +- direct/src/distributed/CMakeLists.txt | 8 +------- direct/src/interval/CMakeLists.txt | 2 +- direct/src/showbase/CMakeLists.txt | 2 +- panda/CMakeLists.txt | 4 ++-- panda/metalibs/pandaegg/CMakeLists.txt | 3 ++- panda/metalibs/pandagl/CMakeLists.txt | 2 +- panda/src/audiotraits/CMakeLists.txt | 6 +++--- panda/src/downloadertools/CMakeLists.txt | 22 +++++++++++----------- panda/src/egg/CMakeLists.txt | 2 +- panda/src/egg2pg/CMakeLists.txt | 2 +- panda/src/ffmpeg/CMakeLists.txt | 2 +- panda/src/framework/CMakeLists.txt | 2 +- panda/src/glgsg/CMakeLists.txt | 2 +- panda/src/ode/CMakeLists.txt | 3 ++- panda/src/particlesystem/CMakeLists.txt | 2 +- panda/src/physics/CMakeLists.txt | 2 +- panda/src/x11display/CMakeLists.txt | 2 +- pandatool/src/bam/CMakeLists.txt | 8 ++++---- pandatool/src/converter/CMakeLists.txt | 2 +- pandatool/src/flt/CMakeLists.txt | 2 +- pandatool/src/pandatoolbase/CMakeLists.txt | 2 +- pandatool/src/progbase/CMakeLists.txt | 2 +- pandatool/src/pstatserver/CMakeLists.txt | 2 +- 25 files changed, 43 insertions(+), 47 deletions(-) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index a959ba7695..d36fd7fd9f 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -49,7 +49,7 @@ composite_sources(p3dcparser P3DCPARSER_SOURCES) add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) -target_link_libraries(p3dcparser p3directbase p3express p3pstatclient p3prc) +target_link_libraries(p3dcparser p3directbase panda) target_use_packages(p3dcparser PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index fd373bb05c..277f515e53 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -8,7 +8,7 @@ set(P3DEADREC_SOURCES add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) set_target_properties(p3deadrec PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DEADREC) -target_link_libraries(p3deadrec p3directbase p3linmath p3pgraph p3prc) +target_link_libraries(p3deadrec p3directbase panda) target_interrogate(p3deadrec ALL) install(TARGETS p3deadrec DESTINATION lib) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 6b2803a7df..0216e766ce 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -14,14 +14,8 @@ if(HAVE_PYTHON) add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED) set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) - target_link_libraries(p3distributed p3directbase p3dcparser p3pgraph) + target_link_libraries(p3distributed p3directbase p3dcparser panda) target_use_packages(p3distributed PYTHON) - if(WANT_NATIVE_NET) - target_link_libraries(p3distributed p3nativenet) - endif() - if(HAVE_NET) - target_link_libraries(p3distributed p3net) - endif() target_interrogate(p3distributed ALL) install(TARGETS p3distributed DESTINATION lib) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 3ac8beea25..5755508fe8 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -38,7 +38,7 @@ set(P3INTERVAL_SOURCES composite_sources(p3interval P3INTERVAL_SOURCES) add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) set_target_properties(p3interval PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_INTERVAL) -target_link_libraries(p3interval p3directbase p3pstatclient p3pgraph p3chan p3dconfig p3prc) +target_link_libraries(p3interval p3directbase panda) target_interrogate(p3interval ALL) install(TARGETS p3interval DESTINATION lib) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 3e7018fe33..c8ae524b96 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,6 +1,6 @@ add_library(p3showbase showBase.cxx showBase.h) set_target_properties(p3showbase PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_SHOWBASE) -target_link_libraries(p3showbase p3directbase p3express p3event p3chan p3display p3dconfig p3prc) +target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) install(TARGETS p3showbase DESTINATION lib) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 31d219f22b..6dca5eb2bf 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -96,10 +96,10 @@ if(HAVE_PYTHON) add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) if(HAVE_EGG) - add_python_module(egg p3egg p3egg2pg IMPORT panda3d.core) + add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core) endif() - add_python_module(physics p3physics p3particlesystem IMPORT panda3d.core) + add_python_module(physics p3physics p3particlesystem LINK pandaphysics IMPORT panda3d.core) if(HAVE_ODE) add_python_module(ode p3ode IMPORT panda3d.core) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 946229d919..2aba69eb51 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -1,8 +1,9 @@ if(HAVE_EGG) - set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg panda) + set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) add_library(pandaegg pandaegg.cxx) target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) + target_link_libraries(pandaegg panda) install(TARGETS pandaegg DESTINATION lib) endif() diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 6af135a09b..3091551fc8 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -7,7 +7,6 @@ if(HAVE_GL) HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") endif() - add_definitions(-DBUILDING_PANDAGL) set(PANDAGL_LINK_TARGETS p3glgsg) if(HAVE_GLX) @@ -27,6 +26,7 @@ if(HAVE_GL) add_library(pandagl pandagl.cxx) target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) + set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) install(TARGETS pandagl DESTINATION lib) endif() diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 9084f8e70d..8cf68126d6 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -19,7 +19,7 @@ if(HAVE_AUDIO) include_directories(${MILES_INCLUDE_DIR}) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) - target_link_libraries(p3miles_audio p3audio p3event p3pipeline) + target_link_libraries(p3miles_audio panda) target_use_packages(p3miles_audio MILES) install(TARGETS p3miles_audio DESTINATION lib) @@ -38,7 +38,7 @@ if(HAVE_AUDIO) include_directories(${FMODEX_INCLUDE_DIR}) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) - target_link_libraries(p3fmod_audio p3audio p3event) + target_link_libraries(p3fmod_audio panda) target_use_packages(p3fmod_audio FMODEX) install(TARGETS p3fmod_audio DESTINATION lib) @@ -58,7 +58,7 @@ if(HAVE_AUDIO) include_directories(${OPENAL_INCLUDE_DIR}) add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) - target_link_libraries(p3openal_audio p3audio p3event) + target_link_libraries(p3openal_audio panda) target_use_packages(p3openal_audio OPENAL) install(TARGETS p3openal_audio DESTINATION lib) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index 3df202569e..adc70f3f41 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -1,16 +1,16 @@ if(HAVE_OPENSSL) add_executable(apply_patch apply_patch.cxx) - target_link_libraries(apply_patch p3downloader p3express p3pystub) + target_link_libraries(apply_patch panda) add_executable(build_patch build_patch.cxx) - target_link_libraries(build_patch p3downloader p3express p3pystub) + target_link_libraries(build_patch panda) add_executable(show_ddb show_ddb.cxx) - target_link_libraries(show_ddb p3downloader p3express p3pystub) + target_link_libraries(show_ddb panda) add_executable(check_md5 check_md5.cxx) - target_link_libraries(check_md5 p3downloader p3express p3pystub) + target_link_libraries(check_md5 panda) add_executable(pencrypt pencrypt.cxx) - target_link_libraries(pencrypt p3downloader p3express p3pystub) + target_link_libraries(pencrypt panda) add_executable(pdecrypt pdecrypt.cxx) - target_link_libraries(pdecrypt p3downloader p3express p3pystub) + target_link_libraries(pdecrypt panda) install(TARGETS apply_patch build_patch show_ddb check_md5 pencrypt pdecrypt DESTINATION bin) @@ -18,18 +18,18 @@ endif() if(HAVE_ZLIB) add_executable(check_adler check_adler.cxx) - target_link_libraries(check_adler p3downloader p3express p3pystub) + target_link_libraries(check_adler panda) add_executable(check_crc check_crc.cxx) - target_link_libraries(check_crc p3downloader p3express p3pystub) + target_link_libraries(check_crc panda) add_executable(pzip pzip.cxx) - target_link_libraries(pzip p3downloader p3express p3pystub) + target_link_libraries(pzip panda) add_executable(punzip punzip.cxx) - target_link_libraries(punzip p3downloader p3express p3pystub) + target_link_libraries(punzip panda) install(TARGETS check_adler check_crc pzip punzip DESTINATION bin) endif() add_executable(multify multify.cxx) -target_link_libraries(multify p3downloader p3express p3pystub) +target_link_libraries(multify panda) install(TARGETS multify DESTINATION bin) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 0da2748074..15783ed7f0 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -101,7 +101,7 @@ if(HAVE_EGG) composite_sources(p3egg P3EGG_SOURCES) add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) set_target_properties(p3egg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) - target_link_libraries(p3egg p3prc p3pandabase p3express p3linmath p3mathutil) + target_link_libraries(p3egg panda) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) install(TARGETS p3egg DESTINATION lib) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 9e0e038476..1bed8e5a3d 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -32,7 +32,7 @@ if(HAVE_EGG) composite_sources(p3egg2pg P3EGG2PG_SOURCES) add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) set_target_properties(p3egg2pg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) - target_link_libraries(p3egg2pg p3parametrics p3collide p3egg p3pgraph p3chan p3char) + target_link_libraries(p3egg2pg panda p3egg) target_interrogate(p3egg2pg ALL) install(TARGETS p3egg2pg DESTINATION lib) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 5b3ae8c396..a0c9102d47 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -20,7 +20,7 @@ if(HAVE_FFMPEG) composite_sources(p3ffmpeg P3FFMPEG_SOURCES) add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) - target_link_libraries(p3ffmpeg p3movies) + target_link_libraries(p3ffmpeg panda) target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) install(TARGETS p3ffmpeg DESTINATION lib) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 3a969ca746..5f6d48f1da 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -11,7 +11,7 @@ set(P3FRAMEWORK_SOURCES ) -set(P3FRAMEWORK_LINK_TARGETS p3char p3pgui p3recorder p3collide p3pnmimagetypes) +set(P3FRAMEWORK_LINK_TARGETS panda) if(NOT BUILD_SHARED_LIBS) # If we're statically linking, we need to explicitly link with # at least one of the available renderers. diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 87192401e4..f05d8d4de7 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -11,7 +11,7 @@ if(HAVE_GL) composite_sources(p3glgsg P3GLGSG_SOURCES) add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) set_target_properties(p3glgsg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) - target_link_libraries(p3glgsg p3glstuff p3display + target_link_libraries(p3glgsg p3glstuff panda ${OPENGL_LIBRARIES}) target_use_packages(p3glgsg CG) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index edca403ec1..a018d8305b 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -84,7 +84,8 @@ if(HAVE_ODE) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) - target_link_libraries(p3ode p3pgraph p3physics ${ODE_LIBRARY}) + target_link_libraries(p3ode panda) + target_use_packages(p3ode ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) install(TARGETS p3ode DESTINATION lib) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index bbd2818582..0ff8e31a72 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -40,7 +40,7 @@ set(P3PARTICLESYSTEM_SOURCES composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) add_library(p3particlesystem ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) set_target_properties(p3particlesystem PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) -target_link_libraries(p3particlesystem p3pgraph p3physics) +target_link_libraries(p3particlesystem p3physics panda) target_interrogate(p3particlesystem ALL) install(TARGETS p3particlesystem DESTINATION lib) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 06b4f999c6..9a9e3b5e66 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -38,7 +38,7 @@ set(P3PHYSICS_SOURCES composite_sources(p3physics P3PHYSICS_SOURCES) add_library(p3physics ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) set_target_properties(p3physics PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) -target_link_libraries(p3physics p3pgraph p3linmath p3collide) +target_link_libraries(p3physics panda) target_interrogate(p3physics ALL) install(TARGETS p3physics DESTINATION lib) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 3053e81677..2351bbedf4 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -11,7 +11,7 @@ if(HAVE_X11) composite_sources(p3x11display P3X11DISPLAY_SOURCES) add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) set_target_properties(p3x11display PROPERTIES DEFINE_SYMBOL BUILDING_PANDAX11) - target_link_libraries(p3x11display p3display ${X11_LIBRARIES}) + target_link_libraries(p3x11display panda ${X11_LIBRARIES}) install(TARGETS p3x11display DESTINATION lib) endif() diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index 56d0e49261..9bd837c9e3 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -1,15 +1,15 @@ add_executable(bam-info bamInfo.cxx bamInfo.h) -target_link_libraries(bam-info p3progbase p3pgraphnodes p3recorder) +target_link_libraries(bam-info p3progbase panda) install(TARGETS bam-info DESTINATION bin) add_executable(egg2bam eggToBam.cxx eggToBam.h) -target_link_libraries(egg2bam p3eggbase p3progbase) +target_link_libraries(egg2bam p3eggbase p3progbase panda) install(TARGETS egg2bam DESTINATION bin) add_executable(bam2egg bamToEgg.cxx bamToEgg.h) -target_link_libraries(bam2egg p3converter p3eggbase p3progbase) +target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda) install(TARGETS bam2egg DESTINATION bin) add_executable(pts2bam ptsToBam.cxx ptsToBam.h) -target_link_libraries(pts2bam p3progbase p3pgraph p3pgraphnodes p3egg2pg) +target_link_libraries(pts2bam p3progbase pandaegg panda) install(TARGETS pts2bam DESTINATION bin) diff --git a/pandatool/src/converter/CMakeLists.txt b/pandatool/src/converter/CMakeLists.txt index 4dd62fb15c..b91752f849 100644 --- a/pandatool/src/converter/CMakeLists.txt +++ b/pandatool/src/converter/CMakeLists.txt @@ -6,4 +6,4 @@ set(P3CONVERTER_SOURCES somethingToEggConverter.cxx eggToSomethingConverter.cxx) add_library(p3converter STATIC ${P3CONVERTER_HEADERS} ${P3CONVERTER_SOURCES}) -target_link_libraries(p3converter p3pandatoolbase p3egg2pg p3pystub) +target_link_libraries(p3converter p3pandatoolbase pandaegg) diff --git a/pandatool/src/flt/CMakeLists.txt b/pandatool/src/flt/CMakeLists.txt index be35f038f3..9b7b045c4d 100644 --- a/pandatool/src/flt/CMakeLists.txt +++ b/pandatool/src/flt/CMakeLists.txt @@ -82,4 +82,4 @@ set(P3FLT_SOURCES composite_sources(p3flt P3FLT_SOURCES) add_library(p3flt STATIC ${P3FLT_HEADERS} ${P3FLT_SOURCES}) -target_link_libraries(p3flt p3pandatoolbase p3mathutil) +target_link_libraries(p3flt p3pandatoolbase panda) diff --git a/pandatool/src/pandatoolbase/CMakeLists.txt b/pandatool/src/pandatoolbase/CMakeLists.txt index d4a7aff55a..b1c921f3ea 100644 --- a/pandatool/src/pandatoolbase/CMakeLists.txt +++ b/pandatool/src/pandatoolbase/CMakeLists.txt @@ -16,7 +16,7 @@ set(P3PANDATOOLBASE_SOURCES composite_sources(p3pandatoolbase P3PANDATOOLBASE_SOURCES) add_library(p3pandatoolbase STATIC ${P3PANDATOOLBASE_HEADERS} ${P3PANDATOOLBASE_SOURCES}) -target_link_libraries(p3pandatoolbase p3pandabase p3putil) +target_link_libraries(p3pandatoolbase panda) # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. diff --git a/pandatool/src/progbase/CMakeLists.txt b/pandatool/src/progbase/CMakeLists.txt index 8b245f2b2d..831a9bd936 100644 --- a/pandatool/src/progbase/CMakeLists.txt +++ b/pandatool/src/progbase/CMakeLists.txt @@ -10,7 +10,7 @@ set(P3PROGBASE_SOURCES composite_sources(p3progbase P3PROGBASE_SOURCES) add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) -target_link_libraries(p3progbase p3pandatoolbase p3pnmimage) +target_link_libraries(p3progbase p3pandatoolbase panda) target_use_packages(p3progbase ZLIB) # This is only needed for binaries in the pandatool package. It is not useful diff --git a/pandatool/src/pstatserver/CMakeLists.txt b/pandatool/src/pstatserver/CMakeLists.txt index 560cddece9..a907785f91 100644 --- a/pandatool/src/pstatserver/CMakeLists.txt +++ b/pandatool/src/pstatserver/CMakeLists.txt @@ -19,7 +19,7 @@ if(HAVE_NET) composite_sources(p3pstatserver P3PSTATSERVER_SOURCES) add_library(p3pstatserver STATIC ${P3PSTATSERVER_HEADERS} ${P3PSTATSERVER_SOURCES}) - target_link_libraries(p3pstatserver p3pandatoolbase p3pstatclient p3linmath) + target_link_libraries(p3pstatserver p3pandatoolbase panda) # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. From 7590c37f0c23c05737e5a7da18567c3f29c5969b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 18 Apr 2018 12:23:18 -0600 Subject: [PATCH 404/744] CMake: Have Interrogate respect INTERFACE_COMPILE_DEFINITIONS This commit isn't technically quite right, since Interrogate should use the definitions from COMPILE_DEFINITIONS but the module should be built with INTERFACE_COMPILE_DEFINITIONS, but whatever. That can be changed if it becomes a nuisance later on. The rationale here is it's consistent with how CMake treats these two properties. --- cmake/macros/Interrogate.cmake | 2 +- direct/src/dcparse/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 2 +- direct/src/distributed/CMakeLists.txt | 2 +- panda/src/ode/CMakeLists.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 39b5cbe3dc..2b69aa3ce4 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -192,7 +192,7 @@ function(interrogate_sources target output database language_flags) # in the same way that they are passed to the compiler so that Interrogate # will preprocess each file in the same way. set(define_flags) - get_target_property(target_defines "${target}" COMPILE_DEFINITIONS) + get_target_property(target_defines "${target}" INTERFACE_COMPILE_DEFINITIONS) if(target_defines) foreach(target_define ${target_defines}) list(APPEND define_flags "-D${target_define}") diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index 947c67dfec..ded4815f8f 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(dcparse dcparse.cxx) -set_target_properties(dcparse PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_compile_definitions(dcparse PUBLIC WITHIN_PANDA) target_link_libraries(dcparse p3dcparser) install(TARGETS dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index d36fd7fd9f..318be281d4 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -48,7 +48,7 @@ set(P3DCPARSER_PARSER_SOURCES composite_sources(p3dcparser P3DCPARSER_SOURCES) add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) -set_target_properties(p3dcparser PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) +target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase panda) target_use_packages(p3dcparser PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 0216e766ce..9e4168eb53 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -13,7 +13,7 @@ if(HAVE_PYTHON) add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED) - set_target_properties(p3distributed PROPERTIES COMPILE_DEFINITIONS WITHIN_PANDA) + target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser panda) target_use_packages(p3distributed PYTHON) target_interrogate(p3distributed ALL) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index a018d8305b..7ac467ef7b 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -83,7 +83,7 @@ if(HAVE_ODE) composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) - set_target_properties(p3ode PROPERTIES COMPILE_DEFINITIONS dSINGLE) + target_compile_definitions(p3ode PUBLIC dSINGLE) target_link_libraries(p3ode panda) target_use_packages(p3ode ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) From 655e661035207f07985b9cc80f9234ee5978eaf4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 18 Apr 2018 14:38:59 -0600 Subject: [PATCH 405/744] CMake: Minor typo fix --- dtool/Config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 73a6988eb6..3ce8d4347e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -56,7 +56,7 @@ endif() # Are we building with static or dynamic linking? option(BUILD_SHARED_LIBS - "Causes subpackes to be built separately -- setup for dynamic linking. + "Causes subpackages to be built separately -- setup for dynamic linking. Utilities/tools/binaries/etc are then dynamically linked to the libraries instead of being statically linked." ON) From 4cec3317229c91f2d5eb0952b207c1ef8808b92d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 18 Apr 2018 14:42:56 -0600 Subject: [PATCH 406/744] CMake: Add support for building metalibs as metalibs --- CMakeLists.txt | 1 + cmake/macros/BuildMetalib.cmake | 155 +++++++++++++++++++++ direct/CMakeLists.txt | 6 +- direct/src/dcparse/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 2 +- direct/src/deadrec/CMakeLists.txt | 4 +- direct/src/directbase/CMakeLists.txt | 2 +- direct/src/distributed/CMakeLists.txt | 4 +- direct/src/interval/CMakeLists.txt | 4 +- direct/src/showbase/CMakeLists.txt | 4 +- dtool/Config.cmake | 5 + panda/metalibs/panda/CMakeLists.txt | 3 +- panda/metalibs/pandaegg/CMakeLists.txt | 3 +- panda/metalibs/pandagl/CMakeLists.txt | 3 +- panda/metalibs/pandaphysics/CMakeLists.txt | 3 +- panda/src/audio/CMakeLists.txt | 4 +- panda/src/chan/CMakeLists.txt | 4 +- panda/src/char/CMakeLists.txt | 4 +- panda/src/collide/CMakeLists.txt | 4 +- panda/src/cull/CMakeLists.txt | 4 +- panda/src/device/CMakeLists.txt | 4 +- panda/src/dgraph/CMakeLists.txt | 4 +- panda/src/display/CMakeLists.txt | 4 +- panda/src/downloader/CMakeLists.txt | 4 +- panda/src/dxml/CMakeLists.txt | 4 +- panda/src/egg/CMakeLists.txt | 4 +- panda/src/egg2pg/CMakeLists.txt | 4 +- panda/src/event/CMakeLists.txt | 4 +- panda/src/express/CMakeLists.txt | 4 +- panda/src/framework/CMakeLists.txt | 1 + panda/src/glgsg/CMakeLists.txt | 4 +- panda/src/glstuff/CMakeLists.txt | 4 +- panda/src/glxdisplay/CMakeLists.txt | 4 +- panda/src/gobj/CMakeLists.txt | 4 +- panda/src/grutil/CMakeLists.txt | 4 +- panda/src/gsgbase/CMakeLists.txt | 4 +- panda/src/linmath/CMakeLists.txt | 4 +- panda/src/mathutil/CMakeLists.txt | 4 +- panda/src/movies/CMakeLists.txt | 4 +- panda/src/nativenet/CMakeLists.txt | 4 +- panda/src/net/CMakeLists.txt | 4 +- panda/src/pandabase/CMakeLists.txt | 2 +- panda/src/parametrics/CMakeLists.txt | 4 +- panda/src/particlesystem/CMakeLists.txt | 4 +- panda/src/pgraph/CMakeLists.txt | 4 +- panda/src/pgraphnodes/CMakeLists.txt | 4 +- panda/src/pgui/CMakeLists.txt | 4 +- panda/src/physics/CMakeLists.txt | 4 +- panda/src/pipeline/CMakeLists.txt | 4 +- panda/src/pnmimage/CMakeLists.txt | 4 +- panda/src/pnmimagetypes/CMakeLists.txt | 4 +- panda/src/pnmtext/CMakeLists.txt | 4 +- panda/src/pstatclient/CMakeLists.txt | 4 +- panda/src/putil/CMakeLists.txt | 4 +- panda/src/recorder/CMakeLists.txt | 4 +- panda/src/text/CMakeLists.txt | 4 +- panda/src/tform/CMakeLists.txt | 4 +- 57 files changed, 263 insertions(+), 101 deletions(-) create mode 100644 cmake/macros/BuildMetalib.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 28a970ec64..6bcb35b6fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,7 @@ include(dtool/Config.cmake) # Include global modules include(AddBisonTarget) # Defines add_bison_target function include(AddFlexTarget) # Defines add_flex_target function +include(BuildMetalib) # Defines add_component_library AND add_metalib include(CompositeSources) # Defines composite_sources function include(Interrogate) # Defines target_interrogate AND add_python_module include(RunPzip) # Defines run_pzip function diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake new file mode 100644 index 0000000000..b42c35b7f2 --- /dev/null +++ b/cmake/macros/BuildMetalib.cmake @@ -0,0 +1,155 @@ +# Filename: BuildMetalib.cmake +# +# Description: This file contains macros to build Panda3D's "metalibs" - these +# are special libraries that contain no unique code themselves and are +# instead just an agglomeration of the various component libraries that get +# linked into them. A library of libraries - a "metalibrary." + +# +# Function: target_link_libraries(...) +# +# Overrides CMake's target_link_libraries() to support "linking" object +# libraries. This is a partial reimplementation of CMake commit dc38970f83, +# which as of this writing has not yet landed in any release. +# +function(target_link_libraries target) + get_target_property(target_type "${target}" TYPE) + if(NOT target_type STREQUAL "OBJECT_LIBRARY") + _target_link_libraries("${target}" ${ARGN}) + return() + endif() + + foreach(library ${ARGN}) + if(library MATCHES "^[A-Za-z0-9]+$") + # We need to add "library"'s include directories to "target" + # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further + # dependencies will work) + set(include_directories "$") + set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") + + # Also build with the same BUILDING_ macros, because these will all end + # up in the same library. + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") + + # Libraries are only linked transitively if they aren't components. + # Unfortunately, it seems like INTERFACE_LINK_LIBRARIES can't have + # generator expressions on an object library(?) so we resort to taking + # care of this at configuration time. + if(TARGET "${library}") + get_target_property(is_component "${library}" IS_COMPONENT) + if(NOT is_component) + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") + endif() + endif() + else() + # This is a file path to an out-of-tree library - this needs to be + # recorded so that the metalib can link them. (They aren't needed at + # all for the object libraries themselves, so they don't have to work + # transitively.) + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") + endif() + endforeach() + +endfunction(target_link_libraries) + +# +# Function: add_component_library(target [SYMBOL building_symbol] [SOURCES]) +# +# Used very similarly to add_library. You can specify a symbol with SYMBOL, +# which works like CMake's own DEFINE_SYMBOL property: it's defined when +# building the library, but not when building something that links against the +# library. +# +# Note that this function gets to decide whether the component library is +# OBJECT or SHARED, and whether the library is installed or not. Also, as +# a rule, component libraries may only be linked by other component libraries +# in the same metalib - outside of the metalib, you must link the metalib +# itself. +# +function(add_component_library target_name) + set(sources) + unset(symbol) + + set(symbol_keyword OFF) + foreach(source ${ARGN}) + if(source STREQUAL "SYMBOL") + set(symbol_keyword ON) + elseif(symbol_keyword) + set(symbol_keyword OFF) + set(symbol "${source}") + else() + list(APPEND sources "${source}") + endif() + endforeach() + + + if(BUILD_METALIBS) + add_library("${target_name}" OBJECT ${sources}) + else() + add_library("${target_name}" ${sources}) + endif() + + set_target_properties("${target_name}" PROPERTIES IS_COMPONENT ON) + if(symbol) + # ... DEFINE_SYMBOL is apparently not respected for object libraries? + set_property(TARGET "${target_name}" APPEND PROPERTY COMPILE_DEFINITIONS "${symbol}") + endif() + if(BUILD_METALIBS) + # Apparently neither is CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE? + set_property(TARGET "${target_name}" PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}") + + # If we're building dynamic libraries, the object library needs to be -fPIC + if(BUILD_SHARED_LIBS) + set_property(TARGET "${target_name}" PROPERTY POSITION_INDEPENDENT_CODE ON) + endif() + endif() + +endfunction(add_component_library) + +# +# Function: add_metalib(target [source1 source2] [COMPONENTS component1 ...]) +# +# This is add_library, but for metalibs. +# +function(add_metalib target_name) + set(components_keyword OFF) + set(components) + set(sources) + foreach(arg ${ARGN}) + if(arg STREQUAL "COMPONENTS") + set(components_keyword ON) + elseif(components_keyword) + list(APPEND components "${arg}") + else() + list(APPEND sources "${arg}") + endif() + endforeach() + + set(defines) + set(includes) + set(libs) + foreach(component ${components}) + get_target_property(is_component "${component}" IS_COMPONENT) + if(NOT is_component) + message(FATAL_ERROR + "Attempted to metalink non-component ${component} into ${target_name}!") + endif() + + if(BUILD_METALIBS) + list(APPEND defines "$") + list(APPEND includes "$") + list(APPEND libs "$") + list(APPEND sources "$") + else() + list(APPEND libs "${component}") + endif() + endforeach() + + add_library("${target_name}" ${sources}) + target_compile_definitions("${target_name}" PRIVATE ${defines}) + target_link_libraries("${target_name}" ${libs}) + target_include_directories("${target_name}" PUBLIC ${includes}) + +endfunction(add_metalib) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 9fe7a24c65..5d4f4ed088 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -16,8 +16,12 @@ add_subdirectory(src/interval) #add_subdirectory(src/motiontrail) add_subdirectory(src/showbase) +# TODO: p3direct needs a source file! +add_metalib(p3direct COMPONENTS p3dcparser p3deadrec p3distributed p3interval p3showbase) +set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") + if(HAVE_PYTHON) - add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase IMPORT panda3d.core) + add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase LINK p3direct IMPORT panda3d.core) # Make an __init__.py pointing at the source directory so users can run # Panda3D code straight from their build path: diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index ded4815f8f..f6182aeca1 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,4 +1,4 @@ add_executable(dcparse dcparse.cxx) target_compile_definitions(dcparse PUBLIC WITHIN_PANDA) -target_link_libraries(dcparse p3dcparser) +target_link_libraries(dcparse p3direct) install(TARGETS dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 318be281d4..a79992bdd5 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -46,7 +46,7 @@ set(P3DCPARSER_PARSER_SOURCES dcLexer.cxx) composite_sources(p3dcparser P3DCPARSER_SOURCES) -add_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} +add_component_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase panda) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 277f515e53..50813ca96e 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -6,8 +6,8 @@ set(P3DEADREC_SOURCES config_deadrec.cxx smoothMover.cxx) -add_library(p3deadrec ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) -set_target_properties(p3deadrec PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DEADREC) +add_component_library(p3deadrec SYMBOL BUILDING_DIRECT_DEADREC + ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) target_link_libraries(p3deadrec p3directbase panda) target_interrogate(p3deadrec ALL) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 7db522fc65..4abea24c3e 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -8,7 +8,7 @@ set(P3DIRECTBASE_HEADERS # Not worth compositing sources, there's really only one. add_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) -target_link_libraries(p3directbase p3pandabase) +target_link_libraries(p3directbase panda) install(TARGETS p3directbase DESTINATION lib) install(FILES ${P3DIRECTBASE_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 9e4168eb53..355548041a 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -11,8 +11,8 @@ if(HAVE_PYTHON) cConnectionRepository.cxx cDistributedSmoothNodeBase.cxx) - add_library(p3distributed ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) - set_target_properties(p3distributed PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_DISTRIBUTED) + add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED + ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser panda) target_use_packages(p3distributed PYTHON) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 5755508fe8..397617c1e8 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -36,8 +36,8 @@ set(P3INTERVAL_SOURCES waitInterval.cxx) composite_sources(p3interval P3INTERVAL_SOURCES) -add_library(p3interval ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) -set_target_properties(p3interval PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_INTERVAL) +add_component_library(p3interval SYMBOL BUILDING_DIRECT_INTERVAL + ${P3INTERVAL_HEADERS} ${P3INTERVAL_SOURCES}) target_link_libraries(p3interval p3directbase panda) target_interrogate(p3interval ALL) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index c8ae524b96..9ca60be4ed 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(p3showbase showBase.cxx showBase.h) -set_target_properties(p3showbase PROPERTIES DEFINE_SYMBOL BUILDING_DIRECT_SHOWBASE) +add_component_library(p3showbase SYMBOL BUILDING_DIRECT_SHOWBASE + showBase.cxx showBase.h) target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3ce8d4347e..2551c0a55e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -60,6 +60,11 @@ option(BUILD_SHARED_LIBS Utilities/tools/binaries/etc are then dynamically linked to the libraries instead of being statically linked." ON) +option(BUILD_METALIBS + "Should we build 'metalibs' -- fewer, larger libraries that contain the bulk +of the code instead of many smaller components. Note that turning this off +will still result in the 'metalibs' being built, but they will instead be many +smaller stub libraries and not 'meta' libraries." ON) # The character used to separate components of an OS-specific # directory name depends on the platform (it is '/' on Unix, '\' on diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index ad9651bca3..55383b0c24 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -19,8 +19,7 @@ if(LINK_IN_PHYSX) ) endif() -add_library(panda panda.cxx) +add_metalib(panda panda.cxx COMPONENTS ${PANDA_LINK_TARGETS}) set_target_properties(panda PROPERTIES DEFINE_SYMBOL BUILDING_LIBPANDA) -target_link_libraries(panda ${PANDA_LINK_TARGETS}) install(TARGETS panda DESTINATION lib) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 2aba69eb51..af185e5627 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -1,8 +1,7 @@ if(HAVE_EGG) set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) - add_library(pandaegg pandaegg.cxx) - target_link_libraries(pandaegg ${PANDAEGG_LINK_TARGETS}) + add_metalib(pandaegg pandaegg.cxx COMPONENTS ${PANDAEGG_LINK_TARGETS}) target_link_libraries(pandaegg panda) install(TARGETS pandaegg DESTINATION lib) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 3091551fc8..150b969856 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -24,8 +24,7 @@ if(HAVE_GL) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3osxdisplay) endif() - add_library(pandagl pandagl.cxx) - target_link_libraries(pandagl ${PANDAGL_LINK_TARGETS}) + add_metalib(pandagl pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS}) set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) install(TARGETS pandagl DESTINATION lib) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index f48411820c..908b8ff48b 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -1,4 +1,3 @@ -add_library(pandaphysics pandaphysics.cxx) -target_link_libraries(pandaphysics p3physics p3particlesystem) +add_metalib(pandaphysics pandaphysics.cxx COMPONENTS p3physics p3particlesystem) install(TARGETS pandaphysics DESTINATION lib) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index ca7f6d941b..c87dff6c76 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -18,8 +18,8 @@ if(HAVE_AUDIO) nullAudioSound.cxx) composite_sources(p3audio P3AUDIO_SOURCES) - add_library(p3audio ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) - set_target_properties(p3audio PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_AUDIO) + add_component_library(p3audio SYMBOL BUILDING_PANDA_AUDIO + ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index add157fd3b..7d631a2f97 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -53,8 +53,8 @@ set(P3CHAN_SOURCES ) composite_sources(p3chan P3CHAN_SOURCES) -add_library(p3chan ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) -set_target_properties(p3chan PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CHAN) +add_component_library(p3chan SYMBOL BUILDING_PANDA_CHAN + ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 752ddc2307..f6ca731bc2 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -19,8 +19,8 @@ set(P3CHAR_SOURCES ) composite_sources(p3char P3CHAR_SOURCES) -add_library(p3char ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) -set_target_properties(p3char PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CHAR) +add_component_library(p3char SYMBOL BUILDING_PANDA_CHAR + ${P3CHAR_HEADERS} ${P3CHAR_SOURCES}) target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 7308b23a8c..bd6f39c377 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -63,8 +63,8 @@ set(P3COLLIDE_SOURCES ) composite_sources(p3collide P3COLLIDE_SOURCES) -add_library(p3collide ${P3COLLIDE_HEADERS} ${P3COLLIDE_SOURCES}) -set_target_properties(p3collide PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_COLLIDE) +add_component_library(p3collide SYMBOL BUILDING_PANDA_COLLIDE + ${P3COLLIDE_HEADERS} ${P3COLLIDE_SOURCES}) target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index dc01cb1768..47b7a7ee47 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -21,8 +21,8 @@ set(P3CULL_SOURCES ) composite_sources(p3cull P3CULL_SOURCES) -add_library(p3cull ${P3CULL_HEADERS} ${P3CULL_SOURCES}) -set_target_properties(p3cull PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_CULL) +add_component_library(p3cull SYMBOL BUILDING_PANDA_CULL + ${P3CULL_HEADERS} ${P3CULL_SOURCES}) target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 73cf7a5712..6de38bcc43 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -27,8 +27,8 @@ set(P3DEVICE_SOURCES ) composite_sources(p3device P3DEVICE_SOURCES) -add_library(p3device ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) -set_target_properties(p3device PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DEVICE) +add_component_library(p3device SYMBOL BUILDING_PANDA_DEVICE + ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index a1eaeb484f..53ff1cf381 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -12,8 +12,8 @@ set(P3DGRAPH_SOURCES ) composite_sources(p3dgraph P3DGRAPH_SOURCES) -add_library(p3dgraph ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) -set_target_properties(p3dgraph PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DGRAPH) +add_component_library(p3dgraph SYMBOL BUILDING_PANDA_DGRAPH + ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 3bb1c5d795..38e764b3d1 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -87,8 +87,8 @@ if(APPLE) endif() composite_sources(p3display P3DISPLAY_SOURCES) -add_library(p3display ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) -set_target_properties(p3display PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DISPLAY) +add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY + ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 63ac5da787..1460eec6fd 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -68,8 +68,8 @@ set(P3DOWNLOADER_IGATEEXT ) composite_sources(p3downloader P3DOWNLOADER_SOURCES) -add_library(p3downloader ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) -set_target_properties(p3downloader PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEXPRESS) +add_component_library(p3downloader SYMBOL BUILDING_PANDAEXPRESS + ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) target_link_libraries(p3downloader p3express p3pipeline) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 8da15454d7..9268eb0051 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -12,8 +12,8 @@ set(P3DXML_SOURCES composite_sources(p3dxml P3DXML_SOURCES) add_definitions(-DTIXML_USE_STL) -add_library(p3dxml ${P3DXML_HEADERS} ${P3DXML_SOURCES}) -set_target_properties(p3dxml PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_DXML) +add_component_library(p3dxml SYMBOL BUILDING_PANDA_DXML + ${P3DXML_HEADERS} ${P3DXML_SOURCES}) target_link_libraries(p3dxml p3express) target_interrogate(p3dxml ALL) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 15783ed7f0..829b5804b2 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -99,8 +99,8 @@ if(HAVE_EGG) lexer.cxx) composite_sources(p3egg P3EGG_SOURCES) - add_library(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) - set_target_properties(p3egg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) + add_component_library(p3egg SYMBOL BUILDING_PANDAEGG + ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg panda) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 1bed8e5a3d..5eb9e1dbaa 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -30,8 +30,8 @@ if(HAVE_EGG) ) composite_sources(p3egg2pg P3EGG2PG_SOURCES) - add_library(p3egg2pg ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) - set_target_properties(p3egg2pg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEGG) + add_component_library(p3egg2pg SYMBOL BUILDING_PANDAEGG + ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) target_link_libraries(p3egg2pg panda p3egg) target_interrogate(p3egg2pg ALL) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 3857ceb704..2aee7f4251 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -45,8 +45,8 @@ set(P3EVENT_IGATEEXT ) composite_sources(p3event P3EVENT_SOURCES) -add_library(p3event ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) -set_target_properties(p3event PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_EVENT) +add_component_library(p3event SYMBOL BUILDING_PANDA_EVENT + ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 2319c79c81..bd009eb923 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -144,8 +144,8 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) -add_library(p3express ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -set_target_properties(p3express PROPERTIES DEFINE_SYMBOL BUILDING_PANDAEXPRESS) +add_component_library(p3express SYMBOL BUILDING_PANDAEXPRESS + ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) # p3express needs to include from p3interrogatedb for py_panda.h and extension.h target_include_directories(p3express PUBLIC diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 5f6d48f1da..ecf24a531c 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -46,6 +46,7 @@ if(NOT BUILD_SHARED_LIBS) endif() composite_sources(p3framework P3FRAMEWORK_SOURCES) +# This one isn't a component library add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index f05d8d4de7..d7a9763b9c 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -9,8 +9,8 @@ if(HAVE_GL) ) composite_sources(p3glgsg P3GLGSG_SOURCES) - add_library(p3glgsg ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) - set_target_properties(p3glgsg PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) + add_component_library(p3glgsg SYMBOL BUILDING_PANDAGL + ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff panda ${OPENGL_LIBRARIES}) target_use_packages(p3glgsg CG) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 6326195a0e..3919f79fd3 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -31,8 +31,8 @@ if(HAVE_GL) ) composite_sources(p3glstuff P3GLSTUFF_SOURCES) - add_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) - target_link_libraries(p3glstuff p3pandabase p3gobj) + add_component_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) + target_link_libraries(p3glstuff panda) install(TARGETS p3glstuff DESTINATION lib) install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 3525402f91..473d20b2e8 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -21,8 +21,8 @@ if(HAVE_GLX) ) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) - add_library(p3glxdisplay ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) - set_target_properties(p3glxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) + add_component_library(p3glxdisplay SYMBOL BUILDING_PANDAGL + ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) install(TARGETS p3glxdisplay DESTINATION lib) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 5f6a6749c5..c53aa602c4 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -168,8 +168,8 @@ set(P3GOBJ_IGATEEXT ) composite_sources(p3gobj P3GOBJ_SOURCES) -add_library(p3gobj ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -set_target_properties(p3gobj PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GOBJ) +add_component_library(p3gobj SYMBOL BUILDING_PANDA_GOBJ + ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_use_packages(p3gobj ZLIB SQUISH CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 17cf54ca5c..7dc1c7fb00 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -38,8 +38,8 @@ set(P3GRUTIL_SOURCES ) composite_sources(p3grutil P3GRUTIL_SOURCES) -add_library(p3grutil ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) -set_target_properties(p3grutil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GRUTIL) +add_component_library(p3grutil SYMBOL BUILDING_PANDA_GRUTIL + ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) target_link_libraries(p3grutil p3display p3text p3movies) if(HAVE_AUDIO) target_link_libraries(p3grutil p3audio) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 97e492c4ca..cb891fef98 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -11,8 +11,8 @@ set(P3GSGBASE_SOURCES ) composite_sources(p3gsgbase P3GSGBASE_SOURCES) -add_library(p3gsgbase ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) -set_target_properties(p3gsgbase PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_GSGBASE) +add_component_library(p3gsgbase SYMBOL BUILDING_PANDA_GSGBASE + ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index b2211657ca..922c94537b 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -44,8 +44,8 @@ set(P3LINMATH_SOURCES ) composite_sources(p3linmath P3LINMATH_SOURCES) -add_library(p3linmath ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) -set_target_properties(p3linmath PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_LINMATH) +add_component_library(p3linmath SYMBOL BUILDING_PANDA_LINMATH + ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) target_link_libraries(p3linmath p3express p3pandabase) target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 90fcd5fccd..2cf5568af3 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -61,8 +61,8 @@ set(P3MATHUTIL_SOURCES ) composite_sources(p3mathutil P3MATHUTIL_SOURCES) -add_library(p3mathutil ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -set_target_properties(p3mathutil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_MATHUTIL) +add_component_library(p3mathutil SYMBOL BUILDING_PANDA_MATHUTIL + ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) target_link_libraries(p3mathutil p3event) target_use_packages(p3mathutil FFTW) target_interrogate(p3mathutil ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index e5dabb63a8..d1030f40f5 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -42,8 +42,8 @@ set(P3MOVIES_SOURCES wavAudioCursor.cxx) composite_sources(p3movies P3MOVIES_SOURCES) -add_library(p3movies ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) -set_target_properties(p3movies PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_MOVIES) +add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES + ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) target_interrogate(p3movies ALL) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 8c3a1b4b1f..4323082e87 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -25,8 +25,8 @@ if(WANT_NATIVE_NET) socket_udp_outgoing.cxx) composite_sources(p3nativenet P3NATIVENET_SOURCES) - add_library(p3nativenet ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) - set_target_properties(p3nativenet PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_NATIVENET) + add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET + ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) target_link_libraries(p3nativenet p3express p3pandabase p3downloader) target_interrogate(p3nativenet ALL) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 9a2eca80c9..3f4dba403c 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -26,8 +26,8 @@ if(HAVE_NET AND WANT_NATIVE_NET) recentConnectionReader.cxx) composite_sources(p3net P3NET_SOURCES) - add_library(p3net ${P3NET_HEADERS} ${P3NET_SOURCES}) - set_target_properties(p3net PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_NET) + add_component_library(p3net SYMBOL BUILDING_PANDA_NET + ${P3NET_HEADERS} ${P3NET_SOURCES}) target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) target_interrogate(p3net ALL) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index 89eb1483ec..97261c5f4f 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -6,7 +6,7 @@ set(P3PANDABASE_SOURCES pandabase.cxx ) -add_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) +add_component_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) target_link_libraries(p3pandabase p3dtoolbase) install(TARGETS p3pandabase DESTINATION lib) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 6b5e9a0337..b75334e34e 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -34,8 +34,8 @@ set(P3PARAMETRICS_SOURCES ) composite_sources(p3parametrics P3PARAMETRICS_SOURCES) -add_library(p3parametrics ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) -set_target_properties(p3parametrics PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PARAMETRICS) +add_component_library(p3parametrics SYMBOL BUILDING_PANDA_PARAMETRICS + ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 0ff8e31a72..21334a8606 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -38,8 +38,8 @@ set(P3PARTICLESYSTEM_SOURCES composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) -add_library(p3particlesystem ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) -set_target_properties(p3particlesystem PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) +add_component_library(p3particlesystem SYMBOL BUILDING_PANDAPHYSICS + ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) target_link_libraries(p3particlesystem p3physics panda) target_interrogate(p3particlesystem ALL) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index a6830270ea..9052f6e299 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -217,8 +217,8 @@ set(P3PGRAPH_IGATEEXT ) composite_sources(p3pgraph P3PGRAPH_SOURCES) -add_library(p3pgraph ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) -set_target_properties(p3pgraph PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGRAPH) +add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH + ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index f33280dffe..749a835051 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -45,8 +45,8 @@ set(P3PGRAPHNODES_SOURCES ) composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) -add_library(p3pgraphnodes ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) -set_target_properties(p3pgraphnodes PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGRAPHNODES) +add_component_library(p3pgraphnodes SYMBOL BUILDING_PANDA_PGRAPHNODES + ${P3PGRAPHNODES_HEADERS} ${P3PGRAPHNODES_SOURCES}) target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 129536eaa9..16ced60a74 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -40,8 +40,8 @@ set(P3PGUI_SOURCES ) composite_sources(p3pgui P3PGUI_SOURCES) -add_library(p3pgui ${P3PGUI_HEADERS} ${P3PGUI_SOURCES}) -set_target_properties(p3pgui PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PGUI) +add_component_library(p3pgui SYMBOL BUILDING_PANDA_PGUI + ${P3PGUI_HEADERS} ${P3PGUI_SOURCES}) target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 9a9e3b5e66..cd9ced9c74 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -36,8 +36,8 @@ set(P3PHYSICS_SOURCES physicsObjectCollection.cxx) composite_sources(p3physics P3PHYSICS_SOURCES) -add_library(p3physics ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) -set_target_properties(p3physics PROPERTIES DEFINE_SYMBOL BUILDING_PANDAPHYSICS) +add_component_library(p3physics SYMBOL BUILDING_PANDAPHYSICS + ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) target_link_libraries(p3physics panda) target_interrogate(p3physics ALL) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index a36f01dc1e..4040c58a19 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -128,8 +128,8 @@ set(P3PIPELINE_IGATEEXT ) composite_sources(p3pipeline P3PIPELINE_SOURCES) -add_library(p3pipeline ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) -set_target_properties(p3pipeline PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PIPELINE) +add_component_library(p3pipeline SYMBOL BUILDING_PANDA_PIPELINE + ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) target_link_libraries(p3pipeline p3express) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 2865296c74..857ad79050 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -35,8 +35,8 @@ if(HAVE_SSE2) endif() composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) -add_library(p3pnmimage ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) -set_target_properties(p3pnmimage PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMIMAGE) +add_component_library(p3pnmimage SYMBOL BUILDING_PANDA_PNMIMAGE + ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 21e4f98285..c9236befaa 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -31,8 +31,8 @@ set(P3PNMIMAGETYPES_SOURCES ) composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) -add_library(p3pnmimagetypes ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -set_target_properties(p3pnmimagetypes PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMIMAGETYPES) +add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES + ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) target_link_libraries(p3pnmimagetypes p3pnmimage) target_use_packages(p3pnmimagetypes JPEG TIFF PNG) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 3256654fd8..67713ae318 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -15,8 +15,8 @@ if(HAVE_FREETYPE) ) composite_sources(p3pnmtext P3PNMTEXT_SOURCES) - add_library(p3pnmtext ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) - set_target_properties(p3pnmtext PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PNMTEXT) + add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT + ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) target_link_libraries(p3pnmtext p3parametrics p3pnmimage) target_use_packages(p3pnmtext FREETYPE) target_interrogate(p3pnmtext ALL) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 82572d3def..c14ad4e21d 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -21,8 +21,8 @@ set(P3PSTATCLIENT_SOURCES pStatThread.cxx) composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) -add_library(p3pstatclient ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) -set_target_properties(p3pstatclient PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PSTATCLIENT) +add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT + ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) target_link_libraries(p3pstatclient p3net p3putil p3express) target_interrogate(p3pstatclient ALL) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index f6071a41f7..38cf0b8530 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -124,8 +124,8 @@ set(P3PUTIL_IGATEEXT ) composite_sources(p3putil P3PUTIL_SOURCES) -add_library(p3putil ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) -set_target_properties(p3putil PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_PUTIL) +add_component_library(p3putil SYMBOL BUILDING_PANDA_PUTIL + ${P3PUTIL_HEADERS} ${P3PUTIL_SOURCES}) target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 1409685ab7..f7ef34ac70 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -17,8 +17,8 @@ set(P3RECORDER_SOURCES ) composite_sources(p3recorder P3RECORDER_SOURCES) -add_library(p3recorder ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) -set_target_properties(p3recorder PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_RECORDER) +add_component_library(p3recorder SYMBOL BUILDING_PANDA_RECORDER + ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 0f3ded3729..37bceb02a4 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -33,8 +33,8 @@ set(P3TEXT_SOURCES ) composite_sources(p3text P3TEXT_SOURCES) -add_library(p3text ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) -set_target_properties(p3text PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_TEXT) +add_component_library(p3text SYMBOL BUILDING_PANDA_TEXT + ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) target_link_libraries(p3text p3parametrics) if(HAVE_FREETYPE) target_link_libraries(p3text p3pnmtext) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index bb20b821ed..971848d0d2 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -27,8 +27,8 @@ set(P3TFORM_SOURCES ) composite_sources(p3tform P3TFORM_SOURCES) -add_library(p3tform ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) -set_target_properties(p3tform PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_TFORM) +add_component_library(p3tform SYMBOL BUILDING_PANDA_TFORM + ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) From 29799643e00ccca16cfdb32da7ad1efbc4db7267 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 18 Apr 2018 16:58:20 -0600 Subject: [PATCH 407/744] CMake: Move source file accidentally counted as a header --- panda/src/pgraph/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 9052f6e299..35420548fc 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -57,7 +57,7 @@ set(P3PGRAPH_HEADERS modelNode.I modelNode.h modelPool.I modelPool.h modelRoot.I modelRoot.h - nodePath.I nodePath.h nodePath.cxx + nodePath.I nodePath.h nodePathCollection.I nodePathCollection.h nodePathComponent.I nodePathComponent.h occluderEffect.I occluderEffect.h @@ -157,6 +157,7 @@ set(P3PGRAPH_SOURCES modelNode.cxx modelPool.cxx modelRoot.cxx + nodePath.cxx nodePathCollection.cxx nodePathComponent.cxx occluderEffect.cxx From 5a31844e11f23d3e549c86f0b20a87f1f976f642 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 19 Apr 2018 00:05:21 -0600 Subject: [PATCH 408/744] CMake: Slightly tweak component-library -D inheritance rules This only inherits -D flags from another component library. The private -D flags should not be inherited from regular libraries. --- cmake/macros/BuildMetalib.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index b42c35b7f2..e744834374 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -30,7 +30,7 @@ function(target_link_libraries target) # Also build with the same BUILDING_ macros, because these will all end # up in the same library. - set(compile_definitions "$") + set(compile_definitions "$<$>:$>") set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") # Libraries are only linked transitively if they aren't components. From 218d0e8adebcab01b2b728a7b1a45878b7f01f7b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 19 Apr 2018 00:04:21 -0600 Subject: [PATCH 409/744] CMake: Build dtool metalibs as metalibs --- cmake/macros/BuildMetalib.cmake | 4 ++- cmake/macros/Interrogate.cmake | 2 +- dtool/metalibs/dtool/CMakeLists.txt | 3 +-- dtool/metalibs/dtoolconfig/CMakeLists.txt | 32 +++++++++++------------ dtool/src/cppparser/CMakeLists.txt | 2 +- dtool/src/dconfig/CMakeLists.txt | 4 +-- dtool/src/dtoolbase/CMakeLists.txt | 4 +-- dtool/src/dtoolutil/CMakeLists.txt | 5 ++-- dtool/src/interrogate/CMakeLists.txt | 6 ++--- dtool/src/interrogatedb/CMakeLists.txt | 3 ++- dtool/src/prc/CMakeLists.txt | 6 ++--- dtool/src/pystub/CMakeLists.txt | 2 +- panda/src/express/CMakeLists.txt | 2 +- panda/src/movies/CMakeLists.txt | 2 +- panda/src/pandabase/CMakeLists.txt | 2 +- 15 files changed, 40 insertions(+), 39 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index e744834374..c63f6e2e52 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -20,7 +20,9 @@ function(target_link_libraries target) endif() foreach(library ${ARGN}) - if(library MATCHES "^[A-Za-z0-9]+$") + # 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. + if(library MATCHES "^(p3|panda)[A-Za-z0-9]*$") # We need to add "library"'s include directories to "target" # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further # dependencies will work) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 2b69aa3ce4..1082865f61 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -292,7 +292,7 @@ function(add_python_module module) add_library(${module} STATIC "${module}_module.cxx" ${sources}) endif() target_link_libraries(${module} - ${link_targets} ${PYTHON_LIBRARIES} p3interrogatedb) + ${link_targets} ${PYTHON_LIBRARIES} p3dtool) set_target_properties(${module} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 1ace855669..16cd56f1c3 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,4 +1,3 @@ -add_library(p3dtool dtool.cxx) -target_link_libraries(p3dtool p3dtoolutil p3dtoolbase) +add_metalib(p3dtool dtool.cxx COMPONENTS p3dtoolutil p3dtoolbase) install(TARGETS p3dtool DESTINATION lib) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 658cb91cc7..7a22c6fbf4 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,4 +1,10 @@ -add_definitions(-DBUILDING_DTOOLCONFIG) +# First, dtoolconfig: + +set(DTOOLCONFIG_LINK_TARGETS p3prc p3dconfig p3interrogatedb) +add_metalib(p3dtoolconfig dtoolconfig.cxx COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) +install(TARGETS p3dtoolconfig DESTINATION lib) + +# Next, panda3d.interrogatedb: if(BUILD_SHARED_LIBS) set(libtype MODULE) @@ -7,21 +13,15 @@ else() endif() if(HAVE_PYTHON) - add_library(p3dtoolconfig ${libtype} dtoolconfig.cxx pydtool.cxx) -else() - add_library(p3dtoolconfig ${libtype} dtoolconfig.cxx) -endif() + add_library(interrogatedb ${libtype} pydtool.cxx) + target_use_packages(interrogatedb PYTHON) + target_link_libraries(interrogatedb p3dtoolconfig) -target_use_packages(p3dtoolconfig PYTHON) -target_link_libraries(p3dtoolconfig p3prc p3dconfig p3interrogatedb) -set_target_properties(p3dtoolconfig PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - PREFIX "" - OUTPUT_NAME "interrogatedb" -) + set_target_properties(interrogatedb PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + PREFIX "" + OUTPUT_NAME "interrogatedb" + ) -if(HAVE_PYTHON) - install(TARGETS p3dtoolconfig DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") -else() - install(TARGETS p3dtoolconfig DESTINATION lib) + install(TARGETS interrogatedb DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") endif() diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 4384f756e9..da649eaed5 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -40,6 +40,6 @@ set(P3CPPPARSER_SOURCES composite_sources(p3cppParser P3CPPPARSER_SOURCES) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) -target_link_libraries(p3cppParser p3dtoolutil) +target_link_libraries(p3cppParser p3dtool) install(TARGETS p3cppParser DESTINATION lib) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 642619c0b9..445692204f 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -6,8 +6,8 @@ set(P3DCONFIG_SOURCES composite_sources(p3dconfig P3DCONFIG_SOURCES) -add_library(p3dconfig ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) -set_target_properties(p3dconfig PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_DCONFIG) +add_component_library(p3dconfig SYMBOL BUILDING_DTOOL_DCONFIG + ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) target_link_libraries(p3dconfig p3prc) install(TARGETS p3dconfig DESTINATION lib) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 7e7f1fd3cd..3de0b9cae4 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -69,8 +69,8 @@ set(P3DTOOLBASE_IGATEEXT composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) -add_library(p3dtoolbase ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -set_target_properties(p3dtoolbase PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_DTOOLBASE) +add_component_library(p3dtoolbase SYMBOL BUILDING_DTOOL_DTOOLBASE + ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolbase PUBLIC $) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 6b0a72e248..e2e8cd5cd6 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -71,8 +71,9 @@ set(P3DTOOLUTIL_IGATEEXT composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) -add_library(p3dtoolutil ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) -set_target_properties(p3dtoolutil PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_DTOOLUTIL) +add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL + ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) +target_include_directories(p3dtoolutil PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolutil PUBLIC $) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 272b81e869..81c213dbdb 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -53,12 +53,10 @@ composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate - p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${_OPENSSL_LIBRARIES}) + p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module - p3cppParser p3interrogatedb p3dconfig p3prc p3dtoolutil p3dtoolbase - p3pystub ${_OPENSSL_LIBRARIES}) + p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) install(TARGETS interrogate_module DESTINATION bin) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 2e15dce1ea..ebad56ecab 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -40,7 +40,8 @@ set(P3INTERROGATEDB_IGATE_SOURCES interrogateType.cxx interrogate_datafile.cxx interrogate_interface.cxx interrogate_request.cxx) -add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) +add_component_library(p3interrogatedb SYMBOL SYMBOL BUILDING_INTERROGATEDB + ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) target_use_packages(p3interrogatedb PYTHON) target_interrogate(p3interrogatedb ${P3INTERROGATEDB_IGATE_SOURCES}) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index e295f1fa37..3d478ede3a 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -70,12 +70,12 @@ set(P3PRC_IGATEEXT composite_sources(p3prc P3PRC_SOURCES) -add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) -set_target_properties(p3prc PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_PRC) +add_component_library(p3prc SYMBOL BUILDING_DTOOL_PRC + ${P3PRC_HEADERS} ${P3PRC_SOURCES}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3prc PUBLIC $) -target_link_libraries(p3prc p3dtoolutil p3dtoolbase ${_OPENSSL_LIBRARIES}) +target_link_libraries(p3prc p3dtool ${_OPENSSL_LIBRARIES}) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) install(TARGETS p3prc DESTINATION lib) diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index 09cc066b09..70d8a24a4a 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -2,5 +2,5 @@ set(P3PYSTUB_HEADERS pystub.h) set(P3PYSTUB_SOURCES pystub.cxx) add_library(p3pystub STATIC ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) -target_link_libraries(p3pystub p3dtoolbase) +target_link_libraries(p3pystub p3dtool) install(FILES ${P3PYSTUB_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index bd009eb923..0543f743c8 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -150,7 +150,7 @@ add_component_library(p3express SYMBOL BUILDING_PANDAEXPRESS # p3express needs to include from p3interrogatedb for py_panda.h and extension.h target_include_directories(p3express PUBLIC $) -target_link_libraries(p3express p3pandabase p3dtool p3prc p3dconfig) +target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool) target_use_packages(p3express TAR ZLIB) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index d1030f40f5..9369d9beaf 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -44,7 +44,7 @@ set(P3MOVIES_SOURCES composite_sources(p3movies P3MOVIES_SOURCES) add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) -target_link_libraries(p3movies p3pandabase p3express p3pstatclient p3gobj p3dconfig p3prc) +target_link_libraries(p3movies p3pstatclient p3gobj p3express p3pandabase) target_interrogate(p3movies ALL) install(TARGETS p3movies DESTINATION lib) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index 97261c5f4f..4e9b89735c 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3PANDABASE_SOURCES ) add_component_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) -target_link_libraries(p3pandabase p3dtoolbase) +target_link_libraries(p3pandabase p3dtool) install(TARGETS p3pandabase DESTINATION lib) install(FILES ${P3PANDABASE_HEADERS} DESTINATION include/panda3d) From 570afa6973864f6e53c8376447efcdcdc5e5e8ac Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 19 Apr 2018 20:06:09 -0600 Subject: [PATCH 410/744] CMake: Fix include path when building prc into metalib --- dtool/src/prc/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 3d478ede3a..0c6641ecee 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -72,6 +72,7 @@ composite_sources(p3prc P3PRC_SOURCES) add_component_library(p3prc SYMBOL BUILDING_DTOOL_PRC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) +target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3prc PUBLIC $) From 5b3ca1bb0544048d5c05a9306720887552894f90 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 00:20:14 -0600 Subject: [PATCH 411/744] CMake: Fix up the "transitive library" metalib logic This fixes some cases where transitive libraries, as nominated by a component library, were not being absorbed into a metalib, due to the library actually not being defined yet. This makes the logic a little more robust, first by explicitly requiring a metalib definition to come after all component library definitions, and second to assume a library "linked" to a component library is a non-component if it isn't defined (yet). --- cmake/macros/BuildMetalib.cmake | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index c63f6e2e52..3326b50d77 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -41,9 +41,14 @@ function(target_link_libraries target) # care of this at configuration time. if(TARGET "${library}") get_target_property(is_component "${library}" IS_COMPONENT) - if(NOT is_component) - set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") - endif() + else() + # This is a safe assumption, since we define all component libraries + # before the metalib they appear in: + set(is_component OFF) + endif() + + if(NOT is_component) + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") endif() else() # This is a file path to an out-of-tree library - this needs to be @@ -133,6 +138,11 @@ function(add_metalib target_name) set(includes) set(libs) foreach(component ${components}) + if(NOT TARGET "${component}") + message(FATAL_ERROR + "Missing component library ${component} referenced by metalib ${target_name}! + (Component library targets must be created BEFORE add_metalib.)") + endif() get_target_property(is_component "${component}" IS_COMPONENT) if(NOT is_component) message(FATAL_ERROR From d9e769f656e0fda9b700db46b51645099302e553 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 01:15:44 -0600 Subject: [PATCH 412/744] travis: Practically rewrite .travis.yml - Make the build matrix actually run as a matrix - Add a few exclusion rules to turn off some of the more esoteric cases. - Install libav, to test that p3ffmpeg builds - Don't do a makepanda build at all on this branch - Simplify uses of Python - Change indentation style; no indentation for nested lists --- .travis.yml | 80 ++++++++++++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 31 deletions(-) diff --git a/.travis.yml b/.travis.yml index b55b7d8cdc..0491111e78 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,30 +1,29 @@ language: cpp sudo: false + +# Build matrix: +python: +- "2.7" +- "3.5" +compiler: +- gcc +- clang +env: +- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 +- BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=0 +- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 +- BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30 + +# Remove some combinations from the build matrix, to be nice to Travis: matrix: - include: - - compiler: clang - env: BUILDSYSTEM=makepanda PYTHONV=python3 FLAGS=--installer - - compiler: clang - env: BUILDSYSTEM=makepanda PYTHONV=python2.7 FLAGS=--override=STDFLOAT_DOUBLE=1 - - compiler: gcc - env: BUILDSYSTEM=makepanda PYTHONV=python2.7 FLAGS=--optimize=4 - before_install: - - export CC=gcc-4.7 - - export CXX=g++-4.7 - - compiler: gcc - env: BUILDSYSTEM=cmake PYTHONV=python2.7 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives - before_install: - - export CC=gcc-4.7 - - export CXX=g++-4.7 - - compiler: clang - env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS='-DWANT_PYTHON_VERSION=3 -DCOMPOSITE_SOURCE_LIMIT=0' # Disable unity builds to catch missing #include directives - - compiler: gcc - env: BUILDSYSTEM=cmake PYTHONV=python3 FLAGS='-DWANT_PYTHON_VERSION=3 -DCOMPOSITE_SOURCE_LIMIT=0' # Disable unity builds to catch missing #include directives - before_install: - - export CC=gcc-4.7 - - export CXX=g++-4.7 - - compiler: clang - env: BUILDSYSTEM=cmake PYTHONV=python2.7 FLAGS=-DCOMPOSITE_SOURCE_LIMIT=0 # Disable unity builds to catch missing #include directives + exclude: + - python: "2.7" + compiler: gcc + - python: "2.7" + env: BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=0 + - python: "2.7" + env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 + addons: apt: sources: @@ -34,6 +33,10 @@ addons: - g++-4.7 - bison - flex + - libavcodec-dev + - libavformat-dev + - libavresample-dev + - libavutil-dev - libfreetype6-dev - libgl1-mesa-dev - libjpeg-dev @@ -41,6 +44,7 @@ addons: - libopenal-dev - libpng-dev - libssl-dev + - libswscale-dev - libvorbis-dev - libx11-dev - libxcursor-dev @@ -51,18 +55,32 @@ addons: - python-virtualenv - zlib1g-dev - fakeroot -script: + +# clean up remnants of makepanda +before_install: +- mv makepanda/test_imports.py . +- makepanda/selfdestruct.py --yes + install: - - virtualenv --python=$PYTHONV venv && source venv/bin/activate - - $PYTHONV -m pip install pytest +- virtualenv venv && source venv/bin/activate +- pip install pytest + +before_script: +- mkdir built +- cd built + script: - - '[[ "$BUILDSYSTEM" != "makepanda" ]] || ( $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 && LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV makepanda/test_imports.py )' - - '[[ "$BUILDSYSTEM" != "cmake" ]] || ( mkdir built && cd built && mv ../makepanda/test_imports.py . && ../makepanda/selfdestruct.py --yes && cmake -DHAVE_GTK2=NO $FLAGS .. && make -j4 && $PYTHONV test_imports.py && cd .. )' - - LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV -m pytest tests +- cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. +- make -j4 + +after_script: +- ../test_imports.py +- pytest ../tests + notifications: irc: channels: - - "chat.freenode.net#panda3d" + - "chat.freenode.net#panda3d" on_success: change on_failure: always use_notice: true From 5beaeb0f663097fe0f8254c2a5f8e860d9fe5cbf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 01:53:36 -0600 Subject: [PATCH 413/744] travis: Fix Python version selection Apparently this is only respected by Travis if 'language' is set to 'python' --- .travis.yml | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0491111e78..942613ceca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,27 +2,15 @@ language: cpp sudo: false # Build matrix: -python: -- "2.7" -- "3.5" compiler: - gcc - clang env: -- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 - BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=0 -- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 +- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 - BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30 - -# Remove some combinations from the build matrix, to be nice to Travis: -matrix: - exclude: - - python: "2.7" - compiler: gcc - - python: "2.7" - env: BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=0 - - python: "2.7" - env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 +- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 +- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 PYTHON_INTERP=python2.7 addons: apt: @@ -56,13 +44,13 @@ addons: - zlib1g-dev - fakeroot -# clean up remnants of makepanda before_install: +# clean up remnants of makepanda - mv makepanda/test_imports.py . - makepanda/selfdestruct.py --yes install: -- virtualenv venv && source venv/bin/activate +- ${PYTHON_INTERP:-python3.5} -m virtualenv venv && source venv/bin/activate - pip install pytest before_script: @@ -74,7 +62,7 @@ script: - make -j4 after_script: -- ../test_imports.py +- python ../test_imports.py - pytest ../tests notifications: From 1fcb8a27483b4de9bb92531eebe834b858ee813f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 02:26:47 -0600 Subject: [PATCH 414/744] CMake: Skip optional subdirectories in a cleaner way Instead of wrapping the whole subdirectory's CMakeLists in a gigantic if block, we use if(NOT HAVE_FOO) + return() This is tidier since it keeps the indentation generally consistent across all CMakeLists files. --- direct/src/distributed/CMakeLists.txt | 46 ++--- panda/metalibs/pandaegg/CMakeLists.txt | 16 +- panda/src/audio/CMakeLists.txt | 56 +++--- panda/src/audiotraits/CMakeLists.txt | 140 +++++++-------- panda/src/cocoadisplay/CMakeLists.txt | 66 +++---- panda/src/egg/CMakeLists.txt | 218 ++++++++++++----------- panda/src/egg2pg/CMakeLists.txt | 80 +++++---- panda/src/ffmpeg/CMakeLists.txt | 55 +++--- panda/src/glgsg/CMakeLists.txt | 40 +++-- panda/src/glstuff/CMakeLists.txt | 78 ++++---- panda/src/glxdisplay/CMakeLists.txt | 58 +++--- panda/src/nativenet/CMakeLists.txt | 70 ++++---- panda/src/net/CMakeLists.txt | 80 +++++---- panda/src/ode/CMakeLists.txt | 186 +++++++++---------- panda/src/osxdisplay/CMakeLists.txt | 56 +++--- panda/src/pnmtext/CMakeLists.txt | 52 +++--- panda/src/wgldisplay/CMakeLists.txt | 44 ++--- panda/src/windisplay/CMakeLists.txt | 35 ++-- panda/src/x11display/CMakeLists.txt | 34 ++-- pandatool/src/gtk-stats/CMakeLists.txt | 76 ++++---- pandatool/src/pstatserver/CMakeLists.txt | 52 +++--- 21 files changed, 787 insertions(+), 751 deletions(-) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 355548041a..e44be0d5c1 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -1,23 +1,25 @@ -if(HAVE_PYTHON) - set(P3DISTRIBUTED_HEADERS - config_distributed.h - cConnectionRepository.I - cConnectionRepository.h - cDistributedSmoothNodeBase.I - cDistributedSmoothNodeBase.h) - - set(P3DISTRIBUTED_SOURCES - config_distributed.cxx - cConnectionRepository.cxx - cDistributedSmoothNodeBase.cxx) - - add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED - ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) - target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) - target_link_libraries(p3distributed p3directbase p3dcparser panda) - target_use_packages(p3distributed PYTHON) - target_interrogate(p3distributed ALL) - - install(TARGETS p3distributed DESTINATION lib) - install(FILES ${P3DISTRIBUTED_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_PYTHON) + return() endif() + +set(P3DISTRIBUTED_HEADERS + config_distributed.h + cConnectionRepository.I + cConnectionRepository.h + cDistributedSmoothNodeBase.I + cDistributedSmoothNodeBase.h) + +set(P3DISTRIBUTED_SOURCES + config_distributed.cxx + cConnectionRepository.cxx + cDistributedSmoothNodeBase.cxx) + +add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED + ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) +target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) +target_link_libraries(p3distributed p3directbase p3dcparser panda) +target_use_packages(p3distributed PYTHON) +target_interrogate(p3distributed ALL) + +install(TARGETS p3distributed DESTINATION lib) +install(FILES ${P3DISTRIBUTED_HEADERS} DESTINATION include/panda3d) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index af185e5627..830649b448 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -1,8 +1,10 @@ -if(HAVE_EGG) - set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) - - add_metalib(pandaegg pandaegg.cxx COMPONENTS ${PANDAEGG_LINK_TARGETS}) - target_link_libraries(pandaegg panda) - - install(TARGETS pandaegg DESTINATION lib) +if(NOT HAVE_EGG) + return() endif() + +set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) + +add_metalib(pandaegg pandaegg.cxx COMPONENTS ${PANDAEGG_LINK_TARGETS}) +target_link_libraries(pandaegg panda) + +install(TARGETS pandaegg DESTINATION lib) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index c87dff6c76..6fd101852c 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -1,28 +1,30 @@ -if(HAVE_AUDIO) - set(P3AUDIO_HEADERS - config_audio.h - filterProperties.h filterProperties.I - audioLoadRequest.h audioLoadRequest.I - audioManager.h audioManager.I - audioSound.h audioSound.I - nullAudioManager.h - nullAudioSound.h) - - set(P3AUDIO_SOURCES - config_audio.cxx - filterProperties.cxx - audioLoadRequest.cxx - audioManager.cxx - audioSound.cxx - nullAudioManager.cxx - nullAudioSound.cxx) - - composite_sources(p3audio P3AUDIO_SOURCES) - add_component_library(p3audio SYMBOL BUILDING_PANDA_AUDIO - ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) - target_link_libraries(p3audio p3putil p3event p3movies p3linmath) - target_interrogate(p3audio ALL) - - install(TARGETS p3audio DESTINATION lib) - install(FILES ${P3AUDIO_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_AUDIO) + return() endif() + +set(P3AUDIO_HEADERS + config_audio.h + filterProperties.h filterProperties.I + audioLoadRequest.h audioLoadRequest.I + audioManager.h audioManager.I + audioSound.h audioSound.I + nullAudioManager.h + nullAudioSound.h) + +set(P3AUDIO_SOURCES + config_audio.cxx + filterProperties.cxx + audioLoadRequest.cxx + audioManager.cxx + audioSound.cxx + nullAudioManager.cxx + nullAudioSound.cxx) + +composite_sources(p3audio P3AUDIO_SOURCES) +add_component_library(p3audio SYMBOL BUILDING_PANDA_AUDIO + ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) +target_link_libraries(p3audio p3putil p3event p3movies p3linmath) +target_interrogate(p3audio ALL) + +install(TARGETS p3audio DESTINATION lib) +install(FILES ${P3AUDIO_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 8cf68126d6..266ca6f425 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -1,72 +1,70 @@ -if(HAVE_AUDIO) - - if(HAVE_RAD_MSS) - set(P3MILES_HEADERS - config_milesAudio.h - milesAudioManager.h - milesAudioSound.I milesAudioSound.h - milesAudioSample.I milesAudioSample.h - milesAudioSequence.I milesAudioSequence.h - milesAudioStream.I milesAudioStream.h - globalMilesManager.I globalMilesManager.h) - - set(P3MILES_SOURCES - config_milesAudio.cxx milesAudioManager.cxx milesAudioSound.cxx - milesAudioStream.cxx globalMilesManager.cxx milesAudioSample.cxx - milesAudioSequence.cxx) - - composite_sources(p3miles_audio P3MILES_SOURCES) - include_directories(${MILES_INCLUDE_DIR}) - add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) - set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) - target_link_libraries(p3miles_audio panda) - target_use_packages(p3miles_audio MILES) - - install(TARGETS p3miles_audio DESTINATION lib) - endif() - - if(HAVE_FMODEX) - set(P3FMOD_HEADERS - config_fmodAudio.h - fmodAudioManager.h - fmodAudioSound.I fmodAudioSound.h) - - set(P3FMOD_SOURCES - config_fmodAudio.cxx fmodAudioManager.cxx fmodAudioSound.cxx) - - composite_sources(p3fmod_audio P3FMOD_SOURCES) - include_directories(${FMODEX_INCLUDE_DIR}) - add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) - set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) - target_link_libraries(p3fmod_audio panda) - target_use_packages(p3fmod_audio FMODEX) - - install(TARGETS p3fmod_audio DESTINATION lib) - endif() - - if(HAVE_OPENAL) - set(P3OPENAL_HEADERS - config_openalAudio.h - openalAudioManager.h - openalAudioSound.I openalAudioSound.h) - - set(P3OPENAL_SOURCES - config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx) - - - composite_sources(p3openal_audio P3OPENAL_SOURCES) - include_directories(${OPENAL_INCLUDE_DIR}) - add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) - set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) - target_link_libraries(p3openal_audio panda) - target_use_packages(p3openal_audio OPENAL) - - install(TARGETS p3openal_audio DESTINATION lib) - endif() - - if(NOT HAVE_RAD_MSS AND NOT HAVE_FMODEX AND NOT HAVE_OPENAL) - message(SEND_ERROR - "You must have an audio backend for audio support! Turn off HAVE_AUDIO to ignore this.") - endif() - +if(NOT HAVE_AUDIO) + return() +elseif(NOT HAVE_RAD_MSS AND NOT HAVE_FMODEX AND NOT HAVE_OPENAL) + message(SEND_ERROR + "You must have an audio backend for audio support! Turn off HAVE_AUDIO to ignore this.") +endif() + +if(HAVE_RAD_MSS) + set(P3MILES_HEADERS + config_milesAudio.h + milesAudioManager.h + milesAudioSound.I milesAudioSound.h + milesAudioSample.I milesAudioSample.h + milesAudioSequence.I milesAudioSequence.h + milesAudioStream.I milesAudioStream.h + globalMilesManager.I globalMilesManager.h) + + set(P3MILES_SOURCES + config_milesAudio.cxx milesAudioManager.cxx milesAudioSound.cxx + milesAudioStream.cxx globalMilesManager.cxx milesAudioSample.cxx + milesAudioSequence.cxx) + + composite_sources(p3miles_audio P3MILES_SOURCES) + include_directories(${MILES_INCLUDE_DIR}) + add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) + set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) + target_link_libraries(p3miles_audio panda) + target_use_packages(p3miles_audio MILES) + + install(TARGETS p3miles_audio DESTINATION lib) +endif() + +if(HAVE_FMODEX) + set(P3FMOD_HEADERS + config_fmodAudio.h + fmodAudioManager.h + fmodAudioSound.I fmodAudioSound.h) + + set(P3FMOD_SOURCES + config_fmodAudio.cxx fmodAudioManager.cxx fmodAudioSound.cxx) + + composite_sources(p3fmod_audio P3FMOD_SOURCES) + include_directories(${FMODEX_INCLUDE_DIR}) + add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) + set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) + target_link_libraries(p3fmod_audio panda) + target_use_packages(p3fmod_audio FMODEX) + + install(TARGETS p3fmod_audio DESTINATION lib) +endif() + +if(HAVE_OPENAL) + set(P3OPENAL_HEADERS + config_openalAudio.h + openalAudioManager.h + openalAudioSound.I openalAudioSound.h) + + set(P3OPENAL_SOURCES + config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx) + + + composite_sources(p3openal_audio P3OPENAL_SOURCES) + include_directories(${OPENAL_INCLUDE_DIR}) + add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) + set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) + target_link_libraries(p3openal_audio panda) + target_use_packages(p3openal_audio OPENAL) + + install(TARGETS p3openal_audio DESTINATION lib) endif() diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 7d5d5f1bd7..375b792bdf 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -1,33 +1,35 @@ -if(APPLE AND HAVE_GL AND HAVE_COCOA) - set(P3COCOADISPLAY_HEADERS - config_cocoadisplay.h - cocoaGraphicsPipe.h cocoaGraphicsPipe.I - cocoaGraphicsWindow.h cocoaGraphicsWindow.I - cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I - cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h) - - set(P3COCOADISPLAY_SOURCES - config_cocoadisplay.mm - cocoaGraphicsBuffer.mm - cocoaGraphicsPipe.mm - cocoaGraphicsStateGuardian.mm - cocoaGraphicsWindow.mm - cocoaPandaApp.mm - cocoaPandaView.mm - cocoaPandaWindow.mm - cocoaPandaWindowDelegate.mm) - - #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) - add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) - set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) - target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) - - # Frameworks: - find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) - find_library(APPKIT_LIBRARY AppKit) - find_library(CARBON_LIBRARY Carbon) - target_link_libraries(p3cocoadisplay - ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) - - install(TARGETS p3cocoadisplay DESTINATION lib) +if(NOT APPLE OR NOT HAVE_GL OR NOT HAVE_COCOA) + return() endif() + +set(P3COCOADISPLAY_HEADERS + config_cocoadisplay.h + cocoaGraphicsPipe.h cocoaGraphicsPipe.I + cocoaGraphicsWindow.h cocoaGraphicsWindow.I + cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I + cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h) + +set(P3COCOADISPLAY_SOURCES + config_cocoadisplay.mm + cocoaGraphicsBuffer.mm + cocoaGraphicsPipe.mm + cocoaGraphicsStateGuardian.mm + cocoaGraphicsWindow.mm + cocoaPandaApp.mm + cocoaPandaView.mm + cocoaPandaWindow.mm + cocoaPandaWindowDelegate.mm) + +#composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) +add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) +set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) + +# Frameworks: +find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) +find_library(APPKIT_LIBRARY AppKit) +find_library(CARBON_LIBRARY Carbon) +target_link_libraries(p3cocoadisplay + ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) + +install(TARGETS p3cocoadisplay DESTINATION lib) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 829b5804b2..fe5d24d427 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -1,109 +1,111 @@ -if(HAVE_EGG) - add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) - add_flex_target(lexer.cxx lexer.lxx CASE_INSENSITIVE PREFIX eggyy) - - set(P3EGG_HEADERS - config_egg.h eggAnimData.I eggAnimData.h - eggAnimPreload.I eggAnimPreload.h - eggAttributes.I - eggAttributes.h eggBin.h eggBinMaker.h eggComment.I - eggComment.h - eggCompositePrimitive.I eggCompositePrimitive.h - eggCoordinateSystem.I eggCoordinateSystem.h - eggCurve.I eggCurve.h eggData.I eggData.h - eggExternalReference.I eggExternalReference.h - eggFilenameNode.I eggFilenameNode.h eggGroup.I eggGroup.h - eggGroupNode.I eggGroupNode.h eggGroupUniquifier.h - eggLine.I eggLine.h - eggMaterial.I eggMaterial.h eggMaterialCollection.I - eggMaterialCollection.h - eggMesher.h eggMesher.I - eggMesherEdge.h eggMesherEdge.I - eggMesherFanMaker.h eggMesherFanMaker.I - eggMesherStrip.h eggMesherStrip.I - eggMiscFuncs.I eggMiscFuncs.h - eggMorph.I eggMorph.h eggMorphList.I eggMorphList.h - eggNamedObject.I eggNamedObject.h eggNameUniquifier.h - eggNode.I eggNode.h eggNurbsCurve.I eggNurbsCurve.h - eggNurbsSurface.I eggNurbsSurface.h eggObject.I eggObject.h - eggParameters.h - eggPatch.I eggPatch.h - eggPoint.I eggPoint.h eggPolygon.I - eggPolygon.h eggPolysetMaker.h eggPoolUniquifier.h - eggPrimitive.I eggPrimitive.h - eggRenderMode.I eggRenderMode.h - eggSAnimData.I eggSAnimData.h eggSurface.I eggSurface.h - eggSwitchCondition.h eggTable.I eggTable.h eggTexture.I - eggTexture.h eggTextureCollection.I eggTextureCollection.h - eggTriangleFan.I eggTriangleFan.h - eggTriangleStrip.I eggTriangleStrip.h - eggTransform.I eggTransform.h - eggUserData.I eggUserData.h - eggUtilities.I eggUtilities.h - eggVertex.I eggVertex.h - eggVertexAux.I eggVertexAux.h - eggVertexPool.I eggVertexPool.h - eggVertexUV.I eggVertexUV.h - eggXfmAnimData.I - eggXfmAnimData.h eggXfmSAnim.I eggXfmSAnim.h parserDefs.h - parser.yxx lexerDefs.h lexer.lxx pt_EggMaterial.h - vector_PT_EggMaterial.h pt_EggTexture.h - vector_PT_EggTexture.h pt_EggVertex.h vector_PT_EggVertex.h - ) - - set(P3EGG_SOURCES - config_egg.cxx eggAnimData.cxx - eggAnimPreload.cxx - eggAttributes.cxx eggBin.cxx - eggBinMaker.cxx eggComment.cxx - eggCompositePrimitive.cxx - eggCoordinateSystem.cxx - eggCurve.cxx eggData.cxx eggExternalReference.cxx - eggFilenameNode.cxx eggGroup.cxx eggGroupNode.cxx - eggGroupUniquifier.cxx eggLine.cxx eggMaterial.cxx - eggMaterialCollection.cxx - eggMesher.cxx - eggMesherEdge.cxx - eggMesherFanMaker.cxx - eggMesherStrip.cxx - eggMiscFuncs.cxx eggMorphList.cxx - eggNamedObject.cxx eggNameUniquifier.cxx eggNode.cxx - eggNurbsCurve.cxx eggNurbsSurface.cxx eggObject.cxx - eggParameters.cxx - eggPatch.cxx - eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxx - eggPoolUniquifier.cxx eggPrimitive.cxx eggRenderMode.cxx - eggSAnimData.cxx eggSurface.cxx eggSwitchCondition.cxx - eggTable.cxx eggTexture.cxx eggTextureCollection.cxx - eggTransform.cxx - eggTriangleFan.cxx - eggTriangleStrip.cxx - eggUserData.cxx - eggUtilities.cxx eggVertex.cxx - eggVertexAux.cxx - eggVertexPool.cxx eggVertexUV.cxx - eggXfmAnimData.cxx eggXfmSAnim.cxx pt_EggMaterial.cxx - vector_PT_EggMaterial.cxx pt_EggTexture.cxx - vector_PT_EggTexture.cxx pt_EggVertex.cxx - vector_PT_EggVertex.cxx - ) - - set(P3EGG_IGATEEXT - eggGroupNode_ext.cxx - eggGroupNode_ext.h - ) - - # These cannot be interrogated, and are excluded from the composites. - set(P3EGG_PARSER_SOURCES - parser.cxx - lexer.cxx) - - composite_sources(p3egg P3EGG_SOURCES) - add_component_library(p3egg SYMBOL BUILDING_PANDAEGG - ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) - target_link_libraries(p3egg panda) - target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) - - install(TARGETS p3egg DESTINATION lib) - install(FILES ${P3EGG_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_EGG) + return() endif() + +add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) +add_flex_target(lexer.cxx lexer.lxx CASE_INSENSITIVE PREFIX eggyy) + +set(P3EGG_HEADERS + config_egg.h eggAnimData.I eggAnimData.h + eggAnimPreload.I eggAnimPreload.h + eggAttributes.I + eggAttributes.h eggBin.h eggBinMaker.h eggComment.I + eggComment.h + eggCompositePrimitive.I eggCompositePrimitive.h + eggCoordinateSystem.I eggCoordinateSystem.h + eggCurve.I eggCurve.h eggData.I eggData.h + eggExternalReference.I eggExternalReference.h + eggFilenameNode.I eggFilenameNode.h eggGroup.I eggGroup.h + eggGroupNode.I eggGroupNode.h eggGroupUniquifier.h + eggLine.I eggLine.h + eggMaterial.I eggMaterial.h eggMaterialCollection.I + eggMaterialCollection.h + eggMesher.h eggMesher.I + eggMesherEdge.h eggMesherEdge.I + eggMesherFanMaker.h eggMesherFanMaker.I + eggMesherStrip.h eggMesherStrip.I + eggMiscFuncs.I eggMiscFuncs.h + eggMorph.I eggMorph.h eggMorphList.I eggMorphList.h + eggNamedObject.I eggNamedObject.h eggNameUniquifier.h + eggNode.I eggNode.h eggNurbsCurve.I eggNurbsCurve.h + eggNurbsSurface.I eggNurbsSurface.h eggObject.I eggObject.h + eggParameters.h + eggPatch.I eggPatch.h + eggPoint.I eggPoint.h eggPolygon.I + eggPolygon.h eggPolysetMaker.h eggPoolUniquifier.h + eggPrimitive.I eggPrimitive.h + eggRenderMode.I eggRenderMode.h + eggSAnimData.I eggSAnimData.h eggSurface.I eggSurface.h + eggSwitchCondition.h eggTable.I eggTable.h eggTexture.I + eggTexture.h eggTextureCollection.I eggTextureCollection.h + eggTriangleFan.I eggTriangleFan.h + eggTriangleStrip.I eggTriangleStrip.h + eggTransform.I eggTransform.h + eggUserData.I eggUserData.h + eggUtilities.I eggUtilities.h + eggVertex.I eggVertex.h + eggVertexAux.I eggVertexAux.h + eggVertexPool.I eggVertexPool.h + eggVertexUV.I eggVertexUV.h + eggXfmAnimData.I + eggXfmAnimData.h eggXfmSAnim.I eggXfmSAnim.h parserDefs.h + parser.yxx lexerDefs.h lexer.lxx pt_EggMaterial.h + vector_PT_EggMaterial.h pt_EggTexture.h + vector_PT_EggTexture.h pt_EggVertex.h vector_PT_EggVertex.h +) + +set(P3EGG_SOURCES + config_egg.cxx eggAnimData.cxx + eggAnimPreload.cxx + eggAttributes.cxx eggBin.cxx + eggBinMaker.cxx eggComment.cxx + eggCompositePrimitive.cxx + eggCoordinateSystem.cxx + eggCurve.cxx eggData.cxx eggExternalReference.cxx + eggFilenameNode.cxx eggGroup.cxx eggGroupNode.cxx + eggGroupUniquifier.cxx eggLine.cxx eggMaterial.cxx + eggMaterialCollection.cxx + eggMesher.cxx + eggMesherEdge.cxx + eggMesherFanMaker.cxx + eggMesherStrip.cxx + eggMiscFuncs.cxx eggMorphList.cxx + eggNamedObject.cxx eggNameUniquifier.cxx eggNode.cxx + eggNurbsCurve.cxx eggNurbsSurface.cxx eggObject.cxx + eggParameters.cxx + eggPatch.cxx + eggPoint.cxx eggPolygon.cxx eggPolysetMaker.cxx + eggPoolUniquifier.cxx eggPrimitive.cxx eggRenderMode.cxx + eggSAnimData.cxx eggSurface.cxx eggSwitchCondition.cxx + eggTable.cxx eggTexture.cxx eggTextureCollection.cxx + eggTransform.cxx + eggTriangleFan.cxx + eggTriangleStrip.cxx + eggUserData.cxx + eggUtilities.cxx eggVertex.cxx + eggVertexAux.cxx + eggVertexPool.cxx eggVertexUV.cxx + eggXfmAnimData.cxx eggXfmSAnim.cxx pt_EggMaterial.cxx + vector_PT_EggMaterial.cxx pt_EggTexture.cxx + vector_PT_EggTexture.cxx pt_EggVertex.cxx + vector_PT_EggVertex.cxx +) + +set(P3EGG_IGATEEXT + eggGroupNode_ext.cxx + eggGroupNode_ext.h +) + +# These cannot be interrogated, and are excluded from the composites. +set(P3EGG_PARSER_SOURCES + parser.cxx + lexer.cxx) + +composite_sources(p3egg P3EGG_SOURCES) +add_component_library(p3egg SYMBOL BUILDING_PANDAEGG + ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) +target_link_libraries(p3egg panda) +target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) + +install(TARGETS p3egg DESTINATION lib) +install(FILES ${P3EGG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 5eb9e1dbaa..f5c2c7683c 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -1,40 +1,42 @@ -if(HAVE_EGG) - set(P3EGG2PG_HEADERS - animBundleMaker.h - characterMaker.h - config_egg2pg.h - deferredNodeProperty.h - eggBinner.h - eggLoader.h eggLoader.I - eggRenderState.h eggRenderState.I - eggSaver.h eggSaver.I - egg_parametrics.h - load_egg_file.h - save_egg_file.h - loaderFileTypeEgg.h - ) - - set(P3EGG2PG_SOURCES - animBundleMaker.cxx - characterMaker.cxx - config_egg2pg.cxx - deferredNodeProperty.cxx - eggBinner.cxx - eggLoader.cxx - eggRenderState.cxx - eggSaver.cxx - egg_parametrics.cxx - load_egg_file.cxx - save_egg_file.cxx - loaderFileTypeEgg.cxx - ) - - composite_sources(p3egg2pg P3EGG2PG_SOURCES) - add_component_library(p3egg2pg SYMBOL BUILDING_PANDAEGG - ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) - target_link_libraries(p3egg2pg panda p3egg) - target_interrogate(p3egg2pg ALL) - - install(TARGETS p3egg2pg DESTINATION lib) - install(FILES ${P3EGG2PG_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_EGG) + return() endif() + +set(P3EGG2PG_HEADERS + animBundleMaker.h + characterMaker.h + config_egg2pg.h + deferredNodeProperty.h + eggBinner.h + eggLoader.h eggLoader.I + eggRenderState.h eggRenderState.I + eggSaver.h eggSaver.I + egg_parametrics.h + load_egg_file.h + save_egg_file.h + loaderFileTypeEgg.h +) + +set(P3EGG2PG_SOURCES + animBundleMaker.cxx + characterMaker.cxx + config_egg2pg.cxx + deferredNodeProperty.cxx + eggBinner.cxx + eggLoader.cxx + eggRenderState.cxx + eggSaver.cxx + egg_parametrics.cxx + load_egg_file.cxx + save_egg_file.cxx + loaderFileTypeEgg.cxx +) + +composite_sources(p3egg2pg P3EGG2PG_SOURCES) +add_component_library(p3egg2pg SYMBOL BUILDING_PANDAEGG + ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) +target_link_libraries(p3egg2pg panda p3egg) +target_interrogate(p3egg2pg ALL) + +install(TARGETS p3egg2pg DESTINATION lib) +install(FILES ${P3EGG2PG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index a0c9102d47..8f78a93ac5 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -1,28 +1,29 @@ -if(HAVE_FFMPEG) - - set(P3FFMPEG_HEADERS - config_ffmpeg.h - ffmpegVideo.h ffmpegVideo.I - ffmpegVideoCursor.h ffmpegVideoCursor.I - ffmpegAudio.h ffmpegAudio.I - ffmpegAudioCursor.h ffmpegAudioCursor.I - ffmpegVirtualFile.h ffmpegVirtualFile.I) - - - set(P3FFMPEG_SOURCES - config_ffmpeg.cxx - ffmpegVideo.cxx - ffmpegVideoCursor.cxx - ffmpegAudio.cxx - ffmpegAudioCursor.cxx - ffmpegVirtualFile.cxx) - - composite_sources(p3ffmpeg P3FFMPEG_SOURCES) - add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) - set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) - target_link_libraries(p3ffmpeg panda) - target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) - - install(TARGETS p3ffmpeg DESTINATION lib) - install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_FFMPEG) + return() endif() + +set(P3FFMPEG_HEADERS + config_ffmpeg.h + ffmpegVideo.h ffmpegVideo.I + ffmpegVideoCursor.h ffmpegVideoCursor.I + ffmpegAudio.h ffmpegAudio.I + ffmpegAudioCursor.h ffmpegAudioCursor.I + ffmpegVirtualFile.h ffmpegVirtualFile.I) + + +set(P3FFMPEG_SOURCES + config_ffmpeg.cxx + ffmpegVideo.cxx + ffmpegVideoCursor.cxx + ffmpegAudio.cxx + ffmpegAudioCursor.cxx + ffmpegVirtualFile.cxx) + +composite_sources(p3ffmpeg P3FFMPEG_SOURCES) +add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) +set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) +target_link_libraries(p3ffmpeg panda) +target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) + +install(TARGETS p3ffmpeg DESTINATION lib) +install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index d7a9763b9c..ac243e44f7 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -1,20 +1,22 @@ -if(HAVE_GL) - set(P3GLGSG_HEADERS - config_glgsg.h glgsg.h - ) - - set(P3GLGSG_SOURCES - config_glgsg.cxx - glgsg.cxx - ) - - composite_sources(p3glgsg P3GLGSG_SOURCES) - add_component_library(p3glgsg SYMBOL BUILDING_PANDAGL - ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) - target_link_libraries(p3glgsg p3glstuff panda - ${OPENGL_LIBRARIES}) - target_use_packages(p3glgsg CG) - - install(TARGETS p3glgsg DESTINATION lib) - install(FILES ${P3GLGSG_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_GL) + return() endif() + +set(P3GLGSG_HEADERS + config_glgsg.h glgsg.h +) + +set(P3GLGSG_SOURCES + config_glgsg.cxx + glgsg.cxx +) + +composite_sources(p3glgsg P3GLGSG_SOURCES) +add_component_library(p3glgsg SYMBOL BUILDING_PANDAGL + ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) +target_link_libraries(p3glgsg p3glstuff panda + ${OPENGL_LIBRARIES}) +target_use_packages(p3glgsg CG) + +install(TARGETS p3glgsg DESTINATION lib) +install(FILES ${P3GLGSG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 3919f79fd3..67af226c88 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -1,39 +1,41 @@ -if(HAVE_GL) - set(P3GLSTUFF_HEADERS - glGeomContext_src.I - glGeomContext_src.h - glGeomMunger_src.I - glGeomMunger_src.h - glGraphicsStateGuardian_src.I - glGraphicsStateGuardian_src.h - glGraphicsBuffer_src.I - glGraphicsBuffer_src.h - glImmediateModeSender_src.I - glImmediateModeSender_src.h - glIndexBufferContext_src.I - glIndexBufferContext_src.h - glOcclusionQueryContext_src.I - glOcclusionQueryContext_src.h - glShaderContext_src.I - glShaderContext_src.h - glTextureContext_src.I - glTextureContext_src.h - glVertexBufferContext_src.I - glVertexBufferContext_src.h - glmisc_src.h - glstuff_src.h - glstuff_undef_src.h - panda_glext.h - ) - - set(P3GLSTUFF_SOURCES - glpure.cxx - ) - - composite_sources(p3glstuff P3GLSTUFF_SOURCES) - add_component_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) - target_link_libraries(p3glstuff panda) - - install(TARGETS p3glstuff DESTINATION lib) - install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_GL) + return() endif() + +set(P3GLSTUFF_HEADERS + glGeomContext_src.I + glGeomContext_src.h + glGeomMunger_src.I + glGeomMunger_src.h + glGraphicsStateGuardian_src.I + glGraphicsStateGuardian_src.h + glGraphicsBuffer_src.I + glGraphicsBuffer_src.h + glImmediateModeSender_src.I + glImmediateModeSender_src.h + glIndexBufferContext_src.I + glIndexBufferContext_src.h + glOcclusionQueryContext_src.I + glOcclusionQueryContext_src.h + glShaderContext_src.I + glShaderContext_src.h + glTextureContext_src.I + glTextureContext_src.h + glVertexBufferContext_src.I + glVertexBufferContext_src.h + glmisc_src.h + glstuff_src.h + glstuff_undef_src.h + panda_glext.h +) + +set(P3GLSTUFF_SOURCES + glpure.cxx +) + +composite_sources(p3glstuff P3GLSTUFF_SOURCES) +add_component_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) +target_link_libraries(p3glstuff panda) + +install(TARGETS p3glstuff DESTINATION lib) +install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 473d20b2e8..adedecae49 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -1,29 +1,31 @@ -if(HAVE_GLX) - set(P3GLXDISPLAY_HEADERS - config_glxdisplay.h - glxGraphicsBuffer.h glxGraphicsBuffer.I - glxGraphicsPipe.h glxGraphicsPipe.I - glxGraphicsPixmap.h glxGraphicsPixmap.I - glxGraphicsWindow.h - glxGraphicsStateGuardian.h glxGraphicsStateGuardian.I - posixGraphicsStateGuardian.h posixGraphicsStateGuardian.I - panda_glxext.h - ) - - set(P3GLXDISPLAY_SOURCES - config_glxdisplay.cxx - glxGraphicsBuffer.cxx - glxGraphicsPipe.cxx - glxGraphicsPixmap.cxx - glxGraphicsWindow.cxx - glxGraphicsStateGuardian.cxx - posixGraphicsStateGuardian.cxx - ) - - composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) - add_component_library(p3glxdisplay SYMBOL BUILDING_PANDAGL - ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) - target_link_libraries(p3glxdisplay p3glgsg p3x11display) - - install(TARGETS p3glxdisplay DESTINATION lib) +if(NOT HAVE_GLX) + return() endif() + +set(P3GLXDISPLAY_HEADERS + config_glxdisplay.h + glxGraphicsBuffer.h glxGraphicsBuffer.I + glxGraphicsPipe.h glxGraphicsPipe.I + glxGraphicsPixmap.h glxGraphicsPixmap.I + glxGraphicsWindow.h + glxGraphicsStateGuardian.h glxGraphicsStateGuardian.I + posixGraphicsStateGuardian.h posixGraphicsStateGuardian.I + panda_glxext.h +) + +set(P3GLXDISPLAY_SOURCES + config_glxdisplay.cxx + glxGraphicsBuffer.cxx + glxGraphicsPipe.cxx + glxGraphicsPixmap.cxx + glxGraphicsWindow.cxx + glxGraphicsStateGuardian.cxx + posixGraphicsStateGuardian.cxx +) + +composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) +add_component_library(p3glxdisplay SYMBOL BUILDING_PANDAGL + ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) +target_link_libraries(p3glxdisplay p3glgsg p3x11display) + +install(TARGETS p3glxdisplay DESTINATION lib) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 4323082e87..2c2fc687ca 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -1,35 +1,37 @@ -if(WANT_NATIVE_NET) - set(P3NATIVENET_HEADERS - buffered_datagramconnection.h - buffered_datagramreader.h buffered_datagramreader.I - ringbuffer.h ringbuffer.I socket_ip.h - socket_tcp_listen.h time_accumulator.h time_out.h - socket_address.I socket_address.h - socket_portable.h time_base.h time_span.h buffered_datagramwriter.h - socket_base.h socket_selector.h - socket_udp.h - socket_udp_incoming.h time_clock.h - membuffer.h membuffer.I socket_fdset.h socket_tcp.h - socket_udp_outgoing.h time_general.h) - - set(P3NATIVENET_SOURCES - config_nativenet.cxx - buffered_datagramconnection.cxx - socket_address.cxx - socket_ip.cxx - socket_tcp.cxx - socket_tcp_listen.cxx - socket_tcp_ssl.cxx - socket_udp.cxx - socket_udp_incoming.cxx - socket_udp_outgoing.cxx) - - composite_sources(p3nativenet P3NATIVENET_SOURCES) - add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET - ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) - target_link_libraries(p3nativenet p3express p3pandabase p3downloader) - target_interrogate(p3nativenet ALL) - - install(TARGETS p3nativenet DESTINATION lib) - install(FILES ${P3NATIVENET_HEADERS} DESTINATION include/panda3d) +if(NOT WANT_NATIVE_NET) + return() endif() + +set(P3NATIVENET_HEADERS + buffered_datagramconnection.h + buffered_datagramreader.h buffered_datagramreader.I + ringbuffer.h ringbuffer.I socket_ip.h + socket_tcp_listen.h time_accumulator.h time_out.h + socket_address.I socket_address.h + socket_portable.h time_base.h time_span.h buffered_datagramwriter.h + socket_base.h socket_selector.h + socket_udp.h + socket_udp_incoming.h time_clock.h + membuffer.h membuffer.I socket_fdset.h socket_tcp.h + socket_udp_outgoing.h time_general.h) + +set(P3NATIVENET_SOURCES + config_nativenet.cxx + buffered_datagramconnection.cxx + socket_address.cxx + socket_ip.cxx + socket_tcp.cxx + socket_tcp_listen.cxx + socket_tcp_ssl.cxx + socket_udp.cxx + socket_udp_incoming.cxx + socket_udp_outgoing.cxx) + +composite_sources(p3nativenet P3NATIVENET_SOURCES) +add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET + ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) +target_link_libraries(p3nativenet p3express p3pandabase p3downloader) +target_interrogate(p3nativenet ALL) + +install(TARGETS p3nativenet DESTINATION lib) +install(FILES ${P3NATIVENET_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 3f4dba403c..adc9f9f4ad 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -1,40 +1,42 @@ -if(HAVE_NET AND WANT_NATIVE_NET) - set(P3NET_HEADERS - config_net.h connection.h connectionListener.h - connectionManager.N connectionManager.h - connectionReader.I connectionReader.h - connectionWriter.h datagramQueue.h - datagramTCPHeader.I datagramTCPHeader.h - datagramUDPHeader.I datagramUDPHeader.h - netAddress.h netDatagram.I netDatagram.h - datagramGeneratorNet.I datagramGeneratorNet.h - datagramSinkNet.I datagramSinkNet.h - queuedConnectionListener.I - queuedConnectionListener.h queuedConnectionManager.h - queuedConnectionReader.h recentConnectionReader.h - queuedReturn.h queuedReturn.I) - - set(P3NET_SOURCES - config_net.cxx connection.cxx connectionListener.cxx - connectionManager.cxx connectionReader.cxx - connectionWriter.cxx datagramQueue.cxx datagramTCPHeader.cxx - datagramUDPHeader.cxx netAddress.cxx netDatagram.cxx - datagramGeneratorNet.cxx - datagramSinkNet.cxx - queuedConnectionListener.cxx - queuedConnectionManager.cxx queuedConnectionReader.cxx - recentConnectionReader.cxx) - - composite_sources(p3net P3NET_SOURCES) - add_component_library(p3net SYMBOL BUILDING_PANDA_NET - ${P3NET_HEADERS} ${P3NET_SOURCES}) - target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) - target_interrogate(p3net ALL) - - if(WIN32) - target_link_libraries(p3net Iphlpapi.lib) - endif() - - install(TARGETS p3net DESTINATION lib) - install(FILES ${P3NET_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_NET OR NOT WANT_NATIVE_NET) + return() endif() + +set(P3NET_HEADERS + config_net.h connection.h connectionListener.h + connectionManager.N connectionManager.h + connectionReader.I connectionReader.h + connectionWriter.h datagramQueue.h + datagramTCPHeader.I datagramTCPHeader.h + datagramUDPHeader.I datagramUDPHeader.h + netAddress.h netDatagram.I netDatagram.h + datagramGeneratorNet.I datagramGeneratorNet.h + datagramSinkNet.I datagramSinkNet.h + queuedConnectionListener.I + queuedConnectionListener.h queuedConnectionManager.h + queuedConnectionReader.h recentConnectionReader.h + queuedReturn.h queuedReturn.I) + +set(P3NET_SOURCES + config_net.cxx connection.cxx connectionListener.cxx + connectionManager.cxx connectionReader.cxx + connectionWriter.cxx datagramQueue.cxx datagramTCPHeader.cxx + datagramUDPHeader.cxx netAddress.cxx netDatagram.cxx + datagramGeneratorNet.cxx + datagramSinkNet.cxx + queuedConnectionListener.cxx + queuedConnectionManager.cxx queuedConnectionReader.cxx + recentConnectionReader.cxx) + +composite_sources(p3net P3NET_SOURCES) +add_component_library(p3net SYMBOL BUILDING_PANDA_NET + ${P3NET_HEADERS} ${P3NET_SOURCES}) +target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) +target_interrogate(p3net ALL) + +if(WIN32) + target_link_libraries(p3net Iphlpapi.lib) +endif() + +install(TARGETS p3net DESTINATION lib) +install(FILES ${P3NET_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 7ac467ef7b..3206b722eb 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -1,93 +1,95 @@ -if(HAVE_ODE) - set(P3ODE_HEADERS - ode_includes.h config_ode.h - odeWorld.I odeWorld.h - odeMass.I odeMass.h - odeBody.I odeBody.h - odeJointGroup.I odeJointGroup.h - odeJoint.I odeJoint.h - odeUtil.h - odeSpace.I odeSpace.h - odeGeom.I odeGeom.h - odeSurfaceParameters.I odeSurfaceParameters.h - odeContactGeom.I odeContactGeom.h - odeContact.I odeContact.h - odeAMotorJoint.I odeAMotorJoint.h - odeBallJoint.I odeBallJoint.h - odeContactJoint.I odeContactJoint.h - odeFixedJoint.I odeFixedJoint.h - odeHingeJoint.I odeHingeJoint.h - odeHinge2Joint.I odeHinge2Joint.h - odeLMotorJoint.I odeLMotorJoint.h - odeNullJoint.I odeNullJoint.h - odePlane2dJoint.I odePlane2dJoint.h - odeSliderJoint.I odeSliderJoint.h - odeUniversalJoint.I odeUniversalJoint.h - odeJointCollection.I odeJointCollection.h - odeSimpleSpace.I odeSimpleSpace.h - odeHashSpace.I odeHashSpace.h - odeQuadTreeSpace.I odeQuadTreeSpace.h - odeSphereGeom.I odeSphereGeom.h - odeBoxGeom.I odeBoxGeom.h - odePlaneGeom.I odePlaneGeom.h - odeCappedCylinderGeom.I odeCappedCylinderGeom.h - odeCylinderGeom.I odeCylinderGeom.h - odeRayGeom.I odeRayGeom.h - odeTriMeshData.I odeTriMeshData.h - odeTriMeshGeom.I odeTriMeshGeom.h - odeCollisionEntry.I odeCollisionEntry.h - odeHelperStructs.h) - - set(P3ODE_SOURCES - config_ode.cxx - odeWorld.cxx odeMass.cxx odeBody.cxx - odeJointGroup.cxx odeJoint.cxx - odeUtil.cxx - odeSpace.cxx - odeGeom.cxx - odeSurfaceParameters.cxx - odeContactGeom.cxx odeContact.cxx - odeAMotorJoint.cxx odeBallJoint.cxx - odeContactJoint.cxx odeFixedJoint.cxx - odeHingeJoint.cxx odeHinge2Joint.cxx - odeLMotorJoint.cxx odeNullJoint.cxx - odePlane2dJoint.cxx odeSliderJoint.cxx - odeUniversalJoint.cxx odeJointCollection.cxx - odeSimpleSpace.cxx - odeHashSpace.cxx odeQuadTreeSpace.cxx - odeSphereGeom.cxx odeBoxGeom.cxx - odePlaneGeom.cxx odeCappedCylinderGeom.cxx - odeCylinderGeom.cxx odeRayGeom.cxx - odeTriMeshData.cxx odeTriMeshGeom.cxx - odeCollisionEntry.cxx) - - set(P3ODE_IGATEEXT - odeBody_ext.h - odeBody_ext.I - odeGeom_ext.cxx - odeGeom_ext.h - odeGeom_ext.I - odeJoint_ext.cxx - odeJoint_ext.h - odeSpace_ext.cxx - odeSpace_ext.h - odeSpace_ext.I - odeUtil_ext.cxx - odeUtil_ext.h) - - set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") - list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h") - list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHeightFieldGeom.h") - list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") - - composite_sources(p3ode P3ODE_SOURCES) - add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) - set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) - target_compile_definitions(p3ode PUBLIC dSINGLE) - target_link_libraries(p3ode panda) - target_use_packages(p3ode ODE) - target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) - - install(TARGETS p3ode DESTINATION lib) - install(FILES ${P3ODE_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_ODE) + return() endif() + +set(P3ODE_HEADERS + ode_includes.h config_ode.h + odeWorld.I odeWorld.h + odeMass.I odeMass.h + odeBody.I odeBody.h + odeJointGroup.I odeJointGroup.h + odeJoint.I odeJoint.h + odeUtil.h + odeSpace.I odeSpace.h + odeGeom.I odeGeom.h + odeSurfaceParameters.I odeSurfaceParameters.h + odeContactGeom.I odeContactGeom.h + odeContact.I odeContact.h + odeAMotorJoint.I odeAMotorJoint.h + odeBallJoint.I odeBallJoint.h + odeContactJoint.I odeContactJoint.h + odeFixedJoint.I odeFixedJoint.h + odeHingeJoint.I odeHingeJoint.h + odeHinge2Joint.I odeHinge2Joint.h + odeLMotorJoint.I odeLMotorJoint.h + odeNullJoint.I odeNullJoint.h + odePlane2dJoint.I odePlane2dJoint.h + odeSliderJoint.I odeSliderJoint.h + odeUniversalJoint.I odeUniversalJoint.h + odeJointCollection.I odeJointCollection.h + odeSimpleSpace.I odeSimpleSpace.h + odeHashSpace.I odeHashSpace.h + odeQuadTreeSpace.I odeQuadTreeSpace.h + odeSphereGeom.I odeSphereGeom.h + odeBoxGeom.I odeBoxGeom.h + odePlaneGeom.I odePlaneGeom.h + odeCappedCylinderGeom.I odeCappedCylinderGeom.h + odeCylinderGeom.I odeCylinderGeom.h + odeRayGeom.I odeRayGeom.h + odeTriMeshData.I odeTriMeshData.h + odeTriMeshGeom.I odeTriMeshGeom.h + odeCollisionEntry.I odeCollisionEntry.h + odeHelperStructs.h) + +set(P3ODE_SOURCES + config_ode.cxx + odeWorld.cxx odeMass.cxx odeBody.cxx + odeJointGroup.cxx odeJoint.cxx + odeUtil.cxx + odeSpace.cxx + odeGeom.cxx + odeSurfaceParameters.cxx + odeContactGeom.cxx odeContact.cxx + odeAMotorJoint.cxx odeBallJoint.cxx + odeContactJoint.cxx odeFixedJoint.cxx + odeHingeJoint.cxx odeHinge2Joint.cxx + odeLMotorJoint.cxx odeNullJoint.cxx + odePlane2dJoint.cxx odeSliderJoint.cxx + odeUniversalJoint.cxx odeJointCollection.cxx + odeSimpleSpace.cxx + odeHashSpace.cxx odeQuadTreeSpace.cxx + odeSphereGeom.cxx odeBoxGeom.cxx + odePlaneGeom.cxx odeCappedCylinderGeom.cxx + odeCylinderGeom.cxx odeRayGeom.cxx + odeTriMeshData.cxx odeTriMeshGeom.cxx + odeCollisionEntry.cxx) + +set(P3ODE_IGATEEXT + odeBody_ext.h + odeBody_ext.I + odeGeom_ext.cxx + odeGeom_ext.h + odeGeom_ext.I + odeJoint_ext.cxx + odeJoint_ext.h + odeSpace_ext.cxx + odeSpace_ext.h + odeSpace_ext.I + odeUtil_ext.cxx + odeUtil_ext.h) + +set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") +list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h") +list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHeightFieldGeom.h") +list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") + +composite_sources(p3ode P3ODE_SOURCES) +add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) +set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) +target_compile_definitions(p3ode PUBLIC dSINGLE) +target_link_libraries(p3ode panda) +target_use_packages(p3ode ODE) +target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) + +install(TARGETS p3ode DESTINATION lib) +install(FILES ${P3ODE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index ac03c9620d..0d6026e9dd 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -1,28 +1,30 @@ -if(APPLE AND HAVE_GL AND HAVE_CARBON) - set(P3OSXDISPLAY_HEADERS - config_osxdisplay.h - osxGraphicsPipe.h - osxGraphicsWindow.h osxGraphicsWindow.I - osxGraphicsStateGuardian.h) - - set(P3OSXDISPLAY_SOURCES - config_osxdisplay.cxx osxGraphicsPipe.cxx osxGraphicsStateGuardian.cxx - osxGraphicsBuffer.cxx) - - composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) - add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) - set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) - target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) - - # Frameworks: - find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) - find_library(CARBON_LIBRARY Carbon) - find_library(AGL_LIBRARY AGL) - find_library(CORESERVICES_LIBRARY CoreServices) - find_library(COCOA_LIBRARY Cocoa) - target_link_libraries(p3osxdisplay - ${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} - ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) - - install(TARGETS p3osxdisplay DESTINATION lib) +if(NOT APPLE OR NOT HAVE_GL OR NOT HAVE_CARBON) + return() endif() + +set(P3OSXDISPLAY_HEADERS + config_osxdisplay.h + osxGraphicsPipe.h + osxGraphicsWindow.h osxGraphicsWindow.I + osxGraphicsStateGuardian.h) + +set(P3OSXDISPLAY_SOURCES + config_osxdisplay.cxx osxGraphicsPipe.cxx osxGraphicsStateGuardian.cxx + osxGraphicsBuffer.cxx) + +composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) +add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) +set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) + +# Frameworks: +find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) +find_library(CARBON_LIBRARY Carbon) +find_library(AGL_LIBRARY AGL) +find_library(CORESERVICES_LIBRARY CoreServices) +find_library(COCOA_LIBRARY Cocoa) +target_link_libraries(p3osxdisplay + ${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} + ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) + +install(TARGETS p3osxdisplay DESTINATION lib) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 67713ae318..8d71405a12 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -1,26 +1,28 @@ -if(HAVE_FREETYPE) - set(P3PNMTEXT_HEADERS - config_pnmtext.h - freetypeFace.h freetypeFace.I - freetypeFont.h freetypeFont.I - pnmTextGlyph.h pnmTextGlyph.I - pnmTextMaker.h pnmTextMaker.I - ) - set(P3PNMTEXT_SOURCES - config_pnmtext.cxx - freetypeFace.cxx - freetypeFont.cxx - pnmTextGlyph.cxx - pnmTextMaker.cxx - ) - - composite_sources(p3pnmtext P3PNMTEXT_SOURCES) - add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT - ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) - target_link_libraries(p3pnmtext p3parametrics p3pnmimage) - target_use_packages(p3pnmtext FREETYPE) - target_interrogate(p3pnmtext ALL) - - install(TARGETS p3pnmtext DESTINATION lib) - install(FILES ${P3PNMTEXT_HEADERS} DESTINATION include/panda3d) +if(NOT HAVE_FREETYPE) + return() endif() + +set(P3PNMTEXT_HEADERS + config_pnmtext.h + freetypeFace.h freetypeFace.I + freetypeFont.h freetypeFont.I + pnmTextGlyph.h pnmTextGlyph.I + pnmTextMaker.h pnmTextMaker.I +) +set(P3PNMTEXT_SOURCES + config_pnmtext.cxx + freetypeFace.cxx + freetypeFont.cxx + pnmTextGlyph.cxx + pnmTextMaker.cxx +) + +composite_sources(p3pnmtext P3PNMTEXT_SOURCES) +add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT + ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) +target_link_libraries(p3pnmtext p3parametrics p3pnmimage) +target_use_packages(p3pnmtext FREETYPE) +target_interrogate(p3pnmtext ALL) + +install(TARGETS p3pnmtext DESTINATION lib) +install(FILES ${P3PNMTEXT_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index 0370beadab..147e4b784a 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -1,22 +1,24 @@ -if(HAVE_WGL) - set(P3WGLDISPLAY_HEADERS - config_wgldisplay.h - wglGraphicsBuffer.I wglGraphicsBuffer.h - wglGraphicsPipe.I wglGraphicsPipe.h - wglGraphicsStateGuardian.I wglGraphicsStateGuardian.h - wglGraphicsWindow.I wglGraphicsWindow.h - wglext.h) - - set(P3WGLDISPLAY_SOURCES - config_wgldisplay.cxx - wglGraphicsBuffer.cxx - wglGraphicsPipe.cxx - wglGraphicsStateGuardian.cxx - wglGraphicsWindow.cxx) - - - composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) - add_library(p3wgldisplay ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) - set_target_properties(p3wgldisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) - target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg) +if(NOT HAVE_WGL) + return() endif() + +set(P3WGLDISPLAY_HEADERS + config_wgldisplay.h + wglGraphicsBuffer.I wglGraphicsBuffer.h + wglGraphicsPipe.I wglGraphicsPipe.h + wglGraphicsStateGuardian.I wglGraphicsStateGuardian.h + wglGraphicsWindow.I wglGraphicsWindow.h + wglext.h) + +set(P3WGLDISPLAY_SOURCES + config_wgldisplay.cxx + wglGraphicsBuffer.cxx + wglGraphicsPipe.cxx + wglGraphicsStateGuardian.cxx + wglGraphicsWindow.cxx) + + +composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) +add_library(p3wgldisplay ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) +set_target_properties(p3wgldisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg) diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index 92c5748301..363330d7e9 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -1,18 +1,19 @@ -if(WIN32) - set(P3WINDISPLAY_HEADERS - config_windisplay.h - winGraphicsPipe.I winGraphicsPipe.h - winGraphicsWindow.I winGraphicsWindow.h - winDetectDx.h) - - set(P3WINDISPLAY_SOURCES - config_windisplay.cxx winGraphicsPipe.cxx - winGraphicsWindow.cxx - winDetectDx9.cxx) - - composite_sources(p3windisplay P3WINDISPLAY_SOURCES) - add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) - set_target_properties(p3windisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAWIN) - target_link_libraries(p3windisplay p3display p3putil - Imm32.lib) +if(NOT WIN32) + return() endif() + +set(P3WINDISPLAY_HEADERS + config_windisplay.h + winGraphicsPipe.I winGraphicsPipe.h + winGraphicsWindow.I winGraphicsWindow.h + winDetectDx.h) + +set(P3WINDISPLAY_SOURCES + config_windisplay.cxx winGraphicsPipe.cxx + winGraphicsWindow.cxx + winDetectDx9.cxx) + +composite_sources(p3windisplay P3WINDISPLAY_SOURCES) +add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) +set_target_properties(p3windisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAWIN) +target_link_libraries(p3windisplay p3display p3putil Imm32.lib) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 2351bbedf4..21ae14c02a 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -1,17 +1,19 @@ -if(HAVE_X11) - set(P3X11DISPLAY_HEADERS - config_x11display.h x11GraphicsPipe.I x11GraphicsPipe.h - x11GraphicsWindow.h x11GraphicsWindow.I - ) - - set(P3X11DISPLAY_SOURCES - config_x11display.cxx x11GraphicsPipe.cxx x11GraphicsWindow.cxx - ) - - composite_sources(p3x11display P3X11DISPLAY_SOURCES) - add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) - set_target_properties(p3x11display PROPERTIES DEFINE_SYMBOL BUILDING_PANDAX11) - target_link_libraries(p3x11display panda ${X11_LIBRARIES}) - - install(TARGETS p3x11display DESTINATION lib) +if(NOT HAVE_X11) + return() endif() + +set(P3X11DISPLAY_HEADERS + config_x11display.h x11GraphicsPipe.I x11GraphicsPipe.h + x11GraphicsWindow.h x11GraphicsWindow.I +) + +set(P3X11DISPLAY_SOURCES + config_x11display.cxx x11GraphicsPipe.cxx x11GraphicsWindow.cxx +) + +composite_sources(p3x11display P3X11DISPLAY_SOURCES) +add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) +set_target_properties(p3x11display PROPERTIES DEFINE_SYMBOL BUILDING_PANDAX11) +target_link_libraries(p3x11display panda ${X11_LIBRARIES}) + +install(TARGETS p3x11display DESTINATION lib) diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index 40561bd856..b976f805a4 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -1,38 +1,40 @@ -if(HAVE_GTK2 AND HAVE_NET) - set(GTKSTATS_HEADERS - gtkStatsChartMenu.h - gtkStatsGraph.h - gtkStatsLabel.h - gtkStatsLabelStack.h - gtkStatsMenuId.h - gtkStatsMonitor.h gtkStatsMonitor.I - gtkStatsPianoRoll.h - gtkStatsServer.h - gtkStatsStripChart.h) - - set(GTKSTATS_SOURCES - gtkStats.cxx - gtkStatsChartMenu.cxx - gtkStatsGraph.cxx - gtkStatsLabel.cxx - gtkStatsLabelStack.cxx - gtkStatsMonitor.cxx - gtkStatsPianoRoll.cxx - gtkStatsServer.cxx - gtkStatsStripChart.cxx) - - composite_sources(gtkstats GTKSTATS_SOURCES) - add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) - target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub) - target_use_packages(gtkstats GTK2) - - # This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and - # pstats everywhere else (as the Win32 GUI is not built). - if(WIN32) - set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats-gtk") - else() - set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats") - endif() - - install(TARGETS gtkstats DESTINATION bin) +if(NOT HAVE_GTK2 OR NOT HAVE_NET) + return() endif() + +set(GTKSTATS_HEADERS + gtkStatsChartMenu.h + gtkStatsGraph.h + gtkStatsLabel.h + gtkStatsLabelStack.h + gtkStatsMenuId.h + gtkStatsMonitor.h gtkStatsMonitor.I + gtkStatsPianoRoll.h + gtkStatsServer.h + gtkStatsStripChart.h) + +set(GTKSTATS_SOURCES + gtkStats.cxx + gtkStatsChartMenu.cxx + gtkStatsGraph.cxx + gtkStatsLabel.cxx + gtkStatsLabelStack.cxx + gtkStatsMonitor.cxx + gtkStatsPianoRoll.cxx + gtkStatsServer.cxx + gtkStatsStripChart.cxx) + +composite_sources(gtkstats GTKSTATS_SOURCES) +add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) +target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub) +target_use_packages(gtkstats GTK2) + +# This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and +# pstats everywhere else (as the Win32 GUI is not built). +if(WIN32) + set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats-gtk") +else() + set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats") +endif() + +install(TARGETS gtkstats DESTINATION bin) diff --git a/pandatool/src/pstatserver/CMakeLists.txt b/pandatool/src/pstatserver/CMakeLists.txt index a907785f91..d133fd0763 100644 --- a/pandatool/src/pstatserver/CMakeLists.txt +++ b/pandatool/src/pstatserver/CMakeLists.txt @@ -1,26 +1,28 @@ -if(HAVE_NET) - set(P3PSTATSERVER_HEADERS - pStatClientData.h pStatGraph.I - pStatGraph.h pStatListener.h pStatMonitor.I - pStatMonitor.h pStatPianoRoll.I - pStatPianoRoll.h pStatReader.h - pStatServer.h pStatStripChart.I - pStatStripChart.h pStatThreadData.I - pStatThreadData.h pStatView.I pStatView.h - pStatViewLevel.I pStatViewLevel.h) - - set(P3PSTATSERVER_SOURCES - pStatClientData.cxx pStatGraph.cxx - pStatListener.cxx - pStatMonitor.cxx pStatPianoRoll.cxx - pStatReader.cxx pStatServer.cxx - pStatStripChart.cxx pStatThreadData.cxx - pStatView.cxx pStatViewLevel.cxx) - - composite_sources(p3pstatserver P3PSTATSERVER_SOURCES) - add_library(p3pstatserver STATIC ${P3PSTATSERVER_HEADERS} ${P3PSTATSERVER_SOURCES}) - target_link_libraries(p3pstatserver p3pandatoolbase panda) - - # This is only needed for binaries in the pandatool package. It is not useful - # for user applications, so it is not installed. +if(NOT HAVE_NET) + return() endif() + +set(P3PSTATSERVER_HEADERS + pStatClientData.h pStatGraph.I + pStatGraph.h pStatListener.h pStatMonitor.I + pStatMonitor.h pStatPianoRoll.I + pStatPianoRoll.h pStatReader.h + pStatServer.h pStatStripChart.I + pStatStripChart.h pStatThreadData.I + pStatThreadData.h pStatView.I pStatView.h + pStatViewLevel.I pStatViewLevel.h) + +set(P3PSTATSERVER_SOURCES + pStatClientData.cxx pStatGraph.cxx + pStatListener.cxx + pStatMonitor.cxx pStatPianoRoll.cxx + pStatReader.cxx pStatServer.cxx + pStatStripChart.cxx pStatThreadData.cxx + pStatView.cxx pStatViewLevel.cxx) + +composite_sources(p3pstatserver P3PSTATSERVER_SOURCES) +add_library(p3pstatserver STATIC ${P3PSTATSERVER_HEADERS} ${P3PSTATSERVER_SOURCES}) +target_link_libraries(p3pstatserver p3pandatoolbase panda) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. From 95785407a38f70485255fa1e7523f67eefe089f9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 02:30:04 -0600 Subject: [PATCH 415/744] CMake: General whitespace fixes - Remove trailing whitespace from ends of lines - Convert tabs to (two) spaces --- dtool/src/cppparser/CMakeLists.txt | 62 ++++++------- dtool/src/dconfig/CMakeLists.txt | 4 +- dtool/src/interrogate/CMakeLists.txt | 98 ++++++++++----------- dtool/src/interrogatedb/CMakeLists.txt | 68 +++++++-------- dtool/src/prc/CMakeLists.txt | 116 ++++++++++++------------- panda/src/char/CMakeLists.txt | 4 +- panda/src/display/CMakeLists.txt | 6 +- panda/src/event/CMakeLists.txt | 4 +- panda/src/pnmimage/CMakeLists.txt | 8 +- panda/src/putil/CMakeLists.txt | 2 +- panda/src/text/CMakeLists.txt | 1 + pandatool/src/fltegg/CMakeLists.txt | 2 +- pandatool/src/progbase/CMakeLists.txt | 4 +- 13 files changed, 190 insertions(+), 189 deletions(-) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index da649eaed5..6227ef8f12 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -1,40 +1,40 @@ add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) set(P3CPPPARSER_HEADERS - cppArrayType.h cppBison.yxx cppBisonDefs.h - cppClassTemplateParameter.h cppCommentBlock.h - cppClosureType.h cppConstType.h - cppDeclaration.h cppEnumType.h cppExpression.h - cppExpressionParser.h cppExtensionType.h cppFile.h - cppFunctionGroup.h cppFunctionType.h cppGlobals.h - cppIdentifier.h cppInstance.h cppInstanceIdentifier.h - cppMakeProperty.h cppMakeSeq.h cppManifest.h - cppNameComponent.h cppNamespace.h - cppParameterList.h cppParser.h cppPointerType.h - cppPreprocessor.h cppReferenceType.h cppScope.h - cppSimpleType.h cppStructType.h cppTBDType.h - cppTemplateParameterList.h cppTemplateScope.h cppToken.h - cppType.h cppTypeDeclaration.h cppTypeParser.h - cppTypeProxy.h cppTypedefType.h cppUsing.h cppVisibility.h + cppArrayType.h cppBison.yxx cppBisonDefs.h + cppClassTemplateParameter.h cppCommentBlock.h + cppClosureType.h cppConstType.h + cppDeclaration.h cppEnumType.h cppExpression.h + cppExpressionParser.h cppExtensionType.h cppFile.h + cppFunctionGroup.h cppFunctionType.h cppGlobals.h + cppIdentifier.h cppInstance.h cppInstanceIdentifier.h + cppMakeProperty.h cppMakeSeq.h cppManifest.h + cppNameComponent.h cppNamespace.h + cppParameterList.h cppParser.h cppPointerType.h + cppPreprocessor.h cppReferenceType.h cppScope.h + cppSimpleType.h cppStructType.h cppTBDType.h + cppTemplateParameterList.h cppTemplateScope.h cppToken.h + cppType.h cppTypeDeclaration.h cppTypeParser.h + cppTypeProxy.h cppTypedefType.h cppUsing.h cppVisibility.h ) set(P3CPPPARSER_SOURCES - cppArrayType.cxx ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx - cppClassTemplateParameter.cxx - cppCommentBlock.cxx cppClosureType.cxx cppConstType.cxx cppDeclaration.cxx - cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx - cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx - cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx - cppInstance.cxx cppInstanceIdentifier.cxx - cppMakeProperty.cxx cppMakeSeq.cxx cppManifest.cxx - cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx - cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx - cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx - cppStructType.cxx cppTBDType.cxx - cppTemplateParameterList.cxx cppTemplateScope.cxx - cppToken.cxx cppType.cxx cppTypeDeclaration.cxx - cppTypeParser.cxx cppTypeProxy.cxx cppTypedefType.cxx - cppUsing.cxx cppVisibility.cxx + cppArrayType.cxx ${CMAKE_CURRENT_BINARY_DIR}/cppBison.cxx + cppClassTemplateParameter.cxx + cppCommentBlock.cxx cppClosureType.cxx cppConstType.cxx cppDeclaration.cxx + cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx + cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx + cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx + cppInstance.cxx cppInstanceIdentifier.cxx + cppMakeProperty.cxx cppMakeSeq.cxx cppManifest.cxx + cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx + cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx + cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx + cppStructType.cxx cppTBDType.cxx + cppTemplateParameterList.cxx cppTemplateScope.cxx + cppToken.cxx cppType.cxx cppTypeDeclaration.cxx + cppTypeParser.cxx cppTypeProxy.cxx cppTypedefType.cxx + cppUsing.cxx cppVisibility.cxx ) composite_sources(p3cppParser P3CPPPARSER_SOURCES) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 445692204f..3b895a13af 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -1,8 +1,8 @@ set(P3DCONFIG_HEADERS - config_dconfig.h dconfig.I dconfig.h) + config_dconfig.h dconfig.I dconfig.h) set(P3DCONFIG_SOURCES - config_dconfig.cxx dconfig.cxx) + config_dconfig.cxx dconfig.cxx) composite_sources(p3dconfig P3DCONFIG_SOURCES) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 81c213dbdb..79f7b91c20 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -1,62 +1,62 @@ set(INTERROGATE_HEADERS - functionRemap.h - functionWriter.h - functionWriterPtrFromPython.h functionWriterPtrToPython.h - functionWriters.h - interfaceMaker.h - interfaceMakerC.h - interfaceMakerPython.h interfaceMakerPythonObj.h - interfaceMakerPythonSimple.h - interfaceMakerPythonNative.h - interrogate.h interrogateBuilder.h parameterRemap.I - parameterRemap.h - parameterRemapBasicStringPtrToString.h - parameterRemapBasicStringRefToString.h - parameterRemapBasicStringToString.h - parameterRemapCharStarToString.h - parameterRemapConcreteToPointer.h - parameterRemapConstToNonConst.h parameterRemapEnumToInt.h - parameterRemapPTToPointer.h - parameterRemapReferenceToConcrete.h - parameterRemapReferenceToPointer.h parameterRemapThis.h - parameterRemapToString.h - parameterRemapHandleToInt.h - parameterRemapUnchanged.h - typeManager.h) + functionRemap.h + functionWriter.h + functionWriterPtrFromPython.h functionWriterPtrToPython.h + functionWriters.h + interfaceMaker.h + interfaceMakerC.h + interfaceMakerPython.h interfaceMakerPythonObj.h + interfaceMakerPythonSimple.h + interfaceMakerPythonNative.h + interrogate.h interrogateBuilder.h parameterRemap.I + parameterRemap.h + parameterRemapBasicStringPtrToString.h + parameterRemapBasicStringRefToString.h + parameterRemapBasicStringToString.h + parameterRemapCharStarToString.h + parameterRemapConcreteToPointer.h + parameterRemapConstToNonConst.h parameterRemapEnumToInt.h + parameterRemapPTToPointer.h + parameterRemapReferenceToConcrete.h + parameterRemapReferenceToPointer.h parameterRemapThis.h + parameterRemapToString.h + parameterRemapHandleToInt.h + parameterRemapUnchanged.h + typeManager.h) set(INTERROGATE_SOURCES - functionRemap.cxx - functionWriter.cxx - functionWriterPtrFromPython.cxx functionWriterPtrToPython.cxx - functionWriters.cxx - interfaceMaker.cxx - interfaceMakerC.cxx - interfaceMakerPython.cxx interfaceMakerPythonObj.cxx - interfaceMakerPythonSimple.cxx - interfaceMakerPythonNative.cxx - interrogate.cxx interrogateBuilder.cxx parameterRemap.cxx - parameterRemapBasicStringPtrToString.cxx - parameterRemapBasicStringRefToString.cxx - parameterRemapBasicStringToString.cxx - parameterRemapCharStarToString.cxx - parameterRemapConcreteToPointer.cxx - parameterRemapConstToNonConst.cxx - parameterRemapEnumToInt.cxx parameterRemapPTToPointer.cxx - parameterRemapReferenceToConcrete.cxx - parameterRemapReferenceToPointer.cxx parameterRemapThis.cxx - parameterRemapToString.cxx - parameterRemapHandleToInt.cxx - parameterRemapUnchanged.cxx - typeManager.cxx) + functionRemap.cxx + functionWriter.cxx + functionWriterPtrFromPython.cxx functionWriterPtrToPython.cxx + functionWriters.cxx + interfaceMaker.cxx + interfaceMakerC.cxx + interfaceMakerPython.cxx interfaceMakerPythonObj.cxx + interfaceMakerPythonSimple.cxx + interfaceMakerPythonNative.cxx + interrogate.cxx interrogateBuilder.cxx parameterRemap.cxx + parameterRemapBasicStringPtrToString.cxx + parameterRemapBasicStringRefToString.cxx + parameterRemapBasicStringToString.cxx + parameterRemapCharStarToString.cxx + parameterRemapConcreteToPointer.cxx + parameterRemapConstToNonConst.cxx + parameterRemapEnumToInt.cxx parameterRemapPTToPointer.cxx + parameterRemapReferenceToConcrete.cxx + parameterRemapReferenceToPointer.cxx parameterRemapThis.cxx + parameterRemapToString.cxx + parameterRemapHandleToInt.cxx + parameterRemapUnchanged.cxx + typeManager.cxx) composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate - p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) + p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module - p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) + p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) install(TARGETS interrogate_module DESTINATION bin) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index ebad56ecab..ef1b7fe25f 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -1,44 +1,44 @@ set(P3INTERROGATEDB_HEADERS - config_interrogatedb.h indexRemapper.h interrogateComponent.I - interrogateComponent.h interrogateDatabase.I - interrogateDatabase.h interrogateElement.I - interrogateElement.h interrogateFunction.I - interrogateFunction.h interrogateFunctionWrapper.I - interrogateFunctionWrapper.h - interrogateMakeSeq.I interrogateMakeSeq.h - interrogateManifest.I interrogateManifest.h - interrogateType.I interrogateType.h - interrogate_datafile.I interrogate_datafile.h - interrogate_interface.h interrogate_request.h - extension.h py_compat.h py_panda.h py_wrappers.h) + config_interrogatedb.h indexRemapper.h interrogateComponent.I + interrogateComponent.h interrogateDatabase.I + interrogateDatabase.h interrogateElement.I + interrogateElement.h interrogateFunction.I + interrogateFunction.h interrogateFunctionWrapper.I + interrogateFunctionWrapper.h + interrogateMakeSeq.I interrogateMakeSeq.h + interrogateManifest.I interrogateManifest.h + interrogateType.I interrogateType.h + interrogate_datafile.I interrogate_datafile.h + interrogate_interface.h interrogate_request.h + extension.h py_compat.h py_panda.h py_wrappers.h) set(P3INTERROGATEDB_SOURCES - config_interrogatedb.cxx - dtool_super_base.cxx - indexRemapper.cxx - interrogateComponent.cxx interrogateDatabase.cxx - interrogateElement.cxx interrogateFunction.cxx - interrogateFunctionWrapper.cxx - interrogateMakeSeq.cxx - interrogateManifest.cxx - interrogateType.cxx interrogate_datafile.cxx - interrogate_interface.cxx interrogate_request.cxx - py_compat.cxx - py_panda.cxx - py_wrappers.cxx) + config_interrogatedb.cxx + dtool_super_base.cxx + indexRemapper.cxx + interrogateComponent.cxx interrogateDatabase.cxx + interrogateElement.cxx interrogateFunction.cxx + interrogateFunctionWrapper.cxx + interrogateMakeSeq.cxx + interrogateManifest.cxx + interrogateType.cxx interrogate_datafile.cxx + interrogate_interface.cxx interrogate_request.cxx + py_compat.cxx + py_panda.cxx + py_wrappers.cxx) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) set(P3INTERROGATEDB_IGATE_SOURCES - config_interrogatedb.cxx - indexRemapper.cxx - interrogateComponent.cxx interrogateDatabase.cxx - interrogateElement.cxx interrogateFunction.cxx - interrogateFunctionWrapper.cxx - interrogateMakeSeq.cxx - interrogateManifest.cxx - interrogateType.cxx interrogate_datafile.cxx - interrogate_interface.cxx interrogate_request.cxx) + config_interrogatedb.cxx + indexRemapper.cxx + interrogateComponent.cxx interrogateDatabase.cxx + interrogateElement.cxx interrogateFunction.cxx + interrogateFunctionWrapper.cxx + interrogateMakeSeq.cxx + interrogateManifest.cxx + interrogateType.cxx interrogate_datafile.cxx + interrogate_interface.cxx interrogate_request.cxx) add_component_library(p3interrogatedb SYMBOL SYMBOL BUILDING_INTERROGATEDB ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 0c6641ecee..afe1745af5 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -1,66 +1,66 @@ configure_file(prc_parameters.h.in prc_parameters.h) set(P3PRC_HEADERS - bigEndian.h - config_prc.h - configDeclaration.I configDeclaration.h - configFlags.I configFlags.h - configPage.I configPage.h - configPageManager.I configPageManager.h - configVariable.I configVariable.h - configVariableBase.I configVariableBase.h - configVariableBool.I configVariableBool.h - configVariableCore.I configVariableCore.h - configVariableDouble.I configVariableDouble.h - configVariableEnum.I configVariableEnum.h - configVariableFilename.I configVariableFilename.h - configVariableInt.I configVariableInt.h - configVariableInt64.I configVariableInt64.h - configVariableList.I configVariableList.h - configVariableManager.I configVariableManager.h - configVariableSearchPath.I configVariableSearchPath.h - configVariableString.I configVariableString.h - encryptStreamBuf.h encryptStreamBuf.I encryptStream.h encryptStream.I - littleEndian.h - nativeNumericData.I nativeNumericData.h - pnotify.I pnotify.h - notifyCategory.I notifyCategory.h - notifyCategoryProxy.I notifyCategoryProxy.h - notifySeverity.h - prcKeyRegistry.h - reversedNumericData.I reversedNumericData.h - streamReader.I streamReader.h - streamWrapper.I streamWrapper.h - streamWriter.I streamWriter.h - ${CMAKE_CURRENT_BINARY_DIR}/prc_parameters.h) + bigEndian.h + config_prc.h + configDeclaration.I configDeclaration.h + configFlags.I configFlags.h + configPage.I configPage.h + configPageManager.I configPageManager.h + configVariable.I configVariable.h + configVariableBase.I configVariableBase.h + configVariableBool.I configVariableBool.h + configVariableCore.I configVariableCore.h + configVariableDouble.I configVariableDouble.h + configVariableEnum.I configVariableEnum.h + configVariableFilename.I configVariableFilename.h + configVariableInt.I configVariableInt.h + configVariableInt64.I configVariableInt64.h + configVariableList.I configVariableList.h + configVariableManager.I configVariableManager.h + configVariableSearchPath.I configVariableSearchPath.h + configVariableString.I configVariableString.h + encryptStreamBuf.h encryptStreamBuf.I encryptStream.h encryptStream.I + littleEndian.h + nativeNumericData.I nativeNumericData.h + pnotify.I pnotify.h + notifyCategory.I notifyCategory.h + notifyCategoryProxy.I notifyCategoryProxy.h + notifySeverity.h + prcKeyRegistry.h + reversedNumericData.I reversedNumericData.h + streamReader.I streamReader.h + streamWrapper.I streamWrapper.h + streamWriter.I streamWriter.h + ${CMAKE_CURRENT_BINARY_DIR}/prc_parameters.h) set(P3PRC_SOURCES - config_prc.cxx - configDeclaration.cxx - configFlags.cxx - configPage.cxx - configPageManager.cxx - configVariable.cxx - configVariableBase.cxx - configVariableBool.cxx - configVariableCore.cxx - configVariableDouble.cxx - configVariableEnum.cxx - configVariableFilename.cxx - configVariableInt.cxx - configVariableInt64.cxx - configVariableList.cxx - configVariableManager.cxx - configVariableSearchPath.cxx - configVariableString.cxx - encryptStreamBuf.cxx encryptStream.cxx - nativeNumericData.cxx - notify.cxx - notifyCategory.cxx - notifySeverity.cxx - prcKeyRegistry.cxx - reversedNumericData.cxx - streamReader.cxx streamWrapper.cxx streamWriter.cxx) + config_prc.cxx + configDeclaration.cxx + configFlags.cxx + configPage.cxx + configPageManager.cxx + configVariable.cxx + configVariableBase.cxx + configVariableBool.cxx + configVariableCore.cxx + configVariableDouble.cxx + configVariableEnum.cxx + configVariableFilename.cxx + configVariableInt.cxx + configVariableInt64.cxx + configVariableList.cxx + configVariableManager.cxx + configVariableSearchPath.cxx + configVariableString.cxx + encryptStreamBuf.cxx encryptStream.cxx + nativeNumericData.cxx + notify.cxx + notifyCategory.cxx + notifySeverity.cxx + prcKeyRegistry.cxx + reversedNumericData.cxx + streamReader.cxx streamWrapper.cxx streamWriter.cxx) set(P3PRC_IGATEEXT streamReader_ext.cxx diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index f6ca731bc2..7e62194281 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -10,11 +10,11 @@ set(P3CHAR_HEADERS ) set(P3CHAR_SOURCES character.cxx - characterJoint.cxx characterJointBundle.cxx + characterJoint.cxx characterJointBundle.cxx characterJointEffect.cxx characterSlider.cxx characterVertexSlider.cxx - config_char.cxx + config_char.cxx jointVertexTransform.cxx ) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 38e764b3d1..3f7fb00253 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -49,9 +49,9 @@ set(P3DISPLAY_SOURCES graphicsBuffer.cxx graphicsPipe.cxx graphicsPipeSelection.cxx - graphicsStateGuardian.cxx + graphicsStateGuardian.cxx graphicsThreadingModel.cxx - graphicsWindow.cxx graphicsWindowInputDevice.cxx + graphicsWindow.cxx graphicsWindowInputDevice.cxx graphicsWindowProc.cxx graphicsWindowProcCallbackData.cxx graphicsDevice.cxx @@ -97,7 +97,7 @@ install(FILES ${P3DISPLAY_HEADERS} DESTINATION include/panda3d) if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) # We build a static library of just these files, so the plugin can - # link with it in direct/src/plugin, without pulling in the rest of + # link with it in direct/src/plugin, without pulling in the rest of # Panda. add_library(p3subprocbuffer subprocessWindowBuffer.h diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 2aee7f4251..1352d40b2a 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -15,7 +15,7 @@ set(P3EVENT_HEADERS event.I event.h eventHandler.h eventHandler.I eventParameter.I eventParameter.h eventQueue.I eventQueue.h eventReceiver.h - pt_Event.h throw_event.I throw_event.h + pt_Event.h throw_event.I throw_event.h ) set(P3EVENT_SOURCES @@ -31,7 +31,7 @@ set(P3EVENT_SOURCES genericAsyncTask.cxx pointerEvent.cxx pointerEventList.cxx - config_event.cxx event.cxx eventHandler.cxx + config_event.cxx event.cxx eventHandler.cxx eventParameter.cxx eventQueue.cxx eventReceiver.cxx pt_Event.cxx ) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 857ad79050..c78cb1dfe8 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -3,8 +3,8 @@ set(P3PNMIMAGE_HEADERS pfmFile.I pfmFile.h pnmbitio.h pnmBrush.h pnmBrush.I - pnmFileType.h pnmFileTypeRegistry.h pnmImage.I - pnmImage.h pnmImageHeader.I pnmImageHeader.h + pnmFileType.h pnmFileTypeRegistry.h pnmImage.I + pnmImage.h pnmImageHeader.I pnmImageHeader.h pnmPainter.h pnmPainter.I pnmReader.I pnmReader.h pnmWriter.I pnmWriter.h pnmimage_base.h @@ -18,8 +18,8 @@ set(P3PNMIMAGE_SOURCES pnm-image-filter.cxx pnmbitio.cxx pnmBrush.cxx - pnmFileType.cxx - pnmFileTypeRegistry.cxx pnmImage.cxx pnmImageHeader.cxx + pnmFileType.cxx + pnmFileTypeRegistry.cxx pnmImage.cxx pnmImageHeader.cxx pnmPainter.cxx pnmReader.cxx pnmWriter.cxx pnmimage_base.cxx ppmcmap.cxx diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 38cf0b8530..412706e273 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -61,7 +61,7 @@ set(P3PUTIL_HEADERS vector_typedWritable.h vector_ushort.h vector_writable.h writableConfigurable.h - writableParam.I writableParam.h + writableParam.I writableParam.h ) set(P3PUTIL_SOURCES diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 37bceb02a4..42378c1967 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -15,6 +15,7 @@ set(P3TEXT_HEADERS textProperties.I textProperties.h textPropertiesManager.I textPropertiesManager.h ) + set(P3TEXT_SOURCES config_text.cxx default_font.cxx diff --git a/pandatool/src/fltegg/CMakeLists.txt b/pandatool/src/fltegg/CMakeLists.txt index c68bfca000..94101320c0 100644 --- a/pandatool/src/fltegg/CMakeLists.txt +++ b/pandatool/src/fltegg/CMakeLists.txt @@ -1,7 +1,7 @@ set(P3FLTEGG_HEADERS fltToEggConverter.I fltToEggConverter.h fltToEggLevelState.I fltToEggLevelState.h) - + set(P3FLTEGG_SOURCES fltToEggConverter.cxx fltToEggLevelState.cxx) diff --git a/pandatool/src/progbase/CMakeLists.txt b/pandatool/src/progbase/CMakeLists.txt index 831a9bd936..44bb8b80b2 100644 --- a/pandatool/src/progbase/CMakeLists.txt +++ b/pandatool/src/progbase/CMakeLists.txt @@ -3,10 +3,10 @@ set(P3PROGBASE_HEADERS withOutputFile.I withOutputFile.h wordWrapStream.h wordWrapStreamBuf.I wordWrapStreamBuf.h) - + set(P3PROGBASE_SOURCES programBase.cxx withOutputFile.cxx wordWrapStream.cxx - wordWrapStreamBuf.cxx) + wordWrapStreamBuf.cxx) composite_sources(p3progbase P3PROGBASE_SOURCES) add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) From cca5b910dcf287100f1fe5d13c9a11fc516e0cea Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 02:32:22 -0600 Subject: [PATCH 416/744] travis: Correct version of Python 3 in use Travis-CI environment only has Python 3.4 available, not 3.5. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 942613ceca..2d7a909d97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ before_install: - makepanda/selfdestruct.py --yes install: -- ${PYTHON_INTERP:-python3.5} -m virtualenv venv && source venv/bin/activate +- ${PYTHON_INTERP:-python3.4} -m virtualenv venv && source venv/bin/activate - pip install pytest before_script: From 5f0a390b8f78f096a2623356a9b51fb8d227bb85 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 20 Apr 2018 03:22:45 -0600 Subject: [PATCH 417/744] travis: Always use system 'virtualenv' command for venvs --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2d7a909d97..8b6d27f3d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -50,7 +50,7 @@ before_install: - makepanda/selfdestruct.py --yes install: -- ${PYTHON_INTERP:-python3.4} -m virtualenv venv && source venv/bin/activate +- virtualenv --python=${PYTHON_INTERP:-python3.4} venv && source venv/bin/activate - pip install pytest before_script: From d2d5e3014cdb6371edad28bc6e0d372987ac7f9a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 14 May 2018 14:49:36 -0600 Subject: [PATCH 418/744] CMake: Generate, don't use, pydtool.cxx --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 25 +++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 7a22c6fbf4..2c056e30f4 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -12,8 +12,29 @@ else() set(libtype STATIC) endif() -if(HAVE_PYTHON) - add_library(interrogatedb ${libtype} pydtool.cxx) +if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE) + set(INTERROGATEDB_IGATE + ../../src/interrogatedb/interrogate_interface.h + ../../src/interrogatedb/interrogate_request.h + ) + + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" + COMMAND interrogate + -D EXPCL_INTERROGATEDB= + -nodb -python -promiscuous + -module panda3d.interrogatedb + -library interrogatedb + -string -true-names -do-module + -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" + -oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" + ${INTERROGATEDB_IGATE} + DEPENDS interrogate ${INTERROGATEDB_IGATE} + COMMENT "Interrogating interrogatedb" + ) + + add_library(interrogatedb ${libtype} + "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") target_use_packages(interrogatedb PYTHON) target_link_libraries(interrogatedb p3dtoolconfig) From 8e230495a102119bf3614bc4fd81114067d8b73e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 14 May 2018 14:54:12 -0600 Subject: [PATCH 419/744] CMake: Consolidate "module or static" library logic --- cmake/macros/Interrogate.cmake | 8 ++------ dtool/LocalSetup.cmake | 5 +++++ dtool/metalibs/dtoolconfig/CMakeLists.txt | 8 +------- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 1082865f61..4a17555399 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -237,7 +237,7 @@ endfunction(interrogate_sources) # Python module when it's initialized. # function(add_python_module module) - if(INTERROGATE_PYTHON_INTERFACE) + if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE) set(targets) set(link_targets) set(import_flags) @@ -286,11 +286,7 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - if(BUILD_SHARED_LIBS) - add_library(${module} MODULE "${module}_module.cxx" ${sources}) - else() - add_library(${module} STATIC "${module}_module.cxx" ${sources}) - endif() + add_library(${module} ${MODULE_TYPE} "${module}_module.cxx" ${sources}) target_link_libraries(${module} ${link_targets} ${PYTHON_LIBRARIES} p3dtool) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 134c47f153..c671ec7080 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -180,10 +180,15 @@ check_cxx_compiler_flag(-msse2 HAVE_SSE2) #$[cdefine __USE_LARGEFILE64] # Set LINK_ALL_STATIC if we're building everything as static libraries. +# Also set the library type used for "modules" appropriately. if(BUILD_SHARED_LIBS) set(LINK_ALL_STATIC OFF) + set(MODULE_TYPE "MODULE" + CACHE INTERNAL "" FORCE) else() set(LINK_ALL_STATIC ON) + set(MODULE_TYPE "STATIC" + CACHE INTERNAL "" FORCE) endif() # Now go through all the packages and report whether we have them. diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 2c056e30f4..f9417224b3 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -6,12 +6,6 @@ install(TARGETS p3dtoolconfig DESTINATION lib) # Next, panda3d.interrogatedb: -if(BUILD_SHARED_LIBS) - set(libtype MODULE) -else() - set(libtype STATIC) -endif() - if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE) set(INTERROGATEDB_IGATE ../../src/interrogatedb/interrogate_interface.h @@ -33,7 +27,7 @@ if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE) COMMENT "Interrogating interrogatedb" ) - add_library(interrogatedb ${libtype} + add_library(interrogatedb ${MODULE_TYPE} "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") target_use_packages(interrogatedb PYTHON) target_link_libraries(interrogatedb p3dtoolconfig) From 538c615abebb9a71c0ce8c568a1fdf25a8047511 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 14 May 2018 17:54:56 -0600 Subject: [PATCH 420/744] CMake: Light tidying in Interrogate.cmake --- cmake/macros/Interrogate.cmake | 132 +++++++++++++++++---------------- 1 file changed, 67 insertions(+), 65 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 4a17555399..55fcee0ed0 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -237,72 +237,74 @@ endfunction(interrogate_sources) # Python module when it's initialized. # function(add_python_module module) - if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE) - set(targets) - set(link_targets) - set(import_flags) - set(infiles) - set(sources) - - set(link_keyword OFF) - set(import_keyword OFF) - foreach(arg ${ARGN}) - if(arg STREQUAL "LINK") - set(link_keyword ON) - set(import_keyword OFF) - elseif(arg STREQUAL "IMPORT") - set(link_keyword OFF) - set(import_keyword ON) - elseif(link_keyword) - list(APPEND link_targets "${arg}") - elseif(import_keyword) - list(APPEND import_flags "-import" "${arg}") - else() - list(APPEND targets "${arg}") - endif() - endforeach(arg) - - if(NOT link_targets) - set(link_targets ${targets}) - endif() - - foreach(target ${targets}) - interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" - "-python-native;-module;panda3d.${module}") - get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) - list(APPEND infiles "${target}.in") - list(APPEND sources "${target}_igate.cxx" ${target_extensions}) - endforeach(target) - - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" - COMMAND interrogate_module - -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" - -module ${module} -library ${module} - ${import_flags} - ${INTERROGATE_MODULE_OPTIONS} - ${IMOD_FLAGS} ${infiles} - DEPENDS interrogate_module ${infiles} - COMMENT "Generating module ${module}" - ) - - add_library(${module} ${MODULE_TYPE} "${module}_module.cxx" ${sources}) - target_link_libraries(${module} - ${link_targets} ${PYTHON_LIBRARIES} p3dtool) - - set_target_properties(${module} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - PREFIX "" - ) - if(WIN32 AND NOT CYGWIN) - set_target_properties(${module} PROPERTIES SUFFIX ".pyd") - endif() - - install(TARGETS ${module} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") - - list(APPEND ALL_INTERROGATE_MODULES "${module}") - set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") + if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE) + return() endif() + + set(targets) + set(link_targets) + set(import_flags) + set(infiles) + set(sources) + + set(link_keyword OFF) + set(import_keyword OFF) + foreach(arg ${ARGN}) + if(arg STREQUAL "LINK") + set(link_keyword ON) + set(import_keyword OFF) + elseif(arg STREQUAL "IMPORT") + set(link_keyword OFF) + set(import_keyword ON) + elseif(link_keyword) + list(APPEND link_targets "${arg}") + elseif(import_keyword) + list(APPEND import_flags "-import" "${arg}") + else() + list(APPEND targets "${arg}") + endif() + endforeach(arg) + + if(NOT link_targets) + set(link_targets ${targets}) + endif() + + foreach(target ${targets}) + interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" + "-python-native;-module;panda3d.${module}") + get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) + list(APPEND infiles "${target}.in") + list(APPEND sources "${target}_igate.cxx" ${target_extensions}) + endforeach(target) + + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" + COMMAND interrogate_module + -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" + -module ${module} -library ${module} + ${import_flags} + ${INTERROGATE_MODULE_OPTIONS} + ${IMOD_FLAGS} ${infiles} + DEPENDS interrogate_module ${infiles} + COMMENT "Generating module ${module}" + ) + + add_library(${module} ${MODULE_TYPE} "${module}_module.cxx" ${sources}) + target_link_libraries(${module} + ${link_targets} ${PYTHON_LIBRARIES} p3dtool) + + set_target_properties(${module} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + PREFIX "" + ) + if(WIN32 AND NOT CYGWIN) + set_target_properties(${module} PROPERTIES SUFFIX ".pyd") + endif() + + install(TARGETS ${module} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + + list(APPEND ALL_INTERROGATE_MODULES "${module}") + set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endfunction(add_python_module) From aeeabdbd3b418577d7bd774c2ee533075b0d2091 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 14 May 2018 17:55:47 -0600 Subject: [PATCH 421/744] CMake: Move interrogatedb interrogation to p3interrogatedb --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 39 ----------------- dtool/src/interrogatedb/CMakeLists.txt | 53 ++++++++++++++++++----- 2 files changed, 41 insertions(+), 51 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index f9417224b3..33dc2922da 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,42 +1,3 @@ -# First, dtoolconfig: - set(DTOOLCONFIG_LINK_TARGETS p3prc p3dconfig p3interrogatedb) add_metalib(p3dtoolconfig dtoolconfig.cxx COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) install(TARGETS p3dtoolconfig DESTINATION lib) - -# Next, panda3d.interrogatedb: - -if(HAVE_PYTHON AND INTERROGATE_PYTHON_INTERFACE) - set(INTERROGATEDB_IGATE - ../../src/interrogatedb/interrogate_interface.h - ../../src/interrogatedb/interrogate_request.h - ) - - add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" - COMMAND interrogate - -D EXPCL_INTERROGATEDB= - -nodb -python -promiscuous - -module panda3d.interrogatedb - -library interrogatedb - -string -true-names -do-module - -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" - -oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" - ${INTERROGATEDB_IGATE} - DEPENDS interrogate ${INTERROGATEDB_IGATE} - COMMENT "Interrogating interrogatedb" - ) - - add_library(interrogatedb ${MODULE_TYPE} - "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") - target_use_packages(interrogatedb PYTHON) - target_link_libraries(interrogatedb p3dtoolconfig) - - set_target_properties(interrogatedb PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - PREFIX "" - OUTPUT_NAME "interrogatedb" - ) - - install(TARGETS interrogatedb DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") -endif() diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index ef1b7fe25f..b4527b4ab9 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -27,24 +27,53 @@ set(P3INTERROGATEDB_SOURCES py_panda.cxx py_wrappers.cxx) -composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) +set(P3INTERROGATEDB_IGATE + interrogate_interface.h + interrogate_request.h +) -set(P3INTERROGATEDB_IGATE_SOURCES - config_interrogatedb.cxx - indexRemapper.cxx - interrogateComponent.cxx interrogateDatabase.cxx - interrogateElement.cxx interrogateFunction.cxx - interrogateFunctionWrapper.cxx - interrogateMakeSeq.cxx - interrogateManifest.cxx - interrogateType.cxx interrogate_datafile.cxx - interrogate_interface.cxx interrogate_request.cxx) +composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_component_library(p3interrogatedb SYMBOL SYMBOL BUILDING_INTERROGATEDB ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) target_use_packages(p3interrogatedb PYTHON) -target_interrogate(p3interrogatedb ${P3INTERROGATEDB_IGATE_SOURCES}) install(TARGETS p3interrogatedb DESTINATION lib) install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) + +# ALSO: This has an Interrogate binding! Take care of that if we want it. +# Note we don't use the regular Interrogate macros; this has some custom flags +# that would make it not worthwhile. + +if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE) + return() +endif() + +add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" + COMMAND interrogate + -D EXPCL_INTERROGATEDB= + -nodb -python -promiscuous + -module panda3d.interrogatedb + -library interrogatedb + -string -true-names -do-module + -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" + -oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" + ${P3INTERROGATEDB_IGATE} + DEPENDS interrogate ${P3INTERROGATEDB_IGATE} + COMMENT "Interrogating interrogatedb" +) + +add_library(interrogatedb ${MODULE_TYPE} + "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") +target_use_packages(interrogatedb PYTHON) +target_link_libraries(interrogatedb p3dtoolconfig) + +set_target_properties(interrogatedb PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + PREFIX "" + OUTPUT_NAME "interrogatedb" +) + +install(TARGETS interrogatedb DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") From 62e335a801bcc681ef7c730e89ae9734118716be Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 14 May 2018 19:20:44 -0600 Subject: [PATCH 422/744] CMake: Update for upstream changes --- panda/src/pstatclient/CMakeLists.txt | 5 +++-- panda/src/putil/CMakeLists.txt | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index c14ad4e21d..809c5b2ede 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -1,5 +1,5 @@ set(P3PSTATCLIENT_HEADERS - config_pstats.h pStatClient.I pStatClient.h + config_pstatclient.h pStatClient.I pStatClient.h pStatClientImpl.I pStatClientImpl.h pStatClientVersion.I pStatClientVersion.h pStatClientControlMessage.h @@ -10,7 +10,7 @@ set(P3PSTATCLIENT_HEADERS pStatTimer.I pStatTimer.h) set(P3PSTATCLIENT_SOURCES - config_pstats.cxx pStatClient.cxx pStatClientImpl.cxx + config_pstatclient.cxx pStatClient.cxx pStatClientImpl.cxx pStatClientVersion.cxx pStatClientControlMessage.cxx pStatCollector.cxx @@ -28,3 +28,4 @@ target_interrogate(p3pstatclient ALL) install(TARGETS p3pstatclient DESTINATION lib) install(FILES ${P3PSTATCLIENT_HEADERS} DESTINATION include/panda3d) +install(FILES config_pstats.h DESTINATION include/panda3d) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 412706e273..9da712f192 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -23,7 +23,7 @@ set(P3PUTIL_HEADERS copyOnWriteObject.h copyOnWriteObject.I copyOnWritePointer.h copyOnWritePointer.I compareTo.I compareTo.h - config_util.N config_util.h configurable.h + config_putil.N config_putil.h configurable.h cPointerCallbackObject.h cPointerCallbackObject.I datagramBuffer.I datagramBuffer.h datagramInputFile.I datagramInputFile.h @@ -83,7 +83,7 @@ set(P3PUTIL_SOURCES colorSpace.cxx copyOnWriteObject.cxx copyOnWritePointer.cxx - config_util.cxx configurable.cxx + config_putil.cxx configurable.cxx cPointerCallbackObject.cxx datagramBuffer.cxx datagramInputFile.cxx datagramOutputFile.cxx @@ -131,6 +131,7 @@ target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) install(TARGETS p3putil DESTINATION lib) install(FILES ${P3PUTIL_HEADERS} DESTINATION include/panda3d) +install(FILES config_util.h DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_bamRead From 9f46d3dc48096cba68d29b631f5e2d339e192d87 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 15 May 2018 18:35:22 -0600 Subject: [PATCH 423/744] CMake: Remove unused LINK_IN_PHYSX --- dtool/dtool_config.h.in | 3 --- panda/metalibs/panda/CMakeLists.txt | 8 -------- 2 files changed, 11 deletions(-) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index cd87d171b5..19d5408c37 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -233,9 +233,6 @@ to compile them out. */ #cmakedefine NOTIFY_DEBUG -/* Define if we are linking PANDAPHYSX in with PANDA. */ -#cmakedefine LINK_IN_PHYSX - /* The compiled-in character(s) to expect to separate different components of a path list (e.g. $PRC_PATH). */ #define DEFAULT_PATHSEP "@DEFAULT_PATHSEP@" diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 55383b0c24..942ef26dd9 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -11,14 +11,6 @@ if(HAVE_FREETYPE) list(APPEND PANDA_LINK_TARGETS p3pnmtext) endif() -if(LINK_IN_PHYSX) - add_definitions(-DBUILDING_PANDAPHYSX) - set(PANDA_LINK_TARGETS - ${PANDA_LINK_TARGETS} - p3physx - ) -endif() - add_metalib(panda panda.cxx COMPONENTS ${PANDA_LINK_TARGETS}) set_target_properties(panda PROPERTIES DEFINE_SYMBOL BUILDING_LIBPANDA) From b08ab6324e982a801a3b444351d035ffe5bdd55f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 May 2018 14:04:32 -0600 Subject: [PATCH 424/744] CMake: Move panda version logic to dtoolbase --- dtool/src/dtoolbase/CMakeLists.txt | 9 +++++++++ .../{dtoolutil => dtoolbase}/checkPandaVersion.cxx.in | 2 +- .../src/{dtoolutil => dtoolbase}/checkPandaVersion.h.in | 2 +- dtool/src/{dtoolutil => dtoolbase}/pandaVersion.h.in | 0 dtool/src/dtoolutil/CMakeLists.txt | 8 -------- 5 files changed, 11 insertions(+), 10 deletions(-) rename dtool/src/{dtoolutil => dtoolbase}/checkPandaVersion.cxx.in (92%) rename dtool/src/{dtoolutil => dtoolbase}/checkPandaVersion.h.in (96%) rename dtool/src/{dtoolutil => dtoolbase}/pandaVersion.h.in (100%) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 3de0b9cae4..21daf08d1f 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -1,4 +1,10 @@ +configure_file(pandaVersion.h.in pandaVersion.h) +configure_file(checkPandaVersion.h.in checkPandaVersion.h) +configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) + set(P3DTOOLBASE_HEADERS + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h + ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h addHash.I addHash.h atomicAdjust.h atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I @@ -38,6 +44,7 @@ set(P3DTOOLBASE_HEADERS ) set(P3DTOOLBASE_SOURCES + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx addHash.cxx atomicAdjustDummyImpl.cxx atomicAdjustI386Impl.cxx @@ -74,6 +81,8 @@ add_component_library(p3dtoolbase SYMBOL BUILDING_DTOOL_DTOOLBASE # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolbase PUBLIC $) +# Help other libraries find the autogenerated version headers +target_include_directories(p3dtoolbase PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_use_packages(p3dtoolbase THREADS EIGEN) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) diff --git a/dtool/src/dtoolutil/checkPandaVersion.cxx.in b/dtool/src/dtoolbase/checkPandaVersion.cxx.in similarity index 92% rename from dtool/src/dtoolutil/checkPandaVersion.cxx.in rename to dtool/src/dtoolbase/checkPandaVersion.cxx.in index e986a719ea..e62f0184c8 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.cxx.in +++ b/dtool/src/dtoolbase/checkPandaVersion.cxx.in @@ -18,4 +18,4 @@ #include "dtoolbase.h" -EXPCL_DTOOL_DTOOLUTIL int @PANDA_VERSION_SYMBOL@ = 0; +EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@ = 0; diff --git a/dtool/src/dtoolutil/checkPandaVersion.h.in b/dtool/src/dtoolbase/checkPandaVersion.h.in similarity index 96% rename from dtool/src/dtoolutil/checkPandaVersion.h.in rename to dtool/src/dtoolbase/checkPandaVersion.h.in index 162e16704a..0986e84b28 100644 --- a/dtool/src/dtoolutil/checkPandaVersion.h.in +++ b/dtool/src/dtoolbase/checkPandaVersion.h.in @@ -28,7 +28,7 @@ #include "dtoolbase.h" -extern EXPCL_DTOOL_DTOOLUTIL int @PANDA_VERSION_SYMBOL@; +extern EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@; #ifndef WIN32 /* For Windows, exporting the symbol from the DLL is sufficient; the diff --git a/dtool/src/dtoolutil/pandaVersion.h.in b/dtool/src/dtoolbase/pandaVersion.h.in similarity index 100% rename from dtool/src/dtoolutil/pandaVersion.h.in rename to dtool/src/dtoolbase/pandaVersion.h.in diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index e2e8cd5cd6..182b69f91d 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -1,10 +1,4 @@ -configure_file(pandaVersion.h.in pandaVersion.h) -configure_file(checkPandaVersion.h.in checkPandaVersion.h) -configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) - set(P3DTOOLUTIL_HEADERS - ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h - ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h config_dtoolutil.h dSearchPath.I dSearchPath.h executionEnvironment.I executionEnvironment.h filename.I @@ -38,7 +32,6 @@ if(APPLE) endif() set(P3DTOOLUTIL_SOURCES - ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx config_dtoolutil.cxx dSearchPath.cxx executionEnvironment.cxx filename.cxx @@ -73,7 +66,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) -target_include_directories(p3dtoolutil PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolutil PUBLIC $) From d96765b9575665b72defacb72a2ee80483f934e8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 May 2018 17:38:13 -0600 Subject: [PATCH 425/744] CMake: Enhance checkPandaVersion.h This removes the requirement that it only be included in a single C++ file per library, by forcing the compiler to emit the function that references the version symbol as a weak symbol itself. Now, the linker will not only tolerate redundant inclusions, it will also coalesce them together. --- dtool/src/dtoolbase/checkPandaVersion.h.in | 39 ++++++++++++++++++---- 1 file changed, 32 insertions(+), 7 deletions(-) diff --git a/dtool/src/dtoolbase/checkPandaVersion.h.in b/dtool/src/dtoolbase/checkPandaVersion.h.in index 0986e84b28..d3950d412a 100644 --- a/dtool/src/dtoolbase/checkPandaVersion.h.in +++ b/dtool/src/dtoolbase/checkPandaVersion.h.in @@ -18,7 +18,7 @@ /* Include this file in code that compiles with Panda to guarantee that it is linking with the same version of the Panda DLL's that it - was compiled with. You should include it in one .cxx file only. */ + was compiled with. */ /* We guarantee this by defining an external symbol which is based on the version number. If that symbol is defined, then our DLL's @@ -26,14 +26,39 @@ DLL; but the system linker will prevent the DLL from loading with an undefined symbol. */ +#ifndef CHECKPANDAVERSION_H +#define CHECKPANDAVERSION_H + #include "dtoolbase.h" extern EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@; -#ifndef WIN32 -/* For Windows, exporting the symbol from the DLL is sufficient; the - DLL will not load unless all expected public symbols are defined. - Other systems may not mind if the symbol is absent unless we - explictly write code that references it. */ -static int check_panda_version = @PANDA_VERSION_SYMBOL@; +/* Just declaring the symbol isn't good enough. We need to force the + compiler and linker to preserve the external reference long enough + to end up in the output DLL. Therefore, we have to reference that + symbol somehow. + + Forcing the compiler to include a reference in its output object + file is easy enough: just define a function that makes use of it + in some way. The problem is the linker, which will enforce the + C++ One-Definition Rule and get upset about said definition + appearing in multiple places in the program. We can appease the + linker by forcing the compiler to emit a weak symbol. Many + compilers have syntax to request this explicitly, but since it + varies from compiler to compiler, that wouldn't be very portable. + + Fortunately, the C++ ODR itself has some exceptions, where a + definition can occur in multiple translation units *if and only if* + it's the same definition each time. In these cases, the compiler + must emit a weak symbol, because the ODR does not guarantee that + the same definition isn't repeated in any other translation units. + One such exception is template instantiation, which we use thus: */ +template +class CheckPandaVersion { +public: + int check() { return @PANDA_VERSION_SYMBOL@; } +}; + +template class CheckPandaVersion; + #endif From 94937dd43282728070d605db93a41c723450b2da Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 May 2018 18:05:40 -0600 Subject: [PATCH 426/744] travis: Fix error reporting on failed builds Apparently after_script is allowed to fail, so just run the tests inside script. --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8b6d27f3d5..611dea5b0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,6 @@ script: - cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. - make -j4 -after_script: - python ../test_imports.py - pytest ../tests From c62f3d0d232754563a54fcae34360d0136eb3b5b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 May 2018 18:14:07 -0600 Subject: [PATCH 427/744] CMake: Don't set a default Python version. A blank string to FindPythonInterp finds the version of Python that the system "python" interpreter invokes, so this means the default is now the system default. --- dtool/Config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 2551c0a55e..61b213f7be 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -418,7 +418,7 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # # Is Python installed, and should Python interfaces be generated? -set(WANT_PYTHON_VERSION "2.7" +set(WANT_PYTHON_VERSION "" CACHE STRING "Which Python version to seek out for building Panda3D against.") find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) From a3a24f98405ae5a71ddf3c10bd9c2a978fbd76ad Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 16 May 2018 19:41:15 -0600 Subject: [PATCH 428/744] travis: Fix Python test execution --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 611dea5b0b..76fc9d3742 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,6 +61,7 @@ script: - cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. - make -j4 +- export PYTHONPATH=$PWD - python ../test_imports.py - pytest ../tests From beec6578c86f030f5d204c841c4eebfdd218e5fc Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Thu, 17 May 2018 15:41:31 -0500 Subject: [PATCH 429/744] Fix CMake build issues on macOS. --- direct/src/showbase/CMakeLists.txt | 13 +++++++++++-- dtool/src/dtoolutil/CMakeLists.txt | 3 +++ dtool/src/prc/CMakeLists.txt | 1 + panda/metalibs/pandagl/CMakeLists.txt | 2 +- panda/src/cocoadisplay/CMakeLists.txt | 14 +++++++------- panda/src/display/CMakeLists.txt | 1 + panda/src/express/CMakeLists.txt | 2 +- panda/src/osxdisplay/CMakeLists.txt | 6 ++---- 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 9ca60be4ed..ee81e81704 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,5 +1,14 @@ -add_component_library(p3showbase SYMBOL BUILDING_DIRECT_SHOWBASE - showBase.cxx showBase.h) +set(P3SHOWBASE_FILES + showBase.cxx + showBase.h) +set(P3SHOWBASE_EXTRA_ARGS "") +if(IS_OSX) + list(APPEND P3SHOWBASE_FILES showBase_assist.mm) + set(P3SHOWBASE_EXTRA_ARGS "-ObjC++") +endif() + +add_component_library(p3showbase SYMBOL BUILDING_DIRECT_SHOWBASE ${P3SHOWBASE_FILES}) +set_target_properties(p3showbase PROPERTIES COMPILE_FLAGS ${P3SHOWBASE_EXTRA_ARGS}) target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index e2e8cd5cd6..13d389a586 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -35,6 +35,8 @@ set(P3DTOOLUTIL_HEADERS if(APPLE) set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} filename_assist.mm filename_assist.h) + set(P3DTOOLUTIL_EXTRA_FLAGS "-ObjC++") + set_source_files_properties(filename_assist.mm filename_assist.h PROPERTIES WRAP_EXCLUDE YES) endif() set(P3DTOOLUTIL_SOURCES @@ -73,6 +75,7 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) +set_target_properties(p3dtoolutil PROPERTIES COMPILE_FLAGS ${P3DTOOLUTIL_EXTRA_FLAGS}) target_include_directories(p3dtoolutil PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolutil PUBLIC diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index afe1745af5..3b5d3fd237 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -77,6 +77,7 @@ target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_include_directories(p3prc PUBLIC $) target_link_libraries(p3prc p3dtool ${_OPENSSL_LIBRARIES}) +target_use_packages(p3prc OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) install(TARGETS p3prc DESTINATION lib) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 150b969856..e2bd719880 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -19,7 +19,7 @@ if(HAVE_GL) if(HAVE_COCOA) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3cocoadisplay) endif() - + if(HAVE_CARBON) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3osxdisplay) endif() diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 375b792bdf..822942ff66 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -7,7 +7,8 @@ set(P3COCOADISPLAY_HEADERS cocoaGraphicsPipe.h cocoaGraphicsPipe.I cocoaGraphicsWindow.h cocoaGraphicsWindow.I cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I - cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h) + cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h + cocoaPandaAppDelegate.h) set(P3COCOADISPLAY_SOURCES config_cocoadisplay.mm @@ -18,11 +19,12 @@ set(P3COCOADISPLAY_SOURCES cocoaPandaApp.mm cocoaPandaView.mm cocoaPandaWindow.mm - cocoaPandaWindowDelegate.mm) + cocoaPandaWindowDelegate.mm + cocoaPandaAppDelegate.mm) -#composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) -add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) -set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) +add_component_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) +set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL COMPILE_FLAGS "-ObjC++") target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) # Frameworks: @@ -31,5 +33,3 @@ find_library(APPKIT_LIBRARY AppKit) find_library(CARBON_LIBRARY Carbon) target_link_libraries(p3cocoadisplay ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) - -install(TARGETS p3cocoadisplay DESTINATION lib) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 3f7fb00253..a8479dc9a2 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -90,6 +90,7 @@ composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) +target_use_packages(p3display X11) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) install(TARGETS p3display DESTINATION lib) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 0543f743c8..6b177ec8a3 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -151,7 +151,7 @@ add_component_library(p3express SYMBOL BUILDING_PANDAEXPRESS target_include_directories(p3express PUBLIC $) target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool) -target_use_packages(p3express TAR ZLIB) +target_use_packages(p3express TAR ZLIB OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(WIN32) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index 0d6026e9dd..6cabaca987 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -13,8 +13,8 @@ set(P3OSXDISPLAY_SOURCES osxGraphicsBuffer.cxx) composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) -add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) -set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +add_component_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) +set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL COMPILE_FLAGS "-ObjC++") target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) # Frameworks: @@ -26,5 +26,3 @@ find_library(COCOA_LIBRARY Cocoa) target_link_libraries(p3osxdisplay ${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) - -install(TARGETS p3osxdisplay DESTINATION lib) From 1b3c6fb44489b2476e6bca0ce453f4e88c0288c8 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Sat, 19 May 2018 10:30:26 -0500 Subject: [PATCH 430/744] Fix issue with extra flags --- direct/src/showbase/CMakeLists.txt | 5 +++-- dtool/src/dtoolutil/CMakeLists.txt | 3 +-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index ee81e81704..30065be7bf 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -4,11 +4,12 @@ set(P3SHOWBASE_FILES set(P3SHOWBASE_EXTRA_ARGS "") if(IS_OSX) list(APPEND P3SHOWBASE_FILES showBase_assist.mm) - set(P3SHOWBASE_EXTRA_ARGS "-ObjC++") endif() add_component_library(p3showbase SYMBOL BUILDING_DIRECT_SHOWBASE ${P3SHOWBASE_FILES}) -set_target_properties(p3showbase PROPERTIES COMPILE_FLAGS ${P3SHOWBASE_EXTRA_ARGS}) +if(APPLE) + set_target_properties(p3showbase PROPERTIES COMPILE_FLAGS "-ObjC++") +endif() target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index d2216059d4..9c6b3cb517 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -29,7 +29,6 @@ set(P3DTOOLUTIL_HEADERS if(APPLE) set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} filename_assist.mm filename_assist.h) - set(P3DTOOLUTIL_EXTRA_FLAGS "-ObjC++") set_source_files_properties(filename_assist.mm filename_assist.h PROPERTIES WRAP_EXCLUDE YES) endif() @@ -68,7 +67,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) -set_target_properties(p3dtoolutil PROPERTIES COMPILE_FLAGS ${P3DTOOLUTIL_EXTRA_FLAGS}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolutil PUBLIC $) @@ -76,6 +74,7 @@ target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT}) if(APPLE) + set_target_properties(p3dtoolutil PROPERTIES COMPILE_FLAGS "-ObjC++") find_library(FOUNDATION_LIBRARY Foundation) find_library(APPKIT_LIBRARY AppKit) target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY}) From 85b8d96919b7ff46730bd85b2b6d4661045f44b0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 24 May 2018 14:47:12 -0600 Subject: [PATCH 431/744] CMake: Add reminder for when we upgrade to C++17 --- dtool/src/dtoolbase/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 21daf08d1f..9edb98d0b6 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -2,6 +2,13 @@ configure_file(pandaVersion.h.in pandaVersion.h) configure_file(checkPandaVersion.h.in checkPandaVersion.h) configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) +if(CMAKE_CXX_STANDARD GREATER_EQUAL 17) + # This serves as a reminder to update checkPandaVersion.h.in when we upgrade + # to C++17, which supports inline variables - a cleaner way of depending on + # the Panda version symbol from a header than what we're currently doing. + message(FATAL_ERROR "Developer notice: Update checkPandaVersion.h.in for C++17!") +endif() + set(P3DTOOLBASE_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h From 2d5d1400be58d86a6b42be1dad98b141be74422e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 24 May 2018 18:33:15 -0600 Subject: [PATCH 432/744] CMake: Remove references to WxWidgets/FLTK The plugin once used these; it's since been deprecated, so we don't be needing GUI toolkits anymore. --- dtool/LocalSetup.cmake | 12 ------------ dtool/Package.cmake | 28 ---------------------------- 2 files changed, 40 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index c671ec7080..a8cee40f6c 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -206,18 +206,6 @@ else() message("- Did not find gtk+-2") endif() -if(HAVE_WX) - message("+ WxWidgets") -else() - message("- Did not find WxWidgets") -endif() - -if(HAVE_FLTK) - message("+ FLTK") -else() - message("- Did not find FLTK") -endif() - if(HAVE_GL) message("+ OpenGL") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index b2935ce165..ae3afb0789 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -255,34 +255,6 @@ package_option(PhysX config_package(PhysX "Nvidia PhysX") -# Find and configure WxWidgets -find_package(wxWidgets QUIET) -if(WXWIDGETS_FOUND) - set(WX_FOUND TRUE) # Mangle for convenience -endif() -# Cleanup after builtin FindWx -mark_as_advanced(wxWidgets_CONFIG_EXECUTABLE) -mark_as_advanced(wxWidgets_wxrc_EXECUTABLE) -#config_package(WX "WxWidgets") -package_option(WX) - -# Find and configure FLTK -set(OpenGL_FIND_QUIETLY TRUE) # Fix for builtin FindFLTK -find_package(FLTK QUIET) -mark_as_advanced(FLTK_BASE_LIBRARY) # Cleanup after builtin FLTK -mark_as_advanced(FLTK_CONFIG_SCRIPT) # Cleanup after builtin FLTK -mark_as_advanced(FLTK_FLUID_EXECUTABLE) # Cleanup after builtin FLTK -mark_as_advanced(FLTK_FORMS_LIBRARY) # Cleanup after builtin FLTK -mark_as_advanced(FLTK_GL_LIBRARY) # Cleanup after builtin FLTK -mark_as_advanced(FLTK_IMAGES_LIBRARY) # Cleanup after builtin FLTK -mark_as_advanced(FLTK_INCLUDE_DIR) # Cleanup after builtin FLTK -#config_package(FLTK) -package_option(FLTK) - -# Cleanup after builtin FindFLTK -mark_as_advanced(FLTK_DIR) -mark_as_advanced(FLTK_MATH_LIBRARY) - ######## # TODO # From 399f4a33a134f754ba5444398139c967c72ddce6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 25 May 2018 13:33:47 -0600 Subject: [PATCH 433/744] CMake: Check Git commit SHA1 This is for PandaSystem::get_git_commit() --- dtool/PandaVersion.cmake | 10 ++++++++++ dtool/src/dtoolbase/pandaVersion.h.in | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/dtool/PandaVersion.cmake b/dtool/PandaVersion.cmake index 88a21cc286..a503f150e0 100644 --- a/dtool/PandaVersion.cmake +++ b/dtool/PandaVersion.cmake @@ -73,6 +73,16 @@ set(PANDA_VERSION_SYMBOL panda_version_${PROJECT_VERSION_MAJOR}_${PROJECT_VERSIO # for each component. math(EXPR PANDA_NUMERIC_VERSION "${PROJECT_VERSION_MAJOR}*1000000 + ${PROJECT_VERSION_MINOR}*1000 + ${PROJECT_VERSION_PATCH}") +# The Panda Git SHA1 refspec, for PandaSystem::get_git_commit() +find_package(Git QUIET) +if(GIT_EXECUTABLE) + execute_process( + COMMAND "${GIT_EXECUTABLE}" rev-parse HEAD + WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}" + OUTPUT_VARIABLE PANDA_GIT_COMMIT_STR + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + # Separate the plugin version into its three components. string(REPLACE "." ";" P3D_PLUGIN_VERSION_LIST "${P3D_PLUGIN_VERSION}") list(GET P3D_PLUGIN_VERSION_LIST 0 P3D_PLUGIN_MAJOR_VERSION) diff --git a/dtool/src/dtoolbase/pandaVersion.h.in b/dtool/src/dtoolbase/pandaVersion.h.in index c544ae7fdf..3e93349dca 100644 --- a/dtool/src/dtoolbase/pandaVersion.h.in +++ b/dtool/src/dtoolbase/pandaVersion.h.in @@ -49,6 +49,10 @@ out from CVS by the builder). */ #define PANDA_VERSION_STR "@PANDA_VERSION_STR@" +/* This is the Git commit we built Panda from, or an empty string if this isn't + known. */ +#define PANDA_GIT_COMMIT_STR "@PANDA_GIT_COMMIT_STR@" + /* This is the version of the Panda3D ABI expressed as a string. This usually means the major and minor version. It should be the same for Panda3D versions that are supposed to be backward From 4c4c17cac2c1f94e7d26f20cb60803c7e25bff46 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 26 May 2018 18:01:05 -0600 Subject: [PATCH 434/744] CMake: Flag composite files as generated No idea why this was commented out. --- cmake/macros/CompositeSources.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 241a2a3d64..ad0ac24a2e 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -93,7 +93,7 @@ function(composite_sources target sources_var) endif() endwhile() - #set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) + set_source_files_properties(${composite_files} PROPERTIES GENERATED YES) # The new files are added to the existing files, which means the old files # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting. From a504a910b080528515b63b966508c2a252703e07 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 27 May 2018 12:31:04 -0600 Subject: [PATCH 435/744] CMake: Rename `check` function in checkPandaVersion.h This mirrors 239f66c on master. --- dtool/src/dtoolbase/checkPandaVersion.h.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/checkPandaVersion.h.in b/dtool/src/dtoolbase/checkPandaVersion.h.in index d3950d412a..6f4b7ae403 100644 --- a/dtool/src/dtoolbase/checkPandaVersion.h.in +++ b/dtool/src/dtoolbase/checkPandaVersion.h.in @@ -56,7 +56,7 @@ extern EXPCL_DTOOL_DTOOLBASE int @PANDA_VERSION_SYMBOL@; template class CheckPandaVersion { public: - int check() { return @PANDA_VERSION_SYMBOL@; } + int check_version() { return @PANDA_VERSION_SYMBOL@; } }; template class CheckPandaVersion; From 827f322d0e15864b7600851440a5cb9b38af879b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 27 May 2018 14:07:26 -0600 Subject: [PATCH 436/744] CMake: Update for upstream change --- dtool/LocalSetup.cmake | 2 +- dtool/dtool_config.h.in | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index a8cee40f6c..d153e465b9 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) { fs.open(\"file\", std::fstream::out, 0644); r check_cxx_source_compiles(" #include int main(int argc, char *argv[]) { lockf(0, F_LOCK, 0); return 0; } -" HAVE_LOCKF) +" PHAVE_LOCKF) # Check if we have a wchar_t type. check_type_size(wchar_t HAVE_WCHAR_T) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 19d5408c37..165acc4636 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -262,7 +262,7 @@ #cmakedefine HAVE_OPEN_MASK /* Define if we have a lockf() function. */ -#cmakedefine HAVE_LOCKF +#cmakedefine PHAVE_LOCKF /* Define if some header file defines wchar_t. */ #cmakedefine HAVE_WCHAR_T From e0bc3691742e7e403bb33060821c3ed8732f7bb9 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Mon, 28 May 2018 15:57:15 -0500 Subject: [PATCH 437/744] Make sure libs are installed, delete extraneous whitespace --- panda/metalibs/pandagl/CMakeLists.txt | 1 - panda/src/cocoadisplay/CMakeLists.txt | 2 ++ panda/src/osxdisplay/CMakeLists.txt | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index e2bd719880..78330b4a7f 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -19,7 +19,6 @@ if(HAVE_GL) if(HAVE_COCOA) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3cocoadisplay) endif() - if(HAVE_CARBON) set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3osxdisplay) endif() diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 822942ff66..8d40f301ed 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -33,3 +33,5 @@ find_library(APPKIT_LIBRARY AppKit) find_library(CARBON_LIBRARY Carbon) target_link_libraries(p3cocoadisplay ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) + +install(TARGETS p3cocoadisplay DESTINATION lib) \ No newline at end of file diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index 6cabaca987..fd94a2bcc5 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -26,3 +26,5 @@ find_library(COCOA_LIBRARY Cocoa) target_link_libraries(p3osxdisplay ${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) + +install(TARGETS p3osxdisplay DESTINATION lib) \ No newline at end of file From ef0170388f2ce83ac406fa89f3d4582923e55df8 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Mon, 28 May 2018 16:13:26 -0500 Subject: [PATCH 438/744] Only link X11 with p3display if HAVE_X11 is enabled. --- panda/src/display/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index a8479dc9a2..b7e0a0d8a8 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -90,7 +90,9 @@ composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) -target_use_packages(p3display X11) +if(HAVE_X11) + target_use_packages(p3display X11) +endif() target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) install(TARGETS p3display DESTINATION lib) From 87a05913f849ff44eef9f396941140a727d357fc Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Mon, 28 May 2018 17:38:32 -0500 Subject: [PATCH 439/744] Remove redundant conditional, add missing newline --- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/display/CMakeLists.txt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 8d40f301ed..ecaa3467e5 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -34,4 +34,4 @@ find_library(CARBON_LIBRARY Carbon) target_link_libraries(p3cocoadisplay ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) -install(TARGETS p3cocoadisplay DESTINATION lib) \ No newline at end of file +install(TARGETS p3cocoadisplay DESTINATION lib) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index b7e0a0d8a8..a8479dc9a2 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -90,9 +90,7 @@ composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) target_link_libraries(p3display p3cull p3pgraphnodes) -if(HAVE_X11) - target_use_packages(p3display X11) -endif() +target_use_packages(p3display X11) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) install(TARGETS p3display DESTINATION lib) From e05380509b530c11626291fa5cdf8376e5428f67 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 29 May 2018 19:48:35 -0600 Subject: [PATCH 440/744] CMake: Adjust several forgotten component libraries --- panda/src/wgldisplay/CMakeLists.txt | 4 ++-- panda/src/windisplay/CMakeLists.txt | 4 ++-- panda/src/x11display/CMakeLists.txt | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index 147e4b784a..a645b9ba9b 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -19,6 +19,6 @@ set(P3WGLDISPLAY_SOURCES composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) -add_library(p3wgldisplay ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) -set_target_properties(p3wgldisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +add_component_library(p3wgldisplay SYMBOL BUILDING_PANDAGL + ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg) diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index 363330d7e9..6234426986 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -14,6 +14,6 @@ set(P3WINDISPLAY_SOURCES winDetectDx9.cxx) composite_sources(p3windisplay P3WINDISPLAY_SOURCES) -add_library(p3windisplay ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) -set_target_properties(p3windisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAWIN) +add_component_library(p3windisplay SYMBOL BUILDING_PANDAWIN + ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) target_link_libraries(p3windisplay p3display p3putil Imm32.lib) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 21ae14c02a..2bfbb1ba6b 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -12,8 +12,8 @@ set(P3X11DISPLAY_SOURCES ) composite_sources(p3x11display P3X11DISPLAY_SOURCES) -add_library(p3x11display ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) -set_target_properties(p3x11display PROPERTIES DEFINE_SYMBOL BUILDING_PANDAX11) +add_component_library(p3x11display SYMBOL BUILDING_PANDAX11 + ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) target_link_libraries(p3x11display panda ${X11_LIBRARIES}) install(TARGETS p3x11display DESTINATION lib) From 18817e68484fc89b753c62c0ff1dcd91e1e20be8 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Tue, 29 May 2018 21:08:08 -0500 Subject: [PATCH 441/744] Add travis builds for macOS This also trims down the build matrix. --- .travis.yml | 30 ++++++++++++++++++++++++------ .travis/install_macos.sh | 9 +++++++++ 2 files changed, 33 insertions(+), 6 deletions(-) create mode 100755 .travis/install_macos.sh diff --git a/.travis.yml b/.travis.yml index 76fc9d3742..8bb6473275 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,15 +2,19 @@ language: cpp sudo: false # Build matrix: +os: +- linux +- osx compiler: -- gcc - clang env: -- BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=0 -- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 -- BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30 - BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 - BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 PYTHON_INTERP=python2.7 +- BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30 +- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 +matrix: + include: + - compiler: gcc addons: apt: @@ -40,6 +44,7 @@ addons: - nvidia-cg-toolkit - python-dev - python3-dev + - python3-pip - python-virtualenv - zlib1g-dev - fakeroot @@ -50,7 +55,13 @@ before_install: - makepanda/selfdestruct.py --yes install: -- virtualenv --python=${PYTHON_INTERP:-python3.4} venv && source venv/bin/activate +- > + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + ./.travis/install_macos.sh; + else + virtualenv --python=${PYTHON_INTERP:-python3} venv; + fi +- source venv/bin/activate - pip install pytest before_script: @@ -58,7 +69,14 @@ before_script: - cd built script: -- cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. +- > + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + cmake -DHAVE_CARBON=NO -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2o_1 \ + -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT ..; + else + cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ + -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT ..; + fi - make -j4 - export PYTHONPATH=$PWD diff --git a/.travis/install_macos.sh b/.travis/install_macos.sh new file mode 100755 index 0000000000..0d603fee9a --- /dev/null +++ b/.travis/install_macos.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +brew install python@3 eigen libtar fftw libsquish zlib ffmpeg freetype bullet \ +wxmac opencv assimp libvorbis openssl@1.0 || true +brew install ode --with-shared + +# We can't trust brew to make the right symlinks, so execute commands as modules +${PYTHON_INTERP:-python3} -m pip install virtualenv +${PYTHON_INTERP:-python3} -m virtualenv --python=${PYTHON_INTERP:-python3} venv From a8954d7f674fa91a6a28c93acc59702b3b691517 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Tue, 29 May 2018 21:49:00 -0500 Subject: [PATCH 442/744] Don't build GLX support if on macOS --- dtool/Config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 61b213f7be..0bb92a18c2 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -572,7 +572,7 @@ endif() #package_option(XCURSOR # "This enables custom cursor support in x11display.") -if(HAVE_GL AND HAVE_X11) +if(HAVE_GL AND HAVE_X11 AND NOT APPLE) option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." ON) else() option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." OFF) From 5619c3ed90856b02802d5b2a3a65ef8073ea2a98 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Tue, 29 May 2018 21:58:43 -0500 Subject: [PATCH 443/744] Make sure HAVE_OPENAL_FRAMEWORK is set correctly --- dtool/Package.cmake | 4 +++- dtool/dtool_config.h.in | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index b2935ce165..27c1dfde77 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -205,7 +205,9 @@ package_option(OPENAL LICENSE "LGPL") config_package(OPENAL "OpenAL sound library") - +if(OPENAL_FOUND AND APPLE) + set(HAVE_OPENAL_FRAMEWORK YES) +endif() # # ------------ FreeType ------------ # diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 19d5408c37..cf7b72664f 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -21,6 +21,9 @@ /* Define if we have OpenAL installed. */ #cmakedefine HAVE_OPENAL +/* Define if we have OpenAL installed as a framework. */ +#cmakedefine HAVE_OPENAL_FRAMEWORK + /* Define if we have Freetype 2.0 or better available. */ #cmakedefine HAVE_FREETYPE From 4b70cb162e5b689dcd4b887a831e07b1d6068d74 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 29 May 2018 22:21:31 -0600 Subject: [PATCH 444/744] CMake: Don't metalib p3distributed when not built --- direct/CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 5d4f4ed088..34f798bd00 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -17,7 +17,13 @@ add_subdirectory(src/interval) add_subdirectory(src/showbase) # TODO: p3direct needs a source file! -add_metalib(p3direct COMPONENTS p3dcparser p3deadrec p3distributed p3interval p3showbase) +set(P3DIRECT_COMPONENTS + p3dcparser p3deadrec + p3interval p3showbase) +if(HAVE_PYTHON) + list(APPEND P3DIRECT_COMPONENTS p3distributed) +endif() +add_metalib(p3direct COMPONENTS ${P3DIRECT_COMPONENTS}) set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") if(HAVE_PYTHON) From d0ced03ffdc4d867689ac7c94c6308b2ab823051 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 29 May 2018 22:37:38 -0600 Subject: [PATCH 445/744] CMake: Build direct.motiontrail This covers pretty much all of direct, except for directd. --- direct/CMakeLists.txt | 12 ++++++------ direct/src/motiontrail/CMakeLists.txt | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) create mode 100644 direct/src/motiontrail/CMakeLists.txt diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 34f798bd00..2c45cf0941 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -10,16 +10,14 @@ add_subdirectory(src/deadrec) #add_subdirectory(src/directdServer) #add_subdirectory(src/directd) add_subdirectory(src/distributed) -#add_subdirectory(src/heapq) -#add_subdirectory(src/http) add_subdirectory(src/interval) -#add_subdirectory(src/motiontrail) +add_subdirectory(src/motiontrail) add_subdirectory(src/showbase) # TODO: p3direct needs a source file! set(P3DIRECT_COMPONENTS - p3dcparser p3deadrec - p3interval p3showbase) + p3dcparser p3deadrec p3interval + p3motiontrail p3showbase) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) endif() @@ -27,7 +25,9 @@ add_metalib(p3direct COMPONENTS ${P3DIRECT_COMPONENTS}) set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") if(HAVE_PYTHON) - add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3showbase LINK p3direct IMPORT panda3d.core) + add_python_module(direct + p3dcparser p3deadrec p3distributed p3interval + p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core) # Make an __init__.py pointing at the source directory so users can run # Panda3D code straight from their build path: diff --git a/direct/src/motiontrail/CMakeLists.txt b/direct/src/motiontrail/CMakeLists.txt new file mode 100644 index 0000000000..6e70bc5a33 --- /dev/null +++ b/direct/src/motiontrail/CMakeLists.txt @@ -0,0 +1,15 @@ +set(P3MOTIONTRAIL_HEADERS + config_motiontrail.h + cMotionTrail.h) + +set(P3MOTIONTRAIL_SOURCES + config_motiontrail.cxx + cMotionTrail.cxx) + +add_component_library(p3motiontrail SYMBOL BUILDING_DIRECT_MOTIONTRAIL + ${P3MOTIONTRAIL_HEADERS} ${P3MOTIONTRAIL_SOURCES}) +target_link_libraries(p3motiontrail p3directbase panda) +target_interrogate(p3motiontrail ALL) + +install(TARGETS p3motiontrail DESTINATION lib) +install(FILES ${P3MOTIONTRAIL_HEADERS} DESTINATION include/panda3d) From 09009ca1a4131b2621fff0aff09eedeb0ca1c03d Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 30 May 2018 10:05:37 -0500 Subject: [PATCH 446/744] Be more specific in which python interpreter we want to run --- .travis/install_macos.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis/install_macos.sh b/.travis/install_macos.sh index 0d603fee9a..233775402c 100755 --- a/.travis/install_macos.sh +++ b/.travis/install_macos.sh @@ -5,5 +5,5 @@ wxmac opencv assimp libvorbis openssl@1.0 || true brew install ode --with-shared # We can't trust brew to make the right symlinks, so execute commands as modules -${PYTHON_INTERP:-python3} -m pip install virtualenv -${PYTHON_INTERP:-python3} -m virtualenv --python=${PYTHON_INTERP:-python3} venv +/usr/local/bin/${PYTHON_INTERP:-python3} -m pip install virtualenv +/usr/local/bin/${PYTHON_INTERP:-python3} -m virtualenv --python=${PYTHON_INTERP:-python3} venv From 0f241837be3ec6d271e63e9c8d9ef1c0fbcc1299 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 30 May 2018 10:07:34 -0500 Subject: [PATCH 447/744] Remove --python flag since we know we're running the proper python --- .travis/install_macos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis/install_macos.sh b/.travis/install_macos.sh index 233775402c..833eb1828f 100755 --- a/.travis/install_macos.sh +++ b/.travis/install_macos.sh @@ -6,4 +6,4 @@ brew install ode --with-shared # We can't trust brew to make the right symlinks, so execute commands as modules /usr/local/bin/${PYTHON_INTERP:-python3} -m pip install virtualenv -/usr/local/bin/${PYTHON_INTERP:-python3} -m virtualenv --python=${PYTHON_INTERP:-python3} venv +/usr/local/bin/${PYTHON_INTERP:-python3} -m virtualenv venv From a70ccf5d1306cd5721039121de0e2bb10084a282 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 30 May 2018 19:16:25 -0500 Subject: [PATCH 448/744] CMake won't find the right Python 2.7, so tell it where it is. --- .travis.yml | 3 +-- .travis/install_macos.sh | 4 ++-- .travis/script_macos.sh | 9 +++++++++ 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100755 .travis/script_macos.sh diff --git a/.travis.yml b/.travis.yml index 8bb6473275..f22141c929 100644 --- a/.travis.yml +++ b/.travis.yml @@ -71,8 +71,7 @@ before_script: script: - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - cmake -DHAVE_CARBON=NO -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2o_1 \ - -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT ..; + ../.travis/script_macos.sh; else cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT ..; diff --git a/.travis/install_macos.sh b/.travis/install_macos.sh index 833eb1828f..6f0c5ae907 100755 --- a/.travis/install_macos.sh +++ b/.travis/install_macos.sh @@ -5,5 +5,5 @@ wxmac opencv assimp libvorbis openssl@1.0 || true brew install ode --with-shared # We can't trust brew to make the right symlinks, so execute commands as modules -/usr/local/bin/${PYTHON_INTERP:-python3} -m pip install virtualenv -/usr/local/bin/${PYTHON_INTERP:-python3} -m virtualenv venv +${PYTHON_INTERP:-python3} -m pip install virtualenv +${PYTHON_INTERP:-python3} -m virtualenv venv diff --git a/.travis/script_macos.sh b/.travis/script_macos.sh new file mode 100755 index 0000000000..e945307990 --- /dev/null +++ b/.travis/script_macos.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +if [[ "$PYTHON_INTERP" == "python2.7" ]]; then + export PY2_CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/local/bin/python -DPYTHON_LIBRARY=/usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib" +fi + +cmake -DHAVE_CARBON=NO -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2o_1 \ +-DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ +$PY2_CMAKE_ARGS .. From 3a678fb73826c47ffda171a2bddd8b82b94f9a3a Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Thu, 31 May 2018 22:16:25 -0500 Subject: [PATCH 449/744] Just use APPLE instead of IS_OSX for compiling in ObjC++ --- direct/src/showbase/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 30065be7bf..1aff073438 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -2,7 +2,7 @@ set(P3SHOWBASE_FILES showBase.cxx showBase.h) set(P3SHOWBASE_EXTRA_ARGS "") -if(IS_OSX) +if(APPLE) list(APPEND P3SHOWBASE_FILES showBase_assist.mm) endif() From 407589873ae9194f0f62657f00310104919b1236 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 30 May 2018 00:30:15 -0600 Subject: [PATCH 450/744] CMake: Update some Windows-specific rules --- CMakeLists.txt | 7 +++++++ direct/src/dcparse/CMakeLists.txt | 6 ++++++ panda/metalibs/pandagl/CMakeLists.txt | 11 ++++++----- panda/src/wgldisplay/CMakeLists.txt | 2 +- panda/src/windisplay/CMakeLists.txt | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6bcb35b6fe..0f372b37d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,13 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +# Runtime code assumes that dynamic modules have a "lib" prefix; Windows +# assumes that debug libraries have a _d suffix. +set(CMAKE_SHARED_MODULE_PREFIX "lib") +if(WIN32) + set(CMAKE_DEBUG_POSTFIX "_d") +endif() + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option AND target_use_packages diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index f6182aeca1..1c4a4b55a2 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,9 @@ +if(WIN32) + # We can't build dcparse on Windows, because the dcparser symbols aren't + # properly exported from p3direct.dll. + return() +endif() + add_executable(dcparse dcparse.cxx) target_compile_definitions(dcparse PUBLIC WITHIN_PANDA) target_link_libraries(dcparse p3direct) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 150b969856..d65abc48f5 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -10,21 +10,22 @@ if(HAVE_GL) set(PANDAGL_LINK_TARGETS p3glgsg) if(HAVE_GLX) - list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay) + list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay p3x11display) endif() + if(HAVE_WGL) - list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay) + list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay p3windisplay) endif() if(HAVE_COCOA) - set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3cocoadisplay) + list(APPEND PANDAGL_LINK_TARGETS p3cocoadisplay) endif() if(HAVE_CARBON) - set(PANDAGL_LINK_TARGETS ${PANDAGL_LINK_TARGETS} p3osxdisplay) + list(APPEND PANDAGL_LINK_TARGETS p3osxdisplay) endif() - add_metalib(pandagl pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS}) + add_metalib(pandagl ${MODULE_TYPE} pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS}) set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) install(TARGETS pandagl DESTINATION lib) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index a645b9ba9b..54c55f1579 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -21,4 +21,4 @@ set(P3WGLDISPLAY_SOURCES composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) add_component_library(p3wgldisplay SYMBOL BUILDING_PANDAGL ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) -target_link_libraries(p3wgldisplay p3display p3putil p3windisplay p3glgsg) +target_link_libraries(p3wgldisplay p3glgsg p3windisplay) diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index 6234426986..a8fd62ee56 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -16,4 +16,4 @@ set(P3WINDISPLAY_SOURCES composite_sources(p3windisplay P3WINDISPLAY_SOURCES) add_component_library(p3windisplay SYMBOL BUILDING_PANDAWIN ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) -target_link_libraries(p3windisplay p3display p3putil Imm32.lib) +target_link_libraries(p3windisplay panda User32.lib Imm32.lib) From 7e4f9b4c8e745a5d4317afa3a6d27c13efedabba Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 30 May 2018 00:39:39 -0600 Subject: [PATCH 451/744] CMake: Make p3directbase a component library --- direct/CMakeLists.txt | 4 ++-- direct/src/directbase/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 2c45cf0941..b8276b9c6f 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -16,8 +16,8 @@ add_subdirectory(src/showbase) # TODO: p3direct needs a source file! set(P3DIRECT_COMPONENTS - p3dcparser p3deadrec p3interval - p3motiontrail p3showbase) + p3dcparser p3deadrec p3directbase + p3interval p3motiontrail p3showbase) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) endif() diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 4abea24c3e..445abbe0f8 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3DIRECTBASE_HEADERS ) # Not worth compositing sources, there's really only one. -add_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) +add_component_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) target_link_libraries(p3directbase panda) install(TARGETS p3directbase DESTINATION lib) From f54b4b61dd20815d752667d3d57bce6880904e18 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 31 May 2018 20:25:27 -0600 Subject: [PATCH 452/744] CMake: Don't use pzip when not built --- CMakeLists.txt | 4 ++-- cmake/macros/RunPzip.cmake | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f372b37d8..bef1ac8cbd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,7 +90,7 @@ if(BUILD_MODELS) DESTINATION "${PROJECT_BINARY_DIR}/models/maps" ) run_pzip(models - "${CMAKE_CURRENT_SOURCE_DIR}/models" + "${CMAKE_CURRENT_SOURCE_DIR}/models/" "${PROJECT_BINARY_DIR}/models" *.egg ) @@ -99,7 +99,7 @@ if(BUILD_MODELS) FILES_MATCHING PATTERN *.rgb PATTERN *.png PATTERN *.jpg PATTERN *.wav ) run_pzip(dmodels - "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src" + "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" "${PROJECT_BINARY_DIR}/models" *.egg ) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index ef428b92d6..6cb30d6880 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -1,4 +1,12 @@ function(run_pzip target_name source destination glob) + if(NOT TARGET pzip) + # If pzip isn't built, we just copy instead. + file(COPY "${source}" + DESTINATION "${destination}" + FILES_MATCHING PATTERN "${glob}") + return() + endif() + file(GLOB_RECURSE files RELATIVE "${source}" "${source}/${glob}") set(dstfiles "") From d8f3a669c2f7e3a7aca960f15b8e308d26a4ce20 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Fri, 1 Jun 2018 12:47:59 -0500 Subject: [PATCH 453/744] Move all the little scripts back into .travis.yml, use less specific paths when searching for openssl and python2.7 --- .travis.yml | 20 ++++++++++++++++---- .travis/install_macos.sh | 9 --------- .travis/script_macos.sh | 9 --------- 3 files changed, 16 insertions(+), 22 deletions(-) delete mode 100755 .travis/install_macos.sh delete mode 100755 .travis/script_macos.sh diff --git a/.travis.yml b/.travis.yml index f22141c929..54e25dffae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,9 +57,15 @@ before_install: install: - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - ./.travis/install_macos.sh; + brew install python@3 eigen libtar fftw libsquish zlib ffmpeg freetype \ + bullet opencv assimp libvorbis openssl || true + brew install ode --with-shared + + # We can't trust brew to make the right symlinks, so execute commands as modules + ${PYTHON_INTERP:-python3} -m pip install virtualenv + ${PYTHON_INTERP:-python3} -m virtualenv venv else - virtualenv --python=${PYTHON_INTERP:-python3} venv; + virtualenv --python=${PYTHON_INTERP:-python3} venv fi - source venv/bin/activate - pip install pytest @@ -71,10 +77,16 @@ before_script: script: - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - ../.travis/script_macos.sh; + if [[ "$PYTHON_INTERP" == "python2.7" ]]; then + export PY2_CMAKE_ARGS=-DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/2.7/bin/python + fi + + cmake -DHAVE_CARBON=NO -DBUILD_METALIBS=$BUILD_METALIBS \ + -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ + -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $PY2_CMAKE_ARGS .. else cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ - -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT ..; + -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. fi - make -j4 diff --git a/.travis/install_macos.sh b/.travis/install_macos.sh deleted file mode 100755 index 6f0c5ae907..0000000000 --- a/.travis/install_macos.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -brew install python@3 eigen libtar fftw libsquish zlib ffmpeg freetype bullet \ -wxmac opencv assimp libvorbis openssl@1.0 || true -brew install ode --with-shared - -# We can't trust brew to make the right symlinks, so execute commands as modules -${PYTHON_INTERP:-python3} -m pip install virtualenv -${PYTHON_INTERP:-python3} -m virtualenv venv diff --git a/.travis/script_macos.sh b/.travis/script_macos.sh deleted file mode 100755 index e945307990..0000000000 --- a/.travis/script_macos.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -if [[ "$PYTHON_INTERP" == "python2.7" ]]; then - export PY2_CMAKE_ARGS="-DPYTHON_EXECUTABLE=/usr/local/bin/python -DPYTHON_LIBRARY=/usr/local/opt/python@2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib" -fi - -cmake -DHAVE_CARBON=NO -DOPENSSL_ROOT_DIR=/usr/local/Cellar/openssl/1.0.2o_1 \ --DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ -$PY2_CMAKE_ARGS .. From 16cfac482923bc734447d234fd8eaaa99483847d Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Tue, 5 Jun 2018 17:31:00 -0500 Subject: [PATCH 454/744] Add missing macOS-specific imports --- panda/src/cocoadisplay/cocoaPandaApp.mm | 1 + panda/src/display/subprocessWindow.cxx | 2 ++ 2 files changed, 3 insertions(+) diff --git a/panda/src/cocoadisplay/cocoaPandaApp.mm b/panda/src/cocoadisplay/cocoaPandaApp.mm index e7226786da..83f0b8ef42 100644 --- a/panda/src/cocoadisplay/cocoaPandaApp.mm +++ b/panda/src/cocoadisplay/cocoaPandaApp.mm @@ -12,6 +12,7 @@ */ #import "cocoaPandaApp.h" +#include "config_cocoadisplay.h" @implementation CocoaPandaApp - (void) sendEvent: (NSEvent *) event { diff --git a/panda/src/display/subprocessWindow.cxx b/panda/src/display/subprocessWindow.cxx index d001f3b1f6..ef3b09786c 100644 --- a/panda/src/display/subprocessWindow.cxx +++ b/panda/src/display/subprocessWindow.cxx @@ -18,6 +18,8 @@ #include "graphicsEngine.h" #include "config_display.h" #include "nativeWindowHandle.h" +#include "mouseButton.h" +#include "throw_event.h" TypeHandle SubprocessWindow::_type_handle; From cddd553d1e6d4b865b0bafb838c9c0511f2cee35 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 6 Jun 2018 09:16:26 -0500 Subject: [PATCH 455/744] Add COMPOSITE_SOURCE_EXCLUSIONS option It specifies a list of targets to exclude during the compositing stage. --- .travis.yml | 5 +++++ cmake/macros/CompositeSources.cmake | 12 ++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 54e25dffae..84810b2b01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,12 @@ env: - BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30 - BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 matrix: + exclude: + - os: osx + env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 include: + - os: osx + env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 COMPOSITE_SOURCE_EXCLUSIONS=p3showbase;p3dtoolutil;p3cocoadisplay;p3osxdisplay;p3tinydisplay;p3display - compiler: gcc addons: diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index ad0ac24a2e..adcb4ccfa7 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -26,6 +26,10 @@ build dramatically but will be more memory intensive than a low value.") set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING "Only files of these extensions will be added to composite files.") +set(COMPOSITE_SOURCE_EXCLUSIONS "" CACHE STRING + "A list of targets to skip when compositing sources. This is mainly +desirable for CI builds.") + set(COMPOSITE_GENERATOR "${CMAKE_SOURCE_DIR}/cmake/scripts/MakeComposite.cmake") @@ -36,8 +40,12 @@ function(composite_sources target sources_var) set(sources ${orig_sources}) list(LENGTH sources num_sources) - if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2) - # It's silly to do this for a single source. + # Don't composite if in the list of exclusions, and don't bother compositing + # with too few sources + list (FIND COMPOSITE_SOURCE_EXCLUSIONS ${target} _index) + if(num_sources LESS 2 + OR ${COMPOSITE_SOURCE_LIMIT} LESS 2 + OR ${_index} GREATER -1) return() endif() From ce0d79d1869058f8c94cb509cf6619edcb8b33fb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 6 Jun 2018 13:59:06 -0600 Subject: [PATCH 456/744] CMake: Remove unused config macros and configure-time tests --- dtool/Config.cmake | 5 --- dtool/LocalSetup.cmake | 38 ---------------------- dtool/dtool_config.h.in | 72 ----------------------------------------- 3 files changed, 115 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 61b213f7be..4c38728b51 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -610,11 +610,6 @@ endif() # Miscellaneous settings # -option(HAVE_WIN_TOUCHINPUT -"Define this if you are building on Windows 7 or better, and you -want your Panda build to run only on Windows 7 or better, and you -need to use the Windows touchinput interfaces." OFF) - option(WANT_NATIVE_NET "Define this true to build the low-level native network implementation. Normally this should be set true." ON) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index d153e465b9..609d4174ab 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -14,42 +14,15 @@ include(CheckTypeSize) include(TestBigEndian) include(TestForSTDNamespace) -# Define if we have libjpeg installed. -check_include_file_cxx(jpegint.h PHAVE_JPEGINT_H) - # Check if this is a big-endian system. test_big_endian(WORDS_BIGENDIAN) -# Check if the compiler supports namespaces. -set(HAVE_NAMESPACE ${CMAKE_STD_NAMESPACE}) - -# Define if fstream::open() accepts a third parameter for umask. -check_cxx_source_compiles(" -#include -std::fstream fs; -int main(int argc, char *argv[]) { fs.open(\"file\", std::fstream::out, 0644); return 0; } -" HAVE_OPEN_MASK) - # Define if we have lockf(). check_cxx_source_compiles(" #include int main(int argc, char *argv[]) { lockf(0, F_LOCK, 0); return 0; } " PHAVE_LOCKF) -# Check if we have a wchar_t type. -check_type_size(wchar_t HAVE_WCHAR_T) - -# Check if we have a wstring type. -check_cxx_source_compiles(" -#include -std::wstring str; -int main(int argc, char *argv[]) { return 0; } -" HAVE_WSTRING) - -# Define if the C++ compiler supports the typename keyword. -# Since we now require C++11, this is a given. -set(HAVE_TYPENAME 1) - # Define if we can trust the compiler not to insert extra bytes in # structs between base structs and derived structs. check_c_source_runs(" @@ -93,13 +66,6 @@ if(UNIX) set(IOCTL_TERMINAL_WIDTH 1) endif() -# Do the system headers define a "streamsize" typedef? -check_cxx_source_compiles(" -#include -std::streamsize ss; -int main(int argc, char *argv[]) { return 0; } -" HAVE_STREAMSIZE) - # Do the system headers define key ios typedefs like ios::openmode # and ios::fmtflags? check_cxx_source_compiles(" @@ -163,7 +129,6 @@ check_include_file_cxx(unistd.h PHAVE_UNISTD_H) check_include_file_cxx(utime.h PHAVE_UTIME_H) check_include_file_cxx(glob.h PHAVE_GLOB_H) check_include_file_cxx(dirent.h PHAVE_DIRENT_H) -check_include_file_cxx(sys/soundcard.h PHAVE_SYS_SOUNDCARD_H) check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) #TODO doesn't work on OSX, use sys/ucontext.h check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) check_include_file_cxx(stdint.h PHAVE_STDINT_H) @@ -176,9 +141,6 @@ check_include_file_cxx(typeinfo HAVE_RTTI) include(CheckCXXCompilerFlag) check_cxx_compiler_flag(-msse2 HAVE_SSE2) -#/* Define if needed to have 64-bit file i/o */ -#$[cdefine __USE_LARGEFILE64] - # Set LINK_ALL_STATIC if we're building everything as static libraries. # Also set the library type used for "modules" appropriately. if(BUILD_SHARED_LIBS) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 165acc4636..9cf6ba5b8d 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -15,18 +15,9 @@ /* Define if we have RAD game tools, Miles Sound System installed. */ #cmakedefine HAVE_RAD_MSS -/* Define if we have FMODex installed. */ -#cmakedefine HAVE_FMODEX - -/* Define if we have OpenAL installed. */ -#cmakedefine HAVE_OPENAL - /* Define if we have Freetype 2.0 or better available. */ #cmakedefine HAVE_FREETYPE -/* Define if we are using SpeedTree. */ -#cmakedefine HAVE_SPEEDTREE - /* Define if we want to compile in a default font. */ #cmakedefine COMPILE_IN_DEFAULT_FONT @@ -35,7 +26,6 @@ /* Define if we have Maya available. */ #cmakedefine HAVE_MAYA -#cmakedefine MAYA_PRE_5_0 /* Define if we have libRocket available and built with the Rocket Debugger. */ #cmakedefine HAVE_ROCKET_DEBUGGER @@ -61,7 +51,6 @@ /* Define if we have libjpeg installed. */ #cmakedefine HAVE_JPEG -#cmakedefine PHAVE_JPEGINT_H /* Define to build video-for-linux. */ #cmakedefine HAVE_VIDEO4LINUX @@ -95,12 +84,6 @@ /* Define if we have CG installed. */ #cmakedefine HAVE_CG -/* Define if we have CGGL installed. */ -#cmakedefine HAVE_CGGL - -/* Define if we have CGDX9 installed. */ -#cmakedefine HAVE_CGDX9 - /* Define for dxerr.h instead of dxerr9.h. */ #cmakedefine USE_GENERIC_DXERR_LIBRARY @@ -114,12 +97,6 @@ #cmakedefine MIN_GL_VERSION_MINOR #endif -/* Define if we have OpenGL ES installed and want to build for GLES. */ -#cmakedefine HAVE_GLES - -/* Define if we have OpenGL ES installed and want to build for GLES2. */ -#cmakedefine HAVE_GLES2 - /* Define if we have OpenCV installed and want to build for OpenCV. */ #cmakedefine HAVE_OPENCV #cmakedefine OPENCV_VER_23 @@ -129,18 +106,9 @@ #cmakedefine HAVE_SWSCALE #cmakedefine HAVE_SWRESAMPLE -/* Define if we have ODE installed and want to build for ODE. */ -#cmakedefine HAVE_ODE - -/* Define if we have AWESOMIUM installed and want to build for AWESOMIUM. */ -#cmakedefine HAVE_AWESOMIUM - /* Define if we have GLX installed and want to build for GLX. */ #cmakedefine HAVE_GLX -/* Define if we have EGL installed and want to build for EGL. */ -#cmakedefine HAVE_EGL - /* Define if we have Windows-GL installed and want to build for Wgl. */ #cmakedefine HAVE_WGL @@ -160,15 +128,6 @@ /* Define if we have X11. */ #cmakedefine HAVE_X11 -/* Define if we have the XFree86-DGA extension. */ -#cmakedefine HAVE_XF86DGA - -/* Define if we have the XRandR extension. */ -#cmakedefine HAVE_XRANDR - -/* Define if we have the XCursor extension. */ -#cmakedefine HAVE_XCURSOR - /* Define if we want to compile the threading code. */ #cmakedefine HAVE_THREADS @@ -197,9 +156,6 @@ /* Define if we want to compile the audio code. */ #cmakedefine HAVE_AUDIO -/* Define if we have bison and flex available. */ -#cmakedefine HAVE_BISON - /* Define if we want to use PStats. */ #cmakedefine DO_PSTATS @@ -255,24 +211,9 @@ byte first (like Motorola and SPARC, unlike Intel and VAX). */ #cmakedefine WORDS_BIGENDIAN -/* Define if the C++ compiler uses namespaces. */ -#cmakedefine HAVE_NAMESPACE - -/* Define if fstream::open() accepts a third parameter for umask. */ -#cmakedefine HAVE_OPEN_MASK - /* Define if we have a lockf() function. */ #cmakedefine PHAVE_LOCKF -/* Define if some header file defines wchar_t. */ -#cmakedefine HAVE_WCHAR_T - -/* Define if the header file defines wstring. */ -#cmakedefine HAVE_WSTRING - -/* Define if the C++ compiler supports the typename keyword. */ -#cmakedefine HAVE_TYPENAME - /* Define if we can trust the compiler not to insert extra bytes in structs between base structs and derived structs. */ #cmakedefine SIMPLE_STRUCT_POINTERS @@ -298,9 +239,6 @@ /* Define if you have ioctl(TIOCGWINSZ) to determine terminal width. */ #cmakedefine IOCTL_TERMINAL_WIDTH -/* Do the system headers define a "streamsize" typedef? */ -#cmakedefine HAVE_STREAMSIZE - /* Do the system headers define key ios typedefs like ios::openmode and ios::fmtflags? */ #cmakedefine HAVE_IOS_TYPEDEFS @@ -382,10 +320,6 @@ /* Define if you have the header file. */ #cmakedefine PHAVE_DIRENT_H -/* Do we have (and presumably a Linux-style audio - interface)? */ -#cmakedefine PHAVE_SYS_SOUNDCARD_H - /* Do we have (and therefore makecontext() / swapcontext())? */ #cmakedefine PHAVE_UCONTEXT_H @@ -405,15 +339,9 @@ /* Is the code being compiled with the Tau profiler's instrumentor? */ #cmakedefine USE_TAU -/* Define if needed to have 64-bit file i/o */ -#cmakedefine __USE_LARGEFILE64 - // To activate the DELETED_CHAIN macros. #cmakedefine USE_DELETED_CHAIN -// To build the Windows TOUCHINPUT interfaces (requires Windows 7). -#cmakedefine HAVE_WIN_TOUCHINPUT - // If we are to build the native net interfaces. #cmakedefine WANT_NATIVE_NET From a088e6aba5a000404bed2ff621a5baef47764b45 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 01:43:42 -0600 Subject: [PATCH 457/744] CMake: Autogenerate metalib init files --- cmake/macros/BuildMetalib.cmake | 87 +++++++++++++++++++++-- cmake/templates/metalib_init.cxx.in | 8 +++ cmake/templates/metalib_init.h.in | 8 +++ direct/CMakeLists.txt | 3 +- direct/src/dcparser/CMakeLists.txt | 2 +- direct/src/directbase/CMakeLists.txt | 3 +- direct/src/showbase/CMakeLists.txt | 2 +- dtool/metalibs/dtool/CMakeLists.txt | 2 +- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 +- dtool/src/dconfig/CMakeLists.txt | 2 +- dtool/src/dtoolbase/CMakeLists.txt | 2 +- dtool/src/interrogatedb/CMakeLists.txt | 2 +- dtool/src/prc/CMakeLists.txt | 2 +- panda/metalibs/panda/CMakeLists.txt | 2 +- panda/src/audio/CMakeLists.txt | 2 +- panda/src/chan/CMakeLists.txt | 2 +- panda/src/dgraph/CMakeLists.txt | 2 +- panda/src/event/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 2 +- panda/src/gsgbase/CMakeLists.txt | 2 +- panda/src/parametrics/CMakeLists.txt | 2 +- panda/src/recorder/CMakeLists.txt | 2 +- panda/src/tform/CMakeLists.txt | 2 +- 23 files changed, 118 insertions(+), 27 deletions(-) create mode 100644 cmake/templates/metalib_init.cxx.in create mode 100644 cmake/templates/metalib_init.h.in diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 3326b50d77..7b804bd1b9 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -62,15 +62,23 @@ function(target_link_libraries target) endfunction(target_link_libraries) # -# Function: add_component_library(target [SYMBOL building_symbol] [SOURCES]) +# Function: add_component_library(target [SYMBOL building_symbol] +# [SOURCES] [[NOINIT]/[INIT func [header]]]) # -# Used very similarly to add_library. You can specify a symbol with SYMBOL, +# Used very similarly to add_library. You can specify a symbol with SYMBOL, # which works like CMake's own DEFINE_SYMBOL property: it's defined when # building the library, but not when building something that links against the # library. # +# INIT specifies the init function that should be called from a metalib's init +# function when this is added to a metalib. The header parameter can further +# clarify what header declares this function. By default, this is +# init_libTARGET and config_TARGET.h, respectively, where TARGET is the +# target name (with 'p3' stripped off, if applicable). The NOINIT keyword +# suppresses this default. +# # Note that this function gets to decide whether the component library is -# OBJECT or SHARED, and whether the library is installed or not. Also, as +# OBJECT or SHARED, and whether the library is installed or not. Also, as # a rule, component libraries may only be linked by other component libraries # in the same metalib - outside of the metalib, you must link the metalib # itself. @@ -79,26 +87,50 @@ function(add_component_library target_name) set(sources) unset(symbol) + if(target_name MATCHES "^p3.*") + string(SUBSTRING "${target_name}" 2 -1 name_without_prefix) + else() + set(name_without_prefix "${target_name}") + endif() + set(init_func "init_lib${name_without_prefix}") + set(init_header "config_${name_without_prefix}.h") + set(symbol_keyword OFF) + set(init_keyword 0) foreach(source ${ARGN}) if(source STREQUAL "SYMBOL") set(symbol_keyword ON) + set(init_keyword 0) + elseif(source STREQUAL "INIT") + set(symbol_keyword OFF) + set(init_keyword 2) + elseif(source STREQUAL "NOINIT") + set(init_func) + set(init_header) elseif(symbol_keyword) set(symbol_keyword OFF) set(symbol "${source}") + elseif(init_keyword EQUAL 2) + set(init_func "${source}") + set(init_keyword 1) + elseif(init_keyword EQUAL 1) + set(init_header "${source}") + set(init_keyword 0) else() list(APPEND sources "${source}") endif() endforeach() - if(BUILD_METALIBS) add_library("${target_name}" OBJECT ${sources}) else() add_library("${target_name}" ${sources}) endif() - set_target_properties("${target_name}" PROPERTIES IS_COMPONENT ON) + set_target_properties("${target_name}" PROPERTIES + IS_COMPONENT ON + INIT_FUNCTION "${init_func}" + INIT_HEADER "${init_header}") if(symbol) # ... DEFINE_SYMBOL is apparently not respected for object libraries? set_property(TARGET "${target_name}" APPEND PROPERTY COMPILE_DEFINITIONS "${symbol}") @@ -116,19 +148,37 @@ function(add_component_library target_name) endfunction(add_component_library) # -# Function: add_metalib(target [source1 source2] [COMPONENTS component1 ...]) +# Function: add_metalib(target [source1 source2] [INIT initfunc [initheader.h]] +# [COMPONENTS component1 ...]) # # This is add_library, but for metalibs. # +# The INIT keyword can specify an initialization function/header (which will be +# autogenerated by this function) that calls the underlying component libs' +# init functions. +# function(add_metalib target_name) set(components_keyword OFF) + set(init_keyword 0) + set(init_func) + set(init_header "${target_name}.h") set(components) set(sources) foreach(arg ${ARGN}) if(arg STREQUAL "COMPONENTS") set(components_keyword ON) + set(init_keyword 0) + elseif(arg STREQUAL "INIT") + set(init_keyword 2) + set(components_keyword OFF) elseif(components_keyword) list(APPEND components "${arg}") + elseif(init_keyword EQUAL 2) + set(init_func "${arg}") + set(init_keyword 1) + elseif(init_keyword EQUAL 1) + set(init_header "${arg}") + set(init_keyword 0) else() list(APPEND sources "${arg}") endif() @@ -137,6 +187,8 @@ function(add_metalib target_name) set(defines) set(includes) set(libs) + set(component_init_funcs "") + set(component_init_headers "") foreach(component ${components}) if(NOT TARGET "${component}") message(FATAL_ERROR @@ -149,6 +201,18 @@ function(add_metalib target_name) "Attempted to metalink non-component ${component} into ${target_name}!") endif() + get_target_property(component_init_header "${component}" INIT_HEADER) + get_target_property(component_init_func "${component}" INIT_FUNCTION) + + if(component_init_header) + set(component_init_headers + "${component_init_headers}#include \"${component_init_header}\"\n") + endif() + if(component_init_func) + set(component_init_funcs + "${component_init_funcs} ${component_init_func}();\n") + endif() + if(BUILD_METALIBS) list(APPEND defines "$") list(APPEND includes "$") @@ -159,6 +223,17 @@ function(add_metalib target_name) endif() endforeach() + if(init_func) + set(init_source_path "${CMAKE_CURRENT_BINARY_DIR}/init_${target_name}.cxx") + set(init_header_path "${CMAKE_CURRENT_BINARY_DIR}/${init_header}") + + configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.cxx.in" "${init_source_path}") + list(APPEND sources "${init_source_path}") + + configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.h.in" "${init_header_path}") + install(FILES "${init_header_path}" DESTINATION include/panda3d) + endif() + add_library("${target_name}" ${sources}) target_compile_definitions("${target_name}" PRIVATE ${defines}) target_link_libraries("${target_name}" ${libs}) diff --git a/cmake/templates/metalib_init.cxx.in b/cmake/templates/metalib_init.cxx.in new file mode 100644 index 0000000000..0bef274f6a --- /dev/null +++ b/cmake/templates/metalib_init.cxx.in @@ -0,0 +1,8 @@ +#include "dtoolbase.h" + +@component_init_headers@ + +EXPORT_CLASS void +@init_func@() { +@component_init_funcs@ +} diff --git a/cmake/templates/metalib_init.h.in b/cmake/templates/metalib_init.h.in new file mode 100644 index 0000000000..60f4a1380f --- /dev/null +++ b/cmake/templates/metalib_init.h.in @@ -0,0 +1,8 @@ +#ifndef _METALIB_INIT_@target_name@ +#define _METALIB_INIT_@target_name@ + +#include "dtoolbase.h" + +IMPORT_CLASS void @init_func@(); + +#endif diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index b8276b9c6f..14ea20eca3 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -14,14 +14,13 @@ add_subdirectory(src/interval) add_subdirectory(src/motiontrail) add_subdirectory(src/showbase) -# TODO: p3direct needs a source file! set(P3DIRECT_COMPONENTS p3dcparser p3deadrec p3directbase p3interval p3motiontrail p3showbase) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) endif() -add_metalib(p3direct COMPONENTS ${P3DIRECT_COMPONENTS}) +add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONENTS}) set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") if(HAVE_PYTHON) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index a79992bdd5..681ab48711 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -46,7 +46,7 @@ set(P3DCPARSER_PARSER_SOURCES dcLexer.cxx) composite_sources(p3dcparser P3DCPARSER_SOURCES) -add_component_library(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} +add_component_library(p3dcparser NOINIT ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase panda) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 445abbe0f8..447c93f12d 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -7,7 +7,8 @@ set(P3DIRECTBASE_HEADERS ) # Not worth compositing sources, there's really only one. -add_component_library(p3directbase ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) +add_component_library(p3directbase NOINIT + ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) target_link_libraries(p3directbase panda) install(TARGETS p3directbase DESTINATION lib) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 9ca60be4ed..e9bdc8e9f5 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,4 +1,4 @@ -add_component_library(p3showbase SYMBOL BUILDING_DIRECT_SHOWBASE +add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE showBase.cxx showBase.h) target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 16cd56f1c3..78836cd833 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,3 +1,3 @@ -add_metalib(p3dtool dtool.cxx COMPONENTS p3dtoolutil p3dtoolbase) +add_metalib(p3dtool INIT init_libdtool dtool.h COMPONENTS p3dtoolutil p3dtoolbase) install(TARGETS p3dtool DESTINATION lib) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 33dc2922da..85c89fc4bc 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,3 +1,3 @@ set(DTOOLCONFIG_LINK_TARGETS p3prc p3dconfig p3interrogatedb) -add_metalib(p3dtoolconfig dtoolconfig.cxx COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) +add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) install(TARGETS p3dtoolconfig DESTINATION lib) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 3b895a13af..58a85c4f98 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -6,7 +6,7 @@ set(P3DCONFIG_SOURCES composite_sources(p3dconfig P3DCONFIG_SOURCES) -add_component_library(p3dconfig SYMBOL BUILDING_DTOOL_DCONFIG +add_component_library(p3dconfig NOINIT SYMBOL BUILDING_DTOOL_DCONFIG ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) target_link_libraries(p3dconfig p3prc) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 9edb98d0b6..fb201d42c0 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -83,7 +83,7 @@ set(P3DTOOLBASE_IGATEEXT composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) -add_component_library(p3dtoolbase SYMBOL BUILDING_DTOOL_DTOOLBASE +add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3dtoolbase PUBLIC diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index b4527b4ab9..6b6858a98c 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -34,7 +34,7 @@ set(P3INTERROGATEDB_IGATE composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) -add_component_library(p3interrogatedb SYMBOL SYMBOL BUILDING_INTERROGATEDB +add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) target_use_packages(p3interrogatedb PYTHON) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index afe1745af5..3f352a3137 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -70,7 +70,7 @@ set(P3PRC_IGATEEXT composite_sources(p3prc P3PRC_SOURCES) -add_component_library(p3prc SYMBOL BUILDING_DTOOL_PRC +add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # The extensions need py_panda.h and extension.h from interrogatedb diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 942ef26dd9..0dc43b6c7f 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -11,7 +11,7 @@ if(HAVE_FREETYPE) list(APPEND PANDA_LINK_TARGETS p3pnmtext) endif() -add_metalib(panda panda.cxx COMPONENTS ${PANDA_LINK_TARGETS}) +add_metalib(panda INIT init_libpanda panda.h COMPONENTS ${PANDA_LINK_TARGETS}) set_target_properties(panda PROPERTIES DEFINE_SYMBOL BUILDING_LIBPANDA) install(TARGETS panda DESTINATION lib) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index 6fd101852c..f31638dd51 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -21,7 +21,7 @@ set(P3AUDIO_SOURCES nullAudioSound.cxx) composite_sources(p3audio P3AUDIO_SOURCES) -add_component_library(p3audio SYMBOL BUILDING_PANDA_AUDIO +add_component_library(p3audio NOINIT SYMBOL BUILDING_PANDA_AUDIO ${P3AUDIO_HEADERS} ${P3AUDIO_SOURCES}) target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 7d631a2f97..42278738e2 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -53,7 +53,7 @@ set(P3CHAN_SOURCES ) composite_sources(p3chan P3CHAN_SOURCES) -add_component_library(p3chan SYMBOL BUILDING_PANDA_CHAN +add_component_library(p3chan NOINIT SYMBOL BUILDING_PANDA_CHAN ${P3CHAN_HEADERS} ${P3CHAN_SOURCES}) target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 53ff1cf381..60ec88cbe8 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -12,7 +12,7 @@ set(P3DGRAPH_SOURCES ) composite_sources(p3dgraph P3DGRAPH_SOURCES) -add_component_library(p3dgraph SYMBOL BUILDING_PANDA_DGRAPH +add_component_library(p3dgraph NOINIT SYMBOL BUILDING_PANDA_DGRAPH ${P3DGRAPH_HEADERS} ${P3DGRAPH_SOURCES}) target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 1352d40b2a..e3c0c0ab1e 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -45,7 +45,7 @@ set(P3EVENT_IGATEEXT ) composite_sources(p3event P3EVENT_SOURCES) -add_component_library(p3event SYMBOL BUILDING_PANDA_EVENT +add_component_library(p3event NOINIT SYMBOL BUILDING_PANDA_EVENT ${P3EVENT_HEADERS} ${P3EVENT_SOURCES}) target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index c53aa602c4..6da64d7ead 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -168,7 +168,7 @@ set(P3GOBJ_IGATEEXT ) composite_sources(p3gobj P3GOBJ_SOURCES) -add_component_library(p3gobj SYMBOL BUILDING_PANDA_GOBJ +add_component_library(p3gobj NOINIT SYMBOL BUILDING_PANDA_GOBJ ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_use_packages(p3gobj ZLIB SQUISH CG) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index cb891fef98..27ef4199f1 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -11,7 +11,7 @@ set(P3GSGBASE_SOURCES ) composite_sources(p3gsgbase P3GSGBASE_SOURCES) -add_component_library(p3gsgbase SYMBOL BUILDING_PANDA_GSGBASE +add_component_library(p3gsgbase NOINIT SYMBOL BUILDING_PANDA_GSGBASE ${P3GSGBASE_HEADERS} ${P3GSGBASE_SOURCES}) target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index b75334e34e..08f617bb1e 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -34,7 +34,7 @@ set(P3PARAMETRICS_SOURCES ) composite_sources(p3parametrics P3PARAMETRICS_SOURCES) -add_component_library(p3parametrics SYMBOL BUILDING_PANDA_PARAMETRICS +add_component_library(p3parametrics NOINIT SYMBOL BUILDING_PANDA_PARAMETRICS ${P3PARAMETRICS_HEADERS} ${P3PARAMETRICS_SOURCES}) target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index f7ef34ac70..2964e90c96 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -17,7 +17,7 @@ set(P3RECORDER_SOURCES ) composite_sources(p3recorder P3RECORDER_SOURCES) -add_component_library(p3recorder SYMBOL BUILDING_PANDA_RECORDER +add_component_library(p3recorder NOINIT SYMBOL BUILDING_PANDA_RECORDER ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) target_link_libraries(p3recorder p3dgraph p3downloader) target_interrogate(p3recorder ALL) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index 971848d0d2..53510a0060 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -27,7 +27,7 @@ set(P3TFORM_SOURCES ) composite_sources(p3tform P3TFORM_SOURCES) -add_component_library(p3tform SYMBOL BUILDING_PANDA_TFORM +add_component_library(p3tform NOINIT SYMBOL BUILDING_PANDA_TFORM ${P3TFORM_HEADERS} ${P3TFORM_SOURCES}) target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) From 61ce0218e8b3332a85eb1278198c1fecad612f2c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 01:43:54 -0600 Subject: [PATCH 458/744] CMake: Don't use BUILDING_PANDAEXPRESS --- panda/src/downloader/CMakeLists.txt | 2 +- panda/src/express/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 1460eec6fd..7da60c6fd4 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -68,7 +68,7 @@ set(P3DOWNLOADER_IGATEEXT ) composite_sources(p3downloader P3DOWNLOADER_SOURCES) -add_component_library(p3downloader SYMBOL BUILDING_PANDAEXPRESS +add_component_library(p3downloader SYMBOL BUILDING_PANDA_DOWNLOADER ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) target_link_libraries(p3downloader p3express p3pipeline) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 0543f743c8..6b6ea27fa9 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -144,7 +144,7 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) -add_component_library(p3express SYMBOL BUILDING_PANDAEXPRESS +add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) # p3express needs to include from p3interrogatedb for py_panda.h and extension.h From 1fe9034ba04fa2f65e4d271c706e898f36154b56 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 01:44:03 -0600 Subject: [PATCH 459/744] CMake: Don't build ca_bundle_data_src.c It only contains statics, and it's intended to be #included --- panda/src/express/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 6b6ea27fa9..ff17d24592 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -1,6 +1,5 @@ set(P3EXPRESS_HEADERS buffer.I buffer.h - ca_bundle_data_src.c checksumHashGenerator.I checksumHashGenerator.h circBuffer.I circBuffer.h compress_string.h From 4ea42666d6e8f68bca1394eecc31549ec44c35d6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 01:44:30 -0600 Subject: [PATCH 460/744] CMake: Don't test for minmax.h This is no longer used by the source --- dtool/LocalSetup.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 609d4174ab..0dadc4c5c3 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -120,7 +120,6 @@ check_include_file_cxx(locale.h PHAVE_LOCALE_H) check_include_file_cxx(string.h PHAVE_STRING_H) check_include_file_cxx(stdlib.h PHAVE_STDLIB_H) check_include_file_cxx(limits.h PHAVE_LIMITS_H) -check_include_file_cxx(minmax.h PHAVE_MINMAX_H) check_include_file_cxx(sstream PHAVE_SSTREAM) check_include_file_cxx(new PHAVE_NEW) check_include_file_cxx(sys/types.h PHAVE_SYS_TYPES_H) From 2e98b68e3bbcba08de428f7a0c20427d547803cf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 01:46:36 -0600 Subject: [PATCH 461/744] CMake: Make directbase/pandabase INTERFACE libraries They export no code, and are really only used to contain several preprocessor macros relevant to their respective packages. On Windows, they're a problem: MSVC doesn't generate a .lib when compiling a .dll that exports nothing. --- cmake/macros/BuildMetalib.cmake | 19 ++++++++++++------- direct/CMakeLists.txt | 2 +- direct/src/directbase/CMakeLists.txt | 8 +++----- panda/src/pandabase/CMakeLists.txt | 6 +++--- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 7b804bd1b9..716f8c09d8 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -30,24 +30,29 @@ function(target_link_libraries target) set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") - # Also build with the same BUILDING_ macros, because these will all end - # up in the same library. - set(compile_definitions "$<$>:$>") - set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") - # Libraries are only linked transitively if they aren't components. # Unfortunately, it seems like INTERFACE_LINK_LIBRARIES can't have # generator expressions on an object library(?) so we resort to taking # care of this at configuration time. if(TARGET "${library}") - get_target_property(is_component "${library}" IS_COMPONENT) + get_target_property(target_type "${library}" TYPE) + if(NOT target_type STREQUAL "INTERFACE_LIBRARY") + get_target_property(is_component "${library}" IS_COMPONENT) + else() + set(is_component OFF) + endif() else() # This is a safe assumption, since we define all component libraries # before the metalib they appear in: set(is_component OFF) endif() - if(NOT is_component) + if(is_component) + # Also build with the same BUILDING_ macros, because these will all end + # up in the same library. + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") + else() set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") endif() else() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 14ea20eca3..9e6e238d03 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -15,7 +15,7 @@ add_subdirectory(src/motiontrail) add_subdirectory(src/showbase) set(P3DIRECT_COMPONENTS - p3dcparser p3deadrec p3directbase + p3dcparser p3deadrec p3interval p3motiontrail p3showbase) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 447c93f12d..53a8de1ee7 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -6,10 +6,8 @@ set(P3DIRECTBASE_HEADERS directbase.h directsymbols.h ) -# Not worth compositing sources, there's really only one. -add_component_library(p3directbase NOINIT - ${P3DIRECTBASE_HEADERS} ${P3DIRECTBASE_SOURCES}) -target_link_libraries(p3directbase panda) +# Yes, INTERFACE: don't build it, there's no code! +add_library(p3directbase INTERFACE) +target_link_libraries(p3directbase INTERFACE panda) -install(TARGETS p3directbase DESTINATION lib) install(FILES ${P3DIRECTBASE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index 4e9b89735c..3cf44a1228 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -6,8 +6,8 @@ set(P3PANDABASE_SOURCES pandabase.cxx ) -add_component_library(p3pandabase ${P3PANDABASE_HEADERS} ${P3PANDABASE_SOURCES}) -target_link_libraries(p3pandabase p3dtool) +# Yes, INTERFACE: don't build it, there's no code! +add_library(p3pandabase INTERFACE) +target_link_libraries(p3pandabase INTERFACE p3dtool) -install(TARGETS p3pandabase DESTINATION lib) install(FILES ${P3PANDABASE_HEADERS} DESTINATION include/panda3d) From 600590ed7a19e21965205162d1dc3a35915e1a54 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 19:19:24 -0600 Subject: [PATCH 462/744] CMake: Update BUILDING_ defines for upstream --- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/egg/CMakeLists.txt | 2 +- panda/src/egg2pg/CMakeLists.txt | 2 +- panda/src/glgsg/CMakeLists.txt | 2 +- panda/src/glxdisplay/CMakeLists.txt | 2 +- panda/src/osxdisplay/CMakeLists.txt | 2 +- panda/src/particlesystem/CMakeLists.txt | 2 +- panda/src/physics/CMakeLists.txt | 2 +- panda/src/wgldisplay/CMakeLists.txt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 375b792bdf..2e39c4ee4b 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -22,7 +22,7 @@ set(P3COCOADISPLAY_SOURCES #composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) -set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +set_target_properties(p3cocoadisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_COCOADISPLAY) target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) # Frameworks: diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index fe5d24d427..341938f391 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -102,7 +102,7 @@ set(P3EGG_PARSER_SOURCES lexer.cxx) composite_sources(p3egg P3EGG_SOURCES) -add_component_library(p3egg SYMBOL BUILDING_PANDAEGG +add_component_library(p3egg SYMBOL BUILDING_PANDA_EGG ${P3EGG_HEADERS} ${P3EGG_SOURCES} ${P3EGG_PARSER_SOURCES}) target_link_libraries(p3egg panda) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index f5c2c7683c..e9ede6c215 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -33,7 +33,7 @@ set(P3EGG2PG_SOURCES ) composite_sources(p3egg2pg P3EGG2PG_SOURCES) -add_component_library(p3egg2pg SYMBOL BUILDING_PANDAEGG +add_component_library(p3egg2pg SYMBOL BUILDING_PANDA_EGG2PG ${P3EGG2PG_HEADERS} ${P3EGG2PG_SOURCES}) target_link_libraries(p3egg2pg panda p3egg) target_interrogate(p3egg2pg ALL) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index ac243e44f7..ca961f5b65 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -12,7 +12,7 @@ set(P3GLGSG_SOURCES ) composite_sources(p3glgsg P3GLGSG_SOURCES) -add_component_library(p3glgsg SYMBOL BUILDING_PANDAGL +add_component_library(p3glgsg SYMBOL BUILDING_PANDA_GLGSG ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff panda ${OPENGL_LIBRARIES}) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index adedecae49..edb9544df7 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -24,7 +24,7 @@ set(P3GLXDISPLAY_SOURCES ) composite_sources(p3glxdisplay P3GLXDISPLAY_SOURCES) -add_component_library(p3glxdisplay SYMBOL BUILDING_PANDAGL +add_component_library(p3glxdisplay SYMBOL BUILDING_PANDA_GLXDISPLAY ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index 0d6026e9dd..98f3f6d57b 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -14,7 +14,7 @@ set(P3OSXDISPLAY_SOURCES composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) -set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) +set_target_properties(p3osxdisplay PROPERTIES DEFINE_SYMBOL BUILDING_PANDA_OSXDISPLAY) target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) # Frameworks: diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 21334a8606..71102bb31d 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -38,7 +38,7 @@ set(P3PARTICLESYSTEM_SOURCES composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) -add_component_library(p3particlesystem SYMBOL BUILDING_PANDAPHYSICS +add_component_library(p3particlesystem SYMBOL BUILDING_PANDA_PARTICLESYSTEM ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) target_link_libraries(p3particlesystem p3physics panda) target_interrogate(p3particlesystem ALL) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index cd9ced9c74..3278cd08dd 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -36,7 +36,7 @@ set(P3PHYSICS_SOURCES physicsObjectCollection.cxx) composite_sources(p3physics P3PHYSICS_SOURCES) -add_component_library(p3physics SYMBOL BUILDING_PANDAPHYSICS +add_component_library(p3physics SYMBOL BUILDING_PANDA_PHYSICS ${P3PHYSICS_HEADERS} ${P3PHYSICS_SOURCES}) target_link_libraries(p3physics panda) target_interrogate(p3physics ALL) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index 54c55f1579..c3d6e41792 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -19,6 +19,6 @@ set(P3WGLDISPLAY_SOURCES composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) -add_component_library(p3wgldisplay SYMBOL BUILDING_PANDAGL +add_component_library(p3wgldisplay SYMBOL BUILDING_PANDA_WGLDISPLAY ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) target_link_libraries(p3wgldisplay p3glgsg p3windisplay) From 93306c0aa53bae5f4f5ab057ee43d04f86cbf4cb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Jun 2018 18:49:42 -0600 Subject: [PATCH 463/744] CMake: Build pandaexpress metalib --- panda/CMakeLists.txt | 1 + panda/metalibs/panda/CMakeLists.txt | 5 ++--- panda/metalibs/pandaexpress/CMakeLists.txt | 5 +++++ panda/src/downloader/CMakeLists.txt | 2 +- panda/src/dxml/CMakeLists.txt | 2 +- panda/src/linmath/CMakeLists.txt | 2 +- panda/src/movies/CMakeLists.txt | 2 +- panda/src/nativenet/CMakeLists.txt | 2 +- panda/src/net/CMakeLists.txt | 2 +- panda/src/pipeline/CMakeLists.txt | 2 +- panda/src/pstatclient/CMakeLists.txt | 2 +- 11 files changed, 16 insertions(+), 11 deletions(-) create mode 100644 panda/metalibs/pandaexpress/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6dca5eb2bf..851461e64f 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -73,6 +73,7 @@ add_subdirectory(src/ode) # Include panda metalibs add_subdirectory(metalibs/panda) +add_subdirectory(metalibs/pandaexpress) add_subdirectory(metalibs/pandagl) add_subdirectory(metalibs/pandaegg) add_subdirectory(metalibs/pandaphysics) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 0dc43b6c7f..a628fe3ad6 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,6 +1,6 @@ set(PANDA_LINK_TARGETS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml - p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml + p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) @@ -12,6 +12,5 @@ if(HAVE_FREETYPE) endif() add_metalib(panda INIT init_libpanda panda.h COMPONENTS ${PANDA_LINK_TARGETS}) -set_target_properties(panda PROPERTIES DEFINE_SYMBOL BUILDING_LIBPANDA) install(TARGETS panda DESTINATION lib) diff --git a/panda/metalibs/pandaexpress/CMakeLists.txt b/panda/metalibs/pandaexpress/CMakeLists.txt new file mode 100644 index 0000000000..75fa8c7438 --- /dev/null +++ b/panda/metalibs/pandaexpress/CMakeLists.txt @@ -0,0 +1,5 @@ +add_metalib(pandaexpress + INIT init_libpandaexpress pandaexpress.h + COMPONENTS p3downloader p3express) + +install(TARGETS pandaexpress DESTINATION lib) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 7da60c6fd4..023acf2db5 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -70,7 +70,7 @@ set(P3DOWNLOADER_IGATEEXT composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_component_library(p3downloader SYMBOL BUILDING_PANDA_DOWNLOADER ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) -target_link_libraries(p3downloader p3express p3pipeline) +target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) install(TARGETS p3downloader DESTINATION lib) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 9268eb0051..82db1ef516 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -14,7 +14,7 @@ composite_sources(p3dxml P3DXML_SOURCES) add_definitions(-DTIXML_USE_STL) add_component_library(p3dxml SYMBOL BUILDING_PANDA_DXML ${P3DXML_HEADERS} ${P3DXML_SOURCES}) -target_link_libraries(p3dxml p3express) +target_link_libraries(p3dxml pandaexpress) target_interrogate(p3dxml ALL) install(TARGETS p3dxml DESTINATION lib) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 922c94537b..5157a0d38b 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -46,7 +46,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_component_library(p3linmath SYMBOL BUILDING_PANDA_LINMATH ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) -target_link_libraries(p3linmath p3express p3pandabase) +target_link_libraries(p3linmath p3pandabase pandaexpress) target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 9369d9beaf..49668ffc48 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -44,7 +44,7 @@ set(P3MOVIES_SOURCES composite_sources(p3movies P3MOVIES_SOURCES) add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) -target_link_libraries(p3movies p3pstatclient p3gobj p3express p3pandabase) +target_link_libraries(p3movies p3pstatclient p3gobj p3pandabase pandaexpress) target_interrogate(p3movies ALL) install(TARGETS p3movies DESTINATION lib) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 2c2fc687ca..7cdde96ce8 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -30,7 +30,7 @@ set(P3NATIVENET_SOURCES composite_sources(p3nativenet P3NATIVENET_SOURCES) add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET ${P3NATIVENET_HEADERS} ${P3NATIVENET_SOURCES}) -target_link_libraries(p3nativenet p3express p3pandabase p3downloader) +target_link_libraries(p3nativenet p3pandabase pandaexpress) target_interrogate(p3nativenet ALL) install(TARGETS p3nativenet DESTINATION lib) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index adc9f9f4ad..ba265cc86b 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -31,7 +31,7 @@ set(P3NET_SOURCES composite_sources(p3net P3NET_SOURCES) add_component_library(p3net SYMBOL BUILDING_PANDA_NET ${P3NET_HEADERS} ${P3NET_SOURCES}) -target_link_libraries(p3net p3express p3downloader p3pandabase p3nativenet p3pipeline) +target_link_libraries(p3net p3nativenet p3pipeline p3pandabase pandaexpress) target_interrogate(p3net ALL) if(WIN32) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 4040c58a19..73d7f96ce4 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -130,7 +130,7 @@ set(P3PIPELINE_IGATEEXT composite_sources(p3pipeline P3PIPELINE_SOURCES) add_component_library(p3pipeline SYMBOL BUILDING_PANDA_PIPELINE ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) -target_link_libraries(p3pipeline p3express) +target_link_libraries(p3pipeline pandaexpress) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) install(TARGETS p3pipeline DESTINATION lib) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 809c5b2ede..8aa80f0566 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -23,7 +23,7 @@ set(P3PSTATCLIENT_SOURCES composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) -target_link_libraries(p3pstatclient p3net p3putil p3express) +target_link_libraries(p3pstatclient p3net p3putil pandaexpress) target_interrogate(p3pstatclient ALL) install(TARGETS p3pstatclient DESTINATION lib) From c96a49e8970630c55029ebd53d809285856620d4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 12 Jun 2018 16:32:26 -0600 Subject: [PATCH 464/744] CMake: Update egg/physics metalibs to add_metalib(... INIT ...) --- panda/metalibs/pandaegg/CMakeLists.txt | 6 +++--- panda/metalibs/pandaphysics/CMakeLists.txt | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 830649b448..80ea6d9cd1 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -2,9 +2,9 @@ if(NOT HAVE_EGG) return() endif() -set(PANDAEGG_LINK_TARGETS p3egg p3egg2pg) - -add_metalib(pandaegg pandaegg.cxx COMPONENTS ${PANDAEGG_LINK_TARGETS}) +add_metalib(pandaegg + INIT init_libpandaegg pandaegg.h + COMPONENTS p3egg p3egg2pg) target_link_libraries(pandaegg panda) install(TARGETS pandaegg DESTINATION lib) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index 908b8ff48b..5a9d2ed0db 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -1,3 +1,5 @@ -add_metalib(pandaphysics pandaphysics.cxx COMPONENTS p3physics p3particlesystem) +add_metalib(pandaphysics + INIT init_libpandaphysics pandaphysics.h + COMPONENTS p3physics p3particlesystem) install(TARGETS pandaphysics DESTINATION lib) From fef2fff1f1a0e4697556553a0f4dffb38152e51a Mon Sep 17 00:00:00 2001 From: Psychotropos Date: Mon, 11 Jun 2018 13:45:06 +0100 Subject: [PATCH 465/744] cmake: Actually install the p3direct library during the CMake install process --- direct/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 9e6e238d03..8d0b25a714 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -34,6 +34,7 @@ if(HAVE_PYTHON) endif() # Installation: +install(TARGETS p3direct DESTINATION lib) if(HAVE_PYTHON) set(DIRECT_INSTALL_DIRECTORIES actor cluster controls directbase directdevices directnotify directscripts From 6b660a5c582c0d0ad48da3999506ea62abcd2917 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 18:40:59 -0600 Subject: [PATCH 466/744] CMake: Fix metalib linkage against pandaexpress --- panda/src/pgraph/CMakeLists.txt | 2 +- panda/src/recorder/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 35420548fc..7c136f7a38 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -220,7 +220,7 @@ set(P3PGRAPH_IGATEEXT composite_sources(p3pgraph P3PGRAPH_SOURCES) add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) -target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath p3downloader) +target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath pandaexpress) target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) install(TARGETS p3pgraph DESTINATION lib) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 2964e90c96..fe479652ca 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -19,7 +19,7 @@ set(P3RECORDER_SOURCES composite_sources(p3recorder P3RECORDER_SOURCES) add_component_library(p3recorder NOINIT SYMBOL BUILDING_PANDA_RECORDER ${P3RECORDER_HEADERS} ${P3RECORDER_SOURCES}) -target_link_libraries(p3recorder p3dgraph p3downloader) +target_link_libraries(p3recorder p3dgraph pandaexpress) target_interrogate(p3recorder ALL) install(TARGETS p3recorder DESTINATION lib) From d6d6df83ef7e970f274277564db1f1b8e067db99 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 18:42:50 -0600 Subject: [PATCH 467/744] CMake: Move Python detection to Package.cmake --- dtool/Config.cmake | 40 ---------------------------------------- dtool/Package.cmake | 43 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 40 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 4c38728b51..168faf2fca 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -417,46 +417,6 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # Now let's check for the presence of various thirdparty libraries. # -# Is Python installed, and should Python interfaces be generated? -set(WANT_PYTHON_VERSION "" - CACHE STRING "Which Python version to seek out for building Panda3D against.") - -find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) -find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) -if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) - set(PYTHON_FOUND ON) -else() - set(PYTHON_FOUND OFF) -endif() - -package_option(PYTHON DEFAULT ON - "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE -is also enabled, Python bindings will be generated.") - -# Also detect the optimal install paths: -if(HAVE_PYTHON) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False))" - OUTPUT_VARIABLE _LIB_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" - OUTPUT_VARIABLE _ARCH_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - - set(PYTHON_LIB_INSTALL_DIR "${_LIB_DIR}" CACHE STRING - "Path to the Python architecture-independent package directory.") - - set(PYTHON_ARCH_INSTALL_DIR "${_ARCH_DIR}" CACHE STRING - "Path to the Python architecture-dependent package directory.") - - # Always include Python, because we include it pretty much everywhere - # though we don't usually want to link it in as well. - include_directories(${PYTHON_INCLUDE_DIRS}) -endif() - # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. diff --git a/dtool/Package.cmake b/dtool/Package.cmake index ae3afb0789..468b123ea5 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,3 +1,46 @@ +# +# ------------ Python ------------ +# + +set(WANT_PYTHON_VERSION "" + CACHE STRING "Which Python version to seek out for building Panda3D against.") + +find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) +find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) +if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) + set(PYTHON_FOUND ON) +else() + set(PYTHON_FOUND OFF) +endif() + +package_option(PYTHON DEFAULT ON + "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE +is also enabled, Python bindings will be generated.") + +# Also detect the optimal install paths: +if(HAVE_PYTHON) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False))" + OUTPUT_VARIABLE _LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" + OUTPUT_VARIABLE _ARCH_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + + set(PYTHON_LIB_INSTALL_DIR "${_LIB_DIR}" CACHE STRING + "Path to the Python architecture-independent package directory.") + + set(PYTHON_ARCH_INSTALL_DIR "${_ARCH_DIR}" CACHE STRING + "Path to the Python architecture-dependent package directory.") + + # Always include Python, because we include it pretty much everywhere + # though we don't usually want to link it in as well. + include_directories(${PYTHON_INCLUDE_DIRS}) +endif() + # # ------------ Eigen ------------ # From 21a30a8429008cbd4ee5038fe72c6c0dd82b26f4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 18:49:28 -0600 Subject: [PATCH 468/744] CMake: Make INTERROGATE_PYTHON_INTERFACE option dependent This also makes it sufficient for turning on Interrogate. --- cmake/macros/Interrogate.cmake | 2 +- dtool/Config.cmake | 6 ++++-- dtool/LocalSetup.cmake | 2 +- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 55fcee0ed0..c45f99a950 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -237,7 +237,7 @@ endfunction(interrogate_sources) # Python module when it's initialized. # function(add_python_module module) - if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE) + if(NOT INTERROGATE_PYTHON_INTERFACE) return() endif() diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 168faf2fca..06e8a0448b 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -6,6 +6,8 @@ # generate build scripts appropriate to each environment. # +include(CMakeDependentOption) + # Define the plaform we are building on. # The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN" # are automatically provided by CMAKE. "APPLE" is also provided by @@ -255,11 +257,11 @@ mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST) # The following options relate to interrogate, the tool that is # used to generate bindings for non-C++ languages. -option(INTERROGATE_PYTHON_INTERFACE +cmake_dependent_option(INTERROGATE_PYTHON_INTERFACE "Do you want to generate a Python-callable interrogate interface? This is only necessary if you plan to make calls into Panda from a program written in Python. This is done only if HAVE_PYTHON is also -true." ON) +true." ON "HAVE_PYTHON" OFF) set(INTERROGATE_C_INTERFACE "Do you want to generate a C-callable interrogate interface? This diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 0dadc4c5c3..3b7b603336 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -256,7 +256,7 @@ else() endif() message("") -if(HAVE_INTERROGATE AND HAVE_PYTHON) +if(INTERROGATE_PYTHON_INTERFACE) message("Compilation will generate Python interfaces for Python ${PYTHON_VERSION_STRING}.") else() message("Configuring Panda WITHOUT Python interfaces.") diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 6b6858a98c..736178008c 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -46,7 +46,7 @@ install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) # Note we don't use the regular Interrogate macros; this has some custom flags # that would make it not worthwhile. -if(NOT HAVE_PYTHON OR NOT INTERROGATE_PYTHON_INTERFACE) +if(NOT INTERROGATE_PYTHON_INTERFACE) return() endif() From 29bc62bf9bdb5531f32e53c6ba665a8ea68ca579 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 18:51:12 -0600 Subject: [PATCH 469/744] CMake: Alias Interrogate This allows us to have a different name for Interrogate on the host vs. Interrogate on the target platform, which facilitates cross-compiling. --- cmake/macros/Interrogate.cmake | 8 ++++---- dtool/Config.cmake | 26 ++++++-------------------- dtool/src/interrogate/CMakeLists.txt | 15 +++++++++++++-- dtool/src/interrogatedb/CMakeLists.txt | 4 ++-- 4 files changed, 25 insertions(+), 28 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index c45f99a950..5cbecfb626 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -208,7 +208,7 @@ function(interrogate_sources target output database language_flags) add_custom_command( OUTPUT "${output}" "${database}" - COMMAND interrogate + COMMAND host_interrogate -oc "${output}" -od "${database}" -srcdir "${srcdir}" @@ -223,7 +223,7 @@ function(interrogate_sources target output database language_flags) ${include_flags} ${scan_sources} ${extensions} - DEPENDS interrogate ${sources} ${extensions} ${nfiles} + DEPENDS host_interrogate ${sources} ${extensions} ${nfiles} COMMENT "Interrogating ${target}" ) endfunction(interrogate_sources) @@ -279,13 +279,13 @@ function(add_python_module module) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" - COMMAND interrogate_module + COMMAND host_interrogate_module -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" -module ${module} -library ${module} ${import_flags} ${INTERROGATE_MODULE_OPTIONS} ${IMOD_FLAGS} ${infiles} - DEPENDS interrogate_module ${infiles} + DEPENDS host_interrogate_module ${infiles} COMMENT "Generating module ${module}" ) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 06e8a0448b..5e1ddaa55b 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -257,6 +257,12 @@ mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST) # The following options relate to interrogate, the tool that is # used to generate bindings for non-C++ languages. +option(WANT_INTERROGATE + "Do you want to include Interrogate in the installation? This +program reads C++ source files and generates bindings for another +language. If you won't be building interfaces for other languages, +you don't need the program." ON) + cmake_dependent_option(INTERROGATE_PYTHON_INTERFACE "Do you want to generate a Python-callable interrogate interface? This is only necessary if you plan to make calls into Panda from a @@ -270,12 +276,6 @@ a C calling convention. It should be useful for most other kinds of scripting language; the VR Studio used to use this to make calls into Panda from Squeak." OFF) -option(HAVE_INTERROGATE - "Do you even want to build interrogate at all? This is the program -that reads our C++ source files and generates one of the above -interfaces. If you won't be building the interfaces, you don't -need the program." ON) - set(INTERROGATE_OPTIONS "-fnames;-string;-refcount;-assert" CACHE STRING "What additional options should be passed to interrogate when generating either of the above two interfaces? Generally, you @@ -285,22 +285,8 @@ option(INTERROGATE_VERBOSE "Set this if you would like interrogate to generate advanced debugging information." OFF) -set(INTERROGATE "interrogate" CACHE STRING - "What's the name of the interrogate binary to run? The default -specified is the one that is built as part of DTOOL. If you have a -prebuilt binary standing by (for instance, if you are cross-compiling -and cannot run the built version), specify its name instead.") - -set(INTERROGATE_MODULE "interrogate_module" CACHE STRING - "Same as INTERROGATE, except for the interrogate_module binary.") - mark_as_advanced(INTERROGATE_OPTIONS) -if(NOT CMAKE_CROSSCOMPILING) - mark_as_advanced(INTERROGATE INTERROGATE_MODULE) -endif() - - # # The following options have to do with the memory allocation system # that will be used by Panda3D. diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 79f7b91c20..cf54d19481 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -54,9 +54,20 @@ composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) -install(TARGETS interrogate DESTINATION bin) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) -install(TARGETS interrogate_module DESTINATION bin) + +if(NOT CMAKE_CROSSCOMPILING) + add_executable(host_interrogate ALIAS interrogate) + add_executable(host_interrogate_module ALIAS interrogate_module) +endif() + +if(WANT_INTERROGATE) + install(TARGETS interrogate DESTINATION bin) + install(TARGETS interrogate_module DESTINATION bin) +else() + set_target_properties(interrogate interrogate_module + PROPERTIES EXCLUDE_FROM_ALL ON) +endif() diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 736178008c..c4d02f25a0 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -52,7 +52,7 @@ endif() add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" - COMMAND interrogate + COMMAND host_interrogate -D EXPCL_INTERROGATEDB= -nodb -python -promiscuous -module panda3d.interrogatedb @@ -61,7 +61,7 @@ add_custom_command( -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" -oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" ${P3INTERROGATEDB_IGATE} - DEPENDS interrogate ${P3INTERROGATEDB_IGATE} + DEPENDS host_interrogate ${P3INTERROGATEDB_IGATE} COMMENT "Interrogating interrogatedb" ) From 4c8693f01940d0492c7efdfcb2ae27ac45ce4575 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Jun 2018 19:54:29 -0600 Subject: [PATCH 470/744] CMake: Run pytest as part of CTest --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bef1ac8cbd..297ec2f3a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,14 @@ if(BUILD_MODELS) DESTINATION share/panda3d) endif() +if(INTERROGATE_PYTHON_INTERFACE) + # If we built the Python interface, run the test suite. Note, we do NOT test + # for pytest before adding this test. If the user doesn't have pytest, we'd + # like for the tests to fail. + + add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests") +endif() + # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, # but in older versions of Panda3D, one would use # from pandac.PandaModules import * From 0feadd97750cfe0e45c95bd7d52474ff9fac9a0b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 14 Aug 2018 17:06:46 -0600 Subject: [PATCH 471/744] CMake: Use OPENSSL package correctly in p3prc --- dtool/src/prc/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 3f352a3137..e6457f8685 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -76,7 +76,8 @@ target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) # The extensions need py_panda.h and extension.h from interrogatedb target_include_directories(p3prc PUBLIC $) -target_link_libraries(p3prc p3dtool ${_OPENSSL_LIBRARIES}) +target_link_libraries(p3prc p3dtool) +target_use_packages(p3prc OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) install(TARGETS p3prc DESTINATION lib) From 4af8a04944415f2c0e0fd5c3604fca77a8578ad9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 14 Aug 2018 17:07:01 -0600 Subject: [PATCH 472/744] CMake: Set warning levels --- CMakeLists.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 297ec2f3a1..4a891f79d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,31 @@ if(WIN32) set(CMAKE_DEBUG_POSTFIX "_d") endif() +# Set warning levels +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") +else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +endif() +if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + set(disable_flags "-Wno-unused-function -Wno-unused-parameter") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") + + if(MSVC) + # Clang behaving as MSVC + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-microsoft-template") + endif() +endif() +if(WIN32) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option AND target_use_packages From 0a36a41f93fe59e3ba2c94fe27cc2f18cbdf3582 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 15 Aug 2018 20:35:49 -0600 Subject: [PATCH 473/744] CMake: Bypass warning about CMP0054 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a891f79d8..52f286ebfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,7 +48,7 @@ else() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") endif() -if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") +if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") set(disable_flags "-Wno-unused-function -Wno-unused-parameter") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") From 6b2d417ae41c2e09db09ad0f99d20825fbb5b73e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 16 Aug 2018 13:42:34 -0600 Subject: [PATCH 474/744] CMake: Put Windows DLLs in 'bin', not 'lib' --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52f286ebfe..ef5f6fd952 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -38,6 +38,9 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(CMAKE_SHARED_MODULE_PREFIX "lib") if(WIN32) set(CMAKE_DEBUG_POSTFIX "_d") + + # On Windows, modules (DLLs) are located in bin; lib is just for .lib files + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") endif() # Set warning levels From d94f27bedd8e61b0aa5b201b7d5c736096d7cfa2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 16 Aug 2018 22:28:06 -0600 Subject: [PATCH 475/744] CMake: Update dcparse(r) as latter now has EXPCL --- direct/src/dcparse/CMakeLists.txt | 14 ++++---------- direct/src/dcparser/CMakeLists.txt | 4 ++-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index 1c4a4b55a2..18e8272596 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,10 +1,4 @@ -if(WIN32) - # We can't build dcparse on Windows, because the dcparser symbols aren't - # properly exported from p3direct.dll. - return() -endif() - -add_executable(dcparse dcparse.cxx) -target_compile_definitions(dcparse PUBLIC WITHIN_PANDA) -target_link_libraries(dcparse p3direct) -install(TARGETS dcparse DESTINATION bin) +add_executable(p3dcparse dcparse.cxx) +target_compile_definitions(p3dcparse PUBLIC WITHIN_PANDA) +target_link_libraries(p3dcparse p3direct) +install(TARGETS p3dcparse DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 681ab48711..99a4f13844 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -46,8 +46,8 @@ set(P3DCPARSER_PARSER_SOURCES dcLexer.cxx) composite_sources(p3dcparser P3DCPARSER_SOURCES) -add_component_library(p3dcparser NOINIT ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} - ${P3DCPARSER_PARSER_SOURCES}) +add_component_library(p3dcparser NOINIT SYMBOL BUILDING_DIRECT_DCPARSER + ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparser p3directbase panda) target_use_packages(p3dcparser PYTHON) From 9c3841177b28b553d88b320cb157ce5b3082f7f6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 19 Aug 2018 15:39:42 -0600 Subject: [PATCH 476/744] CMake: Move dtool_config.h to a configuration-specific dir --- CMakeLists.txt | 2 +- dtool/LocalSetup.cmake | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ef5f6fd952..03ed8286a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -86,7 +86,7 @@ include(RunPzip) # Defines run_pzip function include(Versioning) # Hooks 'add_library' to apply VERSION/SOVERSION # Add the include path for source and header files generated by CMake -include_directories("${PROJECT_BINARY_DIR}/include") +include_directories("${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR}") # Determine which trees to build. option(BUILD_DTOOL "Build the dtool source tree." ON) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 3b7b603336..2bbf25cc93 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -280,6 +280,14 @@ message("See dtool_config.h for more details about the specified configuration." message("") # Generate dtool_config.h -configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") -include_directories("${PROJECT_BINARY_DIR}/include") -#install(FILES "${PROJECT_BINARY_DIR}/dtool_config.h" DESTINATION include/panda3d) +if("${CMAKE_CFG_INTDIR}" STREQUAL ".") + # Single-configuration generator + set(intdir ".") +else() + # Multi-configuration generator + set(intdir "${CMAKE_BUILD_TYPE}") +endif() + +configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h") +install(FILES "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h" + DESTINATION include/panda3d) From 67e6c4299e3b4222dc8a7cc914d0c73e50d79221 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 19 Aug 2018 16:58:57 -0600 Subject: [PATCH 477/744] CMake: Reorganize Python installation in direct/CMakeLists.txt --- direct/CMakeLists.txt | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 8d0b25a714..771e43ec14 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -23,19 +23,17 @@ endif() add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONENTS}) set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") +# Installation: +install(TARGETS p3direct DESTINATION lib) + if(HAVE_PYTHON) + # Now for the Python side of everything + add_python_module(direct p3dcparser p3deadrec p3distributed p3interval p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core) - # Make an __init__.py pointing at the source directory so users can run - # Panda3D code straight from their build path: - file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/__init__.py" "__path__.insert(0,r\"${CMAKE_CURRENT_SOURCE_DIR}/src\")") -endif() - -# Installation: -install(TARGETS p3direct DESTINATION lib) -if(HAVE_PYTHON) + # Copy Python source files into the build directory set(DIRECT_INSTALL_DIRECTORIES actor cluster controls directbase directdevices directnotify directscripts directtools directutil distributed extensions extensions_native ffi filter @@ -47,15 +45,14 @@ if(HAVE_PYTHON) DIRECTORY "src/${dir}" DESTINATION "${PROJECT_BINARY_DIR}/direct" FILES_MATCHING PATTERN "*.py") - install( - DIRECTORY "src/${dir}" - DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct" - FILES_MATCHING PATTERN "*.py") endforeach() # We also need an __init__.py file, which we have to generate: file(WRITE "${PROJECT_BINARY_DIR}/direct/__init__.py" "") + + # Install all files install( - FILES "${PROJECT_BINARY_DIR}/direct/__init__.py" - DESTINATION "${PYTHON_LIB_INSTALL_DIR}/direct") + DIRECTORY "${PROJECT_BINARY_DIR}/direct" + DESTINATION "${PYTHON_LIB_INSTALL_DIR}" + FILES_MATCHING REGEX "\\.py[co]?$") endif() From 76378c8990f9e5aa87998f7a7bf73108aa294e2e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 19 Aug 2018 23:10:20 -0600 Subject: [PATCH 478/744] CMake: Ask Python for preferred binary extension suffix --- cmake/macros/Interrogate.cmake | 4 +--- dtool/Package.cmake | 29 +++++++++++++++++++------- dtool/src/interrogatedb/CMakeLists.txt | 1 + 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 5cbecfb626..44d2aed8e1 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -297,9 +297,7 @@ function(add_python_module module) LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" PREFIX "" ) - if(WIN32 AND NOT CYGWIN) - set_target_properties(${module} PROPERTIES SUFFIX ".pyd") - endif() + set_target_properties(${module} PROPERTIES SUFFIX "${PYTHON_EXTENSION_SUFFIX}") install(TARGETS ${module} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 468b123ea5..43b9fdc23b 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -22,13 +22,29 @@ if(HAVE_PYTHON) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False))" - OUTPUT_VARIABLE _LIB_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE _LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" - OUTPUT_VARIABLE _ARCH_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE _ARCH_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from sysconfig import get_config_var as g; print((g('EXT_SUFFIX') or g('SO'))[:])" + OUTPUT_VARIABLE _EXT_SUFFIX + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(NOT _EXT_SUFFIX) + if(CYGWIN) + set(_EXT_SUFFIX ".dll") + elseif(WIN32) + set(_EXT_SUFFIX ".pyd") + else() + set(_EXT_SUFFIX ".so") + endif() + endif() set(PYTHON_LIB_INSTALL_DIR "${_LIB_DIR}" CACHE STRING "Path to the Python architecture-independent package directory.") @@ -36,9 +52,8 @@ if(HAVE_PYTHON) set(PYTHON_ARCH_INSTALL_DIR "${_ARCH_DIR}" CACHE STRING "Path to the Python architecture-dependent package directory.") - # Always include Python, because we include it pretty much everywhere - # though we don't usually want to link it in as well. - include_directories(${PYTHON_INCLUDE_DIRS}) + set(PYTHON_EXTENSION_SUFFIX "${_EXT_SUFFIX}" CACHE STRING + "Suffix for Python binary extension modules.") endif() # diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index c4d02f25a0..305e64efbe 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -67,6 +67,7 @@ add_custom_command( add_library(interrogatedb ${MODULE_TYPE} "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") +set_target_properties(interrogatedb PROPERTIES SUFFIX "${PYTHON_EXTENSION_SUFFIX}") target_use_packages(interrogatedb PYTHON) target_link_libraries(interrogatedb p3dtoolconfig) From ab2ad9927845fc89a3d729489da674eaf0fb7302 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 23 Aug 2018 00:42:54 -0600 Subject: [PATCH 479/744] CMake: Don't use GREATER_EQUAL It's not compatible with CMake 3.0. --- dtool/src/dtoolbase/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index fb201d42c0..9c6a35faad 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -2,7 +2,7 @@ configure_file(pandaVersion.h.in pandaVersion.h) configure_file(checkPandaVersion.h.in checkPandaVersion.h) configure_file(checkPandaVersion.cxx.in checkPandaVersion.cxx) -if(CMAKE_CXX_STANDARD GREATER_EQUAL 17) +if(CMAKE_CXX_STANDARD GREATER 16) # This serves as a reminder to update checkPandaVersion.h.in when we upgrade # to C++17, which supports inline variables - a cleaner way of depending on # the Panda version symbol from a header than what we're currently doing. From fa1e1a2e637504cd63732d72967d104fff8e3c76 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 31 Aug 2018 19:07:26 -0600 Subject: [PATCH 480/744] CMake: Tidy up installation directory Don't install "object-Configuration/" directories when using metalibs, and also put .dll files in bin/ on Windows. --- CMakeLists.txt | 4 ++++ direct/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 4 +++- direct/src/deadrec/CMakeLists.txt | 4 +++- direct/src/distributed/CMakeLists.txt | 4 +++- direct/src/interval/CMakeLists.txt | 4 +++- direct/src/motiontrail/CMakeLists.txt | 4 +++- direct/src/showbase/CMakeLists.txt | 4 +++- dtool/metalibs/dtool/CMakeLists.txt | 2 +- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 +- dtool/src/dconfig/CMakeLists.txt | 4 +++- dtool/src/dtoolbase/CMakeLists.txt | 4 +++- dtool/src/dtoolutil/CMakeLists.txt | 4 +++- dtool/src/interrogatedb/CMakeLists.txt | 4 +++- dtool/src/prc/CMakeLists.txt | 4 +++- panda/metalibs/panda/CMakeLists.txt | 2 +- panda/metalibs/pandaegg/CMakeLists.txt | 2 +- panda/metalibs/pandaexpress/CMakeLists.txt | 2 +- panda/metalibs/pandagl/CMakeLists.txt | 2 +- panda/metalibs/pandaphysics/CMakeLists.txt | 2 +- panda/src/audio/CMakeLists.txt | 4 +++- panda/src/audiotraits/CMakeLists.txt | 6 +++--- panda/src/chan/CMakeLists.txt | 4 +++- panda/src/char/CMakeLists.txt | 4 +++- panda/src/collide/CMakeLists.txt | 4 +++- panda/src/cull/CMakeLists.txt | 4 +++- panda/src/device/CMakeLists.txt | 4 +++- panda/src/dgraph/CMakeLists.txt | 4 +++- panda/src/display/CMakeLists.txt | 4 +++- panda/src/downloader/CMakeLists.txt | 4 +++- panda/src/dxml/CMakeLists.txt | 4 +++- panda/src/egg/CMakeLists.txt | 4 +++- panda/src/egg2pg/CMakeLists.txt | 4 +++- panda/src/event/CMakeLists.txt | 4 +++- panda/src/express/CMakeLists.txt | 4 +++- panda/src/ffmpeg/CMakeLists.txt | 2 +- panda/src/framework/CMakeLists.txt | 2 +- panda/src/glgsg/CMakeLists.txt | 4 +++- panda/src/glstuff/CMakeLists.txt | 4 +++- panda/src/glxdisplay/CMakeLists.txt | 4 +++- panda/src/gobj/CMakeLists.txt | 4 +++- panda/src/grutil/CMakeLists.txt | 4 +++- panda/src/gsgbase/CMakeLists.txt | 4 +++- panda/src/linmath/CMakeLists.txt | 4 +++- panda/src/mathutil/CMakeLists.txt | 4 +++- panda/src/movies/CMakeLists.txt | 4 +++- panda/src/nativenet/CMakeLists.txt | 4 +++- panda/src/net/CMakeLists.txt | 4 +++- panda/src/ode/CMakeLists.txt | 2 +- panda/src/parametrics/CMakeLists.txt | 4 +++- panda/src/particlesystem/CMakeLists.txt | 4 +++- panda/src/pgraph/CMakeLists.txt | 4 +++- panda/src/pgraphnodes/CMakeLists.txt | 4 +++- panda/src/pgui/CMakeLists.txt | 4 +++- panda/src/physics/CMakeLists.txt | 4 +++- panda/src/pipeline/CMakeLists.txt | 4 +++- panda/src/pnmimage/CMakeLists.txt | 4 +++- panda/src/pnmimagetypes/CMakeLists.txt | 4 +++- panda/src/pnmtext/CMakeLists.txt | 4 +++- panda/src/pstatclient/CMakeLists.txt | 4 +++- panda/src/putil/CMakeLists.txt | 4 +++- panda/src/recorder/CMakeLists.txt | 4 +++- panda/src/text/CMakeLists.txt | 4 +++- panda/src/tform/CMakeLists.txt | 4 +++- panda/src/x11display/CMakeLists.txt | 4 +++- 65 files changed, 174 insertions(+), 66 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03ed8286a8..7e23de112f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +set(MODULE_DESTINATION "lib") # Runtime code assumes that dynamic modules have a "lib" prefix; Windows # assumes that debug libraries have a _d suffix. @@ -41,6 +42,9 @@ if(WIN32) # On Windows, modules (DLLs) are located in bin; lib is just for .lib files set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + if(BUILD_SHARED_LIBS) + set(MODULE_DESTINATION "bin") + endif() endif() # Set warning levels diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 771e43ec14..cfda39d6b0 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -24,7 +24,7 @@ add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONEN set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") # Installation: -install(TARGETS p3direct DESTINATION lib) +install(TARGETS p3direct DESTINATION lib RUNTIME DESTINATION bin) if(HAVE_PYTHON) # Now for the Python side of everything diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 99a4f13844..9a4faff8e9 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -53,5 +53,7 @@ target_link_libraries(p3dcparser p3directbase panda) target_use_packages(p3dcparser PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) -install(TARGETS p3dcparser DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3dcparser DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DCPARSER_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 50813ca96e..34bf4f2e48 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -11,5 +11,7 @@ add_component_library(p3deadrec SYMBOL BUILDING_DIRECT_DEADREC target_link_libraries(p3deadrec p3directbase panda) target_interrogate(p3deadrec ALL) -install(TARGETS p3deadrec DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3deadrec DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DEADREC_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index e44be0d5c1..4ae6e406bd 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -21,5 +21,7 @@ target_link_libraries(p3distributed p3directbase p3dcparser panda) target_use_packages(p3distributed PYTHON) target_interrogate(p3distributed ALL) -install(TARGETS p3distributed DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3distributed DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DISTRIBUTED_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 397617c1e8..4ded7c6463 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -41,5 +41,7 @@ add_component_library(p3interval SYMBOL BUILDING_DIRECT_INTERVAL target_link_libraries(p3interval p3directbase panda) target_interrogate(p3interval ALL) -install(TARGETS p3interval DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3interval DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3INTERVAL_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/motiontrail/CMakeLists.txt b/direct/src/motiontrail/CMakeLists.txt index 6e70bc5a33..3a54b9873b 100644 --- a/direct/src/motiontrail/CMakeLists.txt +++ b/direct/src/motiontrail/CMakeLists.txt @@ -11,5 +11,7 @@ add_component_library(p3motiontrail SYMBOL BUILDING_DIRECT_MOTIONTRAIL target_link_libraries(p3motiontrail p3directbase panda) target_interrogate(p3motiontrail ALL) -install(TARGETS p3motiontrail DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3motiontrail DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3MOTIONTRAIL_HEADERS} DESTINATION include/panda3d) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index e9bdc8e9f5..0946ca10c5 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -3,4 +3,6 @@ add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) -install(TARGETS p3showbase DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3showbase DESTINATION lib RUNTIME DESTINATION bin) +endif() diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 78836cd833..4dee10d908 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,3 +1,3 @@ add_metalib(p3dtool INIT init_libdtool dtool.h COMPONENTS p3dtoolutil p3dtoolbase) -install(TARGETS p3dtool DESTINATION lib) +install(TARGETS p3dtool DESTINATION lib RUNTIME DESTINATION bin) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 85c89fc4bc..977c3e0ede 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,3 +1,3 @@ set(DTOOLCONFIG_LINK_TARGETS p3prc p3dconfig p3interrogatedb) add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) -install(TARGETS p3dtoolconfig DESTINATION lib) +install(TARGETS p3dtoolconfig DESTINATION lib RUNTIME DESTINATION bin) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 58a85c4f98..5292450558 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -10,5 +10,7 @@ add_component_library(p3dconfig NOINIT SYMBOL BUILDING_DTOOL_DCONFIG ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) target_link_libraries(p3dconfig p3prc) -install(TARGETS p3dconfig DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3dconfig DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DCONFIG_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 9c6a35faad..e61ea4f8cb 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -93,5 +93,7 @@ target_include_directories(p3dtoolbase PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_use_packages(p3dtoolbase THREADS EIGEN) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) -install(TARGETS p3dtoolbase DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3dtoolbase DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 182b69f91d..872eab7b1d 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -78,5 +78,7 @@ if(APPLE) target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY}) endif() -install(TARGETS p3dtoolutil DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3dtoolutil DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DTOOLUTIL_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 305e64efbe..20e942b7d0 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -39,7 +39,9 @@ add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB target_link_libraries(p3interrogatedb p3dconfig) target_use_packages(p3interrogatedb PYTHON) -install(TARGETS p3interrogatedb DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3interrogatedb DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) # ALSO: This has an Interrogate binding! Take care of that if we want it. diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index e6457f8685..8ba005115e 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -80,5 +80,7 @@ target_link_libraries(p3prc p3dtool) target_use_packages(p3prc OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) -install(TARGETS p3prc DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3prc DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PRC_HEADERS} DESTINATION include/panda3d) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index a628fe3ad6..67e0180619 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -13,4 +13,4 @@ endif() add_metalib(panda INIT init_libpanda panda.h COMPONENTS ${PANDA_LINK_TARGETS}) -install(TARGETS panda DESTINATION lib) +install(TARGETS panda DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 80ea6d9cd1..2a1f1085cb 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -7,4 +7,4 @@ add_metalib(pandaegg COMPONENTS p3egg p3egg2pg) target_link_libraries(pandaegg panda) -install(TARGETS pandaegg DESTINATION lib) +install(TARGETS pandaegg DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/metalibs/pandaexpress/CMakeLists.txt b/panda/metalibs/pandaexpress/CMakeLists.txt index 75fa8c7438..d76f00ca11 100644 --- a/panda/metalibs/pandaexpress/CMakeLists.txt +++ b/panda/metalibs/pandaexpress/CMakeLists.txt @@ -2,4 +2,4 @@ add_metalib(pandaexpress INIT init_libpandaexpress pandaexpress.h COMPONENTS p3downloader p3express) -install(TARGETS pandaexpress DESTINATION lib) +install(TARGETS pandaexpress DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index d65abc48f5..5bcfcd2164 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -28,5 +28,5 @@ if(HAVE_GL) add_metalib(pandagl ${MODULE_TYPE} pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS}) set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) - install(TARGETS pandagl DESTINATION lib) + install(TARGETS pandagl DESTINATION ${MODULE_DESTINATION}) endif() diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index 5a9d2ed0db..1f55fb4130 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -2,4 +2,4 @@ add_metalib(pandaphysics INIT init_libpandaphysics pandaphysics.h COMPONENTS p3physics p3particlesystem) -install(TARGETS pandaphysics DESTINATION lib) +install(TARGETS pandaphysics DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index f31638dd51..9d823bc896 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -26,5 +26,7 @@ add_component_library(p3audio NOINIT SYMBOL BUILDING_PANDA_AUDIO target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) -install(TARGETS p3audio DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3audio DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3AUDIO_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 266ca6f425..63bf44b87b 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -27,7 +27,7 @@ if(HAVE_RAD_MSS) target_link_libraries(p3miles_audio panda) target_use_packages(p3miles_audio MILES) - install(TARGETS p3miles_audio DESTINATION lib) + install(TARGETS p3miles_audio DESTINATION lib RUNTIME DESTINATION bin) endif() if(HAVE_FMODEX) @@ -46,7 +46,7 @@ if(HAVE_FMODEX) target_link_libraries(p3fmod_audio panda) target_use_packages(p3fmod_audio FMODEX) - install(TARGETS p3fmod_audio DESTINATION lib) + install(TARGETS p3fmod_audio DESTINATION lib RUNTIME DESTINATION bin) endif() if(HAVE_OPENAL) @@ -66,5 +66,5 @@ if(HAVE_OPENAL) target_link_libraries(p3openal_audio panda) target_use_packages(p3openal_audio OPENAL) - install(TARGETS p3openal_audio DESTINATION lib) + install(TARGETS p3openal_audio DESTINATION lib RUNTIME DESTINATION bin) endif() diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 42278738e2..46d2076e23 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -58,5 +58,7 @@ add_component_library(p3chan NOINIT SYMBOL BUILDING_PANDA_CHAN target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) -install(TARGETS p3chan DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3chan DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3CHAN_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 7e62194281..f2c6cc9f69 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -24,5 +24,7 @@ add_component_library(p3char SYMBOL BUILDING_PANDA_CHAR target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) -install(TARGETS p3char DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3char DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3CHAR_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index bd6f39c377..ef29604e87 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -68,7 +68,9 @@ add_component_library(p3collide SYMBOL BUILDING_PANDA_COLLIDE target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) -install(TARGETS p3collide DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3collide DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3COLLIDE_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index 47b7a7ee47..527dc439d0 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -26,5 +26,7 @@ add_component_library(p3cull SYMBOL BUILDING_PANDA_CULL target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) -install(TARGETS p3cull DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3cull DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3CULL_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 6de38bcc43..b31f99b31d 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -32,5 +32,7 @@ add_component_library(p3device SYMBOL BUILDING_PANDA_DEVICE target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) -install(TARGETS p3device DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3device DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DEVICE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 60ec88cbe8..417848df2a 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -17,5 +17,7 @@ add_component_library(p3dgraph NOINIT SYMBOL BUILDING_PANDA_DGRAPH target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) -install(TARGETS p3dgraph DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3dgraph DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DGRAPH_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 3f7fb00253..a8d6076f00 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -92,7 +92,9 @@ add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY target_link_libraries(p3display p3cull p3pgraphnodes) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) -install(TARGETS p3display DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3display DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DISPLAY_HEADERS} DESTINATION include/panda3d) if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 023acf2db5..6f03d4bcba 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -73,5 +73,7 @@ add_component_library(p3downloader SYMBOL BUILDING_PANDA_DOWNLOADER target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) -install(TARGETS p3downloader DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3downloader DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DOWNLOADER_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 82db1ef516..2dda39451d 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -17,5 +17,7 @@ add_component_library(p3dxml SYMBOL BUILDING_PANDA_DXML target_link_libraries(p3dxml pandaexpress) target_interrogate(p3dxml ALL) -install(TARGETS p3dxml DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3dxml DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3DXML_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 341938f391..21d00bade7 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -107,5 +107,7 @@ add_component_library(p3egg SYMBOL BUILDING_PANDA_EGG target_link_libraries(p3egg panda) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) -install(TARGETS p3egg DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3egg DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3EGG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index e9ede6c215..5b444c043c 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -38,5 +38,7 @@ add_component_library(p3egg2pg SYMBOL BUILDING_PANDA_EGG2PG target_link_libraries(p3egg2pg panda p3egg) target_interrogate(p3egg2pg ALL) -install(TARGETS p3egg2pg DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3egg2pg DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3EGG2PG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index e3c0c0ab1e..46556369d0 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -50,7 +50,9 @@ add_component_library(p3event NOINIT SYMBOL BUILDING_PANDA_EVENT target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) -install(TARGETS p3event DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3event DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3EVENT_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index ff17d24592..899fe215e4 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -157,7 +157,9 @@ if(WIN32) target_link_libraries(p3express advapi32.lib ws2_32.lib) endif() -install(TARGETS p3express DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3express DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3EXPRESS_HEADERS} DESTINATION include/panda3d) #add_executable(p3expressTestTypes test_types.cxx) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 8f78a93ac5..09d7e38c3d 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -25,5 +25,5 @@ set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) target_link_libraries(p3ffmpeg panda) target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) -install(TARGETS p3ffmpeg DESTINATION lib) +install(TARGETS p3ffmpeg DESTINATION lib RUNTIME DESTINATION bin) install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index ecf24a531c..12ca4a0077 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -51,5 +51,5 @@ add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) -install(TARGETS p3framework DESTINATION lib) +install(TARGETS p3framework DESTINATION lib RUNTIME DESTINATION bin) install(FILES ${P3FRAMEWORK_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index ca961f5b65..0d030a7f0a 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -18,5 +18,7 @@ target_link_libraries(p3glgsg p3glstuff panda ${OPENGL_LIBRARIES}) target_use_packages(p3glgsg CG) -install(TARGETS p3glgsg DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3glgsg DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3GLGSG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 67af226c88..8118d6fc74 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -37,5 +37,7 @@ composite_sources(p3glstuff P3GLSTUFF_SOURCES) add_component_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) target_link_libraries(p3glstuff panda) -install(TARGETS p3glstuff DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3glstuff DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index edb9544df7..19aab8a49f 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -28,4 +28,6 @@ add_component_library(p3glxdisplay SYMBOL BUILDING_PANDA_GLXDISPLAY ${P3GLXDISPLAY_HEADERS} ${P3GLXDISPLAY_SOURCES}) target_link_libraries(p3glxdisplay p3glgsg p3x11display) -install(TARGETS p3glxdisplay DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3glxdisplay DESTINATION lib) +endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 6da64d7ead..d3301f64de 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -174,7 +174,9 @@ target_link_libraries(p3gobj p3gsgbase p3pnmimage) target_use_packages(p3gobj ZLIB SQUISH CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) -install(TARGETS p3gobj DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3gobj DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3GOBJ_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 7dc1c7fb00..7a8be4135e 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -46,5 +46,7 @@ if(HAVE_AUDIO) endif() target_interrogate(p3grutil ALL) -install(TARGETS p3grutil DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3grutil DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3GRUTIL_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 27ef4199f1..81502f4bab 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -16,7 +16,9 @@ add_component_library(p3gsgbase NOINIT SYMBOL BUILDING_PANDA_GSGBASE target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) -install(TARGETS p3gsgbase DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3gsgbase DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3GSGBASE_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 5157a0d38b..6fd6b342b9 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -50,7 +50,9 @@ target_link_libraries(p3linmath p3pandabase pandaexpress) target_use_packages(p3linmath EIGEN) target_interrogate(p3linmath ALL) -install(TARGETS p3linmath DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3linmath DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3LINMATH_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 2cf5568af3..0febd3958d 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -67,7 +67,9 @@ target_link_libraries(p3mathutil p3event) target_use_packages(p3mathutil FFTW) target_interrogate(p3mathutil ALL) -install(TARGETS p3mathutil DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3mathutil DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3MATHUTIL_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 49668ffc48..0f03bbadc5 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -47,5 +47,7 @@ add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES target_link_libraries(p3movies p3pstatclient p3gobj p3pandabase pandaexpress) target_interrogate(p3movies ALL) -install(TARGETS p3movies DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3movies DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3MOVIES_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 7cdde96ce8..7598a61942 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -33,5 +33,7 @@ add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET target_link_libraries(p3nativenet p3pandabase pandaexpress) target_interrogate(p3nativenet ALL) -install(TARGETS p3nativenet DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3nativenet DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3NATIVENET_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index ba265cc86b..58c7e80c6d 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -38,5 +38,7 @@ if(WIN32) target_link_libraries(p3net Iphlpapi.lib) endif() -install(TARGETS p3net DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3net DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3NET_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 3206b722eb..a71c83a22a 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -91,5 +91,5 @@ target_link_libraries(p3ode panda) target_use_packages(p3ode ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) -install(TARGETS p3ode DESTINATION lib) +install(TARGETS p3ode DESTINATION lib RUNTIME DESTINATION bin) install(FILES ${P3ODE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 08f617bb1e..bb61513e3f 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -39,7 +39,9 @@ add_component_library(p3parametrics NOINIT SYMBOL BUILDING_PANDA_PARAMETRICS target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) -install(TARGETS p3parametrics DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3parametrics DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PARAMETRICS_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 71102bb31d..d6b74b057a 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -43,5 +43,7 @@ add_component_library(p3particlesystem SYMBOL BUILDING_PANDA_PARTICLESYSTEM target_link_libraries(p3particlesystem p3physics panda) target_interrogate(p3particlesystem ALL) -install(TARGETS p3particlesystem DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3particlesystem DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PARTICLESYSTEM_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 7c136f7a38..8fed7d0f41 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -223,7 +223,9 @@ add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath pandaexpress) target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) -install(TARGETS p3pgraph DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pgraph DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PGRAPH_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 749a835051..663e88d5f2 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -50,5 +50,7 @@ add_component_library(p3pgraphnodes SYMBOL BUILDING_PANDA_PGRAPHNODES target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) -install(TARGETS p3pgraphnodes DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pgraphnodes DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PGRAPHNODES_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 16ced60a74..57ebb702b6 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -45,7 +45,9 @@ add_component_library(p3pgui SYMBOL BUILDING_PANDA_PGUI target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) -install(TARGETS p3pgui DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pgui DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PGUI_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 3278cd08dd..7d17f65cbe 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -41,5 +41,7 @@ add_component_library(p3physics SYMBOL BUILDING_PANDA_PHYSICS target_link_libraries(p3physics panda) target_interrogate(p3physics ALL) -install(TARGETS p3physics DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3physics DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PHYSICS_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 73d7f96ce4..2d1a2be3d4 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -133,7 +133,9 @@ add_component_library(p3pipeline SYMBOL BUILDING_PANDA_PIPELINE target_link_libraries(p3pipeline pandaexpress) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) -install(TARGETS p3pipeline DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pipeline DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PIPELINE_HEADERS} DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index c78cb1dfe8..807cf1f9f9 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -40,5 +40,7 @@ add_component_library(p3pnmimage SYMBOL BUILDING_PANDA_PNMIMAGE target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) -install(TARGETS p3pnmimage DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pnmimage DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PNMIMAGE_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index c9236befaa..fc2e20efed 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -36,4 +36,6 @@ add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES target_link_libraries(p3pnmimagetypes p3pnmimage) target_use_packages(p3pnmimagetypes JPEG TIFF PNG) -install(TARGETS p3pnmimagetypes DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pnmimagetypes DESTINATION lib RUNTIME DESTINATION bin) +endif() diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 8d71405a12..6b42b9feef 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -24,5 +24,7 @@ target_link_libraries(p3pnmtext p3parametrics p3pnmimage) target_use_packages(p3pnmtext FREETYPE) target_interrogate(p3pnmtext ALL) -install(TARGETS p3pnmtext DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pnmtext DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PNMTEXT_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 8aa80f0566..93395116ac 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -26,6 +26,8 @@ add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT target_link_libraries(p3pstatclient p3net p3putil pandaexpress) target_interrogate(p3pstatclient ALL) -install(TARGETS p3pstatclient DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3pstatclient DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PSTATCLIENT_HEADERS} DESTINATION include/panda3d) install(FILES config_pstats.h DESTINATION include/panda3d) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 9da712f192..2dc2830b13 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -129,7 +129,9 @@ add_component_library(p3putil SYMBOL BUILDING_PANDA_PUTIL target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) -install(TARGETS p3putil DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3putil DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3PUTIL_HEADERS} DESTINATION include/panda3d) install(FILES config_util.h DESTINATION include/panda3d) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index fe479652ca..6ef60c5b8d 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -22,5 +22,7 @@ add_component_library(p3recorder NOINIT SYMBOL BUILDING_PANDA_RECORDER target_link_libraries(p3recorder p3dgraph pandaexpress) target_interrogate(p3recorder ALL) -install(TARGETS p3recorder DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3recorder DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3RECORDER_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 42378c1967..4d9f9fe220 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -42,5 +42,7 @@ if(HAVE_FREETYPE) endif() target_interrogate(p3text ALL) -install(TARGETS p3text DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3text DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3TEXT_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index 53510a0060..ec1eaa5da5 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -32,5 +32,7 @@ add_component_library(p3tform NOINIT SYMBOL BUILDING_PANDA_TFORM target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) -install(TARGETS p3tform DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3tform DESTINATION lib RUNTIME DESTINATION bin) +endif() install(FILES ${P3TFORM_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 2bfbb1ba6b..b4138fb0f6 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -16,4 +16,6 @@ add_component_library(p3x11display SYMBOL BUILDING_PANDAX11 ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) target_link_libraries(p3x11display panda ${X11_LIBRARIES}) -install(TARGETS p3x11display DESTINATION lib) +if(NOT BUILD_METALIBS) + install(TARGETS p3x11display DESTINATION lib) +endif() From e48b78bc507eba39aa0b9e1ef53046b548c17c8d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Sep 2018 16:07:41 -0600 Subject: [PATCH 481/744] CMake: Handle datagram_ext.h --- panda/src/express/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 899fe215e4..32e36b9084 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -121,6 +121,7 @@ set(P3EXPRESS_SOURCES # Some of these reside in dtoolbase/dtoolutil. But dtool isn't run through # Interrogate; Panda is. So we're responsible for providing the extensions. set(P3EXPRESS_IGATEEXT + datagram_ext.h ../../../dtool/src/dtoolutil/filename_ext.cxx ../../../dtool/src/dtoolutil/filename_ext.h ../../../dtool/src/dtoolutil/globPattern_ext.cxx From 23f46d8a841144095daea23922e7d6f13c29c0cf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Sep 2018 16:14:01 -0600 Subject: [PATCH 482/744] CMake: Build p3bullet --- dtool/Package.cmake | 4 +- panda/CMakeLists.txt | 6 ++ panda/src/bullet/CMakeLists.txt | 117 ++++++++++++++++++++++++++++++++ 3 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 panda/src/bullet/CMakeLists.txt diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 43b9fdc23b..f4112a54e1 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -290,10 +290,10 @@ package_option(GTK2) # Bullet find_package(Bullet QUIET) -package_option(Bullet +package_option(BULLET "Enable this option to support game dynamics with the Bullet physics library.") -config_package(Bullet "Bullet physics") +config_package(BULLET "Bullet physics") # ODE find_package(ODE QUIET) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 851461e64f..4d256c18df 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -68,6 +68,8 @@ add_subdirectory(src/testbed) # physics add_subdirectory(src/physics) add_subdirectory(src/particlesystem) +# bullet +add_subdirectory(src/bullet) # ode add_subdirectory(src/ode) @@ -96,6 +98,10 @@ endif() if(HAVE_PYTHON) add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) + if(HAVE_BULLET) + add_python_module(bullet p3bullet IMPORT panda3d.core) + endif() + if(HAVE_EGG) add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core) endif() diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt new file mode 100644 index 0000000000..c2c4cd6b6d --- /dev/null +++ b/panda/src/bullet/CMakeLists.txt @@ -0,0 +1,117 @@ +if(NOT HAVE_BULLET) + return() +endif() + +set(P3BULLET_HEADERS + config_bullet.h + bullet_includes.h + bullet_utils.I bullet_utils.h + bulletAllHitsRayResult.I bulletAllHitsRayResult.h + bulletBaseCharacterControllerNode.I bulletBaseCharacterControllerNode.h + bulletBodyNode.I bulletBodyNode.h + bulletBoxShape.I bulletBoxShape.h + bulletCapsuleShape.I bulletCapsuleShape.h + bulletCharacterControllerNode.I bulletCharacterControllerNode.h + bulletClosestHitRayResult.I bulletClosestHitRayResult.h + bulletClosestHitSweepResult.I bulletClosestHitSweepResult.h + bulletConeShape.I bulletConeShape.h + bulletConeTwistConstraint.I bulletConeTwistConstraint.h + bulletConstraint.I bulletConstraint.h + bulletContactCallbackData.I bulletContactCallbackData.h + bulletContactCallbacks.h + bulletContactResult.I bulletContactResult.h + bulletConvexHullShape.I bulletConvexHullShape.h + bulletConvexPointCloudShape.I bulletConvexPointCloudShape.h + bulletCylinderShape.I bulletCylinderShape.h + bulletDebugNode.I bulletDebugNode.h + bulletFilterCallbackData.I bulletFilterCallbackData.h + bulletGenericConstraint.I bulletGenericConstraint.h + bulletGhostNode.I bulletGhostNode.h + bulletHeightfieldShape.I bulletHeightfieldShape.h + bulletHelper.I bulletHelper.h + bulletHingeConstraint.I bulletHingeConstraint.h + bulletManifoldPoint.I bulletManifoldPoint.h + bulletMinkowskiSumShape.I bulletMinkowskiSumShape.h + bulletMultiSphereShape.I bulletMultiSphereShape.h + bulletPersistentManifold.I bulletPersistentManifold.h + bulletPlaneShape.I bulletPlaneShape.h + bulletRigidBodyNode.I bulletRigidBodyNode.h + bulletRotationalLimitMotor.I bulletRotationalLimitMotor.h + bulletShape.I bulletShape.h + bulletSliderConstraint.I bulletSliderConstraint.h + bulletSoftBodyConfig.I bulletSoftBodyConfig.h + bulletSoftBodyControl.I bulletSoftBodyControl.h + bulletSoftBodyMaterial.I bulletSoftBodyMaterial.h + bulletSoftBodyNode.I bulletSoftBodyNode.h + bulletSoftBodyShape.I bulletSoftBodyShape.h + bulletSoftBodyWorldInfo.I bulletSoftBodyWorldInfo.h + bulletSphereShape.I bulletSphereShape.h + bulletSphericalConstraint.I bulletSphericalConstraint.h + bulletTickCallbackData.I bulletTickCallbackData.h + bulletTranslationalLimitMotor.I bulletTranslationalLimitMotor.h + bulletTriangleMesh.I bulletTriangleMesh.h + bulletTriangleMeshShape.I bulletTriangleMeshShape.h + bulletVehicle.I bulletVehicle.h + bulletWheel.I bulletWheel.h + bulletWorld.I bulletWorld.h) + +set(P3BULLET_SOURCES + config_bullet.cxx + bullet_utils.cxx + bulletAllHitsRayResult.cxx + bulletBaseCharacterControllerNode.cxx + bulletBodyNode.cxx + bulletBoxShape.cxx + bulletCapsuleShape.cxx + bulletCharacterControllerNode.cxx + bulletClosestHitRayResult.cxx + bulletClosestHitSweepResult.cxx + bulletConeShape.cxx + bulletConeTwistConstraint.cxx + bulletConstraint.cxx + bulletContactCallbackData.cxx + bulletContactResult.cxx + bulletConvexHullShape.cxx + bulletConvexPointCloudShape.cxx + bulletCylinderShape.cxx + bulletDebugNode.cxx + bulletFilterCallbackData.cxx + bulletGenericConstraint.cxx + bulletGhostNode.cxx + bulletHeightfieldShape.cxx + bulletHelper.cxx + bulletHingeConstraint.cxx + bulletManifoldPoint.cxx + bulletMinkowskiSumShape.cxx + bulletMultiSphereShape.cxx + bulletPersistentManifold.cxx + bulletPlaneShape.cxx + bulletRigidBodyNode.cxx + bulletRotationalLimitMotor.cxx + bulletShape.cxx + bulletSliderConstraint.cxx + bulletSoftBodyConfig.cxx + bulletSoftBodyControl.cxx + bulletSoftBodyMaterial.cxx + bulletSoftBodyNode.cxx + bulletSoftBodyShape.cxx + bulletSoftBodyWorldInfo.cxx + bulletSphereShape.cxx + bulletSphericalConstraint.cxx + bulletTickCallbackData.cxx + bulletTranslationalLimitMotor.cxx + bulletTriangleMesh.cxx + bulletTriangleMeshShape.cxx + bulletVehicle.cxx + bulletWheel.cxx + bulletWorld.cxx) + +composite_sources(p3bullet P3BULLET_SOURCES) +add_library(p3bullet ${P3BULLET_SOURCES} ${P3BULLET_HEADERS}) +set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET) +target_link_libraries(p3bullet panda) +target_use_packages(p3bullet BULLET) +target_interrogate(p3bullet ALL) + +install(TARGETS p3bullet DESTINATION lib RUNTIME DESTINATION bin) +install(FILES ${P3BULLET_HEADERS} DESTINATION include/panda3d) From 601a82dafc47fb5a3796f6b06a3ba9af127de0f8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Sep 2018 16:35:21 -0600 Subject: [PATCH 483/744] travis: Hackfix for BUILD_METALIBS=OFF tests --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e438814946..d479dbf36a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,12 +58,16 @@ before_script: - cd built script: +# This is kind of a hack, but needed to test non-metalib builds (until +# interrogate has a way of explicitly calling init_libpanda) +- '[ "x$BUILD_METALIBS" == "xON" ] || export LDFLAGS=-Wl,--no-as-needed' + - cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. - make -j4 - export PYTHONPATH=$PWD - python ../test_imports.py -- pytest ../tests +- pytest -v ../tests notifications: irc: From 77018c53839a6725ad1e890acda90a6c041b3315 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Sep 2018 21:01:54 -0600 Subject: [PATCH 484/744] CMake: Name Python targets more distinctively Python targets are now prefixed with "panda3d." in e.g. "panda3d.core" --- cmake/macros/Interrogate.cmake | 43 +++++++++++++++++++------- dtool/src/interrogatedb/CMakeLists.txt | 14 ++------- 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 44d2aed8e1..459c517b41 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -6,6 +6,7 @@ # Functions: # target_interrogate(target [ALL] [source1 [source2 ...]]) # add_python_module(module [lib1 [lib2 ...]]) +# add_python_target(target [source1 [source2 ...]]) # set(IGATE_FLAGS -DCPPPARSER -D__cplusplus -Dvolatile -Dmutable) @@ -289,22 +290,42 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - add_library(${module} ${MODULE_TYPE} "${module}_module.cxx" ${sources}) - target_link_libraries(${module} - ${link_targets} ${PYTHON_LIBRARIES} p3dtool) - - set_target_properties(${module} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - PREFIX "" - ) - set_target_properties(${module} PROPERTIES SUFFIX "${PYTHON_EXTENSION_SUFFIX}") - - install(TARGETS ${module} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + add_python_target(panda3d.${module} "${module}_module.cxx" ${sources}) + target_link_libraries(panda3d.${module} + ${link_targets} p3dtool) list(APPEND ALL_INTERROGATE_MODULES "${module}") set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endfunction(add_python_module) +# +# Function: add_python_target(target [source1 [source2 ...]]) +# Build the provided source(s) as a Python extension module, linked against the +# Python runtime library. +# +# Note that this also takes care of installation, unlike other target creation +# commands in CMake. +# +function(add_python_target target) + if(NOT HAVE_PYTHON) + return() + endif() + + string(REGEX REPLACE "^.*\\." "" basename "${target}") + set(sources ${ARGN}) + + add_library(${target} ${MODULE_TYPE} ${sources}) + target_use_packages(${target} PYTHON) + + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + OUTPUT_NAME "${basename}" + PREFIX "" + SUFFIX "${PYTHON_EXTENSION_SUFFIX}") + + install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") +endfunction(add_python_target) + if(HAVE_PYTHON) # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 20e942b7d0..f17021d849 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -67,16 +67,6 @@ add_custom_command( COMMENT "Interrogating interrogatedb" ) -add_library(interrogatedb ${MODULE_TYPE} +add_python_target(panda3d.interrogatedb "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") -set_target_properties(interrogatedb PROPERTIES SUFFIX "${PYTHON_EXTENSION_SUFFIX}") -target_use_packages(interrogatedb PYTHON) -target_link_libraries(interrogatedb p3dtoolconfig) - -set_target_properties(interrogatedb PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - PREFIX "" - OUTPUT_NAME "interrogatedb" -) - -install(TARGETS interrogatedb DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") +target_link_libraries(panda3d.interrogatedb p3dtoolconfig) From 1970751c8affde691a16b8bc41da2040a3ca5e06 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Sep 2018 21:04:40 -0600 Subject: [PATCH 485/744] CMake: Do something sensible with static Python modules These *do* make sense and there are Panda3D users that use this kind of configuration, so we should try to be accommodating. --- cmake/macros/Interrogate.cmake | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 459c517b41..324650b028 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -317,17 +317,26 @@ function(add_python_target target) add_library(${target} ${MODULE_TYPE} ${sources}) target_use_packages(${target} PYTHON) - set_target_properties(${target} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - OUTPUT_NAME "${basename}" - PREFIX "" - SUFFIX "${PYTHON_EXTENSION_SUFFIX}") + if(BUILD_SHARED_LIBS) + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + OUTPUT_NAME "${basename}" + PREFIX "" + SUFFIX "${PYTHON_EXTENSION_SUFFIX}") + + install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + else() + set_target_properties(${target} PROPERTIES + OUTPUT_NAME "${basename}" + PREFIX "libpython_panda3d_") + + install(TARGETS ${target} DESTINATION lib) + endif() - install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") endfunction(add_python_target) -if(HAVE_PYTHON) +if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS) # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' # as a package. file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "") From 0c889db92866726ae74a6e3ce5c3fdf262b6be3a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Sep 2018 18:58:23 -0600 Subject: [PATCH 486/744] CMake: Don't conflict with find_package internal variables --- cmake/macros/PackageConfig.cmake | 14 +++++++------- dtool/src/interrogate/CMakeLists.txt | 6 ++++-- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 8fca34bf37..b259a465e0 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -148,16 +148,16 @@ function(package_option name) # Create the option. option("HAVE_${name}" "${cache_string}" "${default}") if(HAVE_${name}) - set(_${name}_INCLUDES ${${found_as}_INCLUDE_DIRS} ${${found_as}_INCLUDE_DIR} + set(_PKG_${name}_INCLUDES ${${found_as}_INCLUDE_DIRS} ${${found_as}_INCLUDE_DIR} CACHE INTERNAL "") if(${found_as}_LIBRARIES) - set(_${name}_LIBRARIES ${${found_as}_LIBRARIES} CACHE INTERNAL "") + set(_PKG_${name}_LIBRARIES ${${found_as}_LIBRARIES} CACHE INTERNAL "") else() - set(_${name}_LIBRARIES "${${found_as}_LIBRARY}" CACHE INTERNAL "") + set(_PKG_${name}_LIBRARIES "${${found_as}_LIBRARY}" CACHE INTERNAL "") endif() else() - unset(_${name}_INCLUDES CACHE) - unset(_${name}_LIBRARIES CACHE) + unset(_PKG_${name}_INCLUDES CACHE) + unset(_PKG_${name}_LIBRARIES CACHE) endif() endfunction() @@ -231,13 +231,13 @@ macro(target_use_packages target) foreach(lib ${libs}) if(HAVE_${lib}) - target_link_libraries("${target}" ${_${lib}_LIBRARIES}) + 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 - $<$>>:${_${lib}_INCLUDES}>) + $<$>>:${_PKG_${lib}_INCLUDES}>) endif() endforeach(lib) endmacro(target_use_packages) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index cf54d19481..544934e7c8 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -53,11 +53,13 @@ composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate - p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) + p3cppParser p3dtoolconfig p3pystub) +target_use_packages(interrogate OPENSSL) add_executable(interrogate_module interrogate_module.cxx) target_link_libraries(interrogate_module - p3cppParser p3dtoolconfig p3pystub ${_OPENSSL_LIBRARIES}) + p3cppParser p3dtoolconfig p3pystub) +target_use_packages(interrogate_module OPENSSL) if(NOT CMAKE_CROSSCOMPILING) add_executable(host_interrogate ALIAS interrogate) From 27ac06890899e040701e45069e6809e39ba4b3d1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Sep 2018 22:22:00 -0600 Subject: [PATCH 487/744] CMake: Clean up p3express's strange dependencies on dtool --- panda/src/express/CMakeLists.txt | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 32e36b9084..259bac1e57 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -118,25 +118,13 @@ set(P3EXPRESS_SOURCES windowsRegistry.cxx zStream.cxx zStreamBuf.cxx) -# Some of these reside in dtoolbase/dtoolutil. But dtool isn't run through -# Interrogate; Panda is. So we're responsible for providing the extensions. set(P3EXPRESS_IGATEEXT datagram_ext.h - ../../../dtool/src/dtoolutil/filename_ext.cxx - ../../../dtool/src/dtoolutil/filename_ext.h - ../../../dtool/src/dtoolutil/globPattern_ext.cxx - ../../../dtool/src/dtoolutil/globPattern_ext.h memoryUsagePointers_ext.cxx memoryUsagePointers_ext.h pointerToArray_ext.h ramfile_ext.cxx ramfile_ext.h - ../../../dtool/src/prc/streamReader_ext.cxx - ../../../dtool/src/prc/streamReader_ext.h - ../../../dtool/src/prc/streamWriter_ext.cxx - ../../../dtool/src/prc/streamWriter_ext.h - ../../../dtool/src/dtoolbase/typeHandle_ext.cxx - ../../../dtool/src/dtoolbase/typeHandle_ext.h virtualFileSystem_ext.cxx virtualFileSystem_ext.h virtualFile_ext.cxx @@ -147,9 +135,6 @@ composite_sources(p3express P3EXPRESS_SOURCES) add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -# p3express needs to include from p3interrogatedb for py_panda.h and extension.h -target_include_directories(p3express PUBLIC - $) target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool) target_use_packages(p3express TAR ZLIB) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) From e501d20927ad1b036e939ba1c204c1481424e324 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Sep 2018 00:26:13 -0600 Subject: [PATCH 488/744] CMake: Don't compile Interrogate runtime code into interrogatedb This should obviate the need for pystub as well. Note that it's currently a little bit hacky; the source will have to be moved to make the CMake dependencies work better. --- cmake/macros/Interrogate.cmake | 4 +-- dtool/src/dtoolbase/CMakeLists.txt | 3 -- dtool/src/dtoolutil/CMakeLists.txt | 3 -- dtool/src/interrogatedb/CMakeLists.txt | 39 ++++++++++++++++++++------ dtool/src/prc/CMakeLists.txt | 3 -- panda/src/ode/CMakeLists.txt | 2 +- 6 files changed, 34 insertions(+), 20 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 324650b028..dc87547c9d 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -219,6 +219,7 @@ function(interrogate_sources target output database language_flags) ${language_flags} ${define_flags} -S "${PROJECT_BINARY_DIR}/include" + -S "${PROJECT_SOURCE_DIR}/dtool/src/interrogatedb" -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" -S "${PYTHON_INCLUDE_DIRS}" ${include_flags} @@ -291,8 +292,7 @@ function(add_python_module module) ) add_python_target(panda3d.${module} "${module}_module.cxx" ${sources}) - target_link_libraries(panda3d.${module} - ${link_targets} p3dtool) + target_link_libraries(panda3d.${module} ${link_targets} p3igateruntime) list(APPEND ALL_INTERROGATE_MODULES "${module}") set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index e61ea4f8cb..f957c30645 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -85,9 +85,6 @@ composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -# The extensions need py_panda.h and extension.h from interrogatedb -target_include_directories(p3dtoolbase PUBLIC - $) # Help other libraries find the autogenerated version headers target_include_directories(p3dtoolbase PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) target_use_packages(p3dtoolbase THREADS EIGEN) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 872eab7b1d..9ee7961987 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -66,9 +66,6 @@ composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) -# The extensions need py_panda.h and extension.h from interrogatedb -target_include_directories(p3dtoolutil PUBLIC - $) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT}) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index f17021d849..ace718342c 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -9,12 +9,13 @@ set(P3INTERROGATEDB_HEADERS interrogateManifest.I interrogateManifest.h interrogateType.I interrogateType.h interrogate_datafile.I interrogate_datafile.h - interrogate_interface.h interrogate_request.h + interrogate_interface.h interrogate_request.h) + +set(P3IGATERUNTIME_HEADERS extension.h py_compat.h py_panda.h py_wrappers.h) set(P3INTERROGATEDB_SOURCES config_interrogatedb.cxx - dtool_super_base.cxx indexRemapper.cxx interrogateComponent.cxx interrogateDatabase.cxx interrogateElement.cxx interrogateFunction.cxx @@ -22,28 +23,50 @@ set(P3INTERROGATEDB_SOURCES interrogateMakeSeq.cxx interrogateManifest.cxx interrogateType.cxx interrogate_datafile.cxx - interrogate_interface.cxx interrogate_request.cxx + interrogate_interface.cxx interrogate_request.cxx) + +set(P3IGATERUNTIME_SOURCES + dtool_super_base.cxx py_compat.cxx - py_panda.cxx + ${CMAKE_CURRENT_BINARY_DIR}/py_panda.cxx py_wrappers.cxx) set(P3INTERROGATEDB_IGATE interrogate_interface.h - interrogate_request.h -) + interrogate_request.h) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3dconfig) -target_use_packages(p3interrogatedb PYTHON) if(NOT BUILD_METALIBS) install(TARGETS p3interrogatedb DESTINATION lib RUNTIME DESTINATION bin) endif() install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) +# Now we need to build the Interrogate runtime code; this should eventually be +# split out into its own subdirectory. + +# HACK: igateruntime doesn't have its own BUILDING_IGATERUNTIME symbol yet; +# it's still using BUILDING_INTERROGATEDB. + +# py_panda.cxx can't rely on anything from interrogatedb, so: +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/py_panda.cxx _py_panda) +string(REGEX REPLACE "interrogatedb" "prc" _py_panda "${_py_panda}") +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/py_panda.cxx "${_py_panda}") + +add_library(p3igateruntime + ${P3IGATERUNTIME_HEADERS} ${P3IGATERUNTIME_SOURCES}) +set_target_properties(p3igateruntime PROPERTIES + DEFINE_SYMBOL BUILDING_INTERROGATEDB) # HACK +target_link_libraries(p3igateruntime p3dtoolconfig) +target_use_packages(p3igateruntime PYTHON) + +install(TARGETS p3igateruntime DESTINATION lib RUNTIME DESTINATION bin) +install(FILES ${P3IGATERUNTIME_HEADERS} DESTINATION include/panda3d) + # ALSO: This has an Interrogate binding! Take care of that if we want it. # Note we don't use the regular Interrogate macros; this has some custom flags # that would make it not worthwhile. @@ -69,4 +92,4 @@ add_custom_command( add_python_target(panda3d.interrogatedb "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") -target_link_libraries(panda3d.interrogatedb p3dtoolconfig) +target_link_libraries(panda3d.interrogatedb p3igateruntime) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 8ba005115e..dbeceacb55 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -73,9 +73,6 @@ composite_sources(p3prc P3PRC_SOURCES) add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -# The extensions need py_panda.h and extension.h from interrogatedb -target_include_directories(p3prc PUBLIC - $) target_link_libraries(p3prc p3dtool) target_use_packages(p3prc OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index a71c83a22a..dab81d57cb 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -87,7 +87,7 @@ composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) target_compile_definitions(p3ode PUBLIC dSINGLE) -target_link_libraries(p3ode panda) +target_link_libraries(p3ode p3igateruntime panda) target_use_packages(p3ode ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) From 9f55b9e77ed89517b1171a70beee7a5cb2e4ff1a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Sep 2018 23:58:41 -0600 Subject: [PATCH 489/744] CMake: Don't Interrogate with deprecated -longlong on Windows --- cmake/macros/Interrogate.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index dc87547c9d..5d83cea25b 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -29,7 +29,7 @@ set(INTERROGATE_EXCLUDE_REGEXES ".*_src\\..*") if(WIN32) - list(APPEND IGATE_FLAGS -longlong __int64 -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32) + list(APPEND IGATE_FLAGS -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32) endif() if(INTERROGATE_VERBOSE) list(APPEND IGATE_FLAGS "-v") From 193cf71233ae2db22647c9d2fffacc80071212b7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 7 Sep 2018 00:03:26 -0600 Subject: [PATCH 490/744] CMake: Pass Python extension files to Interrogate with relative paths This makes sure absolute paths don't show up in #include, since Interrogate doesn't (currently) use the proper representation for this. (See #386) --- cmake/macros/Interrogate.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 5d83cea25b..4d88310947 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -164,6 +164,12 @@ function(interrogate_sources target output database language_flags) endif() endforeach(source) + # Also add extensions, in relative-path form + foreach(extension ${extensions}) + file(RELATIVE_PATH rel_extension "${srcdir}" "${extension}") + list(APPEND scan_sources "${rel_extension}") + endforeach(extension) + # Interrogate also needs the include paths, so we'll extract them from the # target. These are available via a generator expression. @@ -224,7 +230,6 @@ function(interrogate_sources target output database language_flags) -S "${PYTHON_INCLUDE_DIRS}" ${include_flags} ${scan_sources} - ${extensions} DEPENDS host_interrogate ${sources} ${extensions} ${nfiles} COMMENT "Interrogating ${target}" ) From cf26888672ac1aae6e60d626acf0d7e710064930 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 18 Sep 2018 18:17:43 -0600 Subject: [PATCH 491/744] CMake: Stop using include_directories() Setting this directly on the target is cleaner, and in most cases, the INTERFACE_INCLUDE_DIRECTORIES mechanism takes care of it for us. --- cmake/macros/Interrogate.cmake | 3 --- dtool/src/dtoolbase/CMakeLists.txt | 6 ++++-- panda/CMakeLists.txt | 10 ---------- panda/src/audiotraits/CMakeLists.txt | 3 --- 4 files changed, 4 insertions(+), 18 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 4d88310947..df0c173090 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -192,8 +192,6 @@ function(interrogate_sources target output database language_flags) # a JOIN will cause it to be escaped. Tabs are not escaped and will # separate correctly. set(include_flags "-I$,\t-I>") - # The above must also be included when compiling the resulting _igate.cxx file: - include_directories("$") # Get the compiler definition flags. These must be passed to Interrogate # in the same way that they are passed to the compiler so that Interrogate @@ -224,7 +222,6 @@ function(interrogate_sources target output database language_flags) ${IGATE_FLAGS} ${language_flags} ${define_flags} - -S "${PROJECT_BINARY_DIR}/include" -S "${PROJECT_SOURCE_DIR}/dtool/src/interrogatedb" -S "${PROJECT_SOURCE_DIR}/dtool/src/parser-inc" -S "${PYTHON_INCLUDE_DIRS}" diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index f957c30645..cff3e9b17c 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -85,8 +85,10 @@ composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) -# Help other libraries find the autogenerated version headers -target_include_directories(p3dtoolbase PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +# Help other libraries find the autogenerated headers +target_include_directories(p3dtoolbase PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} + ${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR}) target_use_packages(p3dtoolbase THREADS EIGEN) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 4d256c18df..b11bd5a0f3 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -2,16 +2,6 @@ if(NOT BUILD_DTOOL) message(FATAL_ERROR "Cannot build panda without dtool! Please enable the BUILD_DTOOL option.") endif() -# Not sure where I want to hide these inludes yet, but it is annoying -# to have to add them to every CMakeLists that either directly, or -# recursively includes linmath, and other libraries etc... -if(HAVE_CG) - include_directories(${CG_INCLUDE_DIRS}) -endif() -if(HAVE_FREETYPE) - include_directories(${FREETYPE_INCLUDE_DIRS}) -endif() - # Include panda source directories add_subdirectory(src/configfiles) add_subdirectory(src/pandabase) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 63bf44b87b..4521ee6e5c 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -21,7 +21,6 @@ if(HAVE_RAD_MSS) milesAudioSequence.cxx) composite_sources(p3miles_audio P3MILES_SOURCES) - include_directories(${MILES_INCLUDE_DIR}) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) target_link_libraries(p3miles_audio panda) @@ -40,7 +39,6 @@ if(HAVE_FMODEX) config_fmodAudio.cxx fmodAudioManager.cxx fmodAudioSound.cxx) composite_sources(p3fmod_audio P3FMOD_SOURCES) - include_directories(${FMODEX_INCLUDE_DIR}) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) target_link_libraries(p3fmod_audio panda) @@ -60,7 +58,6 @@ if(HAVE_OPENAL) composite_sources(p3openal_audio P3OPENAL_SOURCES) - include_directories(${OPENAL_INCLUDE_DIR}) add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) target_link_libraries(p3openal_audio panda) From 1520d712d479c2bc6fe5c29c8cb1cc1df9a083e3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 18 Sep 2018 20:00:03 -0600 Subject: [PATCH 492/744] 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. --- CMakeLists.txt | 2 +- cmake/macros/BuildMetalib.cmake | 2 +- cmake/macros/Interrogate.cmake | 2 +- cmake/macros/PackageConfig.cmake | 66 ++++++++++---------------- direct/src/dcparser/CMakeLists.txt | 3 +- direct/src/distributed/CMakeLists.txt | 3 +- dtool/src/dtoolbase/CMakeLists.txt | 2 +- dtool/src/interrogate/CMakeLists.txt | 10 ++-- dtool/src/interrogatedb/CMakeLists.txt | 3 +- dtool/src/prc/CMakeLists.txt | 3 +- panda/src/audiotraits/CMakeLists.txt | 9 ++-- panda/src/bullet/CMakeLists.txt | 3 +- panda/src/express/CMakeLists.txt | 4 +- panda/src/ffmpeg/CMakeLists.txt | 4 +- panda/src/glgsg/CMakeLists.txt | 3 +- panda/src/gobj/CMakeLists.txt | 4 +- panda/src/linmath/CMakeLists.txt | 3 +- panda/src/mathutil/CMakeLists.txt | 3 +- panda/src/ode/CMakeLists.txt | 3 +- panda/src/pnmimagetypes/CMakeLists.txt | 3 +- panda/src/pnmtext/CMakeLists.txt | 3 +- pandatool/src/gtk-stats/CMakeLists.txt | 3 +- pandatool/src/progbase/CMakeLists.txt | 3 +- 23 files changed, 56 insertions(+), 88 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e23de112f..785e5a5ed3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -73,7 +73,7 @@ if(WIN32) endif() # Include global modules needed for configure scripts -include(PackageConfig) # Defines package_option AND target_use_packages +include(PackageConfig) # Defines package_option # Configure Panda3D include(dtool/PandaVersion.cmake) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 716f8c09d8..5c14ee3c09 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -22,7 +22,7 @@ function(target_link_libraries target) foreach(library ${ARGN}) # 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. - 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" # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further # dependencies will work) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index df0c173090..7b4d201936 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -317,7 +317,7 @@ function(add_python_target target) set(sources ${ARGN}) add_library(${target} ${MODULE_TYPE} ${sources}) - target_use_packages(${target} PYTHON) + target_link_libraries(${target} PKG::PYTHON) if(BUILD_SHARED_LIBS) set_target_properties(${target} PROPERTIES diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index b259a465e0..9be8004ac7 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -6,6 +6,11 @@ # Assumes an attempt to find the package has already been made with # 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 # Usage: # package_option(package_name package_doc_string @@ -39,13 +44,6 @@ # This prints the package usage report using the information provided in # calls to config_package above. # -# -# Function: target_use_packages -# Usage: -# target_use_packages(target [PACKAGES ...]) -# Examples: -# target_use_packages(mylib PYTHON PNG) -# # # package_option @@ -112,7 +110,6 @@ function(package_option name) else() list(FIND PANDA_DIST_USE_LICENSES ${license} license_index) # 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") set(default OFF) else() @@ -147,19 +144,31 @@ function(package_option name) # Create the option. option("HAVE_${name}" "${cache_string}" "${default}") + + # Create the library if the package is available. + add_library(PKG::${name} INTERFACE IMPORTED GLOBAL) + if(HAVE_${name}) - set(_PKG_${name}_INCLUDES ${${found_as}_INCLUDE_DIRS} ${${found_as}_INCLUDE_DIR} - CACHE INTERNAL "") - if(${found_as}_LIBRARIES) - set(_PKG_${name}_LIBRARIES ${${found_as}_LIBRARIES} CACHE INTERNAL "") + if(${found_as}_INCLUDE_DIRS) + set(includes ${${found_as}_INCLUDE_DIRS}) else() - set(_PKG_${name}_LIBRARIES "${${found_as}_LIBRARY}" CACHE INTERNAL "") + set(includes "${${found_as}_INCLUDE_DIR}") endif() - else() - unset(_PKG_${name}_INCLUDES CACHE) - unset(_PKG_${name}_LIBRARIES CACHE) + if(${found_as}_LIBRARIES) + set(libs ${${found_as}_LIBRARIES}) + 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 + "$<$>>:${includes}>") endif() -endfunction() +endfunction(package_option) set(_ALL_CONFIG_PACKAGES CACHE INTERNAL "Internal variable") @@ -218,26 +227,3 @@ function(show_packages) endif() endforeach() 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 - $<$>>:${_PKG_${lib}_INCLUDES}>) - endif() - endforeach(lib) -endmacro(target_use_packages) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 9a4faff8e9..3780cf5293 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -49,8 +49,7 @@ composite_sources(p3dcparser P3DCPARSER_SOURCES) add_component_library(p3dcparser NOINIT SYMBOL BUILDING_DIRECT_DCPARSER ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) -target_link_libraries(p3dcparser p3directbase panda) -target_use_packages(p3dcparser PYTHON) +target_link_libraries(p3dcparser p3directbase panda PKG::PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) if(NOT BUILD_METALIBS) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 4ae6e406bd..09662ac5eb 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -17,8 +17,7 @@ set(P3DISTRIBUTED_SOURCES add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) -target_link_libraries(p3distributed p3directbase p3dcparser panda) -target_use_packages(p3distributed PYTHON) +target_link_libraries(p3distributed p3directbase p3dcparser panda PKG::PYTHON) target_interrogate(p3distributed ALL) if(NOT BUILD_METALIBS) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index cff3e9b17c..ebcc827fb5 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -89,7 +89,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE target_include_directories(p3dtoolbase PUBLIC ${CMAKE_CURRENT_BINARY_DIR} ${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}) if(NOT BUILD_METALIBS) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 544934e7c8..0367567f66 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -52,14 +52,12 @@ set(INTERROGATE_SOURCES composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) -target_link_libraries(interrogate - p3cppParser p3dtoolconfig p3pystub) -target_use_packages(interrogate OPENSSL) +target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub + PKG::OPENSSL) add_executable(interrogate_module interrogate_module.cxx) -target_link_libraries(interrogate_module - p3cppParser p3dtoolconfig p3pystub) -target_use_packages(interrogate_module OPENSSL) +target_link_libraries(interrogate_module p3cppParser p3dtoolconfig p3pystub + PKG::OPENSSL) if(NOT CMAKE_CROSSCOMPILING) add_executable(host_interrogate ALIAS interrogate) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index ace718342c..3088a31e78 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -61,8 +61,7 @@ add_library(p3igateruntime ${P3IGATERUNTIME_HEADERS} ${P3IGATERUNTIME_SOURCES}) set_target_properties(p3igateruntime PROPERTIES DEFINE_SYMBOL BUILDING_INTERROGATEDB) # HACK -target_link_libraries(p3igateruntime p3dtoolconfig) -target_use_packages(p3igateruntime PYTHON) +target_link_libraries(p3igateruntime p3dtoolconfig PKG::PYTHON) install(TARGETS p3igateruntime DESTINATION lib RUNTIME DESTINATION bin) install(FILES ${P3IGATERUNTIME_HEADERS} DESTINATION include/panda3d) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index dbeceacb55..9c74352017 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -73,8 +73,7 @@ composite_sources(p3prc P3PRC_SOURCES) add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) -target_link_libraries(p3prc p3dtool) -target_use_packages(p3prc OPENSSL) +target_link_libraries(p3prc p3dtool PKG::OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) if(NOT BUILD_METALIBS) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 4521ee6e5c..a40f4dc301 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -23,8 +23,7 @@ if(HAVE_RAD_MSS) composite_sources(p3miles_audio P3MILES_SOURCES) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) - target_link_libraries(p3miles_audio panda) - target_use_packages(p3miles_audio MILES) + target_link_libraries(p3miles_audio panda PKG::MILES) install(TARGETS p3miles_audio DESTINATION lib RUNTIME DESTINATION bin) endif() @@ -41,8 +40,7 @@ if(HAVE_FMODEX) composite_sources(p3fmod_audio P3FMOD_SOURCES) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) - target_link_libraries(p3fmod_audio panda) - target_use_packages(p3fmod_audio FMODEX) + target_link_libraries(p3fmod_audio panda PKG::FMODEX) install(TARGETS p3fmod_audio DESTINATION lib RUNTIME DESTINATION bin) endif() @@ -60,8 +58,7 @@ if(HAVE_OPENAL) composite_sources(p3openal_audio P3OPENAL_SOURCES) add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) - target_link_libraries(p3openal_audio panda) - target_use_packages(p3openal_audio OPENAL) + target_link_libraries(p3openal_audio panda PKG::OPENAL) install(TARGETS p3openal_audio DESTINATION lib RUNTIME DESTINATION bin) endif() diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index c2c4cd6b6d..781e61f397 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -109,8 +109,7 @@ set(P3BULLET_SOURCES composite_sources(p3bullet P3BULLET_SOURCES) add_library(p3bullet ${P3BULLET_SOURCES} ${P3BULLET_HEADERS}) set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET) -target_link_libraries(p3bullet panda) -target_use_packages(p3bullet BULLET) +target_link_libraries(p3bullet panda PKG::BULLET) target_interrogate(p3bullet ALL) install(TARGETS p3bullet DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 259bac1e57..2d2929fed3 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -135,8 +135,8 @@ composite_sources(p3express P3EXPRESS_SOURCES) add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool) -target_use_packages(p3express TAR ZLIB) +target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool + PKG::TAR PKG::ZLIB) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(WIN32) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 09d7e38c3d..84a498a54e 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -22,8 +22,8 @@ set(P3FFMPEG_SOURCES composite_sources(p3ffmpeg P3FFMPEG_SOURCES) add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) -target_link_libraries(p3ffmpeg panda) -target_use_packages(p3ffmpeg FFMPEG SWSCALE SWRESAMPLE) +target_link_libraries(p3ffmpeg panda + PKG::FFMPEG PKG::SWSCALE PKG::SWRESAMPLE) install(TARGETS p3ffmpeg DESTINATION lib RUNTIME DESTINATION bin) install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 0d030a7f0a..9421def529 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -15,8 +15,7 @@ composite_sources(p3glgsg P3GLGSG_SOURCES) add_component_library(p3glgsg SYMBOL BUILDING_PANDA_GLGSG ${P3GLGSG_HEADERS} ${P3GLGSG_SOURCES}) target_link_libraries(p3glgsg p3glstuff panda - ${OPENGL_LIBRARIES}) -target_use_packages(p3glgsg CG) + PKG::CG PKG::GL) if(NOT BUILD_METALIBS) install(TARGETS p3glgsg DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index d3301f64de..a4df5f7f32 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -170,8 +170,8 @@ set(P3GOBJ_IGATEEXT composite_sources(p3gobj P3GOBJ_SOURCES) add_component_library(p3gobj NOINIT SYMBOL BUILDING_PANDA_GOBJ ${P3GOBJ_HEADERS} ${P3GOBJ_SOURCES}) -target_link_libraries(p3gobj p3gsgbase p3pnmimage) -target_use_packages(p3gobj ZLIB SQUISH CG) +target_link_libraries(p3gobj p3gsgbase p3pnmimage + PKG::ZLIB PKG::SQUISH PKG::CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) if(NOT BUILD_METALIBS) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 6fd6b342b9..c3fa7332bd 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -46,8 +46,7 @@ set(P3LINMATH_SOURCES composite_sources(p3linmath P3LINMATH_SOURCES) add_component_library(p3linmath SYMBOL BUILDING_PANDA_LINMATH ${P3LINMATH_HEADERS} ${P3LINMATH_SOURCES}) -target_link_libraries(p3linmath p3pandabase pandaexpress) -target_use_packages(p3linmath EIGEN) +target_link_libraries(p3linmath p3pandabase pandaexpress PKG::EIGEN) target_interrogate(p3linmath ALL) if(NOT BUILD_METALIBS) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 0febd3958d..6018510008 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -63,8 +63,7 @@ set(P3MATHUTIL_SOURCES composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_component_library(p3mathutil SYMBOL BUILDING_PANDA_MATHUTIL ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -target_link_libraries(p3mathutil p3event) -target_use_packages(p3mathutil FFTW) +target_link_libraries(p3mathutil p3event PKG::FFTW) target_interrogate(p3mathutil ALL) if(NOT BUILD_METALIBS) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index dab81d57cb..934fdbc04f 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -87,8 +87,7 @@ composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) target_compile_definitions(p3ode PUBLIC dSINGLE) -target_link_libraries(p3ode p3igateruntime panda) -target_use_packages(p3ode ODE) +target_link_libraries(p3ode p3igateruntime panda PKG::ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) install(TARGETS p3ode DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index fc2e20efed..688caba7c5 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -33,8 +33,7 @@ set(P3PNMIMAGETYPES_SOURCES composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -target_link_libraries(p3pnmimagetypes p3pnmimage) -target_use_packages(p3pnmimagetypes JPEG TIFF PNG) +target_link_libraries(p3pnmimagetypes p3pnmimage PKG::JPEG PKG::TIFF PKG::PNG) if(NOT BUILD_METALIBS) install(TARGETS p3pnmimagetypes DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 6b42b9feef..1e1c2c9e14 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -20,8 +20,7 @@ set(P3PNMTEXT_SOURCES composite_sources(p3pnmtext P3PNMTEXT_SOURCES) add_component_library(p3pnmtext SYMBOL BUILDING_PANDA_PNMTEXT ${P3PNMTEXT_HEADERS} ${P3PNMTEXT_SOURCES}) -target_link_libraries(p3pnmtext p3parametrics p3pnmimage) -target_use_packages(p3pnmtext FREETYPE) +target_link_libraries(p3pnmtext p3parametrics p3pnmimage PKG::FREETYPE) target_interrogate(p3pnmtext ALL) if(NOT BUILD_METALIBS) diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index b976f805a4..130ed34b4a 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -26,8 +26,7 @@ set(GTKSTATS_SOURCES composite_sources(gtkstats GTKSTATS_SOURCES) add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) -target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub) -target_use_packages(gtkstats GTK2) +target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub PKG::GTK2) # This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and # pstats everywhere else (as the Win32 GUI is not built). diff --git a/pandatool/src/progbase/CMakeLists.txt b/pandatool/src/progbase/CMakeLists.txt index 44bb8b80b2..6d037b460d 100644 --- a/pandatool/src/progbase/CMakeLists.txt +++ b/pandatool/src/progbase/CMakeLists.txt @@ -10,8 +10,7 @@ set(P3PROGBASE_SOURCES composite_sources(p3progbase P3PROGBASE_SOURCES) add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) -target_link_libraries(p3progbase p3pandatoolbase panda) -target_use_packages(p3progbase ZLIB) +target_link_libraries(p3progbase p3pandatoolbase panda PKG::ZLIB) # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. From 968ca123d4973aa79a8845fd007964440d85dc14 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 21 Sep 2018 16:24:48 -0600 Subject: [PATCH 493/744] CMake: Use packages by imported target where available This is preferable because imported targets generally include all of the relevant information specific to the particular installation of each package, and without needing to hunt down a bunch of variables to do it. To do this, package_option() (which is starting to grow in scope a little beyond just providing the package option, come to think of it) is given a new IMPORTED_AS option, which tells the package configuration system to look for one or more imported targets and link against them instead. --- cmake/macros/PackageConfig.cmake | 73 ++++++++++++++++++++++---------- dtool/Package.cmake | 18 +++++--- 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 9be8004ac7..847cb95281 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -15,6 +15,7 @@ # Usage: # package_option(package_name package_doc_string # [DEFAULT ON | OFF] +# [IMPORTED_AS CMake::Imported::Target [...]] # [FOUND_AS find_name] # [LICENSE license]) # Examples: @@ -28,6 +29,11 @@ # FOUND_AS indicates the name of the CMake find_package() module, which # may differ from Panda3D's internal name for that package. # +# IMPORTED_AS is used to indicate that the find_package() may have +# provided one or more IMPORTED targets, and that if at least one is +# found, the IMPORTED target(s) should be used instead of the +# variables provided by find_package() +# # # Function: config_package # Usage: @@ -62,6 +68,7 @@ function(package_option name) set(command) set(default) set(found_as "${name}") + set(imported_as) set(license "") set(cache_string) @@ -87,6 +94,12 @@ function(package_option name) elseif(arg STREQUAL "LICENSE") set(command "LICENSE") + elseif(arg STREQUAL "IMPORTED_AS") + set(command "IMPORTED_AS") + + elseif(command STREQUAL "IMPORTED_AS") + list(APPEND imported_as "${arg}") + else() # Yes, a list, because semicolons can be in there, and # that gets split up into multiple args, so we have to @@ -96,8 +109,8 @@ function(package_option name) endif() endforeach() - if(command STREQUAL "DEFAULT") - message(SEND_ERROR "DEFAULT in package_option takes an argument") + if(command AND NOT command STREQUAL "IMPORTED_AS") + message(SEND_ERROR "${command} in package_option takes an argument") endif() # If the default is not set, we set it. @@ -142,31 +155,47 @@ function(package_option name) set(PANDA_PACKAGE_DEFAULT_${name} "${default}" PARENT_SCOPE) - # Create the option. - option("HAVE_${name}" "${cache_string}" "${default}") - - # Create the library if the package is available. + # Create the INTERFACE library used to depend on this package. add_library(PKG::${name} INTERFACE IMPORTED GLOBAL) + # Create the option, and if it actually is enabled, populate the INTERFACE + # library created above + option("HAVE_${name}" "${cache_string}" "${default}") if(HAVE_${name}) - if(${found_as}_INCLUDE_DIRS) - set(includes ${${found_as}_INCLUDE_DIRS}) - else() - set(includes "${${found_as}_INCLUDE_DIR}") - endif() - if(${found_as}_LIBRARIES) - set(libs ${${found_as}_LIBRARIES}) - else() - set(libs "${${found_as}_LIBRARY}") - endif() + set(use_variables ON) - target_link_libraries(PKG::${name} INTERFACE ${libs}) + foreach(implib ${imported_as}) + if(TARGET ${implib}) + # We found one of the implibs, so we don't need to use variables + # (below) anymore + set(use_variables OFF) - # 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 - "$<$>>:${includes}>") + # Yes, this is ugly. See below for an explanation. + target_link_libraries(PKG::${name} INTERFACE + "$<$>>:${implib}>") + endif() + endforeach(implib) + + if(use_variables) + if(${found_as}_INCLUDE_DIRS) + set(includes ${${found_as}_INCLUDE_DIRS}) + else() + set(includes "${${found_as}_INCLUDE_DIR}") + endif() + if(${found_as}_LIBRARIES) + set(libs ${${found_as}_LIBRARIES}) + 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 + "$<$>>:${includes}>") + endif() endif() endfunction(package_option) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index f4112a54e1..2d01f72d39 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -88,8 +88,10 @@ endif() # find_package(OpenSSL COMPONENTS ssl crypto QUIET) -package_option(OPENSSL DEFAULT ON - "Enable OpenSSL support") +package_option(OPENSSL + DEFAULT ON + "Enable OpenSSL support" + IMPORTED_AS OpenSSL::SSL OpenSSL::Crypto) option(REPORT_OPENSSL_ERRORS "Define this true to include the OpenSSL code to report verbose @@ -112,7 +114,10 @@ config_package(JPEG "libjpeg") # PNG: find_package(PNG QUIET) -package_option(PNG DEFAULT ON "Enable support for loading .png images.") +package_option(PNG + DEFAULT ON + "Enable support for loading .png images." + IMPORTED_AS PNG::PNG) config_package(PNG "libpng") # TIFF: @@ -201,7 +206,8 @@ config_package(VRPN "VRPN") find_package(zlib QUIET) package_option(ZLIB - "Enables support for compression of Panda assets.") + "Enables support for compression of Panda assets." + IMPORTED_AS ZLIB::ZLIB) config_package(ZLIB "zlib") @@ -260,6 +266,7 @@ package_option(OPENAL "This enables support for audio output via OpenAL. Some platforms, such as macOS, provide their own OpenAL implementation, which Panda3D can use. But, on most platforms this will imply OpenAL Soft, which is LGPL licensed." + IMPORTED_AS OpenAL::OpenAL LICENSE "LGPL") config_package(OPENAL "OpenAL sound library") @@ -272,7 +279,8 @@ find_package(Freetype QUIET) package_option(FREETYPE "This enables support for the FreeType font-rendering library. If disabled, - 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) config_package(FREETYPE "FreeType") From bd187643f361b519d6369fcff699ebfd9e7ff63b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 21 Sep 2018 19:22:59 -0600 Subject: [PATCH 494/744] CMake: Look for packages by CONFIG first This requires a macro to override find_package, as the default behavior in CMake is to fall back from MODULE onto CONFIG. Note that Bullet is given a specific override not to look for a CONFIG, since Bullet tends to use weird paths in its CONFIG script. --- cmake/macros/PackageConfig.cmake | 28 ++++++++++++++++++++++++++++ dtool/Package.cmake | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 847cb95281..b35b5e5bb9 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -256,3 +256,31 @@ function(show_packages) endif() endforeach() endfunction() + +# +# find_package +# +# This override is necessary because CMake's default behavior is to run +# find_package in MODULE mode, *then* in CONFIG mode. This is silly! CONFIG +# mode makes more sense to be done first, since any system config file will +# know vastly more about the package's configuration than a module can hope to +# guess. +# +macro(find_package name) + if(";${ARGN};" MATCHES ";(CONFIG|MODULE|NO_MODULE);") + # Caller explicitly asking for a certain mode; so be it. + _find_package(${ARGV}) + else() + string(TOUPPER "${name}" __pkgname_upper) + + # Try CONFIG + _find_package("${name}" CONFIG ${ARGN}) + if(NOT ${name}_FOUND) + # CONFIG didn't work, fall back to MODULE + _find_package("${name}" MODULE ${ARGN}) + else() + # Case-sensitivity + set(${__pkgname_upper}_FOUND 1) + endif() + endif() +endmacro(find_package) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 2d01f72d39..558871f43a 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -296,7 +296,7 @@ package_option(GTK2) # # Bullet -find_package(Bullet QUIET) +find_package(Bullet MODULE QUIET) package_option(BULLET "Enable this option to support game dynamics with the Bullet physics library.") From cfb32fad8491932dda958791113f7d4217a3f963 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 22 Sep 2018 15:55:03 -0600 Subject: [PATCH 495/744] CMake: Detect OpenGL (and SpeedTree) the proper way --- dtool/Config.cmake | 5 ----- dtool/LocalSetup.cmake | 12 ------------ dtool/Package.cmake | 38 ++++++++++++++++++++++++++++---------- 3 files changed, 28 insertions(+), 27 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 5e1ddaa55b..a7d5a21043 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -419,11 +419,6 @@ option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) -# Is OpenGL installed, and where? -find_package(OpenGL QUIET) -set(GL_FOUND ${OPENGL_FOUND}) -package_option(GL "Enable OpenGL support.") - # If you are having trouble linking in OpenGL extension functions at # runtime for some reason, you can set this variable. It also, # requires you to install the OpenGL header files and compile-time diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 2bbf25cc93..8a4006de86 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -155,24 +155,12 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_SPEEDTREE) - message("+ SpeedTree") -else() - message("- Did not find SpeedTree") -endif() - if(HAVE_GTK2) message("+ gtk+-2") else() message("- Did not find gtk+-2") endif() -if(HAVE_GL) - message("+ OpenGL") -else() - message("- Did not find OpenGL") -endif() - if(HAVE_GLES) message("+ OpenGL ES 1") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 558871f43a..e91d15ff58 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -315,25 +315,43 @@ config_package(ODE "Open Dynamics Engine") # PhysX find_package(PhysX QUIET) -package_option(PhysX +package_option(PHYSX "Enable this option to support game dynamics with Nvidia PhysX." LICENSE "Nvidia") -config_package(PhysX "Nvidia PhysX") +config_package(PHYSX "Nvidia PhysX") +# +# ------------ SpeedTree ------------ +# + +# SpeedTree +find_package(SpeedTree QUIET) + +package_option(SPEEDTREE + "Enable this option to include scenegraph support for SpeedTree trees." + LICENSE "SpeedTree") + +config_package(SPEEDTREE "SpeedTree") + +# +# ------------ Rendering APIs ------------ +# + +# OpenGL +find_package(OpenGL QUIET) + +package_option(GL + "Enable OpenGL support." + FOUND_AS OPENGL + IMPORTED_AS OpenGL::GL) + +config_package(GL "OpenGL") ######## # TODO # ######## -# Find and configure PhysX -#find_package(PhysX) -#config_package(PHYSX "Aegia PhysX") - -# Find and configure SpeedTree -#find_package(SpeedTree) -#config_package(SPEEDTREE "SpeedTree") - # Find and configure OpenGL ES 1 #find_package(GLES) #config_package(GLES COMMENT "OpenGL ES 1") From 645fe32ca3d77511fe31e68697bb8a5df831a6f2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 24 Sep 2018 13:48:12 -0600 Subject: [PATCH 496/744] CMake: Fix capitalization of OpenSSL components --- dtool/Package.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index e91d15ff58..b1b0780040 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -86,7 +86,7 @@ endif() # # ------------ OpenSSL ------------ # -find_package(OpenSSL COMPONENTS ssl crypto QUIET) +find_package(OpenSSL COMPONENTS SSL Crypto QUIET) package_option(OPENSSL DEFAULT ON From 2a2a07773b5276bf276511c43339c31eef350855 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 24 Sep 2018 20:34:33 -0600 Subject: [PATCH 497/744] CMake: Disable clang_cl warnings about /Gm- being unused --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 785e5a5ed3..c098cb1f43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,9 @@ if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") if(MSVC) # Clang behaving as MSVC - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-microsoft-template") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") endif() endif() if(WIN32) From 2e2a8eae9885fd3e3cb8a88503464601e25d426e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 28 Sep 2018 17:15:56 -0600 Subject: [PATCH 498/744] CMake: Byte-compile all .py files when building Panda This also involves the creation a new include: Python.cmake This file will contain utility functions for building Python modules and installing Python packages. --- CMakeLists.txt | 5 +- cmake/macros/Interrogate.cmake | 39 +------------- cmake/macros/Python.cmake | 95 ++++++++++++++++++++++++++++++++++ direct/CMakeLists.txt | 5 +- 4 files changed, 99 insertions(+), 45 deletions(-) create mode 100644 cmake/macros/Python.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index c098cb1f43..a73098190c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -87,6 +87,7 @@ include(AddBisonTarget) # Defines add_bison_target function include(AddFlexTarget) # Defines add_flex_target function include(BuildMetalib) # Defines add_component_library AND add_metalib include(CompositeSources) # Defines composite_sources function +include(Python) # Defines add_python_target AND install_python_package include(Interrogate) # Defines target_interrogate AND add_python_module include(RunPzip) # Defines run_pzip function include(Versioning) # Hooks 'add_library' to apply VERSION/SOVERSION @@ -174,7 +175,5 @@ except ImportError as err: file(WRITE "${PROJECT_BINARY_DIR}/pandac/__init__.py" "") # Now install ourselves: - install( - FILES "${PROJECT_BINARY_DIR}/pandac/__init__.py" "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" - DESTINATION "${PYTHON_LIB_INSTALL_DIR}/pandac") + install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB) endif() diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 7b4d201936..291648e72d 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -300,43 +300,6 @@ function(add_python_module module) set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endfunction(add_python_module) -# -# Function: add_python_target(target [source1 [source2 ...]]) -# Build the provided source(s) as a Python extension module, linked against the -# Python runtime library. -# -# Note that this also takes care of installation, unlike other target creation -# commands in CMake. -# -function(add_python_target target) - if(NOT HAVE_PYTHON) - return() - endif() - - string(REGEX REPLACE "^.*\\." "" basename "${target}") - set(sources ${ARGN}) - - add_library(${target} ${MODULE_TYPE} ${sources}) - target_link_libraries(${target} PKG::PYTHON) - - if(BUILD_SHARED_LIBS) - set_target_properties(${target} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" - OUTPUT_NAME "${basename}" - PREFIX "" - SUFFIX "${PYTHON_EXTENSION_SUFFIX}") - - install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") - else() - set_target_properties(${target} PROPERTIES - OUTPUT_NAME "${basename}" - PREFIX "libpython_panda3d_") - - install(TARGETS ${target} DESTINATION lib) - endif() - -endfunction(add_python_target) - if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS) # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' @@ -345,5 +308,5 @@ if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS) # The Interrogate path needs to be installed to the architecture-dependent # Python directory. - install(FILES "${PROJECT_BINARY_DIR}/panda3d/__init__.py" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + install_python_package("${PROJECT_BINARY_DIR}/panda3d") endif() diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake new file mode 100644 index 0000000000..b2457650f8 --- /dev/null +++ b/cmake/macros/Python.cmake @@ -0,0 +1,95 @@ +# Filename: Python.cmake +# +# Description: This file provides support functions for building/installing +# Python extension modules and/or pure-Python packages. +# +# Functions: +# add_python_target(target [source1 [source2 ...]]) +# install_python_package(path [ARCH/LIB]) +# + +# +# Function: add_python_target(target [source1 [source2 ...]]) +# Build the provided source(s) as a Python extension module, linked against the +# Python runtime library. +# +# Note that this also takes care of installation, unlike other target creation +# commands in CMake. +# +function(add_python_target target) + if(NOT HAVE_PYTHON) + return() + endif() + + string(REGEX REPLACE "^.*\\." "" basename "${target}") + set(sources ${ARGN}) + + add_library(${target} ${MODULE_TYPE} ${sources}) + target_link_libraries(${target} PKG::PYTHON) + + if(BUILD_SHARED_LIBS) + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + OUTPUT_NAME "${basename}" + PREFIX "" + SUFFIX "${PYTHON_EXTENSION_SUFFIX}") + + install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + else() + set_target_properties(${target} PROPERTIES + OUTPUT_NAME "${basename}" + PREFIX "libpython_panda3d_") + + install(TARGETS ${target} DESTINATION lib) + endif() + +endfunction(add_python_target) + +# +# Function: install_python_package(path [ARCH/LIB]) +# +# Installs the Python package which was built at `path`. +# +# Note that this handles more than just installation; it will also invoke +# Python's compileall utility to pregenerate .pyc/.pyo files. This will only +# happen if the Python interpreter is found. +# +# The ARCH or LIB keyword may be used to specify whether this package should be +# installed into Python's architecture-dependent or architecture-independent +# package path. The default, if unspecified, is LIB. +# +function(install_python_package path) + if(ARGN STREQUAL "ARCH") + set(type "ARCH") + elseif(ARGN STREQUAL "LIB") + set(type "LIB") + elseif(ARGN STREQUAL "") + set(type "LIB") + else() + message(FATAL_ERROR "install_python_package got unexpected argument: ${ARGN}") + endif() + + get_filename_component(package_name "${path}" NAME) + set(custom_target "bytecompile_${package_name}") + + file(RELATIVE_PATH relpath "${PROJECT_BINARY_DIR}" "${path}") + + if(PYTHON_EXECUTABLE) + add_custom_target(${custom_target} ALL) + add_custom_command( + TARGET ${custom_target} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" + COMMAND "${PYTHON_EXECUTABLE}" -m compileall -q "${relpath}") + add_custom_command( + TARGET ${custom_target} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" + COMMAND "${PYTHON_EXECUTABLE}" -OO -m compileall -q "${relpath}") + endif() + + set(dir ${PYTHON_${type}_INSTALL_DIR}) + if(dir) + install(DIRECTORY "${path}" DESTINATION "${dir}" + FILES_MATCHING REGEX "\\.py[co]?$") + endif() + +endfunction(install_python_package) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index cfda39d6b0..b3cb42c78a 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -51,8 +51,5 @@ if(HAVE_PYTHON) file(WRITE "${PROJECT_BINARY_DIR}/direct/__init__.py" "") # Install all files - install( - DIRECTORY "${PROJECT_BINARY_DIR}/direct" - DESTINATION "${PYTHON_LIB_INSTALL_DIR}" - FILES_MATCHING REGEX "\\.py[co]?$") + install_python_package("${PROJECT_BINARY_DIR}/direct" LIB) endif() From 73e273e7828935c08870ffe1dc24203267e7fbdc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 28 Sep 2018 17:28:17 -0600 Subject: [PATCH 499/744] CMake: Remove hardcoded 'panda3d.*' assumptions from Python.cmake --- cmake/macros/Python.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index b2457650f8..0ede7c1c7e 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -24,21 +24,25 @@ function(add_python_target target) string(REGEX REPLACE "^.*\\." "" basename "${target}") set(sources ${ARGN}) + string(REGEX REPLACE "\\.[^.]+$" "" namespace "${target}") + string(REPLACE "." "_" underscore_namespace "${namespace}") + string(REPLACE "." "/" slash_namespace "${namespace}") + add_library(${target} ${MODULE_TYPE} ${sources}) target_link_libraries(${target} PKG::PYTHON) if(BUILD_SHARED_LIBS) set_target_properties(${target} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/panda3d" + LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${slash_namespace}" OUTPUT_NAME "${basename}" PREFIX "" SUFFIX "${PYTHON_EXTENSION_SUFFIX}") - install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/panda3d") + install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") else() set_target_properties(${target} PROPERTIES OUTPUT_NAME "${basename}" - PREFIX "libpython_panda3d_") + PREFIX "libpython_${underscore_namespace}_") install(TARGETS ${target} DESTINATION lib) endif() From 53920e7aee70276584ec952e5944b531c8631e15 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 28 Sep 2018 21:24:26 -0600 Subject: [PATCH 500/744] CMake: Move __init__.py generation to Python.cmake This also allows us to generate a suitable __init__.py for fixing up PATH and/or __path__ on platforms that need it to properly import Python extension modules. --- CMakeLists.txt | 2 - cmake/macros/Interrogate.cmake | 4 -- cmake/macros/Python.cmake | 120 +++++++++++++++++++++++++++++++++ direct/CMakeLists.txt | 3 - 4 files changed, 120 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a73098190c..6e17563d4a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -172,8 +172,6 @@ except ImportError as err: ") endforeach() - file(WRITE "${PROJECT_BINARY_DIR}/pandac/__init__.py" "") - # Now install ourselves: install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB) endif() diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 291648e72d..84f4f9cc7e 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -302,10 +302,6 @@ endfunction(add_python_module) if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS) - # We have to create an __init__.py so that Python 2.x can recognize 'panda3d' - # as a package. - file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" "") - # The Interrogate path needs to be installed to the architecture-dependent # Python directory. install_python_package("${PROJECT_BINARY_DIR}/panda3d") diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 0ede7c1c7e..524caae38e 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -6,6 +6,7 @@ # Functions: # add_python_target(target [source1 [source2 ...]]) # install_python_package(path [ARCH/LIB]) +# ensure_python_init(path [ARCH] [ROOT] [OVERWRITE]) # # @@ -47,6 +48,12 @@ function(add_python_target target) install(TARGETS ${target} DESTINATION lib) endif() + set(keywords OVERWRITE ARCH) + if(NOT underscore_namespace MATCHES ".*_.*") + list(APPEND keywords ROOT) + endif() + ensure_python_init("${PROJECT_BINARY_DIR}/${slash_namespace}" ${keywords}) + endfunction(add_python_target) # @@ -90,6 +97,8 @@ function(install_python_package path) COMMAND "${PYTHON_EXECUTABLE}" -OO -m compileall -q "${relpath}") endif() + ensure_python_init("${path}") + set(dir ${PYTHON_${type}_INSTALL_DIR}) if(dir) install(DIRECTORY "${path}" DESTINATION "${dir}" @@ -97,3 +106,114 @@ function(install_python_package path) endif() endfunction(install_python_package) + +# +# Function: ensure_python_init(path [ARCH] [ROOT] [OVERWRITE]) +# +# Makes sure that the directory - at `path` - contains a file named +# '__init__.py', which is necessary for Python to recognize the directory as a +# package. +# +# ARCH, if specified, means that this is a binary package, and the build tree +# might contain configuration-specific subdirectories. The __init__.py will be +# generated with a function that ensures that the appropriate configuration +# subdirectory is in the path. +# +# ROOT, if specified, means that the directory may sit directly adjacent to a +# 'bin' directory, which should be added to the DLL search path on Windows. +# +# OVERWRITE causes the __init__.py file to be overwritten if one is already +# present. +# +function(ensure_python_init path) + set(arch OFF) + set(root OFF) + set(overwrite OFF) + + foreach(arg ${ARGN}) + if(arg STREQUAL "ARCH") + set(arch ON) + elseif(arg STREQUAL "ROOT") + set(root ON) + elseif(arg STREQUAL "OVERWRITE") + set(overwrite ON) + else() + message(FATAL_ERROR "ensure_python_init got unexpected argument: ${arg}") + endif() + endforeach(arg) + + set(init_filename "${path}/__init__.py") + if(EXISTS "${init_filename}" AND NOT overwrite) + return() + endif() + + file(WRITE "${init_filename}" "") + + if(arch AND NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".") + # ARCH set, and this is a multi-configuration generator + + set(configs "${CMAKE_CONFIGURATION_TYPES}") + + # Debug should be at the end (highest preference) + list(REMOVE_ITEM configs "Debug") + list(APPEND configs "Debug") + + string(REPLACE ";" "', '" configs "${configs}") + + file(APPEND "${init_filename}" " +def _fixup_path(): + try: + path = __path__[0] + except (NameError, IndexError): + return # Not a package, or not on filesystem + + import os + abspath = os.path.abspath(path) + + newpath = None + for config in ['${configs}']: + cfgpath = os.path.join(abspath, config) + if not os.path.isdir(cfgpath): + continue + + newpath = cfgpath + + if config.lower() == os.environ.get('CMAKE_CONFIGURATION', '').lower(): + break + + if newpath: + __path__.insert(0, newpath) + +_fixup_path() +del _fixup_path +") + endif() + + if(root AND WIN32 AND NOT CYGWIN) + # ROOT set, and this is Windows + + file(APPEND "${init_filename}" " +def _fixup_dlls(): + try: + path = __path__[0] + except (NameError, IndexError): + return # Not a package, or not on filesystem + + import os + + relpath = os.path.relpath(path, __path__[-1]) + dll_path = os.path.abspath(os.path.join(__path__[-1], '../bin', relpath)) + if not os.path.isdir(dll_path): + return + + os_path = os.environ.get('PATH', '') + os_path = os_path.split(os.pathsep) if os_path else [] + os_path.insert(0, dll_path) + os.environ['PATH'] = os.pathsep.join(os_path) + +_fixup_dlls() +del _fixup_dlls +") + endif() + +endfunction(ensure_python_init) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index b3cb42c78a..a1568a527c 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -47,9 +47,6 @@ if(HAVE_PYTHON) FILES_MATCHING PATTERN "*.py") endforeach() - # We also need an __init__.py file, which we have to generate: - file(WRITE "${PROJECT_BINARY_DIR}/direct/__init__.py" "") - # Install all files install_python_package("${PROJECT_BINARY_DIR}/direct" LIB) endif() From 0997c6b19c6b3aaa491fca8c20cdd3f15f97df96 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 30 Sep 2018 15:42:58 -0600 Subject: [PATCH 501/744] CMake: Don't depend on Python interpreter This allows building against the Python libraries even when the Python interpreter/executable is missing. The correct extensions for the binary modules will be guessed, the tests will fail, and the bytecode for any pure-Python modules will not be precompiled. --- cmake/macros/Python.cmake | 4 +++- dtool/Package.cmake | 35 ++++++++++++++++++++++------------- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 524caae38e..a04679f5d3 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -39,7 +39,9 @@ function(add_python_target target) PREFIX "" SUFFIX "${PYTHON_EXTENSION_SUFFIX}") - install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") + if(PYTHON_ARCH_INSTALL_DIR) + install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") + endif() else() set_target_properties(${target} PROPERTIES OUTPUT_NAME "${basename}" diff --git a/dtool/Package.cmake b/dtool/Package.cmake index b1b0780040..71a9795d35 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -7,10 +7,9 @@ set(WANT_PYTHON_VERSION "" find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) -if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) + +if(PYTHONLIBS_FOUND) set(PYTHON_FOUND ON) -else() - set(PYTHON_FOUND OFF) endif() package_option(PYTHON DEFAULT ON @@ -19,16 +18,26 @@ is also enabled, Python bindings will be generated.") # Also detect the optimal install paths: if(HAVE_PYTHON) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False))" - OUTPUT_VARIABLE _LIB_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} - -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" - OUTPUT_VARIABLE _ARCH_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE) + if(WIN32 AND NOT CYGWIN) + set(_LIB_DIR ".") + set(_ARCH_DIR ".") + elseif(PYTHON_EXECUTABLE) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(False))" + OUTPUT_VARIABLE _LIB_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process( + COMMAND ${PYTHON_EXECUTABLE} + -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" + OUTPUT_VARIABLE _ARCH_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE) + else() + set(_LIB_DIR "") + set(_ARCH_DIR "") + endif() + + execute_process( COMMAND ${PYTHON_EXECUTABLE} -c "from sysconfig import get_config_var as g; print((g('EXT_SUFFIX') or g('SO'))[:])" From 10b5c9f3e6a1735e160e8d41d9e7262b8baf4fff Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 5 Oct 2018 14:59:58 -0600 Subject: [PATCH 502/744] CMake: Use CMake 3.12 FindPython, where available --- dtool/Package.cmake | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 71a9795d35..d76d7aa644 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -5,16 +5,25 @@ set(WANT_PYTHON_VERSION "" CACHE STRING "Which Python version to seek out for building Panda3D against.") -find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) -find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) +find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development) -if(PYTHONLIBS_FOUND) +if(Python_FOUND) set(PYTHON_FOUND ON) + set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) +else() + find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) + find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) + + if(PYTHONLIBS_FOUND) + set(PYTHON_FOUND ON) + endif() endif() -package_option(PYTHON DEFAULT ON +package_option(PYTHON + DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE -is also enabled, Python bindings will be generated.") +is also enabled, Python bindings will be generated." + IMPORTED_AS Python::Python) # Also detect the optimal install paths: if(HAVE_PYTHON) From 86d137d4102ef1e595a7a4e53dfdd67ec99355b8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 6 Oct 2018 02:20:31 -0600 Subject: [PATCH 503/744] CMake: Windows static libraries should be prefixed with "lib" --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e17563d4a..e2d5d3b6d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,9 @@ set(CMAKE_SHARED_MODULE_PREFIX "lib") if(WIN32) set(CMAKE_DEBUG_POSTFIX "_d") + # Windows uses libfoo.lib for static libraries and foo.lib/dll for dynamic. + set(CMAKE_STATIC_LIBRARY_PREFIX "lib") + # On Windows, modules (DLLs) are located in bin; lib is just for .lib files set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") if(BUILD_SHARED_LIBS) From 9b4b83c0e125a7375afec259d8ab317f87d98ca6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 6 Oct 2018 18:33:34 -0600 Subject: [PATCH 504/744] CMake: Properly propagate INTERFACE_COMPILE_DEFINITIONS to component libs --- cmake/macros/BuildMetalib.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 5c14ee3c09..e5093fd3c2 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -30,6 +30,10 @@ function(target_link_libraries target) set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") + # And for INTERFACE_COMPILE_DEFINITIONS as well + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") + # Libraries are only linked transitively if they aren't components. # Unfortunately, it seems like INTERFACE_LINK_LIBRARIES can't have # generator expressions on an object library(?) so we resort to taking From 086663ef4added735a90c53988459665da66aed5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 7 Oct 2018 16:42:20 -0600 Subject: [PATCH 505/744] CMake: Use $ when referencing paths in build directory This prevents CMake from including them in exported targets, which allows the exported targets to be installed. --- dtool/src/dtoolbase/CMakeLists.txt | 4 ++-- dtool/src/prc/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index ebcc827fb5..43a4013e5e 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -87,8 +87,8 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) # Help other libraries find the autogenerated headers target_include_directories(p3dtoolbase PUBLIC - ${CMAKE_CURRENT_BINARY_DIR} - ${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR}) + $ + $) target_link_libraries(p3dtoolbase PKG::EIGEN) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 9c74352017..0d834afd62 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -72,7 +72,7 @@ composite_sources(p3prc P3PRC_SOURCES) add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) -target_include_directories(p3prc PUBLIC ${CMAKE_CURRENT_BINARY_DIR}) +target_include_directories(p3prc PUBLIC $) target_link_libraries(p3prc p3dtool PKG::OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) From 149303f04c37cb7f2e16db8370d9c05cc73e3b1a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 7 Oct 2018 17:12:51 -0600 Subject: [PATCH 506/744] CMake: Clean up stray ${X11_LIBRARIES} direct reference --- panda/src/x11display/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index b4138fb0f6..897653c4e2 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -14,7 +14,7 @@ set(P3X11DISPLAY_SOURCES composite_sources(p3x11display P3X11DISPLAY_SOURCES) add_component_library(p3x11display SYMBOL BUILDING_PANDAX11 ${P3X11DISPLAY_HEADERS} ${P3X11DISPLAY_SOURCES}) -target_link_libraries(p3x11display panda ${X11_LIBRARIES}) +target_link_libraries(p3x11display panda PKG::X11) if(NOT BUILD_METALIBS) install(TARGETS p3x11display DESTINATION lib) From f696bfbfe22ddc6ce4285a03faab1a59b2ef5a10 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 9 Oct 2018 00:37:23 -0600 Subject: [PATCH 507/744] CMake: Clean up run_pzip This should get rid of stray directories in the build directory on Windows. --- cmake/macros/RunPzip.cmake | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index 6cb30d6880..13225d0fb4 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -10,20 +10,23 @@ function(run_pzip target_name source destination glob) file(GLOB_RECURSE files RELATIVE "${source}" "${source}/${glob}") set(dstfiles "") - foreach(srcfile ${files}) - file(RELATIVE_PATH srcfile_rel "${destination}" "${source}/${srcfile}") - file(RELATIVE_PATH dstfile_rel "${destination}" "${destination}/${srcfile}.pz") + foreach(filename ${files}) + string(REGEX REPLACE "^/" "" filename "${filename}") + file(RELATIVE_PATH srcfile "${destination}" "${source}/${filename}") - list(APPEND dstfiles "${dstfile_rel}") - add_custom_command(OUTPUT "${dstfile_rel}" - COMMAND pzip -c > "${dstfile_rel}" < "${srcfile_rel}" + get_filename_component(dstdir "${destination}/${filename}" DIRECTORY) + file(MAKE_DIRECTORY "${dstdir}") + + set(dstfile "${filename}.pz") + list(APPEND dstfiles "${destination}/${dstfile}") + + add_custom_command(OUTPUT "${destination}/${dstfile}" + COMMAND pzip -c > "${dstfile}" < "${srcfile}" WORKING_DIRECTORY "${destination}" DEPENDS pzip COMMENT "") - get_filename_component(dstdir "${destination}/${dstfile_rel}" DIRECTORY) - file(MAKE_DIRECTORY "${dstdir}") - endforeach(srcfile) + endforeach(filename) add_custom_target(${target_name} ALL DEPENDS ${dstfiles} From b8fa692e2fe532bcadc4ac38830d37de5ed510e1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 9 Oct 2018 00:38:14 -0600 Subject: [PATCH 508/744] CMake: Fix BuildMetalib on CMake 3.0.2 CMake now tests out correctly on 3.0.2 again. --- cmake/macros/BuildMetalib.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index e5093fd3c2..1a060a535d 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -131,6 +131,14 @@ function(add_component_library target_name) endforeach() if(BUILD_METALIBS) + # CMake 3.0.2 doesn't like .I/.N/.T files! We let it know that they're only + # headers. + foreach(source ${sources}) + if(source MATCHES "\\.[INT]$") + set_source_files_properties(${source} PROPERTIES HEADER_FILE_ONLY ON) + endif() + endforeach(source) + add_library("${target_name}" OBJECT ${sources}) else() add_library("${target_name}" ${sources}) From e89621b88d354992b40d12721c5576c325db0195 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 7 Oct 2018 16:07:16 -0600 Subject: [PATCH 509/744] CMake: "Flatten" metalibs more By "flatten" I mean that component libraries aren't referenced by genex anymore; instead, their include directories and libraries are copied out of their interfaces and into the interface of the metalib. This prepares for exporting our targets, by making sure that the component libraries don't have to be installed for CMake to be able to export metalibs. --- cmake/macros/BuildMetalib.cmake | 61 ++++++++++++++++++++++++--- panda/metalibs/pandagl/CMakeLists.txt | 2 +- 2 files changed, 56 insertions(+), 7 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 1a060a535d..06c2f15fff 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -201,7 +201,11 @@ function(add_metalib target_name) endif() endforeach() - set(defines) + string(REPLACE ";" "|" piped_components "${components}") + set(component_genex_regex ".*TARGET_PROPERTY:(${piped_components}),.*") + + set(private_defines) + set(interface_defines) set(includes) set(libs) set(component_init_funcs "") @@ -212,6 +216,7 @@ function(add_metalib target_name) "Missing component library ${component} referenced by metalib ${target_name}! (Component library targets must be created BEFORE add_metalib.)") endif() + get_target_property(is_component "${component}" IS_COMPONENT) if(NOT is_component) message(FATAL_ERROR @@ -231,9 +236,49 @@ function(add_metalib target_name) endif() if(BUILD_METALIBS) - list(APPEND defines "$") - list(APPEND includes "$") - list(APPEND libs "$") + # This will be an object library we're pulling in; rather than link, + # let's try to "flatten" all of its properties into ours. + + # Private defines: Just reference using a generator expression + list(APPEND private_defines "$") + # Interface defines: Copy those + get_target_property(component_defines "${component}" INTERFACE_COMPILE_DEFINITIONS) + if(component_defines) + list(APPEND interface_defines ${component_defines}) + endif() + + # Include directories: Filter out anything that references a component + # library or anything in the project path + get_target_property(component_includes "${component}" INTERFACE_INCLUDE_DIRECTORIES) + foreach(component_include ${component_includes}) + if(component_include MATCHES "${component_genex_regex}") + # Ignore component references + elseif(component_include MATCHES "^${PROJECT_SOURCE_DIR}") + # Include path within project; should only be included when building + list(APPEND includes "$") + else() + # Anything else gets included + list(APPEND includes "${component_include}") + endif() + endforeach(component_include) + + # Link libraries: Filter out component libraries; we aren't linking + # against them, we're using their objects + get_target_property(component_libraries "${component}" INTERFACE_LINK_LIBRARIES) + foreach(component_library ${component_libraries}) + if(NOT component_library) + # NOTFOUND - guess there are no INTERFACE_LINK_LIBRARIES + elseif(component_library MATCHES "${component_genex_regex}") + # Ignore component references + elseif(component_library MATCHES ".*(${piped_components}).*") + # Component library, ignore + else() + # Anything else gets included + list(APPEND libs "${component_library}") + endif() + endforeach(component_library) + + # Consume this component's objects list(APPEND sources "$") else() list(APPEND libs "${component}") @@ -252,8 +297,12 @@ function(add_metalib target_name) endif() add_library("${target_name}" ${sources}) - target_compile_definitions("${target_name}" PRIVATE ${defines}) + target_compile_definitions("${target_name}" + PRIVATE ${private_defines} + INTERFACE ${interface_defines}) target_link_libraries("${target_name}" ${libs}) - target_include_directories("${target_name}" PUBLIC ${includes}) + target_include_directories("${target_name}" + PUBLIC ${includes} + INTERFACE "$/include/panda3d>") endfunction(add_metalib) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 5bcfcd2164..10c8a9aedc 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -7,7 +7,7 @@ if(HAVE_GL) HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") endif() - set(PANDAGL_LINK_TARGETS p3glgsg) + set(PANDAGL_LINK_TARGETS p3glgsg p3glstuff) if(HAVE_GLX) list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay p3x11display) From a0d9a931e0c32b0973610a0c5ef0e133643f8cb8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 10 Oct 2018 20:14:47 -0600 Subject: [PATCH 510/744] CMake: Simplify target_link_libraries "object" linking shim This uses generator expressions instead, so that it's no longer dependent on all linked component libraries existing first. --- cmake/macros/BuildMetalib.cmake | 51 ++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 06c2f15fff..2b69f530f0 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -34,31 +34,35 @@ function(target_link_libraries target) set(compile_definitions "$") set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") - # Libraries are only linked transitively if they aren't components. - # Unfortunately, it seems like INTERFACE_LINK_LIBRARIES can't have - # generator expressions on an object library(?) so we resort to taking - # care of this at configuration time. - if(TARGET "${library}") - get_target_property(target_type "${library}" TYPE) - if(NOT target_type STREQUAL "INTERFACE_LIBRARY") - get_target_property(is_component "${library}" IS_COMPONENT) - else() - set(is_component OFF) - endif() + # Build up some generator expressions for determining whether `library` + # is a component library or not. + if(library MATCHES ".*::.*") + # "::" messes up CMake's genex parser; fortunately, a library whose + # name contains that is either an interface library or alias, and + # definitely not a component + set(is_component 0) + set(name_of_component "") + set(name_of_non_component "${library}") else() - # This is a safe assumption, since we define all component libraries - # before the metalib they appear in: - set(is_component OFF) + set(is_component "$") + + # CMake complains if we lookup IS_COMPONENT on an INTERFACE library :( + set(is_object "$,OBJECT_LIBRARY>") + set(is_component "$>") + + set(name_of_component "$<${is_component}:${library}>") + set(name_of_non_component "$<$:${library}>") endif() - if(is_component) - # Also build with the same BUILDING_ macros, because these will all end - # up in the same library. - set(compile_definitions "$") - set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") - else() - set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") - endif() + # Libraries are only linked transitively if they aren't components. + set_property(TARGET "${target}" APPEND PROPERTY + INTERFACE_LINK_LIBRARIES "${name_of_non_component}") + + # Also build with the same BUILDING_ macros, because these will all end + # up in the same library. + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY + COMPILE_DEFINITIONS "$<${is_component}:${compile_definitions}>") else() # This is a file path to an out-of-tree library - this needs to be # recorded so that the metalib can link them. (They aren't needed at @@ -66,7 +70,8 @@ function(target_link_libraries target) # transitively.) set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") endif() - endforeach() + + endforeach(library) endfunction(target_link_libraries) From 90d3b297679d9f9e1c3f5d7752534495b5a2c4a3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 10 Oct 2018 17:30:28 -0600 Subject: [PATCH 511/744] CMake: Sort direct/dtool/panda/pandatool subdirectories This forces us to make sure the inter-target dependencies work in an order-independent way. --- direct/CMakeLists.txt | 6 +-- dtool/CMakeLists.txt | 10 ++--- panda/CMakeLists.txt | 90 ++++++++++++++++++++-------------------- pandatool/CMakeLists.txt | 16 +++---- 4 files changed, 61 insertions(+), 61 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index a1568a527c..9c8d4a4411 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -3,12 +3,12 @@ if(NOT BUILD_PANDA) endif() # Include source directories which have C++ components: -add_subdirectory(src/directbase) -add_subdirectory(src/dcparser) add_subdirectory(src/dcparse) +add_subdirectory(src/dcparser) add_subdirectory(src/deadrec) -#add_subdirectory(src/directdServer) +add_subdirectory(src/directbase) #add_subdirectory(src/directd) +#add_subdirectory(src/directdServer) add_subdirectory(src/distributed) add_subdirectory(src/interval) add_subdirectory(src/motiontrail) diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 8c9761298a..018979f20a 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -2,14 +2,14 @@ include(LocalSetup.cmake) # Include dtool source directories +add_subdirectory(src/cppparser) +add_subdirectory(src/dconfig) add_subdirectory(src/dtoolbase) add_subdirectory(src/dtoolutil) -add_subdirectory(src/prc) -add_subdirectory(src/dconfig) -add_subdirectory(src/pystub) -add_subdirectory(src/cppparser) -add_subdirectory(src/interrogatedb) add_subdirectory(src/interrogate) +add_subdirectory(src/interrogatedb) +add_subdirectory(src/prc) +add_subdirectory(src/pystub) # Include dtool metalibs add_subdirectory(metalibs/dtool) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index b11bd5a0f3..2b976e5220 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -3,71 +3,71 @@ if(NOT BUILD_DTOOL) endif() # Include panda source directories -add_subdirectory(src/configfiles) -add_subdirectory(src/pandabase) -add_subdirectory(src/express) -add_subdirectory(src/dxml) -add_subdirectory(src/pipeline) -add_subdirectory(src/downloader) -add_subdirectory(src/downloadertools) -add_subdirectory(src/nativenet) -add_subdirectory(src/net) -add_subdirectory(src/linmath) -add_subdirectory(src/putil) -add_subdirectory(src/pstatclient) -add_subdirectory(src/event) -add_subdirectory(src/mathutil) -add_subdirectory(src/gsgbase) -add_subdirectory(src/pnmimage) -add_subdirectory(src/pnmimagetypes) -add_subdirectory(src/gobj) -add_subdirectory(src/pgraph) -add_subdirectory(src/pgraphnodes) -add_subdirectory(src/cull) -add_subdirectory(src/display) -add_subdirectory(src/glstuff) -add_subdirectory(src/glgsg) -add_subdirectory(src/x11display) -add_subdirectory(src/glxdisplay) -add_subdirectory(src/windisplay) -add_subdirectory(src/wgldisplay) -add_subdirectory(src/osxdisplay) -add_subdirectory(src/cocoadisplay) -add_subdirectory(src/movies) -add_subdirectory(src/ffmpeg) add_subdirectory(src/audio) add_subdirectory(src/audiotraits) add_subdirectory(src/chan) add_subdirectory(src/char) -add_subdirectory(src/dgraph) -add_subdirectory(src/device) -add_subdirectory(src/parametrics) -add_subdirectory(src/pnmtext) -add_subdirectory(src/text) -add_subdirectory(src/grutil) -add_subdirectory(src/tform) -add_subdirectory(src/pgui) -add_subdirectory(src/recorder) +add_subdirectory(src/cocoadisplay) add_subdirectory(src/collide) +add_subdirectory(src/configfiles) +add_subdirectory(src/cull) +add_subdirectory(src/device) +add_subdirectory(src/dgraph) +add_subdirectory(src/display) +add_subdirectory(src/downloader) +add_subdirectory(src/downloadertools) +add_subdirectory(src/dxml) add_subdirectory(src/egg) add_subdirectory(src/egg2pg) +add_subdirectory(src/event) +add_subdirectory(src/express) +add_subdirectory(src/ffmpeg) add_subdirectory(src/framework) +add_subdirectory(src/glgsg) +add_subdirectory(src/glstuff) +add_subdirectory(src/glxdisplay) +add_subdirectory(src/gobj) +add_subdirectory(src/grutil) +add_subdirectory(src/gsgbase) +add_subdirectory(src/linmath) +add_subdirectory(src/mathutil) +add_subdirectory(src/movies) +add_subdirectory(src/nativenet) +add_subdirectory(src/net) +add_subdirectory(src/osxdisplay) +add_subdirectory(src/pandabase) +add_subdirectory(src/parametrics) +add_subdirectory(src/pgraph) +add_subdirectory(src/pgraphnodes) +add_subdirectory(src/pgui) +add_subdirectory(src/pipeline) +add_subdirectory(src/pnmimage) +add_subdirectory(src/pnmimagetypes) +add_subdirectory(src/pnmtext) +add_subdirectory(src/pstatclient) +add_subdirectory(src/putil) +add_subdirectory(src/recorder) add_subdirectory(src/testbed) +add_subdirectory(src/text) +add_subdirectory(src/tform) +add_subdirectory(src/wgldisplay) +add_subdirectory(src/windisplay) +add_subdirectory(src/x11display) # For other components -# physics -add_subdirectory(src/physics) -add_subdirectory(src/particlesystem) # bullet add_subdirectory(src/bullet) # ode add_subdirectory(src/ode) +# physics +add_subdirectory(src/particlesystem) +add_subdirectory(src/physics) # Include panda metalibs add_subdirectory(metalibs/panda) +add_subdirectory(metalibs/pandaegg) add_subdirectory(metalibs/pandaexpress) add_subdirectory(metalibs/pandagl) -add_subdirectory(metalibs/pandaegg) add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 3eb7202250..4695732303 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -3,17 +3,17 @@ if(NOT BUILD_PANDA) endif() # Include pandatool source directories -add_subdirectory(src/pandatoolbase) -add_subdirectory(src/progbase) +add_subdirectory(src/bam) add_subdirectory(src/converter) add_subdirectory(src/cvscopy) -add_subdirectory(src/eggbase) -add_subdirectory(src/bam) -add_subdirectory(src/flt) -add_subdirectory(src/fltegg) -add_subdirectory(src/fltprogs) add_subdirectory(src/dxf) add_subdirectory(src/dxfegg) add_subdirectory(src/dxfprogs) -add_subdirectory(src/pstatserver) +add_subdirectory(src/eggbase) +add_subdirectory(src/flt) +add_subdirectory(src/fltegg) +add_subdirectory(src/fltprogs) add_subdirectory(src/gtk-stats) +add_subdirectory(src/pandatoolbase) +add_subdirectory(src/progbase) +add_subdirectory(src/pstatserver) From 47b5a506885d1271cdf69388369714f5313a419b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 10 Oct 2018 20:16:04 -0600 Subject: [PATCH 512/744] CMake: Don't always override target_link_libraries() Previously, we would override target_link_libraries() to support object "linking" since this wasn't supported in versions of CMake before 3.12. Now that 3.12 is released, we only do it for versions of CMake before that release. --- cmake/macros/BuildMetalib.cmake | 122 ++++++++++++++++---------------- 1 file changed, 62 insertions(+), 60 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 2b69f530f0..0fa9675825 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -10,70 +10,72 @@ # # Overrides CMake's target_link_libraries() to support "linking" object # libraries. This is a partial reimplementation of CMake commit dc38970f83, -# which as of this writing has not yet landed in any release. +# which is only available in CMake 3.12+ # -function(target_link_libraries target) - get_target_property(target_type "${target}" TYPE) - if(NOT target_type STREQUAL "OBJECT_LIBRARY") - _target_link_libraries("${target}" ${ARGN}) - return() - endif() - - foreach(library ${ARGN}) - # 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. - if(library MATCHES "^(PKG::|p3|panda)[A-Za-z0-9]*$") - # We need to add "library"'s include directories to "target" - # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further - # dependencies will work) - set(include_directories "$") - set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") - set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") - - # And for INTERFACE_COMPILE_DEFINITIONS as well - set(compile_definitions "$") - set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") - - # Build up some generator expressions for determining whether `library` - # is a component library or not. - if(library MATCHES ".*::.*") - # "::" messes up CMake's genex parser; fortunately, a library whose - # name contains that is either an interface library or alias, and - # definitely not a component - set(is_component 0) - set(name_of_component "") - set(name_of_non_component "${library}") - else() - set(is_component "$") - - # CMake complains if we lookup IS_COMPONENT on an INTERFACE library :( - set(is_object "$,OBJECT_LIBRARY>") - set(is_component "$>") - - set(name_of_component "$<${is_component}:${library}>") - set(name_of_non_component "$<$:${library}>") - endif() - - # Libraries are only linked transitively if they aren't components. - set_property(TARGET "${target}" APPEND PROPERTY - INTERFACE_LINK_LIBRARIES "${name_of_non_component}") - - # Also build with the same BUILDING_ macros, because these will all end - # up in the same library. - set(compile_definitions "$") - set_property(TARGET "${target}" APPEND PROPERTY - COMPILE_DEFINITIONS "$<${is_component}:${compile_definitions}>") - else() - # This is a file path to an out-of-tree library - this needs to be - # recorded so that the metalib can link them. (They aren't needed at - # all for the object libraries themselves, so they don't have to work - # transitively.) - set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") +if(CMAKE_VERSION VERSION_LESS "3.12") + function(target_link_libraries target) + get_target_property(target_type "${target}" TYPE) + if(NOT target_type STREQUAL "OBJECT_LIBRARY") + _target_link_libraries("${target}" ${ARGN}) + return() endif() - endforeach(library) + foreach(library ${ARGN}) + # 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. + if(library MATCHES "^(PKG::|p3|panda)[A-Za-z0-9]*$") + # We need to add "library"'s include directories to "target" + # (and transitively to INTERFACE_INCLUDE_DIRECTORIES so further + # dependencies will work) + set(include_directories "$") + set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") -endfunction(target_link_libraries) + # And for INTERFACE_COMPILE_DEFINITIONS as well + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") + + # Build up some generator expressions for determining whether `library` + # is a component library or not. + if(library MATCHES ".*::.*") + # "::" messes up CMake's genex parser; fortunately, a library whose + # name contains that is either an interface library or alias, and + # definitely not a component + set(is_component 0) + set(name_of_component "") + set(name_of_non_component "${library}") + else() + set(is_component "$") + + # CMake complains if we lookup IS_COMPONENT on an INTERFACE library :( + set(is_object "$,OBJECT_LIBRARY>") + set(is_component "$>") + + set(name_of_component "$<${is_component}:${library}>") + set(name_of_non_component "$<$:${library}>") + endif() + + # Libraries are only linked transitively if they aren't components. + set_property(TARGET "${target}" APPEND PROPERTY + INTERFACE_LINK_LIBRARIES "${name_of_non_component}") + + # Also build with the same BUILDING_ macros, because these will all end + # up in the same library. + set(compile_definitions "$") + set_property(TARGET "${target}" APPEND PROPERTY + COMPILE_DEFINITIONS "$<${is_component}:${compile_definitions}>") + else() + # This is a file path to an out-of-tree library - this needs to be + # recorded so that the metalib can link them. (They aren't needed at + # all for the object libraries themselves, so they don't have to work + # transitively.) + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") + endif() + + endforeach(library) + + endfunction(target_link_libraries) +endif() # # Function: add_component_library(target [SYMBOL building_symbol] From 32a6552af48d59240e3a7f90b689afd210734831 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 11 Oct 2018 15:51:30 -0600 Subject: [PATCH 513/744] CMake: Make BuildMetalib's link override more like CMake 3.12 --- cmake/macros/BuildMetalib.cmake | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 0fa9675825..1ba1e8efaa 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -34,6 +34,7 @@ if(CMAKE_VERSION VERSION_LESS "3.12") # And for INTERFACE_COMPILE_DEFINITIONS as well set(compile_definitions "$") set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") + set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "${compile_definitions}") # Build up some generator expressions for determining whether `library` # is a component library or not. @@ -58,12 +59,6 @@ if(CMAKE_VERSION VERSION_LESS "3.12") # Libraries are only linked transitively if they aren't components. set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${name_of_non_component}") - - # Also build with the same BUILDING_ macros, because these will all end - # up in the same library. - set(compile_definitions "$") - set_property(TARGET "${target}" APPEND PROPERTY - COMPILE_DEFINITIONS "$<${is_component}:${compile_definitions}>") else() # This is a file path to an out-of-tree library - this needs to be # recorded so that the metalib can link them. (They aren't needed at From 8610b2fcebda53817e0c2b700d21aa922e65a80c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 8 Oct 2018 14:02:46 -0600 Subject: [PATCH 514/744] CMake: Simplify Interrogate's compiler definition discovery This uses generator expressions to make sure the definitions are discovered transitively. The output _igate.cxx file also has its definitions applied to it via a source file property rather than via add_definitions(), which prevents them from leaking to other targets. --- cmake/macros/Interrogate.cmake | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 84f4f9cc7e..edb4a1eee2 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -196,15 +196,8 @@ function(interrogate_sources target output database language_flags) # Get the compiler definition flags. These must be passed to Interrogate # in the same way that they are passed to the compiler so that Interrogate # will preprocess each file in the same way. - set(define_flags) - get_target_property(target_defines "${target}" INTERFACE_COMPILE_DEFINITIONS) - if(target_defines) - foreach(target_define ${target_defines}) - list(APPEND define_flags "-D${target_define}") - # And add the same definition when we compile the _igate.cxx file: - add_definitions("-D${target_define}") - endforeach(target_define) - endif() + set(define_flags "$$,\t-D>") + # If this is a release build that has NDEBUG defined, we need that too: string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") @@ -230,6 +223,11 @@ function(interrogate_sources target output database language_flags) DEPENDS host_interrogate ${sources} ${extensions} ${nfiles} COMMENT "Interrogating ${target}" ) + + # Propagate the target's compile definitions to the output file + set_source_files_properties("${output}" PROPERTIES + COMPILE_DEFINITIONS "$") + endfunction(interrogate_sources) # @@ -296,6 +294,22 @@ function(add_python_module module) add_python_target(panda3d.${module} "${module}_module.cxx" ${sources}) target_link_libraries(panda3d.${module} ${link_targets} p3igateruntime) + if(CMAKE_VERSION VERSION_LESS "3.11") + # CMake <3.11 doesn't allow generator expressions on source files, so we + # need to copy them to our target, which does allow them. + + foreach(target ${targets}) + set(igate_file "${target}_igate.cxx") + get_source_file_property(compile_definitions "${igate_file}" COMPILE_DEFINITIONS) + if(compile_definitions) + set_property(TARGET panda3d.${module} APPEND PROPERTY + COMPILE_DEFINITIONS ${compile_definitions}) + + set_source_files_properties("${igate_file}" PROPERTIES COMPILE_DEFINITIONS "") + endif() + endforeach(target) + endif() + list(APPEND ALL_INTERROGATE_MODULES "${module}") set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endfunction(add_python_module) From da9bb2aaa295a142eb2c79bd82fac6f34e5d4dce Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 13 Oct 2018 15:03:15 -0600 Subject: [PATCH 515/744] CMake: Fix PYTHON_INCLUDE_DIRS variable when using CMake 3.12+'s FindPython --- dtool/Package.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index d76d7aa644..6159e64b6f 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -10,6 +10,7 @@ find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Developm if(Python_FOUND) set(PYTHON_FOUND ON) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) + set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS}) else() find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) From 1e38910d9d56fa60dac8a8f397a476e53cb48a7b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 11 Oct 2018 17:37:23 -0600 Subject: [PATCH 516/744] CMake: Fix BuildMetalib's BUILDING_ symbol propagation --- cmake/macros/BuildMetalib.cmake | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 1ba1e8efaa..16a64d5947 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -151,8 +151,17 @@ function(add_component_library target_name) INIT_FUNCTION "${init_func}" INIT_HEADER "${init_header}") if(symbol) - # ... DEFINE_SYMBOL is apparently not respected for object libraries? - set_property(TARGET "${target_name}" APPEND PROPERTY COMPILE_DEFINITIONS "${symbol}") + set_property(TARGET "${target_name}" PROPERTY DEFINE_SYMBOL "${symbol}") + + if(BUILD_METALIBS) + # ... DEFINE_SYMBOL is apparently not respected for object libraries? + set_property(TARGET "${target_name}" APPEND PROPERTY COMPILE_DEFINITIONS "${symbol}") + + # Make sure other component libraries relying on this one inherit the + # symbol + set_property(TARGET "${target_name}" APPEND PROPERTY + INTERFACE_COMPILE_DEFINITIONS "$<$>:${symbol}>") + endif() endif() if(BUILD_METALIBS) # Apparently neither is CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE? @@ -243,10 +252,19 @@ function(add_metalib target_name) # Private defines: Just reference using a generator expression list(APPEND private_defines "$") - # Interface defines: Copy those + # Interface defines: Copy those, but filter out generator expressions + # referencing a component library get_target_property(component_defines "${component}" INTERFACE_COMPILE_DEFINITIONS) if(component_defines) - list(APPEND interface_defines ${component_defines}) + foreach(component_define ${component_defines}) + if(component_define MATCHES "${component_genex_regex}") + # Filter, it's a genex referencing one of our components + elseif(component_define MATCHES ".*IS_COMPONENT.*") + # Filter, it's testing to see if the consumer is a component + else() + list(APPEND interface_defines ${component_define}) + endif() + endforeach(component_define) endif() # Include directories: Filter out anything that references a component From f1c5352cc1e179181ba0526243b8cf74d4a56737 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 8 Oct 2018 14:37:54 -0600 Subject: [PATCH 517/744] CMake: Remove redundant target_compile_definitions(WITHIN_PANDA) This is no longer needed since they should now propagate from dcparser automatically. --- direct/src/dcparse/CMakeLists.txt | 1 - direct/src/distributed/CMakeLists.txt | 1 - 2 files changed, 2 deletions(-) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index 18e8272596..f4853d7c42 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,4 +1,3 @@ add_executable(p3dcparse dcparse.cxx) -target_compile_definitions(p3dcparse PUBLIC WITHIN_PANDA) target_link_libraries(p3dcparse p3direct) install(TARGETS p3dcparse DESTINATION bin) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 09662ac5eb..ddf320732f 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -16,7 +16,6 @@ set(P3DISTRIBUTED_SOURCES add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) -target_compile_definitions(p3distributed PUBLIC WITHIN_PANDA) target_link_libraries(p3distributed p3directbase p3dcparser panda PKG::PYTHON) target_interrogate(p3distributed ALL) From 23a55f30eb05893767a3a73a88713e2a8c3ec4fe Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 13 Oct 2018 15:23:10 -0600 Subject: [PATCH 518/744] CMake: Make sure Python version is always correctly reported --- dtool/Package.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 6159e64b6f..f63406f60e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -11,12 +11,17 @@ if(Python_FOUND) set(PYTHON_FOUND ON) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS}) + set(PYTHON_VERSION_STRING ${Python_VERSION}) else() find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) if(PYTHONLIBS_FOUND) set(PYTHON_FOUND ON) + + if(NOT PYTHON_VERSION_STRING) + set(PYTHON_VERSION_STRING ${PYTHONLIBS_VERSION_STRING}) + endif() endif() endif() From c26109e8cc43da27d07a5c94df23ff28722de0fc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 12 Oct 2018 22:22:36 -0600 Subject: [PATCH 519/744] CMake: Add textEncoder_ext.{cxx,h} to build --- dtool/src/dtoolutil/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 9ee7961987..eab710f3fb 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -60,6 +60,8 @@ set(P3DTOOLUTIL_IGATEEXT filename_ext.h globPattern_ext.cxx globPattern_ext.h + textEncoder_ext.cxx + textEncoder_ext.h ) composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) From 629ada63db3ac830844632ebb2c12b77ac0169f8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Oct 2018 17:30:40 -0600 Subject: [PATCH 520/744] CMake: Turn OFF HAVE_CARBON by default --- .travis.yml | 2 +- dtool/Config.cmake | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 214f283d79..90f391360b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -90,7 +90,7 @@ script: export PY2_CMAKE_ARGS=-DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/2.7/bin/python fi - cmake -DHAVE_CARBON=NO -DBUILD_METALIBS=$BUILD_METALIBS \ + cmake -DBUILD_METALIBS=$BUILD_METALIBS \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $PY2_CMAKE_ARGS .. else diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 80b15fd016..803a451428 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -532,13 +532,10 @@ else() option(HAVE_WGL "Enable WGL. Requires OpenGL on Windows." OFF) endif() -if(IS_OSX) - option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." ON) - option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." ON) -else() - option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." OFF) - option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." OFF) -endif() +cmake_dependent_option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." ON + "APPLE" OFF) +cmake_dependent_option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." OFF + "APPLE" OFF) # # <<<<<< Insert the rest of the Config.pp From c6554d2c25a56a273d706ae08da7784aaa2261a5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Oct 2018 22:18:56 -0600 Subject: [PATCH 521/744] travis: Don't install FFTW3 for CI tests This is due to FFTW3 issue GH#130 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 90f391360b..1a26106481 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,7 +62,7 @@ before_install: install: - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install python@3 eigen libtar fftw libsquish zlib ffmpeg freetype \ + brew install python@3 eigen libtar libsquish zlib ffmpeg freetype \ bullet opencv assimp libvorbis openssl || true brew install ode --with-shared From c6dee72b06e9372a2659874073c729c6cc3b56c8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Oct 2018 16:18:18 -0600 Subject: [PATCH 522/744] CMake: Make sure Xkb+Xutil are available for X11 This fixes a compile error on some macOS systems. --- dtool/Config.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 803a451428..877844380e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -485,14 +485,15 @@ mark_as_advanced(SDL_LIBRARY_TEMP) # Is X11 insalled, and where? find_package(X11 QUIET) +if(NOT X11_Xkb_FOUND OR NOT X11_Xutil_FOUND) + # Panda implicitly requires these supplementary X11 libs; if we can't find + # them, we just say we didn't find X11 at all. + set(X11_FOUND OFF) +endif() + package_option(X11 "Provides X-server support on Unix platforms. X11 may need to be linked against for tinydisplay, but probably only on a Linux platform.") -if(NOT UNIX AND HAVE_X11) - message(SEND_ERROR - "X11 support is only supported on Unix platforms: -ie. Linux, BSD, OS X, Cygwin, etc...") -endif() # TODO: XF86DGA From f9eb327a113fe10436ee72ce1478d328e8e4e27a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Oct 2018 17:10:28 -0600 Subject: [PATCH 523/744] CMake: Add missing dependency from p3display on PKG::X11 --- panda/src/display/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index a8d6076f00..2061079646 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -89,7 +89,8 @@ endif() composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) -target_link_libraries(p3display p3cull p3pgraphnodes) +target_link_libraries(p3display p3cull p3pgraphnodes + PKG::X11) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) if(NOT BUILD_METALIBS) From 226c9002dd099917e1d0565e2177636096870831 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Oct 2018 18:45:22 -0600 Subject: [PATCH 524/744] travis: Don't use --no-as-needed on osx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1a26106481..c809dd2ee1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ before_script: script: # This is kind of a hack, but needed to test non-metalib builds (until # interrogate has a way of explicitly calling init_libpanda) -- '[ "x$BUILD_METALIBS" == "xON" ] || export LDFLAGS=-Wl,--no-as-needed' +- '[ "x$BUILD_METALIBS" == "xON" || "x$TRAVIS_OS_NAME" == "xosx" ] || export LDFLAGS=-Wl,--no-as-needed' - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then From 983d7fa6b96af48b2b59de1307d4c9e30e49206c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Oct 2018 19:31:40 -0600 Subject: [PATCH 525/744] travis: Small syntax fix --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c809dd2ee1..a3d56045a5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -82,7 +82,7 @@ before_script: script: # This is kind of a hack, but needed to test non-metalib builds (until # interrogate has a way of explicitly calling init_libpanda) -- '[ "x$BUILD_METALIBS" == "xON" || "x$TRAVIS_OS_NAME" == "xosx" ] || export LDFLAGS=-Wl,--no-as-needed' +- '[ "x$BUILD_METALIBS" == "xON" -o "x$TRAVIS_OS_NAME" == "xosx" ] || export LDFLAGS=-Wl,--no-as-needed' - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then From 2c0b079dc94e48100826bc4c366dd3c2cd6cd6fe Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Oct 2018 23:49:05 -0600 Subject: [PATCH 526/744] CMake: Disable C++ exceptions everywhere that doesn't request them --- CMakeLists.txt | 14 ++++++++++++++ panda/src/pnmimagetypes/CMakeLists.txt | 1 + 2 files changed, 15 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2d5d3b6d2..a2116607a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,20 @@ if(WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() +# As long as we're figuring out compiler flags, figure out the flags for +# turning C++ exception support on and off +if(MSVC) + set(cxx_exceptions_on "/EHsc") + set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0") +else() + set(cxx_exceptions_on "-fexceptions") + set(cxx_exceptions_off "-fno-exceptions") +endif() +set(cxx_exceptions_property "$>") +add_compile_options( + "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" + "$<$:${cxx_exceptions_off}>") + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 688caba7c5..8fcac02573 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -34,6 +34,7 @@ composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) target_link_libraries(p3pnmimagetypes p3pnmimage PKG::JPEG PKG::TIFF PKG::PNG) +set_target_properties(p3pnmimagetypes PROPERTIES CXX_EXCEPTIONS ON) if(NOT BUILD_METALIBS) install(TARGETS p3pnmimagetypes DESTINATION lib RUNTIME DESTINATION bin) From 5c166e6cdcde46b5a417ed7f4838851784545a0e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 17 Oct 2018 17:44:31 -0600 Subject: [PATCH 527/744] travis: Fix `COMPOSITE_SOURCE_EXCLUSIONS` being passed to CMake --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a3d56045a5..48014b4e01 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ matrix: env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 include: - os: osx - env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 COMPOSITE_SOURCE_EXCLUSIONS=p3showbase;p3dtoolutil;p3cocoadisplay;p3osxdisplay;p3tinydisplay;p3display + env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 COMPOSITE_SOURCE_EXCLUSIONS='p3showbase;p3dtoolutil;p3cocoadisplay;p3osxdisplay;p3tinydisplay;p3display' - compiler: gcc addons: @@ -91,10 +91,12 @@ script: fi cmake -DBUILD_METALIBS=$BUILD_METALIBS \ + -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $PY2_CMAKE_ARGS .. else cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ + -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. fi - make -j4 From dd5c411e88ed9097f686ece676c73a883d786269 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 18 Oct 2018 02:26:38 -0600 Subject: [PATCH 528/744] CMake: When building metalib components, properly flag SYSTEM include dirs --- cmake/macros/BuildMetalib.cmake | 6 ++++++ cmake/macros/PackageConfig.cmake | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 16a64d5947..1277ec0820 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -31,6 +31,12 @@ if(CMAKE_VERSION VERSION_LESS "3.12") set_property(TARGET "${target}" APPEND PROPERTY INCLUDE_DIRECTORIES "${include_directories}") set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${include_directories}") + # SYSTEM include directories should still be reported as SYSTEM, so + # that warnings from those includes are suppressed + set(sys_include_directories + "$") + target_include_directories("${target}" SYSTEM PUBLIC "${sys_include_directories}") + # And for INTERFACE_COMPILE_DEFINITIONS as well set(compile_definitions "$") set_property(TARGET "${target}" APPEND PROPERTY COMPILE_DEFINITIONS "${compile_definitions}") diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index b35b5e5bb9..df81deb621 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -158,6 +158,18 @@ function(package_option name) # Create the INTERFACE library used to depend on this package. add_library(PKG::${name} INTERFACE IMPORTED GLOBAL) + # Explicitly record the package's include directories as system include + # directories. CMake does do this automatically for INTERFACE libraries, but + # it does it by discovering all transitive links first, then reading + # INTERFACE_INCLUDE_DIRECTORIES for those which are INTERFACE libraries. So, + # this would be broken for the metalib system (pre CMake 3.12) which doesn't + # "link" the object libraries. + if(CMAKE_VERSION VERSION_LESS "3.12") + set_target_properties(PKG::${name} PROPERTIES + INTERFACE_SYSTEM_INCLUDE_DIRECTORIES + "$") + endif() + # Create the option, and if it actually is enabled, populate the INTERFACE # library created above option("HAVE_${name}" "${cache_string}" "${default}") From 8dd46eb736060887bc24a93df6b15a7217d92698 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 18 Oct 2018 15:28:40 -0600 Subject: [PATCH 529/744] CMake: Redo ODE find module This defines an ODE::ODE target; it also automatically selects the correct `dIDESINGLE`/`dIDEDOUBLE` compile-time definition. --- cmake/modules/FindODE.cmake | 158 +++++++++++++++++++++++++---------- dtool/Package.cmake | 3 +- panda/src/ode/CMakeLists.txt | 141 ++++++++++++++++--------------- 3 files changed, 186 insertions(+), 116 deletions(-) diff --git a/cmake/modules/FindODE.cmake b/cmake/modules/FindODE.cmake index 6c70f69de7..363b87db8f 100644 --- a/cmake/modules/FindODE.cmake +++ b/cmake/modules/FindODE.cmake @@ -7,74 +7,144 @@ # Once done this will define: # ODE_FOUND - system has ode # ODE_INCLUDE_DIR - the ode include directory -# ODE_LIBRARY_DIR - the ode library directory -# ODE_LIBRARY - the path to the library binary # # ODE_RELEASE_LIBRARY - the filepath of the ode release library # ODE_DEBUG_LIBRARY - the filepath of the ode debug library # +# ODE_SINGLE_DEBUG_LIBRARY - the filepath of the single-precision ode debug library +# ODE_SINGLE_RELEASE_LIBRARY - the filepath of the single-precision ode release library +# ODE_DOUBLE_DEBUG_LIBRARY - the filepath of the double-precision ode debug library +# ODE_DOUBLE_RELEASE_LIBRARY - the filepath of the double-precision ode release library +# +# ODE::ODE - The recommended ODE library to link against +# ODE::ODE_single - If available, this links against single-precision ODE +# ODE::ODE_double - If available, this links against double-precision ODE +# if(NOT ODE_INCLUDE_DIR OR NOT ODE_LIBRARY_DIR) # Find the libode include files find_path(ODE_INCLUDE_DIR NAMES "ode.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - PATH_SUFFIXES "" "ode" - ) + PATH_SUFFIXES "ode") # Find the libode library built for release find_library(ODE_RELEASE_LIBRARY - NAMES "ode" "libode" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) + NAMES "ode" "libode") # Find the libode library built for debug find_library(ODE_DEBUG_LIBRARY - NAMES "oded" "liboded" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) + NAMES "oded" "liboded") + # Find the single-precision library built for release + find_library(ODE_SINGLE_RELEASE_LIBRARY + NAMES "ode_single" "libode_single") + + # Find the single-precision library built for debug + find_library(ODE_SINGLE_DEBUG_LIBRARY + NAMES "ode_singled" "libode_singled") + + # Find the double-precision library built for release + find_library(ODE_DOUBLE_RELEASE_LIBRARY + NAMES "ode_double" "libode_double" ) + + # Find the double-precision library built for debug + find_library(ODE_DOUBLE_DEBUG_LIBRARY + NAMES "ode_doubled" "libode_doubled") + + unset(_ODE_LIB_PATHS) mark_as_advanced(ODE_INCLUDE_DIR) mark_as_advanced(ODE_RELEASE_LIBRARY) mark_as_advanced(ODE_DEBUG_LIBRARY) + mark_as_advanced(ODE_SINGLE_RELEASE_LIBRARY) + mark_as_advanced(ODE_SINGLE_DEBUG_LIBRARY) + mark_as_advanced(ODE_DOUBLE_RELEASE_LIBRARY) + mark_as_advanced(ODE_DOUBLE_DEBUG_LIBRARY) endif() -# Choose library -if(CMAKE_BUILD_TYPE MATCHES "Debug" AND ODE_DEBUG_LIBRARY) - set(ODE_LIBRARY ${ODE_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libode's library binary.") -elseif(ODE_RELEASE_LIBRARY) - set(ODE_LIBRARY ${ODE_RELEASE_LIBRARY} CACHE FILEPATH "The filepath to libode's library binary.") -elseif(ODE_DEBUG_LIBRARY) - set(ODE_LIBRARY ${ODE_DEBUG_LIBRARY} CACHE FILEPATH "The filepath to libode's library binary.") +# Define targets for both precisions (and unspecified) +foreach(_precision _single _double "") + string(TOUPPER "${_precision}" _PRECISION) + + if(EXISTS "${ODE${_PRECISION}_RELEASE_LIBRARY}" OR + EXISTS "${ODE${_PRECISION}_DEBUG_LIBRARY}") + if(NOT TARGET ODE::ODE${_precision}) + add_library(ODE::ODE${_precision} UNKNOWN IMPORTED GLOBAL) + + set_target_properties(ODE::ODE${_precision} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIR}") + + if(EXISTS "${ODE${_PRECISION}_RELEASE_LIBRARY}") + set_property(TARGET ODE::ODE${_precision} APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(ODE::ODE${_precision} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "C" + IMPORTED_LOCATION_RELEASE "${ODE${_PRECISION}_RELEASE_LIBRARY}") + endif() + + if(EXISTS "${ODE${_PRECISION}_DEBUG_LIBRARY}") + set_property(TARGET ODE::ODE${_precision} APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(ODE::ODE${_precision} PROPERTIES + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG "C" + IMPORTED_LOCATION_DEBUG "${ODE${_PRECISION}_DEBUG_LIBRARY}") + endif() + + # If this has a precision, we should be sure to define + # dIDESINGLE/dIDEDOUBLE to keep it consistent + if(_precision) + string(REPLACE "_" "dIDE" _precision_symbol "${_PRECISION}") + + set_target_properties(ODE::ODE${_precision} PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${_precision_symbol}") + + unset(_precision_symbol) + endif() + + endif() + endif() +endforeach(_precision) +unset(_precision) +unset(_PRECISION) + +# OKAY. If everything went well, we have ODE::ODE_single and/or +# ODE::ODE_double. We might even have an ODE::ODE, but if not, we need to +# alias one of the other two to it. +if(NOT TARGET ODE::ODE) + if(TARGET ODE::ODE_single) + set(_copy_from "ODE::ODE_single") + elseif(TARGET ODE::ODE_double) + set(_copy_from "ODE::ODE_double") + endif() + + if(DEFINED _copy_from) + add_library(ODE::ODE UNKNOWN IMPORTED GLOBAL) + + foreach(_prop + INTERFACE_INCLUDE_DIRECTORIES + INTERFACE_COMPILE_DEFINITIONS + IMPORTED_CONFIGURATIONS + IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE + IMPORTED_LOCATION_RELEASE + IMPORTED_LINK_INTERFACE_LANGUAGES_DEBUG + IMPORTED_LOCATION_DEBUG) + + get_target_property(_value "${_copy_from}" "${_prop}") + if(DEFINED _value) + set_target_properties(ODE::ODE PROPERTIES "${_prop}" "${_value}") + endif() + unset(_value) + endforeach(_prop) + endif() + + unset(_copy_from) endif() -# Translate library into library directory -if(ODE_LIBRARY) - unset(ODE_LIBRARY_DIR CACHE) - get_filename_component(ODE_LIBRARY_DIR "${ODE_LIBRARY}" PATH) - set(ODE_LIBRARY_DIR "${ODE_LIBRARY_DIR}" CACHE PATH "The path to libode's library directory.") # Library path +if(TARGET ODE::ODE) + set(_HAS_ODE_LIBRARY ON) endif() -mark_as_advanced(ODE_LIBRARY) -mark_as_advanced(ODE_LIBRARY_DIR) - include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ODE DEFAULT_MSG ODE_LIBRARY ODE_INCLUDE_DIR ODE_LIBRARY_DIR) +find_package_handle_standard_args(ODE DEFAULT_MSG ODE_INCLUDE_DIR _HAS_ODE_LIBRARY) + +unset(_HAS_ODE_LIBRARY) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 7b2e4c4dc7..79dbeae29f 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -336,7 +336,8 @@ find_package(ODE QUIET) package_option(ODE "Enable this option to support game dynamics with the Open Dynamics Engine (ODE)." - LICENSE "BSD-3") + LICENSE "BSD-3" + IMPORTED_AS ODE::ODE) config_package(ODE "Open Dynamics Engine") diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 934fdbc04f..b80183aa7c 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -3,80 +3,80 @@ if(NOT HAVE_ODE) endif() set(P3ODE_HEADERS - ode_includes.h config_ode.h - odeWorld.I odeWorld.h - odeMass.I odeMass.h - odeBody.I odeBody.h - odeJointGroup.I odeJointGroup.h - odeJoint.I odeJoint.h - odeUtil.h - odeSpace.I odeSpace.h - odeGeom.I odeGeom.h - odeSurfaceParameters.I odeSurfaceParameters.h - odeContactGeom.I odeContactGeom.h - odeContact.I odeContact.h - odeAMotorJoint.I odeAMotorJoint.h - odeBallJoint.I odeBallJoint.h - odeContactJoint.I odeContactJoint.h - odeFixedJoint.I odeFixedJoint.h - odeHingeJoint.I odeHingeJoint.h - odeHinge2Joint.I odeHinge2Joint.h - odeLMotorJoint.I odeLMotorJoint.h - odeNullJoint.I odeNullJoint.h - odePlane2dJoint.I odePlane2dJoint.h - odeSliderJoint.I odeSliderJoint.h - odeUniversalJoint.I odeUniversalJoint.h - odeJointCollection.I odeJointCollection.h - odeSimpleSpace.I odeSimpleSpace.h - odeHashSpace.I odeHashSpace.h - odeQuadTreeSpace.I odeQuadTreeSpace.h - odeSphereGeom.I odeSphereGeom.h - odeBoxGeom.I odeBoxGeom.h - odePlaneGeom.I odePlaneGeom.h - odeCappedCylinderGeom.I odeCappedCylinderGeom.h - odeCylinderGeom.I odeCylinderGeom.h - odeRayGeom.I odeRayGeom.h - odeTriMeshData.I odeTriMeshData.h - odeTriMeshGeom.I odeTriMeshGeom.h - odeCollisionEntry.I odeCollisionEntry.h - odeHelperStructs.h) + ode_includes.h config_ode.h + odeWorld.I odeWorld.h + odeMass.I odeMass.h + odeBody.I odeBody.h + odeJointGroup.I odeJointGroup.h + odeJoint.I odeJoint.h + odeUtil.h + odeSpace.I odeSpace.h + odeGeom.I odeGeom.h + odeSurfaceParameters.I odeSurfaceParameters.h + odeContactGeom.I odeContactGeom.h + odeContact.I odeContact.h + odeAMotorJoint.I odeAMotorJoint.h + odeBallJoint.I odeBallJoint.h + odeContactJoint.I odeContactJoint.h + odeFixedJoint.I odeFixedJoint.h + odeHingeJoint.I odeHingeJoint.h + odeHinge2Joint.I odeHinge2Joint.h + odeLMotorJoint.I odeLMotorJoint.h + odeNullJoint.I odeNullJoint.h + odePlane2dJoint.I odePlane2dJoint.h + odeSliderJoint.I odeSliderJoint.h + odeUniversalJoint.I odeUniversalJoint.h + odeJointCollection.I odeJointCollection.h + odeSimpleSpace.I odeSimpleSpace.h + odeHashSpace.I odeHashSpace.h + odeQuadTreeSpace.I odeQuadTreeSpace.h + odeSphereGeom.I odeSphereGeom.h + odeBoxGeom.I odeBoxGeom.h + odePlaneGeom.I odePlaneGeom.h + odeCappedCylinderGeom.I odeCappedCylinderGeom.h + odeCylinderGeom.I odeCylinderGeom.h + odeRayGeom.I odeRayGeom.h + odeTriMeshData.I odeTriMeshData.h + odeTriMeshGeom.I odeTriMeshGeom.h + odeCollisionEntry.I odeCollisionEntry.h + odeHelperStructs.h) set(P3ODE_SOURCES - config_ode.cxx - odeWorld.cxx odeMass.cxx odeBody.cxx - odeJointGroup.cxx odeJoint.cxx - odeUtil.cxx - odeSpace.cxx - odeGeom.cxx - odeSurfaceParameters.cxx - odeContactGeom.cxx odeContact.cxx - odeAMotorJoint.cxx odeBallJoint.cxx - odeContactJoint.cxx odeFixedJoint.cxx - odeHingeJoint.cxx odeHinge2Joint.cxx - odeLMotorJoint.cxx odeNullJoint.cxx - odePlane2dJoint.cxx odeSliderJoint.cxx - odeUniversalJoint.cxx odeJointCollection.cxx - odeSimpleSpace.cxx - odeHashSpace.cxx odeQuadTreeSpace.cxx - odeSphereGeom.cxx odeBoxGeom.cxx - odePlaneGeom.cxx odeCappedCylinderGeom.cxx - odeCylinderGeom.cxx odeRayGeom.cxx - odeTriMeshData.cxx odeTriMeshGeom.cxx - odeCollisionEntry.cxx) + config_ode.cxx + odeWorld.cxx odeMass.cxx odeBody.cxx + odeJointGroup.cxx odeJoint.cxx + odeUtil.cxx + odeSpace.cxx + odeGeom.cxx + odeSurfaceParameters.cxx + odeContactGeom.cxx odeContact.cxx + odeAMotorJoint.cxx odeBallJoint.cxx + odeContactJoint.cxx odeFixedJoint.cxx + odeHingeJoint.cxx odeHinge2Joint.cxx + odeLMotorJoint.cxx odeNullJoint.cxx + odePlane2dJoint.cxx odeSliderJoint.cxx + odeUniversalJoint.cxx odeJointCollection.cxx + odeSimpleSpace.cxx + odeHashSpace.cxx odeQuadTreeSpace.cxx + odeSphereGeom.cxx odeBoxGeom.cxx + odePlaneGeom.cxx odeCappedCylinderGeom.cxx + odeCylinderGeom.cxx odeRayGeom.cxx + odeTriMeshData.cxx odeTriMeshGeom.cxx + odeCollisionEntry.cxx) set(P3ODE_IGATEEXT - odeBody_ext.h - odeBody_ext.I - odeGeom_ext.cxx - odeGeom_ext.h - odeGeom_ext.I - odeJoint_ext.cxx - odeJoint_ext.h - odeSpace_ext.cxx - odeSpace_ext.h - odeSpace_ext.I - odeUtil_ext.cxx - odeUtil_ext.h) + odeBody_ext.h + odeBody_ext.I + odeGeom_ext.cxx + odeGeom_ext.h + odeGeom_ext.I + odeJoint_ext.cxx + odeJoint_ext.h + odeSpace_ext.cxx + odeSpace_ext.h + odeSpace_ext.I + odeUtil_ext.cxx + odeUtil_ext.h) set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h") @@ -86,7 +86,6 @@ list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) -target_compile_definitions(p3ode PUBLIC dSINGLE) target_link_libraries(p3ode p3igateruntime panda PKG::ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) From cefc000235455c5daca72d74b3c3db6445312d32 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 18 Oct 2018 15:56:25 -0600 Subject: [PATCH 530/744] CMake: Remove PATHS from FindEigen3 Why do we need these? CMake checks the "obvious" paths for us. --- cmake/modules/FindEigen3.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index a03f5ddf3f..7b18a8172d 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -13,10 +13,7 @@ if(NOT EIGEN3_INCLUDE_DIR) find_path(EIGEN3_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library - PATHS ${CMAKE_INSTALL_PREFIX}/include - ${KDE4_INCLUDE_DIR} - PATH_SUFFIXES eigen3 eigen - ) + PATH_SUFFIXES eigen3 eigen) mark_as_advanced(EIGEN3_INCLUDE_DIR) endif() From 56b211f902a8411af22a5f60c32f668894d93ba1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 19 Oct 2018 12:18:54 -0600 Subject: [PATCH 531/744] CMake: Fix FindODE's include path finding It needs to look for the path containing the "ode" directory, not the "ode" directory itself. --- cmake/modules/FindODE.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/modules/FindODE.cmake b/cmake/modules/FindODE.cmake index 363b87db8f..643d233ac6 100644 --- a/cmake/modules/FindODE.cmake +++ b/cmake/modules/FindODE.cmake @@ -23,9 +23,7 @@ if(NOT ODE_INCLUDE_DIR OR NOT ODE_LIBRARY_DIR) # Find the libode include files - find_path(ODE_INCLUDE_DIR - NAMES "ode.h" - PATH_SUFFIXES "ode") + find_path(ODE_INCLUDE_DIR "ode/ode.h") # Find the libode library built for release find_library(ODE_RELEASE_LIBRARY From a585dcf9ad46cc1442d713c87e4bc7d2f1d8d1f4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 19 Oct 2018 17:39:36 -0600 Subject: [PATCH 532/744] CMake: Streamline THREADS configuration In particular this uses Threads::Threads (when available) to let CMake figure out how to link against pthread/etc. --- dtool/Config.cmake | 39 ++-- dtool/src/dtoolbase/CMakeLists.txt | 2 +- panda/src/pipeline/CMakeLists.txt | 313 ++++++++++------------------- 3 files changed, 122 insertions(+), 232 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 877844380e..3bcf8ace8e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -631,25 +631,21 @@ set(HAVE_FLEX ${FLEX_FOUND}) # ### Configure threading support ### +set(CMAKE_THREAD_PREFER_PTHREAD ON) +set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads QUIET) -# Add basic use flag for threading -if(THREADS_FOUND) - option(HAVE_THREADS - "If on, compile Panda3D with threading support. -Building in support for threading will enable Panda to take -advantage of multiple CPU's if you have them (and if the OS -supports kernel threads running on different CPU's), but it will -slightly slow down Panda for the single CPU case." ON) -else() - option(HAVE_THREADS - "If on, compile Panda3D with threading support. -Building in support for threading will enable Panda to take -advantage of multiple CPU's if you have them (and if the OS -supports kernel threads running on different CPU's), but it will -slightly slow down Panda for the single CPU case." OFF) -endif() +set(THREADS_LIBRARIES "${CMAKE_THREAD_LIBS_INIT}") +set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) +# Add basic use flag for threading +package_option(THREADS + "If on, compile Panda3D with threading support. +Building in support for threading will enable Panda to take +advantage of multiple CPU's if you have them (and if the OS +supports kernel threads running on different CPU's), but it will +slightly slow down Panda for the single CPU case." + IMPORTED_AS Threads::Threads) # Configure debug threads if(CMAKE_BUILD_TYPE MATCHES "Debug") @@ -658,17 +654,6 @@ else() option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) endif() -if(HAVE_THREADS) - set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) - if(HAVE_POSIX_THREADS) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -pthread") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -pthread") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -pthread") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -pthread") - endif() -endif() - option(SIMPLE_THREADS "If on, compile with simulated threads. Threads, by default, use OS-provided threading constructs, which usually allows for full diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 43a4013e5e..20557d0c7d 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -89,7 +89,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE target_include_directories(p3dtoolbase PUBLIC $ $) -target_link_libraries(p3dtoolbase PKG::EIGEN) +target_link_libraries(p3dtoolbase PKG::EIGEN PKG::THREADS) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) if(NOT BUILD_METALIBS) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 2d1a2be3d4..8af739fcfb 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -1,230 +1,135 @@ set(P3PIPELINE_HEADERS - contextSwitch.h - blockerSimple.h blockerSimple.I - conditionVar.h conditionVar.I - conditionVarDebug.h conditionVarDebug.I - conditionVarDirect.h conditionVarDirect.I - conditionVarDummyImpl.h conditionVarDummyImpl.I - conditionVarFull.h conditionVarFull.I - conditionVarFullDebug.h conditionVarFullDebug.I - conditionVarFullDirect.h conditionVarFullDirect.I - conditionVarImpl.h - conditionVarSimpleImpl.h conditionVarSimpleImpl.I - conditionVarSpinlockImpl.h conditionVarSpinlockImpl.I - conditionVarPosixImpl.h conditionVarPosixImpl.I - config_pipeline.h - cycleData.h cycleData.I - cycleDataLockedReader.h cycleDataLockedReader.I - cycleDataLockedStageReader.h cycleDataLockedStageReader.I - cycleDataReader.h cycleDataReader.I - cycleDataStageReader.h cycleDataStageReader.I - cycleDataStageWriter.h cycleDataStageWriter.I - cycleDataWriter.h cycleDataWriter.I - cyclerHolder.h cyclerHolder.I - externalThread.h - genericThread.h genericThread.I - lightMutex.I lightMutex.h - lightMutexDirect.h lightMutexDirect.I - lightMutexHolder.I lightMutexHolder.h - lightReMutex.I lightReMutex.h - lightReMutexDirect.h lightReMutexDirect.I - lightReMutexHolder.I lightReMutexHolder.h - mainThread.h - mutexDebug.h mutexDebug.I - mutexDirect.h mutexDirect.I - mutexHolder.h mutexHolder.I - mutexSimpleImpl.h mutexSimpleImpl.I - mutexTrueImpl.h - pipeline.h pipeline.I - pipelineCycler.h pipelineCycler.I - pipelineCyclerLinks.h pipelineCyclerLinks.I - pipelineCyclerBase.h - pipelineCyclerDummyImpl.h pipelineCyclerDummyImpl.I - pipelineCyclerTrivialImpl.h pipelineCyclerTrivialImpl.I - pipelineCyclerTrueImpl.h pipelineCyclerTrueImpl.I - pmutex.h pmutex.I - reMutex.I reMutex.h - reMutexDirect.h reMutexDirect.I - reMutexHolder.I reMutexHolder.h - psemaphore.h psemaphore.I - thread.h thread.I threadImpl.h - threadDummyImpl.h threadDummyImpl.I - threadSimpleImpl.h threadSimpleImpl.I - threadPosixImpl.h threadPosixImpl.I - threadSimpleManager.h threadSimpleManager.I - threadPriority.h -) + contextSwitch.h + blockerSimple.h blockerSimple.I + conditionVar.h conditionVar.I + conditionVarDebug.h conditionVarDebug.I + conditionVarDirect.h conditionVarDirect.I + conditionVarDummyImpl.h conditionVarDummyImpl.I + conditionVarFull.h conditionVarFull.I + conditionVarFullDebug.h conditionVarFullDebug.I + conditionVarFullDirect.h conditionVarFullDirect.I + conditionVarImpl.h + conditionVarSimpleImpl.h conditionVarSimpleImpl.I + conditionVarSpinlockImpl.h conditionVarSpinlockImpl.I + conditionVarPosixImpl.h conditionVarPosixImpl.I + config_pipeline.h + cycleData.h cycleData.I + cycleDataLockedReader.h cycleDataLockedReader.I + cycleDataLockedStageReader.h cycleDataLockedStageReader.I + cycleDataReader.h cycleDataReader.I + cycleDataStageReader.h cycleDataStageReader.I + cycleDataStageWriter.h cycleDataStageWriter.I + cycleDataWriter.h cycleDataWriter.I + cyclerHolder.h cyclerHolder.I + externalThread.h + genericThread.h genericThread.I + lightMutex.I lightMutex.h + lightMutexDirect.h lightMutexDirect.I + lightMutexHolder.I lightMutexHolder.h + lightReMutex.I lightReMutex.h + lightReMutexDirect.h lightReMutexDirect.I + lightReMutexHolder.I lightReMutexHolder.h + mainThread.h + mutexDebug.h mutexDebug.I + mutexDirect.h mutexDirect.I + mutexHolder.h mutexHolder.I + mutexSimpleImpl.h mutexSimpleImpl.I + mutexTrueImpl.h + pipeline.h pipeline.I + pipelineCycler.h pipelineCycler.I + pipelineCyclerLinks.h pipelineCyclerLinks.I + pipelineCyclerBase.h + pipelineCyclerDummyImpl.h pipelineCyclerDummyImpl.I + pipelineCyclerTrivialImpl.h pipelineCyclerTrivialImpl.I + pipelineCyclerTrueImpl.h pipelineCyclerTrueImpl.I + pmutex.h pmutex.I + reMutex.I reMutex.h + reMutexDirect.h reMutexDirect.I + reMutexHolder.I reMutexHolder.h + psemaphore.h psemaphore.I + thread.h thread.I threadImpl.h + threadDummyImpl.h threadDummyImpl.I + threadSimpleImpl.h threadSimpleImpl.I + threadPosixImpl.h threadPosixImpl.I + threadSimpleManager.h threadSimpleManager.I + threadPriority.h) set(P3PIPELINE_SOURCES - contextSwitch.c - conditionVar.cxx - conditionVarDebug.cxx - conditionVarDirect.cxx - conditionVarDummyImpl.cxx - conditionVarFull.cxx - conditionVarFullDebug.cxx - conditionVarFullDirect.cxx - conditionVarSimpleImpl.cxx - conditionVarSpinlockImpl.cxx - conditionVarPosixImpl.cxx - config_pipeline.cxx - cycleData.cxx - cycleDataLockedReader.cxx - cycleDataLockedStageReader.cxx - cycleDataReader.cxx - cycleDataStageReader.cxx - cycleDataStageWriter.cxx - cycleDataWriter.cxx - cyclerHolder.cxx - externalThread.cxx - genericThread.cxx - lightMutex.cxx - lightMutexDirect.cxx - lightMutexHolder.cxx - lightReMutex.cxx - lightReMutexDirect.cxx - lightReMutexHolder.cxx - mainThread.cxx - mutexDebug.cxx - mutexDirect.cxx - mutexHolder.cxx - mutexSimpleImpl.cxx - pipeline.cxx - pipelineCycler.cxx - pipelineCyclerDummyImpl.cxx - pipelineCyclerTrivialImpl.cxx - pipelineCyclerTrueImpl.cxx - pmutex.cxx - reMutex.cxx - reMutexDirect.cxx - reMutexHolder.cxx - psemaphore.cxx - thread.cxx - threadDummyImpl.cxx - threadPosixImpl.cxx - threadSimpleImpl.cxx - threadSimpleManager.cxx - threadPriority.cxx -) + contextSwitch.c + conditionVar.cxx + conditionVarDebug.cxx + conditionVarDirect.cxx + conditionVarDummyImpl.cxx + conditionVarFull.cxx + conditionVarFullDebug.cxx + conditionVarFullDirect.cxx + conditionVarSimpleImpl.cxx + conditionVarSpinlockImpl.cxx + conditionVarPosixImpl.cxx + config_pipeline.cxx + cycleData.cxx + cycleDataLockedReader.cxx + cycleDataLockedStageReader.cxx + cycleDataReader.cxx + cycleDataStageReader.cxx + cycleDataStageWriter.cxx + cycleDataWriter.cxx + cyclerHolder.cxx + externalThread.cxx + genericThread.cxx + lightMutex.cxx + lightMutexDirect.cxx + lightMutexHolder.cxx + lightReMutex.cxx + lightReMutexDirect.cxx + lightReMutexHolder.cxx + mainThread.cxx + mutexDebug.cxx + mutexDirect.cxx + mutexHolder.cxx + mutexSimpleImpl.cxx + pipeline.cxx + pipelineCycler.cxx + pipelineCyclerDummyImpl.cxx + pipelineCyclerTrivialImpl.cxx + pipelineCyclerTrueImpl.cxx + pmutex.cxx + reMutex.cxx + reMutexDirect.cxx + reMutexHolder.cxx + psemaphore.cxx + thread.cxx + threadDummyImpl.cxx + threadPosixImpl.cxx + threadSimpleImpl.cxx + threadSimpleManager.cxx + threadPriority.cxx) if(WIN32) set(P3PIPELINE_HEADERS ${P3PIPELINE_HEADERS} conditionVarFullWin32Impl.h conditionVarFullWin32Impl.I conditionVarWin32Impl.h conditionVarWin32Impl.I - threadWin32Impl.h threadWin32Impl.I - ) + threadWin32Impl.h threadWin32Impl.I) set(P3PIPELINE_SOURCES ${P3PIPELINE_SOURCES} conditionVarFullWin32Impl.cxx conditionVarWin32Impl.cxx - threadWin32Impl.cxx - ) + threadWin32Impl.cxx) endif() set(P3PIPELINE_IGATEEXT - pythonThread.cxx - pythonThread.h -) + pythonThread.cxx + pythonThread.h) composite_sources(p3pipeline P3PIPELINE_SOURCES) add_component_library(p3pipeline SYMBOL BUILDING_PANDA_PIPELINE ${P3PIPELINE_HEADERS} ${P3PIPELINE_SOURCES}) -target_link_libraries(p3pipeline pandaexpress) +target_link_libraries(p3pipeline pandaexpress + PKG::THREADS) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3pipeline DESTINATION lib RUNTIME DESTINATION bin) endif() install(FILES ${P3PIPELINE_HEADERS} DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_threaddata - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ - # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ - # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - # test_threaddata.cxx - -#end test_bin_target - - -#begin test_bin_target - #define TARGET test_diners - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ - # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ - # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - # test_diners.cxx - -#end test_bin_target - - -#begin test_bin_target - #define TARGET test_mutex - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ - # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ - # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - # test_mutex.cxx - -#end test_bin_target - - -#begin test_bin_target - #define TARGET test_concurrency - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ -# p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ -# p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - # test_concurrency.cxx - -#end test_bin_target - - -#begin test_bin_target - #define TARGET test_delete - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ - # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ - # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - # test_delete.cxx - -#end test_bin_target - - -#begin test_bin_target - #define TARGET test_atomic - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ - # p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ - # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - # test_atomic.cxx - -#end test_bin_target - - - -#begin test_bin_target - #define TARGET test_setjmp - #define LOCAL_LIBS $[LOCAL_LIBS] p3pipeline - #define OTHER_LIBS \ - #p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ - # p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ - #test_setjmp.cxx - -#end test_bin_target From 11a75eab998013563bfeae7a2373d89c4fe5e8b0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 22 Oct 2018 01:58:24 -0600 Subject: [PATCH 533/744] CMake: Build OpenGL ES (1&2) display modules Also reorganizes Package.cmake a little, getting more of the package discovery logic under the PackageConfig.cmake system. --- cmake/modules/FindEGL.cmake | 27 +++++++++ cmake/modules/FindOpenGLES1.cmake | 27 +++++++++ cmake/modules/FindOpenGLES2.cmake | 27 +++++++++ dtool/Config.cmake | 14 ----- dtool/LocalSetup.cmake | 24 -------- dtool/Package.cmake | 76 ++++++++++++++++++++---- panda/CMakeLists.txt | 5 ++ panda/metalibs/pandagles/CMakeLists.txt | 9 +++ panda/metalibs/pandagles2/CMakeLists.txt | 9 +++ panda/src/egldisplay/CMakeLists.txt | 54 +++++++++++++++++ panda/src/gles2gsg/CMakeLists.txt | 22 +++++++ panda/src/glesgsg/CMakeLists.txt | 22 +++++++ 12 files changed, 268 insertions(+), 48 deletions(-) create mode 100644 cmake/modules/FindEGL.cmake create mode 100644 cmake/modules/FindOpenGLES1.cmake create mode 100644 cmake/modules/FindOpenGLES2.cmake create mode 100644 panda/metalibs/pandagles/CMakeLists.txt create mode 100644 panda/metalibs/pandagles2/CMakeLists.txt create mode 100644 panda/src/egldisplay/CMakeLists.txt create mode 100644 panda/src/gles2gsg/CMakeLists.txt create mode 100644 panda/src/glesgsg/CMakeLists.txt diff --git a/cmake/modules/FindEGL.cmake b/cmake/modules/FindEGL.cmake new file mode 100644 index 0000000000..eced64105b --- /dev/null +++ b/cmake/modules/FindEGL.cmake @@ -0,0 +1,27 @@ +# Filename: FindEGL.cmake +# Authors: CFSworks (21 Oct, 2018) +# +# Usage: +# find_package(EGL [REQUIRED] [QUIET]) +# +# Once done this will define: +# EGL_FOUND - system has EGL +# EGL_INCLUDE_DIR - the include directory containing EGL/egl.h +# EGL_LIBRARY - the library to link against for EGL +# + +if(NOT EGL_INCLUDE_DIR) + find_path(EGL_INCLUDE_DIR "EGL/egl.h") + + mark_as_advanced(EGL_INCLUDE_DIR) +endif() + +if(NOT EGL_LIBRARY) + find_library(EGL_LIBRARY + NAMES "EGL") + + mark_as_advanced(EGL_LIBRARY) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(EGL DEFAULT_MSG EGL_INCLUDE_DIR EGL_LIBRARY) diff --git a/cmake/modules/FindOpenGLES1.cmake b/cmake/modules/FindOpenGLES1.cmake new file mode 100644 index 0000000000..2314cef70f --- /dev/null +++ b/cmake/modules/FindOpenGLES1.cmake @@ -0,0 +1,27 @@ +# Filename: FindOpenGLES1.cmake +# Authors: CFSworks (21 Oct, 2018) +# +# Usage: +# find_package(OpenGLES1 [REQUIRED] [QUIET]) +# +# Once done this will define: +# OPENGLES1_FOUND - system has OpenGL ES 1.x +# OPENGLES1_INCLUDE_DIR - the include directory containing GLES/gl.h +# OPENGLES1_LIBRARY - the library to link against for OpenGL ES 1.x +# + +if(NOT OPENGLES1_INCLUDE_DIR) + find_path(OPENGLES1_INCLUDE_DIR "GLES/gl.h") + + mark_as_advanced(OPENGLES1_INCLUDE_DIR) +endif() + +if(NOT OPENGLES1_LIBRARY) + find_library(OPENGLES1_LIBRARY + NAMES "GLESv1" "GLESv1_CM" "GLES_CM") + + mark_as_advanced(OPENGLES1_LIBRARY) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenGLES1 DEFAULT_MSG OPENGLES1_INCLUDE_DIR OPENGLES1_LIBRARY) diff --git a/cmake/modules/FindOpenGLES2.cmake b/cmake/modules/FindOpenGLES2.cmake new file mode 100644 index 0000000000..42a8cfedce --- /dev/null +++ b/cmake/modules/FindOpenGLES2.cmake @@ -0,0 +1,27 @@ +# Filename: FindOpenGLES2.cmake +# Authors: CFSworks (21 Oct, 2018) +# +# Usage: +# find_package(OpenGLES2 [REQUIRED] [QUIET]) +# +# Once done this will define: +# OPENGLES2_FOUND - system has OpenGL ES 2.x +# OPENGLES2_INCLUDE_DIR - the include directory containing GLES2/gl2.h +# OPENGLES2_LIBRARY - the library to link against for OpenGL ES 2.x +# + +if(NOT OPENGLES2_INCLUDE_DIR) + find_path(OPENGLES2_INCLUDE_DIR "GLES2/gl2.h") + + mark_as_advanced(OPENGLES2_INCLUDE_DIR) +endif() + +if(NOT OPENGLES2_LIBRARY) + find_library(OPENGLES2_LIBRARY + NAMES "GLESv2") + + mark_as_advanced(OPENGLES2_LIBRARY) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_INCLUDE_DIR OPENGLES2_LIBRARY) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 3bcf8ace8e..1d39651c91 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -482,20 +482,6 @@ mark_as_advanced(SDL_LIBRARY) mark_as_advanced(SDL_LIBRARY_TEMP) -# Is X11 insalled, and where? -find_package(X11 QUIET) - -if(NOT X11_Xkb_FOUND OR NOT X11_Xutil_FOUND) - # Panda implicitly requires these supplementary X11 libs; if we can't find - # them, we just say we didn't find X11 at all. - set(X11_FOUND OFF) -endif() - -package_option(X11 - "Provides X-server support on Unix platforms. X11 may need to be linked -against for tinydisplay, but probably only on a Linux platform.") - - # TODO: XF86DGA # This defines if we have XF86DGA installed. #find_package(XF86DGA QUIET) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 8a4006de86..36727adba9 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -155,24 +155,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_GTK2) - message("+ gtk+-2") -else() - message("- Did not find gtk+-2") -endif() - -if(HAVE_GLES) - message("+ OpenGL ES 1") -else() - message("- Did not find OpenGL ES 1") -endif() - -if(HAVE_GLES2) - message("+ OpenGL ES 2") -else() - message("- Did not find OpenGL ES 2") -endif() - if(HAVE_DX9) message("+ DirectX9") else() @@ -185,12 +167,6 @@ else() message("- Not building Tinydisplay") endif() -if(HAVE_X11) - message("+ X11") -else() - message("- Did not find X11") -endif() - if(HAVE_OPENCV) message("+ OpenCV") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 79dbeae29f..eae931ce75 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -300,9 +300,11 @@ endif() # -# ------------ FreeType ------------ +# ------------ UI libraries ------------ # +# Freetype + find_package(Freetype QUIET) package_option(FREETYPE @@ -312,12 +314,14 @@ package_option(FREETYPE config_package(FREETYPE "FreeType") +# GTK2 + # Find and configure GTK 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) -#config_package(GTK2 "gtk+-2") package_option(GTK2) +config_package(GTK2 "gtk+-2") # # ------------ Physics engines ------------ @@ -377,18 +381,70 @@ package_option(GL config_package(GL "OpenGL") +# OpenGL ES 1 +find_package(OpenGLES1 QUIET) + +package_option(GLES1 + "Enable support for OpenGL ES 1.x rendering APIs." + FOUND_AS OPENGLES1) + +config_package(GLES1 "OpenGL ES 1.x") + +# OpenGL ES 2 +find_package(OpenGLES2 QUIET) + +package_option(GLES2 + "Enable support for OpenGL ES 2.x rendering APIs." + FOUND_AS OPENGLES2) + +config_package(GLES2 "OpenGL ES 2.x") + +# +# ------------ Display APIs ------------ +# + +# X11 +find_package(X11 QUIET) + +if(NOT X11_Xkb_FOUND OR NOT X11_Xutil_FOUND) + # Panda implicitly requires these supplementary X11 libs; if we can't find + # them, we just say we didn't find X11 at all. + set(X11_FOUND OFF) +endif() + +package_option(X11 + "Provides X-server support on Unix platforms. X11 may need to be linked +against for tinydisplay, but probably only on a Linux platform.") + +set(HAVE_GLX_AVAILABLE OFF) +if(HAVE_GL AND HAVE_X11 AND NOT APPLE) + set(HAVE_GLX_AVAILABLE ON) +endif() + +option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." ${HAVE_GLX_AVAILABLE}) +if(HAVE_GLX AND NOT HAVE_GLX_AVAILABLE) + message(SEND_ERROR "HAVE_GLX manually set to ON but it is not available!") +endif() + +if(HAVE_GLX) + config_package(X11 "X11 (with GLX)") +else() + config_package(X11 "X11 (without GLX)") +endif() + +# EGL +find_package(EGL QUIET) + +package_option(EGL + "Enable support for the Khronos EGL context management interface for + OpenGL ES. This is necessary to support OpenGL ES under X11.") + +config_package(EGL "EGL") + ######## # TODO # ######## -# Find and configure OpenGL ES 1 -#find_package(GLES) -#config_package(GLES COMMENT "OpenGL ES 1") - -# Find and configure OpenGL ES 2 -#find_package(GLES) -#config_package(GLES COMMENT "OpenGL ES 2") - # Find and configure DirectX 9 #find_package(DX9) #config_package(DX9 COMMENT "DirectX9") diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 2b976e5220..3f0eb57e7d 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -19,10 +19,13 @@ add_subdirectory(src/downloadertools) add_subdirectory(src/dxml) add_subdirectory(src/egg) add_subdirectory(src/egg2pg) +add_subdirectory(src/egldisplay) add_subdirectory(src/event) add_subdirectory(src/express) add_subdirectory(src/ffmpeg) add_subdirectory(src/framework) +add_subdirectory(src/glesgsg) +add_subdirectory(src/gles2gsg) add_subdirectory(src/glgsg) add_subdirectory(src/glstuff) add_subdirectory(src/glxdisplay) @@ -68,6 +71,8 @@ add_subdirectory(metalibs/panda) add_subdirectory(metalibs/pandaegg) add_subdirectory(metalibs/pandaexpress) add_subdirectory(metalibs/pandagl) +add_subdirectory(metalibs/pandagles) +add_subdirectory(metalibs/pandagles2) add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt new file mode 100644 index 0000000000..817cfc2026 --- /dev/null +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -0,0 +1,9 @@ +if(NOT HAVE_GLES1 OR NOT HAVE_EGL) + return() +endif() + +add_metalib(pandagles ${MODULE_TYPE} pandagles.cxx + COMPONENTS p3egldisplay_gles1 p3glesgsg) +set_target_properties(pandagles PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGLES) + +install(TARGETS pandagles DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/metalibs/pandagles2/CMakeLists.txt b/panda/metalibs/pandagles2/CMakeLists.txt new file mode 100644 index 0000000000..cb0e887254 --- /dev/null +++ b/panda/metalibs/pandagles2/CMakeLists.txt @@ -0,0 +1,9 @@ +if(NOT HAVE_GLES2 OR NOT HAVE_EGL) + return() +endif() + +add_metalib(pandagles2 ${MODULE_TYPE} pandagles2.cxx + COMPONENTS p3egldisplay_gles2 p3gles2gsg) +set_target_properties(pandagles2 PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGLES2) + +install(TARGETS pandagles2 DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/src/egldisplay/CMakeLists.txt b/panda/src/egldisplay/CMakeLists.txt new file mode 100644 index 0000000000..c5e51d18bf --- /dev/null +++ b/panda/src/egldisplay/CMakeLists.txt @@ -0,0 +1,54 @@ +if(NOT HAVE_EGL OR NOT HAVE_X11) + return() +endif() + +if(NOT HAVE_GLES1 AND NOT HAVE_GLES2) + return() +endif() + +set(P3EGLDISPLAY_HEADERS + config_egldisplay.h + eglGraphicsBuffer.h + eglGraphicsPipe.h eglGraphicsPipe.I + eglGraphicsPixmap.h + eglGraphicsStateGuardian.h eglGraphicsStateGuardian.I + eglGraphicsWindow.h eglGraphicsWindow.I +) + +set(P3EGLDISPLAY_SOURCES + config_egldisplay.cxx + eglGraphicsBuffer.cxx + eglGraphicsPipe.cxx + eglGraphicsPixmap.cxx + eglGraphicsStateGuardian.cxx + eglGraphicsWindow.cxx +) + +composite_sources(p3egldisplay P3EGLDISPLAY_SOURCES) + +# We actually build this twice! Once for GLES1, once for GLES2. +if(HAVE_GLES1) + add_component_library(p3egldisplay_gles1 SYMBOL BUILDING_PANDAGLES + ${P3EGLDISPLAY_HEADERS} ${P3EGLDISPLAY_SOURCES}) + target_compile_definitions(p3egldisplay_gles1 PUBLIC OPENGLES_1) + target_link_libraries(p3egldisplay_gles1 p3glesgsg p3x11display + PKG::EGL PKG::GLES1) + + if(NOT BUILD_METALIBS) + install(TARGETS p3egldisplay_gles1 DESTINATION lib) + endif() +endif() + +if(HAVE_GLES2) + add_component_library(p3egldisplay_gles2 SYMBOL BUILDING_PANDAGLES2 + ${P3EGLDISPLAY_HEADERS} ${P3EGLDISPLAY_SOURCES}) + target_compile_definitions(p3egldisplay_gles2 PUBLIC OPENGLES_2) + target_link_libraries(p3egldisplay_gles2 p3gles2gsg p3x11display + PKG::EGL PKG::GLES2) + + if(NOT BUILD_METALIBS) + install(TARGETS p3egldisplay_gles2 DESTINATION lib) + endif() +endif() + +install(FILES ${P3EGLDISPLAY_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/gles2gsg/CMakeLists.txt b/panda/src/gles2gsg/CMakeLists.txt new file mode 100644 index 0000000000..6bbd4ca9c8 --- /dev/null +++ b/panda/src/gles2gsg/CMakeLists.txt @@ -0,0 +1,22 @@ +if(NOT HAVE_GLES2) + return() +endif() + +set(P3GLES2GSG_HEADERS + config_gles2gsg.h + gles2gsg.h) + +set(P3GLES2GSG_SOURCES + config_gles2gsg.cxx + gles2gsg.cxx) + +composite_sources(p3gles2gsg P3GLES2GSG_SOURCES) +add_component_library(p3gles2gsg SYMBOL BUILDING_PANDAGLES2 + ${P3GLE2SGSG_HEADERS} ${P3GLES2GSG_SOURCES}) +target_link_libraries(p3gles2gsg p3glstuff panda + PKG::GLES2) + +if(NOT BUILD_METALIBS) + install(TARGETS p3gles2gsg DESTINATION lib RUNTIME DESTINATION bin) +endif() +install(FILES ${P3GLES2GSG_HEADERS} DESTINATION include/panda3d) diff --git a/panda/src/glesgsg/CMakeLists.txt b/panda/src/glesgsg/CMakeLists.txt new file mode 100644 index 0000000000..993303a3f7 --- /dev/null +++ b/panda/src/glesgsg/CMakeLists.txt @@ -0,0 +1,22 @@ +if(NOT HAVE_GLES1) + return() +endif() + +set(P3GLESGSG_HEADERS + config_glesgsg.h + glesgsg.h) + +set(P3GLESGSG_SOURCES + config_glesgsg.cxx + glesgsg.cxx) + +composite_sources(p3glesgsg P3GLESGSG_SOURCES) +add_component_library(p3glesgsg SYMBOL BUILDING_PANDAGLES + ${P3GLESGSG_HEADERS} ${P3GLESGSG_SOURCES}) +target_link_libraries(p3glesgsg p3glstuff panda + PKG::GLES1) + +if(NOT BUILD_METALIBS) + install(TARGETS p3glesgsg DESTINATION lib RUNTIME DESTINATION bin) +endif() +install(FILES ${P3GLESGSG_HEADERS} DESTINATION include/panda3d) From f07b713e8d4d73e3876bef780c04df7f9bc4339f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 27 Oct 2018 21:11:14 -0600 Subject: [PATCH 534/744] CMake: Change FindOpenGLES* modules so they don't even try on Apple --- cmake/modules/FindOpenGLES1.cmake | 4 ++-- cmake/modules/FindOpenGLES2.cmake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/modules/FindOpenGLES1.cmake b/cmake/modules/FindOpenGLES1.cmake index 2314cef70f..c36714e324 100644 --- a/cmake/modules/FindOpenGLES1.cmake +++ b/cmake/modules/FindOpenGLES1.cmake @@ -10,13 +10,13 @@ # OPENGLES1_LIBRARY - the library to link against for OpenGL ES 1.x # -if(NOT OPENGLES1_INCLUDE_DIR) +if(NOT OPENGLES1_INCLUDE_DIR AND NOT APPLE) find_path(OPENGLES1_INCLUDE_DIR "GLES/gl.h") mark_as_advanced(OPENGLES1_INCLUDE_DIR) endif() -if(NOT OPENGLES1_LIBRARY) +if(NOT OPENGLES1_LIBRARY AND NOT APPLE) find_library(OPENGLES1_LIBRARY NAMES "GLESv1" "GLESv1_CM" "GLES_CM") diff --git a/cmake/modules/FindOpenGLES2.cmake b/cmake/modules/FindOpenGLES2.cmake index 42a8cfedce..f2ceb76ecd 100644 --- a/cmake/modules/FindOpenGLES2.cmake +++ b/cmake/modules/FindOpenGLES2.cmake @@ -10,13 +10,13 @@ # OPENGLES2_LIBRARY - the library to link against for OpenGL ES 2.x # -if(NOT OPENGLES2_INCLUDE_DIR) +if(NOT OPENGLES2_INCLUDE_DIR AND NOT APPLE) find_path(OPENGLES2_INCLUDE_DIR "GLES2/gl2.h") mark_as_advanced(OPENGLES2_INCLUDE_DIR) endif() -if(NOT OPENGLES2_LIBRARY) +if(NOT OPENGLES2_LIBRARY AND NOT APPLE) find_library(OPENGLES2_LIBRARY NAMES "GLESv2") From 6760c1366d19cbd29642ab863e7ef17c117326db Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 28 Oct 2018 02:00:03 -0600 Subject: [PATCH 535/744] CMake: Update pandatool CMakeLists.txt files for style consistency --- pandatool/src/converter/CMakeLists.txt | 11 +- pandatool/src/cvscopy/CMakeLists.txt | 7 +- pandatool/src/dxf/CMakeLists.txt | 21 ++- pandatool/src/dxfegg/CMakeLists.txt | 12 +- pandatool/src/eggbase/CMakeLists.txt | 29 ++-- pandatool/src/flt/CMakeLists.txt | 161 +++++++++++---------- pandatool/src/fltegg/CMakeLists.txt | 12 +- pandatool/src/gtk-stats/CMakeLists.txt | 38 ++--- pandatool/src/pandatoolbase/CMakeLists.txt | 26 ++-- pandatool/src/progbase/CMakeLists.txt | 14 +- pandatool/src/pstatserver/CMakeLists.txt | 33 +++-- 11 files changed, 201 insertions(+), 163 deletions(-) diff --git a/pandatool/src/converter/CMakeLists.txt b/pandatool/src/converter/CMakeLists.txt index b91752f849..aee79d48c6 100644 --- a/pandatool/src/converter/CMakeLists.txt +++ b/pandatool/src/converter/CMakeLists.txt @@ -1,9 +1,14 @@ set(P3CONVERTER_HEADERS - somethingToEggConverter.I somethingToEggConverter.h - eggToSomethingConverter.I eggToSomethingConverter.h) + somethingToEggConverter.h somethingToEggConverter.I + eggToSomethingConverter.h eggToSomethingConverter.I +) set(P3CONVERTER_SOURCES - somethingToEggConverter.cxx eggToSomethingConverter.cxx) + somethingToEggConverter.cxx eggToSomethingConverter.cxx +) add_library(p3converter STATIC ${P3CONVERTER_HEADERS} ${P3CONVERTER_SOURCES}) target_link_libraries(p3converter p3pandatoolbase pandaegg) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/cvscopy/CMakeLists.txt b/pandatool/src/cvscopy/CMakeLists.txt index 68b0a30ed1..718db0d7ca 100644 --- a/pandatool/src/cvscopy/CMakeLists.txt +++ b/pandatool/src/cvscopy/CMakeLists.txt @@ -1,9 +1,12 @@ set(P3CVSCOPY_HEADERS - cvsCopy.h cvsSourceDirectory.h cvsSourceTree.h) + cvsCopy.h cvsSourceDirectory.h cvsSourceTree.h +) set(P3CVSCOPY_SOURCES - cvsCopy.cxx cvsSourceDirectory.cxx cvsSourceTree.cxx) + cvsCopy.cxx cvsSourceDirectory.cxx cvsSourceTree.cxx +) +composite_sources(p3cvscopy P3CVSCOPY_SOURCES) add_library(p3cvscopy STATIC ${P3CVSCOPY_HEADERS} ${P3CVSCOPY_SOURCES}) target_link_libraries(p3cvscopy p3progbase) diff --git a/pandatool/src/dxf/CMakeLists.txt b/pandatool/src/dxf/CMakeLists.txt index d190b1bea9..c8095a327f 100644 --- a/pandatool/src/dxf/CMakeLists.txt +++ b/pandatool/src/dxf/CMakeLists.txt @@ -1,15 +1,20 @@ set(P3DXF_HEADERS - dxfFile.h - dxfLayer.h - dxfLayerMap.h - dxfVertex.h) + dxfFile.h + dxfLayer.h + dxfLayerMap.h + dxfVertex.h +) set(P3DXF_SOURCES - dxfFile.cxx - dxfLayer.cxx - dxfLayerMap.cxx - dxfVertex.cxx) + dxfFile.cxx + dxfLayer.cxx + dxfLayerMap.cxx + dxfVertex.cxx +) composite_sources(p3dxf P3DXF_SOURCES) add_library(p3dxf STATIC ${P3DXF_HEADERS} ${P3DXF_SOURCES}) target_link_libraries(p3dxf p3pandatoolbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/dxfegg/CMakeLists.txt b/pandatool/src/dxfegg/CMakeLists.txt index 43f32316df..dd2b994483 100644 --- a/pandatool/src/dxfegg/CMakeLists.txt +++ b/pandatool/src/dxfegg/CMakeLists.txt @@ -1,13 +1,15 @@ set(P3DXFEGG_HEADERS - dxfToEggConverter.h - dxfToEggLayer.h) + dxfToEggConverter.h + dxfToEggLayer.h +) set(P3DXFEGG_SOURCES - dxfToEggConverter.cxx - dxfToEggLayer.cxx) + dxfToEggConverter.cxx + dxfToEggLayer.cxx +) add_library(p3dxfegg STATIC ${P3DXFEGG_HEADERS} ${P3DXFEGG_SOURCES}) -target_link_libraries(p3dxfegg p3dxf p3converter) +target_link_libraries(p3dxfegg p3dxf p3eggbase) # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. diff --git a/pandatool/src/eggbase/CMakeLists.txt b/pandatool/src/eggbase/CMakeLists.txt index c3dda64cd3..1abb6a2dd3 100644 --- a/pandatool/src/eggbase/CMakeLists.txt +++ b/pandatool/src/eggbase/CMakeLists.txt @@ -1,19 +1,24 @@ set(P3EGGBASE_HEADERS - eggBase.h eggConverter.h eggFilter.h - eggMakeSomething.h - eggMultiBase.h eggMultiFilter.h - eggReader.h eggSingleBase.h - eggToSomething.h eggWriter.h - somethingToEgg.h) + eggBase.h eggConverter.h eggFilter.h + eggMakeSomething.h + eggMultiBase.h eggMultiFilter.h + eggReader.h eggSingleBase.h + eggToSomething.h eggWriter.h + somethingToEgg.h +) set(P3EGGBASE_SOURCES - eggBase.cxx eggConverter.cxx eggFilter.cxx - eggMakeSomething.cxx - eggMultiBase.cxx - eggMultiFilter.cxx eggReader.cxx eggSingleBase.cxx - eggToSomething.cxx - eggWriter.cxx somethingToEgg.cxx) + eggBase.cxx eggConverter.cxx eggFilter.cxx + eggMakeSomething.cxx + eggMultiBase.cxx + eggMultiFilter.cxx eggReader.cxx eggSingleBase.cxx + eggToSomething.cxx + eggWriter.cxx somethingToEgg.cxx +) composite_sources(p3eggbase P3EGGBASE_SOURCES) add_library(p3eggbase STATIC ${P3EGGBASE_HEADERS} ${P3EGGBASE_SOURCES}) target_link_libraries(p3eggbase p3progbase p3converter) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/flt/CMakeLists.txt b/pandatool/src/flt/CMakeLists.txt index 9b7b045c4d..02f096b81b 100644 --- a/pandatool/src/flt/CMakeLists.txt +++ b/pandatool/src/flt/CMakeLists.txt @@ -1,85 +1,90 @@ set(P3FLT_HEADERS - config_flt.h - fltBead.h - fltBeadID.h - fltCurve.I fltCurve.h - fltError.h - fltExternalReference.h - fltEyepoint.h - fltFace.I fltFace.h - fltGeometry.I fltGeometry.h - fltGroup.h - fltHeader.h - fltInstanceDefinition.h - fltInstanceRef.h - fltLightSourceDefinition.h - fltLocalVertexPool.I fltLocalVertexPool.h - fltLOD.h - fltMaterial.h - fltMesh.I fltMesh.h - fltMeshPrimitive.I fltMeshPrimitive.h - fltObject.h - fltOpcode.h - fltPackedColor.I fltPackedColor.h - fltRecord.I fltRecord.h - fltRecordReader.h - fltRecordWriter.h - fltTexture.h - fltTrackplane.h - fltTransformGeneralMatrix.h - fltTransformPut.h - fltTransformRecord.h - fltTransformRotateAboutEdge.h - fltTransformRotateAboutPoint.h - fltTransformRotateScale.h - fltTransformScale.h - fltTransformTranslate.h - fltUnsupportedRecord.h - fltVectorRecord.h - fltVertex.I fltVertex.h - fltVertexList.h) + config_flt.h + fltBead.h + fltBeadID.h + fltCurve.h fltCurve.I + fltError.h + fltExternalReference.h + fltEyepoint.h + fltFace.h fltFace.I + fltGeometry.h fltGeometry.I + fltGroup.h + fltHeader.h + fltInstanceDefinition.h + fltInstanceRef.h + fltLightSourceDefinition.h + fltLocalVertexPool.h fltLocalVertexPool.I + fltLOD.h + fltMaterial.h + fltMesh.h fltMesh.I + fltMeshPrimitive.h fltMeshPrimitive.I + fltObject.h + fltOpcode.h + fltPackedColor.h fltPackedColor.I + fltRecord.h fltRecord.I + fltRecordReader.h + fltRecordWriter.h + fltTexture.h + fltTrackplane.h + fltTransformGeneralMatrix.h + fltTransformPut.h + fltTransformRecord.h + fltTransformRotateAboutEdge.h + fltTransformRotateAboutPoint.h + fltTransformRotateScale.h + fltTransformScale.h + fltTransformTranslate.h + fltUnsupportedRecord.h + fltVectorRecord.h + fltVertex.h fltVertex.I + fltVertexList.h +) set(P3FLT_SOURCES - config_flt.cxx - fltBead.cxx - fltBeadID.cxx - fltCurve.cxx - fltError.cxx - fltExternalReference.cxx - fltEyepoint.cxx - fltFace.cxx - fltGeometry.cxx - fltGroup.cxx - fltHeader.cxx - fltInstanceDefinition.cxx - fltInstanceRef.cxx - fltLightSourceDefinition.cxx - fltLocalVertexPool.cxx - fltLOD.cxx - fltMaterial.cxx - fltMesh.cxx - fltMeshPrimitive.cxx - fltObject.cxx - fltOpcode.cxx - fltPackedColor.cxx - fltRecord.cxx - fltRecordReader.cxx - fltRecordWriter.cxx - fltTexture.cxx - fltTrackplane.cxx - fltTransformGeneralMatrix.cxx - fltTransformPut.cxx - fltTransformRecord.cxx - fltTransformRotateAboutEdge.cxx - fltTransformRotateAboutPoint.cxx - fltTransformRotateScale.cxx - fltTransformScale.cxx - fltTransformTranslate.cxx - fltUnsupportedRecord.cxx - fltVectorRecord.cxx - fltVertex.cxx - fltVertexList.cxx) + config_flt.cxx + fltBead.cxx + fltBeadID.cxx + fltCurve.cxx + fltError.cxx + fltExternalReference.cxx + fltEyepoint.cxx + fltFace.cxx + fltGeometry.cxx + fltGroup.cxx + fltHeader.cxx + fltInstanceDefinition.cxx + fltInstanceRef.cxx + fltLightSourceDefinition.cxx + fltLocalVertexPool.cxx + fltLOD.cxx + fltMaterial.cxx + fltMesh.cxx + fltMeshPrimitive.cxx + fltObject.cxx + fltOpcode.cxx + fltPackedColor.cxx + fltRecord.cxx + fltRecordReader.cxx + fltRecordWriter.cxx + fltTexture.cxx + fltTrackplane.cxx + fltTransformGeneralMatrix.cxx + fltTransformPut.cxx + fltTransformRecord.cxx + fltTransformRotateAboutEdge.cxx + fltTransformRotateAboutPoint.cxx + fltTransformRotateScale.cxx + fltTransformScale.cxx + fltTransformTranslate.cxx + fltUnsupportedRecord.cxx + fltVectorRecord.cxx + fltVertex.cxx + fltVertexList.cxx +) composite_sources(p3flt P3FLT_SOURCES) add_library(p3flt STATIC ${P3FLT_HEADERS} ${P3FLT_SOURCES}) target_link_libraries(p3flt p3pandatoolbase panda) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/fltegg/CMakeLists.txt b/pandatool/src/fltegg/CMakeLists.txt index 94101320c0..5072e863f0 100644 --- a/pandatool/src/fltegg/CMakeLists.txt +++ b/pandatool/src/fltegg/CMakeLists.txt @@ -1,13 +1,15 @@ set(P3FLTEGG_HEADERS - fltToEggConverter.I fltToEggConverter.h - fltToEggLevelState.I fltToEggLevelState.h) + fltToEggConverter.h fltToEggConverter.I + fltToEggLevelState.h fltToEggLevelState.I +) set(P3FLTEGG_SOURCES - fltToEggConverter.cxx - fltToEggLevelState.cxx) + fltToEggConverter.cxx + fltToEggLevelState.cxx +) add_library(p3fltegg STATIC ${P3FLTEGG_HEADERS} ${P3FLTEGG_SOURCES}) -target_link_libraries(p3fltegg p3flt p3converter) +target_link_libraries(p3fltegg p3flt p3eggbase) # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index 130ed34b4a..5594f53a5b 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -3,26 +3,28 @@ if(NOT HAVE_GTK2 OR NOT HAVE_NET) endif() set(GTKSTATS_HEADERS - gtkStatsChartMenu.h - gtkStatsGraph.h - gtkStatsLabel.h - gtkStatsLabelStack.h - gtkStatsMenuId.h - gtkStatsMonitor.h gtkStatsMonitor.I - gtkStatsPianoRoll.h - gtkStatsServer.h - gtkStatsStripChart.h) + gtkStatsChartMenu.h + gtkStatsGraph.h + gtkStatsLabel.h + gtkStatsLabelStack.h + gtkStatsMenuId.h + gtkStatsMonitor.h gtkStatsMonitor.I + gtkStatsPianoRoll.h + gtkStatsServer.h + gtkStatsStripChart.h +) set(GTKSTATS_SOURCES - gtkStats.cxx - gtkStatsChartMenu.cxx - gtkStatsGraph.cxx - gtkStatsLabel.cxx - gtkStatsLabelStack.cxx - gtkStatsMonitor.cxx - gtkStatsPianoRoll.cxx - gtkStatsServer.cxx - gtkStatsStripChart.cxx) + gtkStats.cxx + gtkStatsChartMenu.cxx + gtkStatsGraph.cxx + gtkStatsLabel.cxx + gtkStatsLabelStack.cxx + gtkStatsMonitor.cxx + gtkStatsPianoRoll.cxx + gtkStatsServer.cxx + gtkStatsStripChart.cxx +) composite_sources(gtkstats GTKSTATS_SOURCES) add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) diff --git a/pandatool/src/pandatoolbase/CMakeLists.txt b/pandatool/src/pandatoolbase/CMakeLists.txt index b1c921f3ea..7e615b2d0b 100644 --- a/pandatool/src/pandatoolbase/CMakeLists.txt +++ b/pandatool/src/pandatoolbase/CMakeLists.txt @@ -1,18 +1,20 @@ set(P3PANDATOOLBASE_HEADERS - animationConvert.h - config_pandatoolbase.h - distanceUnit.h - pandatoolbase.h pandatoolsymbols.h - pathReplace.I pathReplace.h - pathStore.h) + animationConvert.h + config_pandatoolbase.h + distanceUnit.h + pandatoolbase.h pandatoolsymbols.h + pathReplace.h pathReplace.I + pathStore.h +) set(P3PANDATOOLBASE_SOURCES - animationConvert.cxx - config_pandatoolbase.cxx - distanceUnit.cxx - pandatoolbase.cxx - pathReplace.cxx - pathStore.cxx) + animationConvert.cxx + config_pandatoolbase.cxx + distanceUnit.cxx + pandatoolbase.cxx + pathReplace.cxx + pathStore.cxx +) composite_sources(p3pandatoolbase P3PANDATOOLBASE_SOURCES) add_library(p3pandatoolbase STATIC ${P3PANDATOOLBASE_HEADERS} ${P3PANDATOOLBASE_SOURCES}) diff --git a/pandatool/src/progbase/CMakeLists.txt b/pandatool/src/progbase/CMakeLists.txt index 6d037b460d..3b390c12a3 100644 --- a/pandatool/src/progbase/CMakeLists.txt +++ b/pandatool/src/progbase/CMakeLists.txt @@ -1,12 +1,14 @@ set(P3PROGBASE_HEADERS - programBase.I programBase.h - withOutputFile.I withOutputFile.h - wordWrapStream.h wordWrapStreamBuf.I - wordWrapStreamBuf.h) + programBase.h programBase.I + withOutputFile.h withOutputFile.I + wordWrapStream.h wordWrapStreamBuf.I + wordWrapStreamBuf.h +) set(P3PROGBASE_SOURCES - programBase.cxx withOutputFile.cxx wordWrapStream.cxx - wordWrapStreamBuf.cxx) + programBase.cxx withOutputFile.cxx wordWrapStream.cxx + wordWrapStreamBuf.cxx +) composite_sources(p3progbase P3PROGBASE_SOURCES) add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) diff --git a/pandatool/src/pstatserver/CMakeLists.txt b/pandatool/src/pstatserver/CMakeLists.txt index d133fd0763..359f529b18 100644 --- a/pandatool/src/pstatserver/CMakeLists.txt +++ b/pandatool/src/pstatserver/CMakeLists.txt @@ -3,22 +3,27 @@ if(NOT HAVE_NET) endif() set(P3PSTATSERVER_HEADERS - pStatClientData.h pStatGraph.I - pStatGraph.h pStatListener.h pStatMonitor.I - pStatMonitor.h pStatPianoRoll.I - pStatPianoRoll.h pStatReader.h - pStatServer.h pStatStripChart.I - pStatStripChart.h pStatThreadData.I - pStatThreadData.h pStatView.I pStatView.h - pStatViewLevel.I pStatViewLevel.h) + pStatClientData.h + pStatGraph.h pStatGraph.I + pStatListener.h + pStatMonitor.h pStatMonitor.I + pStatPianoRoll.h pStatPianoRoll.I + pStatReader.h + pStatServer.h + pStatStripChart.h pStatStripChart.I + pStatThreadData.h pStatThreadData.I + pStatView.h pStatView.I + pStatViewLevel.h pStatViewLevel.I +) set(P3PSTATSERVER_SOURCES - pStatClientData.cxx pStatGraph.cxx - pStatListener.cxx - pStatMonitor.cxx pStatPianoRoll.cxx - pStatReader.cxx pStatServer.cxx - pStatStripChart.cxx pStatThreadData.cxx - pStatView.cxx pStatViewLevel.cxx) + pStatClientData.cxx pStatGraph.cxx + pStatListener.cxx + pStatMonitor.cxx pStatPianoRoll.cxx + pStatReader.cxx pStatServer.cxx + pStatStripChart.cxx pStatThreadData.cxx + pStatView.cxx pStatViewLevel.cxx +) composite_sources(p3pstatserver P3PSTATSERVER_SOURCES) add_library(p3pstatserver STATIC ${P3PSTATSERVER_HEADERS} ${P3PSTATSERVER_SOURCES}) From 841e7a9a16f7b0e467aa81f3554ae3dc5a3a67dd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 28 Oct 2018 03:12:47 -0600 Subject: [PATCH 536/744] CMake: Add a bunch of pandatool components to the build --- pandatool/CMakeLists.txt | 23 ++++++++ pandatool/src/egg-mkfont/CMakeLists.txt | 17 ++++++ pandatool/src/egg-optchar/CMakeLists.txt | 19 ++++++ pandatool/src/egg-palettize/CMakeLists.txt | 7 +++ pandatool/src/egg-qtess/CMakeLists.txt | 27 +++++++++ pandatool/src/eggcharbase/CMakeLists.txt | 42 +++++++++++++ pandatool/src/eggprogs/CMakeLists.txt | 35 +++++++++++ pandatool/src/imagebase/CMakeLists.txt | 20 +++++++ pandatool/src/imageprogs/CMakeLists.txt | 19 ++++++ pandatool/src/lwo/CMakeLists.txt | 69 ++++++++++++++++++++++ pandatool/src/lwoegg/CMakeLists.txt | 27 +++++++++ pandatool/src/lwoprogs/CMakeLists.txt | 7 +++ pandatool/src/miscprogs/CMakeLists.txt | 3 + pandatool/src/objegg/CMakeLists.txt | 19 ++++++ pandatool/src/objprogs/CMakeLists.txt | 7 +++ pandatool/src/palettizer/CMakeLists.txt | 56 ++++++++++++++++++ pandatool/src/pandatoolbase/CMakeLists.txt | 7 +++ pandatool/src/pfmprogs/CMakeLists.txt | 9 +++ pandatool/src/ptloader/CMakeLists.txt | 18 ++++++ pandatool/src/vrml/CMakeLists.txt | 30 ++++++++++ pandatool/src/vrmlegg/CMakeLists.txt | 18 ++++++ pandatool/src/vrmlprogs/CMakeLists.txt | 7 +++ pandatool/src/xfile/CMakeLists.txt | 56 ++++++++++++++++++ pandatool/src/xfileegg/CMakeLists.txt | 22 +++++++ pandatool/src/xfileprogs/CMakeLists.txt | 11 ++++ 25 files changed, 575 insertions(+) create mode 100644 pandatool/src/egg-mkfont/CMakeLists.txt create mode 100644 pandatool/src/egg-optchar/CMakeLists.txt create mode 100644 pandatool/src/egg-palettize/CMakeLists.txt create mode 100644 pandatool/src/egg-qtess/CMakeLists.txt create mode 100644 pandatool/src/eggcharbase/CMakeLists.txt create mode 100644 pandatool/src/eggprogs/CMakeLists.txt create mode 100644 pandatool/src/imagebase/CMakeLists.txt create mode 100644 pandatool/src/imageprogs/CMakeLists.txt create mode 100644 pandatool/src/lwo/CMakeLists.txt create mode 100644 pandatool/src/lwoegg/CMakeLists.txt create mode 100644 pandatool/src/lwoprogs/CMakeLists.txt create mode 100644 pandatool/src/miscprogs/CMakeLists.txt create mode 100644 pandatool/src/objegg/CMakeLists.txt create mode 100644 pandatool/src/objprogs/CMakeLists.txt create mode 100644 pandatool/src/palettizer/CMakeLists.txt create mode 100644 pandatool/src/pfmprogs/CMakeLists.txt create mode 100644 pandatool/src/ptloader/CMakeLists.txt create mode 100644 pandatool/src/vrml/CMakeLists.txt create mode 100644 pandatool/src/vrmlegg/CMakeLists.txt create mode 100644 pandatool/src/vrmlprogs/CMakeLists.txt create mode 100644 pandatool/src/xfile/CMakeLists.txt create mode 100644 pandatool/src/xfileegg/CMakeLists.txt create mode 100644 pandatool/src/xfileprogs/CMakeLists.txt diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 4695732303..194f298f44 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -10,10 +10,33 @@ add_subdirectory(src/dxf) add_subdirectory(src/dxfegg) add_subdirectory(src/dxfprogs) add_subdirectory(src/eggbase) +add_subdirectory(src/eggcharbase) +add_subdirectory(src/eggprogs) +add_subdirectory(src/egg-mkfont) +add_subdirectory(src/egg-optchar) +add_subdirectory(src/egg-palettize) +add_subdirectory(src/egg-qtess) add_subdirectory(src/flt) add_subdirectory(src/fltegg) add_subdirectory(src/fltprogs) add_subdirectory(src/gtk-stats) +add_subdirectory(src/imagebase) +add_subdirectory(src/imageprogs) +add_subdirectory(src/lwo) +add_subdirectory(src/lwoegg) +add_subdirectory(src/lwoprogs) +add_subdirectory(src/miscprogs) +add_subdirectory(src/objegg) +add_subdirectory(src/objprogs) +add_subdirectory(src/palettizer) add_subdirectory(src/pandatoolbase) +add_subdirectory(src/pfmprogs) add_subdirectory(src/progbase) add_subdirectory(src/pstatserver) +add_subdirectory(src/ptloader) +add_subdirectory(src/vrml) +add_subdirectory(src/vrmlegg) +add_subdirectory(src/vrmlprogs) +add_subdirectory(src/xfile) +add_subdirectory(src/xfileegg) +add_subdirectory(src/xfileprogs) diff --git a/pandatool/src/egg-mkfont/CMakeLists.txt b/pandatool/src/egg-mkfont/CMakeLists.txt new file mode 100644 index 0000000000..7f925ccd94 --- /dev/null +++ b/pandatool/src/egg-mkfont/CMakeLists.txt @@ -0,0 +1,17 @@ +set(P3EGG_MKFONT_HEADERS + eggMakeFont.h + rangeDescription.h rangeDescription.I + rangeIterator.h rangeIterator.I +) + +set(P3EGG_MKFONT_SOURCES + eggMakeFont.cxx + rangeDescription.cxx + rangeIterator.cxx +) + +composite_sources(egg-mkfont P3EGG_MKFONT_SOURCES) +add_executable(egg-mkfont ${P3EGG_MKFONT_HEADERS} ${P3EGG_MKFONT_SOURCES}) +target_link_libraries(egg-mkfont p3palettizer p3eggbase p3pandatoolbase) + +install(TARGETS egg-mkfont DESTINATION bin) diff --git a/pandatool/src/egg-optchar/CMakeLists.txt b/pandatool/src/egg-optchar/CMakeLists.txt new file mode 100644 index 0000000000..4d0f180def --- /dev/null +++ b/pandatool/src/egg-optchar/CMakeLists.txt @@ -0,0 +1,19 @@ +set(P3EGG_OPTCHAR_HEADERS + config_egg_optchar.h + eggOptchar.h + eggOptcharUserData.h eggOptcharUserData.I + vertexMembership.h vertexMembership.I +) + +set(P3EGG_OPTCHAR_SOURCES + config_egg_optchar.cxx + eggOptchar.cxx + eggOptcharUserData.cxx + vertexMembership.cxx +) + +composite_sources(egg-optchar P3EGG_OPTCHAR_SOURCES) +add_executable(egg-optchar ${P3EGG_OPTCHAR_HEADERS} ${P3EGG_OPTCHAR_SOURCES}) +target_link_libraries(egg-optchar p3eggcharbase) + +install(TARGETS egg-optchar DESTINATION bin) diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt new file mode 100644 index 0000000000..5ed61c6cca --- /dev/null +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(egg-palettize eggPalettize.cxx eggPalettize.h) +target_link_libraries(egg-palettize p3palettizer p3eggbase p3progbase) +install(TARGETS egg-palettize DESTINATION bin) + +add_library(p3txafile txaFileFilter.cxx txaFileFilter.h txaFileFilter.I) +target_link_libraries(p3txafile p3palettizer) +install(TARGETS p3txafile DESTINATION lib RUNTIME DESTINATION bin) diff --git a/pandatool/src/egg-qtess/CMakeLists.txt b/pandatool/src/egg-qtess/CMakeLists.txt new file mode 100644 index 0000000000..ec7819f4a8 --- /dev/null +++ b/pandatool/src/egg-qtess/CMakeLists.txt @@ -0,0 +1,27 @@ +set(P3EGG_QTESS_HEADERS + config_egg_qtess.h + eggQtess.h + isoPlacer.h isoPlacer.I + qtessGlobals.h + qtessInputEntry.h qtessInputEntry.I + qtessInputFile.h qtessInputFile.I + qtessSurface.h qtessSurface.I + subdivSegment.h subdivSegment.I +) + +set(P3EGG_QTESS_SOURCES + config_egg_qtess.cxx + eggQtess.cxx + isoPlacer.cxx + qtessGlobals.cxx + qtessInputEntry.cxx + qtessInputFile.cxx + qtessSurface.cxx + subdivSegment.cxx +) + +composite_sources(egg-qtess P3EGG_QTESS_SOURCES) +add_executable(egg-qtess ${P3EGG_QTESS_HEADERS} ${P3EGG_QTESS_SOURCES}) +target_link_libraries(egg-qtess p3eggbase) + +install(TARGETS egg-qtess DESTINATION bin) diff --git a/pandatool/src/eggcharbase/CMakeLists.txt b/pandatool/src/eggcharbase/CMakeLists.txt new file mode 100644 index 0000000000..b07b42929a --- /dev/null +++ b/pandatool/src/eggcharbase/CMakeLists.txt @@ -0,0 +1,42 @@ +set(P3EGGCHARBASE_HEADERS + config_eggcharbase.h + eggBackPointer.h + eggCharacterCollection.h eggCharacterCollection.I + eggCharacterData.h eggCharacterData.I + eggCharacterDb.h eggCharacterDb.I + eggCharacterFilter.h + eggComponentData.h eggComponentData.I + eggJointData.h eggJointData.I + eggJointNodePointer.h + eggJointPointer.h eggJointPointer.I + eggMatrixTablePointer.h + eggScalarTablePointer.h + eggSliderData.h eggSliderData.I + eggSliderPointer.h + eggVertexPointer.h +) + +set(P3EGGCHARBASE_SOURCES + config_eggcharbase.cxx + eggBackPointer.cxx + eggCharacterCollection.cxx + eggCharacterData.cxx + eggCharacterDb.cxx + eggCharacterFilter.cxx + eggComponentData.cxx + eggJointData.cxx + eggJointNodePointer.cxx + eggJointPointer.cxx + eggMatrixTablePointer.cxx + eggScalarTablePointer.cxx + eggSliderData.cxx + eggSliderPointer.cxx + eggVertexPointer.cxx +) + +composite_sources(p3eggcharbase P3EGGCHARBASE_SOURCES) +add_library(p3eggcharbase STATIC ${P3EGGCHARBASE_HEADERS} ${P3EGGCHARBASE_SOURCES}) +target_link_libraries(p3eggcharbase p3eggbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/eggprogs/CMakeLists.txt b/pandatool/src/eggprogs/CMakeLists.txt new file mode 100644 index 0000000000..b127796a67 --- /dev/null +++ b/pandatool/src/eggprogs/CMakeLists.txt @@ -0,0 +1,35 @@ +add_executable(egg-crop eggCrop.cxx eggCrop.h) +target_link_libraries(egg-crop p3eggbase) +install(TARGETS egg-crop DESTINATION bin) + +add_executable(egg-list-textures eggListTextures.cxx eggListTextures.h) +target_link_libraries(egg-list-textures p3eggbase) +install(TARGETS egg-list-textures DESTINATION bin) + +add_executable(egg-make-tube eggMakeTube.cxx eggMakeTube.h) +target_link_libraries(egg-make-tube p3eggbase) +install(TARGETS egg-make-tube DESTINATION bin) + +add_executable(egg-rename eggRename.cxx eggRename.h) +target_link_libraries(egg-rename p3eggbase) +install(TARGETS egg-rename DESTINATION bin) + +add_executable(egg-retarget-anim eggRetargetAnim.cxx eggRetargetAnim.h) +target_link_libraries(egg-retarget-anim p3eggcharbase) +install(TARGETS egg-retarget-anim DESTINATION bin) + +add_executable(egg-texture-cards eggTextureCards.cxx eggTextureCards.h) +target_link_libraries(egg-texture-cards p3eggbase) +install(TARGETS egg-texture-cards DESTINATION bin) + +add_executable(egg2c eggToC.cxx eggToC.h) +target_link_libraries(egg2c p3eggbase) +install(TARGETS egg2c DESTINATION bin) + +add_executable(egg-topstrip eggTopstrip.cxx eggTopstrip.h) +target_link_libraries(egg-topstrip p3eggcharbase) +install(TARGETS egg-topstrip DESTINATION bin) + +add_executable(egg-trans eggTrans.cxx eggTrans.h) +target_link_libraries(egg-trans p3eggbase) +install(TARGETS egg-trans DESTINATION bin) diff --git a/pandatool/src/imagebase/CMakeLists.txt b/pandatool/src/imagebase/CMakeLists.txt new file mode 100644 index 0000000000..46ffce3d5c --- /dev/null +++ b/pandatool/src/imagebase/CMakeLists.txt @@ -0,0 +1,20 @@ +set(P3IMAGEBASE_HEADERS + imageBase.h + imageFilter.h + imageReader.h + imageWriter.h imageWriter.I +) + +set(P3IMAGEBASE_SOURCES + imageBase.cxx + imageFilter.cxx + imageReader.cxx + imageWriter.cxx +) + +composite_sources(p3imagebase P3IMAGEBASE_SOURCES) +add_library(p3imagebase STATIC ${P3IMAGEBASE_HEADERS} ${P3IMAGEBASE_SOURCES}) +target_link_libraries(p3imagebase p3progbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/imageprogs/CMakeLists.txt b/pandatool/src/imageprogs/CMakeLists.txt new file mode 100644 index 0000000000..d0f77b99a8 --- /dev/null +++ b/pandatool/src/imageprogs/CMakeLists.txt @@ -0,0 +1,19 @@ +add_executable(image-fix-hidden-color imageFixHiddenColor.cxx imageFixHiddenColor.h) +target_link_libraries(image-fix-hidden-color p3imagebase) +install(TARGETS image-fix-hidden-color DESTINATION bin) + +add_executable(image-info imageInfo.cxx imageInfo.h) +target_link_libraries(image-info p3imagebase) +install(TARGETS image-info DESTINATION bin) + +add_executable(image-resize imageResize.cxx imageResize.h) +target_link_libraries(image-resize p3imagebase) +install(TARGETS image-resize DESTINATION bin) + +add_executable(image-transform-colors imageTransformColors.cxx imageTransformColors.h) +target_link_libraries(image-transform-colors p3imagebase) +install(TARGETS image-transform-colors DESTINATION bin) + +add_executable(image-trans imageTrans.cxx imageTrans.h) +target_link_libraries(image-trans p3imagebase) +install(TARGETS image-trans DESTINATION bin) diff --git a/pandatool/src/lwo/CMakeLists.txt b/pandatool/src/lwo/CMakeLists.txt new file mode 100644 index 0000000000..c7c7f33c35 --- /dev/null +++ b/pandatool/src/lwo/CMakeLists.txt @@ -0,0 +1,69 @@ +set(P3LWO_HEADERS + config_lwo.h + iffChunk.h iffChunk.I + iffGenericChunk.h iffGenericChunk.I + iffId.h iffId.I + iffInputFile.h iffInputFile.I + lwoBoundingBox.h + lwoChunk.h + lwoClip.h + lwoDiscontinuousVertexMap.h + lwoGroupChunk.h + lwoHeader.h lwoHeader.I + lwoInputFile.h lwoInputFile.I + lwoLayer.h + lwoPoints.h + lwoPolygons.h lwoPolygonTags.h + lwoStillImage.h + lwoSurfaceBlockAxis.h lwoSurfaceBlockChannel.h lwoSurfaceBlockCoordSys.h + lwoSurfaceBlockEnabled.h lwoSurfaceBlock.h lwoSurfaceBlockHeader.h + lwoSurfaceBlockImage.h lwoSurfaceBlockOpacity.h lwoSurfaceBlockProjection.h + lwoSurfaceBlockRefObj.h lwoSurfaceBlockRepeat.h lwoSurfaceBlockTMap.h + lwoSurfaceBlockTransform.h lwoSurfaceBlockVMapName.h lwoSurfaceBlockWrap.h + lwoSurfaceColor.h + lwoSurface.h + lwoSurfaceParameter.h + lwoSurfaceSidedness.h + lwoSurfaceSmoothingAngle.h + lwoTags.h + lwoVertexMap.h +) + +set(P3LWO_SOURCES + config_lwo.cxx + iffChunk.cxx + iffGenericChunk.cxx + iffId.cxx + iffInputFile.cxx + lwoBoundingBox.cxx + lwoChunk.cxx + lwoClip.cxx + lwoDiscontinuousVertexMap.cxx + lwoGroupChunk.cxx + lwoHeader.cxx + lwoInputFile.cxx + lwoLayer.cxx + lwoPoints.cxx + lwoPolygons.cxx + lwoPolygonTags.cxx + lwoStillImage.cxx + lwoSurfaceBlockAxis.cxx lwoSurfaceBlockChannel.cxx lwoSurfaceBlockCoordSys.cxx + lwoSurfaceBlock.cxx lwoSurfaceBlockEnabled.cxx lwoSurfaceBlockHeader.cxx + lwoSurfaceBlockImage.cxx lwoSurfaceBlockOpacity.cxx lwoSurfaceBlockProjection.cxx + lwoSurfaceBlockRefObj.cxx lwoSurfaceBlockRepeat.cxx lwoSurfaceBlockTMap.cxx + lwoSurfaceBlockTransform.cxx lwoSurfaceBlockVMapName.cxx lwoSurfaceBlockWrap.cxx + lwoSurfaceColor.cxx + lwoSurface.cxx + lwoSurfaceParameter.cxx + lwoSurfaceSidedness.cxx + lwoSurfaceSmoothingAngle.cxx + lwoTags.cxx + lwoVertexMap.cxx +) + +composite_sources(p3lwo P3LWO_SOURCES) +add_library(p3lwo STATIC ${P3LWO_HEADERS} ${P3LWO_SOURCES}) +target_link_libraries(p3lwo p3pandatoolbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/lwoegg/CMakeLists.txt b/pandatool/src/lwoegg/CMakeLists.txt new file mode 100644 index 0000000000..da4d156bdc --- /dev/null +++ b/pandatool/src/lwoegg/CMakeLists.txt @@ -0,0 +1,27 @@ +set(P3LWOEGG_HEADERS + cLwoClip.h cLwoClip.I + cLwoLayer.h cLwoLayer.I + cLwoPoints.h cLwoPoints.I + cLwoPolygons.h cLwoPolygons.I + cLwoSurfaceBlock.h cLwoSurfaceBlock.I + cLwoSurfaceBlockTMap.h cLwoSurfaceBlockTMap.I + cLwoSurface.h cLwoSurface.I + lwoToEggConverter.h lwoToEggConverter.I +) + +set(P3LWOEGG_SOURCES + cLwoClip.cxx + cLwoLayer.cxx + cLwoPoints.cxx + cLwoPolygons.cxx + cLwoSurfaceBlock.cxx + cLwoSurfaceBlockTMap.cxx + cLwoSurface.cxx + lwoToEggConverter.cxx +) + +add_library(p3lwoegg STATIC ${P3LWOEGG_HEADERS} ${P3LWOEGG_SOURCES}) +target_link_libraries(p3lwoegg p3lwo p3eggbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/lwoprogs/CMakeLists.txt b/pandatool/src/lwoprogs/CMakeLists.txt new file mode 100644 index 0000000000..9232882376 --- /dev/null +++ b/pandatool/src/lwoprogs/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(lwo-scan lwoScan.cxx lwoScan.h) +target_link_libraries(lwo-scan p3progbase p3lwo) +install(TARGETS lwo-scan DESTINATION bin) + +add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h) +target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase) +install(TARGETS lwo2egg DESTINATION bin) diff --git a/pandatool/src/miscprogs/CMakeLists.txt b/pandatool/src/miscprogs/CMakeLists.txt new file mode 100644 index 0000000000..c3964de618 --- /dev/null +++ b/pandatool/src/miscprogs/CMakeLists.txt @@ -0,0 +1,3 @@ +add_executable(bin2c binToC.cxx binToC.h) +target_link_libraries(bin2c p3progbase) +install(TARGETS bin2c DESTINATION bin) diff --git a/pandatool/src/objegg/CMakeLists.txt b/pandatool/src/objegg/CMakeLists.txt new file mode 100644 index 0000000000..839c176be8 --- /dev/null +++ b/pandatool/src/objegg/CMakeLists.txt @@ -0,0 +1,19 @@ +set(P3OBJEGG_HEADERS + config_objegg.h + eggToObjConverter.h + objToEggConverter.h + objToEggConverter.I +) + +set(P3OBJEGG_SOURCES + config_objegg.cxx + eggToObjConverter.cxx + objToEggConverter.cxx +) + +composite_sources(p3objegg P3OBJEGG_SOURCES) +add_library(p3objegg STATIC ${P3OBJEGG_HEADERS} ${P3OBJEGG_SOURCES}) +target_link_libraries(p3objegg p3eggbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/objprogs/CMakeLists.txt b/pandatool/src/objprogs/CMakeLists.txt new file mode 100644 index 0000000000..47fbbc058a --- /dev/null +++ b/pandatool/src/objprogs/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(egg2obj eggToObj.cxx eggToObj.h) +target_link_libraries(egg2obj p3objegg p3eggbase) +install(TARGETS egg2obj DESTINATION bin) + +add_executable(obj2egg objToEgg.cxx objToEgg.h) +target_link_libraries(obj2egg p3objegg p3eggbase p3progbase) +install(TARGETS obj2egg DESTINATION bin) diff --git a/pandatool/src/palettizer/CMakeLists.txt b/pandatool/src/palettizer/CMakeLists.txt new file mode 100644 index 0000000000..17eed82416 --- /dev/null +++ b/pandatool/src/palettizer/CMakeLists.txt @@ -0,0 +1,56 @@ +set(P3PALETTIZER_HEADERS + config_palettizer.h + destTextureImage.h + eggFile.h + filenameUnifier.h + imageFile.h + omitReason.h + paletteGroup.h + paletteGroups.h + paletteImage.h + palettePage.h + palettizer.h + pal_string_utils.h + sourceTextureImage.h + textureImage.h + textureMemoryCounter.h + texturePlacement.h + texturePosition.h + textureProperties.h + textureReference.h + textureRequest.h + txaFile.h + txaLine.h +) + +set(P3PALETTIZER_SOURCES + config_palettizer.cxx + destTextureImage.cxx + eggFile.cxx + filenameUnifier.cxx + imageFile.cxx + omitReason.cxx + paletteGroup.cxx + paletteGroups.cxx + paletteImage.cxx + palettePage.cxx + palettizer.cxx + pal_string_utils.cxx + sourceTextureImage.cxx + textureImage.cxx + textureMemoryCounter.cxx + texturePlacement.cxx + texturePosition.cxx + textureProperties.cxx + textureReference.cxx + textureRequest.cxx + txaFile.cxx + txaLine.cxx +) + +composite_sources(p3palettizer P3PALETTIZER_SOURCES) +add_library(p3palettizer STATIC ${P3PALETTIZER_HEADERS} ${P3PALETTIZER_SOURCES}) +target_link_libraries(p3palettizer p3progbase p3converter) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/pandatoolbase/CMakeLists.txt b/pandatool/src/pandatoolbase/CMakeLists.txt index 7e615b2d0b..93d9aae35e 100644 --- a/pandatool/src/pandatoolbase/CMakeLists.txt +++ b/pandatool/src/pandatoolbase/CMakeLists.txt @@ -20,5 +20,12 @@ composite_sources(p3pandatoolbase P3PANDATOOLBASE_SOURCES) add_library(p3pandatoolbase STATIC ${P3PANDATOOLBASE_HEADERS} ${P3PANDATOOLBASE_SOURCES}) target_link_libraries(p3pandatoolbase panda) +# ptloader - a module - may need to link in libraries in this package, so: +if(MODULE_TYPE STREQUAL "MODULE") + set_target_properties(p3pandatoolbase PROPERTIES + POSITION_INDEPENDENT_CODE ON + INTERFACE_POSITION_INDEPENDENT_CODE ON) +endif() + # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. diff --git a/pandatool/src/pfmprogs/CMakeLists.txt b/pandatool/src/pfmprogs/CMakeLists.txt new file mode 100644 index 0000000000..0b5bad8978 --- /dev/null +++ b/pandatool/src/pfmprogs/CMakeLists.txt @@ -0,0 +1,9 @@ +add_executable(pfm-bba + config_pfmprogs.cxx config_pfmprogs.h + pfmBba.cxx pfmBba.h) +target_link_libraries(pfm-bba p3progbase) +install(TARGETS pfm-bba DESTINATION bin) + +add_executable(pfm-trans pfmTrans.cxx pfmTrans.h) +target_link_libraries(pfm-trans p3progbase) +install(TARGETS pfm-trans DESTINATION bin) diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt new file mode 100644 index 0000000000..c3335c37d4 --- /dev/null +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -0,0 +1,18 @@ +set(P3PTLOADER_HEADERS + config_ptloader.h + loaderFileTypePandatool.h +) + +set(P3PTLOADER_SOURCES + config_ptloader.cxx + loaderFileTypePandatool.cxx +) + +composite_sources(p3ptloader P3PTLOADER_SOURCES) +add_library(p3ptloader ${MODULE_TYPE} ${P3PTLOADER_HEADERS} ${P3PTLOADER_SOURCES}) +set_target_properties(p3ptloader PROPERTIES DEFINE_SYMBOL BUILDING_PTLOADER) +target_link_libraries(p3ptloader + p3dxfegg p3fltegg p3lwoegg p3objegg p3vrmlegg p3xfileegg + p3converter) + +install(TARGETS p3ptloader DESTINATION ${MODULE_DESTINATION}) diff --git a/pandatool/src/vrml/CMakeLists.txt b/pandatool/src/vrml/CMakeLists.txt new file mode 100644 index 0000000000..0e0b410659 --- /dev/null +++ b/pandatool/src/vrml/CMakeLists.txt @@ -0,0 +1,30 @@ +add_bison_target(vrmlParser.cxx vrmlParser.yxx DEFINES vrmlParser.h PREFIX vrmlyy) +add_flex_target(vrmlLexer.cxx vrmlLexer.lxx CASE_INSENSITIVE PREFIX vrmlyy) + +set(P3VRML_HEADERS + parse_vrml.h + standard_nodes.h + vrmlLexerDefs.h + vrmlNode.h + vrmlNodeType.h + vrmlParserDefs.h +) + +set(P3VRML_SOURCES + parse_vrml.cxx + standard_nodes.cxx + vrmlNode.cxx + vrmlNodeType.cxx +) + +set(P3VRML_PARSER_SOURCES + vrmlParser.cxx + vrmlLexer.cxx +) + +composite_sources(p3vrml P3VRML_SOURCES) +add_library(p3vrml STATIC ${P3VRML_HEADERS} ${P3VRML_SOURCES} ${P3VRML_PARSER_SOURCES}) +target_link_libraries(p3vrml p3pandatoolbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/vrmlegg/CMakeLists.txt b/pandatool/src/vrmlegg/CMakeLists.txt new file mode 100644 index 0000000000..621aa1a852 --- /dev/null +++ b/pandatool/src/vrmlegg/CMakeLists.txt @@ -0,0 +1,18 @@ +set(P3VRMLEGG_HEADERS + indexedFaceSet.h + vrmlAppearance.h + vrmlToEggConverter.h +) + +set(P3VRMLEGG_SOURCES + indexedFaceSet.cxx + vrmlAppearance.cxx + vrmlToEggConverter.cxx +) + +composite_sources(p3vrmlegg P3VRMLEGG_SOURCES) +add_library(p3vrmlegg STATIC ${P3VRMLEGG_HEADERS} ${P3VRMLEGG_SOURCES}) +target_link_libraries(p3vrmlegg p3vrml p3eggbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/vrmlprogs/CMakeLists.txt b/pandatool/src/vrmlprogs/CMakeLists.txt new file mode 100644 index 0000000000..0657671d51 --- /dev/null +++ b/pandatool/src/vrmlprogs/CMakeLists.txt @@ -0,0 +1,7 @@ +add_executable(vrml-trans vrmlTrans.cxx vrmlTrans.h) +target_link_libraries(vrml-trans p3progbase p3vrml) +install(TARGETS vrml-trans DESTINATION bin) + +add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h) +target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase) +install(TARGETS vrml2egg DESTINATION bin) diff --git a/pandatool/src/xfile/CMakeLists.txt b/pandatool/src/xfile/CMakeLists.txt new file mode 100644 index 0000000000..597cb1eb58 --- /dev/null +++ b/pandatool/src/xfile/CMakeLists.txt @@ -0,0 +1,56 @@ +add_bison_target(xParser.cxx xParser.yxx DEFINES xParser.h PREFIX xyy) +add_flex_target(xLexer.cxx xLexer.lxx CASE_INSENSITIVE PREFIX xyy) + +set(P3XFILE_HEADERS + config_xfile.h + standard_templates.h + windowsGuid.h windowsGuid.I + xFileArrayDef.h xFileArrayDef.I + xFileDataDef.h xFileDataDef.I + xFileDataNode.h xFileDataNode.I + xFileDataNodeReference.h xFileDataNodeReference.I + xFileDataNodeTemplate.h xFileDataNodeTemplate.I + xFileDataObjectArray.h xFileDataObjectArray.I + xFileDataObjectDouble.h xFileDataObjectDouble.I + xFileDataObject.h xFileDataObject.I + xFileDataObjectInteger.h xFileDataObjectInteger.I + xFileDataObjectString.h xFileDataObjectString.I + xFile.h xFile.I + xFileNode.h xFileNode.I + xFileParseData.h xFileParseData.I + xFileTemplate.h xFileTemplate.I + xLexerDefs.h + xParserDefs.h +) + +set(P3XFILE_SOURCES + config_xfile.cxx + standard_templates.cxx + windowsGuid.cxx + xFileArrayDef.cxx + xFile.cxx + xFileDataDef.cxx + xFileDataNode.cxx + xFileDataNodeReference.cxx + xFileDataNodeTemplate.cxx + xFileDataObjectArray.cxx + xFileDataObject.cxx + xFileDataObjectDouble.cxx + xFileDataObjectInteger.cxx + xFileDataObjectString.cxx + xFileNode.cxx + xFileParseData.cxx + xFileTemplate.cxx +) + +set(P3XFILE_PARSER_SOURCES + xParser.cxx + xLexer.cxx +) + +composite_sources(p3xfile P3XFILE_SOURCES) +add_library(p3xfile STATIC ${P3XFILE_HEADERS} ${P3XFILE_SOURCES} ${P3XFILE_PARSER_SOURCES}) +target_link_libraries(p3xfile p3pandatoolbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/xfileegg/CMakeLists.txt b/pandatool/src/xfileegg/CMakeLists.txt new file mode 100644 index 0000000000..606079e539 --- /dev/null +++ b/pandatool/src/xfileegg/CMakeLists.txt @@ -0,0 +1,22 @@ +set(P3XFILEEGG_HEADERS + xFileAnimationSet.h xFileAnimationSet.I + xFileFace.h xFileMaker.h + xFileMaterial.h xFileMesh.h xFileNormal.h + xFileToEggConverter.h + xFileVertex.h xFileVertexPool.h +) + +set(P3XFILEEGG_SOURCES + xFileAnimationSet.cxx + xFileFace.cxx xFileMaker.cxx + xFileMaterial.cxx xFileMesh.cxx xFileNormal.cxx + xFileToEggConverter.cxx + xFileVertex.cxx +) + +composite_sources(p3xfileegg P3XFILEEGG_SOURCES) +add_library(p3xfileegg STATIC ${P3XFILEEGG_HEADERS} ${P3XFILEEGG_SOURCES}) +target_link_libraries(p3xfileegg p3xfile p3eggbase) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/xfileprogs/CMakeLists.txt b/pandatool/src/xfileprogs/CMakeLists.txt new file mode 100644 index 0000000000..907ebea1ee --- /dev/null +++ b/pandatool/src/xfileprogs/CMakeLists.txt @@ -0,0 +1,11 @@ +add_executable(egg2x eggToX.cxx eggToX.h) +target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase) +install(TARGETS egg2x DESTINATION bin) + +add_executable(x-trans xFileTrans.cxx xFileTrans.h) +target_link_libraries(x-trans p3progbase p3xfile) +install(TARGETS x-trans DESTINATION bin) + +add_executable(x2egg xFileToEgg.cxx xFileToEgg.h) +target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase) +install(TARGETS x2egg DESTINATION bin) From 7c42b75ac88c35790377205460ea9d0c0b853845 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 1 Nov 2018 15:56:16 -0600 Subject: [PATCH 537/744] CMake: Update FindCg to discover cgD3D9 This also means renaming "CGDX9" to "CGD3D9" for consistency with what Nvidia calls it. --- cmake/modules/FindCg.cmake | 58 +++++++++++++++++++++++++++----------- dtool/Package.cmake | 10 +++---- 2 files changed, 46 insertions(+), 22 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index f7c43884a2..a6636a67a1 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -42,7 +42,7 @@ macro(find_cggl) # Find the library directory find_library(CGGL_LIBRARY - NAMES "CgGL" "libCgGL" + NAMES "cgGL" "libCgGL" PATHS "C:/Program Files/Cg" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" @@ -66,21 +66,48 @@ macro(find_cggl) endmacro() -# Find Cg for DirectX 8 -macro(find_cgdx8) - # TODO: Implement -endmacro() +# Find Cg for Direct3D 9 +macro(find_cgd3d9) + if(Cg_FIND_QUIETLY) + set(CgD3D9_FIND_QUIETLY TRUE) + endif() + if(NOT CGD3D9_LIBRARY_DIR OR NOT CGD3D9_INCLUDE_DIR) + # Find the include directory + find_path(CGD3D9_INCLUDE_DIR + NAMES "cgD3D9.h" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg/include" + "/usr/include" + "/usr/local/include" + "/opt/Cg" + "/opt/nvidia-cg-toolkit/include" # Gentoo + PATH_SUFFIXES "" "Cg" "cg" + DOC "The path to NvidiaCgD3D9's include directory." + ) + # Find the library directory + find_library(CGD3D9_LIBRARY + NAMES "cgD3D9" "libCgD3D9" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg" + "/usr" + "/usr/lib/x86_64-linux-gnu" + "/usr/local" + "/opt/Cg" + "/opt/nvidia-cg-toolkit" # Gentoo + PATH_SUFFIXES "" "lib" "lib32" "lib64" + DOC "The filepath to NvidiaCgD3D9's libary binary." + ) + get_filename_component(CGD3D9_LIBRARY_DIR "${CGD3D9_LIBRARY}" PATH) + set(CGD3D9_LIBRARY_DIR "${CGD3D9_LIBRARY_DIR}" CACHE PATH "The path to the CgD3D9 library directory.") # Library path -# Find Cg for DirectX 9 -macro(find_cgdx9) - # TODO: Implement -endmacro() + mark_as_advanced(CGD3D9_INCLUDE_DIR) + mark_as_advanced(CGD3D9_LIBRARY_DIR) + mark_as_advanced(CGD3D9_LIBRARY) + endif() + find_package_handle_standard_args(CgD3D9 DEFAULT_MSG CGD3D9_LIBRARY CGD3D9_INCLUDE_DIR CGD3D9_LIBRARY_DIR) -# Find Cg for DirectX 10 -macro(find_cgdx10) - # TODO: Implement endmacro() @@ -155,11 +182,8 @@ find_package_handle_standard_args(Cg DEFAULT_MSG CG_LIBRARY CG_INCLUDE_DIRS CG_L if(CG_INCLUDE_DIR AND CG_LIBRARY_DIR) find_cggl() - find_cgdx8() - find_cgdx9() - find_cgdx10() + find_cgd3d9() - set(CG_LIBRARIES ${CG_LIBRARY} ${CGGL_LIBRARY} - ${CGDX8_LIBRARY} ${CGDX9_LIBRARY} ${CGDX10_LIBRARY}) + set(CG_LIBRARIES ${CG_LIBRARY} ${CGGL_LIBRARY} ${CGD3D9_LIBRARY}) mark_as_advanced(CG_LIBRARIES) endif() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index eae931ce75..cb570d701b 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -196,16 +196,16 @@ package_option(CG package_option(CGGL "Enable support for Nvidia Cg's OpenGL API." LICENSE "Nvidia") -package_option(CGDX9 - "Enable support for Nvidia Cg's DirectX 9 API." +package_option(CGD3D9 + "Enable support for Nvidia Cg's Direct3D 9 API." LICENSE "Nvidia") -if(HAVE_CGGL AND HAVE_CGDX9) - set(cg_apis "supporting OpenGL and DirectX 9") +if(HAVE_CGGL AND HAVE_CGD3D9) + set(cg_apis "supporting OpenGL and Direct3D 9") elseif(HAVE_CGGL) set(cg_apis "supporting OpenGL") elseif(HAVE_CGDX9) - set(cg_apis "supporting DirectX 9") + set(cg_apis "supporting Direct3D 9") else() set(cg_apis "WITHOUT rendering backend support") endif() From f7b59f6e5539dae66785ea34b6cd4f19ea24b531 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 1 Nov 2018 15:57:47 -0600 Subject: [PATCH 538/744] CMake: Fix pandatool/p3txafile build error on Windows Need to define BUILDING_MISC for p3txafile so that it can be properly exported. --- pandatool/src/egg-palettize/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 5ed61c6cca..81e7da0ace 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -3,5 +3,6 @@ target_link_libraries(egg-palettize p3palettizer p3eggbase p3progbase) install(TARGETS egg-palettize DESTINATION bin) add_library(p3txafile txaFileFilter.cxx txaFileFilter.h txaFileFilter.I) +set_target_properties(p3txafile PROPERTIES DEFINE_SYMBOL BUILDING_MISC) target_link_libraries(p3txafile p3palettizer) install(TARGETS p3txafile DESTINATION lib RUNTIME DESTINATION bin) From 5b973ed8371ae014377aa829b3bf1c1a467a4529 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 1 Nov 2018 21:51:26 -0600 Subject: [PATCH 539/744] CMake: Add DirectX 9 support --- cmake/modules/FindDirect3D9.cmake | 104 +++++++++++++++++++++++++ dtool/LocalSetup.cmake | 6 -- dtool/Package.cmake | 18 +++-- panda/CMakeLists.txt | 2 + panda/metalibs/pandadx9/CMakeLists.txt | 9 +++ panda/src/dxgsg9/CMakeLists.txt | 48 ++++++++++++ 6 files changed, 175 insertions(+), 12 deletions(-) create mode 100644 cmake/modules/FindDirect3D9.cmake create mode 100644 panda/metalibs/pandadx9/CMakeLists.txt create mode 100644 panda/src/dxgsg9/CMakeLists.txt diff --git a/cmake/modules/FindDirect3D9.cmake b/cmake/modules/FindDirect3D9.cmake new file mode 100644 index 0000000000..4752150b4b --- /dev/null +++ b/cmake/modules/FindDirect3D9.cmake @@ -0,0 +1,104 @@ +# Filename: FindDirect3D9.cmake +# Authors: CFSworks (26 Oct, 2018) +# +# Usage: +# find_package(Direct3D9 [REQUIRED] [QUIET]) +# +# This supports the following components: +# d3dx9 +# dxerr +# dxguid +# +# Once done this will define: +# DIRECT3D9_FOUND - system has Direct3D 9.x +# DIRECT3D9_INCLUDE_DIR - the include directory containing d3d9.h - note that +# this will be empty if it's part of the Windows SDK. +# DIRECT3D9_LIBRARY - the path to d3d9.lib +# DIRECT3D9_LIBRARIES - the path to d3d9.lib and all extra component +# libraries +# + +include(CheckIncludeFile) + +if(Direct3D9_FIND_QUIETLY) + if(DEFINED CMAKE_REQUIRED_QUIET) + set(_OLD_CMAKE_REQUIRED_QUIET ${CMAKE_REQUIRED_QUIET}) + endif() + # Suppress check_include_file messages + set(CMAKE_REQUIRED_QUIET ON) +endif() + +check_include_file("d3d9.h" SYSTEM_INCLUDE_D3D9_H) +mark_as_advanced(SYSTEM_INCLUDE_D3D9_H) + +if(Direct3D9_FIND_QUIETLY) + if(DEFINED _OLD_CMAKE_REQUIRED_QUIET) + set(CMAKE_REQUIRED_QUIET ${_OLD_CMAKE_REQUIRED_QUIET}) + unset(_OLD_CMAKE_REQUIRED_QUIET) + else() + unset(CMAKE_REQUIRED_QUIET) + endif() +endif() + +if(SYSTEM_INCLUDE_D3D9_H + AND NOT Direct3D9_FIND_REQUIRED_d3dx9 + AND NOT Direct3D9_FIND_REQUIRED_dxerr) + # It's available as #include - easy enough. We'll use "." as a way + # of saying "We found it, but please erase this variable later." + set(DIRECT3D9_INCLUDE_DIR ".") + + # Since d3d9.h is on the search path, we can pretty much assume d3d9.lib is + # as well. + set(DIRECT3D9_LIBRARY "d3d9.lib") + + # And dxguid.lib, why not + set(DIRECT3D9_dxguid_LIBRARY "dxguid.lib") + +else() + # We could not find it easily - maybe it's installed separately as part of + # the DirectX SDK? + + find_path(DIRECT3D9_INCLUDE_DIR + NAMES d3d9.h + PATHS "$ENV{DXSDK_DIR}/Include") + + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(dx_lib_path "$ENV{DXSDK_DIR}/Lib/x64/") + else() + set(dx_lib_path "$ENV{DXSDK_DIR}/Lib/x86/") + endif() + + find_library(DIRECT3D9_LIBRARY d3d9 "${dx_lib_path}" NO_DEFAULT_PATH) + + find_library(DIRECT3D9_d3dx9_LIBRARY d3dx9 "${dx_lib_path}" NO_DEFAULT_PATH) + find_library(DIRECT3D9_dxerr_LIBRARY dxerr "${dx_lib_path}" NO_DEFAULT_PATH) + find_library(DIRECT3D9_dxguid_LIBRARY dxguid "${dx_lib_path}" NO_DEFAULT_PATH) + + unset(dx_lib_path) +endif() + +mark_as_advanced(DIRECT3D9_INCLUDE_DIR DIRECT3D9_LIBRARY) +set(DIRECT3D9_LIBRARIES "${DIRECT3D9_LIBRARY}") + +foreach(_component d3dx9 dxerr dxguid) + if(DIRECT3D9_${_component}_LIBRARY) + set(Direct3D9_${_component}_FOUND ON) + list(FIND Direct3D9_FIND_COMPONENTS "${_component}" _index) + if(${_index} GREATER -1) + list(APPEND DIRECT3D9_LIBRARIES "${DIRECT3D9_${_component}_LIBRARY}") + endif() + unset(_index) + endif() +endforeach(_component) +unset(_component) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Direct3D9 HANDLE_COMPONENTS + REQUIRED_VARS DIRECT3D9_INCLUDE_DIR DIRECT3D9_LIBRARY DIRECT3D9_LIBRARIES) + +# See above - if we found the include as part of the system path, we don't want +# to actually modify the include search path, but we need a non-empty string to +# satisfy find_package_handle_standard_args() +if(DIRECT3D9_INCLUDE_DIR STREQUAL ".") + set(DIRECT3D9_INCLUDE_DIR "") +endif() diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 36727adba9..88fdd89b54 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -155,12 +155,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_DX9) - message("+ DirectX9") -else() - message("- Did not find DirectX9") -endif() - if(HAVE_TINYDISPLAY) message("+ Tinydisplay") else() diff --git a/dtool/Package.cmake b/dtool/Package.cmake index cb570d701b..65bec54b4e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -427,9 +427,9 @@ if(HAVE_GLX AND NOT HAVE_GLX_AVAILABLE) endif() if(HAVE_GLX) - config_package(X11 "X11 (with GLX)") + config_package(X11 "X11" "with GLX") else() - config_package(X11 "X11 (without GLX)") + config_package(X11 "X11" "without GLX") endif() # EGL @@ -441,14 +441,20 @@ package_option(EGL config_package(EGL "EGL") +# Direct3D 9 + +find_package(Direct3D9 QUIET COMPONENTS dxguid dxerr d3dx9) + +package_option(DX9 + "Enable support for DirectX 9. This is typically only viable on Windows." + FOUND_AS DIRECT3D9) + +config_package(DX9 "Direct3D 9.x") + ######## # TODO # ######## -# Find and configure DirectX 9 -#find_package(DX9) -#config_package(DX9 COMMENT "DirectX9") - # Find and configure OpenCV #find_package(OpenCV) #config_package(OPENCV COMMENT "OpenCV") diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 3f0eb57e7d..afa730ed8e 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -16,6 +16,7 @@ add_subdirectory(src/dgraph) add_subdirectory(src/display) add_subdirectory(src/downloader) add_subdirectory(src/downloadertools) +add_subdirectory(src/dxgsg9) add_subdirectory(src/dxml) add_subdirectory(src/egg) add_subdirectory(src/egg2pg) @@ -68,6 +69,7 @@ add_subdirectory(src/physics) # Include panda metalibs add_subdirectory(metalibs/panda) +add_subdirectory(metalibs/pandadx9) add_subdirectory(metalibs/pandaegg) add_subdirectory(metalibs/pandaexpress) add_subdirectory(metalibs/pandagl) diff --git a/panda/metalibs/pandadx9/CMakeLists.txt b/panda/metalibs/pandadx9/CMakeLists.txt new file mode 100644 index 0000000000..92eeb1dc45 --- /dev/null +++ b/panda/metalibs/pandadx9/CMakeLists.txt @@ -0,0 +1,9 @@ +if(NOT HAVE_DX9) + return() +endif() + +add_metalib(pandadx9 ${MODULE_TYPE} pandadx9.cxx + COMPONENTS p3dxgsg9) +set_target_properties(pandadx9 PROPERTIES DEFINE_SYMBOL BUILDING_PANDADX) + +install(TARGETS pandadx9 DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt new file mode 100644 index 0000000000..1db30265a9 --- /dev/null +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -0,0 +1,48 @@ +if(NOT HAVE_DX9) + return() +endif() + +set(P3DXGSG9_HEADERS + config_dxgsg9.h + dxGeomMunger9.h dxGeomMunger9.I + dxGraphicsDevice9.h + dxGraphicsStateGuardian9.h dxGraphicsStateGuardian9.I + dxgsg9base.h + dxIndexBufferContext9.h dxIndexBufferContext9.I + dxOcclusionQueryContext9.h dxOcclusionQueryContext9.I + dxShaderContext9.h dxShaderContext9.I + dxTextureContext9.h dxTextureContext9.I + dxVertexBufferContext9.h dxVertexBufferContext9.I + vertexElementArray.h + wdxGraphicsBuffer9.h wdxGraphicsBuffer9.I + wdxGraphicsPipe9.h wdxGraphicsPipe9.I + wdxGraphicsWindow9.h wdxGraphicsWindow9.I +) + +set(P3DXGSG9_SOURCES + config_dxgsg9.cxx + dxGeomMunger9.cxx + dxGraphicsDevice9.cxx + dxGraphicsStateGuardian9.cxx + dxIndexBufferContext9.cxx + dxOcclusionQueryContext9.cxx + dxShaderContext9.cxx + dxTextureContext9.cxx + dxVertexBufferContext9.cxx + vertexElementArray.cxx + wdxGraphicsBuffer9.cxx + wdxGraphicsPipe9.cxx + wdxGraphicsWindow9.cxx +) + +composite_sources(p3dxgsg9 P3DXGSG9_SOURCES) +add_component_library(p3dxgsg9 SYMBOL BUILDING_PANDADX + ${P3DXGSG9_HEADERS} ${P3DXGSG9_SOURCES}) +target_link_libraries(p3dxgsg9 p3windisplay panda + PKG::CG PKG::DX9) +target_compile_definitions(p3dxgsg9 PRIVATE USE_GENERIC_DXERR_LIBRARY) # FIXME + +if(NOT BUILD_METALIBS) + install(TARGETS p3dxgsg9 DESTINATION lib RUNTIME DESTINATION bin) +endif() +install(FILES ${P3DXGSG9_HEADERS} DESTINATION include/panda3d) From 7de4b39f6eee928baf96e752353e45b01016e161 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 2 Nov 2018 01:10:25 -0600 Subject: [PATCH 540/744] CMake: Put generated Interrogate files under the right build directory That is, they should appear under the build directory of the component library they're Interrogating; this is just an organizational change to keep the cmake/panda/ directory from accumulating Interrogate clutter. --- cmake/macros/Interrogate.cmake | 39 ++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index edb4a1eee2..31c2e480e6 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -100,8 +100,14 @@ function(target_interrogate target) # relative to it, thereby shortening the command-line even more. # Since this is not an Interrogate-specific property, it is not named with # an IGATE_ prefix. - set_target_properties("${target}" PROPERTIES TARGET_SRCDIR - "${CMAKE_CURRENT_SOURCE_DIR}") + set_target_properties("${target}" PROPERTIES + TARGET_SRCDIR "${CMAKE_CURRENT_SOURCE_DIR}") + + # Also store where the build files are kept, so the Interrogate output can go + # there as well. + set_target_properties("${target}" PROPERTIES + TARGET_BINDIR "${CMAKE_CURRENT_BINARY_DIR}") + endfunction(target_interrogate) # @@ -248,6 +254,7 @@ function(add_python_module module) set(import_flags) set(infiles) set(sources) + set(extensions) set(link_keyword OFF) set(import_keyword OFF) @@ -272,11 +279,22 @@ function(add_python_module module) endif() foreach(target ${targets}) - interrogate_sources(${target} "${target}_igate.cxx" "${target}.in" + get_target_property(workdir "${target}" TARGET_BINDIR) + if(NOT workdir) + # No TARGET_BINDIR was set, so we'll just use our current directory: + set(workdir "${CMAKE_CURRENT_BINARY_DIR}") + endif() + # Keep command lines short + file(RELATIVE_PATH workdir "${CMAKE_CURRENT_BINARY_DIR}" "${workdir}") + + interrogate_sources(${target} + "${workdir}/${target}_igate.cxx" "${workdir}/${target}.in" "-python-native;-module;panda3d.${module}") + get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) - list(APPEND infiles "${target}.in") - list(APPEND sources "${target}_igate.cxx" ${target_extensions}) + list(APPEND infiles "${workdir}/${target}.in") + list(APPEND sources "${workdir}/${target}_igate.cxx") + list(APPEND extensions ${target_extensions}) endforeach(target) add_custom_command( @@ -291,23 +309,22 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - add_python_target(panda3d.${module} "${module}_module.cxx" ${sources}) + add_python_target(panda3d.${module} "${module}_module.cxx" ${sources} ${extensions}) target_link_libraries(panda3d.${module} ${link_targets} p3igateruntime) if(CMAKE_VERSION VERSION_LESS "3.11") # CMake <3.11 doesn't allow generator expressions on source files, so we # need to copy them to our target, which does allow them. - foreach(target ${targets}) - set(igate_file "${target}_igate.cxx") - get_source_file_property(compile_definitions "${igate_file}" COMPILE_DEFINITIONS) + foreach(source ${sources}) + get_source_file_property(compile_definitions "${source}" COMPILE_DEFINITIONS) if(compile_definitions) set_property(TARGET panda3d.${module} APPEND PROPERTY COMPILE_DEFINITIONS ${compile_definitions}) - set_source_files_properties("${igate_file}" PROPERTIES COMPILE_DEFINITIONS "") + set_source_files_properties("${source}" PROPERTIES COMPILE_DEFINITIONS "") endif() - endforeach(target) + endforeach(source) endif() list(APPEND ALL_INTERROGATE_MODULES "${module}") From f701e36aa51416735b5a96c2ba5d352f472f1a69 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 2 Nov 2018 21:08:00 -0600 Subject: [PATCH 541/744] CMake: Detect VRPN and build support for it when present I inadvertently rewrote FindVRPN.cmake doing this - I didn't think to check if it already existed before overwriting. Oh well, the new version is a bit simpler. --- cmake/modules/FindVRPN.cmake | 48 +++++++++++------------------------ panda/CMakeLists.txt | 5 ++++ panda/src/vrpn/CMakeLists.txt | 39 ++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 33 deletions(-) create mode 100644 panda/src/vrpn/CMakeLists.txt diff --git a/cmake/modules/FindVRPN.cmake b/cmake/modules/FindVRPN.cmake index 759cbbf2a8..19d205547c 100644 --- a/cmake/modules/FindVRPN.cmake +++ b/cmake/modules/FindVRPN.cmake @@ -1,45 +1,27 @@ # Filename: FindVRPN.cmake -# Author: kestred (29 Nov, 2013) +# Authors: CFSworks (2 Nov, 2018) # # Usage: # find_package(VRPN [REQUIRED] [QUIET]) # -# It sets the following variables: -# VRPN_FOUND - system has libvrpn -# VRPN_INCLUDE_DIR - the vrpn include directory -# VRPN_LIBRARY_DIR - the vrpn library directory -# VRPN_LIBRARY - the path to the library binary +# Once done this will define: +# VRPN_FOUND - system has VRPN +# VRPN_INCLUDE_DIR - the include directory containing VRPN header files +# VRPN_LIBRARY - the path to the VRPN client library # -if(VRPN_INCLUDE_DIR AND VRPN_LIBRARY_DIR) - set(FOUND_VRPN TRUE) -else() - # Find the vrpn include files - find_path(VRPN_INCLUDE_DIR - NAMES "vrpn_Keyboard.h" - PATHS "/usr/include" - "/usr/local/include" - "/opt/vrpn/include" - PATH_SUFFIXES "" "vrpn" - DOC "The path to vrpn's include directory." - ) +if(NOT VRPN_INCLUDE_DIR) + find_path(VRPN_INCLUDE_DIR "vrpn_Connection.h") - # Find the libvrpn library (.a, .so) - find_library(VRPN_LIBRARY - NAMES "vrpn" - "libvrpn" - PATHS "/usr" - "/usr/local" - "/opt/vrpn" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) - get_filename_component(VRPN_LIBRARY_DIR "${VRPN_LIBRARY}" PATH) - set(VRPN_LIBRARY_DIR "${VRPN_LIBRARY_DIR}" CACHE PATH "The path to vrpn's library directory.") # Library path + mark_as_advanced(VRPN_INCLUDE_DIR) +endif() - mark_as_advanced(VRPN_INCLUDE_DIR) - mark_as_advanced(VRPN_LIBRARY_DIR) - mark_as_advanced(VRPN_LIBRARY) +if(NOT VRPN_LIBRARY) + find_library(VRPN_LIBRARY + NAMES "vrpn") + + mark_as_advanced(VRPN_LIBRARY) endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_LIBRARY VRPN_INCLUDE_DIR VRPN_LIBRARY_DIR) +find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_INCLUDE_DIR VRPN_LIBRARY) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index afa730ed8e..bf75353f97 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -54,6 +54,7 @@ add_subdirectory(src/recorder) add_subdirectory(src/testbed) add_subdirectory(src/text) add_subdirectory(src/tform) +add_subdirectory(src/vrpn) add_subdirectory(src/wgldisplay) add_subdirectory(src/windisplay) add_subdirectory(src/x11display) @@ -108,4 +109,8 @@ if(HAVE_PYTHON) if(HAVE_ODE) add_python_module(ode p3ode IMPORT panda3d.core) endif() + + if(HAVE_VRPN) + add_python_module(vrpn p3vrpn IMPORT panda3d.core) + endif() endif() diff --git a/panda/src/vrpn/CMakeLists.txt b/panda/src/vrpn/CMakeLists.txt new file mode 100644 index 0000000000..e5c67d686b --- /dev/null +++ b/panda/src/vrpn/CMakeLists.txt @@ -0,0 +1,39 @@ +if(NOT HAVE_VRPN) + return() +endif() + +set(P3VRPN_HEADERS + config_vrpn.h + vrpnAnalogDevice.h vrpnAnalogDevice.I + vrpnAnalog.h vrpnAnalog.I + vrpnButtonDevice.h vrpnButtonDevice.I + vrpnButton.h vrpnButton.I + vrpnClient.h vrpnClient.I + vrpnDialDevice.h vrpnDialDevice.I + vrpnDial.h vrpnDial.I + vrpn_interface.h + vrpnTrackerDevice.h vrpnTrackerDevice.I + vrpnTracker.h vrpnTracker.I +) + +set(P3VRPN_SOURCES + config_vrpn.cxx + vrpnAnalog.cxx + vrpnAnalogDevice.cxx + vrpnButton.cxx + vrpnButtonDevice.cxx + vrpnClient.cxx + vrpnDial.cxx + vrpnDialDevice.cxx + vrpnTracker.cxx + vrpnTrackerDevice.cxx +) + +composite_sources(p3vrpn P3VRPN_SOURCES) +add_library(p3vrpn ${P3VRPN_HEADERS} ${P3VRPN_SOURCES}) +set_target_properties(p3vrpn PROPERTIES DEFINE_SYMBOL BUILDING_VRPN) +target_link_libraries(p3vrpn panda PKG::VRPN) +target_interrogate(p3vrpn ALL) + +install(TARGETS p3vrpn DESTINATION lib RUNTIME DESTINATION bin) +install(FILES ${P3VRPN_HEADERS} DESTINATION include/panda3d) From 15a78c55bc3dabaf8bafea892055660240f2aff6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 2 Nov 2018 22:10:46 -0600 Subject: [PATCH 542/744] CMake: Detect and use HarfBuzz when available --- cmake/modules/FindHarfBuzz.cmake | 29 +++++++++++++++++++++++++++++ dtool/Package.cmake | 14 +++++++++++++- dtool/dtool_config.h.in | 3 +++ panda/src/text/CMakeLists.txt | 3 ++- 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 cmake/modules/FindHarfBuzz.cmake diff --git a/cmake/modules/FindHarfBuzz.cmake b/cmake/modules/FindHarfBuzz.cmake new file mode 100644 index 0000000000..ae1d56acda --- /dev/null +++ b/cmake/modules/FindHarfBuzz.cmake @@ -0,0 +1,29 @@ +# Filename: FindHarfBuzz.cmake +# Authors: CFSworks (2 Nov, 2018) +# +# Usage: +# find_package(HarfBuzz [REQUIRED] [QUIET]) +# +# Once done this will define: +# HARFBUZZ_FOUND - system has HarfBuzz +# HARFBUZZ_INCLUDE_DIR - the include directory containing hb.h +# HARFBUZZ_LIBRARY - the path to the HarfBuzz library +# + +if(NOT HARFBUZZ_INCLUDE_DIR) + find_path(HARFBUZZ_INCLUDE_DIR + NAMES "hb.h" + PATH_SUFFIXES "harfbuzz") + + mark_as_advanced(HARFBUZZ_INCLUDE_DIR) +endif() + +if(NOT HARFBUZZ_LIBRARY) + find_library(HARFBUZZ_LIBRARY + NAMES "harfbuzz") + + mark_as_advanced(HARFBUZZ_LIBRARY) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(HarfBuzz DEFAULT_MSG HARFBUZZ_INCLUDE_DIR HARFBUZZ_LIBRARY) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 65bec54b4e..e3dc9c2da4 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -308,12 +308,24 @@ endif() find_package(Freetype QUIET) package_option(FREETYPE - "This enables support for the FreeType font-rendering library. If disabled, + "This enables support for the FreeType font-rendering library. If disabled, Panda3D will only be able to read fonts specially made with egg-mkfont." IMPORTED_AS freetype) config_package(FREETYPE "FreeType") +# HarfBuzz + +# Some versions of harfbuzz-config.cmake contain an endless while loop, so we +# force MODULE mode here. +find_package(HarfBuzz MODULE QUIET) + +package_option(HARFBUZZ + "This enables support for the HarfBuzz text shaping library." + IMPORTED_AS harfbuzz::harfbuzz) + +config_package(HARFBUZZ "HarfBuzz") + # GTK2 # Find and configure GTK diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 30b95773d9..27d264dabb 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -21,6 +21,9 @@ /* Define if we have Freetype 2.0 or better available. */ #cmakedefine HAVE_FREETYPE +/* Define if we have HarfBuzz available. */ +#cmakedefine HAVE_HARFBUZZ + /* Define if we want to compile in a default font. */ #cmakedefine COMPILE_IN_DEFAULT_FONT diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 4d9f9fe220..3b02c62ae7 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -36,7 +36,8 @@ set(P3TEXT_SOURCES composite_sources(p3text P3TEXT_SOURCES) add_component_library(p3text SYMBOL BUILDING_PANDA_TEXT ${P3TEXT_HEADERS} ${P3TEXT_SOURCES}) -target_link_libraries(p3text p3parametrics) +target_link_libraries(p3text p3parametrics + PKG::HARFBUZZ) if(HAVE_FREETYPE) target_link_libraries(p3text p3pnmtext) endif() From 0fc4edee3870c35ee863a14d2e78880d52993139 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Nov 2018 17:43:03 -0600 Subject: [PATCH 543/744] CMake: Fix missing component in pandadx9 --- panda/metalibs/pandadx9/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/metalibs/pandadx9/CMakeLists.txt b/panda/metalibs/pandadx9/CMakeLists.txt index 92eeb1dc45..7f5844f983 100644 --- a/panda/metalibs/pandadx9/CMakeLists.txt +++ b/panda/metalibs/pandadx9/CMakeLists.txt @@ -3,7 +3,7 @@ if(NOT HAVE_DX9) endif() add_metalib(pandadx9 ${MODULE_TYPE} pandadx9.cxx - COMPONENTS p3dxgsg9) + COMPONENTS p3dxgsg9 p3windisplay) set_target_properties(pandadx9 PROPERTIES DEFINE_SYMBOL BUILDING_PANDADX) install(TARGETS pandadx9 DESTINATION ${MODULE_DESTINATION}) From 3a5c158b5af25b676371ad0e3b490324b045a957 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Nov 2018 21:21:30 -0600 Subject: [PATCH 544/744] CMake: Fix FindVRPN so it also finds VRPN's quat library --- cmake/modules/FindVRPN.cmake | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/cmake/modules/FindVRPN.cmake b/cmake/modules/FindVRPN.cmake index 19d205547c..903eccac37 100644 --- a/cmake/modules/FindVRPN.cmake +++ b/cmake/modules/FindVRPN.cmake @@ -7,7 +7,7 @@ # Once done this will define: # VRPN_FOUND - system has VRPN # VRPN_INCLUDE_DIR - the include directory containing VRPN header files -# VRPN_LIBRARY - the path to the VRPN client library +# VRPN_LIBRARIES - the path to the VRPN client libraries # if(NOT VRPN_INCLUDE_DIR) @@ -16,12 +16,31 @@ if(NOT VRPN_INCLUDE_DIR) mark_as_advanced(VRPN_INCLUDE_DIR) endif() -if(NOT VRPN_LIBRARY) - find_library(VRPN_LIBRARY +if(NOT VRPN_vrpn_LIBRARY) + find_library(VRPN_vrpn_LIBRARY NAMES "vrpn") - mark_as_advanced(VRPN_LIBRARY) + mark_as_advanced(VRPN_vrpn_LIBRARY) +endif() + +if(VRPN_vrpn_LIBRARY AND NOT VRPN_quat_LIBRARY) + get_filename_component(_vrpn_dir "${VRPN_vrpn_LIBRARY}" DIRECTORY) + find_library(VRPN_quat_LIBRARY + NAMES "quat" + PATHS "${_vrpn_dir}" + NO_DEFAULT_PATH) + + unset(_vrpn_dir) + mark_as_advanced(VRPN_quat_LIBRARY) +endif() + +set(VRPN_LIBRARIES) +if(VRPN_vrpn_LIBRARY) + list(APPEND VRPN_LIBRARIES "${VRPN_vrpn_LIBRARY}") +endif() +if(VRPN_quat_LIBRARY) + list(APPEND VRPN_LIBRARIES "${VRPN_quat_LIBRARY}") endif() include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_INCLUDE_DIR VRPN_LIBRARY) +find_package_handle_standard_args(VRPN DEFAULT_MSG VRPN_INCLUDE_DIR VRPN_LIBRARIES) From 9222bc6d31fe034995d19b3246e1f4a28ffe1867 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Nov 2018 22:39:57 -0600 Subject: [PATCH 545/744] CMake: Detect OpenCV/ARToolKit, build p3vision For now, p3vision is only built if either OpenCV or ARToolKit is available. It does contain some generic webcam access code, so it might be worth building it when that's available. --- cmake/modules/FindARToolKit.cmake | 43 +++++++++++++++++ cmake/modules/FindOpenCV.cmake | 79 +++++++++++++++++++++++++++++++ dtool/LocalSetup.cmake | 12 ----- dtool/Package.cmake | 41 ++++++++-------- panda/CMakeLists.txt | 5 ++ panda/src/vision/CMakeLists.txt | 37 +++++++++++++++ 6 files changed, 185 insertions(+), 32 deletions(-) create mode 100644 cmake/modules/FindARToolKit.cmake create mode 100644 cmake/modules/FindOpenCV.cmake create mode 100644 panda/src/vision/CMakeLists.txt diff --git a/cmake/modules/FindARToolKit.cmake b/cmake/modules/FindARToolKit.cmake new file mode 100644 index 0000000000..e596e608e9 --- /dev/null +++ b/cmake/modules/FindARToolKit.cmake @@ -0,0 +1,43 @@ +# Filename: FindARToolKit.cmake +# Authors: CFSworks (3 Nov, 2018) +# +# Usage: +# find_package(ARToolKit [REQUIRED] [QUIET]) +# +# Once done this will define: +# ARTOOLKIT_FOUND - system has ARToolKit +# ARTOOLKIT_INCLUDE_DIR - the include directory containing ARToolKit header files +# ARTOOLKIT_LIBRARIES - the paths to the ARToolKit client libraries +# + +if(NOT ARTOOLKIT_INCLUDE_DIR) + find_path(ARTOOLKIT_INCLUDE_DIR "AR/ar.h") + + mark_as_advanced(ARTOOLKIT_INCLUDE_DIR) +endif() + +if(NOT ARTOOLKIT_AR_LIBRARY) + find_library(ARTOOLKIT_AR_LIBRARY + NAMES "AR" "libAR") + + mark_as_advanced(ARTOOLKIT_AR_LIBRARY) +endif() + +if(NOT ARTOOLKIT_ARMulti_LIBRARY) + find_library(ARTOOLKIT_ARMulti_LIBRARY + NAMES "ARMulti" "libARMulti") + + mark_as_advanced(ARTOOLKIT_ARMulti_LIBRARY) +endif() + +set(ARTOOLKIT_LIBRARIES) +if(ARTOOLKIT_AR_LIBRARY) + list(APPEND ARTOOLKIT_LIBRARIES "${ARTOOLKIT_AR_LIBRARY}") +endif() +if(ARTOOLKIT_ARMulti_LIBRARY) + list(APPEND ARTOOLKIT_LIBRARIES "${ARTOOLKIT_ARMulti_LIBRARY}") +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ARToolKit DEFAULT_MSG + ARTOOLKIT_INCLUDE_DIR ARTOOLKIT_LIBRARIES) diff --git a/cmake/modules/FindOpenCV.cmake b/cmake/modules/FindOpenCV.cmake new file mode 100644 index 0000000000..fcb6e1b49b --- /dev/null +++ b/cmake/modules/FindOpenCV.cmake @@ -0,0 +1,79 @@ +# Filename: FindOpenCV.cmake +# Authors: CFSworks (3 Nov, 2018) +# +# Usage: +# find_package(OpenCV [REQUIRED] [QUIET]) +# +# This supports the following components: +# calib3d +# contrib +# core +# features2d +# flann +# gpu +# highgui +# imgproc +# legacy +# ml +# nonfree +# objdetect +# photo +# stitching +# superres +# video +# videostab +# +# Once done this will define: +# OPENCV_FOUND - system has OpenCV +# OpenCV_INCLUDE_DIRS - the include dir(s) containing OpenCV header files +# OpenCV_comp_LIBRARY - the path to the OpenCV library for the particular +# component +# OpenCV_LIBS - the paths to the OpenCV libraries for the requested +# component(s) +# + +set(OpenCV_INCLUDE_DIRS) +if(NOT OpenCV_V1_INCLUDE_DIR) + find_path(OpenCV_V1_INCLUDE_DIR + NAMES "cv.h" + PATH_SUFFIXES "opencv") + + mark_as_advanced(OpenCV_V1_INCLUDE_DIR) +endif() +if(OpenCV_V1_INCLUDE_DIR) + list(APPEND OpenCV_INCLUDE_DIRS "${OpenCV_V1_INCLUDE_DIR}") +endif() + +if(NOT OpenCV_V2_INCLUDE_DIR) + find_path(OpenCV_V2_INCLUDE_DIR "opencv2/core/core.hpp") + + mark_as_advanced(OpenCV_V2_INCLUDE_DIR) +endif() +if(OpenCV_V2_INCLUDE_DIR) + list(APPEND OpenCV_INCLUDE_DIRS "${OpenCV_V2_INCLUDE_DIR}") +endif() + +set(OpenCV_LIBS) +foreach(_component calib3d contrib core features2d flann gpu highgui imgproc + legacy ml nonfree objdetect photo stitching superres video + videostab) + + list(FIND OpenCV_FIND_COMPONENTS "${_component}" _index) + if(_index GREATER -1 OR _component STREQUAL "core") + if(NOT OpenCV_${_component}_LIBRARY) + find_library(OpenCV_${_component}_LIBRARY + NAMES "opencv_${_component}") + endif() + + if(OpenCV_${_component}_LIBRARY) + list(APPEND OpenCV_LIBS "${OpenCV_${_component}_LIBRARY}") + set(OpenCV_${_component}_FOUND ON) + endif() + endif() + unset(_index) +endforeach(_component) +unset(_component) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenCV HANDLE_COMPONENTS + REQUIRED_VARS OpenCV_INCLUDE_DIRS OpenCV_LIBS) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 88fdd89b54..c92ca758c6 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -161,12 +161,6 @@ else() message("- Not building Tinydisplay") endif() -if(HAVE_OPENCV) - message("+ OpenCV") -else() - message("- Did not find OpenCV") -endif() - if(HAVE_AWESOMIUM) message("+ AWESOMIUM") else() @@ -191,12 +185,6 @@ else() message("- Did not find Assimp") endif() -if(HAVE_ARTOOLKIT) - message("+ ARToolKit") -else() - message("- Did not find ARToolKit") -endif() - if(HAVE_ROCKET) if(HAVE_ROCKET_PYTHON) message("+ libRocket with Python bindings") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index e3dc9c2da4..b1a432f6e1 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -463,22 +463,31 @@ package_option(DX9 config_package(DX9 "Direct3D 9.x") +# +# ------------ Vision tools ------------ +# + +# OpenCV +find_package(OpenCV QUIET COMPONENTS core highgui) + +package_option(OPENCV + "Enable support for OpenCV. This will be built into the 'vision' package." + FOUND_AS OpenCV) + +config_package(OPENCV "OpenCV") + +# ARToolKit +find_package(ARToolKit QUIET) + +package_option(ARTOOLKIT + "Enable support for ARToolKit. This will be built into the 'vision' package.") + +config_package(ARTOOLKIT "ARToolKit") + ######## # TODO # ######## -# Find and configure OpenCV -#find_package(OpenCV) -#config_package(OPENCV COMMENT "OpenCV") - -# Find and configure FFMPEG -#find_package(FFMPEG) -#config_package(FFMPEG) - -# Find and configure ODE -#find_package(ODE) -#config_package(ODE) - # Find and configure Awesomium #find_package(Awesomium) #config_package(AWESOMIUM COMMENT "Awesomium") @@ -505,10 +514,6 @@ config_package(DX9 "Direct3D 9.x") #find_package(Assimp) #config_package(ASSIMP COMMENT "Assimp") -# Find and configure ARToolKit -#find_package(ARToolKit) -#config_package(ARTOOLKIT COMMENT "ARToolKit") - # Find and configure libRocket #find_package(Rocket) #config_package(ROCKET COMMENT "libRocket") @@ -531,10 +536,6 @@ config_package(DX9 "Direct3D 9.x") # unset(USE_ROCKET_PYTHON CACHE) #endif() -# Find and configure Bullet -#find_package(Bullet) -#config_package(BULLET COMMENT "Bullet Physics") - # Find and configure Vorbis #find_package(Vorbis) #config_package(VORBIS COMMENT "Vorbis Ogg decoder") diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index bf75353f97..00524ec804 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -54,6 +54,7 @@ add_subdirectory(src/recorder) add_subdirectory(src/testbed) add_subdirectory(src/text) add_subdirectory(src/tform) +add_subdirectory(src/vision) add_subdirectory(src/vrpn) add_subdirectory(src/wgldisplay) add_subdirectory(src/windisplay) @@ -110,6 +111,10 @@ if(HAVE_PYTHON) add_python_module(ode p3ode IMPORT panda3d.core) endif() + if(HAVE_OPENCV OR HAVE_ARTOOLKIT) + add_python_module(vision p3vision IMPORT panda3d.core) + endif() + if(HAVE_VRPN) add_python_module(vrpn p3vrpn IMPORT panda3d.core) endif() diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt new file mode 100644 index 0000000000..e70490ab63 --- /dev/null +++ b/panda/src/vision/CMakeLists.txt @@ -0,0 +1,37 @@ +if(NOT HAVE_OPENCV AND NOT HAVE_ARTOOLKIT) + return() +endif() + +set(P3VISION_HEADERS + arToolKit.h arToolKit.I + config_vision.h + openCVTexture.h openCVTexture.I + webcamVideoCursorOpenCV.h + webcamVideoCursorV4L.h + webcamVideo.h webcamVideo.I + webcamVideoOpenCV.h + webcamVideoV4L.h +) + +set(P3VISION_SOURCES + arToolKit.cxx + config_vision.cxx + openCVTexture.cxx + webcamVideoCursorOpenCV.cxx + webcamVideoCursorV4L.cxx + webcamVideo.cxx + webcamVideoDS.cxx + webcamVideoOpenCV.cxx + webcamVideoV4L.cxx +) + +composite_sources(p3vision P3VISION_SOURCES) +add_library(p3vision ${P3VISION_HEADERS} ${P3VISION_SOURCES}) +set_target_properties(p3vision PROPERTIES DEFINE_SYMBOL BUILDING_VISION) +target_link_libraries(p3vision panda + PKG::OPENCV PKG::ARTOOLKIT) +set_target_properties(p3vision PROPERTIES CXX_EXCEPTIONS ON) +target_interrogate(p3vision ALL) + +install(TARGETS p3vision DESTINATION lib RUNTIME DESTINATION bin) +install(FILES ${P3VISION_HEADERS} DESTINATION include/panda3d) From e604d71fbc1f43a4fa7318d1286a666a5696a659 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 3 Nov 2018 23:46:34 -0600 Subject: [PATCH 546/744] CMake: Don't build p3dconfig anymore dconfig.cxx was recently deleted. p3dconfig is now just an interface library, since it still contains a header which we'd like on the search path of libraries that use it. --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 +- dtool/src/dconfig/CMakeLists.txt | 19 ++++--------------- dtool/src/interrogatedb/CMakeLists.txt | 2 +- 3 files changed, 6 insertions(+), 17 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 977c3e0ede..1b0564c3b3 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,3 +1,3 @@ -set(DTOOLCONFIG_LINK_TARGETS p3prc p3dconfig p3interrogatedb) +set(DTOOLCONFIG_LINK_TARGETS p3prc p3interrogatedb) add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) install(TARGETS p3dtoolconfig DESTINATION lib RUNTIME DESTINATION bin) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 5292450558..9dff9c0baa 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -1,16 +1,5 @@ -set(P3DCONFIG_HEADERS - config_dconfig.h dconfig.I dconfig.h) +# Yes, INTERFACE: don't build it, there's no code! +# We're only doing this to put the .h file on the path. +add_library(p3dconfig INTERFACE) -set(P3DCONFIG_SOURCES - config_dconfig.cxx dconfig.cxx) - -composite_sources(p3dconfig P3DCONFIG_SOURCES) - -add_component_library(p3dconfig NOINIT SYMBOL BUILDING_DTOOL_DCONFIG - ${P3DCONFIG_HEADERS} ${P3DCONFIG_SOURCES}) -target_link_libraries(p3dconfig p3prc) - -if(NOT BUILD_METALIBS) - install(TARGETS p3dconfig DESTINATION lib RUNTIME DESTINATION bin) -endif() -install(FILES ${P3DCONFIG_HEADERS} DESTINATION include/panda3d) +install(FILES dconfig.h DESTINATION include/panda3d) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 3088a31e78..65e4fdf669 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -39,7 +39,7 @@ composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3dconfig) +target_link_libraries(p3interrogatedb p3prc p3dconfig p3dtool) if(NOT BUILD_METALIBS) install(TARGETS p3interrogatedb DESTINATION lib RUNTIME DESTINATION bin) From 16be0770e79613db17fb9269946aba08a6f4292e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 5 Nov 2018 17:54:45 -0700 Subject: [PATCH 547/744] CMake: Fix libCgGL linkage in FindCg.cmake This involves both fixing the capitalization of "CgGL" and only adding libraries to CG_LIBRARIES when they're found. --- cmake/modules/FindCg.cmake | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index a6636a67a1..b48904b2ba 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -42,7 +42,7 @@ macro(find_cggl) # Find the library directory find_library(CGGL_LIBRARY - NAMES "cgGL" "libCgGL" + NAMES "CgGL" "libCgGL" PATHS "C:/Program Files/Cg" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" @@ -87,7 +87,7 @@ macro(find_cgd3d9) # Find the library directory find_library(CGD3D9_LIBRARY - NAMES "cgD3D9" "libCgD3D9" + NAMES "CgD3D9" "libCgD3D9" PATHS "C:/Program Files/Cg" "C:/Program Files/NVIDIA Corporation/Cg" "/usr" @@ -184,6 +184,11 @@ if(CG_INCLUDE_DIR AND CG_LIBRARY_DIR) find_cggl() find_cgd3d9() - set(CG_LIBRARIES ${CG_LIBRARY} ${CGGL_LIBRARY} ${CGD3D9_LIBRARY}) - mark_as_advanced(CG_LIBRARIES) + set(CG_LIBRARIES ${CG_LIBRARY}) + if(CGGL_LIBRARY) + list(APPEND CG_LIBRARIES "${CGGL_LIBRARY}") + endif() + if(CGD3D9_LIBRARY) + list(APPEND CG_LIBRARIES "${CGD3D9_LIBRARY}") + endif() endif() From d43767c6173dba0cb2f5a678f493d63b4ae0752f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 5 Nov 2018 23:20:04 -0700 Subject: [PATCH 548/744] CMake: Find OpenEXR, support it in pnmimagetypes --- cmake/modules/FindOpenEXR.cmake | 90 ++++++++++++++++++++++++++ dtool/Package.cmake | 5 ++ dtool/dtool_config.h.in | 3 + panda/src/pnmimagetypes/CMakeLists.txt | 3 +- 4 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/FindOpenEXR.cmake diff --git a/cmake/modules/FindOpenEXR.cmake b/cmake/modules/FindOpenEXR.cmake new file mode 100644 index 0000000000..693113217e --- /dev/null +++ b/cmake/modules/FindOpenEXR.cmake @@ -0,0 +1,90 @@ +# Filename: FindOpenEXR.cmake +# Authors: CFSworks (5 Nov, 2018) +# +# Usage: +# find_package(OpenEXR [REQUIRED] [QUIET]) +# +# Once done this will define: +# OPENEXR_FOUND - system has OpenEXR +# OPENEXR_INCLUDE_DIR - the include directory containing OpenEXR header files +# OPENEXR_LIBRARIES - the path to the OpenEXR libraries +# + +if(NOT OPENEXR_INCLUDE_DIR) + find_path(OPENEXR_INCLUDE_DIR + "ImfVersion.h" + PATH_SUFFIXES "OpenEXR") + + mark_as_advanced(OPENEXR_INCLUDE_DIR) +endif() + +find_library(OPENEXR_imf_LIBRARY + NAMES "IlmImf") + +if(OPENEXR_imf_LIBRARY) + get_filename_component(_imf_dir "${OPENEXR_imf_LIBRARY}" DIRECTORY) + find_library(OPENEXR_imfutil_LIBRARY + NAMES "IlmImfUtil" + PATHS "${_imf_dir}" + NO_DEFAULT_PATH) + + find_library(OPENEXR_ilmthread_LIBRARY + NAMES "IlmThread" + PATHS "${_imf_dir}" + NO_DEFAULT_PATH) + + find_library(OPENEXR_iex_LIBRARY + NAMES "Iex" + PATHS "${_imf_dir}" + NO_DEFAULT_PATH) + + find_library(OPENEXR_iexmath_LIBRARY + NAMES "IexMath" + PATHS "${_imf_dir}" + NO_DEFAULT_PATH) + + find_library(OPENEXR_imath_LIBRARY + NAMES "Imath" + PATHS "${_imf_dir}" + NO_DEFAULT_PATH) + + find_library(OPENEXR_half_LIBRARY + NAMES "Half" + PATHS "${_imf_dir}" + NO_DEFAULT_PATH) + + unset(_imf_dir) +endif() + +mark_as_advanced( + OPENEXR_imf_LIBRARY + OPENEXR_imfutil_LIBRARY + OPENEXR_ilmthread_LIBRARY + OPENEXR_iex_LIBRARY + OPENEXR_iexmath_LIBRARY + OPENEXR_imath_LIBRARY + OPENEXR_half_LIBRARY +) + +set(OPENEXR_LIBRARIES + ${OPENEXR_imf_LIBRARY} + ${OPENEXR_imfutil_LIBRARY} + ${OPENEXR_ilmthread_LIBRARY} + ${OPENEXR_iex_LIBRARY} + ${OPENEXR_iexmath_LIBRARY} + ${OPENEXR_imath_LIBRARY} + ${OPENEXR_half_LIBRARY} +) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpenEXR DEFAULT_MSG + OPENEXR_INCLUDE_DIR OPENEXR_LIBRARIES + + OPENEXR_imf_LIBRARY + OPENEXR_imfutil_LIBRARY + OPENEXR_ilmthread_LIBRARY + OPENEXR_iex_LIBRARY + OPENEXR_iexmath_LIBRARY + OPENEXR_imath_LIBRARY + OPENEXR_half_LIBRARY +) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index b1a432f6e1..8395579abb 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -149,6 +149,11 @@ find_package(TIFF QUIET) package_option(TIFF "Enable support for loading .tif images.") config_package(TIFF "libtiff") +# OpenEXR: +find_package(OpenEXR QUIET) +package_option(OPENEXR "Enable support for loading .exr images.") +config_package(OPENEXR "OpenEXR") + # # ------------ LIBTAR ------------ # diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 27d264dabb..5a20f9666c 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -67,6 +67,9 @@ /* Define if we have libtiff installed. */ #cmakedefine HAVE_TIFF +/* Define if we have OpenEXR installed. */ +#cmakedefine HAVE_OPENEXR + /* Define if we want to build these other image file formats. */ #cmakedefine HAVE_SGI_RGB #cmakedefine HAVE_TGA diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index 8fcac02573..c29e7ae1a3 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -33,7 +33,8 @@ set(P3PNMIMAGETYPES_SOURCES composite_sources(p3pnmimagetypes P3PNMIMAGETYPES_SOURCES) add_component_library(p3pnmimagetypes SYMBOL BUILDING_PANDA_PNMIMAGETYPES ${P3PNMIMAGETYPES_HEADERS} ${P3PNMIMAGETYPES_SOURCES}) -target_link_libraries(p3pnmimagetypes p3pnmimage PKG::JPEG PKG::TIFF PKG::PNG) +target_link_libraries(p3pnmimagetypes p3pnmimage + PKG::JPEG PKG::TIFF PKG::PNG PKG::OPENEXR) set_target_properties(p3pnmimagetypes PROPERTIES CXX_EXCEPTIONS ON) if(NOT BUILD_METALIBS) From 3050203e2412ab2ec7d155ace2383c6f9e9b3875 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 8 Nov 2018 17:42:32 -0700 Subject: [PATCH 549/744] CMake: Update add_metalib() to support exports This allows exporting (a stub function that forwards to) a function that returns a value - it's particularly useful in the graphics plugins for the "get_pipe_type_foo()" functions. This also frees up CMake from needing to use any of the source files in the metalibs/*/ directories. --- cmake/macros/BuildMetalib.cmake | 49 ++++++++++++++++- cmake/templates/metalib_init.cxx.in | 1 + cmake/templates/metalib_init.h.in | 1 + panda/metalibs/pandadx9/CMakeLists.txt | 6 ++- panda/metalibs/pandagl/CMakeLists.txt | 67 +++++++++++++----------- panda/metalibs/pandagles/CMakeLists.txt | 14 ++++- panda/metalibs/pandagles2/CMakeLists.txt | 6 ++- panda/src/egldisplay/CMakeLists.txt | 2 + panda/src/glstuff/CMakeLists.txt | 2 +- 9 files changed, 108 insertions(+), 40 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 1277ec0820..50d16af44a 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -182,7 +182,9 @@ function(add_component_library target_name) endfunction(add_component_library) # -# Function: add_metalib(target [source1 source2] [INIT initfunc [initheader.h]] +# Function: add_metalib(target [source1 source2] +# [INCLUDE header1.h ...] +# [INIT initfunc [initheader.h] [EXPORT type name expr]] # [COMPONENTS component1 ...]) # # This is add_library, but for metalibs. @@ -191,28 +193,72 @@ endfunction(add_component_library) # autogenerated by this function) that calls the underlying component libs' # init functions. # +# The EXPORT keyword exports the expression `expr`, which yields a value of +# type `type`, as the undecorated (extern "C") symbol `name` +# +# The INCLUDE keyword allows the init file to pull in additional headers, which +# may be useful for EXPORT. +# function(add_metalib target_name) set(components_keyword OFF) set(init_keyword 0) set(init_func) set(init_header "${target_name}.h") + set(export_keyword 0) + set(export_declarations) + set(export_definitions) + set(component_init_headers) set(components) set(sources) foreach(arg ${ARGN}) if(arg STREQUAL "COMPONENTS") set(components_keyword ON) + set(include_keyword OFF) set(init_keyword 0) + set(export_keyword 0) + elseif(arg STREQUAL "INCLUDE") + set(include_keyword ON) + set(components_keyword OFF) + set(init_keyword 0) + set(export_keyword 0) elseif(arg STREQUAL "INIT") set(init_keyword 2) set(components_keyword OFF) + set(include_keyword OFF) + set(export_keyword 0) + elseif(arg STREQUAL "EXPORT") + if(NOT init_func) + message(FATAL_ERROR "EXPORT cannot be used before INIT") + endif() + set(export_keyword 3) + set(components_keyword OFF) + set(include_keyword OFF) + set(init_keyword 0) elseif(components_keyword) list(APPEND components "${arg}") + elseif(include_keyword) + set(component_init_headers + "${component_init_headers}#include \"${arg}\"\n") elseif(init_keyword EQUAL 2) set(init_func "${arg}") set(init_keyword 1) elseif(init_keyword EQUAL 1) set(init_header "${arg}") set(init_keyword 0) + elseif(export_keyword EQUAL 3) + set(_export_type "${arg}") + set(export_keyword 2) + elseif(export_keyword EQUAL 2) + set(_export_name "${arg}") + set(export_keyword 1) + elseif(export_keyword EQUAL 1) + set(export_declarations + "${export_declarations}\nextern \"C\" IMPORT_CLASS ${_export_type} ${_export_name}();") + set(export_definitions + "${export_definitions}\nextern \"C\" EXPORT_CLASS ${_export_type} ${_export_name}() { return ${arg}; }") + unset(_export_type) + unset(_export_name) + set(export_keyword 0) else() list(APPEND sources "${arg}") endif() @@ -226,7 +272,6 @@ function(add_metalib target_name) set(includes) set(libs) set(component_init_funcs "") - set(component_init_headers "") foreach(component ${components}) if(NOT TARGET "${component}") message(FATAL_ERROR diff --git a/cmake/templates/metalib_init.cxx.in b/cmake/templates/metalib_init.cxx.in index 0bef274f6a..f8975d400d 100644 --- a/cmake/templates/metalib_init.cxx.in +++ b/cmake/templates/metalib_init.cxx.in @@ -6,3 +6,4 @@ EXPORT_CLASS void @init_func@() { @component_init_funcs@ } +@export_definitions@ diff --git a/cmake/templates/metalib_init.h.in b/cmake/templates/metalib_init.h.in index 60f4a1380f..4ae8db0d34 100644 --- a/cmake/templates/metalib_init.h.in +++ b/cmake/templates/metalib_init.h.in @@ -4,5 +4,6 @@ #include "dtoolbase.h" IMPORT_CLASS void @init_func@(); +@export_declarations@ #endif diff --git a/panda/metalibs/pandadx9/CMakeLists.txt b/panda/metalibs/pandadx9/CMakeLists.txt index 7f5844f983..d340d018ec 100644 --- a/panda/metalibs/pandadx9/CMakeLists.txt +++ b/panda/metalibs/pandadx9/CMakeLists.txt @@ -2,8 +2,10 @@ if(NOT HAVE_DX9) return() endif() -add_metalib(pandadx9 ${MODULE_TYPE} pandadx9.cxx +add_metalib(pandadx9 ${MODULE_TYPE} + INCLUDE wdxGraphicsPipe9.h + INIT init_libpandadx9 pandadx9.h + EXPORT int get_pipe_type_pandadx9 "wdxGraphicsPipe9::get_class_type().get_index()" COMPONENTS p3dxgsg9 p3windisplay) -set_target_properties(pandadx9 PROPERTIES DEFINE_SYMBOL BUILDING_PANDADX) install(TARGETS pandadx9 DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 10c8a9aedc..acc204069d 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -1,32 +1,37 @@ -if(HAVE_GL) - # Check that we actually have a display subsystem. - if(NOT HAVE_WGL AND NOT HAVE_COCOA AND NOT HAVE_CARBON AND NOT HAVE_GLX) - message("") # Add extra line before error - message(SEND_ERROR - "When compiling with OpenGL (HAVE_GL), at least one of: - HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") - endif() - - set(PANDAGL_LINK_TARGETS p3glgsg p3glstuff) - - if(HAVE_GLX) - list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay p3x11display) - endif() - - if(HAVE_WGL) - list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay p3windisplay) - endif() - - if(HAVE_COCOA) - list(APPEND PANDAGL_LINK_TARGETS p3cocoadisplay) - endif() - - if(HAVE_CARBON) - list(APPEND PANDAGL_LINK_TARGETS p3osxdisplay) - endif() - - add_metalib(pandagl ${MODULE_TYPE} pandagl.cxx COMPONENTS ${PANDAGL_LINK_TARGETS}) - set_target_properties(pandagl PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGL) - - install(TARGETS pandagl DESTINATION ${MODULE_DESTINATION}) +if(NOT HAVE_GL) + return() endif() + +set(PANDAGL_LINK_TARGETS p3glgsg p3glstuff) + +if(HAVE_GLX) + list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay p3x11display) + set(PANDAGL_PIPE_TYPE "glxGraphicsPipe") +elseif(HAVE_WGL) + list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay p3windisplay) + set(PANDAGL_PIPE_TYPE "wglGraphicsPipe") +elseif(HAVE_COCOA) + list(APPEND PANDAGL_LINK_TARGETS p3cocoadisplay) + set(PANDAGL_PIPE_TYPE "CocoaGraphicsPipe") + set(PANDAGL_PIPE_INCLUDE "cocoaGraphicsPipe.h") +elseif(HAVE_CARBON) + list(APPEND PANDAGL_LINK_TARGETS p3osxdisplay) + set(PANDAGL_PIPE_TYPE "osxGraphicsPipe") +else() + message("") # Add extra line before error + message(SEND_ERROR + "When compiling with OpenGL (HAVE_GL), at least one of: + HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") +endif() + +if(NOT PANDAGL_PIPE_INCLUDE) + set(PANDAGL_PIPE_INCLUDE "${PANDAGL_PIPE_TYPE}.h") +endif() + +add_metalib(pandagl ${MODULE_TYPE} + INCLUDE "${PANDAGL_PIPE_INCLUDE}" + INIT init_libpandagl pandagl.h + EXPORT int get_pipe_type_pandagl "${PANDAGL_PIPE_TYPE}::get_class_type().get_index()" + COMPONENTS ${PANDAGL_LINK_TARGETS}) + +install(TARGETS pandagl DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt index 817cfc2026..3c5969c373 100644 --- a/panda/metalibs/pandagles/CMakeLists.txt +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -2,8 +2,18 @@ if(NOT HAVE_GLES1 OR NOT HAVE_EGL) return() endif() -add_metalib(pandagles ${MODULE_TYPE} pandagles.cxx +if(ANDROID) + set(GLES1_PIPE_TYPE "AndroidGraphicsPipe") + set(GLES1_PIPE_INCLUDE "androidGraphicsPipe.h") +else() + set(GLES1_PIPE_TYPE "eglGraphicsPipe") + set(GLES1_PIPE_INCLUDE "eglGraphicsPipe.h") +endif() + +add_metalib(pandagles ${MODULE_TYPE} + INCLUDE "${GLES1_PIPE_INCLUDE}" + INIT init_libpandagles pandagles.h + EXPORT int get_pipe_type_pandagles "${GLES1_PIPE_TYPE}::get_class_type().get_index()" COMPONENTS p3egldisplay_gles1 p3glesgsg) -set_target_properties(pandagles PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGLES) install(TARGETS pandagles DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/metalibs/pandagles2/CMakeLists.txt b/panda/metalibs/pandagles2/CMakeLists.txt index cb0e887254..a327ccf267 100644 --- a/panda/metalibs/pandagles2/CMakeLists.txt +++ b/panda/metalibs/pandagles2/CMakeLists.txt @@ -2,8 +2,10 @@ if(NOT HAVE_GLES2 OR NOT HAVE_EGL) return() endif() -add_metalib(pandagles2 ${MODULE_TYPE} pandagles2.cxx +add_metalib(pandagles2 ${MODULE_TYPE} + INCLUDE eglGraphicsPipe.h + INIT init_libpandagles2 pandagles2.h + EXPORT int get_pipe_type_pandagles2 "eglGraphicsPipe::get_class_type().get_index()" COMPONENTS p3egldisplay_gles2 p3gles2gsg) -set_target_properties(pandagles2 PROPERTIES DEFINE_SYMBOL BUILDING_PANDAGLES2) install(TARGETS pandagles2 DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/src/egldisplay/CMakeLists.txt b/panda/src/egldisplay/CMakeLists.txt index c5e51d18bf..2fbdd985fd 100644 --- a/panda/src/egldisplay/CMakeLists.txt +++ b/panda/src/egldisplay/CMakeLists.txt @@ -29,6 +29,7 @@ composite_sources(p3egldisplay P3EGLDISPLAY_SOURCES) # We actually build this twice! Once for GLES1, once for GLES2. if(HAVE_GLES1) add_component_library(p3egldisplay_gles1 SYMBOL BUILDING_PANDAGLES + INIT init_libegldisplay config_egldisplay.h ${P3EGLDISPLAY_HEADERS} ${P3EGLDISPLAY_SOURCES}) target_compile_definitions(p3egldisplay_gles1 PUBLIC OPENGLES_1) target_link_libraries(p3egldisplay_gles1 p3glesgsg p3x11display @@ -41,6 +42,7 @@ endif() if(HAVE_GLES2) add_component_library(p3egldisplay_gles2 SYMBOL BUILDING_PANDAGLES2 + INIT init_libegldisplay config_egldisplay.h ${P3EGLDISPLAY_HEADERS} ${P3EGLDISPLAY_SOURCES}) target_compile_definitions(p3egldisplay_gles2 PUBLIC OPENGLES_2) target_link_libraries(p3egldisplay_gles2 p3gles2gsg p3x11display diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 8118d6fc74..c0063aef21 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -34,7 +34,7 @@ set(P3GLSTUFF_SOURCES ) composite_sources(p3glstuff P3GLSTUFF_SOURCES) -add_component_library(p3glstuff ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) +add_component_library(p3glstuff NOINIT ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) target_link_libraries(p3glstuff panda) if(NOT BUILD_METALIBS) From 98fde4f7e03d9739851842b57b23850cfe275463 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 8 Nov 2018 20:50:15 -0700 Subject: [PATCH 550/744] makepanda: Delete metalibs sources CMake now generates these on-the-fly. --- makepanda/selfdestruct.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/makepanda/selfdestruct.py b/makepanda/selfdestruct.py index 79518a72d4..67d0303c20 100755 --- a/makepanda/selfdestruct.py +++ b/makepanda/selfdestruct.py @@ -31,6 +31,15 @@ shutil.rmtree(os.path.join(root, 'makepanda')) # Then we look under each of the separate project trees: projects = ['contrib', 'direct', 'dtool', 'panda', 'pandatool'] for project in projects: + # Remove non-CMakeLists.txt files from */metalibs/*/ + for path, dirs, files in os.walk(os.path.join(root, project, 'metalibs')): + for filename in files: + if filename.lower() != 'cmakelists.txt': + os.unlink(os.path.join(path, filename)) + # Unlink the directory itself, if empty + if not os.listdir(path): + os.rmdir(path) + for path, dirs, files in os.walk(os.path.join(root, project)): # Get rid of _composite#.cxx files for filename in files: From 2b1554a44c9a14b342ff4b7fe09a66e92c9dc0bc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 8 Nov 2018 21:15:00 -0700 Subject: [PATCH 551/744] 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. --- cmake/macros/PackageConfig.cmake | 18 +++---- dtool/Package.cmake | 80 ++++++++++++++++---------------- 2 files changed, 49 insertions(+), 49 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index df81deb621..a1e862b103 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -35,12 +35,12 @@ # variables provided by find_package() # # -# Function: config_package +# Function: package_status # Usage: -# config_package(package_name "Package description" ["Config summary"]) +# package_status(package_name "Package description" ["Config summary"]) # Examples: -# config_package(OpenAL "OpenAL Audio Output") -# config_package(ROCKET "Rocket" "without Python bindings") +# package_status(OpenAL "OpenAL Audio Output") +# package_status(ROCKET "Rocket" "without Python bindings") # # # Function: show_packages @@ -48,7 +48,7 @@ # show_packages() # # 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") # -# config_package +# package_status # -function(config_package name desc) +function(package_status name desc) set(note "") foreach(arg ${ARGN}) set(note "${arg}") endforeach() 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.") endif() list(FIND _ALL_CONFIG_PACKAGES "${name}" called_twice) 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.") else() list(APPEND _ALL_CONFIG_PACKAGES "${name}") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 8395579abb..501fe0b71c 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -102,9 +102,9 @@ alignment, which could impact memory usage on very-low-memory platforms. Currently experimental." ON) 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() - 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() # @@ -122,9 +122,9 @@ option(REPORT_OPENSSL_ERRORS error messages when they occur." ${IS_DEBUG_BUILD}) if(REPORT_OPENSSL_ERRORS) - config_package(OPENSSL "OpenSSL" "with verbose error reporting") + package_status(OPENSSL "OpenSSL" "with verbose error reporting") else() - config_package(OPENSSL "OpenSSL") + package_status(OPENSSL "OpenSSL") endif() # @@ -134,7 +134,7 @@ endif() # JPEG: find_package(JPEG QUIET) package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") -config_package(JPEG "libjpeg") +package_status(JPEG "libjpeg") # PNG: find_package(PNG QUIET) @@ -142,17 +142,17 @@ package_option(PNG DEFAULT ON "Enable support for loading .png images." IMPORTED_AS PNG::PNG) -config_package(PNG "libpng") +package_status(PNG "libpng") # TIFF: find_package(TIFF QUIET) package_option(TIFF "Enable support for loading .tif images.") -config_package(TIFF "libtiff") +package_status(TIFF "libtiff") # OpenEXR: find_package(OpenEXR QUIET) package_option(OPENEXR "Enable support for loading .exr images.") -config_package(OPENEXR "OpenEXR") +package_status(OPENEXR "OpenEXR") # # ------------ LIBTAR ------------ @@ -160,7 +160,7 @@ config_package(OPENEXR "OpenEXR") find_package(Tar QUIET) package_option(TAR "This is used to optimize patch generation against tar files.") -config_package(TAR "libtar") +package_status(TAR "libtar") # # ------------ FFTW ------------ @@ -175,7 +175,7 @@ package_option(FFTW FOUND_AS "FFTW3" LICENSE "GPL") -config_package(FFTW "FFTW") +package_status(FFTW "FFTW") # # ------------ libsquish ------------ @@ -187,7 +187,7 @@ package_option(SQUISH "Enables support for automatic compression of DXT textures." FOUND_AS LIBSQUISH) -config_package(SQUISH "libsquish") +package_status(SQUISH "libsquish") # # ------------ Nvidia Cg ------------ @@ -214,7 +214,7 @@ elseif(HAVE_CGDX9) else() set(cg_apis "WITHOUT rendering backend support") endif() -config_package(CG "Nvidia Cg Shading Language" "${cg_apis}") +package_status(CG "Nvidia Cg Shading Language" "${cg_apis}") # # ------------ VRPN ------------ @@ -226,7 +226,7 @@ package_option(VRPN "Enables support for connecting to VRPN servers. This is only needed if you are building Panda3D for a fixed VRPN-based VR installation.") -config_package(VRPN "VRPN") +package_status(VRPN "VRPN") # # ------------ zlib ------------ @@ -238,7 +238,7 @@ package_option(ZLIB "Enables support for compression of Panda assets." IMPORTED_AS ZLIB::ZLIB) -config_package(ZLIB "zlib") +package_status(ZLIB "zlib") # # ------------ FFmpeg ------------ @@ -264,7 +264,7 @@ elseif(HAVE_SWRESAMPLE) else() set(ffmpeg_features "without resampling/rescaling support") endif() -config_package(FFMPEG "FFmpeg" "${ffmpeg_features}") +package_status(FFMPEG "FFmpeg" "${ffmpeg_features}") # # ------------ Audio libraries ------------ @@ -278,7 +278,7 @@ package_option(RAD_MSS if you need to enable this option." FOUND_AS Miles LICENSE "Miles") -config_package(RAD_MSS "Miles Sound System") +package_status(RAD_MSS "Miles Sound System") # FMOD Ex find_package(FMODEx QUIET) @@ -287,7 +287,7 @@ package_option(FMODEX from Firelight Technologies. This audio library is free for non-commercial use." LICENSE "FMOD") -config_package(FMODEX "FMOD Ex sound library") +package_status(FMODEX "FMOD Ex sound library") # OpenAL find_package(OpenAL QUIET) @@ -297,7 +297,7 @@ package_option(OPENAL on most platforms this will imply OpenAL Soft, which is LGPL licensed." IMPORTED_AS OpenAL::OpenAL LICENSE "LGPL") -config_package(OPENAL "OpenAL sound library") +package_status(OPENAL "OpenAL sound library") if(OPENAL_FOUND AND APPLE) 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." IMPORTED_AS freetype) -config_package(FREETYPE "FreeType") +package_status(FREETYPE "FreeType") # HarfBuzz @@ -329,7 +329,7 @@ package_option(HARFBUZZ "This enables support for the HarfBuzz text shaping library." IMPORTED_AS harfbuzz::harfbuzz) -config_package(HARFBUZZ "HarfBuzz") +package_status(HARFBUZZ "HarfBuzz") # GTK2 @@ -338,7 +338,7 @@ 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) package_option(GTK2) -config_package(GTK2 "gtk+-2") +package_status(GTK2 "gtk+-2") # # ------------ Physics engines ------------ @@ -350,7 +350,7 @@ find_package(Bullet MODULE QUIET) package_option(BULLET "Enable this option to support game dynamics with the Bullet physics library.") -config_package(BULLET "Bullet physics") +package_status(BULLET "Bullet physics") # ODE find_package(ODE QUIET) @@ -360,7 +360,7 @@ package_option(ODE LICENSE "BSD-3" IMPORTED_AS ODE::ODE) -config_package(ODE "Open Dynamics Engine") +package_status(ODE "Open Dynamics Engine") # PhysX find_package(PhysX QUIET) @@ -369,7 +369,7 @@ package_option(PHYSX "Enable this option to support game dynamics with Nvidia PhysX." LICENSE "Nvidia") -config_package(PHYSX "Nvidia PhysX") +package_status(PHYSX "Nvidia PhysX") # # ------------ SpeedTree ------------ @@ -382,7 +382,7 @@ package_option(SPEEDTREE "Enable this option to include scenegraph support for SpeedTree trees." LICENSE "SpeedTree") -config_package(SPEEDTREE "SpeedTree") +package_status(SPEEDTREE "SpeedTree") # # ------------ Rendering APIs ------------ @@ -396,7 +396,7 @@ package_option(GL FOUND_AS OPENGL IMPORTED_AS OpenGL::GL) -config_package(GL "OpenGL") +package_status(GL "OpenGL") # OpenGL ES 1 find_package(OpenGLES1 QUIET) @@ -405,7 +405,7 @@ package_option(GLES1 "Enable support for OpenGL ES 1.x rendering APIs." FOUND_AS OPENGLES1) -config_package(GLES1 "OpenGL ES 1.x") +package_status(GLES1 "OpenGL ES 1.x") # OpenGL ES 2 find_package(OpenGLES2 QUIET) @@ -414,7 +414,7 @@ package_option(GLES2 "Enable support for OpenGL ES 2.x rendering APIs." FOUND_AS OPENGLES2) -config_package(GLES2 "OpenGL ES 2.x") +package_status(GLES2 "OpenGL ES 2.x") # # ------------ Display APIs ------------ @@ -444,9 +444,9 @@ if(HAVE_GLX AND NOT HAVE_GLX_AVAILABLE) endif() if(HAVE_GLX) - config_package(X11 "X11" "with GLX") + package_status(X11 "X11" "with GLX") else() - config_package(X11 "X11" "without GLX") + package_status(X11 "X11" "without GLX") endif() # EGL @@ -456,7 +456,7 @@ package_option(EGL "Enable support for the Khronos EGL context management interface for OpenGL ES. This is necessary to support OpenGL ES under X11.") -config_package(EGL "EGL") +package_status(EGL "EGL") # Direct3D 9 @@ -466,7 +466,7 @@ package_option(DX9 "Enable support for DirectX 9. This is typically only viable on Windows." FOUND_AS DIRECT3D9) -config_package(DX9 "Direct3D 9.x") +package_status(DX9 "Direct3D 9.x") # # ------------ Vision tools ------------ @@ -479,7 +479,7 @@ package_option(OPENCV "Enable support for OpenCV. This will be built into the 'vision' package." FOUND_AS OpenCV) -config_package(OPENCV "OpenCV") +package_status(OPENCV "OpenCV") # ARToolKit find_package(ARToolKit QUIET) @@ -487,7 +487,7 @@ find_package(ARToolKit QUIET) package_option(ARTOOLKIT "Enable support for ARToolKit. This will be built into the 'vision' package.") -config_package(ARTOOLKIT "ARToolKit") +package_status(ARTOOLKIT "ARToolKit") ######## # TODO # @@ -495,15 +495,15 @@ config_package(ARTOOLKIT "ARToolKit") # Find and configure Awesomium #find_package(Awesomium) -#config_package(AWESOMIUM COMMENT "Awesomium") +#package_status(AWESOMIUM COMMENT "Awesomium") # Find and configure OpenMaya #find_package(OpenMaya) -#config_package(MAYA COMMENT "OpenMaya") +#package_status(MAYA COMMENT "OpenMaya") # Find and configure FCollada #find_package(FCollada) -#config_package(FCOLLADA COMMENT "FCollada") +#package_status(FCOLLADA COMMENT "FCollada") #if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) # set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") # if(USE_COLLADA) @@ -517,11 +517,11 @@ config_package(ARTOOLKIT "ARToolKit") # Find and configure Assimp #find_package(Assimp) -#config_package(ASSIMP COMMENT "Assimp") +#package_status(ASSIMP COMMENT "Assimp") # Find and configure libRocket #find_package(Rocket) -#config_package(ROCKET COMMENT "libRocket") +#package_status(ROCKET COMMENT "libRocket") #if(HAVE_ROCKET AND HAVE_PYTHON) # # Check for rocket python bindings # if(FOUND_ROCKET_PYTHON) @@ -543,4 +543,4 @@ config_package(ARTOOLKIT "ARToolKit") # Find and configure Vorbis #find_package(Vorbis) -#config_package(VORBIS COMMENT "Vorbis Ogg decoder") +#package_status(VORBIS COMMENT "Vorbis Ogg decoder") From aea53844d8f5019b3017ee19b84757e18c560d53 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 8 Nov 2018 22:56:16 -0700 Subject: [PATCH 552/744] CMake: dxgsg9's USE_GENERIC_DXERR_LIBRARY should be public The reason is that it's used in the public headers, so we need to make sure that users of the public headers also use the same preprocessor definition. --- panda/src/dxgsg9/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt index 1db30265a9..25c2fa1a8a 100644 --- a/panda/src/dxgsg9/CMakeLists.txt +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -40,7 +40,7 @@ add_component_library(p3dxgsg9 SYMBOL BUILDING_PANDADX ${P3DXGSG9_HEADERS} ${P3DXGSG9_SOURCES}) target_link_libraries(p3dxgsg9 p3windisplay panda PKG::CG PKG::DX9) -target_compile_definitions(p3dxgsg9 PRIVATE USE_GENERIC_DXERR_LIBRARY) # FIXME +target_compile_definitions(p3dxgsg9 PUBLIC USE_GENERIC_DXERR_LIBRARY) # FIXME if(NOT BUILD_METALIBS) install(TARGETS p3dxgsg9 DESTINATION lib RUNTIME DESTINATION bin) From 1a80b69fb19ef7170c13b346eba0f5fca03ade9a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Nov 2018 01:43:01 -0700 Subject: [PATCH 553/744] CMake: Clean out a few old TODOs and comments --- dtool/Config.cmake | 71 +----------------------------------------- dtool/LocalSetup.cmake | 46 --------------------------- dtool/Package.cmake | 56 --------------------------------- 3 files changed, 1 insertion(+), 172 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 1d39651c91..34a3626b4e 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -442,26 +442,6 @@ that is built into Panda. TinyDisplay is not as full-featured as Mesa but is many times faster." ${IS_NOT_MINSIZE_BUILD}) -# TODO: OpenGL ES -# Is OpenGL ES 1.x installed, and where? -#find_package(OpenGLES) - -#package_option(GLES -# "Enable OpenGL ES 1.x support, a minimal subset of -#OpenGL for mobile devices.") - -# Is OpenGL ES 2.x installed, and where? -#find_package(OpenGLES) - -#package_option(GLES2 -# "Enable OpenGL ES 2.x support, a version of OpenGL ES but without -#fixed-function pipeline - everything is programmable there.") - -# Is EGL installed, and where? -#package_option(EGL -# "Enable EGL support. EGL is like GLX, but for OpenGL ES.") - - # Is SDL installed, and where? set(Threads_FIND_QUIETLY TRUE) # Fix for builtin FindSDL set(Eigen3_FIND_QUIETLY TRUE) # Fix for builtin FindSDL @@ -482,26 +462,6 @@ mark_as_advanced(SDL_LIBRARY) mark_as_advanced(SDL_LIBRARY_TEMP) -# TODO: XF86DGA -# This defines if we have XF86DGA installed. -#find_package(XF86DGA QUIET) - -#package_option(XF86DGA -# "This enables smooth FPS-style mouse in x11display, -#when mouse mode M_relative is used.") - - -# TODO: XRANDR -#find_package(Xrandr QUIET) -#package_option(XRANDR -# "This enables resolution switching in x11display.") - - -# TODO: XCURSOR -#find_package(Xcursor QUIET) -#package_option(XCURSOR -# "This enables custom cursor support in x11display.") - if(HAVE_GL AND HAVE_X11 AND NOT APPLE) option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." ON) else() @@ -524,15 +484,6 @@ cmake_dependent_option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." ON cmake_dependent_option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." OFF "APPLE" OFF) -# -# <<<<<< Insert the rest of the Config.pp -# port of third-party libs here <<<<<<< -# - - - - - # # Miscellaneous settings # @@ -582,16 +533,6 @@ mark_as_advanced(HAVE_SGI_RGB HAVE_TGA HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM) -# -# <<<<< Insert the rest of the Config.pp -# port of miscellaneous settings here <<<<< -# - - - - - - # How to invoke bison and flex. Panda takes advantage of some # bison/flex features, and therefore specifically requires bison and # flex, not some other versions of yacc and lex. However, you only @@ -610,12 +551,6 @@ set(HAVE_BISON ${BISON_FOUND}) set(HAVE_FLEX ${FLEX_FOUND}) -# -# >>>>> Below is entirely temporary config information -# until the port of Config.pp is finished. -# It should be re-arranged for above. >>>>>> -# - ### Configure threading support ### set(CMAKE_THREAD_PREFER_PTHREAD ON) set(THREADS_PREFER_PTHREAD_FLAG ON) @@ -634,11 +569,7 @@ slightly slow down Panda for the single CPU case." IMPORTED_AS Threads::Threads) # Configure debug threads -if(CMAKE_BUILD_TYPE MATCHES "Debug") - option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ON) -else() - option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) -endif() +option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ${IS_DEBUG_BUILD}) option(SIMPLE_THREADS "If on, compile with simulated threads. Threads, by default, use diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index c92ca758c6..65823c77c5 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -155,52 +155,6 @@ endif() # Now go through all the packages and report whether we have them. show_packages() -if(HAVE_TINYDISPLAY) - message("+ Tinydisplay") -else() - message("- Not building Tinydisplay") -endif() - -if(HAVE_AWESOMIUM) - message("+ AWESOMIUM") -else() - message("- Did not find AWESOMIUM") -endif() - -if(HAVE_MAYA) - message("+ OpenMaya") -else() - message("- Did not find OpenMaya") -endif() - -if(HAVE_FCOLLADA) - message("+ FCollada") -else() - message("- Did not find FCollada") -endif() - -if(HAVE_ASSIMP) - message("+ Assimp") -else() - message("- Did not find Assimp") -endif() - -if(HAVE_ROCKET) - if(HAVE_ROCKET_PYTHON) - message("+ libRocket with Python bindings") - else() - message("+ libRocket without Python bindings") - endif() -else() - message("- Did not find libRocket") -endif() - -if(HAVE_VORBIS) - message("+ libvorbis (Ogg Vorbis Decoder)") -else() - message("- Did not find libvorbis (Ogg Vorbis Decoder)") -endif() - message("") if(INTERROGATE_PYTHON_INTERFACE) message("Compilation will generate Python interfaces for Python ${PYTHON_VERSION_STRING}.") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 501fe0b71c..ed083ad03e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -488,59 +488,3 @@ package_option(ARTOOLKIT "Enable support for ARToolKit. This will be built into the 'vision' package.") package_status(ARTOOLKIT "ARToolKit") - -######## -# TODO # -######## - -# Find and configure Awesomium -#find_package(Awesomium) -#package_status(AWESOMIUM COMMENT "Awesomium") - -# Find and configure OpenMaya -#find_package(OpenMaya) -#package_status(MAYA COMMENT "OpenMaya") - -# Find and configure FCollada -#find_package(FCollada) -#package_status(FCOLLADA COMMENT "FCollada") -#if(FOUND_COLLADA14DOM OR FOUND_COLLADA15DOM) -# set(USE_COLLADA TRUE CACHE BOOL "If true, compile Panda3D with COLLADA DOM") -# if(USE_COLLADA) -# if(FOUND_COLLADA15DOM) -# set(HAVE_COLLADA15DOM TRUE) -# else() -# set(HAVE_COLLADA14DOM TRUE) -# endif() -# endif() -#endif() - -# Find and configure Assimp -#find_package(Assimp) -#package_status(ASSIMP COMMENT "Assimp") - -# Find and configure libRocket -#find_package(Rocket) -#package_status(ROCKET COMMENT "libRocket") -#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) -# if(USE_ROCKET_PYTHON) -# set(HAVE_ROCKET_PYTHON TRUE) -# endif() -# else() -# unset(USE_ROCKET_PYTHON CACHE) -# endif() -# if(HAVE_ROCKET_PYTHON) -# message(STATUS "+ libRocket with Python bindings") -# else() -# message(STATUS "+ libRocket without Python bindings") -# endif() -#else() -# unset(USE_ROCKET_PYTHON CACHE) -#endif() - -# Find and configure Vorbis -#find_package(Vorbis) -#package_status(VORBIS COMMENT "Vorbis Ogg decoder") From c3f9fdf778064c6068248dc8e49a335c8e7073c5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 9 Nov 2018 17:46:03 -0700 Subject: [PATCH 554/744] CMake: Organize Package.cmake a bit better --- dtool/Package.cmake | 274 ++++++++++++++++++++++---------------------- 1 file changed, 139 insertions(+), 135 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index ed083ad03e..55e7650952 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -80,9 +80,92 @@ if(HAVE_PYTHON) "Suffix for Python binary extension modules.") endif() + # -# ------------ Eigen ------------ +# ------------ Data handling libraries ------------ # + +# OpenSSL +find_package(OpenSSL COMPONENTS SSL Crypto QUIET) + +package_option(OPENSSL + DEFAULT ON + "Enable OpenSSL support" + IMPORTED_AS OpenSSL::SSL OpenSSL::Crypto) + +option(REPORT_OPENSSL_ERRORS + "Define this true to include the OpenSSL code to report verbose +error messages when they occur." ${IS_DEBUG_BUILD}) + +if(REPORT_OPENSSL_ERRORS) + package_status(OPENSSL "OpenSSL" "with verbose error reporting") +else() + package_status(OPENSSL "OpenSSL") +endif() + +# zlib +find_package(ZLIB QUIET) + +package_option(ZLIB + "Enables support for compression of Panda assets." + IMPORTED_AS ZLIB::ZLIB) + +package_status(ZLIB "zlib") + + +# +# ------------ Image formats ------------ +# + +# JPEG +find_package(JPEG QUIET) +package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") +package_status(JPEG "libjpeg") + +# PNG +find_package(PNG QUIET) +package_option(PNG + DEFAULT ON + "Enable support for loading .png images." + IMPORTED_AS PNG::PNG) +package_status(PNG "libpng") + +# TIFF +find_package(TIFF QUIET) +package_option(TIFF "Enable support for loading .tif images.") +package_status(TIFF "libtiff") + +# OpenEXR +find_package(OpenEXR QUIET) +package_option(OPENEXR "Enable support for loading .exr images.") +package_status(OPENEXR "OpenEXR") + +# libsquish +find_package(LibSquish QUIET) + +package_option(SQUISH + "Enables support for automatic compression of DXT textures." + FOUND_AS LIBSQUISH) + +package_status(SQUISH "libsquish") + + +# +# ------------ Archival formats ------------ +# + +# libtar +find_package(Tar QUIET) +package_option(TAR + "This is used to optimize patch generation against tar files.") +package_status(TAR "libtar") + + +# +# ------------ Math libraries ------------ +# + +# Eigen find_package(Eigen3 QUIET) package_option(EIGEN @@ -107,65 +190,7 @@ else() package_status(EIGEN "Eigen linear algebra library" "vectorization NOT enabled in build") endif() -# -# ------------ OpenSSL ------------ -# -find_package(OpenSSL COMPONENTS SSL Crypto QUIET) - -package_option(OPENSSL - DEFAULT ON - "Enable OpenSSL support" - IMPORTED_AS OpenSSL::SSL OpenSSL::Crypto) - -option(REPORT_OPENSSL_ERRORS - "Define this true to include the OpenSSL code to report verbose -error messages when they occur." ${IS_DEBUG_BUILD}) - -if(REPORT_OPENSSL_ERRORS) - package_status(OPENSSL "OpenSSL" "with verbose error reporting") -else() - package_status(OPENSSL "OpenSSL") -endif() - -# -# ------------ IMAGE FORMATS ------------ -# - -# JPEG: -find_package(JPEG QUIET) -package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") -package_status(JPEG "libjpeg") - -# PNG: -find_package(PNG QUIET) -package_option(PNG - DEFAULT ON - "Enable support for loading .png images." - IMPORTED_AS PNG::PNG) -package_status(PNG "libpng") - -# TIFF: -find_package(TIFF QUIET) -package_option(TIFF "Enable support for loading .tif images.") -package_status(TIFF "libtiff") - -# OpenEXR: -find_package(OpenEXR QUIET) -package_option(OPENEXR "Enable support for loading .exr images.") -package_status(OPENEXR "OpenEXR") - -# -# ------------ LIBTAR ------------ -# -find_package(Tar QUIET) -package_option(TAR - "This is used to optimize patch generation against tar files.") -package_status(TAR "libtar") - -# -# ------------ FFTW ------------ -# - +# FFTW find_package(FFTW3 QUIET) package_option(FFTW @@ -177,73 +202,12 @@ package_option(FFTW package_status(FFTW "FFTW") -# -# ------------ libsquish ------------ -# - -find_package(LibSquish QUIET) - -package_option(SQUISH - "Enables support for automatic compression of DXT textures." - FOUND_AS LIBSQUISH) - -package_status(SQUISH "libsquish") # -# ------------ Nvidia Cg ------------ -# - -find_package(Cg QUIET) - -package_option(CG - "Enable support for Nvidia Cg Shading Language" - LICENSE "Nvidia") -package_option(CGGL - "Enable support for Nvidia Cg's OpenGL API." - LICENSE "Nvidia") -package_option(CGD3D9 - "Enable support for Nvidia Cg's Direct3D 9 API." - LICENSE "Nvidia") - -if(HAVE_CGGL AND HAVE_CGD3D9) - set(cg_apis "supporting OpenGL and Direct3D 9") -elseif(HAVE_CGGL) - set(cg_apis "supporting OpenGL") -elseif(HAVE_CGDX9) - set(cg_apis "supporting Direct3D 9") -else() - set(cg_apis "WITHOUT rendering backend support") -endif() -package_status(CG "Nvidia Cg Shading Language" "${cg_apis}") - -# -# ------------ VRPN ------------ -# - -find_package(VRPN QUIET) - -package_option(VRPN - "Enables support for connecting to VRPN servers. This is only needed if you - are building Panda3D for a fixed VRPN-based VR installation.") - -package_status(VRPN "VRPN") - -# -# ------------ zlib ------------ -# - -find_package(zlib QUIET) - -package_option(ZLIB - "Enables support for compression of Panda assets." - IMPORTED_AS ZLIB::ZLIB) - -package_status(ZLIB "zlib") - -# -# ------------ FFmpeg ------------ +# ------------ Multimedia formats ------------ # +# FFmpeg find_package(FFMPEG QUIET) find_package(SWScale QUIET) find_package(SWResample QUIET) @@ -333,13 +297,13 @@ package_status(HARFBUZZ "HarfBuzz") # GTK2 -# Find and configure GTK 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) package_option(GTK2) package_status(GTK2 "gtk+-2") + # # ------------ Physics engines ------------ # @@ -371,6 +335,7 @@ package_option(PHYSX package_status(PHYSX "Nvidia PhysX") + # # ------------ SpeedTree ------------ # @@ -384,6 +349,7 @@ package_option(SPEEDTREE package_status(SPEEDTREE "SpeedTree") + # # ------------ Rendering APIs ------------ # @@ -416,11 +382,45 @@ package_option(GLES2 package_status(GLES2 "OpenGL ES 2.x") +# Direct3D 9 +find_package(Direct3D9 QUIET COMPONENTS dxguid dxerr d3dx9) + +package_option(DX9 + "Enable support for DirectX 9. This is typically only viable on Windows." + FOUND_AS DIRECT3D9) + +package_status(DX9 "Direct3D 9.x") + +# Nvidia Cg +find_package(Cg QUIET) + +package_option(CG + "Enable support for Nvidia Cg Shading Language" + LICENSE "Nvidia") +package_option(CGGL + "Enable support for Nvidia Cg's OpenGL API." + LICENSE "Nvidia") +package_option(CGD3D9 + "Enable support for Nvidia Cg's Direct3D 9 API." + LICENSE "Nvidia") + +if(HAVE_CGGL AND HAVE_CGD3D9) + set(cg_apis "supporting OpenGL and Direct3D 9") +elseif(HAVE_CGGL) + set(cg_apis "supporting OpenGL") +elseif(HAVE_CGDX9) + set(cg_apis "supporting Direct3D 9") +else() + set(cg_apis "WITHOUT rendering backend support") +endif() +package_status(CG "Nvidia Cg Shading Language" "${cg_apis}") + + # # ------------ Display APIs ------------ # -# X11 +# X11 (and GLX) find_package(X11 QUIET) if(NOT X11_Xkb_FOUND OR NOT X11_Xutil_FOUND) @@ -458,16 +458,6 @@ package_option(EGL package_status(EGL "EGL") -# Direct3D 9 - -find_package(Direct3D9 QUIET COMPONENTS dxguid dxerr d3dx9) - -package_option(DX9 - "Enable support for DirectX 9. This is typically only viable on Windows." - FOUND_AS DIRECT3D9) - -package_status(DX9 "Direct3D 9.x") - # # ------------ Vision tools ------------ # @@ -488,3 +478,17 @@ package_option(ARTOOLKIT "Enable support for ARToolKit. This will be built into the 'vision' package.") package_status(ARTOOLKIT "ARToolKit") + + +# +# ------------ VR integration ------------ +# + +# VRPN +find_package(VRPN QUIET) + +package_option(VRPN + "Enables support for connecting to VRPN servers. This is only needed if you + are building Panda3D for a fixed VRPN-based VR installation.") + +package_status(VRPN "VRPN") From 226dc69af231dff0a62b248f89db9124a80616ca Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 12 Nov 2018 15:44:14 -0700 Subject: [PATCH 555/744] CMake: Remove references to deleted files in ode --- panda/src/ode/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index b80183aa7c..42a44fcf32 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -79,8 +79,6 @@ set(P3ODE_IGATEEXT odeUtil_ext.h) set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") -list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeConvexGeom.h") -list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHeightFieldGeom.h") list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") composite_sources(p3ode P3ODE_SOURCES) From 1ae736f88194eca755be861189602173f069cf2d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 12 Nov 2018 15:49:08 -0700 Subject: [PATCH 556/744] CMake: Detect and build support for Assimp --- cmake/modules/FindAssimp.cmake | 28 ++++++++++++++++++++++++++++ dtool/Package.cmake | 11 +++++++++++ pandatool/CMakeLists.txt | 1 + pandatool/src/assimp/CMakeLists.txt | 29 +++++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 cmake/modules/FindAssimp.cmake create mode 100644 pandatool/src/assimp/CMakeLists.txt diff --git a/cmake/modules/FindAssimp.cmake b/cmake/modules/FindAssimp.cmake new file mode 100644 index 0000000000..0f1696d971 --- /dev/null +++ b/cmake/modules/FindAssimp.cmake @@ -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) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 55e7650952..c30402aa6b 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -161,6 +161,17 @@ package_option(TAR 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 ------------ # diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 194f298f44..3acefaf1f7 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -3,6 +3,7 @@ if(NOT BUILD_PANDA) endif() # Include pandatool source directories +add_subdirectory(src/assimp) add_subdirectory(src/bam) add_subdirectory(src/converter) add_subdirectory(src/cvscopy) diff --git a/pandatool/src/assimp/CMakeLists.txt b/pandatool/src/assimp/CMakeLists.txt new file mode 100644 index 0000000000..b65bdca8df --- /dev/null +++ b/pandatool/src/assimp/CMakeLists.txt @@ -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}) From 7f8d7366dc5d8c20e1a81c695857fd7a50846869 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 12 Nov 2018 17:23:30 -0700 Subject: [PATCH 557/744] CMake: Update for upstream Interrogate changes - "igateruntime" is no longer a thing - interrogate_module embeds a preamble; we have to provide it - WindowProperties now has an extension --- cmake/macros/Interrogate.cmake | 2 +- dtool/src/interrogate/CMakeLists.txt | 32 +++++++++++++++++-- dtool/src/interrogatedb/CMakeLists.txt | 43 +++++++------------------- panda/src/display/CMakeLists.txt | 2 ++ panda/src/ode/CMakeLists.txt | 13 +++++--- 5 files changed, 52 insertions(+), 40 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 31c2e480e6..48859cad4c 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -310,7 +310,7 @@ function(add_python_module module) ) add_python_target(panda3d.${module} "${module}_module.cxx" ${sources} ${extensions}) - target_link_libraries(panda3d.${module} ${link_targets} p3igateruntime) + target_link_libraries(panda3d.${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11") # CMake <3.11 doesn't allow generator expressions on source files, so we diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 0367567f66..8882aa1af4 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -22,7 +22,8 @@ set(INTERROGATE_HEADERS parameterRemapToString.h parameterRemapHandleToInt.h parameterRemapUnchanged.h - typeManager.h) + typeManager.h +) set(INTERROGATE_SOURCES functionRemap.cxx @@ -47,7 +48,15 @@ set(INTERROGATE_SOURCES parameterRemapToString.cxx parameterRemapHandleToInt.cxx parameterRemapUnchanged.cxx - typeManager.cxx) + typeManager.cxx +) + +set(INTERROGATE_PREAMBLE_PYTHON_NATIVE + ../interrogatedb/py_panda.cxx + ../interrogatedb/py_compat.cxx + ../interrogatedb/py_wrappers.cxx + ../interrogatedb/dtool_super_base.cxx +) composite_sources(interrogate INTERROGATE_SOURCES) @@ -55,7 +64,24 @@ add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub PKG::OPENSSL) -add_executable(interrogate_module interrogate_module.cxx) +# Python preamble for interrogate_module +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx + "extern const char interrogate_preamble_python_native[];\n") +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx + "const char interrogate_preamble_python_native[] = (\n") +foreach(preamble_file ${INTERROGATE_PREAMBLE_PYTHON_NATIVE}) + file(READ ${preamble_file} preamble_content) + string(REPLACE "\\" "\\\\" preamble_content "${preamble_content}") + string(REPLACE "\"" "\\\"" preamble_content "${preamble_content}") + string(REPLACE "\n" "\\n" preamble_content "${preamble_content}") + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx + " \"${preamble_content}\"\n") +endforeach(preamble_file) +file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx + ");\n") + +add_executable(interrogate_module interrogate_module.cxx + ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx) target_link_libraries(interrogate_module p3cppParser p3dtoolconfig p3pystub PKG::OPENSSL) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 65e4fdf669..a62730f057 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -9,10 +9,8 @@ set(P3INTERROGATEDB_HEADERS interrogateManifest.I interrogateManifest.h interrogateType.I interrogateType.h interrogate_datafile.I interrogate_datafile.h - interrogate_interface.h interrogate_request.h) - -set(P3IGATERUNTIME_HEADERS - extension.h py_compat.h py_panda.h py_wrappers.h) + interrogate_interface.h interrogate_request.h +) set(P3INTERROGATEDB_SOURCES config_interrogatedb.cxx @@ -23,17 +21,17 @@ set(P3INTERROGATEDB_SOURCES interrogateMakeSeq.cxx interrogateManifest.cxx interrogateType.cxx interrogate_datafile.cxx - interrogate_interface.cxx interrogate_request.cxx) - -set(P3IGATERUNTIME_SOURCES - dtool_super_base.cxx - py_compat.cxx - ${CMAKE_CURRENT_BINARY_DIR}/py_panda.cxx - py_wrappers.cxx) + interrogate_interface.cxx interrogate_request.cxx +) set(P3INTERROGATEDB_IGATE interrogate_interface.h - interrogate_request.h) + interrogate_request.h +) + +set(P3IGATERUNTIME_HEADERS + extension.h py_compat.h py_panda.h py_wrappers.h +) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) @@ -45,25 +43,6 @@ if(NOT BUILD_METALIBS) install(TARGETS p3interrogatedb DESTINATION lib RUNTIME DESTINATION bin) endif() install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) - -# Now we need to build the Interrogate runtime code; this should eventually be -# split out into its own subdirectory. - -# HACK: igateruntime doesn't have its own BUILDING_IGATERUNTIME symbol yet; -# it's still using BUILDING_INTERROGATEDB. - -# py_panda.cxx can't rely on anything from interrogatedb, so: -file(READ ${CMAKE_CURRENT_SOURCE_DIR}/py_panda.cxx _py_panda) -string(REGEX REPLACE "interrogatedb" "prc" _py_panda "${_py_panda}") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/py_panda.cxx "${_py_panda}") - -add_library(p3igateruntime - ${P3IGATERUNTIME_HEADERS} ${P3IGATERUNTIME_SOURCES}) -set_target_properties(p3igateruntime PROPERTIES - DEFINE_SYMBOL BUILDING_INTERROGATEDB) # HACK -target_link_libraries(p3igateruntime p3dtoolconfig PKG::PYTHON) - -install(TARGETS p3igateruntime DESTINATION lib RUNTIME DESTINATION bin) install(FILES ${P3IGATERUNTIME_HEADERS} DESTINATION include/panda3d) # ALSO: This has an Interrogate binding! Take care of that if we want it. @@ -91,4 +70,4 @@ add_custom_command( add_python_target(panda3d.interrogatedb "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") -target_link_libraries(panda3d.interrogatedb p3igateruntime) +target_link_libraries(panda3d.interrogatedb p3dtoolconfig) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 2061079646..aea52bd766 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -71,6 +71,8 @@ set(P3DISPLAY_IGATEEXT graphicsWindow_ext.h pythonGraphicsWindowProc.cxx pythonGraphicsWindowProc.h + windowProperties_ext.cxx + windowProperties_ext.h ) if(APPLE) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 42a44fcf32..fc574d7747 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -39,7 +39,8 @@ set(P3ODE_HEADERS odeTriMeshData.I odeTriMeshData.h odeTriMeshGeom.I odeTriMeshGeom.h odeCollisionEntry.I odeCollisionEntry.h - odeHelperStructs.h) + odeHelperStructs.h +) set(P3ODE_SOURCES config_ode.cxx @@ -62,9 +63,11 @@ set(P3ODE_SOURCES odePlaneGeom.cxx odeCappedCylinderGeom.cxx odeCylinderGeom.cxx odeRayGeom.cxx odeTriMeshData.cxx odeTriMeshGeom.cxx - odeCollisionEntry.cxx) + odeCollisionEntry.cxx +) set(P3ODE_IGATEEXT + odeBody_ext.cxx odeBody_ext.h odeBody_ext.I odeGeom_ext.cxx @@ -76,7 +79,8 @@ set(P3ODE_IGATEEXT odeSpace_ext.h odeSpace_ext.I odeUtil_ext.cxx - odeUtil_ext.h) + odeUtil_ext.h +) set(P3ODE_IGATE_SOURCES "${P3ODE_HEADERS};${P3ODE_SOURCES}") list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") @@ -84,7 +88,8 @@ list(REMOVE_ITEM P3ODE_IGATE_SOURCES "odeHelperStructs.h") composite_sources(p3ode P3ODE_SOURCES) add_library(p3ode ${P3ODE_SOURCES} ${P3ODE_HEADERS}) set_target_properties(p3ode PROPERTIES DEFINE_SYMBOL BUILDING_PANDAODE) -target_link_libraries(p3ode p3igateruntime panda PKG::ODE) +target_link_libraries(p3ode panda + PKG::ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) install(TARGETS p3ode DESTINATION lib RUNTIME DESTINATION bin) From f59c6bb2bfddd231c5662bd2da48b3ffe1059fcb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 14 Nov 2018 17:41:27 -0700 Subject: [PATCH 558/744] CMake: Make FindODE link against libccd when present This fixes building against the macOS/Homebrew version of ODE. --- cmake/modules/FindODE.cmake | 71 +++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/cmake/modules/FindODE.cmake b/cmake/modules/FindODE.cmake index 643d233ac6..6bd51c21f3 100644 --- a/cmake/modules/FindODE.cmake +++ b/cmake/modules/FindODE.cmake @@ -21,44 +21,46 @@ # ODE::ODE_double - If available, this links against double-precision ODE # -if(NOT ODE_INCLUDE_DIR OR NOT ODE_LIBRARY_DIR) - # Find the libode include files - find_path(ODE_INCLUDE_DIR "ode/ode.h") +# Find the libode include files +find_path(ODE_INCLUDE_DIR "ode/ode.h") - # Find the libode library built for release - find_library(ODE_RELEASE_LIBRARY - NAMES "ode" "libode") +# Find the libode library built for release +find_library(ODE_RELEASE_LIBRARY + NAMES "ode" "libode") - # Find the libode library built for debug - find_library(ODE_DEBUG_LIBRARY - NAMES "oded" "liboded") +# Find the libode library built for debug +find_library(ODE_DEBUG_LIBRARY + NAMES "oded" "liboded") - # Find the single-precision library built for release - find_library(ODE_SINGLE_RELEASE_LIBRARY - NAMES "ode_single" "libode_single") +# Find the single-precision library built for release +find_library(ODE_SINGLE_RELEASE_LIBRARY + NAMES "ode_single" "libode_single") - # Find the single-precision library built for debug - find_library(ODE_SINGLE_DEBUG_LIBRARY - NAMES "ode_singled" "libode_singled") +# Find the single-precision library built for debug +find_library(ODE_SINGLE_DEBUG_LIBRARY + NAMES "ode_singled" "libode_singled") - # Find the double-precision library built for release - find_library(ODE_DOUBLE_RELEASE_LIBRARY - NAMES "ode_double" "libode_double" ) +# Find the double-precision library built for release +find_library(ODE_DOUBLE_RELEASE_LIBRARY + NAMES "ode_double" "libode_double") - # Find the double-precision library built for debug - find_library(ODE_DOUBLE_DEBUG_LIBRARY - NAMES "ode_doubled" "libode_doubled") +# Find the double-precision library built for debug +find_library(ODE_DOUBLE_DEBUG_LIBRARY + NAMES "ode_doubled" "libode_doubled") - unset(_ODE_LIB_PATHS) +# Find libccd, which ODE sometimes links against, so we want to let the linker +# know about it if it's present. +find_library(ODE_LIBCCD_LIBRARY + NAMES "ccd" "libccd") - mark_as_advanced(ODE_INCLUDE_DIR) - mark_as_advanced(ODE_RELEASE_LIBRARY) - mark_as_advanced(ODE_DEBUG_LIBRARY) - mark_as_advanced(ODE_SINGLE_RELEASE_LIBRARY) - mark_as_advanced(ODE_SINGLE_DEBUG_LIBRARY) - mark_as_advanced(ODE_DOUBLE_RELEASE_LIBRARY) - mark_as_advanced(ODE_DOUBLE_DEBUG_LIBRARY) -endif() +mark_as_advanced(ODE_INCLUDE_DIR) +mark_as_advanced(ODE_RELEASE_LIBRARY) +mark_as_advanced(ODE_DEBUG_LIBRARY) +mark_as_advanced(ODE_SINGLE_RELEASE_LIBRARY) +mark_as_advanced(ODE_SINGLE_DEBUG_LIBRARY) +mark_as_advanced(ODE_DOUBLE_RELEASE_LIBRARY) +mark_as_advanced(ODE_DOUBLE_DEBUG_LIBRARY) +mark_as_advanced(ODE_LIBCCD_LIBRARY) # Define targets for both precisions (and unspecified) foreach(_precision _single _double "") @@ -72,6 +74,11 @@ foreach(_precision _single _double "") set_target_properties(ODE::ODE${_precision} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ODE_INCLUDE_DIR}") + if(ODE_LIBCCD_LIBRARY) + set_target_properties(ODE::ODE${_precision} PROPERTIES + INTERFACE_LINK_LIBRARIES "${ODE_LIBCCD_LIBRARY}") + endif() + if(EXISTS "${ODE${_PRECISION}_RELEASE_LIBRARY}") set_property(TARGET ODE::ODE${_precision} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) @@ -121,6 +128,7 @@ if(NOT TARGET ODE::ODE) foreach(_prop INTERFACE_INCLUDE_DIRECTORIES INTERFACE_COMPILE_DEFINITIONS + INTERFACE_LINK_LIBRARIES IMPORTED_CONFIGURATIONS IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE IMPORTED_LOCATION_RELEASE @@ -128,11 +136,12 @@ if(NOT TARGET ODE::ODE) IMPORTED_LOCATION_DEBUG) get_target_property(_value "${_copy_from}" "${_prop}") - if(DEFINED _value) + if(_value) set_target_properties(ODE::ODE PROPERTIES "${_prop}" "${_value}") endif() unset(_value) endforeach(_prop) + unset(_prop) endif() unset(_copy_from) From 9be6b6b314e36edc4944365e3ecaacbe5a81f319 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 28 Nov 2018 14:03:33 -0700 Subject: [PATCH 559/744] CMake: Work around bug in CMake 3.0.2 CMake versions that old insist that source files in the binary directory be specified absolutely or do not contain `..`, so we do the former. --- cmake/macros/Interrogate.cmake | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 48859cad4c..109ff1037f 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -252,8 +252,9 @@ function(add_python_module module) set(targets) set(link_targets) set(import_flags) - set(infiles) - set(sources) + set(infiles_rel) + set(infiles_abs) + set(sources_abs) set(extensions) set(link_keyword OFF) @@ -279,21 +280,22 @@ function(add_python_module module) endif() foreach(target ${targets}) - get_target_property(workdir "${target}" TARGET_BINDIR) - if(NOT workdir) + get_target_property(workdir_abs "${target}" TARGET_BINDIR) + if(NOT workdir_abs) # No TARGET_BINDIR was set, so we'll just use our current directory: - set(workdir "${CMAKE_CURRENT_BINARY_DIR}") + set(workdir_abs "${CMAKE_CURRENT_BINARY_DIR}") endif() # Keep command lines short - file(RELATIVE_PATH workdir "${CMAKE_CURRENT_BINARY_DIR}" "${workdir}") + file(RELATIVE_PATH workdir_rel "${CMAKE_CURRENT_BINARY_DIR}" "${workdir_abs}") interrogate_sources(${target} - "${workdir}/${target}_igate.cxx" "${workdir}/${target}.in" + "${workdir_abs}/${target}_igate.cxx" "${workdir_abs}/${target}.in" "-python-native;-module;panda3d.${module}") get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) - list(APPEND infiles "${workdir}/${target}.in") - list(APPEND sources "${workdir}/${target}_igate.cxx") + list(APPEND infiles_rel "${workdir_rel}/${target}.in") + list(APPEND infiles_abs "${workdir_abs}/${target}.in") + list(APPEND sources_abs "${workdir_abs}/${target}_igate.cxx") list(APPEND extensions ${target_extensions}) endforeach(target) @@ -304,19 +306,19 @@ function(add_python_module module) -module ${module} -library ${module} ${import_flags} ${INTERROGATE_MODULE_OPTIONS} - ${IMOD_FLAGS} ${infiles} - DEPENDS host_interrogate_module ${infiles} + ${IMOD_FLAGS} ${infiles_rel} + DEPENDS host_interrogate_module ${infiles_abs} COMMENT "Generating module ${module}" ) - add_python_target(panda3d.${module} "${module}_module.cxx" ${sources} ${extensions}) + add_python_target(panda3d.${module} "${module}_module.cxx" ${sources_abs} ${extensions}) target_link_libraries(panda3d.${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11") # CMake <3.11 doesn't allow generator expressions on source files, so we # need to copy them to our target, which does allow them. - foreach(source ${sources}) + foreach(source ${sources_abs}) get_source_file_property(compile_definitions "${source}" COMPILE_DEFINITIONS) if(compile_definitions) set_property(TARGET panda3d.${module} APPEND PROPERTY From 1f029b1cd32ed6f3e22bab12714b777e06c3ec2d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 27 Nov 2018 19:20:33 -0700 Subject: [PATCH 560/744] CMake: Fix pandagles(2) component lists --- panda/metalibs/pandagles/CMakeLists.txt | 2 +- panda/metalibs/pandagles2/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt index 3c5969c373..b3e87024ad 100644 --- a/panda/metalibs/pandagles/CMakeLists.txt +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -14,6 +14,6 @@ add_metalib(pandagles ${MODULE_TYPE} INCLUDE "${GLES1_PIPE_INCLUDE}" INIT init_libpandagles pandagles.h EXPORT int get_pipe_type_pandagles "${GLES1_PIPE_TYPE}::get_class_type().get_index()" - COMPONENTS p3egldisplay_gles1 p3glesgsg) + COMPONENTS p3egldisplay_gles1 p3glesgsg p3glstuff p3x11display) install(TARGETS pandagles DESTINATION ${MODULE_DESTINATION}) diff --git a/panda/metalibs/pandagles2/CMakeLists.txt b/panda/metalibs/pandagles2/CMakeLists.txt index a327ccf267..e1d378c27f 100644 --- a/panda/metalibs/pandagles2/CMakeLists.txt +++ b/panda/metalibs/pandagles2/CMakeLists.txt @@ -6,6 +6,6 @@ add_metalib(pandagles2 ${MODULE_TYPE} INCLUDE eglGraphicsPipe.h INIT init_libpandagles2 pandagles2.h EXPORT int get_pipe_type_pandagles2 "eglGraphicsPipe::get_class_type().get_index()" - COMPONENTS p3egldisplay_gles2 p3gles2gsg) + COMPONENTS p3egldisplay_gles2 p3gles2gsg p3glstuff p3x11display) install(TARGETS pandagles2 DESTINATION ${MODULE_DESTINATION}) From 940ef456ff2b5236c4177b35d84a48c8ca1e1f26 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 27 Nov 2018 19:21:01 -0700 Subject: [PATCH 561/744] CMake: Only link PRIVATEly against libraries not installed --- pandatool/src/assimp/CMakeLists.txt | 4 ++-- pandatool/src/egg-palettize/CMakeLists.txt | 2 +- pandatool/src/ptloader/CMakeLists.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pandatool/src/assimp/CMakeLists.txt b/pandatool/src/assimp/CMakeLists.txt index b65bdca8df..22792091a4 100644 --- a/pandatool/src/assimp/CMakeLists.txt +++ b/pandatool/src/assimp/CMakeLists.txt @@ -23,7 +23,7 @@ set(P3ASSIMP_SOURCES 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) +target_link_libraries(p3assimp PRIVATE p3pandatoolbase) +target_link_libraries(p3assimp PUBLIC PKG::ASSIMP) install(TARGETS p3assimp DESTINATION ${MODULE_DESTINATION}) diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 81e7da0ace..570e6beeb6 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -4,5 +4,5 @@ install(TARGETS egg-palettize DESTINATION bin) add_library(p3txafile txaFileFilter.cxx txaFileFilter.h txaFileFilter.I) set_target_properties(p3txafile PROPERTIES DEFINE_SYMBOL BUILDING_MISC) -target_link_libraries(p3txafile p3palettizer) +target_link_libraries(p3txafile PRIVATE p3palettizer) install(TARGETS p3txafile DESTINATION lib RUNTIME DESTINATION bin) diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt index c3335c37d4..34dbfacabf 100644 --- a/pandatool/src/ptloader/CMakeLists.txt +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -11,7 +11,7 @@ set(P3PTLOADER_SOURCES composite_sources(p3ptloader P3PTLOADER_SOURCES) add_library(p3ptloader ${MODULE_TYPE} ${P3PTLOADER_HEADERS} ${P3PTLOADER_SOURCES}) set_target_properties(p3ptloader PROPERTIES DEFINE_SYMBOL BUILDING_PTLOADER) -target_link_libraries(p3ptloader +target_link_libraries(p3ptloader PRIVATE p3dxfegg p3fltegg p3lwoegg p3objegg p3vrmlegg p3xfileegg p3converter) From 8df53698f4323e81f035123db4ab76e342858f3a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 27 Nov 2018 21:51:31 -0700 Subject: [PATCH 562/744] CMake: Add missing .h/.I files that weren't getting installed --- direct/src/dcparser/CMakeLists.txt | 4 +++- dtool/src/dtoolbase/CMakeLists.txt | 2 ++ dtool/src/dtoolutil/CMakeLists.txt | 1 + dtool/src/interrogate/CMakeLists.txt | 4 ++-- dtool/src/interrogatedb/CMakeLists.txt | 2 +- dtool/src/prc/CMakeLists.txt | 3 ++- panda/src/cocoadisplay/CMakeLists.txt | 6 +++++- panda/src/collide/CMakeLists.txt | 1 + panda/src/downloader/CMakeLists.txt | 2 +- panda/src/express/CMakeLists.txt | 10 ++++++---- panda/src/glxdisplay/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 2 ++ panda/src/linmath/CMakeLists.txt | 13 ++++++++----- panda/src/movies/CMakeLists.txt | 1 + panda/src/nativenet/CMakeLists.txt | 6 ++++-- panda/src/osxdisplay/CMakeLists.txt | 4 +++- panda/src/particlesystem/CMakeLists.txt | 9 ++++++++- panda/src/physics/CMakeLists.txt | 1 + panda/src/pipeline/CMakeLists.txt | 4 +++- panda/src/pnmimage/CMakeLists.txt | 1 + panda/src/pnmimagetypes/CMakeLists.txt | 4 +++- panda/src/putil/CMakeLists.txt | 5 +++++ panda/src/tform/CMakeLists.txt | 5 +++-- 23 files changed, 67 insertions(+), 25 deletions(-) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 3780cf5293..fd05dabe14 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -20,7 +20,9 @@ set(P3DCPARSER_HEADERS dcSwitch.h dcTypedef.h dcPython.h - dcbase.h dcindent.h hashGenerator.h + dcbase.h dcindent.h + dcmsgtypes.h + hashGenerator.h primeNumberGenerator.h) set(P3DCPARSER_SOURCES diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 20557d0c7d..a534eede91 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -15,6 +15,7 @@ set(P3DTOOLBASE_HEADERS addHash.I addHash.h atomicAdjust.h atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I + atomicAdjustGccImpl.h atomicAdjustGccImpl.I atomicAdjustI386Impl.h atomicAdjustI386Impl.I atomicAdjustPosixImpl.h atomicAdjustPosixImpl.I atomicAdjustWin32Impl.h atomicAdjustWin32Impl.I @@ -48,6 +49,7 @@ set(P3DTOOLBASE_HEADERS pdeque.h plist.h pmap.h pset.h pvector.h epvector.h lookup3.h + version.h ) set(P3DTOOLBASE_SOURCES diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index e624bf5985..3fdd4d990c 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -20,6 +20,7 @@ set(P3DTOOLUTIL_HEADERS vector_double.h vector_float.h vector_int.h + vector_stdfloat.h vector_string.h vector_uchar.h vector_src.h diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 8882aa1af4..3f5b5d2ce1 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -91,8 +91,8 @@ if(NOT CMAKE_CROSSCOMPILING) endif() if(WANT_INTERROGATE) - install(TARGETS interrogate DESTINATION bin) - install(TARGETS interrogate_module DESTINATION bin) + install(TARGETS interrogate interrogate_module DESTINATION bin) + install(FILES ${INTERROGATE_HEADERS} DESTINATION include/panda3d) else() set_target_properties(interrogate interrogate_module PROPERTIES EXCLUDE_FROM_ALL ON) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index a62730f057..70550022bd 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -30,7 +30,7 @@ set(P3INTERROGATEDB_IGATE ) set(P3IGATERUNTIME_HEADERS - extension.h py_compat.h py_panda.h py_wrappers.h + extension.h py_compat.h py_panda.h py_panda.I py_wrappers.h ) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 0d834afd62..d23243a183 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -1,6 +1,7 @@ configure_file(prc_parameters.h.in prc_parameters.h) set(P3PRC_HEADERS + androidLogStream.h bigEndian.h config_prc.h configDeclaration.I configDeclaration.h @@ -27,7 +28,7 @@ set(P3PRC_HEADERS notifyCategory.I notifyCategory.h notifyCategoryProxy.I notifyCategoryProxy.h notifySeverity.h - prcKeyRegistry.h + prcKeyRegistry.h prcKeyRegistry.I reversedNumericData.I reversedNumericData.h streamReader.I streamReader.h streamWrapper.I streamWrapper.h diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index bd7673ef89..a0a35227c2 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -4,10 +4,14 @@ endif() set(P3COCOADISPLAY_HEADERS config_cocoadisplay.h + cocoaGraphicsBuffer.h cocoaGraphicsBuffer.I cocoaGraphicsPipe.h cocoaGraphicsPipe.I cocoaGraphicsWindow.h cocoaGraphicsWindow.I cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I - cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h + cocoaPandaApp.h + cocoaPandaView.h + cocoaPandaWindow.h + cocoaPandaWindowDelegate.h cocoaPandaAppDelegate.h) set(P3COCOADISPLAY_SOURCES diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index ef29604e87..344453092e 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -28,6 +28,7 @@ set(P3COLLIDE_HEADERS collisionTraverser.I collisionTraverser.h collisionTube.I collisionTube.h collisionVisualizer.I collisionVisualizer.h + config_collide.h ) set(P3COLLIDE_SOURCES collisionBox.cxx diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 6f03d4bcba..ab9950285b 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -8,7 +8,7 @@ set(P3DOWNLOADER_HEADERS decompressor.h decompressor.I documentSpec.h documentSpec.I download_utils.h downloadDb.h downloadDb.I - extractor.h + extractor.h extractor.I httpAuthorization.I httpAuthorization.h httpBasicAuthorization.I httpBasicAuthorization.h httpChannel.I httpChannel.h diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index e6d3e11482..663ab97844 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -49,10 +49,12 @@ set(P3EXPRESS_HEADERS threadSafePointerToBase.I threadSafePointerToBase.h trueClock.I trueClock.h typedReferenceCount.I typedReferenceCount.h typedef.h - virtualFile.I virtualFileList.I virtualFileList.h virtualFileMount.h - virtualFileComposite.h virtualFileComposite.I virtualFile.h - virtualFileMount.I virtualFileMountMultifile.h - virtualFileMountMultifile.I + virtualFileList.I virtualFileList.h + virtualFileComposite.h virtualFileComposite.I + virtualFile.h virtualFile.I + virtualFileMount.h virtualFileMount.I + virtualFileMountAndroidAsset.h virtualFileMountAndroidAsset.I + virtualFileMountMultifile.h virtualFileMountMultifile.I virtualFileMountRamdisk.h virtualFileMountRamdisk.I virtualFileMountSystem.h virtualFileMountSystem.I virtualFileSimple.h virtualFileSimple.I diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 19aab8a49f..33abd3298b 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3GLXDISPLAY_HEADERS glxGraphicsBuffer.h glxGraphicsBuffer.I glxGraphicsPipe.h glxGraphicsPipe.I glxGraphicsPixmap.h glxGraphicsPixmap.I - glxGraphicsWindow.h + glxGraphicsWindow.h glxGraphicsWindow.I glxGraphicsStateGuardian.h glxGraphicsStateGuardian.I posixGraphicsStateGuardian.h posixGraphicsStateGuardian.I panda_glxext.h diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index a4df5f7f32..cb5d5e5597 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -43,6 +43,8 @@ set(P3GOBJ_HEADERS perspectiveLens.I perspectiveLens.h preparedGraphicsObjects.I preparedGraphicsObjects.h queryContext.I queryContext.h + samplerContext.h samplerContext.I + samplerState.h samplerState.I savedContext.I savedContext.h shader.I shader.h shaderBuffer.h shaderBuffer.I diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index c3fa7332bd..2eddca24d4 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -5,11 +5,14 @@ set(P3LINMATH_HEADERS configVariableColor.h configVariableColor.I coordinateSystem.h dbl2fltnames.h dblnames.h deg_2_rad.h deg_2_rad.I - flt2dblnames.h fltnames.h lcast_to.h lcast_to_src.h - lcast_to_src.I lmatrix.h lmatrix_ext.h lmatrix3_src.I - lmatrix3_src.h lmatrix4_src.I - lmatrix4_src.h lorientation.h - lorientation_src.I lorientation_src.h + flt2dblnames.h fltnames.h + intnames.h + lcast_to.h lcast_to_src.h lcast_to_src.I + lmatrix.h lmatrix_ext.h + lmat_ops.h lmat_ops_src.h lmat_ops_src.I + lmatrix3_src.h lmatrix3_src.I + lmatrix4_src.h lmatrix4_src.I + lorientation.h lorientation_src.h lorientation_src.I lpoint2.h lpoint2_src.I lpoint2_src.h lpoint3.h lpoint3_src.I lpoint3_src.h lpoint4.h lpoint4_src.I lpoint4_src.h diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 0f03bbadc5..1e41eee994 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -1,4 +1,5 @@ set(P3MOVIES_HEADERS + dr_flac.h config_movies.h flacAudio.h flacAudio.I flacAudioCursor.h flacAudioCursor.I diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 7598a61942..bef8d792c9 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -3,16 +3,18 @@ if(NOT WANT_NATIVE_NET) endif() set(P3NATIVENET_HEADERS + config_nativenet.h buffered_datagramconnection.h buffered_datagramreader.h buffered_datagramreader.I ringbuffer.h ringbuffer.I socket_ip.h - socket_tcp_listen.h time_accumulator.h time_out.h + socket_tcp.h socket_tcp_listen.h socket_tcp_ssl.h + time_accumulator.h time_out.h socket_address.I socket_address.h socket_portable.h time_base.h time_span.h buffered_datagramwriter.h socket_base.h socket_selector.h socket_udp.h socket_udp_incoming.h time_clock.h - membuffer.h membuffer.I socket_fdset.h socket_tcp.h + membuffer.h membuffer.I socket_fdset.h socket_udp_outgoing.h time_general.h) set(P3NATIVENET_SOURCES diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index a26fc51123..d7ea87b582 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -4,12 +4,14 @@ endif() set(P3OSXDISPLAY_HEADERS config_osxdisplay.h + osxGraphicsBuffer.h osxGraphicsPipe.h osxGraphicsWindow.h osxGraphicsWindow.I osxGraphicsStateGuardian.h) set(P3OSXDISPLAY_SOURCES - config_osxdisplay.cxx osxGraphicsPipe.cxx osxGraphicsStateGuardian.cxx + config_osxdisplay.cxx + osxGraphicsPipe.cxx osxGraphicsStateGuardian.cxx osxGraphicsBuffer.cxx) composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index d6b74b057a..51136d03bf 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -5,8 +5,11 @@ set(P3PARTICLESYSTEM_HEADERS baseParticleRenderer.h arcEmitter.I arcEmitter.h boxEmitter.I boxEmitter.h config_particlesystem.h discEmitter.I discEmitter.h + emitters.h geomParticleRenderer.I geomParticleRenderer.h lineEmitter.I lineEmitter.h lineParticleRenderer.I lineParticleRenderer.h + particlefactories.h + particles.h particleSystem.I particleSystem.h particleSystemManager.I particleSystemManager.h pointEmitter.I pointEmitter.h pointParticle.h pointParticleFactory.h @@ -36,12 +39,16 @@ set(P3PARTICLESYSTEM_SOURCES tangentRingEmitter.cxx zSpinParticle.cxx zSpinParticleFactory.cxx colorInterpolationManager.cxx) +set(P3PARTICLESYSTEM_IGATE_SOURCES "${P3PARTICLESYSTEM_HEADERS};${P3PARTICLESYSTEM_SOURCES}") +list(REMOVE_ITEM P3PARTICLESYSTEM_IGATE_SOURCES "emitters.h") +list(REMOVE_ITEM P3PARTICLESYSTEM_IGATE_SOURCES "particlefactories.h") +list(REMOVE_ITEM P3PARTICLESYSTEM_IGATE_SOURCES "particles.h") composite_sources(p3particlesystem P3PARTICLESYSTEM_SOURCES) add_component_library(p3particlesystem SYMBOL BUILDING_PANDA_PARTICLESYSTEM ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) target_link_libraries(p3particlesystem p3physics panda) -target_interrogate(p3particlesystem ALL) +target_interrogate(p3particlesystem ${P3PARTICLESYSTEM_IGATE_SOURCES}) if(NOT BUILD_METALIBS) install(TARGETS p3particlesystem DESTINATION lib RUNTIME DESTINATION bin) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 7d17f65cbe..68f2b5a1aa 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -3,6 +3,7 @@ set(P3PHYSICS_HEADERS angularIntegrator.h angularVectorForce.I angularVectorForce.h baseForce.I baseForce.h baseIntegrator.I baseIntegrator.h config_physics.h + forces.h forceNode.I forceNode.h linearControlForce.I linearControlForce.h linearCylinderVortexForce.I linearCylinderVortexForce.h diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 8af739fcfb..2e150f22e4 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -45,7 +45,8 @@ set(P3PIPELINE_HEADERS pmutex.h pmutex.I reMutex.I reMutex.h reMutexDirect.h reMutexDirect.I - reMutexHolder.I reMutexHolder.h + reMutexHolder.h reMutexHolder.I + reMutexSpinlockImpl.h reMutexSpinlockImpl.I psemaphore.h psemaphore.I thread.h thread.I threadImpl.h threadDummyImpl.h threadDummyImpl.I @@ -97,6 +98,7 @@ set(P3PIPELINE_SOURCES reMutex.cxx reMutexDirect.cxx reMutexHolder.cxx + reMutexSpinlockImpl.cxx psemaphore.cxx thread.cxx threadDummyImpl.cxx diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 807cf1f9f9..66f881361b 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -1,5 +1,6 @@ set(P3PNMIMAGE_HEADERS config_pnmimage.h + convert_srgb.h convert_srgb.I pfmFile.I pfmFile.h pnmbitio.h pnmBrush.h pnmBrush.I diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index c29e7ae1a3..e6afb05a33 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -1,5 +1,6 @@ set(P3PNMIMAGETYPES_HEADERS - config_pnmimagetypes.h pnmFileTypeBMP.h + config_pnmimagetypes.h + pnmFileTypeBMP.h pnmFileTypeEXR.h pnmFileTypeIMG.h pnmFileTypePNG.h @@ -10,6 +11,7 @@ set(P3PNMIMAGETYPES_HEADERS pnmFileTypeTGA.h pnmFileTypeTIFF.h pnmFileTypeJPG.h + sgi.h ) set(P3PNMIMAGETYPES_SOURCES diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 2dc2830b13..f0fd79a06e 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -42,6 +42,7 @@ set(P3PUTIL_HEADERS indirectCompareTo.I indirectCompareTo.h ioPtaDatagramFloat.h ioPtaDatagramInt.h ioPtaDatagramShort.h keyboardButton.h + iterator_types.h linkedListNode.I linkedListNode.h load_prc_file.h loaderOptions.I loaderOptions.h @@ -59,7 +60,9 @@ set(P3PUTIL_HEADERS typedWritableReferenceCount.h updateSeq.I updateSeq.h uniqueIdAllocator.h vector_typedWritable.h + vector_ulong.h vector_ushort.h vector_writable.h + weakKeyHashMap.h weakKeyHashMap.I writableConfigurable.h writableParam.I writableParam.h ) @@ -109,7 +112,9 @@ set(P3PUTIL_SOURCES typedWritableReferenceCount.cxx updateSeq.cxx uniqueIdAllocator.cxx vector_typedWritable.cxx + vector_ulong.cxx vector_ushort.cxx vector_writable.cxx + weakKeyHashMap.cxx writableConfigurable.cxx writableParam.cxx ) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index ec1eaa5da5..a4e92c0083 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -4,8 +4,9 @@ set(P3TFORM_HEADERS driveInterface.I driveInterface.h mouseInterfaceNode.I mouseInterfaceNode.h mouseSubregion.I mouseSubregion.h - mouseWatcher.I mouseWatcher.h - mouseWatcherBase.h mouseWatcherGroup.h + mouseWatcher.h mouseWatcher.I + mouseWatcherBase.h mouseWatcherBase.I + mouseWatcherGroup.h mouseWatcherParameter.I mouseWatcherParameter.h mouseWatcherRegion.I mouseWatcherRegion.h trackball.h From e49306fec91488a0f79f3c81a60621adefbc21c3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 27 Nov 2018 22:42:15 -0700 Subject: [PATCH 563/744] CMake: Wrap target names in $ This helps CMake's export generator understand the expression. --- cmake/macros/BuildMetalib.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 50d16af44a..4fc483c0ef 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -58,8 +58,8 @@ if(CMAKE_VERSION VERSION_LESS "3.12") set(is_object "$,OBJECT_LIBRARY>") set(is_component "$>") - set(name_of_component "$<${is_component}:${library}>") - set(name_of_non_component "$<$:${library}>") + set(name_of_component "$<${is_component}:$>") + set(name_of_non_component "$<$:$>") endif() # Libraries are only linked transitively if they aren't components. From 368cdc2802caa1937f6b0d6afdd0f972d6749d01 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 1 Dec 2018 14:42:56 -0700 Subject: [PATCH 564/744] CMake: Move pandac.* generation to be part of direct --- CMakeLists.txt | 26 -------------------------- direct/CMakeLists.txt | 24 ++++++++++++++++++++++++ 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a2116607a1..33f882d20d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,29 +166,3 @@ if(INTERROGATE_PYTHON_INTERFACE) add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests") endif() - -# This bit is to generate the 'pandac' compatibility shim. It's deprecated now, -# but in older versions of Panda3D, one would use -# from pandac.PandaModules import * -# instead of -# from panda3d.FOO import * -if(HAVE_PYTHON) - # Generate PandaModules: - file(WRITE "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" - "\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\" - -print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") - - foreach(module ${ALL_INTERROGATE_MODULES}) - file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" " -try: - from panda3d.${module} import * -except ImportError as err: - if \"No module named %s\" not in str(err): - raise -") - endforeach() - - # Now install ourselves: - install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB) -endif() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 9c8d4a4411..b417dedd8e 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -49,4 +49,28 @@ if(HAVE_PYTHON) # Install all files install_python_package("${PROJECT_BINARY_DIR}/direct" LIB) + + # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, + # but in older versions of Panda3D, one would use + # from pandac.PandaModules import * + # instead of + # from panda3d.FOO import * + # Generate PandaModules: + file(WRITE "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" + "\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\" + +print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") + + foreach(module ${ALL_INTERROGATE_MODULES}) + file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" " +try: + from panda3d.${module} import * +except ImportError as err: + if not (\"No module named\" in str(err) and \"${module}\" in str(err)): + raise +") + endforeach() + + # Now install ourselves: + install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB) endif() From 58dd889165150d00cfd52fed64e83dcd4c973864 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Dec 2018 18:55:55 -0700 Subject: [PATCH 565/744] CMake: Simplify Interrogate.cmake's add_python_module() keyword handling --- cmake/macros/Interrogate.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 109ff1037f..1e0134e5ff 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -257,19 +257,16 @@ function(add_python_module module) set(sources_abs) set(extensions) - set(link_keyword OFF) - set(import_keyword OFF) + set(keyword) foreach(arg ${ARGN}) - if(arg STREQUAL "LINK") - set(link_keyword ON) - set(import_keyword OFF) - elseif(arg STREQUAL "IMPORT") - set(link_keyword OFF) - set(import_keyword ON) - elseif(link_keyword) + if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT") + set(keyword "${arg}") + elseif(keyword STREQUAL "LINK") list(APPEND link_targets "${arg}") - elseif(import_keyword) + set(keyword) + elseif(keyword STREQUAL "IMPORT") list(APPEND import_flags "-import" "${arg}") + set(keyword) else() list(APPEND targets "${arg}") endif() From b3e257746e4c52095c798723cbdb5846c9e8de03 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Dec 2018 19:51:04 -0700 Subject: [PATCH 566/744] CMake: Oops, fix where `panda3d` Python package goes --- cmake/macros/Interrogate.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 1e0134e5ff..7114d9b762 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -334,5 +334,5 @@ endfunction(add_python_module) if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS) # The Interrogate path needs to be installed to the architecture-dependent # Python directory. - install_python_package("${PROJECT_BINARY_DIR}/panda3d") + install_python_package("${PROJECT_BINARY_DIR}/panda3d" ARCH) endif() From 9fffb5605a3b338922915d64b9ee328b81f6fd99 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Dec 2018 17:47:19 -0700 Subject: [PATCH 567/744] CMake: Update Python install macros to accept COMPONENT and EXPORT --- cmake/macros/Python.cmake | 59 +++++++++++++++++++++++++++++---------- 1 file changed, 44 insertions(+), 15 deletions(-) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index a04679f5d3..6cac9001a0 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -10,12 +10,14 @@ # # -# Function: add_python_target(target [source1 [source2 ...]]) +# Function: add_python_target(target [EXPORT exp] [COMPONENT comp] +# [source1 [source2 ...]]) # Build the provided source(s) as a Python extension module, linked against the # Python runtime library. # # Note that this also takes care of installation, unlike other target creation -# commands in CMake. +# commands in CMake. The EXPORT and COMPONENT keywords allow passing the +# corresponding options to install(), but default to "Python" otherwise. # function(add_python_target target) if(NOT HAVE_PYTHON) @@ -23,7 +25,21 @@ function(add_python_target target) endif() string(REGEX REPLACE "^.*\\." "" basename "${target}") - set(sources ${ARGN}) + set(sources) + set(component "Python") + set(export "Python") + foreach(arg ${ARGN}) + if(arg STREQUAL "COMPONENT") + set(keyword "component") + elseif(arg STREQUAL "EXPORT") + set(keyword "export") + elseif(keyword) + set(${keyword} "${arg}") + unset(keyword) + else() + list(APPEND sources "${arg}") + endif() + endforeach(arg) string(REGEX REPLACE "\\.[^.]+$" "" namespace "${target}") string(REPLACE "." "_" underscore_namespace "${namespace}") @@ -40,14 +56,14 @@ function(add_python_target target) SUFFIX "${PYTHON_EXTENSION_SUFFIX}") if(PYTHON_ARCH_INSTALL_DIR) - install(TARGETS ${target} DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") + install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") endif() else() set_target_properties(${target} PROPERTIES OUTPUT_NAME "${basename}" PREFIX "libpython_${underscore_namespace}_") - install(TARGETS ${target} DESTINATION lib) + install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION lib) endif() set(keywords OVERWRITE ARCH) @@ -59,7 +75,7 @@ function(add_python_target target) endfunction(add_python_target) # -# Function: install_python_package(path [ARCH/LIB]) +# Function: install_python_package(path [ARCH/LIB] [COMPONENT component]) # # Installs the Python package which was built at `path`. # @@ -71,16 +87,28 @@ endfunction(add_python_target) # installed into Python's architecture-dependent or architecture-independent # package path. The default, if unspecified, is LIB. # +# The COMPONENT keyword overrides the install component (see CMake's +# documentation for more information on what this does). The default is +# "Python". +# function(install_python_package path) - if(ARGN STREQUAL "ARCH") - set(type "ARCH") - elseif(ARGN STREQUAL "LIB") - set(type "LIB") - elseif(ARGN STREQUAL "") - set(type "LIB") - else() - message(FATAL_ERROR "install_python_package got unexpected argument: ${ARGN}") - endif() + set(type "LIB") + set(component "Python") + set(component_keyword OFF) + foreach(arg ${ARGN}) + if(arg STREQUAL "ARCH") + set(type "ARCH") + elseif(arg STREQUAL "LIB") + set(type "LIB") + elseif(arg STREQUAL "COMPONENT") + set(component_keyword ON) + elseif(component_keyword) + set(component "${arg}") + set(component_keyword OFF) + else() + message(FATAL_ERROR "install_python_package got unexpected argument: ${ARGN}") + endif() + endforeach(arg) get_filename_component(package_name "${path}" NAME) set(custom_target "bytecompile_${package_name}") @@ -104,6 +132,7 @@ function(install_python_package path) set(dir ${PYTHON_${type}_INSTALL_DIR}) if(dir) install(DIRECTORY "${path}" DESTINATION "${dir}" + COMPONENT "${component}" FILES_MATCHING REGEX "\\.py[co]?$") endif() From 8b6a2cfd098ae6f3e6eb56e1f333549dae64c3fa Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Dec 2018 17:48:03 -0700 Subject: [PATCH 568/744] CMake: Update add_python_module to support COMPONENT --- cmake/macros/Interrogate.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 7114d9b762..5c84d048fc 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -250,6 +250,7 @@ function(add_python_module module) endif() set(targets) + set(component "Python") set(link_targets) set(import_flags) set(infiles_rel) @@ -259,7 +260,7 @@ function(add_python_module module) set(keyword) foreach(arg ${ARGN}) - if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT") + if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT" OR arg STREQUAL "COMPONENT") set(keyword "${arg}") elseif(keyword STREQUAL "LINK") list(APPEND link_targets "${arg}") @@ -267,6 +268,9 @@ function(add_python_module module) elseif(keyword STREQUAL "IMPORT") list(APPEND import_flags "-import" "${arg}") set(keyword) + elseif(keyword STREQUAL "COMPONENT") + set(component "${arg}") + set(keyword) else() list(APPEND targets "${arg}") endif() @@ -308,7 +312,8 @@ function(add_python_module module) COMMENT "Generating module ${module}" ) - add_python_target(panda3d.${module} "${module}_module.cxx" ${sources_abs} ${extensions}) + add_python_target(panda3d.${module} COMPONENT "${component}" EXPORT "${component}" + "${module}_module.cxx" ${sources_abs} ${extensions}) target_link_libraries(panda3d.${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11") From 99fee1a64d713ca85970715b5027d76ff1554416 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 6 Dec 2018 17:48:44 -0700 Subject: [PATCH 569/744] CMake: Assign COMPONENT and EXPORT to all targets --- CMakeLists.txt | 2 +- direct/CMakeLists.txt | 14 ++++++++++---- direct/src/dcparse/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 8 ++++++-- direct/src/deadrec/CMakeLists.txt | 8 ++++++-- direct/src/directbase/CMakeLists.txt | 3 ++- direct/src/distributed/CMakeLists.txt | 8 ++++++-- direct/src/interval/CMakeLists.txt | 8 ++++++-- direct/src/motiontrail/CMakeLists.txt | 8 ++++++-- direct/src/showbase/CMakeLists.txt | 19 ++++++++++++++----- dtool/LocalSetup.cmake | 1 + dtool/metalibs/dtool/CMakeLists.txt | 8 +++++++- dtool/metalibs/dtoolconfig/CMakeLists.txt | 9 ++++++++- dtool/src/cppparser/CMakeLists.txt | 2 +- dtool/src/dconfig/CMakeLists.txt | 3 ++- dtool/src/dtoolbase/CMakeLists.txt | 8 ++++++-- dtool/src/dtoolutil/CMakeLists.txt | 8 ++++++-- dtool/src/interrogate/CMakeLists.txt | 4 ++-- dtool/src/interrogatedb/CMakeLists.txt | 10 +++++++--- dtool/src/prc/CMakeLists.txt | 8 ++++++-- dtool/src/pystub/CMakeLists.txt | 2 +- panda/CMakeLists.txt | 10 +++++----- panda/metalibs/panda/CMakeLists.txt | 8 +++++++- panda/metalibs/pandadx9/CMakeLists.txt | 7 ++++++- panda/metalibs/pandaegg/CMakeLists.txt | 8 +++++++- panda/metalibs/pandaexpress/CMakeLists.txt | 8 +++++++- panda/metalibs/pandagl/CMakeLists.txt | 7 ++++++- panda/metalibs/pandagles/CMakeLists.txt | 7 ++++++- panda/metalibs/pandagles2/CMakeLists.txt | 7 ++++++- panda/metalibs/pandaphysics/CMakeLists.txt | 8 +++++++- panda/src/audio/CMakeLists.txt | 8 ++++++-- panda/src/audiotraits/CMakeLists.txt | 18 +++++++++++++++--- panda/src/bullet/CMakeLists.txt | 8 ++++++-- panda/src/chan/CMakeLists.txt | 8 ++++++-- panda/src/char/CMakeLists.txt | 8 ++++++-- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/collide/CMakeLists.txt | 8 ++++++-- panda/src/configfiles/CMakeLists.txt | 2 +- panda/src/cull/CMakeLists.txt | 8 ++++++-- panda/src/device/CMakeLists.txt | 8 ++++++-- panda/src/dgraph/CMakeLists.txt | 8 ++++++-- panda/src/display/CMakeLists.txt | 8 ++++++-- panda/src/downloader/CMakeLists.txt | 8 ++++++-- panda/src/downloadertools/CMakeLists.txt | 4 +++- panda/src/dxgsg9/CMakeLists.txt | 8 ++++++-- panda/src/dxml/CMakeLists.txt | 8 ++++++-- panda/src/egg/CMakeLists.txt | 8 ++++++-- panda/src/egg2pg/CMakeLists.txt | 8 ++++++-- panda/src/egldisplay/CMakeLists.txt | 14 +++++++++++--- panda/src/event/CMakeLists.txt | 8 ++++++-- panda/src/express/CMakeLists.txt | 8 ++++++-- panda/src/ffmpeg/CMakeLists.txt | 8 ++++++-- panda/src/framework/CMakeLists.txt | 8 ++++++-- panda/src/gles2gsg/CMakeLists.txt | 8 ++++++-- panda/src/glesgsg/CMakeLists.txt | 8 ++++++-- panda/src/glgsg/CMakeLists.txt | 8 ++++++-- panda/src/glstuff/CMakeLists.txt | 8 ++++++-- panda/src/glxdisplay/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 8 ++++++-- panda/src/grutil/CMakeLists.txt | 8 ++++++-- panda/src/gsgbase/CMakeLists.txt | 8 ++++++-- panda/src/linmath/CMakeLists.txt | 8 ++++++-- panda/src/mathutil/CMakeLists.txt | 8 ++++++-- panda/src/movies/CMakeLists.txt | 8 ++++++-- panda/src/nativenet/CMakeLists.txt | 8 ++++++-- panda/src/net/CMakeLists.txt | 8 ++++++-- panda/src/ode/CMakeLists.txt | 8 ++++++-- panda/src/osxdisplay/CMakeLists.txt | 2 +- panda/src/pandabase/CMakeLists.txt | 3 ++- panda/src/parametrics/CMakeLists.txt | 8 ++++++-- panda/src/particlesystem/CMakeLists.txt | 8 ++++++-- panda/src/pgraph/CMakeLists.txt | 8 ++++++-- panda/src/pgraphnodes/CMakeLists.txt | 8 ++++++-- panda/src/pgui/CMakeLists.txt | 8 ++++++-- panda/src/physics/CMakeLists.txt | 8 ++++++-- panda/src/pipeline/CMakeLists.txt | 8 ++++++-- panda/src/pnmimage/CMakeLists.txt | 8 ++++++-- panda/src/pnmimagetypes/CMakeLists.txt | 6 +++++- panda/src/pnmtext/CMakeLists.txt | 8 ++++++-- panda/src/pstatclient/CMakeLists.txt | 10 +++++++--- panda/src/putil/CMakeLists.txt | 10 +++++++--- panda/src/recorder/CMakeLists.txt | 8 ++++++-- panda/src/testbed/CMakeLists.txt | 2 +- panda/src/text/CMakeLists.txt | 8 ++++++-- panda/src/tform/CMakeLists.txt | 8 ++++++-- panda/src/vision/CMakeLists.txt | 8 ++++++-- panda/src/vrpn/CMakeLists.txt | 8 ++++++-- panda/src/wgldisplay/CMakeLists.txt | 9 +++++++++ panda/src/windisplay/CMakeLists.txt | 8 ++++++++ panda/src/x11display/CMakeLists.txt | 2 +- pandatool/src/assimp/CMakeLists.txt | 2 +- pandatool/src/bam/CMakeLists.txt | 8 ++++---- pandatool/src/dxfprogs/CMakeLists.txt | 6 +++--- pandatool/src/egg-mkfont/CMakeLists.txt | 2 +- pandatool/src/egg-optchar/CMakeLists.txt | 2 +- pandatool/src/egg-palettize/CMakeLists.txt | 4 ++-- pandatool/src/egg-qtess/CMakeLists.txt | 2 +- pandatool/src/eggprogs/CMakeLists.txt | 18 +++++++++--------- pandatool/src/fltprogs/CMakeLists.txt | 10 +++++----- pandatool/src/gtk-stats/CMakeLists.txt | 2 +- pandatool/src/imageprogs/CMakeLists.txt | 10 +++++----- pandatool/src/lwoprogs/CMakeLists.txt | 4 ++-- pandatool/src/miscprogs/CMakeLists.txt | 2 +- pandatool/src/objprogs/CMakeLists.txt | 4 ++-- pandatool/src/pfmprogs/CMakeLists.txt | 4 ++-- pandatool/src/ptloader/CMakeLists.txt | 2 +- pandatool/src/vrmlprogs/CMakeLists.txt | 4 ++-- pandatool/src/xfileprogs/CMakeLists.txt | 6 +++--- 108 files changed, 551 insertions(+), 208 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 33f882d20d..36fb5a6cfe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,7 @@ if(BUILD_MODELS) *.egg ) install(DIRECTORY "${PROJECT_BINARY_DIR}/models" - DESTINATION share/panda3d) + COMPONENT Models DESTINATION share/panda3d) endif() if(INTERROGATE_PYTHON_INTERFACE) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index b417dedd8e..e2325659ae 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -20,18 +20,24 @@ set(P3DIRECT_COMPONENTS if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "DirectDevel") add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONENTS}) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") # Installation: -install(TARGETS p3direct DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS p3direct + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) if(HAVE_PYTHON) # Now for the Python side of everything add_python_module(direct p3dcparser p3deadrec p3distributed p3interval - p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core) + p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core COMPONENT Direct) # Copy Python source files into the build directory set(DIRECT_INSTALL_DIRECTORIES @@ -48,7 +54,7 @@ if(HAVE_PYTHON) endforeach() # Install all files - install_python_package("${PROJECT_BINARY_DIR}/direct" LIB) + install_python_package("${PROJECT_BINARY_DIR}/direct" LIB COMPONENT Direct) # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, # but in older versions of Panda3D, one would use @@ -72,5 +78,5 @@ except ImportError as err: endforeach() # Now install ourselves: - install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB) + install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB COMPONENT Direct) endif() diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index f4853d7c42..747f5896b2 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(p3dcparse dcparse.cxx) target_link_libraries(p3dcparse p3direct) -install(TARGETS p3dcparse DESTINATION bin) +install(TARGETS p3dcparse EXPORT Direct COMPONENT Direct DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index fd05dabe14..416f337d60 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -55,6 +55,10 @@ target_link_libraries(p3dcparser p3directbase panda PKG::PYTHON) target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) if(NOT BUILD_METALIBS) - install(TARGETS p3dcparser DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3dcparser + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3DCPARSER_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DCPARSER_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 34bf4f2e48..7558db9569 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -12,6 +12,10 @@ target_link_libraries(p3deadrec p3directbase panda) target_interrogate(p3deadrec ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3deadrec DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3deadrec + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3DEADREC_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DEADREC_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index 53a8de1ee7..c4ae151277 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -10,4 +10,5 @@ set(P3DIRECTBASE_HEADERS add_library(p3directbase INTERFACE) target_link_libraries(p3directbase INTERFACE panda) -install(FILES ${P3DIRECTBASE_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3directbase EXPORT Direct COMPONENT Direct) +install(FILES ${P3DIRECTBASE_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index ddf320732f..275514cf8c 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -20,6 +20,10 @@ target_link_libraries(p3distributed p3directbase p3dcparser panda PKG::PYTHON) target_interrogate(p3distributed ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3distributed DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3distributed + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3DISTRIBUTED_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DISTRIBUTED_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 4ded7c6463..f8e7187455 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -42,6 +42,10 @@ target_link_libraries(p3interval p3directbase panda) target_interrogate(p3interval ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3interval DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3interval + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3INTERVAL_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3INTERVAL_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/motiontrail/CMakeLists.txt b/direct/src/motiontrail/CMakeLists.txt index 3a54b9873b..21d0e04583 100644 --- a/direct/src/motiontrail/CMakeLists.txt +++ b/direct/src/motiontrail/CMakeLists.txt @@ -12,6 +12,10 @@ target_link_libraries(p3motiontrail p3directbase panda) target_interrogate(p3motiontrail ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3motiontrail DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3motiontrail + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3MOTIONTRAIL_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3MOTIONTRAIL_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 091ad7c0d4..6e37e65bc6 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -1,13 +1,17 @@ -set(P3SHOWBASE_FILES - showBase.cxx - showBase.h) +set(P3SHOWBASE_HEADERS + showBase.h +) + +set(P3SHOWBASE_SOURCES + showBase.cxx +) if(APPLE) list(APPEND P3SHOWBASE_FILES showBase_assist.mm) endif() add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE - ${P3SHOWBASE_FILES}) + ${P3SHOWBASE_HEADERS} ${P3SHOWBASE_SOURCES}) if(APPLE) set_target_properties(p3showbase PROPERTIES COMPILE_FLAGS "-ObjC++") @@ -17,5 +21,10 @@ target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3showbase DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3showbase + EXPORT Direct COMPONENT Direct + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DirectDevel) endif() +install(FILES ${P3SHOWBASE_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 65823c77c5..1384f18c20 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -190,4 +190,5 @@ endif() configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h") install(FILES "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h" + COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 4dee10d908..7c61e3abde 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -1,3 +1,9 @@ +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(p3dtool INIT init_libdtool dtool.h COMPONENTS p3dtoolutil p3dtoolbase) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS p3dtool DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS p3dtool + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 1b0564c3b3..aa24127592 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,3 +1,10 @@ set(DTOOLCONFIG_LINK_TARGETS p3prc p3interrogatedb) +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) -install(TARGETS p3dtoolconfig DESTINATION lib RUNTIME DESTINATION bin) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) + +install(TARGETS p3dtoolconfig + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 6227ef8f12..1b8fe9f1f7 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -42,4 +42,4 @@ composite_sources(p3cppParser P3CPPPARSER_SOURCES) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) target_link_libraries(p3cppParser p3dtool) -install(TARGETS p3cppParser DESTINATION lib) +install(TARGETS p3cppParser EXPORT Core COMPONENT CoreDevel DESTINATION lib) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 9dff9c0baa..550d8debd3 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -2,4 +2,5 @@ # We're only doing this to put the .h file on the path. add_library(p3dconfig INTERFACE) -install(FILES dconfig.h DESTINATION include/panda3d) +install(FILES dconfig.h COMPONENT CoreDevel DESTINATION include/panda3d) +install(TARGETS p3dconfig EXPORT Core COMPONENT Core) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index a534eede91..152850fbbb 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -95,6 +95,10 @@ target_link_libraries(p3dtoolbase PKG::EIGEN PKG::THREADS) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3dtoolbase DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3dtoolbase + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DTOOLBASE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DTOOLBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 3fdd4d990c..75f9009b58 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -81,6 +81,10 @@ if(APPLE) endif() if(NOT BUILD_METALIBS) - install(TARGETS p3dtoolutil DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3dtoolutil + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DTOOLUTIL_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DTOOLUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 3f5b5d2ce1..4a1fda9e5d 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -91,8 +91,8 @@ if(NOT CMAKE_CROSSCOMPILING) endif() if(WANT_INTERROGATE) - install(TARGETS interrogate interrogate_module DESTINATION bin) - install(FILES ${INTERROGATE_HEADERS} DESTINATION include/panda3d) + install(TARGETS interrogate interrogate_module EXPORT Core COMPONENT CoreDevel DESTINATION bin) + install(FILES ${INTERROGATE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) else() set_target_properties(interrogate interrogate_module PROPERTIES EXCLUDE_FROM_ALL ON) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 70550022bd..1ff55b73b3 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -40,10 +40,14 @@ add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB target_link_libraries(p3interrogatedb p3prc p3dconfig p3dtool) if(NOT BUILD_METALIBS) - install(TARGETS p3interrogatedb DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3interrogatedb + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3INTERROGATEDB_HEADERS} DESTINATION include/panda3d) -install(FILES ${P3IGATERUNTIME_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3INTERROGATEDB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3IGATERUNTIME_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) # ALSO: This has an Interrogate binding! Take care of that if we want it. # Note we don't use the regular Interrogate macros; this has some custom flags diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index d23243a183..3ca67a007d 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -78,6 +78,10 @@ target_link_libraries(p3prc p3dtool PKG::OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3prc DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3prc + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PRC_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PRC_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index 70d8a24a4a..70b7b85898 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -3,4 +3,4 @@ set(P3PYSTUB_SOURCES pystub.cxx) add_library(p3pystub STATIC ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) target_link_libraries(p3pystub p3dtool) -install(FILES ${P3PYSTUB_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 00524ec804..2028613ad1 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -98,24 +98,24 @@ if(HAVE_PYTHON) add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) if(HAVE_BULLET) - add_python_module(bullet p3bullet IMPORT panda3d.core) + add_python_module(bullet p3bullet IMPORT panda3d.core COMPONENT BulletPython) endif() if(HAVE_EGG) - add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core) + add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core COMPONENT EggPython) endif() add_python_module(physics p3physics p3particlesystem LINK pandaphysics IMPORT panda3d.core) if(HAVE_ODE) - add_python_module(ode p3ode IMPORT panda3d.core) + add_python_module(ode p3ode IMPORT panda3d.core COMPONENT ODEPython) endif() if(HAVE_OPENCV OR HAVE_ARTOOLKIT) - add_python_module(vision p3vision IMPORT panda3d.core) + add_python_module(vision p3vision IMPORT panda3d.core COMPONENT VisionPython) endif() if(HAVE_VRPN) - add_python_module(vrpn p3vrpn IMPORT panda3d.core) + add_python_module(vrpn p3vrpn IMPORT panda3d.core COMPONENT VRPNPython) endif() endif() diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 67e0180619..1a8d259b67 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -11,6 +11,12 @@ if(HAVE_FREETYPE) list(APPEND PANDA_LINK_TARGETS p3pnmtext) endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(panda INIT init_libpanda panda.h COMPONENTS ${PANDA_LINK_TARGETS}) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS panda DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS panda + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) diff --git a/panda/metalibs/pandadx9/CMakeLists.txt b/panda/metalibs/pandadx9/CMakeLists.txt index d340d018ec..70d82d89d6 100644 --- a/panda/metalibs/pandadx9/CMakeLists.txt +++ b/panda/metalibs/pandadx9/CMakeLists.txt @@ -2,10 +2,15 @@ if(NOT HAVE_DX9) return() endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "DX9Devel") add_metalib(pandadx9 ${MODULE_TYPE} INCLUDE wdxGraphicsPipe9.h INIT init_libpandadx9 pandadx9.h EXPORT int get_pipe_type_pandadx9 "wdxGraphicsPipe9::get_class_type().get_index()" COMPONENTS p3dxgsg9 p3windisplay) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS pandadx9 DESTINATION ${MODULE_DESTINATION}) +install(TARGETS pandadx9 + EXPORT DX9 COMPONENT DX9 + DESTINATION ${MODULE_DESTINATION} + ARCHIVE COMPONENT DX9Devel) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 2a1f1085cb..a41cffdbe3 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -2,9 +2,15 @@ if(NOT HAVE_EGG) return() endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "EggDevel") add_metalib(pandaegg INIT init_libpandaegg pandaegg.h COMPONENTS p3egg p3egg2pg) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) target_link_libraries(pandaegg panda) -install(TARGETS pandaegg DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS pandaegg + EXPORT Egg COMPONENT Egg + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT EggDevel) diff --git a/panda/metalibs/pandaexpress/CMakeLists.txt b/panda/metalibs/pandaexpress/CMakeLists.txt index d76f00ca11..a5718095f4 100644 --- a/panda/metalibs/pandaexpress/CMakeLists.txt +++ b/panda/metalibs/pandaexpress/CMakeLists.txt @@ -1,5 +1,11 @@ +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(pandaexpress INIT init_libpandaexpress pandaexpress.h COMPONENTS p3downloader p3express) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS pandaexpress DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS pandaexpress + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index acc204069d..40fe9a1810 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -28,10 +28,15 @@ if(NOT PANDAGL_PIPE_INCLUDE) set(PANDAGL_PIPE_INCLUDE "${PANDAGL_PIPE_TYPE}.h") endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "OpenGLDevel") add_metalib(pandagl ${MODULE_TYPE} INCLUDE "${PANDAGL_PIPE_INCLUDE}" INIT init_libpandagl pandagl.h EXPORT int get_pipe_type_pandagl "${PANDAGL_PIPE_TYPE}::get_class_type().get_index()" COMPONENTS ${PANDAGL_LINK_TARGETS}) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS pandagl DESTINATION ${MODULE_DESTINATION}) +install(TARGETS pandagl + EXPORT OpenGL COMPONENT OpenGL + DESTINATION ${MODULE_DESTINATION} + ARCHIVE COMPONENT OpenGLDevel) diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt index b3e87024ad..34a803e976 100644 --- a/panda/metalibs/pandagles/CMakeLists.txt +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -10,10 +10,15 @@ else() set(GLES1_PIPE_INCLUDE "eglGraphicsPipe.h") endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "GLESDevel") add_metalib(pandagles ${MODULE_TYPE} INCLUDE "${GLES1_PIPE_INCLUDE}" INIT init_libpandagles pandagles.h EXPORT int get_pipe_type_pandagles "${GLES1_PIPE_TYPE}::get_class_type().get_index()" COMPONENTS p3egldisplay_gles1 p3glesgsg p3glstuff p3x11display) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS pandagles DESTINATION ${MODULE_DESTINATION}) +install(TARGETS pandagles + EXPORT GLES COMPONENT GLES + DESTINATION ${MODULE_DESTINATION} + ARCHIVE COMPONENT GLESDevel) diff --git a/panda/metalibs/pandagles2/CMakeLists.txt b/panda/metalibs/pandagles2/CMakeLists.txt index e1d378c27f..74cb6c50a4 100644 --- a/panda/metalibs/pandagles2/CMakeLists.txt +++ b/panda/metalibs/pandagles2/CMakeLists.txt @@ -2,10 +2,15 @@ if(NOT HAVE_GLES2 OR NOT HAVE_EGL) return() endif() +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "GLESDevel") add_metalib(pandagles2 ${MODULE_TYPE} INCLUDE eglGraphicsPipe.h INIT init_libpandagles2 pandagles2.h EXPORT int get_pipe_type_pandagles2 "eglGraphicsPipe::get_class_type().get_index()" COMPONENTS p3egldisplay_gles2 p3gles2gsg p3glstuff p3x11display) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS pandagles2 DESTINATION ${MODULE_DESTINATION}) +install(TARGETS pandagles2 + EXPORT GLES COMPONENT GLES + DESTINATION ${MODULE_DESTINATION} + ARCHIVE COMPONENT GLESDevel) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index 1f55fb4130..137ed8c9c0 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -1,5 +1,11 @@ +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(pandaphysics INIT init_libpandaphysics pandaphysics.h COMPONENTS p3physics p3particlesystem) +unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) -install(TARGETS pandaphysics DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS pandaphysics + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index 9d823bc896..e6de607fc1 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -27,6 +27,10 @@ target_link_libraries(p3audio p3putil p3event p3movies p3linmath) target_interrogate(p3audio ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3audio DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3audio + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3AUDIO_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3AUDIO_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index a40f4dc301..2c0988288c 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -25,7 +25,11 @@ if(HAVE_RAD_MSS) set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) target_link_libraries(p3miles_audio panda PKG::MILES) - install(TARGETS p3miles_audio DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3miles_audio + EXPORT Miles COMPONENT Miles + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT MilesDevel) endif() if(HAVE_FMODEX) @@ -42,7 +46,11 @@ if(HAVE_FMODEX) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) target_link_libraries(p3fmod_audio panda PKG::FMODEX) - install(TARGETS p3fmod_audio DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3fmod_audio + EXPORT FMOD COMPONENT FMOD + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT FMODDevel) endif() if(HAVE_OPENAL) @@ -60,5 +68,9 @@ if(HAVE_OPENAL) set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) target_link_libraries(p3openal_audio panda PKG::OPENAL) - install(TARGETS p3openal_audio DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3openal_audio + EXPORT OpenAL COMPONENT OpenAL + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT OpenALDevel) endif() diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index 781e61f397..c001fa54d8 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -112,5 +112,9 @@ set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET) target_link_libraries(p3bullet panda PKG::BULLET) target_interrogate(p3bullet ALL) -install(TARGETS p3bullet DESTINATION lib RUNTIME DESTINATION bin) -install(FILES ${P3BULLET_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3bullet + EXPORT Bullet COMPONENT Bullet + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT BulletDevel) +install(FILES ${P3BULLET_HEADERS} COMPONENT BulletDevel DESTINATION include/panda3d) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 46d2076e23..1e5ce7415c 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -59,6 +59,10 @@ target_link_libraries(p3chan p3pgraph) target_interrogate(p3chan ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3chan DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3chan + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3CHAN_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3CHAN_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index f2c6cc9f69..c0cce9d6d3 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -25,6 +25,10 @@ target_link_libraries(p3char p3chan) target_interrogate(p3char ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3char DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3char + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3CHAR_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3CHAR_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index a0a35227c2..5cea117227 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -40,5 +40,5 @@ target_link_libraries(p3cocoadisplay ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) if(NOT BUILD_METALIBS) - install(TARGETS p3cocoadisplay DESTINATION lib) + install(TARGETS p3cocoadisplay EXPORT Panda COMPONENT Panda DESTINATION lib) endif() diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 344453092e..c906122e33 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -70,9 +70,13 @@ target_link_libraries(p3collide p3tform) target_interrogate(p3collide ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3collide DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3collide + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3COLLIDE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3COLLIDE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_collide diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index adfa257544..84369c32fc 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -28,4 +28,4 @@ endif() configure_file(panda.prc.in "${CMAKE_BINARY_DIR}/etc/20_panda.prc") -install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" DESTINATION etc) +install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" COMPONENT Core DESTINATION etc) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index 527dc439d0..80b96fc52f 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -27,6 +27,10 @@ target_link_libraries(p3cull p3pgraph) target_interrogate(p3cull ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3cull DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3cull + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3CULL_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3CULL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index b31f99b31d..7051f7248f 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -33,6 +33,10 @@ target_link_libraries(p3device p3dgraph p3display) target_interrogate(p3device ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3device DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3device + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DEVICE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DEVICE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 417848df2a..3231ddf005 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -18,6 +18,10 @@ target_link_libraries(p3dgraph p3pgraph) target_interrogate(p3dgraph ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3dgraph DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3dgraph + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DGRAPH_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index aea52bd766..0298ef9974 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -96,9 +96,13 @@ target_link_libraries(p3display p3cull p3pgraphnodes target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3display DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3display + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DISPLAY_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DISPLAY_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) # We build a static library of just these files, so the plugin can diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index ab9950285b..29ba6d7fbf 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -74,6 +74,10 @@ target_link_libraries(p3downloader p3express) target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3downloader DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3downloader + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DOWNLOADER_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DOWNLOADER_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index adc70f3f41..aae9cf85fa 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -13,6 +13,7 @@ if(HAVE_OPENSSL) target_link_libraries(pdecrypt panda) install(TARGETS apply_patch build_patch show_ddb check_md5 pencrypt pdecrypt + EXPORT Tools COMPONENT Tools DESTINATION bin) endif() @@ -27,9 +28,10 @@ if(HAVE_ZLIB) target_link_libraries(punzip panda) install(TARGETS check_adler check_crc pzip punzip + EXPORT Tools COMPONENT Tools DESTINATION bin) endif() add_executable(multify multify.cxx) target_link_libraries(multify panda) -install(TARGETS multify DESTINATION bin) +install(TARGETS multify EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt index 25c2fa1a8a..a77ddc1a60 100644 --- a/panda/src/dxgsg9/CMakeLists.txt +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -43,6 +43,10 @@ target_link_libraries(p3dxgsg9 p3windisplay panda target_compile_definitions(p3dxgsg9 PUBLIC USE_GENERIC_DXERR_LIBRARY) # FIXME if(NOT BUILD_METALIBS) - install(TARGETS p3dxgsg9 DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3dxgsg9 + EXPORT DX9 COMPONENT DX9 + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT DX9Devel) endif() -install(FILES ${P3DXGSG9_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DXGSG9_HEADERS} COMPONENT DX9Devel DESTINATION include/panda3d) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 2dda39451d..1a126295b5 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -18,6 +18,10 @@ target_link_libraries(p3dxml pandaexpress) target_interrogate(p3dxml ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3dxml DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3dxml + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DXML_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3DXML_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 21d00bade7..3636e6100f 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -108,6 +108,10 @@ target_link_libraries(p3egg panda) target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3egg DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3egg + EXPORT Egg COMPONENT Egg + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT EggDevel) endif() -install(FILES ${P3EGG_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3EGG_HEADERS} COMPONENT EggDevel DESTINATION include/panda3d) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 5b444c043c..83de71b2e4 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -39,6 +39,10 @@ target_link_libraries(p3egg2pg panda p3egg) target_interrogate(p3egg2pg ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3egg2pg DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3egg2pg + EXPORT Egg COMPONENT Egg + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT EggDevel) endif() -install(FILES ${P3EGG2PG_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3EGG2PG_HEADERS} COMPONENT EggDevel DESTINATION include/panda3d) diff --git a/panda/src/egldisplay/CMakeLists.txt b/panda/src/egldisplay/CMakeLists.txt index 2fbdd985fd..a20c64c083 100644 --- a/panda/src/egldisplay/CMakeLists.txt +++ b/panda/src/egldisplay/CMakeLists.txt @@ -36,7 +36,11 @@ if(HAVE_GLES1) PKG::EGL PKG::GLES1) if(NOT BUILD_METALIBS) - install(TARGETS p3egldisplay_gles1 DESTINATION lib) + install(TARGETS p3egldisplay_gles1 + EXPORT GLES COMPONENT GLES + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT GLESDevel) endif() endif() @@ -49,8 +53,12 @@ if(HAVE_GLES2) PKG::EGL PKG::GLES2) if(NOT BUILD_METALIBS) - install(TARGETS p3egldisplay_gles2 DESTINATION lib) + install(TARGETS p3egldisplay_gles2 + EXPORT GLES COMPONENT GLES + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT GLESDevel) endif() endif() -install(FILES ${P3EGLDISPLAY_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3EGLDISPLAY_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index 46556369d0..ee1982e464 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -51,9 +51,13 @@ target_link_libraries(p3event p3linmath p3pstatclient) target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3event DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3event + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3EVENT_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3EVENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_task diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 663ab97844..c5c7e68152 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -146,9 +146,13 @@ if(WIN32) endif() if(NOT BUILD_METALIBS) - install(TARGETS p3express DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3express + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3EXPRESS_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3EXPRESS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #add_executable(p3expressTestTypes test_types.cxx) #target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 84a498a54e..ea20395469 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -25,5 +25,9 @@ set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) target_link_libraries(p3ffmpeg panda PKG::FFMPEG PKG::SWSCALE PKG::SWRESAMPLE) -install(TARGETS p3ffmpeg DESTINATION lib RUNTIME DESTINATION bin) -install(FILES ${P3FFMPEG_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3ffmpeg + EXPORT FFmpeg COMPONENT FFmpeg + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT FFmpegDevel) +install(FILES ${P3FFMPEG_HEADERS} COMPONENT FFmpegDevel DESTINATION include/panda3d) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 12ca4a0077..b07fc8623a 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -51,5 +51,9 @@ add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) -install(TARGETS p3framework DESTINATION lib RUNTIME DESTINATION bin) -install(FILES ${P3FRAMEWORK_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3framework + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) +install(FILES ${P3FRAMEWORK_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/gles2gsg/CMakeLists.txt b/panda/src/gles2gsg/CMakeLists.txt index 6bbd4ca9c8..f12dd7be0c 100644 --- a/panda/src/gles2gsg/CMakeLists.txt +++ b/panda/src/gles2gsg/CMakeLists.txt @@ -17,6 +17,10 @@ target_link_libraries(p3gles2gsg p3glstuff panda PKG::GLES2) if(NOT BUILD_METALIBS) - install(TARGETS p3gles2gsg DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3gles2gsg + EXPORT GLES COMPONENT GLES + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT GLESDevel) endif() -install(FILES ${P3GLES2GSG_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GLES2GSG_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) diff --git a/panda/src/glesgsg/CMakeLists.txt b/panda/src/glesgsg/CMakeLists.txt index 993303a3f7..455da8a0c7 100644 --- a/panda/src/glesgsg/CMakeLists.txt +++ b/panda/src/glesgsg/CMakeLists.txt @@ -17,6 +17,10 @@ target_link_libraries(p3glesgsg p3glstuff panda PKG::GLES1) if(NOT BUILD_METALIBS) - install(TARGETS p3glesgsg DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3glesgsg + EXPORT GLES COMPONENT GLES + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT GLESDevel) endif() -install(FILES ${P3GLESGSG_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GLESGSG_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 9421def529..4b033ad3b6 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -18,6 +18,10 @@ target_link_libraries(p3glgsg p3glstuff panda PKG::CG PKG::GL) if(NOT BUILD_METALIBS) - install(TARGETS p3glgsg DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3glgsg + EXPORT OpenGL COMPONENT OpenGL + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT OpenGLDevel) endif() -install(FILES ${P3GLGSG_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GLGSG_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index c0063aef21..de52d21b07 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -38,6 +38,10 @@ add_component_library(p3glstuff NOINIT ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES} target_link_libraries(p3glstuff panda) if(NOT BUILD_METALIBS) - install(TARGETS p3glstuff DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3glstuff + EXPORT OpenGL COMPONENT OpenGL + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT OpenGLDevel) endif() -install(FILES ${P3GLSTUFF_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GLSTUFF_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 33abd3298b..648dc420fd 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -29,5 +29,5 @@ add_component_library(p3glxdisplay SYMBOL BUILDING_PANDA_GLXDISPLAY target_link_libraries(p3glxdisplay p3glgsg p3x11display) if(NOT BUILD_METALIBS) - install(TARGETS p3glxdisplay DESTINATION lib) + install(TARGETS p3glxdisplay EXPORT Panda COMPONENT Panda DESTINATION lib) endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index cb5d5e5597..ef56c5d6f2 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -177,9 +177,13 @@ target_link_libraries(p3gobj p3gsgbase p3pnmimage target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3gobj DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3gobj + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3GOBJ_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GOBJ_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_gobj diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 7a8be4135e..f642464007 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -47,6 +47,10 @@ endif() target_interrogate(p3grutil ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3grutil DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3grutil + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3GRUTIL_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GRUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 81502f4bab..9b3d31aee0 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -17,9 +17,13 @@ target_link_libraries(p3gsgbase p3putil p3linmath) target_interrogate(p3gsgbase ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3gsgbase DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3gsgbase + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3GSGBASE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3GSGBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_gsgbase diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 2eddca24d4..e737f95138 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -53,9 +53,13 @@ target_link_libraries(p3linmath p3pandabase pandaexpress PKG::EIGEN) target_interrogate(p3linmath ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3linmath DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3linmath + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3LINMATH_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3LINMATH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_math diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 6018510008..2fa0e439f3 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -67,9 +67,13 @@ target_link_libraries(p3mathutil p3event PKG::FFTW) target_interrogate(p3mathutil ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3mathutil DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3mathutil + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3MATHUTIL_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3MATHUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_mathutil diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 1e41eee994..c35c4bf33b 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -49,6 +49,10 @@ target_link_libraries(p3movies p3pstatclient p3gobj p3pandabase pandaexpress) target_interrogate(p3movies ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3movies DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3movies + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3MOVIES_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3MOVIES_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index bef8d792c9..39d10ca686 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -36,6 +36,10 @@ target_link_libraries(p3nativenet p3pandabase pandaexpress) target_interrogate(p3nativenet ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3nativenet DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3nativenet + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3NATIVENET_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3NATIVENET_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 58c7e80c6d..98c15c95cb 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -39,6 +39,10 @@ if(WIN32) endif() if(NOT BUILD_METALIBS) - install(TARGETS p3net DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3net + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3NET_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3NET_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index fc574d7747..a61fa8a4ed 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -92,5 +92,9 @@ target_link_libraries(p3ode panda PKG::ODE) target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) -install(TARGETS p3ode DESTINATION lib RUNTIME DESTINATION bin) -install(FILES ${P3ODE_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3ode + EXPORT ODE COMPONENT ODE + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT ODEDevel) +install(FILES ${P3ODE_HEADERS} COMPONENT ODEDevel DESTINATION include/panda3d) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index d7ea87b582..c644082fb8 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -31,5 +31,5 @@ target_link_libraries(p3osxdisplay ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) if(NOT BUILD_METALIBS) - install(TARGETS p3osxdisplay DESTINATION lib) + install(TARGETS p3osxdisplay EXPORT Panda COMPONENT Panda DESTINATION lib) endif() diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index 3cf44a1228..deb4428068 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -10,4 +10,5 @@ set(P3PANDABASE_SOURCES add_library(p3pandabase INTERFACE) target_link_libraries(p3pandabase INTERFACE p3dtool) -install(FILES ${P3PANDABASE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PANDABASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(TARGETS p3pandabase EXPORT Core COMPONENT Core) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index bb61513e3f..ab548eed21 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -40,9 +40,13 @@ target_link_libraries(p3parametrics p3pgraph) target_interrogate(p3parametrics ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3parametrics DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3parametrics + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PARAMETRICS_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PARAMETRICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_parametrics diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 51136d03bf..a38c7f85b2 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -51,6 +51,10 @@ target_link_libraries(p3particlesystem p3physics panda) target_interrogate(p3particlesystem ${P3PARTICLESYSTEM_IGATE_SOURCES}) if(NOT BUILD_METALIBS) - install(TARGETS p3particlesystem DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3particlesystem + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PARTICLESYSTEM_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PARTICLESYSTEM_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 8fed7d0f41..62dfbf93d8 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -224,9 +224,13 @@ target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath pandae target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3pgraph DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pgraph + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PGRAPH_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 663e88d5f2..ffdab9ec02 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -51,6 +51,10 @@ target_link_libraries(p3pgraphnodes p3pgraph) target_interrogate(p3pgraphnodes ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3pgraphnodes DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pgraphnodes + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PGRAPHNODES_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PGRAPHNODES_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 57ebb702b6..1906ac0124 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -46,9 +46,13 @@ target_link_libraries(p3pgui p3tform) target_interrogate(p3pgui ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3pgui DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pgui + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PGUI_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PGUI_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_pgentry diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 68f2b5a1aa..836b4ece01 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -43,6 +43,10 @@ target_link_libraries(p3physics panda) target_interrogate(p3physics ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3physics DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3physics + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PHYSICS_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PHYSICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 2e150f22e4..2d1f0993a3 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -132,6 +132,10 @@ target_link_libraries(p3pipeline pandaexpress target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3pipeline DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pipeline + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PIPELINE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PIPELINE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 66f881361b..1a8d88460b 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -42,6 +42,10 @@ target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3pnmimage DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pnmimage + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PNMIMAGE_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PNMIMAGE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index e6afb05a33..fc086ce9e3 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -40,5 +40,9 @@ target_link_libraries(p3pnmimagetypes p3pnmimage set_target_properties(p3pnmimagetypes PROPERTIES CXX_EXCEPTIONS ON) if(NOT BUILD_METALIBS) - install(TARGETS p3pnmimagetypes DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pnmimagetypes + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 1e1c2c9e14..37aa70931d 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -24,6 +24,10 @@ target_link_libraries(p3pnmtext p3parametrics p3pnmimage PKG::FREETYPE) target_interrogate(p3pnmtext ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3pnmtext DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pnmtext + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PNMTEXT_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3PNMTEXT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 93395116ac..ac256ad870 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -27,7 +27,11 @@ target_link_libraries(p3pstatclient p3net p3putil pandaexpress) target_interrogate(p3pstatclient ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3pstatclient DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3pstatclient + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PSTATCLIENT_HEADERS} DESTINATION include/panda3d) -install(FILES config_pstats.h DESTINATION include/panda3d) +install(FILES ${P3PSTATCLIENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES config_pstats.h COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index f0fd79a06e..f79df878f3 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -135,10 +135,14 @@ target_link_libraries(p3putil p3linmath p3pipeline) target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) if(NOT BUILD_METALIBS) - install(TARGETS p3putil DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3putil + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PUTIL_HEADERS} DESTINATION include/panda3d) -install(FILES config_util.h DESTINATION include/panda3d) +install(FILES ${P3PUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES config_util.h COMPONENT CoreDevel DESTINATION include/panda3d) #begin test_bin_target #define TARGET test_bamRead diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 6ef60c5b8d..5df5b9a5c2 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -23,6 +23,10 @@ target_link_libraries(p3recorder p3dgraph pandaexpress) target_interrogate(p3recorder ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3recorder DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3recorder + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3RECORDER_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3RECORDER_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index 21e15e788c..4872df41ad 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -1,6 +1,6 @@ add_executable(pview pview.cxx) target_link_libraries(pview p3framework p3pystub) -install(TARGETS pview DESTINATION bin) +install(TARGETS pview EXPORT Tools COMPONENT Tools DESTINATION bin) #begin test_bin_target #define TARGET pgrid diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 3b02c62ae7..1da06aba44 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -44,6 +44,10 @@ endif() target_interrogate(p3text ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3text DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3text + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3TEXT_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3TEXT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index a4e92c0083..b223a0a1f5 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -34,6 +34,10 @@ target_link_libraries(p3tform p3device p3grutil) target_interrogate(p3tform ALL) if(NOT BUILD_METALIBS) - install(TARGETS p3tform DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3tform + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3TFORM_HEADERS} DESTINATION include/panda3d) +install(FILES ${P3TFORM_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt index e70490ab63..5f905ebe86 100644 --- a/panda/src/vision/CMakeLists.txt +++ b/panda/src/vision/CMakeLists.txt @@ -33,5 +33,9 @@ target_link_libraries(p3vision panda set_target_properties(p3vision PROPERTIES CXX_EXCEPTIONS ON) target_interrogate(p3vision ALL) -install(TARGETS p3vision DESTINATION lib RUNTIME DESTINATION bin) -install(FILES ${P3VISION_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3vision + EXPORT Vision COMPONENT Vision + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT VisionDevel) +install(FILES ${P3VISION_HEADERS} COMPONENT VisionDevel DESTINATION include/panda3d) diff --git a/panda/src/vrpn/CMakeLists.txt b/panda/src/vrpn/CMakeLists.txt index e5c67d686b..55f2fa91df 100644 --- a/panda/src/vrpn/CMakeLists.txt +++ b/panda/src/vrpn/CMakeLists.txt @@ -35,5 +35,9 @@ set_target_properties(p3vrpn PROPERTIES DEFINE_SYMBOL BUILDING_VRPN) target_link_libraries(p3vrpn panda PKG::VRPN) target_interrogate(p3vrpn ALL) -install(TARGETS p3vrpn DESTINATION lib RUNTIME DESTINATION bin) -install(FILES ${P3VRPN_HEADERS} DESTINATION include/panda3d) +install(TARGETS p3vrpn + EXPORT VRPN COMPONENT VRPN + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT VRPNDevel) +install(FILES ${P3VRPN_HEADERS} COMPONENT VRPNDevel DESTINATION include/panda3d) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index c3d6e41792..8d8b37f8ff 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -22,3 +22,12 @@ composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) add_component_library(p3wgldisplay SYMBOL BUILDING_PANDA_WGLDISPLAY ${P3WGLDISPLAY_HEADERS} ${P3WGLDISPLAY_SOURCES}) target_link_libraries(p3wgldisplay p3glgsg p3windisplay) + +if(NOT BUILD_METALIBS) + install(TARGETS p3wgldisplay + EXPORT OpenGL COMPONENT OpenGL + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT OpenGLDevel) +endif() +install(FILES ${P3WGLDISPLAY_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index a8fd62ee56..c351b9ee5e 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -17,3 +17,11 @@ composite_sources(p3windisplay P3WINDISPLAY_SOURCES) add_component_library(p3windisplay SYMBOL BUILDING_PANDAWIN ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) target_link_libraries(p3windisplay panda User32.lib Imm32.lib) + +if(NOT BUILD_METALIBS) + install(TARGETS p3windisplay + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) +endif() diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 897653c4e2..41db6aaa48 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -17,5 +17,5 @@ add_component_library(p3x11display SYMBOL BUILDING_PANDAX11 target_link_libraries(p3x11display panda PKG::X11) if(NOT BUILD_METALIBS) - install(TARGETS p3x11display DESTINATION lib) + install(TARGETS p3x11display EXPORT Panda COMPONENT Panda DESTINATION lib) endif() diff --git a/pandatool/src/assimp/CMakeLists.txt b/pandatool/src/assimp/CMakeLists.txt index 22792091a4..4daec301cd 100644 --- a/pandatool/src/assimp/CMakeLists.txt +++ b/pandatool/src/assimp/CMakeLists.txt @@ -26,4 +26,4 @@ set_target_properties(p3assimp PROPERTIES DEFINE_SYMBOL BUILDING_ASSIMP) target_link_libraries(p3assimp PRIVATE p3pandatoolbase) target_link_libraries(p3assimp PUBLIC PKG::ASSIMP) -install(TARGETS p3assimp DESTINATION ${MODULE_DESTINATION}) +install(TARGETS p3assimp EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index 9bd837c9e3..880642e616 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -1,15 +1,15 @@ add_executable(bam-info bamInfo.cxx bamInfo.h) target_link_libraries(bam-info p3progbase panda) -install(TARGETS bam-info DESTINATION bin) +install(TARGETS bam-info EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg2bam eggToBam.cxx eggToBam.h) target_link_libraries(egg2bam p3eggbase p3progbase panda) -install(TARGETS egg2bam DESTINATION bin) +install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(bam2egg bamToEgg.cxx bamToEgg.h) target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda) -install(TARGETS bam2egg DESTINATION bin) +install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(pts2bam ptsToBam.cxx ptsToBam.h) target_link_libraries(pts2bam p3progbase pandaegg panda) -install(TARGETS pts2bam DESTINATION bin) +install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/dxfprogs/CMakeLists.txt b/pandatool/src/dxfprogs/CMakeLists.txt index 8968b24fb4..d77cd12252 100644 --- a/pandatool/src/dxfprogs/CMakeLists.txt +++ b/pandatool/src/dxfprogs/CMakeLists.txt @@ -1,11 +1,11 @@ add_executable(dxf-points dxfPoints.cxx dxfPoints.h) target_link_libraries(dxf-points p3progbase p3dxf) -install(TARGETS dxf-points DESTINATION bin) +install(TARGETS dxf-points EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h) target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase) -install(TARGETS egg2dxf DESTINATION bin) +install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h) target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase) -install(TARGETS dxf2egg DESTINATION bin) +install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/egg-mkfont/CMakeLists.txt b/pandatool/src/egg-mkfont/CMakeLists.txt index 7f925ccd94..4b4f6f3525 100644 --- a/pandatool/src/egg-mkfont/CMakeLists.txt +++ b/pandatool/src/egg-mkfont/CMakeLists.txt @@ -14,4 +14,4 @@ composite_sources(egg-mkfont P3EGG_MKFONT_SOURCES) add_executable(egg-mkfont ${P3EGG_MKFONT_HEADERS} ${P3EGG_MKFONT_SOURCES}) target_link_libraries(egg-mkfont p3palettizer p3eggbase p3pandatoolbase) -install(TARGETS egg-mkfont DESTINATION bin) +install(TARGETS egg-mkfont EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/egg-optchar/CMakeLists.txt b/pandatool/src/egg-optchar/CMakeLists.txt index 4d0f180def..41ffdcddf5 100644 --- a/pandatool/src/egg-optchar/CMakeLists.txt +++ b/pandatool/src/egg-optchar/CMakeLists.txt @@ -16,4 +16,4 @@ composite_sources(egg-optchar P3EGG_OPTCHAR_SOURCES) add_executable(egg-optchar ${P3EGG_OPTCHAR_HEADERS} ${P3EGG_OPTCHAR_SOURCES}) target_link_libraries(egg-optchar p3eggcharbase) -install(TARGETS egg-optchar DESTINATION bin) +install(TARGETS egg-optchar EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 570e6beeb6..8d20cbff15 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -1,8 +1,8 @@ add_executable(egg-palettize eggPalettize.cxx eggPalettize.h) target_link_libraries(egg-palettize p3palettizer p3eggbase p3progbase) -install(TARGETS egg-palettize DESTINATION bin) +install(TARGETS egg-palettize EXPORT Tools COMPONENT Tools DESTINATION bin) add_library(p3txafile txaFileFilter.cxx txaFileFilter.h txaFileFilter.I) set_target_properties(p3txafile PROPERTIES DEFINE_SYMBOL BUILDING_MISC) target_link_libraries(p3txafile PRIVATE p3palettizer) -install(TARGETS p3txafile DESTINATION lib RUNTIME DESTINATION bin) +install(TARGETS p3txafile EXPORT Tools COMPONENT Tools DESTINATION lib RUNTIME DESTINATION bin) diff --git a/pandatool/src/egg-qtess/CMakeLists.txt b/pandatool/src/egg-qtess/CMakeLists.txt index ec7819f4a8..3ebccdd01b 100644 --- a/pandatool/src/egg-qtess/CMakeLists.txt +++ b/pandatool/src/egg-qtess/CMakeLists.txt @@ -24,4 +24,4 @@ composite_sources(egg-qtess P3EGG_QTESS_SOURCES) add_executable(egg-qtess ${P3EGG_QTESS_HEADERS} ${P3EGG_QTESS_SOURCES}) target_link_libraries(egg-qtess p3eggbase) -install(TARGETS egg-qtess DESTINATION bin) +install(TARGETS egg-qtess EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/eggprogs/CMakeLists.txt b/pandatool/src/eggprogs/CMakeLists.txt index b127796a67..e4e3921f24 100644 --- a/pandatool/src/eggprogs/CMakeLists.txt +++ b/pandatool/src/eggprogs/CMakeLists.txt @@ -1,35 +1,35 @@ add_executable(egg-crop eggCrop.cxx eggCrop.h) target_link_libraries(egg-crop p3eggbase) -install(TARGETS egg-crop DESTINATION bin) +install(TARGETS egg-crop EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-list-textures eggListTextures.cxx eggListTextures.h) target_link_libraries(egg-list-textures p3eggbase) -install(TARGETS egg-list-textures DESTINATION bin) +install(TARGETS egg-list-textures EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-make-tube eggMakeTube.cxx eggMakeTube.h) target_link_libraries(egg-make-tube p3eggbase) -install(TARGETS egg-make-tube DESTINATION bin) +install(TARGETS egg-make-tube EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-rename eggRename.cxx eggRename.h) target_link_libraries(egg-rename p3eggbase) -install(TARGETS egg-rename DESTINATION bin) +install(TARGETS egg-rename EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-retarget-anim eggRetargetAnim.cxx eggRetargetAnim.h) target_link_libraries(egg-retarget-anim p3eggcharbase) -install(TARGETS egg-retarget-anim DESTINATION bin) +install(TARGETS egg-retarget-anim EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-texture-cards eggTextureCards.cxx eggTextureCards.h) target_link_libraries(egg-texture-cards p3eggbase) -install(TARGETS egg-texture-cards DESTINATION bin) +install(TARGETS egg-texture-cards EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg2c eggToC.cxx eggToC.h) target_link_libraries(egg2c p3eggbase) -install(TARGETS egg2c DESTINATION bin) +install(TARGETS egg2c EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-topstrip eggTopstrip.cxx eggTopstrip.h) target_link_libraries(egg-topstrip p3eggcharbase) -install(TARGETS egg-topstrip DESTINATION bin) +install(TARGETS egg-topstrip EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg-trans eggTrans.cxx eggTrans.h) target_link_libraries(egg-trans p3eggbase) -install(TARGETS egg-trans DESTINATION bin) +install(TARGETS egg-trans EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/fltprogs/CMakeLists.txt b/pandatool/src/fltprogs/CMakeLists.txt index 6e4058b504..2bf1b1f63b 100644 --- a/pandatool/src/fltprogs/CMakeLists.txt +++ b/pandatool/src/fltprogs/CMakeLists.txt @@ -1,19 +1,19 @@ add_executable(flt-info fltInfo.cxx fltInfo.h) target_link_libraries(flt-info p3progbase p3flt) -install(TARGETS flt-info DESTINATION bin) +install(TARGETS flt-info EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(flt-trans fltTrans.cxx fltTrans.h) target_link_libraries(flt-trans p3progbase p3flt) -install(TARGETS flt-trans DESTINATION bin) +install(TARGETS flt-trans EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(fltcopy fltCopy.cxx fltCopy.h) target_link_libraries(fltcopy p3progbase p3cvscopy p3flt) -install(TARGETS fltcopy DESTINATION bin) +install(TARGETS fltcopy EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(egg2flt eggToFlt.cxx eggToFlt.h) target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase) -install(TARGETS egg2flt DESTINATION bin) +install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(flt2egg fltToEgg.cxx fltToEgg.h) target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase) -install(TARGETS flt2egg DESTINATION bin) +install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index 5594f53a5b..58ce7e2621 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -38,4 +38,4 @@ else() set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats") endif() -install(TARGETS gtkstats DESTINATION bin) +install(TARGETS gtkstats EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/imageprogs/CMakeLists.txt b/pandatool/src/imageprogs/CMakeLists.txt index d0f77b99a8..d89a4c62fe 100644 --- a/pandatool/src/imageprogs/CMakeLists.txt +++ b/pandatool/src/imageprogs/CMakeLists.txt @@ -1,19 +1,19 @@ add_executable(image-fix-hidden-color imageFixHiddenColor.cxx imageFixHiddenColor.h) target_link_libraries(image-fix-hidden-color p3imagebase) -install(TARGETS image-fix-hidden-color DESTINATION bin) +install(TARGETS image-fix-hidden-color EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(image-info imageInfo.cxx imageInfo.h) target_link_libraries(image-info p3imagebase) -install(TARGETS image-info DESTINATION bin) +install(TARGETS image-info EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(image-resize imageResize.cxx imageResize.h) target_link_libraries(image-resize p3imagebase) -install(TARGETS image-resize DESTINATION bin) +install(TARGETS image-resize EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(image-transform-colors imageTransformColors.cxx imageTransformColors.h) target_link_libraries(image-transform-colors p3imagebase) -install(TARGETS image-transform-colors DESTINATION bin) +install(TARGETS image-transform-colors EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(image-trans imageTrans.cxx imageTrans.h) target_link_libraries(image-trans p3imagebase) -install(TARGETS image-trans DESTINATION bin) +install(TARGETS image-trans EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/lwoprogs/CMakeLists.txt b/pandatool/src/lwoprogs/CMakeLists.txt index 9232882376..8f166279f5 100644 --- a/pandatool/src/lwoprogs/CMakeLists.txt +++ b/pandatool/src/lwoprogs/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(lwo-scan lwoScan.cxx lwoScan.h) target_link_libraries(lwo-scan p3progbase p3lwo) -install(TARGETS lwo-scan DESTINATION bin) +install(TARGETS lwo-scan EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h) target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase) -install(TARGETS lwo2egg DESTINATION bin) +install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/miscprogs/CMakeLists.txt b/pandatool/src/miscprogs/CMakeLists.txt index c3964de618..d42a8cd7ce 100644 --- a/pandatool/src/miscprogs/CMakeLists.txt +++ b/pandatool/src/miscprogs/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(bin2c binToC.cxx binToC.h) target_link_libraries(bin2c p3progbase) -install(TARGETS bin2c DESTINATION bin) +install(TARGETS bin2c EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/objprogs/CMakeLists.txt b/pandatool/src/objprogs/CMakeLists.txt index 47fbbc058a..60dac7aadd 100644 --- a/pandatool/src/objprogs/CMakeLists.txt +++ b/pandatool/src/objprogs/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(egg2obj eggToObj.cxx eggToObj.h) target_link_libraries(egg2obj p3objegg p3eggbase) -install(TARGETS egg2obj DESTINATION bin) +install(TARGETS egg2obj EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(obj2egg objToEgg.cxx objToEgg.h) target_link_libraries(obj2egg p3objegg p3eggbase p3progbase) -install(TARGETS obj2egg DESTINATION bin) +install(TARGETS obj2egg EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/pfmprogs/CMakeLists.txt b/pandatool/src/pfmprogs/CMakeLists.txt index 0b5bad8978..800c94cd1b 100644 --- a/pandatool/src/pfmprogs/CMakeLists.txt +++ b/pandatool/src/pfmprogs/CMakeLists.txt @@ -2,8 +2,8 @@ add_executable(pfm-bba config_pfmprogs.cxx config_pfmprogs.h pfmBba.cxx pfmBba.h) target_link_libraries(pfm-bba p3progbase) -install(TARGETS pfm-bba DESTINATION bin) +install(TARGETS pfm-bba EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(pfm-trans pfmTrans.cxx pfmTrans.h) target_link_libraries(pfm-trans p3progbase) -install(TARGETS pfm-trans DESTINATION bin) +install(TARGETS pfm-trans EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt index 34dbfacabf..174aa6eb80 100644 --- a/pandatool/src/ptloader/CMakeLists.txt +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -15,4 +15,4 @@ target_link_libraries(p3ptloader PRIVATE p3dxfegg p3fltegg p3lwoegg p3objegg p3vrmlegg p3xfileegg p3converter) -install(TARGETS p3ptloader DESTINATION ${MODULE_DESTINATION}) +install(TARGETS p3ptloader EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) diff --git a/pandatool/src/vrmlprogs/CMakeLists.txt b/pandatool/src/vrmlprogs/CMakeLists.txt index 0657671d51..7396148af7 100644 --- a/pandatool/src/vrmlprogs/CMakeLists.txt +++ b/pandatool/src/vrmlprogs/CMakeLists.txt @@ -1,7 +1,7 @@ add_executable(vrml-trans vrmlTrans.cxx vrmlTrans.h) target_link_libraries(vrml-trans p3progbase p3vrml) -install(TARGETS vrml-trans DESTINATION bin) +install(TARGETS vrml-trans EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h) target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase) -install(TARGETS vrml2egg DESTINATION bin) +install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/xfileprogs/CMakeLists.txt b/pandatool/src/xfileprogs/CMakeLists.txt index 907ebea1ee..db4e48f23a 100644 --- a/pandatool/src/xfileprogs/CMakeLists.txt +++ b/pandatool/src/xfileprogs/CMakeLists.txt @@ -1,11 +1,11 @@ add_executable(egg2x eggToX.cxx eggToX.h) target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase) -install(TARGETS egg2x DESTINATION bin) +install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(x-trans xFileTrans.cxx xFileTrans.h) target_link_libraries(x-trans p3progbase p3xfile) -install(TARGETS x-trans DESTINATION bin) +install(TARGETS x-trans EXPORT Tools COMPONENT Tools DESTINATION bin) add_executable(x2egg xFileToEgg.cxx xFileToEgg.h) target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase) -install(TARGETS x2egg DESTINATION bin) +install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION bin) From 7d6386f2ded7525c52d517d25737e92c9bbbd99e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 11 Dec 2018 17:27:27 -0700 Subject: [PATCH 570/744] CMake: Change some stray "Panda" install components with "Core" --- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/glxdisplay/CMakeLists.txt | 2 +- panda/src/osxdisplay/CMakeLists.txt | 2 +- panda/src/x11display/CMakeLists.txt | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 5cea117227..6bcef03b8f 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -40,5 +40,5 @@ target_link_libraries(p3cocoadisplay ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) if(NOT BUILD_METALIBS) - install(TARGETS p3cocoadisplay EXPORT Panda COMPONENT Panda DESTINATION lib) + install(TARGETS p3cocoadisplay EXPORT Core COMPONENT Core DESTINATION lib) endif() diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 648dc420fd..17f9546d79 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -29,5 +29,5 @@ add_component_library(p3glxdisplay SYMBOL BUILDING_PANDA_GLXDISPLAY target_link_libraries(p3glxdisplay p3glgsg p3x11display) if(NOT BUILD_METALIBS) - install(TARGETS p3glxdisplay EXPORT Panda COMPONENT Panda DESTINATION lib) + install(TARGETS p3glxdisplay EXPORT Core COMPONENT Core DESTINATION lib) endif() diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index c644082fb8..58b58ddb6d 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -31,5 +31,5 @@ target_link_libraries(p3osxdisplay ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) if(NOT BUILD_METALIBS) - install(TARGETS p3osxdisplay EXPORT Panda COMPONENT Panda DESTINATION lib) + install(TARGETS p3osxdisplay EXPORT Core COMPONENT Core DESTINATION lib) endif() diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index 41db6aaa48..a35cdd0f2b 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -17,5 +17,5 @@ add_component_library(p3x11display SYMBOL BUILDING_PANDAX11 target_link_libraries(p3x11display panda PKG::X11) if(NOT BUILD_METALIBS) - install(TARGETS p3x11display EXPORT Panda COMPONENT Panda DESTINATION lib) + install(TARGETS p3x11display EXPORT Core COMPONENT Core DESTINATION lib) endif() From c50bf63aee16bb60d963e11a2268703c0a85670a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 11 Dec 2018 18:28:12 -0700 Subject: [PATCH 571/744] CMake: Fix showbase build error on macOS --- direct/src/showbase/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 6e37e65bc6..571f36a1f0 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3SHOWBASE_SOURCES ) if(APPLE) - list(APPEND P3SHOWBASE_FILES showBase_assist.mm) + list(APPEND P3SHOWBASE_SOURCES showBase_assist.mm) endif() add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE From b20c6e801c4f21ef2eeb341df2d14e1e8152d097 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 11 Dec 2018 19:47:23 -0700 Subject: [PATCH 572/744] CMake: Add an export_packages() function to export PKG::* This is needed to support install(EXPORT) --- cmake/macros/PackageConfig.cmake | 125 ++++++++++++++++++++++++++++--- 1 file changed, 113 insertions(+), 12 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index a1e862b103..a3414e7176 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -51,6 +51,8 @@ # calls to package_status above. # +set(_ALL_PACKAGE_OPTIONS CACHE INTERNAL "Internal variable") + # # package_option # @@ -146,11 +148,12 @@ function(package_option name) # Prevent the function from being called twice. # This would indicate a cmake error. - if(PANDA_DID_SET_OPTION_${name}) + if(";${_ALL_PACKAGE_OPTIONS};" MATCHES ";${name};") message(SEND_ERROR "package_option(${name}) was called twice. This is a bug in the cmake build scripts.") else() - set(PANDA_DID_SET_OPTION_${name} TRUE PARENT_SCOPE) + list(APPEND _ALL_PACKAGE_OPTIONS "${name}") + set(_ALL_PACKAGE_OPTIONS "${_ALL_PACKAGE_OPTIONS}" CACHE INTERNAL "Internal variable") endif() set(PANDA_PACKAGE_DEFAULT_${name} "${default}" PARENT_SCOPE) @@ -176,15 +179,23 @@ function(package_option name) if(HAVE_${name}) set(use_variables ON) + # 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(_is_not_interface_lib + "$,INTERFACE_LIBRARY>>") + set(_is_not_interrogate + "$>>>") + foreach(implib ${imported_as}) if(TARGET ${implib}) # We found one of the implibs, so we don't need to use variables # (below) anymore set(use_variables OFF) - # Yes, this is ugly. See below for an explanation. + # Hide it from Interrogate target_link_libraries(PKG::${name} INTERFACE - "$<$>>:${implib}>") + "$<${_is_not_interrogate}:$>") endif() endforeach(implib) @@ -202,11 +213,9 @@ function(package_option name) 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 - "$<$>>:${includes}>") + # Hide it from Interrogate + set_target_properties(PKG::${name} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "$<${_is_not_interrogate}:${includes}>") endif() endif() endfunction(package_option) @@ -222,13 +231,13 @@ function(package_status name desc) set(note "${arg}") endforeach() - if(NOT PANDA_DID_SET_OPTION_${name}) + if(NOT ";${_ALL_PACKAGE_OPTIONS};" MATCHES ";${name};") message(SEND_ERROR "package_status(${name}) was called before package_option(${name}). This is a bug in the cmake build scripts.") + return() endif() - list(FIND _ALL_CONFIG_PACKAGES "${name}" called_twice) - if(called_twice GREATER -1) + if(";${_ALL_CONFIG_PACKAGES};" MATCHES ";${name};") message(SEND_ERROR "package_status(${name}) was called twice. This is a bug in the cmake build scripts.") else() @@ -269,6 +278,98 @@ function(show_packages) endforeach() endfunction() +# +# export_packages(filename) +# +# Generates an includable CMake file that contains definitions for every PKG:: +# package defined. +# +function(export_packages filename) + set(exports "# Exports for Panda3D PKG:: packages\n") + + foreach(pkg ${_ALL_PACKAGE_OPTIONS}) + set(exports "${exports}\n# Create imported target PKG::${pkg}\n") + set(exports "${exports}add_library(PKG::${pkg} INTERFACE IMPORTED)\n\n") + + set(exports "${exports}set_target_properties(PKG::${pkg} PROPERTIES\n") + foreach(prop + INTERFACE_COMPILE_DEFINITIONS + INTERFACE_COMPILE_FEATURES + INTERFACE_COMPILE_OPTIONS + INTERFACE_INCLUDE_DIRECTORIES + INTERFACE_LINK_DEPENDS + INTERFACE_LINK_DIRECTORIES + INTERFACE_LINK_OPTIONS + INTERFACE_POSITION_INDEPENDENT_CODE + #INTERFACE_SYSTEM_INCLUDE_DIRECTORIES # Let the consumer dictate this + INTERFACE_SOURCES) + set(prop_ex "$") + set(exports "${exports}$<$: ${prop} \"${prop_ex}\"\n>") + endforeach(prop) + + # Ugh, INTERFACE_LINK_LIBRARIES isn't transitive. Fine. Take care of it + # by hand: + set(libraries) + set(stack "PKG::${pkg}") + set(history) + while(stack) + # Remove head item from stack + list(GET stack 0 head) + list(REMOVE_AT stack 0) + + # Don't visit anything twice + list(FIND history "${head}" _index) + if(_index GREATER -1) + continue() + else() + list(APPEND history "${head}") + endif() + + # If head isn't a target, add it to `libraries`, else recurse + if(TARGET "${head}") + get_target_property(link_libs "${head}" INTERFACE_LINK_LIBRARIES) + if(link_libs) + list(APPEND stack ${link_libs}) + endif() + + get_target_property(type "${head}" TYPE) + if(NOT type STREQUAL "INTERFACE_LIBRARY") + get_target_property(imported_location "${head}" IMPORTED_LOCATION) + if(imported_location) + list(APPEND libraries ${imported_location}) + endif() + + get_target_property(configs "${head}" IMPORTED_CONFIGURATIONS) + if(configs AND NOT imported_location) + foreach(config ${configs}) + get_target_property(imported_location "${head}" IMPORTED_LOCATION_${config}) + if(imported_location) + if(configs MATCHES ".*;.*") + set(_bling "$<1:$>") # genex-escaped $ + list(APPEND libraries "${_bling}<${_bling}:${imported_location}>") + else() + list(APPEND libraries ${imported_location}) + endif() + endif() + endforeach(config) + endif() + endif() + elseif("${head}" MATCHES "\\$]+\)>") + string(REGEX REPLACE ".*\\$]+\)>.*" "\\1" match "${head}") + list(APPEND stack "${match}") + else() + list(APPEND libraries "${head}") + endif() + endwhile(stack) + + set(exports "${exports} INTERFACE_LINK_LIBRARIES \"${libraries}\"\n") + + set(exports "${exports})\n") + endforeach(pkg) + + file(GENERATE OUTPUT "${filename}" CONTENT "${exports}") +endfunction(export_packages) + # # find_package # From bddd7c1b4b0544096aa6e301fe6a53c3d8a436c7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 27 Dec 2018 17:28:13 -0700 Subject: [PATCH 573/744] CMake: Generate/install exported target sets --- CMakeLists.txt | 10 ++ cmake/install/Panda3DConfig.cmake | 141 +++++++++++++++++++++++++ cmake/macros/PackageConfig.cmake | 41 +++++++ direct/CMakeLists.txt | 4 + dtool/LocalSetup.cmake | 6 ++ panda/CMakeLists.txt | 14 +++ panda/metalibs/pandaegg/CMakeLists.txt | 2 + panda/metalibs/pandagl/CMakeLists.txt | 2 + panda/src/audiotraits/CMakeLists.txt | 6 ++ panda/src/bullet/CMakeLists.txt | 2 + panda/src/ode/CMakeLists.txt | 2 + panda/src/vision/CMakeLists.txt | 2 + 12 files changed, 232 insertions(+) create mode 100644 cmake/install/Panda3DConfig.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 36fb5a6cfe..c5d8274d8c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -166,3 +166,13 @@ if(INTERROGATE_PYTHON_INTERFACE) add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests") endif() + +# Generate the Panda3DConfig.cmake file so find_package(Panda3D) works, and +# also register the build directory with CMake's package registry. + +file(COPY "${PROJECT_SOURCE_DIR}/cmake/install/Panda3DConfig.cmake" + DESTINATION "${PROJECT_BINARY_DIR}") +install(FILES "${PROJECT_SOURCE_DIR}/cmake/install/Panda3DConfig.cmake" + DESTINATION "lib/cmake/Panda3D") + +export(PACKAGE Panda3D) diff --git a/cmake/install/Panda3DConfig.cmake b/cmake/install/Panda3DConfig.cmake new file mode 100644 index 0000000000..6320da8fdf --- /dev/null +++ b/cmake/install/Panda3DConfig.cmake @@ -0,0 +1,141 @@ +# PANDA 3D SOFTWARE +# Copyright (c) Carnegie Mellon University. All rights reserved. +# +# All use of this software is subject to the terms of the revised BSD +# license. You should have received a copy of this license along +# with this source code in a file named "LICENSE." +# +# Author: CFSworks (Dec. 11, 2018) + +# This file is installed to CMake's package search path, and is invoked for +# find_package(Panda3D [COMPONENTS ...]) +# +# The following components are available for importing: +# +# Core - The core Panda3D libraries; this component is always included. +# +# Panda3D::Core::panda +# Panda3D::Core::pandaexpress +# etc. +# +# +# Python - Python targets, which can be used for linking against the Python +# extension modules directly. Note that this also imports the +# Python bindings for other requested components that have them. +# +# Panda3D::Python::panda3d.core +# Panda3D::Python::panda3d.physics +# etc. +# +# +# Tools - Various tools used in asset manipulation and debugging. +# +# Panda3D::Tools::egg2bam +# Panda3D::Tools::egg-optchar +# Panda3D::Tools::pview +# etc. +# +# +# Direct - Panda's "direct" Python framework; C++ support library. +# +# Panda3D::Direct::p3direct +# +# +# Egg - Support for the Egg file format. +# +# Panda3D::Egg::pandaegg +# +# +# Bullet - Support for Bullet physics. +# +# Panda3D::Bullet::p3bullet +# +# +# ODE - Support for the ODE physics engine. +# +# Panda3D::ODE::p3ode +# +# +# FFmpeg - Support for FFmpeg media format loading. +# +# Panda3D::FFmpeg::p3ffmpeg +# +# +# OpenAL - Support for OpenAL audio output. +# +# Panda3D::OpenAL::p3openal_audio +# +# +# FMOD - Support for FMOD audio output. +# +# Panda3D::OpenAL::p3fmod_audio +# +# +# OpenGL - Support for OpenGL rendering. +# +# Panda3D::OpenGL::pandagl +# +# +# DX9 - Support for Direct3D 9 rendering. +# +# Panda3D::DX9::pandadx9 +# +# +# GLES - Support for OpenGL ES rendering. +# +# Panda3D::GLES::pandagles +# Panda3D::GLES::pandagles2 +# +# +# Vision - Support for vision processing. +# +# Panda3D::Vision::p3vision +# +# +# VRPN - Support for connecting to a VRPN virtual reality server. +# +# Panda3D::VRPN::p3vrpn + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0) + message(FATAL_ERROR "CMake >= 3.0.2 required") +endif() + +get_filename_component(_panda_config_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) + +include("${_panda_config_prefix}/Panda3DPackages.cmake") + +set(_panda_components + Core Python Tools + Direct Egg + Bullet ODE + FFmpeg + OpenAL FMOD + OpenGL DX9 GLES + Vision VRPN +) + +set(Panda3D_FIND_REQUIRED_Core ON) + +foreach(_comp Core ${Panda3D_FIND_COMPONENTS}) + if(";${_panda_components};" MATCHES ";${_comp};" AND + EXISTS "${_panda_config_prefix}/Panda3D${_comp}Targets.cmake") + + include("${_panda_config_prefix}/Panda3D${_comp}Targets.cmake") + + if(";${Panda3D_FIND_COMPONENTS};" MATCHES ";Python;" AND + EXISTS "${_panda_config_prefix}/Panda3D${_comp}PythonTargets.cmake") + + include("${_panda_config_prefix}/Panda3D${_comp}PythonTargets.cmake") + + endif() + + elseif(Panda3D_FIND_REQUIRED_${_comp}) + + message(FATAL_ERROR "Panda3D REQUIRED component ${_comp} not found") + + endif() + +endforeach(_comp) +unset(_comp) + +unset(_panda_components) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index a3414e7176..dfbbaf55d6 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -370,6 +370,47 @@ function(export_packages filename) file(GENERATE OUTPUT "${filename}" CONTENT "${exports}") endfunction(export_packages) +# +# export_targets(set [NAMESPACE namespace] [COMPONENT component]) +# +# Export targets in the export set named by "set" +# +# NAMESPACE overrides the namespace prefixed to the exported targets; it +# defaults to "Panda3D::[set]::" if no explicit override is given. +# +# COMPONENT overrides the install component for the generated .cmake file; it +# defaults to "[set]" if no explicit override is given. +# +function(export_targets set) + set(namespace "Panda3D::${set}::") + set(component "${set}") + set(keyword) + foreach(arg ${ARGN}) + if(arg STREQUAL "NAMESPACE" OR + arg STREQUAL "COMPONENT") + + set(keyword "${arg}") + + elseif(keyword STREQUAL "NAMESPACE") + set(namespace "${arg}") + + elseif(keyword STREQUAL "COMPONENT") + set(component "${arg}") + + else() + message(FATAL_ERROR "export_targets() given unexpected arg: ${arg}") + + endif() + endforeach(arg) + + export(EXPORT "${set}" NAMESPACE "${namespace}" + FILE "${PROJECT_BINARY_DIR}/Panda3D${set}Targets.cmake") + install(EXPORT "${set}" NAMESPACE "${namespace}" + FILE "Panda3D${set}Targets.cmake" + COMPONENT "${component}" DESTINATION lib/cmake/Panda3D) + +endfunction(export_targets) + # # find_package # diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index e2325659ae..d10bf91aa9 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -80,3 +80,7 @@ except ImportError as err: # Now install ourselves: install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB COMPONENT Direct) endif() + +# "Direct" component contains both the Python stuff and the non-Python stuff, +# because direct has a pretty solid dependency on Python. +export_targets(Direct NAMESPACE "Panda3D::Direct::" COMPONENT DirectDevel) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 1384f18c20..e6d9446015 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -192,3 +192,9 @@ configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_ install(FILES "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h" COMPONENT CoreDevel DESTINATION include/panda3d) + +# Generate the package configuration file +export_packages("${PROJECT_BINARY_DIR}/Panda3DPackages.cmake") +install(FILES "${PROJECT_BINARY_DIR}/Panda3DPackages.cmake" + COMPONENT CoreDevel + DESTINATION "lib/cmake/Panda3D") diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 2028613ad1..1f8bb19741 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -99,23 +99,37 @@ if(HAVE_PYTHON) if(HAVE_BULLET) add_python_module(bullet p3bullet IMPORT panda3d.core COMPONENT BulletPython) + + export_targets(BulletPython NAMESPACE "Panda3D::Python::" COMPONENT BulletDevel) endif() if(HAVE_EGG) add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core COMPONENT EggPython) + + export_targets(EggPython NAMESPACE "Panda3D::Python::" COMPONENT EggDevel) endif() add_python_module(physics p3physics p3particlesystem LINK pandaphysics IMPORT panda3d.core) if(HAVE_ODE) add_python_module(ode p3ode IMPORT panda3d.core COMPONENT ODEPython) + + export_targets(ODEPython NAMESPACE "Panda3D::Python::" COMPONENT ODEDevel) endif() if(HAVE_OPENCV OR HAVE_ARTOOLKIT) add_python_module(vision p3vision IMPORT panda3d.core COMPONENT VisionPython) + + export_targets(VisionPython NAMESPACE "Panda3D::Python::" COMPONENT VisionDevel) endif() if(HAVE_VRPN) add_python_module(vrpn p3vrpn IMPORT panda3d.core COMPONENT VRPNPython) + + export_targets(VRPNPython NAMESPACE "Panda3D::Python::" COMPONENT VRPNDevel) endif() + + export_targets(Python NAMESPACE "Panda3D::Python::" COMPONENT CoreDevel) endif() + +export_targets(Core COMPONENT CoreDevel) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index a41cffdbe3..b6f5e56cdb 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -14,3 +14,5 @@ install(TARGETS pandaegg DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT EggDevel) + +export_targets(Egg COMPONENT EggDevel) diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 40fe9a1810..176b176ccb 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -40,3 +40,5 @@ install(TARGETS pandagl EXPORT OpenGL COMPONENT OpenGL DESTINATION ${MODULE_DESTINATION} ARCHIVE COMPONENT OpenGLDevel) + +export_targets(OpenGL NAMESPACE "Panda3D::OpenGL::" COMPONENT OpenGLDevel) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 2c0988288c..3ed5fbe0dd 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -30,6 +30,8 @@ if(HAVE_RAD_MSS) DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT MilesDevel) + + export_targets(Miles NAMESPACE "Panda3D::Miles::" COMPONENT MilesDevel) endif() if(HAVE_FMODEX) @@ -51,6 +53,8 @@ if(HAVE_FMODEX) DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT FMODDevel) + + export_targets(FMOD NAMESPACE "Panda3D::FMOD::" COMPONENT FMODDevel) endif() if(HAVE_OPENAL) @@ -73,4 +77,6 @@ if(HAVE_OPENAL) DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT OpenALDevel) + + export_targets(OpenAL NAMESPACE "Panda3D::OpenAL::" COMPONENT OpenALDevel) endif() diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index c001fa54d8..8dbf70954d 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -118,3 +118,5 @@ install(TARGETS p3bullet RUNTIME DESTINATION bin ARCHIVE COMPONENT BulletDevel) install(FILES ${P3BULLET_HEADERS} COMPONENT BulletDevel DESTINATION include/panda3d) + +export_targets(Bullet COMPONENT BulletDevel) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index a61fa8a4ed..18ff027cb9 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -98,3 +98,5 @@ install(TARGETS p3ode RUNTIME DESTINATION bin ARCHIVE COMPONENT ODEDevel) install(FILES ${P3ODE_HEADERS} COMPONENT ODEDevel DESTINATION include/panda3d) + +export_targets(ODE COMPONENT ODEDevel) diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt index 5f905ebe86..a581ef3076 100644 --- a/panda/src/vision/CMakeLists.txt +++ b/panda/src/vision/CMakeLists.txt @@ -39,3 +39,5 @@ install(TARGETS p3vision RUNTIME DESTINATION bin ARCHIVE COMPONENT VisionDevel) install(FILES ${P3VISION_HEADERS} COMPONENT VisionDevel DESTINATION include/panda3d) + +export_targets(Vision COMPONENT VisionDevel) From 4504530fd568b5d1fc85e55e25f972432a73a2f3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 28 Dec 2018 20:29:27 -0700 Subject: [PATCH 574/744] CMake: Also export FFmpeg/VRPN/DX9/VRPN I forgot to add these exports before. See bddd7c1b4b0544096aa6e301fe6a53c3d8a436c7 --- panda/metalibs/pandadx9/CMakeLists.txt | 2 ++ panda/metalibs/pandagles/CMakeLists.txt | 5 +++++ panda/metalibs/pandagles2/CMakeLists.txt | 2 ++ panda/src/ffmpeg/CMakeLists.txt | 2 ++ panda/src/vrpn/CMakeLists.txt | 2 ++ 5 files changed, 13 insertions(+) diff --git a/panda/metalibs/pandadx9/CMakeLists.txt b/panda/metalibs/pandadx9/CMakeLists.txt index 70d82d89d6..70c8e2ff3a 100644 --- a/panda/metalibs/pandadx9/CMakeLists.txt +++ b/panda/metalibs/pandadx9/CMakeLists.txt @@ -14,3 +14,5 @@ install(TARGETS pandadx9 EXPORT DX9 COMPONENT DX9 DESTINATION ${MODULE_DESTINATION} ARCHIVE COMPONENT DX9Devel) + +export_targets(DX9 COMPONENT DX9Devel) diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt index 34a803e976..d5155e415b 100644 --- a/panda/metalibs/pandagles/CMakeLists.txt +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -22,3 +22,8 @@ install(TARGETS pandagles EXPORT GLES COMPONENT GLES DESTINATION ${MODULE_DESTINATION} ARCHIVE COMPONENT GLESDevel) + +if(NOT HAVE_GLES2) + # If GLES2 won't export this, we should do so here. + export_targets(GLES COMPONENT GLESDevel) +endif() diff --git a/panda/metalibs/pandagles2/CMakeLists.txt b/panda/metalibs/pandagles2/CMakeLists.txt index 74cb6c50a4..ebc0cbdcd2 100644 --- a/panda/metalibs/pandagles2/CMakeLists.txt +++ b/panda/metalibs/pandagles2/CMakeLists.txt @@ -14,3 +14,5 @@ install(TARGETS pandagles2 EXPORT GLES COMPONENT GLES DESTINATION ${MODULE_DESTINATION} ARCHIVE COMPONENT GLESDevel) + +export_targets(GLES COMPONENT GLESDevel) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index ea20395469..f832602996 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -31,3 +31,5 @@ install(TARGETS p3ffmpeg RUNTIME DESTINATION bin ARCHIVE COMPONENT FFmpegDevel) install(FILES ${P3FFMPEG_HEADERS} COMPONENT FFmpegDevel DESTINATION include/panda3d) + +export_targets(FFmpeg COMPONENT FFmpegDevel) diff --git a/panda/src/vrpn/CMakeLists.txt b/panda/src/vrpn/CMakeLists.txt index 55f2fa91df..ff7e0f20c9 100644 --- a/panda/src/vrpn/CMakeLists.txt +++ b/panda/src/vrpn/CMakeLists.txt @@ -41,3 +41,5 @@ install(TARGETS p3vrpn RUNTIME DESTINATION bin ARCHIVE COMPONENT VRPNDevel) install(FILES ${P3VRPN_HEADERS} COMPONENT VRPNDevel DESTINATION include/panda3d) + +export_targets(VRPN COMPONENT VRPNDevel) From 66d145e2d2206f18e045915806df2aa171101d58 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 28 Dec 2018 22:07:04 -0700 Subject: [PATCH 575/744] CMake: Oops, fix some macOS linkage mistakes --- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/osxdisplay/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 6bcef03b8f..e1d8450f92 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -30,7 +30,7 @@ composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) add_component_library(p3cocoadisplay SYMBOL BUILDING_PANDA_COCOADISPLAY ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) set_target_properties(p3cocoadisplay PROPERTIES COMPILE_FLAGS "-ObjC++") -target_link_libraries(p3cocoadisplay p3display p3putil p3glgsg) +target_link_libraries(p3cocoadisplay p3glgsg panda) # Frameworks: find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt index 58b58ddb6d..1bb5af7c36 100644 --- a/panda/src/osxdisplay/CMakeLists.txt +++ b/panda/src/osxdisplay/CMakeLists.txt @@ -18,7 +18,7 @@ composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) add_component_library(p3osxdisplay SYMBOL BUILDING_PANDA_OSXDISPLAY ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) set_target_properties(p3osxdisplay PROPERTIES COMPILE_FLAGS "-ObjC++") -target_link_libraries(p3osxdisplay p3display p3putil p3glgsg) +target_link_libraries(p3osxdisplay p3glgsg panda) # Frameworks: find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) From e512ee5fa5f6aceec22c3bc661d42313e7e9cbd7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 28 Dec 2018 22:16:13 -0700 Subject: [PATCH 576/744] CMake: Update for upstream changes The main change here is that input-overhaul landed, so this commit adds all of those files to the CMake side. This also reverses the dependency relationship between p3device and p3display: the latter now requires the former. --- panda/src/collide/CMakeLists.txt | 5 +-- panda/src/device/CMakeLists.txt | 62 ++++++++++++++++++++++++-------- panda/src/display/CMakeLists.txt | 4 ++- panda/src/putil/CMakeLists.txt | 14 +++++--- 4 files changed, 62 insertions(+), 23 deletions(-) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index c906122e33..9306e805c6 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -1,5 +1,6 @@ set(P3COLLIDE_HEADERS collisionBox.I collisionBox.h + collisionCapsule.I collisionCapsule.h collisionEntry.I collisionEntry.h collisionGeom.I collisionGeom.h collisionHandler.I collisionHandler.h @@ -26,12 +27,13 @@ set(P3COLLIDE_HEADERS collisionSolid.I collisionSolid.h collisionSphere.I collisionSphere.h collisionTraverser.I collisionTraverser.h - collisionTube.I collisionTube.h + collisionTube.h collisionVisualizer.I collisionVisualizer.h config_collide.h ) set(P3COLLIDE_SOURCES collisionBox.cxx + collisionCapsule.cxx collisionEntry.cxx collisionGeom.cxx collisionHandler.cxx @@ -58,7 +60,6 @@ set(P3COLLIDE_SOURCES collisionSolid.cxx collisionSphere.cxx collisionTraverser.cxx - collisionTube.cxx collisionVisualizer.cxx config_collide.cxx ) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 7051f7248f..c6b47b608e 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -1,37 +1,69 @@ set(P3DEVICE_HEADERS - analogNode.I analogNode.h - buttonNode.I buttonNode.h - clientAnalogDevice.I clientAnalogDevice.h clientBase.I - clientBase.h clientButtonDevice.I clientButtonDevice.h - clientDevice.I clientDevice.h clientDialDevice.I - clientDialDevice.h clientTrackerDevice.I - clientTrackerDevice.h config_device.h - dialNode.I dialNode.h - mouseAndKeyboard.h - trackerData.I trackerData.h - trackerNode.I trackerNode.h + analogNode.h analogNode.I + buttonNode.h buttonNode.I + clientAnalogDevice.h clientAnalogDevice.I + clientBase.h clientBase.I + clientButtonDevice.h clientButtonDevice.I + clientDevice.h clientDevice.I + clientDialDevice.h clientDialDevice.I + clientTrackerDevice.h clientTrackerDevice.I + config_device.h + dialNode.h dialNode.I + evdevInputDevice.h evdevInputDevice.I + inputDevice.h inputDevice.I + inputDeviceManager.h inputDeviceManager.I + inputDeviceNode.h + inputDeviceSet.h inputDeviceSet.I + ioKitInputDevice.h + ioKitInputDeviceManager.h + linuxInputDeviceManager.h + linuxJoystickDevice.h linuxJoystickDevice.I + trackerData.h trackerData.I + trackerNode.h trackerNode.I virtualMouse.h + winInputDeviceManager.h + winRawInputDevice.h + xInputDevice.h ) + set(P3DEVICE_SOURCES analogNode.cxx buttonNode.cxx clientAnalogDevice.cxx - clientBase.cxx clientButtonDevice.cxx clientDevice.cxx - clientDialDevice.cxx clientTrackerDevice.cxx + clientBase.cxx + clientButtonDevice.cxx + clientDevice.cxx + clientDialDevice.cxx + clientTrackerDevice.cxx config_device.cxx dialNode.cxx - mouseAndKeyboard.cxx + evdevInputDevice.cxx + inputDevice.cxx + inputDeviceManager.cxx + inputDeviceNode.cxx + inputDeviceSet.cxx + ioKitInputDevice.cxx + ioKitInputDeviceManager.cxx + linuxInputDeviceManager.cxx + linuxJoystickDevice.cxx trackerData.cxx trackerNode.cxx virtualMouse.cxx + winInputDeviceManager.cxx + winRawInputDevice.cxx + xInputDevice.cxx ) composite_sources(p3device P3DEVICE_SOURCES) add_component_library(p3device SYMBOL BUILDING_PANDA_DEVICE ${P3DEVICE_HEADERS} ${P3DEVICE_SOURCES}) -target_link_libraries(p3device p3dgraph p3display) +target_link_libraries(p3device p3dgraph) target_interrogate(p3device ALL) +if(WIN32) + target_link_libraries(p3device Cfgmgr32.lib) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3device EXPORT Core COMPONENT Core diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 0298ef9974..a369b7f4e7 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -20,6 +20,7 @@ set(P3DISPLAY_HEADERS graphicsWindowInputDevice.I graphicsWindowInputDevice.h graphicsWindowProc.h graphicsWindowProcCallbackData.I graphicsWindowProcCallbackData.h + mouseAndKeyboard.h nativeWindowHandle.I nativeWindowHandle.h parasiteBuffer.I parasiteBuffer.h pStatGPUTimer.I pStatGPUTimer.h @@ -55,6 +56,7 @@ set(P3DISPLAY_SOURCES graphicsWindowProc.cxx graphicsWindowProcCallbackData.cxx graphicsDevice.cxx + mouseAndKeyboard.cxx nativeWindowHandle.cxx parasiteBuffer.cxx windowHandle.cxx @@ -91,7 +93,7 @@ endif() composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) -target_link_libraries(p3display p3cull p3pgraphnodes +target_link_libraries(p3display p3cull p3device p3pgraphnodes PKG::X11) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index f79df878f3..6547cac759 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -36,6 +36,7 @@ set(P3PUTIL_HEADERS factoryParams.h firstOfPairCompare.I firstOfPairCompare.h firstOfPairLess.I firstOfPairLess.h + gamepadButton.h globalPointerRegistry.I globalPointerRegistry.h indirectCompareNames.I indirectCompareNames.h indirectCompareSort.I indirectCompareSort.h @@ -46,11 +47,13 @@ set(P3PUTIL_HEADERS linkedListNode.I linkedListNode.h load_prc_file.h loaderOptions.I loaderOptions.h - modifierButtons.I modifierButtons.h mouseButton.h - mouseData.I mouseData.h nameUniquifier.I nameUniquifier.h + modifierButtons.I modifierButtons.h + mouseButton.h mouseData.h + nameUniquifier.I nameUniquifier.h nodeCachedReferenceCount.h nodeCachedReferenceCount.I paramValue.I paramValue.h pbitops.I pbitops.h + pointerData.h pointerData.I portalMask.h pta_ushort.h simpleHashMap.I simpleHashMap.h @@ -62,7 +65,6 @@ set(P3PUTIL_HEADERS vector_typedWritable.h vector_ulong.h vector_ushort.h vector_writable.h - weakKeyHashMap.h weakKeyHashMap.I writableConfigurable.h writableParam.I writableParam.h ) @@ -93,6 +95,7 @@ set(P3PUTIL_SOURCES doubleBitMask.cxx factoryBase.cxx factoryParam.cxx factoryParams.cxx + gamepadButton.cxx globalPointerRegistry.cxx ioPtaDatagramFloat.cxx ioPtaDatagramInt.cxx ioPtaDatagramShort.cxx @@ -100,11 +103,13 @@ set(P3PUTIL_SOURCES linkedListNode.cxx load_prc_file.cxx loaderOptions.cxx - modifierButtons.cxx mouseButton.cxx mouseData.cxx + modifierButtons.cxx + mouseButton.cxx nameUniquifier.cxx nodeCachedReferenceCount.cxx paramValue.cxx pbitops.cxx + pointerData.cxx pta_ushort.cxx simpleHashMap.cxx sparseArray.cxx @@ -114,7 +119,6 @@ set(P3PUTIL_SOURCES vector_typedWritable.cxx vector_ulong.cxx vector_ushort.cxx vector_writable.cxx - weakKeyHashMap.cxx writableConfigurable.cxx writableParam.cxx ) From 6c5bf73141dc711187a21904d9c1f9ff1de69834 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 29 Dec 2018 02:02:52 -0700 Subject: [PATCH 577/744] CMake: Don't build pview/downloadertools when BUILD_PANDATOOL=OFF --- panda/src/downloadertools/CMakeLists.txt | 6 +++++ panda/src/testbed/CMakeLists.txt | 29 +++++------------------- 2 files changed, 12 insertions(+), 23 deletions(-) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index aae9cf85fa..bd3d3124ed 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -1,3 +1,9 @@ +if(NOT BUILD_PANDATOOL) + # It's safe to say, if the user doesn't want pandatool, they don't want these + # tools either. + return() +endif() + if(HAVE_OPENSSL) add_executable(apply_patch apply_patch.cxx) target_link_libraries(apply_patch panda) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index 4872df41ad..e44ce3a2a5 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -1,26 +1,9 @@ +if(NOT BUILD_PANDATOOL) + # It's safe to say, if the user doesn't want pandatool, they don't want pview + # either. + return() +endif() + add_executable(pview pview.cxx) target_link_libraries(pview p3framework p3pystub) install(TARGETS pview EXPORT Tools COMPONENT Tools DESTINATION bin) - -#begin test_bin_target - #define TARGET pgrid - - #define SOURCES \ -# pgrid.cxx - #define UNIX_SYS_LIBS m -#end test_bin_target - -#begin test_bin_target - #define TARGET test_lod - #define SOURCES test_lod.cxx -#end test_bin_target - -#begin test_bin_target - #define TARGET test_texmem - #define SOURCES test_texmem.cxx -#end test_bin_target - -#begin test_bin_target - #define TARGET test_map - #define SOURCES test_map.cxx -#end test_bin_target From 788efb9f6d6a61f45dd6dc18782fb439d868043a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 29 Dec 2018 02:26:53 -0700 Subject: [PATCH 578/744] CMake: Fix build when HAVE_EGG=OFF --- pandatool/src/bam/CMakeLists.txt | 22 +++++++++++++--------- pandatool/src/converter/CMakeLists.txt | 4 ++++ pandatool/src/dxfegg/CMakeLists.txt | 4 ++++ pandatool/src/dxfprogs/CMakeLists.txt | 16 ++++++++++------ pandatool/src/egg-mkfont/CMakeLists.txt | 4 ++++ pandatool/src/egg-optchar/CMakeLists.txt | 4 ++++ pandatool/src/egg-palettize/CMakeLists.txt | 4 ++++ pandatool/src/egg-qtess/CMakeLists.txt | 4 ++++ pandatool/src/eggbase/CMakeLists.txt | 4 ++++ pandatool/src/eggcharbase/CMakeLists.txt | 4 ++++ pandatool/src/eggprogs/CMakeLists.txt | 4 ++++ pandatool/src/fltegg/CMakeLists.txt | 4 ++++ pandatool/src/fltprogs/CMakeLists.txt | 16 ++++++++++------ pandatool/src/lwoegg/CMakeLists.txt | 4 ++++ pandatool/src/lwoprogs/CMakeLists.txt | 10 +++++++--- pandatool/src/objegg/CMakeLists.txt | 4 ++++ pandatool/src/objprogs/CMakeLists.txt | 4 ++++ pandatool/src/palettizer/CMakeLists.txt | 4 ++++ pandatool/src/ptloader/CMakeLists.txt | 4 ++++ pandatool/src/vrmlegg/CMakeLists.txt | 4 ++++ pandatool/src/vrmlprogs/CMakeLists.txt | 10 +++++++--- pandatool/src/xfileegg/CMakeLists.txt | 4 ++++ pandatool/src/xfileprogs/CMakeLists.txt | 18 +++++++++++------- 23 files changed, 126 insertions(+), 34 deletions(-) diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index 880642e616..96dad943e8 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -2,14 +2,18 @@ add_executable(bam-info bamInfo.cxx bamInfo.h) target_link_libraries(bam-info p3progbase panda) install(TARGETS bam-info EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(egg2bam eggToBam.cxx eggToBam.h) -target_link_libraries(egg2bam p3eggbase p3progbase panda) -install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin) +if(HAVE_EGG) -add_executable(bam2egg bamToEgg.cxx bamToEgg.h) -target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda) -install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + add_executable(egg2bam eggToBam.cxx eggToBam.h) + target_link_libraries(egg2bam p3eggbase p3progbase panda) + install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(pts2bam ptsToBam.cxx ptsToBam.h) -target_link_libraries(pts2bam p3progbase pandaegg panda) -install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION bin) + add_executable(bam2egg bamToEgg.cxx bamToEgg.h) + target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda) + install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + + add_executable(pts2bam ptsToBam.cxx ptsToBam.h) + target_link_libraries(pts2bam p3progbase pandaegg panda) + install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() diff --git a/pandatool/src/converter/CMakeLists.txt b/pandatool/src/converter/CMakeLists.txt index aee79d48c6..2e75fed9f2 100644 --- a/pandatool/src/converter/CMakeLists.txt +++ b/pandatool/src/converter/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3CONVERTER_HEADERS somethingToEggConverter.h somethingToEggConverter.I eggToSomethingConverter.h eggToSomethingConverter.I diff --git a/pandatool/src/dxfegg/CMakeLists.txt b/pandatool/src/dxfegg/CMakeLists.txt index dd2b994483..74684b1c1f 100644 --- a/pandatool/src/dxfegg/CMakeLists.txt +++ b/pandatool/src/dxfegg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3DXFEGG_HEADERS dxfToEggConverter.h dxfToEggLayer.h diff --git a/pandatool/src/dxfprogs/CMakeLists.txt b/pandatool/src/dxfprogs/CMakeLists.txt index d77cd12252..627474b02a 100644 --- a/pandatool/src/dxfprogs/CMakeLists.txt +++ b/pandatool/src/dxfprogs/CMakeLists.txt @@ -2,10 +2,14 @@ add_executable(dxf-points dxfPoints.cxx dxfPoints.h) target_link_libraries(dxf-points p3progbase p3dxf) install(TARGETS dxf-points EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h) -target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase) -install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION bin) +if(HAVE_EGG) -add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h) -target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase) -install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h) + target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase) + install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION bin) + + add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h) + target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase) + install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() diff --git a/pandatool/src/egg-mkfont/CMakeLists.txt b/pandatool/src/egg-mkfont/CMakeLists.txt index 4b4f6f3525..7f2bdaf538 100644 --- a/pandatool/src/egg-mkfont/CMakeLists.txt +++ b/pandatool/src/egg-mkfont/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3EGG_MKFONT_HEADERS eggMakeFont.h rangeDescription.h rangeDescription.I diff --git a/pandatool/src/egg-optchar/CMakeLists.txt b/pandatool/src/egg-optchar/CMakeLists.txt index 41ffdcddf5..4d2083e92e 100644 --- a/pandatool/src/egg-optchar/CMakeLists.txt +++ b/pandatool/src/egg-optchar/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3EGG_OPTCHAR_HEADERS config_egg_optchar.h eggOptchar.h diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 8d20cbff15..6f799a4d3c 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + add_executable(egg-palettize eggPalettize.cxx eggPalettize.h) target_link_libraries(egg-palettize p3palettizer p3eggbase p3progbase) install(TARGETS egg-palettize EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/egg-qtess/CMakeLists.txt b/pandatool/src/egg-qtess/CMakeLists.txt index 3ebccdd01b..a74919cfb5 100644 --- a/pandatool/src/egg-qtess/CMakeLists.txt +++ b/pandatool/src/egg-qtess/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3EGG_QTESS_HEADERS config_egg_qtess.h eggQtess.h diff --git a/pandatool/src/eggbase/CMakeLists.txt b/pandatool/src/eggbase/CMakeLists.txt index 1abb6a2dd3..115ac0882c 100644 --- a/pandatool/src/eggbase/CMakeLists.txt +++ b/pandatool/src/eggbase/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3EGGBASE_HEADERS eggBase.h eggConverter.h eggFilter.h eggMakeSomething.h diff --git a/pandatool/src/eggcharbase/CMakeLists.txt b/pandatool/src/eggcharbase/CMakeLists.txt index b07b42929a..384bebe032 100644 --- a/pandatool/src/eggcharbase/CMakeLists.txt +++ b/pandatool/src/eggcharbase/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3EGGCHARBASE_HEADERS config_eggcharbase.h eggBackPointer.h diff --git a/pandatool/src/eggprogs/CMakeLists.txt b/pandatool/src/eggprogs/CMakeLists.txt index e4e3921f24..074ebc8e01 100644 --- a/pandatool/src/eggprogs/CMakeLists.txt +++ b/pandatool/src/eggprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + add_executable(egg-crop eggCrop.cxx eggCrop.h) target_link_libraries(egg-crop p3eggbase) install(TARGETS egg-crop EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/fltegg/CMakeLists.txt b/pandatool/src/fltegg/CMakeLists.txt index 5072e863f0..5a61e47ace 100644 --- a/pandatool/src/fltegg/CMakeLists.txt +++ b/pandatool/src/fltegg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3FLTEGG_HEADERS fltToEggConverter.h fltToEggConverter.I fltToEggLevelState.h fltToEggLevelState.I diff --git a/pandatool/src/fltprogs/CMakeLists.txt b/pandatool/src/fltprogs/CMakeLists.txt index 2bf1b1f63b..31bb45e4ef 100644 --- a/pandatool/src/fltprogs/CMakeLists.txt +++ b/pandatool/src/fltprogs/CMakeLists.txt @@ -10,10 +10,14 @@ add_executable(fltcopy fltCopy.cxx fltCopy.h) target_link_libraries(fltcopy p3progbase p3cvscopy p3flt) install(TARGETS fltcopy EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(egg2flt eggToFlt.cxx eggToFlt.h) -target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase) -install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION bin) +if(HAVE_EGG) -add_executable(flt2egg fltToEgg.cxx fltToEgg.h) -target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase) -install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + add_executable(egg2flt eggToFlt.cxx eggToFlt.h) + target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase) + install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION bin) + + add_executable(flt2egg fltToEgg.cxx fltToEgg.h) + target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase) + install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() diff --git a/pandatool/src/lwoegg/CMakeLists.txt b/pandatool/src/lwoegg/CMakeLists.txt index da4d156bdc..dbd4cff02f 100644 --- a/pandatool/src/lwoegg/CMakeLists.txt +++ b/pandatool/src/lwoegg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3LWOEGG_HEADERS cLwoClip.h cLwoClip.I cLwoLayer.h cLwoLayer.I diff --git a/pandatool/src/lwoprogs/CMakeLists.txt b/pandatool/src/lwoprogs/CMakeLists.txt index 8f166279f5..50ec203a06 100644 --- a/pandatool/src/lwoprogs/CMakeLists.txt +++ b/pandatool/src/lwoprogs/CMakeLists.txt @@ -2,6 +2,10 @@ add_executable(lwo-scan lwoScan.cxx lwoScan.h) target_link_libraries(lwo-scan p3progbase p3lwo) install(TARGETS lwo-scan EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h) -target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase) -install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION bin) +if(HAVE_EGG) + + add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h) + target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase) + install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() diff --git a/pandatool/src/objegg/CMakeLists.txt b/pandatool/src/objegg/CMakeLists.txt index 839c176be8..c6106815b2 100644 --- a/pandatool/src/objegg/CMakeLists.txt +++ b/pandatool/src/objegg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3OBJEGG_HEADERS config_objegg.h eggToObjConverter.h diff --git a/pandatool/src/objprogs/CMakeLists.txt b/pandatool/src/objprogs/CMakeLists.txt index 60dac7aadd..b93a62f6fd 100644 --- a/pandatool/src/objprogs/CMakeLists.txt +++ b/pandatool/src/objprogs/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + add_executable(egg2obj eggToObj.cxx eggToObj.h) target_link_libraries(egg2obj p3objegg p3eggbase) install(TARGETS egg2obj EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/palettizer/CMakeLists.txt b/pandatool/src/palettizer/CMakeLists.txt index 17eed82416..f3cb281893 100644 --- a/pandatool/src/palettizer/CMakeLists.txt +++ b/pandatool/src/palettizer/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3PALETTIZER_HEADERS config_palettizer.h destTextureImage.h diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt index 174aa6eb80..c88009a520 100644 --- a/pandatool/src/ptloader/CMakeLists.txt +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3PTLOADER_HEADERS config_ptloader.h loaderFileTypePandatool.h diff --git a/pandatool/src/vrmlegg/CMakeLists.txt b/pandatool/src/vrmlegg/CMakeLists.txt index 621aa1a852..b2a38c840e 100644 --- a/pandatool/src/vrmlegg/CMakeLists.txt +++ b/pandatool/src/vrmlegg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3VRMLEGG_HEADERS indexedFaceSet.h vrmlAppearance.h diff --git a/pandatool/src/vrmlprogs/CMakeLists.txt b/pandatool/src/vrmlprogs/CMakeLists.txt index 7396148af7..73fa9c9441 100644 --- a/pandatool/src/vrmlprogs/CMakeLists.txt +++ b/pandatool/src/vrmlprogs/CMakeLists.txt @@ -2,6 +2,10 @@ add_executable(vrml-trans vrmlTrans.cxx vrmlTrans.h) target_link_libraries(vrml-trans p3progbase p3vrml) install(TARGETS vrml-trans EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h) -target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase) -install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION bin) +if(HAVE_EGG) + + add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h) + target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase) + install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() diff --git a/pandatool/src/xfileegg/CMakeLists.txt b/pandatool/src/xfileegg/CMakeLists.txt index 606079e539..eb8bd12e57 100644 --- a/pandatool/src/xfileegg/CMakeLists.txt +++ b/pandatool/src/xfileegg/CMakeLists.txt @@ -1,3 +1,7 @@ +if(NOT HAVE_EGG) + return() +endif() + set(P3XFILEEGG_HEADERS xFileAnimationSet.h xFileAnimationSet.I xFileFace.h xFileMaker.h diff --git a/pandatool/src/xfileprogs/CMakeLists.txt b/pandatool/src/xfileprogs/CMakeLists.txt index db4e48f23a..d8b7f5e810 100644 --- a/pandatool/src/xfileprogs/CMakeLists.txt +++ b/pandatool/src/xfileprogs/CMakeLists.txt @@ -1,11 +1,15 @@ -add_executable(egg2x eggToX.cxx eggToX.h) -target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase) -install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION bin) - add_executable(x-trans xFileTrans.cxx xFileTrans.h) target_link_libraries(x-trans p3progbase p3xfile) install(TARGETS x-trans EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(x2egg xFileToEgg.cxx xFileToEgg.h) -target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase) -install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION bin) +if(HAVE_EGG) + + add_executable(egg2x eggToX.cxx eggToX.h) + target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase) + install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION bin) + + add_executable(x2egg xFileToEgg.cxx xFileToEgg.h) + target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase) + install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() From 211ac763d1c8d53ba83020d1e9b3ba5307b0e3f1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 29 Dec 2018 02:55:01 -0700 Subject: [PATCH 579/744] CMake: Update the list of pure-Python packages under direct --- direct/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index d10bf91aa9..6b549ddbf5 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -42,9 +42,9 @@ if(HAVE_PYTHON) # Copy Python source files into the build directory set(DIRECT_INSTALL_DIRECTORIES actor cluster controls directbase directdevices directnotify directscripts - directtools directutil distributed extensions extensions_native ffi filter - fsm gui http interval leveleditor motiontrail p3d particles physics pyinst - showbase showutil stdpy task test tkpanels tkwidgets wxwidgets) + directtools directutil dist distributed extensions_native filter + fsm gui interval leveleditor motiontrail p3d particles physics + showbase showutil stdpy task tkpanels tkwidgets wxwidgets) foreach(dir ${DIRECT_INSTALL_DIRECTORIES}) file(COPY From 3122bf350628247dfbf6b00042c6aa6bb424abf4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 29 Dec 2018 04:01:05 -0700 Subject: [PATCH 580/744] CMake: Fix p3device build on macOS --- panda/src/cocoadisplay/CMakeLists.txt | 4 +++- panda/src/device/CMakeLists.txt | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index e1d8450f92..7447c6e1f4 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -36,8 +36,10 @@ target_link_libraries(p3cocoadisplay p3glgsg panda) find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) find_library(APPKIT_LIBRARY AppKit) find_library(CARBON_LIBRARY Carbon) +find_library(CORE_VIDEO_LIBRARY CoreVideo) target_link_libraries(p3cocoadisplay - ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY}) + ${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY} + ${CORE_VIDEO_LIBRARY}) if(NOT BUILD_METALIBS) install(TARGETS p3cocoadisplay EXPORT Core COMPONENT Core DESTINATION lib) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index c6b47b608e..0839ac57df 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -62,6 +62,9 @@ target_interrogate(p3device ALL) if(WIN32) target_link_libraries(p3device Cfgmgr32.lib) +elseif(APPLE) + find_library(IOKIT_LIBRARY IOKit) + target_link_libraries(p3device ${IOKIT_LIBRARY}) endif() if(NOT BUILD_METALIBS) From aa9a1956653d3cd3c218b87f7ecc4807cc12454d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 2 Jan 2019 06:02:31 -0700 Subject: [PATCH 581/744] CMake: Stop CMake from adding -rdynamic by default --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c5d8274d8c..5793c47c26 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,13 @@ if(WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() +# CMake will often pass -rdynamic when linking executables as a convenience for +# projects that might forget when to use ENABLE_EXPORTS. This is preposterous, +# since it prevents the linker from removing symbols unneeded by the executable +# and stops us from identifying cases where ENABLE_EXPORTS is needed. +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") + # As long as we're figuring out compiler flags, figure out the flags for # turning C++ exception support on and off if(MSVC) From 18d5c983deb57d0a8e60c6d7a66235fbba7b87fb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 2 Jan 2019 06:08:15 -0700 Subject: [PATCH 582/744] CMake: Make Python static library names use '.' This is to be consistent with makepanda as of cedd4172c4e. --- cmake/macros/Python.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 6cac9001a0..1492a49e83 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -42,7 +42,6 @@ function(add_python_target target) endforeach(arg) string(REGEX REPLACE "\\.[^.]+$" "" namespace "${target}") - string(REPLACE "." "_" underscore_namespace "${namespace}") string(REPLACE "." "/" slash_namespace "${namespace}") add_library(${target} ${MODULE_TYPE} ${sources}) @@ -61,13 +60,13 @@ function(add_python_target target) else() set_target_properties(${target} PROPERTIES OUTPUT_NAME "${basename}" - PREFIX "libpython_${underscore_namespace}_") + PREFIX "libpy.${namespace}.") install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION lib) endif() set(keywords OVERWRITE ARCH) - if(NOT underscore_namespace MATCHES ".*_.*") + if(NOT slash_namespace MATCHES ".*/.*") list(APPEND keywords ROOT) endif() ensure_python_init("${PROJECT_BINARY_DIR}/${slash_namespace}" ${keywords}) From ad6cc0f21f8e00e930bb4a5017b4bfc933380de6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 3 Jan 2019 02:30:38 -0700 Subject: [PATCH 583/744] CMake: Remove ALTERNATIVE_MALLOC This apparently no longer does anything. --- dtool/Config.cmake | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 34a3626b4e..47c0e94690 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -342,10 +342,6 @@ if 16-byte alignment must be performed on top of it, wasting up to is required and not provided by the system malloc library, then an alternative malloc system (above) will be used instead." OFF) -option(ALTERNATIVE_MALLOC - "Do you want to use one of the alternative malloc implementations?" - OFF) - option(USE_DELETED_CHAIN "Define this true to use the DELETED_CHAIN macros, which support fast re-use of existing allocated blocks, minimizing the low-level @@ -355,7 +351,7 @@ suspect a bug in Panda's memory management code." ON) mark_as_advanced(DO_MEMORY_USAGE SIMULATE_NETWORK_DELAY SUPPORT_IMMEDIATE_MODE USE_MEMORY_DLMALLOC USE_MEMORY_PTMALLOC2 - MEMORY_HOOK_DO_ALIGN ALTERNATIVE_MALLOC USE_DELETED_CHAIN) + MEMORY_HOOK_DO_ALIGN USE_DELETED_CHAIN) # From f01303a0b3ead8957b88be7a6d7a5107d16acef4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 3 Jan 2019 06:01:57 -0700 Subject: [PATCH 584/744] CMake: Fix exported packages on Windows --- cmake/macros/PackageConfig.cmake | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index dfbbaf55d6..1b54027222 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -335,7 +335,10 @@ function(export_packages filename) get_target_property(type "${head}" TYPE) if(NOT type STREQUAL "INTERFACE_LIBRARY") get_target_property(imported_location "${head}" IMPORTED_LOCATION) - if(imported_location) + get_target_property(imported_implib "${head}" IMPORTED_IMPLIB) + if(imported_implib) + list(APPEND libraries ${imported_implib}) + elseif(imported_location) list(APPEND libraries ${imported_location}) endif() @@ -343,6 +346,13 @@ function(export_packages filename) if(configs AND NOT imported_location) foreach(config ${configs}) get_target_property(imported_location "${head}" IMPORTED_LOCATION_${config}) + + # Prefer IMPORTED_IMPLIB where present + get_target_property(imported_implib "${head}" IMPORTED_IMPLIB_${config}) + if(imported_implib) + set(imported_location "${imported_implib}") + endif() + if(imported_location) if(configs MATCHES ".*;.*") set(_bling "$<1:$>") # genex-escaped $ @@ -353,7 +363,16 @@ function(export_packages filename) endif() endforeach(config) endif() + + else() + # This is an INTERFACE_LIBRARY + get_target_property(imported_libname "${head}" IMPORTED_LIBNAME) + if(imported_libname) + list(APPEND libraries ${imported_libname}) + endif() + endif() + elseif("${head}" MATCHES "\\$]+\)>") string(REGEX REPLACE ".*\\$]+\)>.*" "\\1" match "${head}") list(APPEND stack "${match}") From 30dd14c991dfa3f48505537eaa13ff606b468b6f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 3 Jan 2019 11:40:57 -0700 Subject: [PATCH 585/744] CMake: Fix "whitelisted property" error from CMake <3.8 --- cmake/macros/PackageConfig.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 1b54027222..975ccc4559 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -364,8 +364,9 @@ function(export_packages filename) endforeach(config) endif() - else() - # This is an INTERFACE_LIBRARY + elseif(CMAKE_VERSION VERSION_GREATER "3.8") + # This is an INTERFACE_LIBRARY, and CMake is new enough to support + # IMPORTED_IMPLIB get_target_property(imported_libname "${head}" IMPORTED_LIBNAME) if(imported_libname) list(APPEND libraries ${imported_libname}) From 0a4c0e53b7e897a86a52cec9684e838d49add50d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 5 Jan 2019 12:17:12 -0700 Subject: [PATCH 586/744] CMake: Move p3glxdisplay from the Core component to OpenGL --- panda/src/glxdisplay/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index 17f9546d79..a5153e54b1 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -29,5 +29,5 @@ add_component_library(p3glxdisplay SYMBOL BUILDING_PANDA_GLXDISPLAY target_link_libraries(p3glxdisplay p3glgsg p3x11display) if(NOT BUILD_METALIBS) - install(TARGETS p3glxdisplay EXPORT Core COMPONENT Core DESTINATION lib) + install(TARGETS p3glxdisplay EXPORT OpenGL COMPONENT OpenGL DESTINATION lib) endif() From 654abdc5eb438e83e23bac86384dbe364060c630 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 5 Jan 2019 13:53:55 -0700 Subject: [PATCH 587/744] CMake: Detect when to set OPENCV_VER_23/OPENCV_VER_3 --- cmake/modules/FindOpenCV.cmake | 39 ++++++++++++++++++++++----------- dtool/Package.cmake | 9 +++++++- dtool/dtool_config.h.in | 1 - panda/src/vision/CMakeLists.txt | 6 +++++ 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/cmake/modules/FindOpenCV.cmake b/cmake/modules/FindOpenCV.cmake index fcb6e1b49b..77d49edfbe 100644 --- a/cmake/modules/FindOpenCV.cmake +++ b/cmake/modules/FindOpenCV.cmake @@ -21,6 +21,7 @@ # stitching # superres # video +# videoio # videostab # # Once done this will define: @@ -30,33 +31,44 @@ # component # OpenCV_LIBS - the paths to the OpenCV libraries for the requested # component(s) +# OpenCV_VERSION_MAJOR- a "best guess" of the major version (X.x) +# OpenCV_VERSION_MINOR- a "best guess" of the minor version (x.X) # set(OpenCV_INCLUDE_DIRS) -if(NOT OpenCV_V1_INCLUDE_DIR) - find_path(OpenCV_V1_INCLUDE_DIR - NAMES "cv.h" - PATH_SUFFIXES "opencv") - mark_as_advanced(OpenCV_V1_INCLUDE_DIR) -endif() +find_path(OpenCV_V1_INCLUDE_DIR + NAMES "cv.h" + PATH_SUFFIXES "opencv") +mark_as_advanced(OpenCV_V1_INCLUDE_DIR) if(OpenCV_V1_INCLUDE_DIR) list(APPEND OpenCV_INCLUDE_DIRS "${OpenCV_V1_INCLUDE_DIR}") + + # This is a wild guess: + set(OpenCV_VERSION_MAJOR 1) + set(OpenCV_VERSION_MINOR 0) endif() -if(NOT OpenCV_V2_INCLUDE_DIR) - find_path(OpenCV_V2_INCLUDE_DIR "opencv2/core/core.hpp") - - mark_as_advanced(OpenCV_V2_INCLUDE_DIR) -endif() +find_path(OpenCV_V2_INCLUDE_DIR "opencv2/core/version.hpp") +mark_as_advanced(OpenCV_V2_INCLUDE_DIR) if(OpenCV_V2_INCLUDE_DIR) list(APPEND OpenCV_INCLUDE_DIRS "${OpenCV_V2_INCLUDE_DIR}") + + file(STRINGS "${OpenCV_V2_INCLUDE_DIR}/opencv2/core/version.hpp" + _version_major REGEX "#define CV_VERSION_EPOCH") + file(STRINGS "${OpenCV_V2_INCLUDE_DIR}/opencv2/core/version.hpp" + _version_minor REGEX "#define CV_VERSION_MAJOR") + + string(REGEX REPLACE "[^0-9]" "" OpenCV_VERSION_MAJOR "${_version_major}") + string(REGEX REPLACE "[^0-9]" "" OpenCV_VERSION_MINOR "${_version_minor}") + unset(_version_major) + unset(_version_minor) endif() set(OpenCV_LIBS) foreach(_component calib3d contrib core features2d flann gpu highgui imgproc legacy ml nonfree objdetect photo stitching superres video - videostab) + videoio videostab) list(FIND OpenCV_FIND_COMPONENTS "${_component}" _index) if(_index GREATER -1 OR _component STREQUAL "core") @@ -76,4 +88,5 @@ unset(_component) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(OpenCV HANDLE_COMPONENTS - REQUIRED_VARS OpenCV_INCLUDE_DIRS OpenCV_LIBS) + REQUIRED_VARS OpenCV_INCLUDE_DIRS OpenCV_LIBS + OpenCV_VERSION_MAJOR OpenCV_VERSION_MINOR) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index c30402aa6b..39a80cb080 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -474,7 +474,7 @@ package_status(EGL "EGL") # # OpenCV -find_package(OpenCV QUIET COMPONENTS core highgui) +find_package(OpenCV QUIET COMPONENTS core highgui OPTIONAL_COMPONENTS videoio) package_option(OPENCV "Enable support for OpenCV. This will be built into the 'vision' package." @@ -482,6 +482,13 @@ package_option(OPENCV package_status(OPENCV "OpenCV") +if(OpenCV_VERSION_MAJOR GREATER_EQUAL 3) + set(OPENCV_VER_3 ON) +elseif(OpenCV_VERSION_MAJOR GREATER_EQUAL 2 AND + OpenCV_VERSION_MINOR GREATER_EQUAL 3) + set(OPENCV_VER_23 ON) +endif() + # ARToolKit find_package(ARToolKit QUIET) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 5a20f9666c..59950c5480 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -108,7 +108,6 @@ /* Define if we have OpenCV installed and want to build for OpenCV. */ #cmakedefine HAVE_OPENCV -#cmakedefine OPENCV_VER_23 /* Define if we have FFMPEG installed and want to build for FFMPEG. */ #cmakedefine HAVE_FFMPEG diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt index a581ef3076..f1497fcf6e 100644 --- a/panda/src/vision/CMakeLists.txt +++ b/panda/src/vision/CMakeLists.txt @@ -33,6 +33,12 @@ target_link_libraries(p3vision panda set_target_properties(p3vision PROPERTIES CXX_EXCEPTIONS ON) target_interrogate(p3vision ALL) +if(OPENCV_VER_3) + set_target_properties(p3vision PROPERTIES COMPILE_DEFINITIONS "OPENCV_VER_3") +elseif(OPENCV_VER_23) + set_target_properties(p3vision PROPERTIES COMPILE_DEFINITIONS "OPENCV_VER_23") +endif() + install(TARGETS p3vision EXPORT Vision COMPONENT Vision DESTINATION lib From cfa1f043ddbbea5305f84208e8fd03112a0b8c8f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 6 Jan 2019 15:45:50 -0700 Subject: [PATCH 588/744] CMake: Parse project version string out of setup.cfg --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5793c47c26..229086b88a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,13 @@ cmake_minimum_required(VERSION 3.0.2) set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below -project(Panda3D VERSION 1.10.0) + +# Figure out the version +file(STRINGS "setup.cfg" _version REGEX "^version = ") +string(REGEX REPLACE "^.*= " "" _version "${_version}") +project(Panda3D VERSION ${_version}) +unset(_version) + enable_testing() # Panda3D is now a C++11 project. Newer versions of CMake support this out of From 9ee4f1f4e2e2d72739267cfeb29de60d8d6047e6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Jan 2019 07:50:13 -0700 Subject: [PATCH 589/744] CMake: Test for -f(no-)exceptions support before using it --- CMakeLists.txt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 229086b88a..e4be19ec2c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -92,12 +92,19 @@ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") # As long as we're figuring out compiler flags, figure out the flags for # turning C++ exception support on and off +include(CheckCXXCompilerFlag) if(MSVC) set(cxx_exceptions_on "/EHsc") set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0") else() - set(cxx_exceptions_on "-fexceptions") - set(cxx_exceptions_off "-fno-exceptions") + check_cxx_compiler_flag("-fno-exceptions" COMPILER_SUPPORTS_FEXCEPTIONS) + if(COMPILER_SUPPORTS_FEXCEPTIONS) + set(cxx_exceptions_on "-fexceptions") + set(cxx_exceptions_off "-fno-exceptions") + else() + set(cxx_exceptions_on) + set(cxx_exceptions_off) + endif() endif() set(cxx_exceptions_property "$>") add_compile_options( From 768a8d62e93da20b07f84ae4d8106f27351f43df Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Jan 2019 07:50:27 -0700 Subject: [PATCH 590/744] CMake: Use -fvisibility=hidden everywhere supported --- CMakeLists.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e4be19ec2c..6a24f41bbf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -111,6 +111,16 @@ add_compile_options( "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" "$<$:${cxx_exceptions_off}>") +# We should use -fvisibility=hidden everywhere, as it makes sure we think +# about what symbols really should be exposed externally. For more info, see: +# https://gcc.gnu.org/wiki/Visibility +if(NOT MSVC) + check_cxx_compiler_flag("-fvisibility=hidden" COMPILER_SUPPORTS_FVISIBILITY_HIDDEN) + if(COMPILER_SUPPORTS_FVISIBILITY_HIDDEN) + add_compile_options("-fvisibility=hidden") + endif() +endif() + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option From edb9cb31a59260f83e6f3cbb8287bf25e2ad59b4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 12 Jan 2019 14:59:33 -0700 Subject: [PATCH 591/744] CMake: Exclude .c files from Interrogate --- cmake/macros/Interrogate.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 5c84d048fc..25e53e9cfb 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -24,6 +24,7 @@ endif() set(INTERROGATE_EXCLUDE_REGEXES ".*\\.I$" ".*\\.N$" + ".*\\.c$" ".*\\.lxx$" ".*\\.yxx$" ".*_src\\..*") From 8d94790d3a288283f3843f36bb0857017229c600 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Jan 2019 13:33:58 -0700 Subject: [PATCH 592/744] CMake: Exclude .c files from compositing --- cmake/macros/CompositeSources.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index f4d2c963c6..6073b832db 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -23,7 +23,7 @@ set(COMPOSITE_SOURCE_LIMIT "30" CACHE STRING known as SCU (single compilation unit). A high value will speed up the build dramatically but will be more memory intensive than a low value.") -set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING +set(COMPOSITE_SOURCE_EXTENSIONS ".cxx;.mm" CACHE STRING "Only files of these extensions will be added to composite files.") set(COMPOSITE_SOURCE_EXCLUSIONS "" CACHE STRING @@ -61,8 +61,10 @@ function(composite_sources target sources_var) # Check if we can safely add this to a composite file. get_source_file_property(generated "${source}" GENERATED) get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) + get_filename_component(extension "${source}" EXT) - if(NOT generated AND NOT is_header) + if(NOT generated AND NOT is_header AND + ";${COMPOSITE_SOURCE_EXTENSIONS};" MATCHES ";${extension};") # Add it to composite_sources. list(APPEND composite_sources ${source}) list(LENGTH composite_sources num_composite_sources) From 986377b131136f1ea4c7f2963d42a0eac2b40d4c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Jan 2019 16:07:16 -0700 Subject: [PATCH 593/744] CMake: Make CompositeSources skip sources with SKIP_COMPOSITING property --- cmake/macros/CompositeSources.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 6073b832db..3b4c3d9654 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -61,9 +61,10 @@ function(composite_sources target sources_var) # Check if we can safely add this to a composite file. get_source_file_property(generated "${source}" GENERATED) get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) + get_source_file_property(skip_compositing "${source}" SKIP_COMPOSITING) get_filename_component(extension "${source}" EXT) - if(NOT generated AND NOT is_header AND + if(NOT generated AND NOT is_header AND NOT skip_compositing AND ";${COMPOSITE_SOURCE_EXTENSIONS};" MATCHES ";${extension};") # Add it to composite_sources. list(APPEND composite_sources ${source}) From a0e12f4211cd53c35999340b500eb85212abbb5f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 11 Jan 2019 16:09:56 -0700 Subject: [PATCH 594/744] CMake: Use the SKIP_COMPOSITING flag on some files Files excluded from compositing are (from makepanda): dtool/src/dtoolbase/indent.cxx panda/src/display/graphicsStateGuardian.cxx panda/src/dxgsg9/dxGraphicsStateGuardian9.cxx panda/src/grutil/multitexReducer.cxx panda/src/pgraph/nodePath.cxx panda/src/pnmimage/convert_srgb_sse2.cxx (due to being compiled w/ SSE2) --- dtool/src/dtoolbase/CMakeLists.txt | 2 ++ dtool/src/dtoolutil/CMakeLists.txt | 5 ++++- panda/src/display/CMakeLists.txt | 3 +++ panda/src/dxgsg9/CMakeLists.txt | 3 +++ panda/src/grutil/CMakeLists.txt | 3 +++ panda/src/pgraph/CMakeLists.txt | 3 +++ panda/src/pnmimage/CMakeLists.txt | 7 +++++-- 7 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 152850fbbb..b11869e6e9 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -83,6 +83,8 @@ set(P3DTOOLBASE_IGATEEXT typeHandle_ext.h ) +set_source_files_properties(indent.cxx PROPERTIES SKIP_COMPOSITING YES) + composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 75f9009b58..4d0d27b9ac 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -30,7 +30,10 @@ set(P3DTOOLUTIL_HEADERS if(APPLE) set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} filename_assist.mm filename_assist.h) - set_source_files_properties(filename_assist.mm filename_assist.h PROPERTIES WRAP_EXCLUDE YES) + set_source_files_properties( + filename_assist.mm filename_assist.h PROPERTIES + WRAP_EXCLUDE YES + SKIP_COMPOSITING YES) endif() set(P3DTOOLUTIL_SOURCES diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index a369b7f4e7..02d3c657dd 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -90,6 +90,9 @@ if(APPLE) ) endif() +# This is a large file; let's build it separately +set_source_files_properties(graphicsStateGuardian.cxx PROPERTIES SKIP_COMPOSITING YES) + composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY ${P3DISPLAY_HEADERS} ${P3DISPLAY_SOURCES}) diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt index a77ddc1a60..962baefed7 100644 --- a/panda/src/dxgsg9/CMakeLists.txt +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -35,6 +35,9 @@ set(P3DXGSG9_SOURCES wdxGraphicsWindow9.cxx ) +# This is a large file; let's build it separately +set_source_files_properties(dxGraphicsStateGuardian9.cxx PROPERTIES SKIP_COMPOSITING YES) + composite_sources(p3dxgsg9 P3DXGSG9_SOURCES) add_component_library(p3dxgsg9 SYMBOL BUILDING_PANDADX ${P3DXGSG9_HEADERS} ${P3DXGSG9_SOURCES}) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index f642464007..ad8ce53e0f 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -37,6 +37,9 @@ set(P3GRUTIL_SOURCES rigidBodyCombiner.cxx ) +# This is a large file; let's build it separately +set_source_files_properties(multitexReducer.cxx PROPERTIES SKIP_COMPOSITING YES) + composite_sources(p3grutil P3GRUTIL_SOURCES) add_component_library(p3grutil SYMBOL BUILDING_PANDA_GRUTIL ${P3GRUTIL_HEADERS} ${P3GRUTIL_SOURCES}) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 62dfbf93d8..0b6087cb57 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -217,6 +217,9 @@ set(P3PGRAPH_IGATEEXT transformState_ext.h ) +# This is a large file; let's build it separately +set_source_files_properties(nodePath.cxx PROPERTIES SKIP_COMPOSITING YES) + composite_sources(p3pgraph P3PGRAPH_SOURCES) add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH ${P3PGRAPH_HEADERS} ${P3PGRAPH_SOURCES}) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 1a8d88460b..5f66c24270 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -15,6 +15,7 @@ set(P3PNMIMAGE_HEADERS set(P3PNMIMAGE_SOURCES config_pnmimage.cxx convert_srgb.cxx + convert_srgb_sse2.cxx pfmFile.cxx pnm-image-filter.cxx pnmbitio.cxx @@ -32,12 +33,14 @@ set(P3PNMIMAGE_IGATEEXT ) if(HAVE_SSE2) - set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES COMPILE_FLAGS -msse2) + set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES + SKIP_COMPOSITING YES + COMPILE_FLAGS -msse2) endif() composite_sources(p3pnmimage P3PNMIMAGE_SOURCES) add_component_library(p3pnmimage SYMBOL BUILDING_PANDA_PNMIMAGE - ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES} convert_srgb_sse2.cxx) + ${P3PNMIMAGE_HEADERS} ${P3PNMIMAGE_SOURCES}) target_link_libraries(p3pnmimage p3mathutil) target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) From 615a1d205d2706540dc2bd74cf3559349fdb4a57 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 13 Jan 2019 10:45:03 -0700 Subject: [PATCH 595/744] CMake: Modify Find*.cmake to trust find_*()'s caching --- cmake/modules/FindARToolKit.cmake | 22 +--- cmake/modules/FindAssimp.cmake | 16 +-- cmake/modules/FindEGL.cmake | 14 +-- cmake/modules/FindEigen3.cmake | 10 +- cmake/modules/FindFFMPEG.cmake | 98 ++++++++-------- cmake/modules/FindFFTW3.cmake | 174 ++++++++++++++--------------- cmake/modules/FindFMODEx.cmake | 122 ++++++++++---------- cmake/modules/FindHarfBuzz.cmake | 18 +-- cmake/modules/FindLibSquish.cmake | 74 ++++++------ cmake/modules/FindMiles.cmake | 166 ++++++++++++++------------- cmake/modules/FindOpenEXR.cmake | 10 +- cmake/modules/FindOpenGLES1.cmake | 14 +-- cmake/modules/FindOpenGLES2.cmake | 14 +-- cmake/modules/FindSWResample.cmake | 50 ++++----- cmake/modules/FindSWScale.cmake | 50 ++++----- cmake/modules/FindTar.cmake | 44 ++++---- cmake/modules/FindVRPN.cmake | 16 +-- 17 files changed, 423 insertions(+), 489 deletions(-) diff --git a/cmake/modules/FindARToolKit.cmake b/cmake/modules/FindARToolKit.cmake index e596e608e9..fa383768e6 100644 --- a/cmake/modules/FindARToolKit.cmake +++ b/cmake/modules/FindARToolKit.cmake @@ -10,25 +10,15 @@ # ARTOOLKIT_LIBRARIES - the paths to the ARToolKit client libraries # -if(NOT ARTOOLKIT_INCLUDE_DIR) - find_path(ARTOOLKIT_INCLUDE_DIR "AR/ar.h") +find_path(ARTOOLKIT_INCLUDE_DIR "AR/ar.h") - mark_as_advanced(ARTOOLKIT_INCLUDE_DIR) -endif() +find_library(ARTOOLKIT_AR_LIBRARY + NAMES "AR" "libAR") -if(NOT ARTOOLKIT_AR_LIBRARY) - find_library(ARTOOLKIT_AR_LIBRARY - NAMES "AR" "libAR") +find_library(ARTOOLKIT_ARMulti_LIBRARY + NAMES "ARMulti" "libARMulti") - mark_as_advanced(ARTOOLKIT_AR_LIBRARY) -endif() - -if(NOT ARTOOLKIT_ARMulti_LIBRARY) - find_library(ARTOOLKIT_ARMulti_LIBRARY - NAMES "ARMulti" "libARMulti") - - mark_as_advanced(ARTOOLKIT_ARMulti_LIBRARY) -endif() +mark_as_advanced(ARTOOLKIT_INCLUDE_DIR ARTOOLKIT_AR_LIBRARY ARTOOLKIT_ARMulti_LIBRARY) set(ARTOOLKIT_LIBRARIES) if(ARTOOLKIT_AR_LIBRARY) diff --git a/cmake/modules/FindAssimp.cmake b/cmake/modules/FindAssimp.cmake index 0f1696d971..9535a3f489 100644 --- a/cmake/modules/FindAssimp.cmake +++ b/cmake/modules/FindAssimp.cmake @@ -10,19 +10,13 @@ # ASSIMP_LIBRARY - the library to link against for Assimp # -if(NOT ASSIMP_INCLUDE_DIR) - find_path(ASSIMP_INCLUDE_DIR - NAMES "assimp/Importer.hpp") +find_path(ASSIMP_INCLUDE_DIR + NAMES "assimp/Importer.hpp") - mark_as_advanced(ASSIMP_INCLUDE_DIR) -endif() +find_library(ASSIMP_LIBRARY + NAMES "assimp") -if(NOT ASSIMP_LIBRARY) - find_library(ASSIMP_LIBRARY - NAMES "assimp") - - mark_as_advanced(ASSIMP_LIBRARY) -endif() +mark_as_advanced(ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY) diff --git a/cmake/modules/FindEGL.cmake b/cmake/modules/FindEGL.cmake index eced64105b..111083db85 100644 --- a/cmake/modules/FindEGL.cmake +++ b/cmake/modules/FindEGL.cmake @@ -10,18 +10,12 @@ # EGL_LIBRARY - the library to link against for EGL # -if(NOT EGL_INCLUDE_DIR) - find_path(EGL_INCLUDE_DIR "EGL/egl.h") +find_path(EGL_INCLUDE_DIR "EGL/egl.h") - mark_as_advanced(EGL_INCLUDE_DIR) -endif() +find_library(EGL_LIBRARY + NAMES "EGL") -if(NOT EGL_LIBRARY) - find_library(EGL_LIBRARY - NAMES "EGL") - - mark_as_advanced(EGL_LIBRARY) -endif() +mark_as_advanced(EGL_INCLUDE_DIR EGL_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(EGL DEFAULT_MSG EGL_INCLUDE_DIR EGL_LIBRARY) diff --git a/cmake/modules/FindEigen3.cmake b/cmake/modules/FindEigen3.cmake index 7b18a8172d..6b56819383 100644 --- a/cmake/modules/FindEigen3.cmake +++ b/cmake/modules/FindEigen3.cmake @@ -10,13 +10,11 @@ # EIGEN3_INCLUDE_DIR - the Eigen3 include directory # -if(NOT EIGEN3_INCLUDE_DIR) - find_path(EIGEN3_INCLUDE_DIR - NAMES signature_of_eigen3_matrix_library - PATH_SUFFIXES eigen3 eigen) +find_path(EIGEN3_INCLUDE_DIR + NAMES signature_of_eigen3_matrix_library + PATH_SUFFIXES eigen3 eigen) - mark_as_advanced(EIGEN3_INCLUDE_DIR) -endif() +mark_as_advanced(EIGEN3_INCLUDE_DIR) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Eigen3 DEFAULT_MSG EIGEN3_INCLUDE_DIR) diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index ee4c8bdc1c..649f2b80e2 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -14,60 +14,58 @@ # FFMPEG_LIBAVUTIL - the path to the libavutil library binary # -if(NOT FFMPEG_INCLUDE_DIR OR NOT FFMPEG_LIBRARY_DIR) - # Find the libffmpeg include files - find_path(FFMPEG_INCLUDE_DIR - NAMES "libavcodec/avcodec.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - PATH_SUFFIXES "libav" "ffmpeg" - ) +# Find the libffmpeg include files +find_path(FFMPEG_INCLUDE_DIR + NAMES "libavcodec/avcodec.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "libav" "ffmpeg" +) - # Find the libavcodec library - find_library(FFMPEG_LIBAVCODEC - NAMES "avcodec" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libavcodec library +find_library(FFMPEG_LIBAVCODEC + NAMES "avcodec" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - # Find the libavformat library - find_library(FFMPEG_LIBAVFORMAT - NAMES "avformat" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libavformat library +find_library(FFMPEG_LIBAVFORMAT + NAMES "avformat" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - # Find the libavutil library - find_library(FFMPEG_LIBAVUTIL - NAMES "avutil" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libavutil library +find_library(FFMPEG_LIBAVUTIL + NAMES "avutil" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - mark_as_advanced(FFMPEG_INCLUDE_DIR) - mark_as_advanced(FFMPEG_LIBAVCODEC) - mark_as_advanced(FFMPEG_LIBAVFORMAT) - mark_as_advanced(FFMPEG_LIBAVUTIL) -endif() +mark_as_advanced(FFMPEG_INCLUDE_DIR) +mark_as_advanced(FFMPEG_LIBAVCODEC) +mark_as_advanced(FFMPEG_LIBAVFORMAT) +mark_as_advanced(FFMPEG_LIBAVUTIL) # Translate library into library directory if(FFMPEG_LIBAVCODEC) diff --git a/cmake/modules/FindFFTW3.cmake b/cmake/modules/FindFFTW3.cmake index fbd572fbfc..23f76cc5e5 100644 --- a/cmake/modules/FindFFTW3.cmake +++ b/cmake/modules/FindFFTW3.cmake @@ -14,96 +14,94 @@ # FFTW3_ROOT - if set, the libraries are exclusively searched under this path # -if(NOT FFTW3_INCLUDE_DIR OR NOT FFTW3_LIBRARY_DIR) - # Check if we can use PkgConfig - find_package(PkgConfig QUIET) +# Check if we can use PkgConfig +find_package(PkgConfig QUIET) - #Determine from PKG - if(PKG_CONFIG_FOUND AND NOT FFTW3_ROOT) - pkg_check_modules(PKG_FFTW QUIET "fftw3") - endif() - - if(FFTW3_ROOT) - # Try to find headers under root - find_path(FFTW3_INCLUDE_DIR - NAMES "fftw3.h" - PATHS ${FFTW3_ROOT} - PATH_SUFFIXES "include" - NO_DEFAULT_PATH - ) - - # Try to find library under root - find_library(FFTW3_LIBRARY - NAMES "fftw3" - PATHS ${FFTW3_ROOT} - PATH_SUFFIXES "lib" "lib64" - NO_DEFAULT_PATH - ) - - find_library(FFTW3_FFTWF_LIBRARY - NAMES "fftw3f" - PATHS ${FFTW3_ROOT} - PATH_SUFFIXES "lib" "lib64" - NO_DEFAULT_PATH - ) - - find_library(FFTW3_FFTWL_LIBRARY - NAMES "fftw3l" - PATHS ${FFTW3_ROOT} - PATH_SUFFIXES "lib" "lib64" - NO_DEFAULT_PATH - ) - else() - # Find headers the normal way - find_path(FFTW3_INCLUDE_DIR - NAMES "fftw3.h" - PATHS ${PKG_FFTW3_INCLUDE_DIRS} - ${INCLUDE_INSTALL_DIR} - "/usr/include" - "/usr/local/include" - PATH_SUFFIXES "" "fftw" - ) - - # Find library the normal way - find_library(FFTW3_LIBRARY - NAMES "fftw3" - PATHS ${PKG_FFTW3_LIBRARY_DIRS} - ${LIB_INSTALL_DIR} - "/usr" - "/usr/local" - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - - find_library(FFTW3_FFTWF_LIBRARY - NAMES "fftw3f" - PATHS ${PKG_FFTW3_LIBRARY_DIRS} - ${LIB_INSTALL_DIR} - "/usr" - "/usr/local" - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - - - find_library(FFTW3_FFTWL_LIBRARY - NAMES "fftw3l" - PATHS ${PKG_FFTW3_LIBRARY_DIRS} - ${LIB_INSTALL_DIR} - "/usr" - "/usr/local" - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - endif() - - # Get the directory conaining FFTW3_LIBRARY - get_filename_component(FFTW3_LIBRARY_DIR "${FFTW3_LIBRARY}" PATH) - set(FFTW3_LIBRARY_DIR "${FFTW3_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path - - mark_as_advanced(FFTW3_INCLUDE_DIR) - mark_as_advanced(FFTW3_LIBRARY_DIR) - mark_as_advanced(FFTW3_LIBRARY) - mark_as_advanced(FFTW3_FFTWF_LIBRARY) - mark_as_advanced(FFTW3_FFTWL_LIBRARY) +#Determine from PKG +if(PKG_CONFIG_FOUND AND NOT FFTW3_ROOT) + pkg_check_modules(PKG_FFTW QUIET "fftw3") endif() +if(FFTW3_ROOT) + # Try to find headers under root + find_path(FFTW3_INCLUDE_DIR + NAMES "fftw3.h" + PATHS ${FFTW3_ROOT} + PATH_SUFFIXES "include" + NO_DEFAULT_PATH + ) + + # Try to find library under root + find_library(FFTW3_LIBRARY + NAMES "fftw3" + PATHS ${FFTW3_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + + find_library(FFTW3_FFTWF_LIBRARY + NAMES "fftw3f" + PATHS ${FFTW3_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) + + find_library(FFTW3_FFTWL_LIBRARY + NAMES "fftw3l" + PATHS ${FFTW3_ROOT} + PATH_SUFFIXES "lib" "lib64" + NO_DEFAULT_PATH + ) +else() + # Find headers the normal way + find_path(FFTW3_INCLUDE_DIR + NAMES "fftw3.h" + PATHS ${PKG_FFTW3_INCLUDE_DIRS} + ${INCLUDE_INSTALL_DIR} + "/usr/include" + "/usr/local/include" + PATH_SUFFIXES "" "fftw" + ) + + # Find library the normal way + find_library(FFTW3_LIBRARY + NAMES "fftw3" + PATHS ${PKG_FFTW3_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + + find_library(FFTW3_FFTWF_LIBRARY + NAMES "fftw3f" + PATHS ${PKG_FFTW3_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + + + find_library(FFTW3_FFTWL_LIBRARY + NAMES "fftw3l" + PATHS ${PKG_FFTW3_LIBRARY_DIRS} + ${LIB_INSTALL_DIR} + "/usr" + "/usr/local" + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) +endif() + +# Get the directory conaining FFTW3_LIBRARY +get_filename_component(FFTW3_LIBRARY_DIR "${FFTW3_LIBRARY}" PATH) +set(FFTW3_LIBRARY_DIR "${FFTW3_LIBRARY_DIR}" CACHE PATH "The path to fftw's library directory.") # Library path + +mark_as_advanced(FFTW3_INCLUDE_DIR) +mark_as_advanced(FFTW3_LIBRARY_DIR) +mark_as_advanced(FFTW3_LIBRARY) +mark_as_advanced(FFTW3_FFTWF_LIBRARY) +mark_as_advanced(FFTW3_FFTWL_LIBRARY) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FFTW3 DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE_DIR FFTW3_LIBRARY_DIR) diff --git a/cmake/modules/FindFMODEx.cmake b/cmake/modules/FindFMODEx.cmake index 5725c365c0..13ccbf39d1 100644 --- a/cmake/modules/FindFMODEx.cmake +++ b/cmake/modules/FindFMODEx.cmake @@ -14,72 +14,70 @@ # FMOXEX_64_LIBRARY - the filepath of the Miles SDK 64-bit library # -if(NOT FMODEX_LIBRARY_DIR OR NOT FMODEX_INCLUDE_DIR) - # Find the include directory - find_path(FMODEX_INCLUDE_DIR - NAMES "fmod.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - "/opt/fmodex/include" - "/opt/fmodex/api/inc" - "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/inc" - PATH_SUFFIXES "" "fmodex/fmod" "fmodex/fmod3" "fmod" "fmod3" - DOC "The path to FMOD Ex's include directory." - ) +# Find the include directory +find_path(FMODEX_INCLUDE_DIR + NAMES "fmod.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + "/opt/fmodex/include" + "/opt/fmodex/api/inc" + "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/inc" + PATH_SUFFIXES "" "fmodex/fmod" "fmodex/fmod3" "fmod" "fmod3" + DOC "The path to FMOD Ex's include directory." +) - # Find the 32-bit library - find_library(FMODEX_32_LIBRARY - NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" - PATHS "/usr" - "/usr/local" - "/usr/X11R6" - "/usr/local/X11R6" - "/sw" - "/opt" - "/opt/local" - "/opt/csw" - "/opt/fmodex" - "/opt/fmodex/api" - "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/lib" - PATH_SUFFIXES "" "lib" "lib32" - ) +# Find the 32-bit library +find_library(FMODEX_32_LIBRARY + NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" + PATHS "/usr" + "/usr/local" + "/usr/X11R6" + "/usr/local/X11R6" + "/sw" + "/opt" + "/opt/local" + "/opt/csw" + "/opt/fmodex" + "/opt/fmodex/api" + "C:/Program Files (x86)/FMOD SoundSystem/FMOD Programmers API Win32/api/lib" + PATH_SUFFIXES "" "lib" "lib32" +) - # Find the 64-bit library - find_library(FMODEX_64_LIBRARY - NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" - PATHS "/usr" - "/usr/local" - "/usr/X11R6" - "/usr/local/X11R6" - "/sw" - "/opt" - "/opt/local" - "/opt/csw" - "/opt/fmodex" - "/opt/fmodex/api" - "/usr/freeware" - PATH_SUFFIXES "" "lib" "lib64" - ) +# Find the 64-bit library +find_library(FMODEX_64_LIBRARY + NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" + PATHS "/usr" + "/usr/local" + "/usr/X11R6" + "/usr/local/X11R6" + "/sw" + "/opt" + "/opt/local" + "/opt/csw" + "/opt/fmodex" + "/opt/fmodex/api" + "/usr/freeware" + PATH_SUFFIXES "" "lib" "lib64" +) - if(FMODEX_32_LIBRARY) - set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.") - elseif(FMODEX_64_LIBRARY) - set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.") - endif() - - get_filename_component(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY}" PATH) - set(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY_DIR}" CACHE PATH "The path to FMOD Ex's library directory.") - - mark_as_advanced(FMODEX_INCLUDE_DIR) - mark_as_advanced(FMODEX_LIBRARY_DIR) - mark_as_advanced(FMODEX_LIBRARY) - mark_as_advanced(FMODEX_32_LIBRARY) - mark_as_advanced(FMODEX_64_LIBRARY) +if(FMODEX_32_LIBRARY) + set(FMODEX_LIBRARY ${FMODEX_32_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.") +elseif(FMODEX_64_LIBRARY) + set(FMODEX_LIBRARY ${FMODEX_64_LIBRARY} CACHE FILEPATH "The filepath to FMOD Ex's library binary.") endif() +get_filename_component(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY}" PATH) +set(FMODEX_LIBRARY_DIR "${FMODEX_LIBRARY_DIR}" CACHE PATH "The path to FMOD Ex's library directory.") + +mark_as_advanced(FMODEX_INCLUDE_DIR) +mark_as_advanced(FMODEX_LIBRARY_DIR) +mark_as_advanced(FMODEX_LIBRARY) +mark_as_advanced(FMODEX_32_LIBRARY) +mark_as_advanced(FMODEX_64_LIBRARY) + include(FindPackageHandleStandardArgs) find_package_handle_standard_args(FMODEx DEFAULT_MSG FMODEX_LIBRARY FMODEX_INCLUDE_DIR FMODEX_LIBRARY_DIR) diff --git a/cmake/modules/FindHarfBuzz.cmake b/cmake/modules/FindHarfBuzz.cmake index ae1d56acda..fd27ea603a 100644 --- a/cmake/modules/FindHarfBuzz.cmake +++ b/cmake/modules/FindHarfBuzz.cmake @@ -10,20 +10,14 @@ # HARFBUZZ_LIBRARY - the path to the HarfBuzz library # -if(NOT HARFBUZZ_INCLUDE_DIR) - find_path(HARFBUZZ_INCLUDE_DIR - NAMES "hb.h" - PATH_SUFFIXES "harfbuzz") +find_path(HARFBUZZ_INCLUDE_DIR + NAMES "hb.h" + PATH_SUFFIXES "harfbuzz") - mark_as_advanced(HARFBUZZ_INCLUDE_DIR) -endif() +find_library(HARFBUZZ_LIBRARY + NAMES "harfbuzz") -if(NOT HARFBUZZ_LIBRARY) - find_library(HARFBUZZ_LIBRARY - NAMES "harfbuzz") - - mark_as_advanced(HARFBUZZ_LIBRARY) -endif() +mark_as_advanced(HARFBUZZ_INCLUDE_DIR HARFBUZZ_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(HarfBuzz DEFAULT_MSG HARFBUZZ_INCLUDE_DIR HARFBUZZ_LIBRARY) diff --git a/cmake/modules/FindLibSquish.cmake b/cmake/modules/FindLibSquish.cmake index 9a21d65852..3399d81ae7 100644 --- a/cmake/modules/FindLibSquish.cmake +++ b/cmake/modules/FindLibSquish.cmake @@ -14,48 +14,46 @@ # LIBSQUISH_DEBUG_LIBRARY - the filepath of the libsquish debug library # -if(NOT LIBSQUISH_INCLUDE_DIR OR NOT LIBSQUISH_LIBRARY_DIR) - # Find the libsquish include files - find_path(LIBSQUISH_INCLUDE_DIR - NAMES "squish.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - PATH_SUFFIXES "" "cppunit" - ) +# Find the libsquish include files +find_path(LIBSQUISH_INCLUDE_DIR + NAMES "squish.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "" "cppunit" +) - # Find the libsquish library built for release - find_library(LIBSQUISH_RELEASE_LIBRARY - NAMES "squish" "libsquish" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libsquish library built for release +find_library(LIBSQUISH_RELEASE_LIBRARY + NAMES "squish" "libsquish" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - # Find the libsquish library built for debug - find_library(LIBSQUISH_DEBUG_LIBRARY - NAMES "squishd" "libsquishd" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libsquish library built for debug +find_library(LIBSQUISH_DEBUG_LIBRARY + NAMES "squishd" "libsquishd" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - mark_as_advanced(LIBSQUISH_INCLUDE_DIR) - mark_as_advanced(LIBSQUISH_RELEASE_LIBRARY) - mark_as_advanced(LIBSQUISH_DEBUG_LIBRARY) -endif() +mark_as_advanced(LIBSQUISH_INCLUDE_DIR) +mark_as_advanced(LIBSQUISH_RELEASE_LIBRARY) +mark_as_advanced(LIBSQUISH_DEBUG_LIBRARY) # Choose library if(CMAKE_BUILD_TYPE MATCHES "Debug" AND LIBSQUISH_DEBUG_LIBRARY) diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake index def0949e78..187dd94a48 100644 --- a/cmake/modules/FindMiles.cmake +++ b/cmake/modules/FindMiles.cmake @@ -17,94 +17,92 @@ # MILES_DEBUG_LIBRARY - the filepath of the Miles SDK debug library # -if(NOT MILES_INCLUDE_DIR OR NOT MILES_LIBRARY_DIR) - # Find the Miles SDK include files - find_path(MILES_INCLUDE_DIR - NAMES "miles.h" - PATHS "/usr/include" - "/usr/local/include" - "/opt/" - "C:/Program Files" - "C:/Program Files (x86)" - PATH_SUFFIXES "" "miles" "Miles6" "miles/include" "Miles6/include" - DOC "The path to the Miles SDK include directory." - ) +# Find the Miles SDK include files +find_path(MILES_INCLUDE_DIR + NAMES "miles.h" + PATHS "/usr/include" + "/usr/local/include" + "/opt/" + "C:/Program Files" + "C:/Program Files (x86)" + PATH_SUFFIXES "" "miles" "Miles6" "miles/include" "Miles6/include" + DOC "The path to the Miles SDK include directory." +) - # Find the Miles SDK libraries (.a, .so) - find_library(MILES_RELEASE_LIBRARY - NAMES "miles" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "/opt/Miles6" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) - find_library(MILES_MINSIZE_LIBRARY - NAMES "miles_s" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) - find_library(MILES_RELWITHDEBINFO_LIBRARY - NAMES "miles_rd" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) - find_library(MILES_DEBUG_LIBRARY - NAMES "miles_d" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" - ) +# Find the Miles SDK libraries (.a, .so) +find_library(MILES_RELEASE_LIBRARY + NAMES "miles" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "/opt/Miles6" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" +) +find_library(MILES_MINSIZE_LIBRARY + NAMES "miles_s" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" +) +find_library(MILES_RELWITHDEBINFO_LIBRARY + NAMES "miles_rd" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" +) +find_library(MILES_DEBUG_LIBRARY + NAMES "miles_d" + PATHS "/usr" + "/usr/local" + "/opt/miles" + "C:/Program Files/miles" + "C:/Program Files (x86)/miles" + "C:/Program Files/Miles6" + "C:/Program Files (x86)/Miles6" + PATH_SUFFIXES "lib" "lib32" +) - # Choose library - if(CMAKE_BUILD_TYPE MATCHES "Release" AND MILES_RELEASE_LIBRARY) - set(MILES_LIBRARY ${MILES_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") - elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY) - set(MILES_LIBRARY ${MILES_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") - elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND MILES_MINSIZE_LIBRARY) - set(MILES_LIBRARY ${MILES_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") - elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND MILES_DEBUG_LIBRARY) - set(MILES_LIBRARY ${MILES_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") - endif() - - # Set library path - 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.") - - # Check if we have everything we need - if(MILES_INCLUDE_DIR AND MILES_LIBRARY_DIR) - set(FOUND_MILES TRUE) - set(MILES_LIBS Mss32) - endif() - - mark_as_advanced(MILES_INCLUDE_DIR) - mark_as_advanced(MILES_DEBUG_LIBRARY) - mark_as_advanced(MILES_RELEASE_LIBRARY) - mark_as_advanced(MILES_RELWITHDEBINFO_LIBRARY) - mark_as_advanced(MILES_MINSIZE_LIBRARY) +# Choose library +if(CMAKE_BUILD_TYPE MATCHES "Release" AND MILES_RELEASE_LIBRARY) + set(MILES_LIBRARY ${MILES_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") +elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY) + set(MILES_LIBRARY ${MILES_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") +elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND MILES_MINSIZE_LIBRARY) + set(MILES_LIBRARY ${MILES_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") +elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND MILES_DEBUG_LIBRARY) + set(MILES_LIBRARY ${MILES_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") endif() +# Set library path +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.") + +# Check if we have everything we need +if(MILES_INCLUDE_DIR AND MILES_LIBRARY_DIR) + set(FOUND_MILES TRUE) + set(MILES_LIBS Mss32) +endif() + +mark_as_advanced(MILES_INCLUDE_DIR) +mark_as_advanced(MILES_DEBUG_LIBRARY) +mark_as_advanced(MILES_RELEASE_LIBRARY) +mark_as_advanced(MILES_RELWITHDEBINFO_LIBRARY) +mark_as_advanced(MILES_MINSIZE_LIBRARY) + # Choose library if(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY) unset(MILES_LIBRARY CACHE) diff --git a/cmake/modules/FindOpenEXR.cmake b/cmake/modules/FindOpenEXR.cmake index 693113217e..365ceec733 100644 --- a/cmake/modules/FindOpenEXR.cmake +++ b/cmake/modules/FindOpenEXR.cmake @@ -10,13 +10,11 @@ # OPENEXR_LIBRARIES - the path to the OpenEXR libraries # -if(NOT OPENEXR_INCLUDE_DIR) - find_path(OPENEXR_INCLUDE_DIR - "ImfVersion.h" - PATH_SUFFIXES "OpenEXR") +find_path(OPENEXR_INCLUDE_DIR + "ImfVersion.h" + PATH_SUFFIXES "OpenEXR") - mark_as_advanced(OPENEXR_INCLUDE_DIR) -endif() +mark_as_advanced(OPENEXR_INCLUDE_DIR) find_library(OPENEXR_imf_LIBRARY NAMES "IlmImf") diff --git a/cmake/modules/FindOpenGLES1.cmake b/cmake/modules/FindOpenGLES1.cmake index c36714e324..ab4305088d 100644 --- a/cmake/modules/FindOpenGLES1.cmake +++ b/cmake/modules/FindOpenGLES1.cmake @@ -10,18 +10,12 @@ # OPENGLES1_LIBRARY - the library to link against for OpenGL ES 1.x # -if(NOT OPENGLES1_INCLUDE_DIR AND NOT APPLE) - find_path(OPENGLES1_INCLUDE_DIR "GLES/gl.h") +find_path(OPENGLES1_INCLUDE_DIR "GLES/gl.h") - mark_as_advanced(OPENGLES1_INCLUDE_DIR) -endif() +find_library(OPENGLES1_LIBRARY + NAMES "GLESv1" "GLESv1_CM" "GLES_CM") -if(NOT OPENGLES1_LIBRARY AND NOT APPLE) - find_library(OPENGLES1_LIBRARY - NAMES "GLESv1" "GLESv1_CM" "GLES_CM") - - mark_as_advanced(OPENGLES1_LIBRARY) -endif() +mark_as_advanced(OPENGLES1_INCLUDE_DIR OPENGLES1_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(OpenGLES1 DEFAULT_MSG OPENGLES1_INCLUDE_DIR OPENGLES1_LIBRARY) diff --git a/cmake/modules/FindOpenGLES2.cmake b/cmake/modules/FindOpenGLES2.cmake index f2ceb76ecd..f1e4752ad2 100644 --- a/cmake/modules/FindOpenGLES2.cmake +++ b/cmake/modules/FindOpenGLES2.cmake @@ -10,18 +10,12 @@ # OPENGLES2_LIBRARY - the library to link against for OpenGL ES 2.x # -if(NOT OPENGLES2_INCLUDE_DIR AND NOT APPLE) - find_path(OPENGLES2_INCLUDE_DIR "GLES2/gl2.h") +find_path(OPENGLES2_INCLUDE_DIR "GLES2/gl2.h") - mark_as_advanced(OPENGLES2_INCLUDE_DIR) -endif() +find_library(OPENGLES2_LIBRARY + NAMES "GLESv2") -if(NOT OPENGLES2_LIBRARY AND NOT APPLE) - find_library(OPENGLES2_LIBRARY - NAMES "GLESv2") - - mark_as_advanced(OPENGLES2_LIBRARY) -endif() +mark_as_advanced(OPENGLES2_INCLUDE_DIR OPENGLES2_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(OpenGLES2 DEFAULT_MSG OPENGLES2_INCLUDE_DIR OPENGLES2_LIBRARY) diff --git a/cmake/modules/FindSWResample.cmake b/cmake/modules/FindSWResample.cmake index 827758835e..eb3ec28f03 100644 --- a/cmake/modules/FindSWResample.cmake +++ b/cmake/modules/FindSWResample.cmake @@ -10,34 +10,32 @@ # SWRESAMPLE_LIBRARY - the path to the library binary # -if(NOT SWRESAMPLE_INCLUDE_DIR OR NOT SWRESAMPLE_LIBRARY) - # Find the libswresample include files - find_path(SWRESAMPLE_INCLUDE_DIR - NAMES "libswresample/swresample.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - PATH_SUFFIXES "libav" "ffmpeg" - ) +# Find the libswresample include files +find_path(SWRESAMPLE_INCLUDE_DIR + NAMES "libswresample/swresample.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "libav" "ffmpeg" +) - # Find the libswresample library - find_library(SWRESAMPLE_LIBRARY - NAMES "swresample" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libswresample library +find_library(SWRESAMPLE_LIBRARY + NAMES "swresample" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - mark_as_advanced(SWRESAMPLE_INCLUDE_DIR) - mark_as_advanced(SWRESAMPLE_LIBRARY) -endif() +mark_as_advanced(SWRESAMPLE_INCLUDE_DIR) +mark_as_advanced(SWRESAMPLE_LIBRARY) # Translate library into library directory if(SWRESAMPLE_LIBRARY) diff --git a/cmake/modules/FindSWScale.cmake b/cmake/modules/FindSWScale.cmake index 2fca4c441d..f6e8b3cc36 100644 --- a/cmake/modules/FindSWScale.cmake +++ b/cmake/modules/FindSWScale.cmake @@ -10,34 +10,32 @@ # SWSCALE_LIBRARY - the path to the library binary # -if(NOT SWSCALE_INCLUDE_DIR OR NOT SWSCALE_LIBRARY) - # Find the libswscale include files - find_path(SWSCALE_INCLUDE_DIR - NAMES "libswscale/swscale.h" - PATHS "/usr/include" - "/usr/local/include" - "/sw/include" - "/opt/include" - "/opt/local/include" - "/opt/csw/include" - PATH_SUFFIXES "libav" "ffmpeg" - ) +# Find the libswscale include files +find_path(SWSCALE_INCLUDE_DIR + NAMES "libswscale/swscale.h" + PATHS "/usr/include" + "/usr/local/include" + "/sw/include" + "/opt/include" + "/opt/local/include" + "/opt/csw/include" + PATH_SUFFIXES "libav" "ffmpeg" +) - # Find the libswscale library - find_library(SWSCALE_LIBRARY - NAMES "swscale" - PATHS "/usr" - "/usr/local" - "/usr/freeware" - "/sw" - "/opt" - "/opt/csw" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) +# Find the libswscale library +find_library(SWSCALE_LIBRARY + NAMES "swscale" + PATHS "/usr" + "/usr/local" + "/usr/freeware" + "/sw" + "/opt" + "/opt/csw" + PATH_SUFFIXES "lib" "lib32" "lib64" +) - mark_as_advanced(SWSCALE_INCLUDE_DIR) - mark_as_advanced(SWSCALE_LIBRARY) -endif() +mark_as_advanced(SWSCALE_INCLUDE_DIR) +mark_as_advanced(SWSCALE_LIBRARY) # Translate library into library directory if(SWSCALE_LIBRARY) diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake index a14a99bb6b..8db18b690c 100644 --- a/cmake/modules/FindTar.cmake +++ b/cmake/modules/FindTar.cmake @@ -11,31 +11,29 @@ # TAR_LIBRARY - the path to the library binary # -if(NOT TAR_INCLUDE_DIR OR NOT TAR_LIBRARY_DIR) - # Find the libtar include files - find_path(TAR_INCLUDE_DIR - NAMES "libtar.h" - PATHS "/usr/include" - "/usr/local/include" - PATH_SUFFIXES "" "tar" "libtar" - DOC "The path to libtar's include directory." - ) +# Find the libtar include files +find_path(TAR_INCLUDE_DIR + NAMES "libtar.h" + PATHS "/usr/include" + "/usr/local/include" + PATH_SUFFIXES "" "tar" "libtar" + DOC "The path to libtar's include directory." +) - # Find the libtar library (.a, .so) - find_library(TAR_LIBRARY - NAMES "tar" - "libtar" - PATHS "/usr" - "/usr/local" - PATH_SUFFIXES "lib" "lib32" "lib64" - ) - get_filename_component(TAR_LIBRARY_DIR "${TAR_LIBRARY}" PATH) - set(TAR_LIBRARY_DIR "${TAR_LIBRARY_DIR}" CACHE PATH "The path to libtar's library directory.") # Library path +# Find the libtar library (.a, .so) +find_library(TAR_LIBRARY + NAMES "tar" + "libtar" + PATHS "/usr" + "/usr/local" + PATH_SUFFIXES "lib" "lib32" "lib64" +) +get_filename_component(TAR_LIBRARY_DIR "${TAR_LIBRARY}" PATH) +set(TAR_LIBRARY_DIR "${TAR_LIBRARY_DIR}" CACHE PATH "The path to libtar's library directory.") # Library path - mark_as_advanced(TAR_INCLUDE_DIR) - mark_as_advanced(TAR_LIBRARY_DIR) - mark_as_advanced(TAR_LIBRARY) -endif() +mark_as_advanced(TAR_INCLUDE_DIR) +mark_as_advanced(TAR_LIBRARY_DIR) +mark_as_advanced(TAR_LIBRARY) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Tar DEFAULT_MSG TAR_LIBRARY TAR_INCLUDE_DIR TAR_LIBRARY_DIR) diff --git a/cmake/modules/FindVRPN.cmake b/cmake/modules/FindVRPN.cmake index 903eccac37..6a7599e205 100644 --- a/cmake/modules/FindVRPN.cmake +++ b/cmake/modules/FindVRPN.cmake @@ -10,20 +10,14 @@ # VRPN_LIBRARIES - the path to the VRPN client libraries # -if(NOT VRPN_INCLUDE_DIR) - find_path(VRPN_INCLUDE_DIR "vrpn_Connection.h") +find_path(VRPN_INCLUDE_DIR "vrpn_Connection.h") - mark_as_advanced(VRPN_INCLUDE_DIR) -endif() +find_library(VRPN_vrpn_LIBRARY + NAMES "vrpn") -if(NOT VRPN_vrpn_LIBRARY) - find_library(VRPN_vrpn_LIBRARY - NAMES "vrpn") +mark_as_advanced(VRPN_INCLUDE_DIR VRPN_vrpn_LIBRARY) - mark_as_advanced(VRPN_vrpn_LIBRARY) -endif() - -if(VRPN_vrpn_LIBRARY AND NOT VRPN_quat_LIBRARY) +if(VRPN_vrpn_LIBRARY) get_filename_component(_vrpn_dir "${VRPN_vrpn_LIBRARY}" DIRECTORY) find_library(VRPN_quat_LIBRARY NAMES "quat" From 8a2375a5f1c869b88a9093e65ac40de615df0dcf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 13 Jan 2019 11:31:43 -0700 Subject: [PATCH 596/744] CMake: Detect Ogg+Vorbis --- cmake/modules/FindOgg.cmake | 20 ++++++++++++++++++ cmake/modules/FindVorbisFile.cmake | 34 ++++++++++++++++++++++++++++++ dtool/Package.cmake | 7 ++++++ panda/src/movies/CMakeLists.txt | 3 ++- 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/FindOgg.cmake create mode 100644 cmake/modules/FindVorbisFile.cmake diff --git a/cmake/modules/FindOgg.cmake b/cmake/modules/FindOgg.cmake new file mode 100644 index 0000000000..88bcfe81cd --- /dev/null +++ b/cmake/modules/FindOgg.cmake @@ -0,0 +1,20 @@ +# Filename: FindOgg.cmake +# Authors: CFSworks (13 Jan, 2019) +# +# Usage: +# find_package(Ogg [REQUIRED] [QUIET]) +# +# Once done this will define: +# OGG_FOUND - system has Ogg +# OGG_INCLUDE_DIR - the include directory containing ogg/ +# OGG_LIBRARY - the path to the ogg library +# + +find_path(OGG_INCLUDE_DIR NAMES "ogg/ogg.h") + +find_library(OGG_LIBRARY NAMES "ogg") + +mark_as_advanced(OGG_INCLUDE_DIR OGG_LIBRARY) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Ogg DEFAULT_MSG OGG_INCLUDE_DIR OGG_LIBRARY) diff --git a/cmake/modules/FindVorbisFile.cmake b/cmake/modules/FindVorbisFile.cmake new file mode 100644 index 0000000000..654219c3f7 --- /dev/null +++ b/cmake/modules/FindVorbisFile.cmake @@ -0,0 +1,34 @@ +# Filename: FindVorbisFile.cmake +# Authors: CFSworks (13 Jan, 2019) +# +# Usage: +# find_package(VorbisFile [REQUIRED] [QUIET]) +# +# Once done this will define: +# VORBISFILE_FOUND - system has Ogg and vorbisfile +# VORBISFILE_INCLUDE_DIRS - the include directory/ies containing vorbis/ and ogg/ +# VORBISFILE_LIBRARIES - the paths to the vorbis and vorbisfile libraries +# + +# Find Ogg +find_package(Ogg QUIET) + +# Find Vorbis +find_path(VORBIS_INCLUDE_DIR NAMES "vorbis/vorbisfile.h") + +find_library(VORBIS_vorbis_LIBRARY NAMES "vorbis") +find_library(VORBIS_vorbisfile_LIBRARY NAMES "vorbisfile") + +mark_as_advanced(VORBIS_INCLUDE_DIR VORBIS_vorbis_LIBRARY VORBIS_vorbisfile_LIBRARY) + +# Define output variables +set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIR}) +if(NOT OGG_INCLUDE_DIR STREQUAL VORBIS_INCLUDE_DIR) + list(APPEND VORBISFILE_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) +endif() +set(VORBISFILE_LIBRARIES ${OGG_LIBRARY} ${VORBIS_vorbis_LIBRARY} ${VORBIS_vorbisfile_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(VorbisFile DEFAULT_MSG + Ogg_FOUND + VORBIS_INCLUDE_DIR VORBIS_vorbis_LIBRARY VORBIS_vorbisfile_LIBRARY) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 39a80cb080..01e14dfa0d 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -241,6 +241,13 @@ else() endif() package_status(FFMPEG "FFmpeg" "${ffmpeg_features}") +# Vorbis +find_package(VorbisFile QUIET) +package_option(VORBIS + FOUND_AS VORBISFILE + "Enables support for decoding Vorbis-encoded .ogg audio files via libvorbisfile.") +package_status(VORBIS "Vorbis") + # # ------------ Audio libraries ------------ # diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index c35c4bf33b..5646bde08c 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -45,7 +45,8 @@ set(P3MOVIES_SOURCES composite_sources(p3movies P3MOVIES_SOURCES) add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) -target_link_libraries(p3movies p3pstatclient p3gobj p3pandabase pandaexpress) +target_link_libraries(p3movies p3pstatclient p3gobj p3pandabase pandaexpress + PKG::VORBIS) target_interrogate(p3movies ALL) if(NOT BUILD_METALIBS) From 052004d06b10ac951e4a78fdfcb292c10c506944 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 13 Jan 2019 11:39:58 -0700 Subject: [PATCH 597/744] CMake: Detect Opus --- cmake/modules/FindOpusFile.cmake | 34 ++++++++++++++++++++++++++++++++ dtool/Package.cmake | 7 +++++++ dtool/dtool_config.h.in | 3 +++ panda/src/movies/CMakeLists.txt | 2 +- 4 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 cmake/modules/FindOpusFile.cmake diff --git a/cmake/modules/FindOpusFile.cmake b/cmake/modules/FindOpusFile.cmake new file mode 100644 index 0000000000..64b0c814ff --- /dev/null +++ b/cmake/modules/FindOpusFile.cmake @@ -0,0 +1,34 @@ +# Filename: FindOpusFile.cmake +# Authors: CFSworks (13 Jan, 2019) +# +# Usage: +# find_package(OpusFile [REQUIRED] [QUIET]) +# +# Once done this will define: +# OPUSFILE_FOUND - system has Ogg and opusfile +# OPUSFILE_INCLUDE_DIRS - the include directory/ies containing opus/ and ogg/ +# OPUSFILE_LIBRARIES - the paths to the opus and opusfile libraries +# + +# Find Ogg +find_package(Ogg QUIET) + +# Find Opus +find_path(OPUS_INCLUDE_DIR NAMES "opus/opusfile.h") + +find_library(OPUS_opus_LIBRARY NAMES "opus") +find_library(OPUS_opusfile_LIBRARY NAMES "opusfile") + +mark_as_advanced(OPUS_INCLUDE_DIR OPUS_opus_LIBRARY OPUS_opusfile_LIBRARY) + +# Define output variables +set(OPUSFILE_INCLUDE_DIRS ${OPUS_INCLUDE_DIR} "${OPUS_INCLUDE_DIR}/opus") +if(NOT OGG_INCLUDE_DIR STREQUAL OPUS_INCLUDE_DIR) + list(APPEND OPUSFILE_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) +endif() +set(OPUSFILE_LIBRARIES ${OGG_LIBRARY} ${OPUS_opus_LIBRARY} ${OPUS_opusfile_LIBRARY}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(OpusFile DEFAULT_MSG + Ogg_FOUND + OPUS_INCLUDE_DIR OPUS_opus_LIBRARY OPUS_opusfile_LIBRARY) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 01e14dfa0d..98a6a5162a 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -248,6 +248,13 @@ package_option(VORBIS "Enables support for decoding Vorbis-encoded .ogg audio files via libvorbisfile.") package_status(VORBIS "Vorbis") +# Opus +find_package(OpusFile QUIET) +package_option(OPUS + FOUND_AS OPUSFILE + "Enables support for decoding .opus audio files via libopusfile.") +package_status(OPUS "Opus") + # # ------------ Audio libraries ------------ # diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 59950c5480..3208b29c38 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -51,6 +51,9 @@ /* Define if we have libvorbisfile available. */ #cmakedefine HAVE_VORBIS +/* Define if we have libopus available. */ +#cmakedefine HAVE_OPUS + /* Define if we have OpenSSL installed. */ #cmakedefine HAVE_OPENSSL #cmakedefine REPORT_OPENSSL_ERRORS diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 5646bde08c..62af1e46d3 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -46,7 +46,7 @@ composite_sources(p3movies P3MOVIES_SOURCES) add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES ${P3MOVIES_HEADERS} ${P3MOVIES_SOURCES}) target_link_libraries(p3movies p3pstatclient p3gobj p3pandabase pandaexpress - PKG::VORBIS) + PKG::VORBIS PKG::OPUS) target_interrogate(p3movies ALL) if(NOT BUILD_METALIBS) From 0ff6787c1cd5c55bb489d3adc09101a40be56518 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 13 Jan 2019 13:00:56 -0700 Subject: [PATCH 598/744] CMake: Fix compatibility with CMake 3.0 `x GREATER_EQUAL y` wasn't added until 3.7, so instead this uses `NOT x LESS y` --- dtool/Package.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 98a6a5162a..3f5ab0f2df 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -496,10 +496,11 @@ package_option(OPENCV package_status(OPENCV "OpenCV") -if(OpenCV_VERSION_MAJOR GREATER_EQUAL 3) +# CMake <3.7 doesn't support GREATER_EQUAL, so this uses NOT LESS instead. +if(NOT OpenCV_VERSION_MAJOR LESS 3) set(OPENCV_VER_3 ON) -elseif(OpenCV_VERSION_MAJOR GREATER_EQUAL 2 AND - OpenCV_VERSION_MINOR GREATER_EQUAL 3) +elseif(NOT OpenCV_VERSION_MAJOR LESS 2 AND + NOT OpenCV_VERSION_MINOR LESS 3) set(OPENCV_VER_23 ON) endif() From 2298aba578610defa3383e6437814f918406e1cf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 13 Jan 2019 14:24:35 -0700 Subject: [PATCH 599/744] CMake: Correct order for {opus,vorbis}file libs --- cmake/modules/FindOpusFile.cmake | 2 +- cmake/modules/FindVorbisFile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindOpusFile.cmake b/cmake/modules/FindOpusFile.cmake index 64b0c814ff..88139de084 100644 --- a/cmake/modules/FindOpusFile.cmake +++ b/cmake/modules/FindOpusFile.cmake @@ -26,7 +26,7 @@ set(OPUSFILE_INCLUDE_DIRS ${OPUS_INCLUDE_DIR} "${OPUS_INCLUDE_DIR}/opus") if(NOT OGG_INCLUDE_DIR STREQUAL OPUS_INCLUDE_DIR) list(APPEND OPUSFILE_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) endif() -set(OPUSFILE_LIBRARIES ${OGG_LIBRARY} ${OPUS_opus_LIBRARY} ${OPUS_opusfile_LIBRARY}) +set(OPUSFILE_LIBRARIES ${OPUS_opusfile_LIBRARY} ${OPUS_opus_LIBRARY} ${OGG_LIBRARY}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(OpusFile DEFAULT_MSG diff --git a/cmake/modules/FindVorbisFile.cmake b/cmake/modules/FindVorbisFile.cmake index 654219c3f7..efa16dd680 100644 --- a/cmake/modules/FindVorbisFile.cmake +++ b/cmake/modules/FindVorbisFile.cmake @@ -26,7 +26,7 @@ set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIR}) if(NOT OGG_INCLUDE_DIR STREQUAL VORBIS_INCLUDE_DIR) list(APPEND VORBISFILE_INCLUDE_DIRS ${OGG_INCLUDE_DIR}) endif() -set(VORBISFILE_LIBRARIES ${OGG_LIBRARY} ${VORBIS_vorbis_LIBRARY} ${VORBIS_vorbisfile_LIBRARY}) +set(VORBISFILE_LIBRARIES ${VORBIS_vorbisfile_LIBRARY} ${VORBIS_vorbis_LIBRARY} ${OGG_LIBRARY}) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(VorbisFile DEFAULT_MSG From 404cfa3fff540c1b06ade55784448add89f587db Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 13 Jan 2019 21:03:01 -0700 Subject: [PATCH 600/744] CMake: Install audiotraits headers --- panda/src/audiotraits/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 3ed5fbe0dd..e9539ec511 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -30,6 +30,7 @@ if(HAVE_RAD_MSS) DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT MilesDevel) + install(FILES ${P3MILES_HEADERS} COMPONENT MilesDevel DESTINATION include/panda3d) export_targets(Miles NAMESPACE "Panda3D::Miles::" COMPONENT MilesDevel) endif() @@ -53,6 +54,7 @@ if(HAVE_FMODEX) DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT FMODDevel) + install(FILES ${P3FMOD_HEADERS} COMPONENT FMODDevel DESTINATION include/panda3d) export_targets(FMOD NAMESPACE "Panda3D::FMOD::" COMPONENT FMODDevel) endif() @@ -77,6 +79,7 @@ if(HAVE_OPENAL) DESTINATION lib RUNTIME DESTINATION bin ARCHIVE COMPONENT OpenALDevel) + install(FILES ${P3OPENAL_HEADERS} COMPONENT OpenALDevel DESTINATION include/panda3d) export_targets(OpenAL NAMESPACE "Panda3D::OpenAL::" COMPONENT OpenALDevel) endif() From 8c4dfd7a70128ff6d7d2d4e698d1ab0aaa9b86be Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 19 Jan 2019 13:22:20 -0700 Subject: [PATCH 601/744] CMake: Move compiler flag detection to its own file --- CMakeLists.txt | 107 +----------------------------------- dtool/CompilerFlags.cmake | 113 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+), 106 deletions(-) create mode 100644 dtool/CompilerFlags.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 6a24f41bbf..aec7d85a2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,121 +10,16 @@ unset(_version) enable_testing() -# Panda3D is now a C++11 project. Newer versions of CMake support this out of -# the box; for older versions we take a shot in the dark: -if(CMAKE_VERSION VERSION_LESS "3.1") - include(CheckCXXCompilerFlag) - check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11) - if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") - else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") - endif() -else() - set(CMAKE_CXX_STANDARD 11) -endif() - # Add generic modules to cmake module path, # and add Panda3D specific modules to cmake module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") -# Set certain CMake flags we expect -set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) -set(CMAKE_INCLUDE_CURRENT_DIR ON) - -# Set up the output directory structure, mimicking that of makepanda -set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") -set(MODULE_DESTINATION "lib") - -# Runtime code assumes that dynamic modules have a "lib" prefix; Windows -# assumes that debug libraries have a _d suffix. -set(CMAKE_SHARED_MODULE_PREFIX "lib") -if(WIN32) - set(CMAKE_DEBUG_POSTFIX "_d") - - # Windows uses libfoo.lib for static libraries and foo.lib/dll for dynamic. - set(CMAKE_STATIC_LIBRARY_PREFIX "lib") - - # On Windows, modules (DLLs) are located in bin; lib is just for .lib files - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") - if(BUILD_SHARED_LIBS) - set(MODULE_DESTINATION "bin") - endif() -endif() - -# Set warning levels -if(MSVC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") -else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") -endif() -if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") - set(disable_flags "-Wno-unused-function -Wno-unused-parameter") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") - - if(MSVC) - # Clang behaving as MSVC - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") - set(CMAKE_CXX_FLAGS - "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") - endif() -endif() -if(WIN32) - add_definitions(-D_CRT_SECURE_NO_WARNINGS) -endif() - -# CMake will often pass -rdynamic when linking executables as a convenience for -# projects that might forget when to use ENABLE_EXPORTS. This is preposterous, -# since it prevents the linker from removing symbols unneeded by the executable -# and stops us from identifying cases where ENABLE_EXPORTS is needed. -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") -set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") - -# As long as we're figuring out compiler flags, figure out the flags for -# turning C++ exception support on and off -include(CheckCXXCompilerFlag) -if(MSVC) - set(cxx_exceptions_on "/EHsc") - set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0") -else() - check_cxx_compiler_flag("-fno-exceptions" COMPILER_SUPPORTS_FEXCEPTIONS) - if(COMPILER_SUPPORTS_FEXCEPTIONS) - set(cxx_exceptions_on "-fexceptions") - set(cxx_exceptions_off "-fno-exceptions") - else() - set(cxx_exceptions_on) - set(cxx_exceptions_off) - endif() -endif() -set(cxx_exceptions_property "$>") -add_compile_options( - "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" - "$<$:${cxx_exceptions_off}>") - -# We should use -fvisibility=hidden everywhere, as it makes sure we think -# about what symbols really should be exposed externally. For more info, see: -# https://gcc.gnu.org/wiki/Visibility -if(NOT MSVC) - check_cxx_compiler_flag("-fvisibility=hidden" COMPILER_SUPPORTS_FVISIBILITY_HIDDEN) - if(COMPILER_SUPPORTS_FVISIBILITY_HIDDEN) - add_compile_options("-fvisibility=hidden") - endif() -endif() - # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option # Configure Panda3D +include(dtool/CompilerFlags.cmake) include(dtool/PandaVersion.cmake) include(dtool/Package.cmake) include(dtool/Config.cmake) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake new file mode 100644 index 0000000000..dd7cfd8d6f --- /dev/null +++ b/dtool/CompilerFlags.cmake @@ -0,0 +1,113 @@ +# +# CompilerFlags.cmake +# +# This file sets up various compiler flags (warning levels, turning off options +# we don't need, etc.) It must be included directly from the root +# CMakeLists.txt, due to its use of set(...) +# + +include(CheckCXXCompilerFlag) + +# Panda3D is now a C++11 project. Newer versions of CMake support this out of +# the box; for older versions we take a shot in the dark: +if(CMAKE_VERSION VERSION_LESS "3.1") + check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11) + if(COMPILER_SUPPORTS_CXX11) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") + endif() +else() + set(CMAKE_CXX_STANDARD 11) +endif() + +# Set certain CMake flags we expect +set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +# Set up the output directory structure, mimicking that of makepanda +set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +set(MODULE_DESTINATION "lib") + +# Runtime code assumes that dynamic modules have a "lib" prefix; Windows +# assumes that debug libraries have a _d suffix. +set(CMAKE_SHARED_MODULE_PREFIX "lib") +if(WIN32) + set(CMAKE_DEBUG_POSTFIX "_d") + + # Windows uses libfoo.lib for static libraries and foo.lib/dll for dynamic. + set(CMAKE_STATIC_LIBRARY_PREFIX "lib") + + # On Windows, modules (DLLs) are located in bin; lib is just for .lib files + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + if(BUILD_SHARED_LIBS) + set(MODULE_DESTINATION "bin") + endif() +endif() + +# Set warning levels +if(MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") +else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") +endif() +if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") + set(disable_flags "-Wno-unused-function -Wno-unused-parameter") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") + + if(MSVC) + # Clang behaving as MSVC + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") + set(CMAKE_CXX_FLAGS + "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") + endif() +endif() +if(WIN32) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif() + +# CMake will often pass -rdynamic when linking executables as a convenience for +# projects that might forget when to use ENABLE_EXPORTS. This is preposterous, +# since it prevents the linker from removing symbols unneeded by the executable +# and stops us from identifying cases where ENABLE_EXPORTS is needed. +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") + +# As long as we're figuring out compiler flags, figure out the flags for +# turning C++ exception support on and off +if(MSVC) + set(cxx_exceptions_on "/EHsc") + set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0") +else() + check_cxx_compiler_flag("-fno-exceptions" COMPILER_SUPPORTS_FEXCEPTIONS) + if(COMPILER_SUPPORTS_FEXCEPTIONS) + set(cxx_exceptions_on "-fexceptions") + set(cxx_exceptions_off "-fno-exceptions") + else() + set(cxx_exceptions_on) + set(cxx_exceptions_off) + endif() +endif() +set(cxx_exceptions_property "$>") +add_compile_options( + "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" + "$<$:${cxx_exceptions_off}>") + +# We should use -fvisibility=hidden everywhere, as it makes sure we think +# about what symbols really should be exposed externally. For more info, see: +# https://gcc.gnu.org/wiki/Visibility +if(NOT MSVC) + check_cxx_compiler_flag("-fvisibility=hidden" COMPILER_SUPPORTS_FVISIBILITY_HIDDEN) + if(COMPILER_SUPPORTS_FVISIBILITY_HIDDEN) + add_compile_options("-fvisibility=hidden") + endif() +endif() From d9615148920387229a0f575bde63d839e933e926 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 19 Jan 2019 17:01:36 -0700 Subject: [PATCH 602/744] CMake: Use string/list(APPEND foo ...) instead of set(foo ${foo} ...) --- cmake/macros/AddBisonTarget.cmake | 6 +++--- cmake/macros/AddFlexTarget.cmake | 8 ++++---- cmake/macros/PackageConfig.cmake | 12 ++++++------ cmake/modules/FindCg.cmake | 2 +- dtool/CompilerFlags.cmake | 24 ++++++++++++------------ 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/cmake/macros/AddBisonTarget.cmake b/cmake/macros/AddBisonTarget.cmake index 45278db7de..820f78ab56 100644 --- a/cmake/macros/AddBisonTarget.cmake +++ b/cmake/macros/AddBisonTarget.cmake @@ -21,9 +21,9 @@ function(add_bison_target output_cxx input_yxx) set(keyword "PREFIX") elseif(keyword STREQUAL "PREFIX") - set(arguments ${arguments} -p "${arg}") + list(APPEND arguments -p "${arg}") elseif(keyword STREQUAL "DEFINES") - set(arguments ${arguments} --defines="${arg}") + list(APPEND arguments --defines="${arg}") list(APPEND outputs "${arg}") else() @@ -61,7 +61,7 @@ function(add_bison_target output_cxx input_yxx) endif() list(APPEND depends "${prebuilt_file}") - set(commands ${commands} COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) + list(APPEND commands COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) endforeach() add_custom_command( diff --git a/cmake/macros/AddFlexTarget.cmake b/cmake/macros/AddFlexTarget.cmake index 1df75d5859..d85d4875c7 100644 --- a/cmake/macros/AddFlexTarget.cmake +++ b/cmake/macros/AddFlexTarget.cmake @@ -20,12 +20,12 @@ function(add_flex_target output_cxx input_lxx) elseif(arg STREQUAL "PREFIX") set(keyword "PREFIX") elseif(arg STREQUAL "CASE_INSENSITIVE") - set(arguments ${arguments} -i) + list(APPEND arguments -i) elseif(keyword STREQUAL "PREFIX") - set(arguments ${arguments} -P "${arg}") + list(APPEND arguments -P "${arg}") elseif(keyword STREQUAL "DEFINES") - set(arguments ${arguments} --header-file="${arg}") + list(APPEND arguments --header-file="${arg}") list(APPEND outputs "${arg}") else() @@ -63,7 +63,7 @@ function(add_flex_target output_cxx input_lxx) endif() list(APPEND depends "${prebuilt_file}") - set(commands ${commands} COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) + list(APPEND commands COMMAND ${CMAKE_COMMAND} -E copy ${prebuilt_file} ${output}) endforeach() add_custom_command( diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 975ccc4559..3c200438b1 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -288,10 +288,10 @@ function(export_packages filename) set(exports "# Exports for Panda3D PKG:: packages\n") foreach(pkg ${_ALL_PACKAGE_OPTIONS}) - set(exports "${exports}\n# Create imported target PKG::${pkg}\n") - set(exports "${exports}add_library(PKG::${pkg} INTERFACE IMPORTED)\n\n") + string(APPEND exports "\n# Create imported target PKG::${pkg}\n") + string(APPEND exports "add_library(PKG::${pkg} INTERFACE IMPORTED)\n\n") - set(exports "${exports}set_target_properties(PKG::${pkg} PROPERTIES\n") + string(APPEND exports "set_target_properties(PKG::${pkg} PROPERTIES\n") foreach(prop INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES @@ -304,7 +304,7 @@ function(export_packages filename) #INTERFACE_SYSTEM_INCLUDE_DIRECTORIES # Let the consumer dictate this INTERFACE_SOURCES) set(prop_ex "$") - set(exports "${exports}$<$: ${prop} \"${prop_ex}\"\n>") + string(APPEND exports "$<$: ${prop} \"${prop_ex}\"\n>") endforeach(prop) # Ugh, INTERFACE_LINK_LIBRARIES isn't transitive. Fine. Take care of it @@ -382,9 +382,9 @@ function(export_packages filename) endif() endwhile(stack) - set(exports "${exports} INTERFACE_LINK_LIBRARIES \"${libraries}\"\n") + string(APPEND exports " INTERFACE_LINK_LIBRARIES \"${libraries}\"\n") - set(exports "${exports})\n") + string(APPEND exports ")\n") endforeach(pkg) file(GENERATE OUTPUT "${filename}" CONTENT "${exports}") diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index b48904b2ba..3df0a7fd58 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -122,7 +122,7 @@ if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIRS) cmake_find_frameworks(Cg) if(Cg_FRAMEWORKS) foreach(dir ${Cg_FRAMEWORKS}) - set(CG_INCLUDES ${CG_INCLUDES} ${dir}/Headers ${dir}/PrivateHeaders) + list(APPEND CG_INCLUDES ${dir}/Headers ${dir}/PrivateHeaders) endforeach(dir) unset(Cg_FRAMEWORKS) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index dd7cfd8d6f..114c824a0b 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -13,9 +13,9 @@ include(CheckCXXCompilerFlag) if(CMAKE_VERSION VERSION_LESS "3.1") check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX11) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + string(APPEND CMAKE_CXX_FLAGS " -std=gnu++11") else() - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") + string(APPEND CMAKE_CXX_FLAGS " -std=gnu++0x") endif() else() set(CMAKE_CXX_STANDARD 11) @@ -50,23 +50,23 @@ endif() # Set warning levels if(MSVC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") + string(APPEND CMAKE_C_FLAGS " /W3") + string(APPEND CMAKE_CXX_FLAGS " /W3") else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") + string(APPEND CMAKE_C_FLAGS " -Wall") + string(APPEND CMAKE_CXX_FLAGS " -Wall") endif() if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") set(disable_flags "-Wno-unused-function -Wno-unused-parameter") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") + string(APPEND CMAKE_C_FLAGS " ${disable_flags}") + string(APPEND CMAKE_CXX_FLAGS " ${disable_flags} -Wno-reorder") + string(APPEND CMAKE_CXX_FLAGS_RELEASE " -Wno-unused-variable") + string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Wno-unused-variable") + string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " -Wno-unused-variable") if(MSVC) # Clang behaving as MSVC - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") + string(APPEND CMAKE_C_FLAGS " -Wno-unused-command-line-argument") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") endif() From 7097f5b0e1d6769c81508f332872074ad11b5eee Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 23 Feb 2019 01:28:26 -0700 Subject: [PATCH 603/744] CMake: Move "framework" to its own component It can depend on graphics backends, so it can't go in Core. --- cmake/install/Panda3DConfig.cmake | 87 ++++++++++++++++-------------- panda/src/framework/CMakeLists.txt | 8 +-- 2 files changed, 51 insertions(+), 44 deletions(-) diff --git a/cmake/install/Panda3DConfig.cmake b/cmake/install/Panda3DConfig.cmake index 6320da8fdf..ceff49f55a 100644 --- a/cmake/install/Panda3DConfig.cmake +++ b/cmake/install/Panda3DConfig.cmake @@ -12,89 +12,94 @@ # # The following components are available for importing: # -# Core - The core Panda3D libraries; this component is always included. +# Core - The core Panda3D libraries; this component is always included. # -# Panda3D::Core::panda -# Panda3D::Core::pandaexpress -# etc. +# Panda3D::Core::panda +# Panda3D::Core::pandaexpress +# etc. # # -# Python - Python targets, which can be used for linking against the Python -# extension modules directly. Note that this also imports the -# Python bindings for other requested components that have them. +# Python - Python targets, which can be used for linking against the Python +# extension modules directly. Note that this also imports the +# Python bindings for other requested components that have them. # -# Panda3D::Python::panda3d.core -# Panda3D::Python::panda3d.physics -# etc. +# Panda3D::Python::panda3d.core +# Panda3D::Python::panda3d.physics +# etc. # # -# Tools - Various tools used in asset manipulation and debugging. +# Tools - Various tools used in asset manipulation and debugging. # -# Panda3D::Tools::egg2bam -# Panda3D::Tools::egg-optchar -# Panda3D::Tools::pview -# etc. +# Panda3D::Tools::egg2bam +# Panda3D::Tools::egg-optchar +# Panda3D::Tools::pview +# etc. # # -# Direct - Panda's "direct" Python framework; C++ support library. +# Direct - Panda's "direct" Python framework; C++ support library. # -# Panda3D::Direct::p3direct +# Panda3D::Direct::p3direct # # -# Egg - Support for the Egg file format. +# Framework - Panda's "p3framework" C++ framework. # -# Panda3D::Egg::pandaegg +# Panda3D::Framework::p3framework # # -# Bullet - Support for Bullet physics. +# Egg - Support for the Egg file format. # -# Panda3D::Bullet::p3bullet +# Panda3D::Egg::pandaegg # # -# ODE - Support for the ODE physics engine. +# Bullet - Support for Bullet physics. # -# Panda3D::ODE::p3ode +# Panda3D::Bullet::p3bullet # # -# FFmpeg - Support for FFmpeg media format loading. +# ODE - Support for the ODE physics engine. # -# Panda3D::FFmpeg::p3ffmpeg +# Panda3D::ODE::p3ode # # -# OpenAL - Support for OpenAL audio output. +# FFmpeg - Support for FFmpeg media format loading. # -# Panda3D::OpenAL::p3openal_audio +# Panda3D::FFmpeg::p3ffmpeg # # -# FMOD - Support for FMOD audio output. +# OpenAL - Support for OpenAL audio output. # -# Panda3D::OpenAL::p3fmod_audio +# Panda3D::OpenAL::p3openal_audio # # -# OpenGL - Support for OpenGL rendering. +# FMOD - Support for FMOD audio output. # -# Panda3D::OpenGL::pandagl +# Panda3D::OpenAL::p3fmod_audio # # -# DX9 - Support for Direct3D 9 rendering. +# OpenGL - Support for OpenGL rendering. # -# Panda3D::DX9::pandadx9 +# Panda3D::OpenGL::pandagl # # -# GLES - Support for OpenGL ES rendering. +# DX9 - Support for Direct3D 9 rendering. # -# Panda3D::GLES::pandagles -# Panda3D::GLES::pandagles2 +# Panda3D::DX9::pandadx9 # # -# Vision - Support for vision processing. +# GLES - Support for OpenGL ES rendering. # -# Panda3D::Vision::p3vision +# Panda3D::GLES::pandagles +# Panda3D::GLES::pandagles2 # # -# VRPN - Support for connecting to a VRPN virtual reality server. +# Vision - Support for vision processing. # -# Panda3D::VRPN::p3vrpn +# Panda3D::Vision::p3vision +# +# +# VRPN - Support for connecting to a VRPN virtual reality server. +# +# Panda3D::VRPN::p3vrpn if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0) message(FATAL_ERROR "CMake >= 3.0.2 required") @@ -106,7 +111,7 @@ include("${_panda_config_prefix}/Panda3DPackages.cmake") set(_panda_components Core Python Tools - Direct Egg + Direct Framework Egg Bullet ODE FFmpeg OpenAL FMOD diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index b07fc8623a..68bf38152c 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -52,8 +52,10 @@ set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) install(TARGETS p3framework - EXPORT Core COMPONENT Core + EXPORT Framework COMPONENT Framework DESTINATION lib RUNTIME DESTINATION bin - ARCHIVE COMPONENT CoreDevel) -install(FILES ${P3FRAMEWORK_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) + ARCHIVE COMPONENT FrameworkDevel) +install(FILES ${P3FRAMEWORK_HEADERS} COMPONENT FrameworkDevel DESTINATION include/panda3d) + +export_targets(Framework COMPONENT FrameworkDevel) From 9c90ad596e23bc69c53b076dc7bd12ce460fb52c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 12 Mar 2019 02:05:06 -0600 Subject: [PATCH 604/744] CMake: Update for upstream changes --- panda/CMakeLists.txt | 1 - panda/src/express/CMakeLists.txt | 2 -- panda/src/osxdisplay/CMakeLists.txt | 35 --------------------------- panda/src/pipeline/CMakeLists.txt | 9 +------ pandatool/CMakeLists.txt | 1 - pandatool/src/cvscopy/CMakeLists.txt | 14 ----------- pandatool/src/fltprogs/CMakeLists.txt | 4 --- 7 files changed, 1 insertion(+), 65 deletions(-) delete mode 100644 panda/src/osxdisplay/CMakeLists.txt delete mode 100644 pandatool/src/cvscopy/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 1f8bb19741..43ead6253f 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -38,7 +38,6 @@ add_subdirectory(src/mathutil) add_subdirectory(src/movies) add_subdirectory(src/nativenet) add_subdirectory(src/net) -add_subdirectory(src/osxdisplay) add_subdirectory(src/pandabase) add_subdirectory(src/parametrics) add_subdirectory(src/pgraph) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index c5c7e68152..2e1c1c28b2 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -36,7 +36,6 @@ set(P3EXPRESS_HEADERS pointerToArrayBase.I pointerToArrayBase.h pointerToBase.I pointerToBase.h pointerToVoid.I pointerToVoid.h - profileTimer.I profileTimer.h pta_int.h pta_uchar.h pta_double.h pta_float.h pta_stdfloat.h @@ -94,7 +93,6 @@ set(P3EXPRESS_SOURCES pointerToArray.cxx pointerToBase.cxx pointerToVoid.cxx - profileTimer.cxx pta_int.cxx pta_uchar.cxx pta_double.cxx pta_float.cxx ramfile.cxx diff --git a/panda/src/osxdisplay/CMakeLists.txt b/panda/src/osxdisplay/CMakeLists.txt deleted file mode 100644 index 1bb5af7c36..0000000000 --- a/panda/src/osxdisplay/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -if(NOT APPLE OR NOT HAVE_GL OR NOT HAVE_CARBON) - return() -endif() - -set(P3OSXDISPLAY_HEADERS - config_osxdisplay.h - osxGraphicsBuffer.h - osxGraphicsPipe.h - osxGraphicsWindow.h osxGraphicsWindow.I - osxGraphicsStateGuardian.h) - -set(P3OSXDISPLAY_SOURCES - config_osxdisplay.cxx - osxGraphicsPipe.cxx osxGraphicsStateGuardian.cxx - osxGraphicsBuffer.cxx) - -composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES) -add_component_library(p3osxdisplay SYMBOL BUILDING_PANDA_OSXDISPLAY - ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES}) -set_target_properties(p3osxdisplay PROPERTIES COMPILE_FLAGS "-ObjC++") -target_link_libraries(p3osxdisplay p3glgsg panda) - -# Frameworks: -find_library(APPLICATIONSERVICES_LIBRARY ApplicationServices) -find_library(CARBON_LIBRARY Carbon) -find_library(AGL_LIBRARY AGL) -find_library(CORESERVICES_LIBRARY CoreServices) -find_library(COCOA_LIBRARY Cocoa) -target_link_libraries(p3osxdisplay - ${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY} - ${CORESERVICES_LIBRARY} ${COCOA_LIBRARY}) - -if(NOT BUILD_METALIBS) - install(TARGETS p3osxdisplay EXPORT Core COMPONENT Core DESTINATION lib) -endif() diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 2d1f0993a3..fad48fa244 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -5,9 +5,7 @@ set(P3PIPELINE_HEADERS conditionVarDebug.h conditionVarDebug.I conditionVarDirect.h conditionVarDirect.I conditionVarDummyImpl.h conditionVarDummyImpl.I - conditionVarFull.h conditionVarFull.I - conditionVarFullDebug.h conditionVarFullDebug.I - conditionVarFullDirect.h conditionVarFullDirect.I + conditionVarFull.h conditionVarImpl.h conditionVarSimpleImpl.h conditionVarSimpleImpl.I conditionVarSpinlockImpl.h conditionVarSpinlockImpl.I @@ -61,9 +59,6 @@ set(P3PIPELINE_SOURCES conditionVarDebug.cxx conditionVarDirect.cxx conditionVarDummyImpl.cxx - conditionVarFull.cxx - conditionVarFullDebug.cxx - conditionVarFullDirect.cxx conditionVarSimpleImpl.cxx conditionVarSpinlockImpl.cxx conditionVarPosixImpl.cxx @@ -110,12 +105,10 @@ set(P3PIPELINE_SOURCES if(WIN32) set(P3PIPELINE_HEADERS ${P3PIPELINE_HEADERS} - conditionVarFullWin32Impl.h conditionVarFullWin32Impl.I conditionVarWin32Impl.h conditionVarWin32Impl.I threadWin32Impl.h threadWin32Impl.I) set(P3PIPELINE_SOURCES ${P3PIPELINE_SOURCES} - conditionVarFullWin32Impl.cxx conditionVarWin32Impl.cxx threadWin32Impl.cxx) endif() diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 3acefaf1f7..1ecd9f6f58 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -6,7 +6,6 @@ endif() add_subdirectory(src/assimp) add_subdirectory(src/bam) add_subdirectory(src/converter) -add_subdirectory(src/cvscopy) add_subdirectory(src/dxf) add_subdirectory(src/dxfegg) add_subdirectory(src/dxfprogs) diff --git a/pandatool/src/cvscopy/CMakeLists.txt b/pandatool/src/cvscopy/CMakeLists.txt deleted file mode 100644 index 718db0d7ca..0000000000 --- a/pandatool/src/cvscopy/CMakeLists.txt +++ /dev/null @@ -1,14 +0,0 @@ -set(P3CVSCOPY_HEADERS - cvsCopy.h cvsSourceDirectory.h cvsSourceTree.h -) - -set(P3CVSCOPY_SOURCES - cvsCopy.cxx cvsSourceDirectory.cxx cvsSourceTree.cxx -) - -composite_sources(p3cvscopy P3CVSCOPY_SOURCES) -add_library(p3cvscopy STATIC ${P3CVSCOPY_HEADERS} ${P3CVSCOPY_SOURCES}) -target_link_libraries(p3cvscopy p3progbase) - -# This is only needed for binaries in the pandatool package. It is not useful -# for user applications, so it is not installed. diff --git a/pandatool/src/fltprogs/CMakeLists.txt b/pandatool/src/fltprogs/CMakeLists.txt index 31bb45e4ef..9fc69bb15a 100644 --- a/pandatool/src/fltprogs/CMakeLists.txt +++ b/pandatool/src/fltprogs/CMakeLists.txt @@ -6,10 +6,6 @@ add_executable(flt-trans fltTrans.cxx fltTrans.h) target_link_libraries(flt-trans p3progbase p3flt) install(TARGETS flt-trans EXPORT Tools COMPONENT Tools DESTINATION bin) -add_executable(fltcopy fltCopy.cxx fltCopy.h) -target_link_libraries(fltcopy p3progbase p3cvscopy p3flt) -install(TARGETS fltcopy EXPORT Tools COMPONENT Tools DESTINATION bin) - if(HAVE_EGG) add_executable(egg2flt eggToFlt.cxx eggToFlt.h) From 52541825b59aeb2f18f3b90f32c250f5e8217a27 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Mar 2019 20:17:55 -0600 Subject: [PATCH 605/744] CMake: Move p3cocoadisplay to OpenGL component --- panda/src/cocoadisplay/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 7447c6e1f4..775b273c23 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -42,5 +42,5 @@ target_link_libraries(p3cocoadisplay ${CORE_VIDEO_LIBRARY}) if(NOT BUILD_METALIBS) - install(TARGETS p3cocoadisplay EXPORT Core COMPONENT Core DESTINATION lib) + install(TARGETS p3cocoadisplay EXPORT OpenGL COMPONENT OpenGL DESTINATION lib) endif() From 617ef48346f9ff7d79b43f3392407aa50a8a2e6d Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 17 Mar 2019 21:10:55 +0100 Subject: [PATCH 606/744] CMake: fix building without HAVE_NET/WANT_NATIVE_NET --- panda/CMakeLists.txt | 10 ++++++++-- panda/metalibs/panda/CMakeLists.txt | 10 ++++++++-- panda/src/pstatclient/CMakeLists.txt | 7 ++++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 43ead6253f..dd8f545255 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -81,11 +81,17 @@ add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: set(CORE_MODULE_COMPONENTS p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml - p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet - p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil + p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform p3prc p3dtoolutil p3dtoolbase) +if(WANT_NATIVE_NET) + list(APPEND CORE_MODULE_COMPONENTS p3nativenet) + if(HAVE_NET) + list(APPEND CORE_MODULE_COMPONENTS p3net) + endif() +endif() if(HAVE_AUDIO) list(APPEND CORE_MODULE_COMPONENTS p3audio) endif() diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 1a8d259b67..ee34835678 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,9 +1,15 @@ set(PANDA_LINK_TARGETS p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml - p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3nativenet - p3net p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil + p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) +if(WANT_NATIVE_NET) + list(APPEND PANDA_LINK_TARGETS p3nativenet) + if(HAVE_NET) + list(APPEND PANDA_LINK_TARGETS p3net) + endif() +endif() if(HAVE_AUDIO) list(APPEND PANDA_LINK_TARGETS p3audio) endif() diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index ac256ad870..83a9b7e968 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -23,7 +23,12 @@ set(P3PSTATCLIENT_SOURCES composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT ${P3PSTATCLIENT_HEADERS} ${P3PSTATCLIENT_SOURCES}) -target_link_libraries(p3pstatclient p3net p3putil pandaexpress) +target_link_libraries(p3pstatclient p3putil pandaexpress) + +if(HAVE_NET AND WANT_NATIVE_NET) + target_link_libraries(p3pstatclient p3net) +endif() + target_interrogate(p3pstatclient ALL) if(NOT BUILD_METALIBS) From d44b090ecd7fbe6e3e22d98684140759797a2b89 Mon Sep 17 00:00:00 2001 From: rdb Date: Sun, 17 Mar 2019 21:16:08 +0100 Subject: [PATCH 607/744] CMake: update for latest Android NDK; fix missing Android sources --- dtool/Config.cmake | 12 ++++++------ dtool/src/prc/CMakeLists.txt | 9 +++++++++ panda/src/express/CMakeLists.txt | 9 +++++++++ 3 files changed, 24 insertions(+), 6 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 47c0e94690..55ee41a2c7 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -12,7 +12,7 @@ include(CMakeDependentOption) # The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN" # are automatically provided by CMAKE. "APPLE" is also provided by # CMAKE but may be True on systems that are not OS X. -if(CMAKE_SYSTEM_NAME MATCHES "Linux") +if(CMAKE_SYSTEM_NAME MATCHES "Linux" OR CMAKE_SYSTEM_NAME MATCHES "Android") set(IS_LINUX 1) endif() if(CMAKE_SYSTEM_NAME MATCHES "Darwin") @@ -378,14 +378,14 @@ set(ANDROID_NDK_HOME "" CACHE STRING "The location of the Android NDK directory. ANDROID_NDK_HOME may not contain any spaces.") -set(ANDROID_ABI "armeabi" CACHE STRING - "Can be be set to armeabi, armeabi-v7a, x86, or mips, +set(ANDROID_ABI "armeabi-v7a" CACHE STRING + "Can be be set to armeabi-v7a, arm64-v8a, x86, or x86_64, depending on which architecture should be targeted.") set_property(CACHE ANDROID_ABI PROPERTY STRINGS - armeabi armeabi-v7a x86 mips) + armeabi-v7a arm64-v8a x86 x86_64) -set(ANDROID_STL "gnustl_shared" CACHE STRING "") -set(ANDROID_PLATFORM "android-9" CACHE STRING "") +set(ANDROID_STL "c++_shared" CACHE STRING "") +set(ANDROID_PLATFORM "android-14" CACHE STRING "") set(ANDROID_ARCH "arm" CACHE STRING "") if(ANDROID_ARCH STREQUAL "arm") set(ANDROID_TOOLCHAIN "arm-linux-androideabi") diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 3ca67a007d..18ead907d7 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -63,6 +63,11 @@ set(P3PRC_SOURCES reversedNumericData.cxx streamReader.cxx streamWrapper.cxx streamWriter.cxx) +if(ANDROID) + set(P3PRC_SOURCES ${P3PRC_SOURCES} + androidLogStream.cxx) +endif() + set(P3PRC_IGATEEXT streamReader_ext.cxx streamReader_ext.h @@ -77,6 +82,10 @@ target_include_directories(p3prc PUBLIC $ Date: Sat, 16 Mar 2019 16:20:39 -0600 Subject: [PATCH 608/744] CMake: Discover FFTW3 by MODULE only, never CONFIG This stops a CMake crash on some folks' systems. --- dtool/Package.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 3f5ab0f2df..04ccedf67e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -202,7 +202,10 @@ else() endif() # FFTW -find_package(FFTW3 QUIET) +# FFTW 3.3.7, when built with autotools, doesn't install +# FFTW3LibraryDepends.cmake, which will crash us if we use CONFIG mode. BAH! +# Force MODULE mode to fix that. +find_package(FFTW3 MODULE QUIET) package_option(FFTW "This enables support for compression of animations in .bam files. From d61ecb8a8f281e8b1e808330036c4eb32c4ac0c5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 16 Mar 2019 17:26:44 -0600 Subject: [PATCH 609/744] CMake: Build p3distort --- panda/CMakeLists.txt | 9 ++++---- panda/metalibs/panda/CMakeLists.txt | 2 +- panda/src/distort/CMakeLists.txt | 34 +++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 panda/src/distort/CMakeLists.txt diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index dd8f545255..962101b8e2 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -14,6 +14,7 @@ add_subdirectory(src/cull) add_subdirectory(src/device) add_subdirectory(src/dgraph) add_subdirectory(src/display) +add_subdirectory(src/distort) add_subdirectory(src/downloader) add_subdirectory(src/downloadertools) add_subdirectory(src/dxgsg9) @@ -80,10 +81,10 @@ add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: set(CORE_MODULE_COMPONENTS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml - p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil - p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline - p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort + p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath + p3mathutil p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui + p3pipeline p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform p3prc p3dtoolutil p3dtoolbase) if(WANT_NATIVE_NET) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index ee34835678..bb1e96d374 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,5 +1,5 @@ set(PANDA_LINK_TARGETS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort p3dxml p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) diff --git a/panda/src/distort/CMakeLists.txt b/panda/src/distort/CMakeLists.txt new file mode 100644 index 0000000000..9711656648 --- /dev/null +++ b/panda/src/distort/CMakeLists.txt @@ -0,0 +1,34 @@ +set(P3DISTORT_HEADERS + config_distort.h + cylindricalLens.h cylindricalLens.I + fisheyeLens.h fisheyeLens.I + nonlinearImager.h nonlinearImager.I + oSphereLens.h oSphereLens.I + projectionScreen.h projectionScreen.I + pSphereLens.h pSphereLens.I +) + +set(P3DISTORT_SOURCES + config_distort.cxx + cylindricalLens.cxx + fisheyeLens.cxx + nonlinearImager.cxx + oSphereLens.cxx + projectionScreen.cxx + pSphereLens.cxx +) + +composite_sources(p3distort P3DISTORT_SOURCES) +add_component_library(p3distort SYMBOL BUILDING_PANDAFX + ${P3DISTORT_HEADERS} ${P3DISTORT_SOURCES}) +target_link_libraries(p3distort p3pgraphnodes p3display) +target_interrogate(p3distort ALL) + +if(NOT BUILD_METALIBS) + install(TARGETS p3distort + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) +endif() +install(FILES ${P3DISTORT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) From 3a9353c0ca995d3df8bbcb89ad7982126769b9cc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 17 Mar 2019 00:06:26 -0600 Subject: [PATCH 610/744] CMake: Build 'contrib' --- CMakeLists.txt | 5 +++ cmake/install/Panda3DConfig.cmake | 9 ++++- contrib/CMakeLists.txt | 18 +++++++++ contrib/src/ai/CMakeLists.txt | 53 ++++++++++++++++++++++++++ contrib/src/contribbase/CMakeLists.txt | 14 +++++++ contrib/src/rplight/CMakeLists.txt | 51 +++++++++++++++++++++++++ 6 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 contrib/CMakeLists.txt create mode 100644 contrib/src/ai/CMakeLists.txt create mode 100644 contrib/src/contribbase/CMakeLists.txt create mode 100644 contrib/src/rplight/CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index aec7d85a2b..211183d65d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,7 @@ option(BUILD_DTOOL "Build the dtool source tree." ON) option(BUILD_PANDA "Build the panda source tree." ON) option(BUILD_DIRECT "Build the direct source tree." ON) option(BUILD_PANDATOOL "Build the pandatool source tree." ON) +option(BUILD_CONTRIB "Build the contrib source tree." ON) option(BUILD_MODELS "Build/install the built-in models." ON) # Include Panda3D packages @@ -61,6 +62,10 @@ if(BUILD_PANDATOOL) add_subdirectory(pandatool "${CMAKE_BINARY_DIR}/pandatool") endif() +if(BUILD_CONTRIB) + add_subdirectory(contrib "${CMAKE_BINARY_DIR}/contrib") +endif() + if(BUILD_MODELS) # We don't really "build" the models, just pzip them file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" diff --git a/cmake/install/Panda3DConfig.cmake b/cmake/install/Panda3DConfig.cmake index ceff49f55a..2a7c192926 100644 --- a/cmake/install/Panda3DConfig.cmake +++ b/cmake/install/Panda3DConfig.cmake @@ -41,6 +41,13 @@ # Panda3D::Direct::p3direct # # +# Contrib - Extensions not part of the Panda3D core, but contributed by the +# community. +# +# Panda3D::Contrib::p3ai +# Panda3D::Contrib::p3rplight +# +# # Framework - Panda's "p3framework" C++ framework. # # Panda3D::Framework::p3framework @@ -111,7 +118,7 @@ include("${_panda_config_prefix}/Panda3DPackages.cmake") set(_panda_components Core Python Tools - Direct Framework Egg + Direct Contrib Framework Egg Bullet ODE FFmpeg OpenAL FMOD diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt new file mode 100644 index 0000000000..19f8604966 --- /dev/null +++ b/contrib/CMakeLists.txt @@ -0,0 +1,18 @@ +if(NOT BUILD_PANDA) + message(FATAL_ERROR "Cannot build contrib without panda! Please enable the BUILD_PANDA option.") +endif() + +# Include source directories +add_subdirectory(src/ai) +add_subdirectory(src/contribbase) +add_subdirectory(src/rplight) + +if(HAVE_PYTHON) + add_python_module(ai p3ai + IMPORT panda3d.core COMPONENT ContribPython) + + add_python_module(_rplight p3rplight + IMPORT panda3d.core COMPONENT ContribPython) +endif() + +export_targets(Contrib COMPONENT ContribDevel) diff --git a/contrib/src/ai/CMakeLists.txt b/contrib/src/ai/CMakeLists.txt new file mode 100644 index 0000000000..b32b3b878d --- /dev/null +++ b/contrib/src/ai/CMakeLists.txt @@ -0,0 +1,53 @@ +set(P3AI_HEADERS + aiBehaviors.h + aiCharacter.h + aiGlobals.h + aiNode.h + aiPathFinder.h + aiWorld.h + arrival.h + config_ai.h + evade.h + flee.h + flock.h + meshNode.h + obstacleAvoidance.h + pathFind.h + pathFollow.h + pursue.h + seek.h + wander.h +) + +set(P3AI_SOURCES + aiBehaviors.cxx + aiCharacter.cxx + aiNode.cxx + aiPathFinder.cxx + aiWorld.cxx + arrival.cxx + config_ai.cxx + evade.cxx + flee.cxx + flock.cxx + meshNode.cxx + obstacleAvoidance.cxx + pathFind.cxx + pathFollow.cxx + pursue.cxx + seek.cxx + wander.cxx +) + +composite_sources(p3ai P3AI_SOURCES) +add_library(p3ai ${P3AI_HEADERS} ${P3AI_SOURCES}) +set_target_properties(p3ai PROPERTIES DEFINE_SYMBOL BUILDING_PANDAAI) +target_link_libraries(p3ai p3contribbase) +target_interrogate(p3ai ALL) + +install(TARGETS p3ai + EXPORT Contrib COMPONENT Contrib + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT ContribDevel) +install(FILES ${P3AI_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) diff --git a/contrib/src/contribbase/CMakeLists.txt b/contrib/src/contribbase/CMakeLists.txt new file mode 100644 index 0000000000..a60e741c6e --- /dev/null +++ b/contrib/src/contribbase/CMakeLists.txt @@ -0,0 +1,14 @@ +set(P3CONTRIBBASE_SOURCES + contribbase.cxx +) + +set(P3CONTRIBBASE_HEADERS + contribbase.h contribsymbols.h +) + +# Yes, INTERFACE: don't build it, there's no code! +add_library(p3contribbase INTERFACE) +target_link_libraries(p3contribbase INTERFACE panda) + +install(TARGETS p3contribbase EXPORT Contrib COMPONENT Contrib) +install(FILES ${P3CONTRIBBASE_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) diff --git a/contrib/src/rplight/CMakeLists.txt b/contrib/src/rplight/CMakeLists.txt new file mode 100644 index 0000000000..5bb1f669f3 --- /dev/null +++ b/contrib/src/rplight/CMakeLists.txt @@ -0,0 +1,51 @@ +set(P3RPLIGHT_HEADERS + config_rplight.h + gpuCommand.h gpuCommand.I + gpuCommandList.h + iesDataset.h + internalLightManager.h internalLightManager.I + pointerSlotStorage.h + pssmCameraRig.h pssmCameraRig.I + rpLight.h rpLight.I + rpPointLight.h rpPointLight.I + rpSpotLight.h rpSpotLight.I + shadowAtlas.h shadowAtlas.I + shadowManager.h shadowManager.I + shadowSource.h shadowSource.I + tagStateManager.h tagStateManager.I +) + +set(P3RPLIGHT_SOURCES + config_rplight.cxx + gpuCommand.cxx + gpuCommandList.cxx + iesDataset.cxx + internalLightManager.cxx + pssmCameraRig.cxx + rpLight.cxx + rpPointLight.cxx + rpSpotLight.cxx + shadowAtlas.cxx + shadowManager.cxx + shadowSource.cxx + tagStateManager.cxx +) + +composite_sources(p3rplight P3RPLIGHT_SOURCES) +# STATIC, because it doesn't contain any EXPCL_ stuff +add_library(p3rplight STATIC ${P3RPLIGHT_HEADERS} ${P3RPLIGHT_SOURCES}) +target_link_libraries(p3rplight p3contribbase) +target_interrogate(p3rplight ALL) + +if(MODULE_TYPE STREQUAL "MODULE") + # Because it's STATIC (see above), we need to make it PIC so it can link into + # a Python module + set_target_properties(p3rplight PROPERTIES POSITION_INDEPENDENT_CODE ON) +endif() + +install(TARGETS p3rplight + EXPORT Contrib COMPONENT Contrib + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT ContribDevel) +install(FILES ${P3RPLIGHT_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) From b4a532f1d09178893ebce33b7c79e29635810dd4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 17 Mar 2019 17:14:23 -0600 Subject: [PATCH 611/744] CMake: Add support for building against FCollada --- cmake/modules/FindFCollada.cmake | 80 +++++++++++++++++++++++++++ dtool/Package.cmake | 7 +++ pandatool/CMakeLists.txt | 2 + pandatool/src/daeegg/CMakeLists.txt | 26 +++++++++ pandatool/src/daeprogs/CMakeLists.txt | 11 ++++ pandatool/src/ptloader/CMakeLists.txt | 4 ++ 6 files changed, 130 insertions(+) create mode 100644 cmake/modules/FindFCollada.cmake create mode 100644 pandatool/src/daeegg/CMakeLists.txt create mode 100644 pandatool/src/daeprogs/CMakeLists.txt diff --git a/cmake/modules/FindFCollada.cmake b/cmake/modules/FindFCollada.cmake new file mode 100644 index 0000000000..8db7f1ca00 --- /dev/null +++ b/cmake/modules/FindFCollada.cmake @@ -0,0 +1,80 @@ +# Filename: FindFCollada.cmake +# Author: CFSworks (17 Mar, 2019) +# +# Usage: +# find_package(FCollada [REQUIRED] [QUIET]) +# +# Once done this will define: +# FCOLLADA_FOUND - system has FCollada +# FCOLLADA_INCLUDE_DIR - the FCollada include directory +# +# FCOLLADA_RELEASE_LIBRARY - the filepath of the FCollada release library +# FCOLLADA_DEBUG_LIBRARY - the filepath of the FCollada debug library +# +# FCollada::FCollada - The recommended FCollada library to link against +# + +# Find the FCollada include files +find_path(FCOLLADA_INCLUDE_DIR "FCollada.h" PATH_SUFFIXES "FCollada") + +# Find the library built for release +find_library(FCOLLADA_RELEASE_LIBRARY + NAMES "FCollada" "libFCollada" + "FColladaS" "libFColladaS" + "FColladaU" "libFColladaU" + "FColladaSU" "libFColladaSU" +) + +# Find the library built for debug +find_library(FCOLLADA_DEBUG_LIBRARY + NAMES "FColladaD" "libFColladaD" + "FColladaSD" "libFColladaSD" + "FColladaUD" "libFColladaUD" + "FColladaSUD" "libFColladaSUD" +) + +mark_as_advanced(FCOLLADA_INCLUDE_DIR) +mark_as_advanced(FCOLLADA_RELEASE_LIBRARY) +mark_as_advanced(FCOLLADA_DEBUG_LIBRARY) + +set(_defines) +if(FCOLLADA_RELEASE_LIBRARY MATCHES "FCollada[^/]*U" OR + FCOLLADA_DEBUG_LIBRARY MATCHES "FCollada[^/]*U") + list(APPEND _defines "UNICODE") +endif() +if(NOT MSVC AND + NOT FCOLLADA_RELEASE_LIBRARY MATCHES "FCollada[^/]*S" AND + NOT FCOLLADA_DEBUG_LIBRARY MATCHES "FCollada[^/]*S") + list(APPEND _defines "FCOLLADA_DLL") +endif() + +foreach(_config RELEASE DEBUG) + # Make sure we have lib/includes for this config + if(NOT FCOLLADA_${_config}_LIBRARY OR NOT FCOLLADA_INCLUDE_DIR) + continue() + endif() + + if(NOT _HAS_FCOLLADA_LIBRARY) + set(_HAS_FCOLLADA_LIBRARY ON) + add_library(FCollada::FCollada UNKNOWN IMPORTED GLOBAL) + + set_target_properties(FCollada::FCollada PROPERTIES + INTERFACE_COMPILE_DEFINITIONS "${_defines}" + INTERFACE_INCLUDE_DIRECTORIES "${FCOLLADA_INCLUDE_DIR}") + + endif() + + set_property(TARGET FCollada::FCollada + APPEND PROPERTY IMPORTED_CONFIGURATIONS "${_config}") + + set_target_properties(FCollada::FCollada PROPERTIES + IMPORTED_LOCATION_${_config} "${FCOLLADA_${_config}_LIBRARY}") + +endforeach(_config) +unset(_config) +unset(_defines) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(FCollada DEFAULT_MSG FCOLLADA_INCLUDE_DIR _HAS_FCOLLADA_LIBRARY) + +unset(_HAS_FCOLLADA_LIBRARY) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 04ccedf67e..384fc7254b 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -171,6 +171,13 @@ package_option(ASSIMP "Build pandatool with support for loading 3D assets supported by Assimp.") package_status(ASSIMP "Assimp") +# FCollada +find_package(FCollada QUIET) +package_option(FCOLLADA + "Build pandatool with support for loading Collada files using FCollada." + IMPORTED_AS FCollada::FCollada) +package_status(FCOLLADA "FCollada") + # # ------------ Math libraries ------------ diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 1ecd9f6f58..162ba44e8e 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -6,6 +6,8 @@ endif() add_subdirectory(src/assimp) add_subdirectory(src/bam) add_subdirectory(src/converter) +add_subdirectory(src/daeegg) +add_subdirectory(src/daeprogs) add_subdirectory(src/dxf) add_subdirectory(src/dxfegg) add_subdirectory(src/dxfprogs) diff --git a/pandatool/src/daeegg/CMakeLists.txt b/pandatool/src/daeegg/CMakeLists.txt new file mode 100644 index 0000000000..07b6320d14 --- /dev/null +++ b/pandatool/src/daeegg/CMakeLists.txt @@ -0,0 +1,26 @@ +if(NOT HAVE_EGG OR NOT HAVE_FCOLLADA) + return() +endif() + +set(P3DAEEGG_HEADERS + config_daeegg.h + daeCharacter.h + daeMaterials.h + daeToEggConverter.h + fcollada_utils.h + pre_fcollada_include.h +) + +set(P3DAEEGG_SOURCES + config_daeegg.cxx + daeCharacter.cxx + daeMaterials.cxx + daeToEggConverter.cxx +) + +add_library(p3daeegg STATIC ${P3DAEEGG_HEADERS} ${P3DAEEGG_SOURCES}) +target_link_libraries(p3daeegg p3eggbase + PKG::FCOLLADA) + +# This is only needed for binaries in the pandatool package. It is not useful +# for user applications, so it is not installed. diff --git a/pandatool/src/daeprogs/CMakeLists.txt b/pandatool/src/daeprogs/CMakeLists.txt new file mode 100644 index 0000000000..432fc5ecd2 --- /dev/null +++ b/pandatool/src/daeprogs/CMakeLists.txt @@ -0,0 +1,11 @@ +if(HAVE_EGG AND HAVE_FCOLLADA) + + add_executable(egg2dae eggToDAE.cxx eggToDAE.h) + target_link_libraries(egg2dae p3daeegg p3eggbase p3progbase) + install(TARGETS egg2dae EXPORT Tools COMPONENT Tools DESTINATION bin) + + add_executable(dae2egg daeToEgg.cxx daeToEgg.h) + target_link_libraries(dae2egg p3daeegg p3eggbase p3progbase) + install(TARGETS dae2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + +endif() diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt index c88009a520..83c15713eb 100644 --- a/pandatool/src/ptloader/CMakeLists.txt +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -19,4 +19,8 @@ target_link_libraries(p3ptloader PRIVATE p3dxfegg p3fltegg p3lwoegg p3objegg p3vrmlegg p3xfileegg p3converter) +if(HAVE_FCOLLADA) + target_link_libraries(p3ptloader PRIVATE p3daeegg) +endif() + install(TARGETS p3ptloader EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) From 5c1b525636eba21fc179f54d471feee825b70ea1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 17 Mar 2019 20:16:02 -0600 Subject: [PATCH 612/744] CMake: Minor tweaks to gtk-stats - hyphenate target name - remove dependency on pystub --- pandatool/src/gtk-stats/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index 58ce7e2621..eb376985a9 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -26,16 +26,16 @@ set(GTKSTATS_SOURCES gtkStatsStripChart.cxx ) -composite_sources(gtkstats GTKSTATS_SOURCES) -add_executable(gtkstats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) -target_link_libraries(gtkstats p3progbase p3pstatserver p3pystub PKG::GTK2) +composite_sources(gtk-stats GTKSTATS_SOURCES) +add_executable(gtk-stats ${GTKSTATS_HEADERS} ${GTKSTATS_SOURCES}) +target_link_libraries(gtk-stats p3progbase p3pstatserver PKG::GTK2) -# This program is NOT actually called gtkstats. It's pstats-gtk on Win32 and +# This program is NOT actually called gtk-stats. It's pstats-gtk on Win32 and # pstats everywhere else (as the Win32 GUI is not built). if(WIN32) - set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats-gtk") + set_target_properties(gtk-stats PROPERTIES OUTPUT_NAME "pstats-gtk") else() - set_target_properties(gtkstats PROPERTIES OUTPUT_NAME "pstats") + set_target_properties(gtk-stats PROPERTIES OUTPUT_NAME "pstats") endif() -install(TARGETS gtkstats EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS gtk-stats EXPORT Tools COMPONENT Tools DESTINATION bin) From 8b58b5a6edc0ab8af5b8b2f3b17f34392a7c1e2f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 17 Mar 2019 20:16:12 -0600 Subject: [PATCH 613/744] CMake: Build text-stats and win-stats --- pandatool/CMakeLists.txt | 2 ++ pandatool/src/text-stats/CMakeLists.txt | 19 +++++++++++++ pandatool/src/win-stats/CMakeLists.txt | 37 +++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 pandatool/src/text-stats/CMakeLists.txt create mode 100644 pandatool/src/win-stats/CMakeLists.txt diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index 162ba44e8e..cc1a060a71 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -36,9 +36,11 @@ add_subdirectory(src/pfmprogs) add_subdirectory(src/progbase) add_subdirectory(src/pstatserver) add_subdirectory(src/ptloader) +add_subdirectory(src/text-stats) add_subdirectory(src/vrml) add_subdirectory(src/vrmlegg) add_subdirectory(src/vrmlprogs) +add_subdirectory(src/win-stats) add_subdirectory(src/xfile) add_subdirectory(src/xfileegg) add_subdirectory(src/xfileprogs) diff --git a/pandatool/src/text-stats/CMakeLists.txt b/pandatool/src/text-stats/CMakeLists.txt new file mode 100644 index 0000000000..d5cff0d4fc --- /dev/null +++ b/pandatool/src/text-stats/CMakeLists.txt @@ -0,0 +1,19 @@ +if(NOT HAVE_NET) + return() +endif() + +set(TEXTSTATS_HEADERS + textMonitor.h textMonitor.I + textStats.h +) + +set(TEXTSTATS_SOURCES + textMonitor.cxx + textStats.cxx +) + +composite_sources(text-stats TEXTSTATS_SOURCES) +add_executable(text-stats ${TEXTSTATS_HEADERS} ${TEXTSTATS_SOURCES}) +target_link_libraries(text-stats p3progbase p3pstatserver) + +install(TARGETS text-stats EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/win-stats/CMakeLists.txt b/pandatool/src/win-stats/CMakeLists.txt new file mode 100644 index 0000000000..7c36316fc5 --- /dev/null +++ b/pandatool/src/win-stats/CMakeLists.txt @@ -0,0 +1,37 @@ +if(NOT WIN32 OR NOT HAVE_NET) + return() +endif() + +set(WINSTATS_HEADERS + winStatsChartMenu.h + winStatsGraph.h + winStats.h + winStatsLabel.h + winStatsLabelStack.h + winStatsMenuId.h + winStatsMonitor.h winStatsMonitor.I + winStatsPianoRoll.h + winStatsServer.h + winStatsStripChart.h +) + +set(WINSTATS_SOURCES + winStatsChartMenu.cxx + winStats.cxx + winStatsGraph.cxx + winStatsLabel.cxx + winStatsLabelStack.cxx + winStatsMonitor.cxx + winStatsPianoRoll.cxx + winStatsServer.cxx + winStatsStripChart.cxx +) + +composite_sources(win-stats WINSTATS_SOURCES) +add_executable(win-stats ${WINSTATS_HEADERS} ${WINSTATS_SOURCES}) +target_link_libraries(win-stats p3progbase p3pstatserver) + +# This program is NOT actually called win-stats. It's just pstats.exe +set_target_properties(win-stats PROPERTIES OUTPUT_NAME "pstats") + +install(TARGETS win-stats EXPORT Tools COMPONENT Tools DESTINATION bin) From 2a575bf1d89f04b982c342880b9c0e2c988b7b9a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 18 Mar 2019 00:44:10 -0600 Subject: [PATCH 614/744] CMake: Export pandatool targets under "Tools" --- pandatool/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pandatool/CMakeLists.txt b/pandatool/CMakeLists.txt index cc1a060a71..8f26fb2d9a 100644 --- a/pandatool/CMakeLists.txt +++ b/pandatool/CMakeLists.txt @@ -44,3 +44,5 @@ add_subdirectory(src/win-stats) add_subdirectory(src/xfile) add_subdirectory(src/xfileegg) add_subdirectory(src/xfileprogs) + +export_targets(Tools) From ac16852e3216aa0242ae677eaccd92239dd45076 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 18 Mar 2019 01:35:55 -0600 Subject: [PATCH 615/744] CMake: Generate/install Panda3DConfigVersion.cmake This allows people to do find_package(Panda3D) by version. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 211183d65d..6284c6c6df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -105,4 +105,12 @@ file(COPY "${PROJECT_SOURCE_DIR}/cmake/install/Panda3DConfig.cmake" install(FILES "${PROJECT_SOURCE_DIR}/cmake/install/Panda3DConfig.cmake" DESTINATION "lib/cmake/Panda3D") +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + "${PROJECT_BINARY_DIR}/Panda3DConfigVersion.cmake" + VERSION "${PROJECT_VERSION}" + COMPATIBILITY AnyNewerVersion) +install(FILES "${PROJECT_BINARY_DIR}/Panda3DConfigVersion.cmake" + DESTINATION "lib/cmake/Panda3D") + export(PACKAGE Panda3D) From fbde7c0b626d3086b7b6f0ab576acb857209bfb2 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 18 Mar 2019 02:04:52 -0600 Subject: [PATCH 616/744] CMake: Fix invocation of flex This removes the space between '-o' and the output filename, which apparently some builds of flex (e.g. on Windows) dislike. --- cmake/macros/AddFlexTarget.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmake/macros/AddFlexTarget.cmake b/cmake/macros/AddFlexTarget.cmake index d85d4875c7..9dfd640671 100644 --- a/cmake/macros/AddFlexTarget.cmake +++ b/cmake/macros/AddFlexTarget.cmake @@ -20,12 +20,12 @@ function(add_flex_target output_cxx input_lxx) elseif(arg STREQUAL "PREFIX") set(keyword "PREFIX") elseif(arg STREQUAL "CASE_INSENSITIVE") - list(APPEND arguments -i) + list(APPEND arguments "-i") elseif(keyword STREQUAL "PREFIX") - list(APPEND arguments -P "${arg}") + list(APPEND arguments "-P${arg}") elseif(keyword STREQUAL "DEFINES") - list(APPEND arguments --header-file="${arg}") + list(APPEND arguments "--header-file=${arg}") list(APPEND outputs "${arg}") else() @@ -44,7 +44,7 @@ function(add_flex_target output_cxx input_lxx) add_custom_command( OUTPUT ${outputs} COMMAND ${FLEX_EXECUTABLE} - -o "${output_cxx}" ${arguments} + "-o${output_cxx}" ${arguments} "${input_lxx}" MAIN_DEPENDENCY "${input_lxx}" ) From b3813dfed95e571fe60537c4aa6b124a179cf011 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 13 Apr 2019 17:59:34 -0600 Subject: [PATCH 617/744] CMake: Update for upstream change (threadSafePointerTo deletion) --- panda/src/express/CMakeLists.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 9f179d0752..301baf6f56 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -44,8 +44,6 @@ set(P3EXPRESS_HEADERS subStream.I subStream.h subStreamBuf.h subfileInfo.h subfileInfo.I temporaryFile.h temporaryFile.I - threadSafePointerTo.I threadSafePointerTo.h - threadSafePointerToBase.I threadSafePointerToBase.h trueClock.I trueClock.h typedReferenceCount.I typedReferenceCount.h typedef.h virtualFileList.I virtualFileList.h @@ -100,8 +98,6 @@ set(P3EXPRESS_SOURCES subStream.cxx subStreamBuf.cxx subfileInfo.cxx temporaryFile.cxx - threadSafePointerTo.cxx - threadSafePointerToBase.cxx trueClock.cxx typedReferenceCount.cxx virtualFileComposite.cxx virtualFile.cxx virtualFileList.cxx From 5e82d8e43e60e308019116b902c00b0f326a9a1a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Apr 2019 19:06:11 -0600 Subject: [PATCH 618/744] CMake: Don't find GLES on macOS; headers known broken --- dtool/Package.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 384fc7254b..cf1975b202 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -400,7 +400,9 @@ package_option(GL package_status(GL "OpenGL") # OpenGL ES 1 -find_package(OpenGLES1 QUIET) +if(NOT APPLE) # Apple X11 ships the GLES headers but they're broken + find_package(OpenGLES1 QUIET) +endif() package_option(GLES1 "Enable support for OpenGL ES 1.x rendering APIs." @@ -409,7 +411,9 @@ package_option(GLES1 package_status(GLES1 "OpenGL ES 1.x") # OpenGL ES 2 -find_package(OpenGLES2 QUIET) +if(NOT APPLE) # Apple X11 ships the GLES headers but they're broken + find_package(OpenGLES2 QUIET) +endif() package_option(GLES2 "Enable support for OpenGL ES 2.x rendering APIs." From ed67f98a0558858f2ff934327e37cd020825495e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Apr 2019 20:03:18 -0600 Subject: [PATCH 619/744] CMake: Update some of the cmake/* docs --- cmake/README.md | 11 ++--------- cmake/TODO | 4 ---- 2 files changed, 2 insertions(+), 13 deletions(-) delete mode 100644 cmake/TODO diff --git a/cmake/README.md b/cmake/README.md index a632418ff5..71c2ded070 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -3,17 +3,10 @@ Building with CMake The quickest way to build and install panda with CMake is to run: ```sh -cmake . -make -[sudo] make install -``` - -Instead, it is recommended to create a separate directory to build Panda3D: -```sh -mkdir build -cd build/ +mkdir build && cd build cmake .. make +[sudo] make install ``` To configure CMake, it is recommended to use cmake-gui (`cmake-gui .`), diff --git a/cmake/TODO b/cmake/TODO deleted file mode 100644 index 8a57cd4ea8..0000000000 --- a/cmake/TODO +++ /dev/null @@ -1,4 +0,0 @@ -# List of things which may appear done but actually still need work! -Test Miles Sound System support -Add DirectX support for Nvidia Cg -Finish Config.pp conversion to Config.cmake From 6097d34ead1e88d7753b07e6b21dc670f05f4504 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Apr 2019 22:37:18 -0600 Subject: [PATCH 620/744] CMake: Neatly format everything for readability and consistency --- CMakeLists.txt | 12 +-- cmake/install/Panda3DConfig.cmake | 2 +- cmake/macros/AddBisonTarget.cmake | 6 +- cmake/macros/AddFlexTarget.cmake | 10 +- cmake/macros/BuildMetalib.cmake | 57 +++++++++- cmake/macros/CompositeSources.cmake | 6 +- cmake/macros/Interrogate.cmake | 30 ++++-- cmake/macros/PackageConfig.cmake | 22 ++++ cmake/macros/Python.cmake | 17 +++ cmake/macros/RunPzip.cmake | 2 + cmake/macros/Versioning.cmake | 12 +++ direct/CMakeLists.txt | 4 +- direct/src/dcparser/CMakeLists.txt | 96 ++++++++++------- direct/src/deadrec/CMakeLists.txt | 10 +- direct/src/distributed/CMakeLists.txt | 18 ++-- direct/src/interval/CMakeLists.txt | 68 ++++++------ direct/src/motiontrail/CMakeLists.txt | 10 +- dtool/CompilerFlags.cmake | 11 ++ dtool/LocalSetup.cmake | 5 + dtool/Package.cmake | 35 +++++- dtool/PandaVersion.cmake | 1 + dtool/src/cppparser/CMakeLists.txt | 5 +- dtool/src/dtoolbase/CMakeLists.txt | 131 +++++++++++------------ dtool/src/dtoolutil/CMakeLists.txt | 2 +- dtool/src/interrogate/CMakeLists.txt | 3 +- dtool/src/interrogatedb/CMakeLists.txt | 5 +- dtool/src/prc/CMakeLists.txt | 14 +-- panda/CMakeLists.txt | 13 ++- panda/metalibs/panda/CMakeLists.txt | 11 +- panda/metalibs/pandagl/CMakeLists.txt | 5 + panda/metalibs/pandagles/CMakeLists.txt | 2 + panda/src/audio/CMakeLists.txt | 30 +++--- panda/src/audiotraits/CMakeLists.txt | 42 ++++---- panda/src/bullet/CMakeLists.txt | 6 +- panda/src/char/CMakeLists.txt | 1 + panda/src/cocoadisplay/CMakeLists.txt | 42 ++++---- panda/src/collide/CMakeLists.txt | 12 +-- panda/src/configfiles/CMakeLists.txt | 9 +- panda/src/device/CMakeLists.txt | 2 + panda/src/dgraph/CMakeLists.txt | 1 + panda/src/display/CMakeLists.txt | 13 +-- panda/src/downloadertools/CMakeLists.txt | 16 ++- panda/src/egg/CMakeLists.txt | 9 +- panda/src/event/CMakeLists.txt | 76 ++++++------- panda/src/express/CMakeLists.txt | 28 ++--- panda/src/ffmpeg/CMakeLists.txt | 27 ++--- panda/src/framework/CMakeLists.txt | 25 ++--- panda/src/gles2gsg/CMakeLists.txt | 6 +- panda/src/glesgsg/CMakeLists.txt | 6 +- panda/src/glstuff/CMakeLists.txt | 48 ++++----- panda/src/gobj/CMakeLists.txt | 10 -- panda/src/grutil/CMakeLists.txt | 1 + panda/src/gsgbase/CMakeLists.txt | 10 -- panda/src/linmath/CMakeLists.txt | 11 -- panda/src/mathutil/CMakeLists.txt | 23 ---- panda/src/movies/CMakeLists.txt | 82 +++++++------- panda/src/nativenet/CMakeLists.txt | 48 +++++---- panda/src/net/CMakeLists.txt | 46 ++++---- panda/src/parametrics/CMakeLists.txt | 11 +- panda/src/particlesystem/CMakeLists.txt | 79 +++++++------- panda/src/pgraph/CMakeLists.txt | 12 --- panda/src/pgraphnodes/CMakeLists.txt | 80 +++++++------- panda/src/pgui/CMakeLists.txt | 19 +--- panda/src/physics/CMakeLists.txt | 70 ++++++------ panda/src/pipeline/CMakeLists.txt | 15 +-- panda/src/pnmtext/CMakeLists.txt | 1 + panda/src/pstatclient/CMakeLists.txt | 38 +++---- panda/src/putil/CMakeLists.txt | 58 ---------- panda/src/recorder/CMakeLists.txt | 1 + panda/src/tform/CMakeLists.txt | 1 + panda/src/wgldisplay/CMakeLists.txt | 25 ++--- panda/src/windisplay/CMakeLists.txt | 16 +-- pandatool/src/vrml/CMakeLists.txt | 6 +- pandatool/src/xfile/CMakeLists.txt | 6 +- 74 files changed, 862 insertions(+), 831 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6284c6c6df..7293d84d14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,22 +69,18 @@ endif() if(BUILD_MODELS) # We don't really "build" the models, just pzip them file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" - DESTINATION "${PROJECT_BINARY_DIR}/models/maps" - ) + DESTINATION "${PROJECT_BINARY_DIR}/models/maps") run_pzip(models "${CMAKE_CURRENT_SOURCE_DIR}/models/" "${PROJECT_BINARY_DIR}/models" - *.egg - ) + *.egg) file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" DESTINATION "${PROJECT_BINARY_DIR}/models" - FILES_MATCHING PATTERN *.rgb PATTERN *.png PATTERN *.jpg PATTERN *.wav - ) + FILES_MATCHING PATTERN *.rgb PATTERN *.png PATTERN *.jpg PATTERN *.wav) run_pzip(dmodels "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" "${PROJECT_BINARY_DIR}/models" - *.egg - ) + *.egg) install(DIRECTORY "${PROJECT_BINARY_DIR}/models" COMPONENT Models DESTINATION share/panda3d) endif() diff --git a/cmake/install/Panda3DConfig.cmake b/cmake/install/Panda3DConfig.cmake index 2a7c192926..2514ac9ecb 100644 --- a/cmake/install/Panda3DConfig.cmake +++ b/cmake/install/Panda3DConfig.cmake @@ -109,7 +109,7 @@ # Panda3D::VRPN::p3vrpn if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 3.0) - message(FATAL_ERROR "CMake >= 3.0.2 required") + message(FATAL_ERROR "CMake >= 3.0.2 required") endif() get_filename_component(_panda_config_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH) diff --git a/cmake/macros/AddBisonTarget.cmake b/cmake/macros/AddBisonTarget.cmake index 820f78ab56..0feb2616ee 100644 --- a/cmake/macros/AddBisonTarget.cmake +++ b/cmake/macros/AddBisonTarget.cmake @@ -17,17 +17,20 @@ function(add_bison_target output_cxx input_yxx) foreach(arg ${ARGN}) if(arg STREQUAL "DEFINES") set(keyword "DEFINES") + elseif(arg STREQUAL "PREFIX") set(keyword "PREFIX") elseif(keyword STREQUAL "PREFIX") list(APPEND arguments -p "${arg}") + elseif(keyword STREQUAL "DEFINES") list(APPEND arguments --defines="${arg}") list(APPEND outputs "${arg}") else() message(SEND_ERROR "Unexpected argument ${arg} to add_bison_target") + endif() endforeach() @@ -67,7 +70,6 @@ function(add_bison_target output_cxx input_yxx) add_custom_command( OUTPUT ${outputs} ${commands} - DEPENDS ${depends} - ) + DEPENDS ${depends}) endif() endfunction(add_bison_target) diff --git a/cmake/macros/AddFlexTarget.cmake b/cmake/macros/AddFlexTarget.cmake index 9dfd640671..b24aeb95fc 100644 --- a/cmake/macros/AddFlexTarget.cmake +++ b/cmake/macros/AddFlexTarget.cmake @@ -17,19 +17,23 @@ function(add_flex_target output_cxx input_lxx) foreach(arg ${ARGN}) if(arg STREQUAL "DEFINES") set(keyword "DEFINES") + elseif(arg STREQUAL "PREFIX") set(keyword "PREFIX") + elseif(arg STREQUAL "CASE_INSENSITIVE") list(APPEND arguments "-i") elseif(keyword STREQUAL "PREFIX") list(APPEND arguments "-P${arg}") + elseif(keyword STREQUAL "DEFINES") list(APPEND arguments "--header-file=${arg}") list(APPEND outputs "${arg}") else() message(SEND_ERROR "Unexpected argument ${arg} to add_flex_target") + endif() endforeach() @@ -46,8 +50,7 @@ function(add_flex_target output_cxx input_lxx) COMMAND ${FLEX_EXECUTABLE} "-o${output_cxx}" ${arguments} "${input_lxx}" - MAIN_DEPENDENCY "${input_lxx}" - ) + MAIN_DEPENDENCY "${input_lxx}") else() # Look for prebuilt versions of the outputs. @@ -69,7 +72,6 @@ function(add_flex_target output_cxx input_lxx) add_custom_command( OUTPUT ${outputs} ${commands} - DEPENDS ${depends} - ) + DEPENDS ${depends}) endif() endfunction(add_flex_target) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 4fc483c0ef..7b4c1d8173 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -51,6 +51,7 @@ if(CMAKE_VERSION VERSION_LESS "3.12") set(is_component 0) set(name_of_component "") set(name_of_non_component "${library}") + else() set(is_component "$") @@ -60,17 +61,20 @@ if(CMAKE_VERSION VERSION_LESS "3.12") set(name_of_component "$<${is_component}:$>") set(name_of_non_component "$<$:$>") + endif() # Libraries are only linked transitively if they aren't components. set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${name_of_non_component}") + else() # This is a file path to an out-of-tree library - this needs to be # recorded so that the metalib can link them. (They aren't needed at # all for the object libraries themselves, so they don't have to work # transitively.) set_property(TARGET "${target}" APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${library}") + endif() endforeach(library) @@ -106,9 +110,12 @@ function(add_component_library target_name) if(target_name MATCHES "^p3.*") string(SUBSTRING "${target_name}" 2 -1 name_without_prefix) + else() set(name_without_prefix "${target_name}") + endif() + set(init_func "init_lib${name_without_prefix}") set(init_header "config_${name_without_prefix}.h") @@ -118,23 +125,30 @@ function(add_component_library target_name) if(source STREQUAL "SYMBOL") set(symbol_keyword ON) set(init_keyword 0) + elseif(source STREQUAL "INIT") set(symbol_keyword OFF) set(init_keyword 2) + elseif(source STREQUAL "NOINIT") set(init_func) set(init_header) + elseif(symbol_keyword) set(symbol_keyword OFF) set(symbol "${source}") + elseif(init_keyword EQUAL 2) set(init_func "${source}") set(init_keyword 1) + elseif(init_keyword EQUAL 1) set(init_header "${source}") set(init_keyword 0) + else() list(APPEND sources "${source}") + endif() endforeach() @@ -148,14 +162,17 @@ function(add_component_library target_name) endforeach(source) add_library("${target_name}" OBJECT ${sources}) + else() add_library("${target_name}" ${sources}) + endif() set_target_properties("${target_name}" PROPERTIES IS_COMPONENT ON INIT_FUNCTION "${init_func}" INIT_HEADER "${init_header}") + if(symbol) set_property(TARGET "${target_name}" PROPERTY DEFINE_SYMBOL "${symbol}") @@ -169,13 +186,16 @@ function(add_component_library target_name) INTERFACE_COMPILE_DEFINITIONS "$<$>:${symbol}>") endif() endif() + if(BUILD_METALIBS) # Apparently neither is CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE? - set_property(TARGET "${target_name}" PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}") + set_property(TARGET "${target_name}" PROPERTY + INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}") # If we're building dynamic libraries, the object library needs to be -fPIC if(BUILD_SHARED_LIBS) - set_property(TARGET "${target_name}" PROPERTY POSITION_INDEPENDENT_CODE ON) + set_property(TARGET "${target_name}" PROPERTY + POSITION_INDEPENDENT_CODE ON) endif() endif() @@ -210,47 +230,59 @@ function(add_metalib target_name) set(component_init_headers) set(components) set(sources) + foreach(arg ${ARGN}) if(arg STREQUAL "COMPONENTS") set(components_keyword ON) set(include_keyword OFF) set(init_keyword 0) set(export_keyword 0) + elseif(arg STREQUAL "INCLUDE") set(include_keyword ON) set(components_keyword OFF) set(init_keyword 0) set(export_keyword 0) + elseif(arg STREQUAL "INIT") set(init_keyword 2) set(components_keyword OFF) set(include_keyword OFF) set(export_keyword 0) + elseif(arg STREQUAL "EXPORT") if(NOT init_func) message(FATAL_ERROR "EXPORT cannot be used before INIT") endif() + set(export_keyword 3) set(components_keyword OFF) set(include_keyword OFF) set(init_keyword 0) + elseif(components_keyword) list(APPEND components "${arg}") + elseif(include_keyword) set(component_init_headers "${component_init_headers}#include \"${arg}\"\n") + elseif(init_keyword EQUAL 2) set(init_func "${arg}") set(init_keyword 1) + elseif(init_keyword EQUAL 1) set(init_header "${arg}") set(init_keyword 0) + elseif(export_keyword EQUAL 3) set(_export_type "${arg}") set(export_keyword 2) + elseif(export_keyword EQUAL 2) set(_export_name "${arg}") set(export_keyword 1) + elseif(export_keyword EQUAL 1) set(export_declarations "${export_declarations}\nextern \"C\" IMPORT_CLASS ${_export_type} ${_export_name}();") @@ -259,8 +291,10 @@ function(add_metalib target_name) unset(_export_type) unset(_export_name) set(export_keyword 0) + else() list(APPEND sources "${arg}") + endif() endforeach() @@ -292,6 +326,7 @@ function(add_metalib target_name) set(component_init_headers "${component_init_headers}#include \"${component_init_header}\"\n") endif() + if(component_init_func) set(component_init_funcs "${component_init_funcs} ${component_init_func}();\n") @@ -303,6 +338,7 @@ function(add_metalib target_name) # Private defines: Just reference using a generator expression list(APPEND private_defines "$") + # Interface defines: Copy those, but filter out generator expressions # referencing a component library get_target_property(component_defines "${component}" INTERFACE_COMPILE_DEFINITIONS) @@ -324,12 +360,15 @@ function(add_metalib target_name) foreach(component_include ${component_includes}) if(component_include MATCHES "${component_genex_regex}") # Ignore component references + elseif(component_include MATCHES "^${PROJECT_SOURCE_DIR}") # Include path within project; should only be included when building list(APPEND includes "$") + else() # Anything else gets included list(APPEND includes "${component_include}") + endif() endforeach(component_include) @@ -339,20 +378,26 @@ function(add_metalib target_name) foreach(component_library ${component_libraries}) if(NOT component_library) # NOTFOUND - guess there are no INTERFACE_LINK_LIBRARIES + elseif(component_library MATCHES "${component_genex_regex}") # Ignore component references + elseif(component_library MATCHES ".*(${piped_components}).*") # Component library, ignore + else() # Anything else gets included list(APPEND libs "${component_library}") + endif() endforeach(component_library) # Consume this component's objects list(APPEND sources "$") - else() + + else() # NOT BUILD_METALIBS list(APPEND libs "${component}") + endif() endforeach() @@ -360,10 +405,12 @@ function(add_metalib target_name) set(init_source_path "${CMAKE_CURRENT_BINARY_DIR}/init_${target_name}.cxx") set(init_header_path "${CMAKE_CURRENT_BINARY_DIR}/${init_header}") - configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.cxx.in" "${init_source_path}") + configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.cxx.in" + "${init_source_path}") list(APPEND sources "${init_source_path}") - configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.h.in" "${init_header_path}") + configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.h.in" + "${init_header_path}") install(FILES "${init_header_path}" DESTINATION include/panda3d) endif() diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 3b4c3d9654..1a0b8bbd0d 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -43,9 +43,7 @@ function(composite_sources target sources_var) # Don't composite if in the list of exclusions, and don't bother compositing # with too few sources list (FIND COMPOSITE_SOURCE_EXCLUSIONS ${target} _index) - if(num_sources LESS 2 - OR ${COMPOSITE_SOURCE_LIMIT} LESS 2 - OR ${_index} GREATER -1) + if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2 OR ${_index} GREATER -1) return() endif() @@ -71,7 +69,6 @@ function(composite_sources target sources_var) list(LENGTH composite_sources num_composite_sources) if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT}) - # It's pointless to make a composite source from just one file. if(num_composite_sources GREATER 1) @@ -109,4 +106,5 @@ function(composite_sources target sources_var) # The new files are added to the existing files, which means the old files # are still there, but they won't be compiled due to the HEADER_FILE_ONLY setting. set(${sources_var} ${orig_sources} ${composite_files} PARENT_SCOPE) + endfunction(composite_sources) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 25e53e9cfb..fd94b68e69 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -27,7 +27,8 @@ set(INTERROGATE_EXCLUDE_REGEXES ".*\\.c$" ".*\\.lxx$" ".*\\.yxx$" - ".*_src\\..*") + ".*_src\\..*" +) if(WIN32) list(APPEND IGATE_FLAGS -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32) @@ -57,12 +58,16 @@ function(target_interrogate target) foreach(arg ${ARGN}) if(arg STREQUAL "ALL") set(want_all ON) + elseif(arg STREQUAL "EXTENSIONS") set(extensions_keyword ON) + elseif(extensions_keyword) list(APPEND extensions "${arg}") + else() list(APPEND sources "${arg}") + endif() endforeach() @@ -77,7 +82,6 @@ function(target_interrogate target) # Now let's get everything's absolute path, so that it can be passed # through a property while still preserving the reference. set(absolute_sources) - set(absolute_extensions) foreach(source ${sources}) get_source_file_property(exclude "${source}" WRAP_EXCLUDE) if(NOT exclude) @@ -85,15 +89,17 @@ function(target_interrogate target) list(APPEND absolute_sources ${location}) endif() endforeach(source) + + set(absolute_extensions) foreach(extension ${extensions}) get_source_file_property(location "${extension}" LOCATION) list(APPEND absolute_extensions ${location}) endforeach(extension) - set_target_properties("${target}" PROPERTIES IGATE_SOURCES - "${absolute_sources}") - set_target_properties("${target}" PROPERTIES IGATE_EXTENSIONS - "${absolute_extensions}") + set_target_properties("${target}" PROPERTIES + IGATE_SOURCES "${absolute_sources}") + set_target_properties("${target}" PROPERTIES + IGATE_EXTENSIONS "${absolute_extensions}") # CMake has no property for determining the source directory where the # target was originally added. interrogate_sources makes use of this @@ -227,9 +233,9 @@ function(interrogate_sources target output database language_flags) -S "${PYTHON_INCLUDE_DIRS}" ${include_flags} ${scan_sources} + DEPENDS host_interrogate ${sources} ${extensions} ${nfiles} - COMMENT "Interrogating ${target}" - ) + COMMENT "Interrogating ${target}") # Propagate the target's compile definitions to the output file set_source_files_properties("${output}" PROPERTIES @@ -263,17 +269,22 @@ function(add_python_module module) foreach(arg ${ARGN}) if(arg STREQUAL "LINK" OR arg STREQUAL "IMPORT" OR arg STREQUAL "COMPONENT") set(keyword "${arg}") + elseif(keyword STREQUAL "LINK") list(APPEND link_targets "${arg}") set(keyword) + elseif(keyword STREQUAL "IMPORT") list(APPEND import_flags "-import" "${arg}") set(keyword) + elseif(keyword STREQUAL "COMPONENT") set(component "${arg}") set(keyword) + else() list(APPEND targets "${arg}") + endif() endforeach(arg) @@ -310,8 +321,7 @@ function(add_python_module module) ${INTERROGATE_MODULE_OPTIONS} ${IMOD_FLAGS} ${infiles_rel} DEPENDS host_interrogate_module ${infiles_abs} - COMMENT "Generating module ${module}" - ) + COMMENT "Generating module ${module}") add_python_target(panda3d.${module} COMPONENT "${component}" EXPORT "${component}" "${module}_module.cxx" ${sources_abs} ${extensions}) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 3c200438b1..f3032fc832 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -18,6 +18,7 @@ # [IMPORTED_AS CMake::Imported::Target [...]] # [FOUND_AS find_name] # [LICENSE license]) +# # Examples: # package_option(LIBNAME "Enables LIBNAME support." DEFAULT OFF) # @@ -38,6 +39,7 @@ # Function: package_status # Usage: # package_status(package_name "Package description" ["Config summary"]) +# # Examples: # package_status(OpenAL "OpenAL Audio Output") # package_status(ROCKET "Rocket" "without Python bindings") @@ -127,9 +129,12 @@ function(package_option name) # If the license isn't in the accept listed, don't use the package if(${license_index} EQUAL "-1") set(default OFF) + else() set(default "${${found_as}_FOUND}") + endif() + endif() elseif(IS_MINSIZE_BUILD) @@ -151,9 +156,11 @@ function(package_option name) if(";${_ALL_PACKAGE_OPTIONS};" MATCHES ";${name};") message(SEND_ERROR "package_option(${name}) was called twice. This is a bug in the cmake build scripts.") + else() list(APPEND _ALL_PACKAGE_OPTIONS "${name}") set(_ALL_PACKAGE_OPTIONS "${_ALL_PACKAGE_OPTIONS}" CACHE INTERNAL "Internal variable") + endif() set(PANDA_PACKAGE_DEFAULT_${name} "${default}" PARENT_SCOPE) @@ -205,6 +212,7 @@ function(package_option name) else() set(includes "${${found_as}_INCLUDE_DIR}") endif() + if(${found_as}_LIBRARIES) set(libs ${${found_as}_LIBRARIES}) else() @@ -240,9 +248,11 @@ function(package_status name desc) if(";${_ALL_CONFIG_PACKAGES};" MATCHES ";${name};") message(SEND_ERROR "package_status(${name}) was called twice. This is a bug in the cmake build scripts.") + else() list(APPEND _ALL_CONFIG_PACKAGES "${name}") set(_ALL_CONFIG_PACKAGES "${_ALL_CONFIG_PACKAGES}" CACHE INTERNAL "Internal variable") + endif() set(PANDA_PACKAGE_DESC_${name} "${desc}" PARENT_SCOPE) @@ -265,6 +275,7 @@ function(show_packages) else() message("+ ${desc}") endif() + else() if(NOT ${package}_FOUND) set(reason "not found") @@ -273,7 +284,9 @@ function(show_packages) else() set(reason "disabled") endif() + message("- ${desc} (${reason})") + endif() endforeach() endfunction() @@ -303,8 +316,10 @@ function(export_packages filename) INTERFACE_POSITION_INDEPENDENT_CODE #INTERFACE_SYSTEM_INCLUDE_DIRECTORIES # Let the consumer dictate this INTERFACE_SOURCES) + set(prop_ex "$") string(APPEND exports "$<$: ${prop} \"${prop_ex}\"\n>") + endforeach(prop) # Ugh, INTERFACE_LINK_LIBRARIES isn't transitive. Fine. Take care of it @@ -357,8 +372,10 @@ function(export_packages filename) if(configs MATCHES ".*;.*") set(_bling "$<1:$>") # genex-escaped $ list(APPEND libraries "${_bling}<${_bling}:${imported_location}>") + else() list(APPEND libraries ${imported_location}) + endif() endif() endforeach(config) @@ -377,8 +394,10 @@ function(export_packages filename) elseif("${head}" MATCHES "\\$]+\)>") string(REGEX REPLACE ".*\\$]+\)>.*" "\\1" match "${head}") list(APPEND stack "${match}") + else() list(APPEND libraries "${head}") + endif() endwhile(stack) @@ -444,6 +463,7 @@ macro(find_package name) if(";${ARGN};" MATCHES ";(CONFIG|MODULE|NO_MODULE);") # Caller explicitly asking for a certain mode; so be it. _find_package(${ARGV}) + else() string(TOUPPER "${name}" __pkgname_upper) @@ -452,9 +472,11 @@ macro(find_package name) if(NOT ${name}_FOUND) # CONFIG didn't work, fall back to MODULE _find_package("${name}" MODULE ${ARGN}) + else() # Case-sensitivity set(${__pkgname_upper}_FOUND 1) + endif() endif() endmacro(find_package) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 1492a49e83..ac30965400 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -31,13 +31,17 @@ function(add_python_target target) foreach(arg ${ARGN}) if(arg STREQUAL "COMPONENT") set(keyword "component") + elseif(arg STREQUAL "EXPORT") set(keyword "export") + elseif(keyword) set(${keyword} "${arg}") unset(keyword) + else() list(APPEND sources "${arg}") + endif() endforeach(arg) @@ -57,12 +61,14 @@ function(add_python_target target) if(PYTHON_ARCH_INSTALL_DIR) install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") endif() + else() set_target_properties(${target} PROPERTIES OUTPUT_NAME "${basename}" PREFIX "libpy.${namespace}.") install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION lib) + endif() set(keywords OVERWRITE ARCH) @@ -97,15 +103,20 @@ function(install_python_package path) foreach(arg ${ARGN}) if(arg STREQUAL "ARCH") set(type "ARCH") + elseif(arg STREQUAL "LIB") set(type "LIB") + elseif(arg STREQUAL "COMPONENT") set(component_keyword ON) + elseif(component_keyword) set(component "${arg}") set(component_keyword OFF) + else() message(FATAL_ERROR "install_python_package got unexpected argument: ${ARGN}") + endif() endforeach(arg) @@ -163,12 +174,16 @@ function(ensure_python_init path) foreach(arg ${ARGN}) if(arg STREQUAL "ARCH") set(arch ON) + elseif(arg STREQUAL "ROOT") set(root ON) + elseif(arg STREQUAL "OVERWRITE") set(overwrite ON) + else() message(FATAL_ERROR "ensure_python_init got unexpected argument: ${arg}") + endif() endforeach(arg) @@ -217,6 +232,7 @@ def _fixup_path(): _fixup_path() del _fixup_path ") + endif() if(root AND WIN32 AND NOT CYGWIN) @@ -244,6 +260,7 @@ def _fixup_dlls(): _fixup_dlls() del _fixup_dlls ") + endif() endfunction(ensure_python_init) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index 13225d0fb4..3a4d2e4d0f 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -4,6 +4,7 @@ function(run_pzip target_name source destination glob) file(COPY "${source}" DESTINATION "${destination}" FILES_MATCHING PATTERN "${glob}") + return() endif() @@ -31,4 +32,5 @@ function(run_pzip target_name source destination glob) add_custom_target(${target_name} ALL DEPENDS ${dstfiles} WORKING_DIRECTORY "${destination}") + endfunction(run_pzip) diff --git a/cmake/macros/Versioning.cmake b/cmake/macros/Versioning.cmake index 056667c958..33dbeb87d2 100644 --- a/cmake/macros/Versioning.cmake +++ b/cmake/macros/Versioning.cmake @@ -1,9 +1,21 @@ +# Filename: Versioning.cmake +# +# Description: Contains an override for add_library to set the +# VERSION and SOVERSION properties on all shared libraries, automatically, to +# the project version. +# +# Functions: +# add_library(...) +# + function(add_library target_name) _add_library("${target_name}" ${ARGN}) + get_target_property(type "${target_name}" TYPE) if(type STREQUAL "SHARED_LIBRARY") set_target_properties("${target_name}" PROPERTIES VERSION "${PROJECT_VERSION}" SOVERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") endif() + endfunction(add_library) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 6b549ddbf5..8d1c92329e 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -16,10 +16,12 @@ add_subdirectory(src/showbase) set(P3DIRECT_COMPONENTS p3dcparser p3deadrec - p3interval p3motiontrail p3showbase) + p3interval p3motiontrail p3showbase +) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) endif() + set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "DirectDevel") add_metalib(p3direct INIT init_libdirect direct.h COMPONENTS ${P3DIRECT_COMPONENTS}) unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 416f337d60..0ca5910f2f 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -1,46 +1,62 @@ -add_bison_target(dcParser.cxx dcParser.yxx DEFINES dcParser.h PREFIX dcyy) -add_flex_target(dcLexer.cxx dcLexer.lxx CASE_INSENSITIVE PREFIX dcyy) - set(P3DCPARSER_HEADERS - dcAtomicField.h dcAtomicField.I dcClass.h dcClass.I - dcDeclaration.h - dcField.h dcField.I - dcFile.h dcFile.I - dcKeyword.h dcKeywordList.h - dcLexer.lxx - dcLexerDefs.h dcMolecularField.h dcParser.yxx dcParserDefs.h - dcSubatomicType.h - dcPackData.h dcPackData.I - dcPacker.h dcPacker.I - dcPackerCatalog.h dcPackerCatalog.I - dcPackerInterface.h dcPackerInterface.I - dcParameter.h dcClassParameter.h dcArrayParameter.h - dcSimpleParameter.h dcSwitchParameter.h - dcNumericRange.h dcNumericRange.I - dcSwitch.h - dcTypedef.h - dcPython.h - dcbase.h dcindent.h - dcmsgtypes.h - hashGenerator.h - primeNumberGenerator.h) + dcAtomicField.h dcAtomicField.I + dcClass.h dcClass.I + dcDeclaration.h + dcField.h dcField.I + dcFile.h dcFile.I + dcKeyword.h dcKeywordList.h + dcLexer.lxx dcLexerDefs.h + dcMolecularField.h + dcParser.yxx dcParserDefs.h + dcSubatomicType.h + dcPackData.h dcPackData.I + dcPacker.h dcPacker.I + dcPackerCatalog.h dcPackerCatalog.I + dcPackerInterface.h dcPackerInterface.I + dcParameter.h + dcClassParameter.h + dcArrayParameter.h + dcSimpleParameter.h + dcSwitchParameter.h + dcNumericRange.h dcNumericRange.I + dcSwitch.h + dcTypedef.h + dcPython.h + dcbase.h + dcindent.h + dcmsgtypes.h + hashGenerator.h + primeNumberGenerator.h +) set(P3DCPARSER_SOURCES - dcAtomicField.cxx dcClass.cxx - dcDeclaration.cxx - dcField.cxx dcFile.cxx - dcKeyword.cxx dcKeywordList.cxx - dcMolecularField.cxx dcSubatomicType.cxx - dcPackData.cxx - dcPacker.cxx - dcPackerCatalog.cxx - dcPackerInterface.cxx - dcParameter.cxx dcClassParameter.cxx dcArrayParameter.cxx - dcSimpleParameter.cxx dcSwitchParameter.cxx - dcSwitch.cxx - dcTypedef.cxx - dcindent.cxx - hashGenerator.cxx primeNumberGenerator.cxx) + dcAtomicField.cxx + dcClass.cxx + dcDeclaration.cxx + dcField.cxx + dcFile.cxx + dcKeyword.cxx + dcKeywordList.cxx + dcMolecularField.cxx + dcSubatomicType.cxx + dcPackData.cxx + dcPacker.cxx + dcPackerCatalog.cxx + dcPackerInterface.cxx + dcParameter.cxx + dcClassParameter.cxx + dcArrayParameter.cxx + dcSimpleParameter.cxx + dcSwitchParameter.cxx + dcSwitch.cxx + dcTypedef.cxx + dcindent.cxx + hashGenerator.cxx + primeNumberGenerator.cxx +) + +add_bison_target(dcParser.cxx dcParser.yxx DEFINES dcParser.h PREFIX dcyy) +add_flex_target(dcLexer.cxx dcLexer.lxx CASE_INSENSITIVE PREFIX dcyy) # These cannot be interrogated, and are excluded from the composites. set(P3DCPARSER_PARSER_SOURCES diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 7558db9569..4a9f4ce512 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -1,10 +1,12 @@ set(P3DEADREC_HEADERS - config_deadrec.h - smoothMover.h smoothMover.I) + config_deadrec.h + smoothMover.h smoothMover.I +) set(P3DEADREC_SOURCES - config_deadrec.cxx - smoothMover.cxx) + config_deadrec.cxx + smoothMover.cxx +) add_component_library(p3deadrec SYMBOL BUILDING_DIRECT_DEADREC ${P3DEADREC_HEADERS} ${P3DEADREC_SOURCES}) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 275514cf8c..a5486d56c7 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -3,16 +3,18 @@ if(NOT HAVE_PYTHON) endif() set(P3DISTRIBUTED_HEADERS - config_distributed.h - cConnectionRepository.I - cConnectionRepository.h - cDistributedSmoothNodeBase.I - cDistributedSmoothNodeBase.h) + config_distributed.h + cConnectionRepository.I + cConnectionRepository.h + cDistributedSmoothNodeBase.I + cDistributedSmoothNodeBase.h +) set(P3DISTRIBUTED_SOURCES - config_distributed.cxx - cConnectionRepository.cxx - cDistributedSmoothNodeBase.cxx) + config_distributed.cxx + cConnectionRepository.cxx + cDistributedSmoothNodeBase.cxx +) add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index f8e7187455..bbc9e8bee5 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -1,39 +1,41 @@ set(P3INTERVAL_HEADERS - config_interval.h - cInterval.I cInterval.h - cIntervalManager.I cIntervalManager.h - cConstraintInterval.I cConstraintInterval.h - cConstrainTransformInterval.I cConstrainTransformInterval.h - cConstrainPosInterval.I cConstrainPosInterval.h - cConstrainHprInterval.I cConstrainHprInterval.h - cConstrainPosHprInterval.I cConstrainPosHprInterval.h - cLerpInterval.I cLerpInterval.h - cLerpNodePathInterval.I cLerpNodePathInterval.h - cLerpAnimEffectInterval.I cLerpAnimEffectInterval.h - cMetaInterval.I cMetaInterval.h - hideInterval.I hideInterval.h - lerpblend.h - showInterval.I showInterval.h - waitInterval.I waitInterval.h - lerp_helpers.h) + config_interval.h + cInterval.I cInterval.h + cIntervalManager.I cIntervalManager.h + cConstraintInterval.I cConstraintInterval.h + cConstrainTransformInterval.I cConstrainTransformInterval.h + cConstrainPosInterval.I cConstrainPosInterval.h + cConstrainHprInterval.I cConstrainHprInterval.h + cConstrainPosHprInterval.I cConstrainPosHprInterval.h + cLerpInterval.I cLerpInterval.h + cLerpNodePathInterval.I cLerpNodePathInterval.h + cLerpAnimEffectInterval.I cLerpAnimEffectInterval.h + cMetaInterval.I cMetaInterval.h + hideInterval.I hideInterval.h + lerpblend.h + showInterval.I showInterval.h + waitInterval.I waitInterval.h + lerp_helpers.h +) set(P3INTERVAL_SOURCES - config_interval.cxx - cInterval.cxx - cIntervalManager.cxx - cConstraintInterval.cxx - cConstrainTransformInterval.cxx - cConstrainPosInterval.cxx - cConstrainHprInterval.cxx - cConstrainPosHprInterval.cxx - cLerpInterval.cxx - cLerpNodePathInterval.cxx - cLerpAnimEffectInterval.cxx - cMetaInterval.cxx - hideInterval.cxx - lerpblend.cxx - showInterval.cxx - waitInterval.cxx) + config_interval.cxx + cInterval.cxx + cIntervalManager.cxx + cConstraintInterval.cxx + cConstrainTransformInterval.cxx + cConstrainPosInterval.cxx + cConstrainHprInterval.cxx + cConstrainPosHprInterval.cxx + cLerpInterval.cxx + cLerpNodePathInterval.cxx + cLerpAnimEffectInterval.cxx + cMetaInterval.cxx + hideInterval.cxx + lerpblend.cxx + showInterval.cxx + waitInterval.cxx +) composite_sources(p3interval P3INTERVAL_SOURCES) add_component_library(p3interval SYMBOL BUILDING_DIRECT_INTERVAL diff --git a/direct/src/motiontrail/CMakeLists.txt b/direct/src/motiontrail/CMakeLists.txt index 21d0e04583..dd06fad2af 100644 --- a/direct/src/motiontrail/CMakeLists.txt +++ b/direct/src/motiontrail/CMakeLists.txt @@ -1,10 +1,12 @@ set(P3MOTIONTRAIL_HEADERS - config_motiontrail.h - cMotionTrail.h) + config_motiontrail.h + cMotionTrail.h +) set(P3MOTIONTRAIL_SOURCES - config_motiontrail.cxx - cMotionTrail.cxx) + config_motiontrail.cxx + cMotionTrail.cxx +) add_component_library(p3motiontrail SYMBOL BUILDING_DIRECT_MOTIONTRAIL ${P3MOTIONTRAIL_HEADERS} ${P3MOTIONTRAIL_SOURCES}) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 114c824a0b..2ee0ed02eb 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -17,8 +17,10 @@ if(CMAKE_VERSION VERSION_LESS "3.1") else() string(APPEND CMAKE_CXX_FLAGS " -std=gnu++0x") endif() + else() set(CMAKE_CXX_STANDARD 11) + endif() # Set certain CMake flags we expect @@ -52,10 +54,13 @@ endif() if(MSVC) string(APPEND CMAKE_C_FLAGS " /W3") string(APPEND CMAKE_CXX_FLAGS " /W3") + else() string(APPEND CMAKE_C_FLAGS " -Wall") string(APPEND CMAKE_CXX_FLAGS " -Wall") + endif() + if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") set(disable_flags "-Wno-unused-function -Wno-unused-parameter") string(APPEND CMAKE_C_FLAGS " ${disable_flags}") @@ -71,6 +76,7 @@ if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") endif() endif() + if(WIN32) add_definitions(-D_CRT_SECURE_NO_WARNINGS) endif() @@ -87,16 +93,21 @@ set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") if(MSVC) set(cxx_exceptions_on "/EHsc") set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0") + else() check_cxx_compiler_flag("-fno-exceptions" COMPILER_SUPPORTS_FEXCEPTIONS) if(COMPILER_SUPPORTS_FEXCEPTIONS) set(cxx_exceptions_on "-fexceptions") set(cxx_exceptions_off "-fno-exceptions") + else() set(cxx_exceptions_on) set(cxx_exceptions_off) + endif() + endif() + set(cxx_exceptions_property "$>") add_compile_options( "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index e6d9446015..6f526d98c2 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -95,6 +95,7 @@ if(IS_LINUX) set(HAVE_PROC_SELF_ENVIRON 1) set(HAVE_PROC_SELF_CMDLINE 1) endif() + if(IS_FREEBSD) set(HAVE_PROC_CURPROC_FILE 1) set(HAVE_PROC_CURPROC_MAP 1) @@ -146,10 +147,12 @@ if(BUILD_SHARED_LIBS) set(LINK_ALL_STATIC OFF) set(MODULE_TYPE "MODULE" CACHE INTERNAL "" FORCE) + else() set(LINK_ALL_STATIC ON) set(MODULE_TYPE "STATIC" CACHE INTERNAL "" FORCE) + endif() # Now go through all the packages and report whether we have them. @@ -170,8 +173,10 @@ if(HAVE_THREADS) else() message("Compilation will include nonpipelined threading support.") endif() + else() message("Configuring Panda without threading support.") + endif() message("") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index cf1975b202..4c1966c218 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -12,6 +12,7 @@ if(Python_FOUND) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS}) set(PYTHON_VERSION_STRING ${Python_VERSION}) + else() find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) @@ -23,6 +24,7 @@ else() set(PYTHON_VERSION_STRING ${PYTHONLIBS_VERSION_STRING}) endif() endif() + endif() package_option(PYTHON @@ -36,6 +38,7 @@ if(HAVE_PYTHON) if(WIN32 AND NOT CYGWIN) set(_LIB_DIR ".") set(_ARCH_DIR ".") + elseif(PYTHON_EXECUTABLE) execute_process( COMMAND ${PYTHON_EXECUTABLE} @@ -47,11 +50,12 @@ if(HAVE_PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(True))" OUTPUT_VARIABLE _ARCH_DIR OUTPUT_STRIP_TRAILING_WHITESPACE) + else() set(_LIB_DIR "") set(_ARCH_DIR "") - endif() + endif() execute_process( COMMAND ${PYTHON_EXECUTABLE} @@ -78,6 +82,7 @@ if(HAVE_PYTHON) set(PYTHON_EXTENSION_SUFFIX "${_EXT_SUFFIX}" CACHE STRING "Suffix for Python binary extension modules.") + endif() @@ -119,25 +124,33 @@ package_status(ZLIB "zlib") # JPEG find_package(JPEG QUIET) + package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") + package_status(JPEG "libjpeg") # PNG find_package(PNG QUIET) + package_option(PNG DEFAULT ON "Enable support for loading .png images." IMPORTED_AS PNG::PNG) + package_status(PNG "libpng") # TIFF find_package(TIFF QUIET) + package_option(TIFF "Enable support for loading .tif images.") + package_status(TIFF "libtiff") # OpenEXR find_package(OpenEXR QUIET) + package_option(OPENEXR "Enable support for loading .exr images.") + package_status(OPENEXR "OpenEXR") # libsquish @@ -156,8 +169,10 @@ package_status(SQUISH "libsquish") # libtar find_package(Tar QUIET) + package_option(TAR "This is used to optimize patch generation against tar files.") + package_status(TAR "libtar") @@ -167,15 +182,19 @@ package_status(TAR "libtar") # Assimp find_package(Assimp QUIET) + package_option(ASSIMP "Build pandatool with support for loading 3D assets supported by Assimp.") + package_status(ASSIMP "Assimp") # FCollada find_package(FCollada QUIET) + package_option(FCOLLADA "Build pandatool with support for loading Collada files using FCollada." IMPORTED_AS FCollada::FCollada) + package_status(FCOLLADA "FCollada") @@ -253,16 +272,20 @@ package_status(FFMPEG "FFmpeg" "${ffmpeg_features}") # Vorbis find_package(VorbisFile QUIET) + package_option(VORBIS FOUND_AS VORBISFILE "Enables support for decoding Vorbis-encoded .ogg audio files via libvorbisfile.") + package_status(VORBIS "Vorbis") # Opus find_package(OpusFile QUIET) + package_option(OPUS FOUND_AS OPUSFILE "Enables support for decoding .opus audio files via libopusfile.") + package_status(OPUS "Opus") # @@ -271,31 +294,37 @@ package_status(OPUS "Opus") # Miles Sound System find_package(Miles QUIET) + package_option(RAD_MSS "This enables support for audio output via the Miles Sound System, by RAD Game Tools. This requires a commercial license to use, so you'll know if you need to enable this option." FOUND_AS Miles LICENSE "Miles") + package_status(RAD_MSS "Miles Sound System") # FMOD Ex find_package(FMODEx QUIET) + package_option(FMODEX "This enables support for the FMOD Ex sound library, from Firelight Technologies. This audio library is free for non-commercial use." LICENSE "FMOD") + package_status(FMODEX "FMOD Ex sound library") # OpenAL find_package(OpenAL QUIET) + package_option(OPENAL "This enables support for audio output via OpenAL. Some platforms, such as macOS, provide their own OpenAL implementation, which Panda3D can use. But, on most platforms this will imply OpenAL Soft, which is LGPL licensed." IMPORTED_AS OpenAL::OpenAL LICENSE "LGPL") + package_status(OPENAL "OpenAL sound library") if(OPENAL_FOUND AND APPLE) @@ -335,7 +364,9 @@ package_status(HARFBUZZ "HarfBuzz") 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) + package_option(GTK2) + package_status(GTK2 "gtk+-2") @@ -513,9 +544,11 @@ package_status(OPENCV "OpenCV") # CMake <3.7 doesn't support GREATER_EQUAL, so this uses NOT LESS instead. if(NOT OpenCV_VERSION_MAJOR LESS 3) set(OPENCV_VER_3 ON) + elseif(NOT OpenCV_VERSION_MAJOR LESS 2 AND NOT OpenCV_VERSION_MINOR LESS 3) set(OPENCV_VER_23 ON) + endif() # ARToolKit diff --git a/dtool/PandaVersion.cmake b/dtool/PandaVersion.cmake index a503f150e0..2ca0a3e6e5 100644 --- a/dtool/PandaVersion.cmake +++ b/dtool/PandaVersion.cmake @@ -98,5 +98,6 @@ if(PANDA_OFFICIAL_VERSION) else() set(P3D_PLUGIN_DLL_DOT_VERSION "${P3D_PLUGIN_VERSION}.0") endif() + # The same thing as a comma-delimited quad. string(REPLACE "." "," P3D_PLUGIN_DLL_COMMA_VERSION "${P3D_PLUGIN_DLL_DOT_VERSION}") diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 1b8fe9f1f7..2f865933f1 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -1,5 +1,3 @@ -add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) - set(P3CPPPARSER_HEADERS cppArrayType.h cppBison.yxx cppBisonDefs.h cppClassTemplateParameter.h cppCommentBlock.h @@ -37,8 +35,9 @@ set(P3CPPPARSER_SOURCES cppUsing.cxx cppVisibility.cxx ) -composite_sources(p3cppParser P3CPPPARSER_SOURCES) +add_bison_target(cppBison.cxx cppBison.yxx DEFINES cppBison.h PREFIX cppyy) +composite_sources(p3cppParser P3CPPPARSER_SOURCES) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) target_link_libraries(p3cppParser p3dtool) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index b11869e6e9..4e3c4b94f6 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -10,83 +10,82 @@ if(CMAKE_CXX_STANDARD GREATER 16) endif() set(P3DTOOLBASE_HEADERS - ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h - ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h - addHash.I addHash.h - atomicAdjust.h - atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I - atomicAdjustGccImpl.h atomicAdjustGccImpl.I - atomicAdjustI386Impl.h atomicAdjustI386Impl.I - atomicAdjustPosixImpl.h atomicAdjustPosixImpl.I - atomicAdjustWin32Impl.h atomicAdjustWin32Impl.I - cmath.I cmath.h - deletedBufferChain.h deletedBufferChain.I - deletedChain.h deletedChain.T - dtoolbase.h dtoolbase_cc.h dtoolsymbols.h - dtool_platform.h - fakestringstream.h - indent.I indent.h - memoryBase.h - memoryHook.h memoryHook.I - mutexImpl.h - mutexDummyImpl.h mutexDummyImpl.I - mutexPosixImpl.h mutexPosixImpl.I - mutexWin32Impl.h mutexWin32Impl.I - mutexSpinlockImpl.h mutexSpinlockImpl.I - nearly_zero.h - neverFreeMemory.h neverFreeMemory.I - numeric_types.h - pdtoa.h - pstrtod.h - register_type.I register_type.h - selectThreadImpl.h - stl_compares.I stl_compares.h - typeHandle.I typeHandle.h - typeRegistry.I typeRegistry.h - typeRegistryNode.I typeRegistryNode.h - typedObject.I typedObject.h - pallocator.T pallocator.h - pdeque.h plist.h pmap.h pset.h - pvector.h epvector.h - lookup3.h - version.h + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.h + ${CMAKE_CURRENT_BINARY_DIR}/pandaVersion.h + addHash.I addHash.h + atomicAdjust.h + atomicAdjustDummyImpl.h atomicAdjustDummyImpl.I + atomicAdjustGccImpl.h atomicAdjustGccImpl.I + atomicAdjustI386Impl.h atomicAdjustI386Impl.I + atomicAdjustPosixImpl.h atomicAdjustPosixImpl.I + atomicAdjustWin32Impl.h atomicAdjustWin32Impl.I + cmath.I cmath.h + deletedBufferChain.h deletedBufferChain.I + deletedChain.h deletedChain.T + dtoolbase.h dtoolbase_cc.h dtoolsymbols.h + dtool_platform.h + fakestringstream.h + indent.I indent.h + memoryBase.h + memoryHook.h memoryHook.I + mutexImpl.h + mutexDummyImpl.h mutexDummyImpl.I + mutexPosixImpl.h mutexPosixImpl.I + mutexWin32Impl.h mutexWin32Impl.I + mutexSpinlockImpl.h mutexSpinlockImpl.I + nearly_zero.h + neverFreeMemory.h neverFreeMemory.I + numeric_types.h + pdtoa.h + pstrtod.h + register_type.I register_type.h + selectThreadImpl.h + stl_compares.I stl_compares.h + typeHandle.I typeHandle.h + typeRegistry.I typeRegistry.h + typeRegistryNode.I typeRegistryNode.h + typedObject.I typedObject.h + pallocator.T pallocator.h + pdeque.h plist.h pmap.h pset.h + pvector.h epvector.h + lookup3.h + version.h ) set(P3DTOOLBASE_SOURCES - ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx - addHash.cxx - atomicAdjustDummyImpl.cxx - atomicAdjustI386Impl.cxx - atomicAdjustPosixImpl.cxx - atomicAdjustWin32Impl.cxx - deletedBufferChain.cxx - dtoolbase.cxx - indent.cxx - lookup3.c - memoryBase.cxx - memoryHook.cxx - mutexDummyImpl.cxx - mutexPosixImpl.cxx - mutexWin32Impl.cxx - mutexSpinlockImpl.cxx - neverFreeMemory.cxx - pdtoa.cxx - pstrtod.cxx - register_type.cxx - typeHandle.cxx - typeRegistry.cxx typeRegistryNode.cxx - typedObject.cxx + ${CMAKE_CURRENT_BINARY_DIR}/checkPandaVersion.cxx + addHash.cxx + atomicAdjustDummyImpl.cxx + atomicAdjustI386Impl.cxx + atomicAdjustPosixImpl.cxx + atomicAdjustWin32Impl.cxx + deletedBufferChain.cxx + dtoolbase.cxx + indent.cxx + lookup3.c + memoryBase.cxx + memoryHook.cxx + mutexDummyImpl.cxx + mutexPosixImpl.cxx + mutexWin32Impl.cxx + mutexSpinlockImpl.cxx + neverFreeMemory.cxx + pdtoa.cxx + pstrtod.cxx + register_type.cxx + typeHandle.cxx + typeRegistry.cxx typeRegistryNode.cxx + typedObject.cxx ) set(P3DTOOLBASE_IGATEEXT - typeHandle_ext.cxx - typeHandle_ext.h + typeHandle_ext.cxx + typeHandle_ext.h ) set_source_files_properties(indent.cxx PROPERTIES SKIP_COMPOSITING YES) composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) - add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE ${P3DTOOLBASE_HEADERS} ${P3DTOOLBASE_SOURCES}) # Help other libraries find the autogenerated headers diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 4d0d27b9ac..94d8a9c059 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -30,6 +30,7 @@ set(P3DTOOLUTIL_HEADERS if(APPLE) set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS} filename_assist.mm filename_assist.h) + set_source_files_properties( filename_assist.mm filename_assist.h PROPERTIES WRAP_EXCLUDE YES @@ -70,7 +71,6 @@ set(P3DTOOLUTIL_IGATEEXT ) composite_sources(p3dtoolutil P3DTOOLUTIL_SOURCES) - add_component_library(p3dtoolutil SYMBOL BUILDING_DTOOL_DTOOLUTIL ${P3DTOOLUTIL_HEADERS} ${P3DTOOLUTIL_SOURCES}) target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 4a1fda9e5d..639344d6d4 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -59,7 +59,6 @@ set(INTERROGATE_PREAMBLE_PYTHON_NATIVE ) composite_sources(interrogate INTERROGATE_SOURCES) - add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub PKG::OPENSSL) @@ -93,7 +92,9 @@ endif() if(WANT_INTERROGATE) install(TARGETS interrogate interrogate_module EXPORT Core COMPONENT CoreDevel DESTINATION bin) install(FILES ${INTERROGATE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) + else() set_target_properties(interrogate interrogate_module PROPERTIES EXCLUDE_FROM_ALL ON) + endif() diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 1ff55b73b3..e809111b90 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -34,7 +34,6 @@ set(P3IGATERUNTIME_HEADERS ) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) - add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) target_link_libraries(p3interrogatedb p3prc p3dconfig p3dtool) @@ -68,9 +67,9 @@ add_custom_command( -srcdir "${CMAKE_CURRENT_SOURCE_DIR}" -oc "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx" ${P3INTERROGATEDB_IGATE} + DEPENDS host_interrogate ${P3INTERROGATEDB_IGATE} - COMMENT "Interrogating interrogatedb" -) + COMMENT "Interrogating interrogatedb") add_python_target(panda3d.interrogatedb "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 18ead907d7..0fb97b1e95 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -1,5 +1,3 @@ -configure_file(prc_parameters.h.in prc_parameters.h) - set(P3PRC_HEADERS androidLogStream.h bigEndian.h @@ -33,7 +31,8 @@ set(P3PRC_HEADERS streamReader.I streamReader.h streamWrapper.I streamWrapper.h streamWriter.I streamWriter.h - ${CMAKE_CURRENT_BINARY_DIR}/prc_parameters.h) + ${CMAKE_CURRENT_BINARY_DIR}/prc_parameters.h +) set(P3PRC_SOURCES config_prc.cxx @@ -61,7 +60,10 @@ set(P3PRC_SOURCES notifySeverity.cxx prcKeyRegistry.cxx reversedNumericData.cxx - streamReader.cxx streamWrapper.cxx streamWriter.cxx) + streamReader.cxx streamWrapper.cxx streamWriter.cxx +) + +configure_file(prc_parameters.h.in prc_parameters.h) if(ANDROID) set(P3PRC_SOURCES ${P3PRC_SOURCES} @@ -72,10 +74,10 @@ set(P3PRC_IGATEEXT streamReader_ext.cxx streamReader_ext.h streamWriter_ext.cxx - streamWriter_ext.h) + streamWriter_ext.h +) composite_sources(p3prc P3PRC_SOURCES) - add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC ${P3PRC_HEADERS} ${P3PRC_SOURCES}) target_include_directories(p3prc PUBLIC $) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 962101b8e2..f440327827 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -81,11 +81,12 @@ add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: set(CORE_MODULE_COMPONENTS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort - p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath - p3mathutil p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui - p3pipeline p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform - p3prc p3dtoolutil p3dtoolbase) + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort + p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath + p3mathutil p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui + p3pipeline p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform + p3prc p3dtoolutil p3dtoolbase +) if(WANT_NATIVE_NET) list(APPEND CORE_MODULE_COMPONENTS p3nativenet) @@ -93,9 +94,11 @@ if(WANT_NATIVE_NET) list(APPEND CORE_MODULE_COMPONENTS p3net) endif() endif() + if(HAVE_AUDIO) list(APPEND CORE_MODULE_COMPONENTS p3audio) endif() + if(HAVE_FREETYPE) list(APPEND CORE_MODULE_COMPONENTS p3pnmtext) endif() diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index bb1e96d374..260dc5294c 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,8 +1,9 @@ set(PANDA_LINK_TARGETS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort p3dxml - p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil - p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline - p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform) + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort p3dxml + p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil + p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline + p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform +) if(WANT_NATIVE_NET) list(APPEND PANDA_LINK_TARGETS p3nativenet) @@ -10,9 +11,11 @@ if(WANT_NATIVE_NET) list(APPEND PANDA_LINK_TARGETS p3net) endif() endif() + if(HAVE_AUDIO) list(APPEND PANDA_LINK_TARGETS p3audio) endif() + if(HAVE_FREETYPE) list(APPEND PANDA_LINK_TARGETS p3pnmtext) endif() diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index 176b176ccb..cb627a2e91 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -7,21 +7,26 @@ set(PANDAGL_LINK_TARGETS p3glgsg p3glstuff) if(HAVE_GLX) list(APPEND PANDAGL_LINK_TARGETS p3glxdisplay p3x11display) set(PANDAGL_PIPE_TYPE "glxGraphicsPipe") + elseif(HAVE_WGL) list(APPEND PANDAGL_LINK_TARGETS p3wgldisplay p3windisplay) set(PANDAGL_PIPE_TYPE "wglGraphicsPipe") + elseif(HAVE_COCOA) list(APPEND PANDAGL_LINK_TARGETS p3cocoadisplay) set(PANDAGL_PIPE_TYPE "CocoaGraphicsPipe") set(PANDAGL_PIPE_INCLUDE "cocoaGraphicsPipe.h") + elseif(HAVE_CARBON) list(APPEND PANDAGL_LINK_TARGETS p3osxdisplay) set(PANDAGL_PIPE_TYPE "osxGraphicsPipe") + else() message("") # Add extra line before error message(SEND_ERROR "When compiling with OpenGL (HAVE_GL), at least one of: HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") + endif() if(NOT PANDAGL_PIPE_INCLUDE) diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt index d5155e415b..cdcb6525fd 100644 --- a/panda/metalibs/pandagles/CMakeLists.txt +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -5,9 +5,11 @@ endif() if(ANDROID) set(GLES1_PIPE_TYPE "AndroidGraphicsPipe") set(GLES1_PIPE_INCLUDE "androidGraphicsPipe.h") + else() set(GLES1_PIPE_TYPE "eglGraphicsPipe") set(GLES1_PIPE_INCLUDE "eglGraphicsPipe.h") + endif() set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "GLESDevel") diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index e6de607fc1..d53df64d53 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -3,22 +3,24 @@ if(NOT HAVE_AUDIO) endif() set(P3AUDIO_HEADERS - config_audio.h - filterProperties.h filterProperties.I - audioLoadRequest.h audioLoadRequest.I - audioManager.h audioManager.I - audioSound.h audioSound.I - nullAudioManager.h - nullAudioSound.h) + config_audio.h + filterProperties.h filterProperties.I + audioLoadRequest.h audioLoadRequest.I + audioManager.h audioManager.I + audioSound.h audioSound.I + nullAudioManager.h + nullAudioSound.h +) set(P3AUDIO_SOURCES - config_audio.cxx - filterProperties.cxx - audioLoadRequest.cxx - audioManager.cxx - audioSound.cxx - nullAudioManager.cxx - nullAudioSound.cxx) + config_audio.cxx + filterProperties.cxx + audioLoadRequest.cxx + audioManager.cxx + audioSound.cxx + nullAudioManager.cxx + nullAudioSound.cxx +) composite_sources(p3audio P3AUDIO_SOURCES) add_component_library(p3audio NOINIT SYMBOL BUILDING_PANDA_AUDIO diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index e9539ec511..0990390469 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -7,18 +7,20 @@ endif() if(HAVE_RAD_MSS) set(P3MILES_HEADERS - config_milesAudio.h - milesAudioManager.h - milesAudioSound.I milesAudioSound.h - milesAudioSample.I milesAudioSample.h - milesAudioSequence.I milesAudioSequence.h - milesAudioStream.I milesAudioStream.h - globalMilesManager.I globalMilesManager.h) + config_milesAudio.h + milesAudioManager.h + milesAudioSound.I milesAudioSound.h + milesAudioSample.I milesAudioSample.h + milesAudioSequence.I milesAudioSequence.h + milesAudioStream.I milesAudioStream.h + globalMilesManager.I globalMilesManager.h + ) set(P3MILES_SOURCES - config_milesAudio.cxx milesAudioManager.cxx milesAudioSound.cxx - milesAudioStream.cxx globalMilesManager.cxx milesAudioSample.cxx - milesAudioSequence.cxx) + config_milesAudio.cxx milesAudioManager.cxx milesAudioSound.cxx + milesAudioStream.cxx globalMilesManager.cxx milesAudioSample.cxx + milesAudioSequence.cxx + ) composite_sources(p3miles_audio P3MILES_SOURCES) add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) @@ -37,12 +39,14 @@ endif() if(HAVE_FMODEX) set(P3FMOD_HEADERS - config_fmodAudio.h - fmodAudioManager.h - fmodAudioSound.I fmodAudioSound.h) + config_fmodAudio.h + fmodAudioManager.h + fmodAudioSound.I fmodAudioSound.h + ) set(P3FMOD_SOURCES - config_fmodAudio.cxx fmodAudioManager.cxx fmodAudioSound.cxx) + config_fmodAudio.cxx fmodAudioManager.cxx fmodAudioSound.cxx + ) composite_sources(p3fmod_audio P3FMOD_SOURCES) add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) @@ -61,12 +65,14 @@ endif() if(HAVE_OPENAL) set(P3OPENAL_HEADERS - config_openalAudio.h - openalAudioManager.h - openalAudioSound.I openalAudioSound.h) + config_openalAudio.h + openalAudioManager.h + openalAudioSound.I openalAudioSound.h + ) set(P3OPENAL_SOURCES - config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx) + config_openalAudio.cxx openalAudioManager.cxx openalAudioSound.cxx + ) composite_sources(p3openal_audio P3OPENAL_SOURCES) diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index 8dbf70954d..8d24bd2353 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -53,7 +53,8 @@ set(P3BULLET_HEADERS bulletTriangleMeshShape.I bulletTriangleMeshShape.h bulletVehicle.I bulletVehicle.h bulletWheel.I bulletWheel.h - bulletWorld.I bulletWorld.h) + bulletWorld.I bulletWorld.h +) set(P3BULLET_SOURCES config_bullet.cxx @@ -104,7 +105,8 @@ set(P3BULLET_SOURCES bulletTriangleMeshShape.cxx bulletVehicle.cxx bulletWheel.cxx - bulletWorld.cxx) + bulletWorld.cxx +) composite_sources(p3bullet P3BULLET_SOURCES) add_library(p3bullet ${P3BULLET_SOURCES} ${P3BULLET_HEADERS}) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index c0cce9d6d3..3f8a0cee33 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -8,6 +8,7 @@ set(P3CHAR_HEADERS config_char.h jointVertexTransform.I jointVertexTransform.h ) + set(P3CHAR_SOURCES character.cxx characterJoint.cxx characterJointBundle.cxx diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 775b273c23..6c5058d8a0 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -3,28 +3,30 @@ if(NOT APPLE OR NOT HAVE_GL OR NOT HAVE_COCOA) endif() set(P3COCOADISPLAY_HEADERS - config_cocoadisplay.h - cocoaGraphicsBuffer.h cocoaGraphicsBuffer.I - cocoaGraphicsPipe.h cocoaGraphicsPipe.I - cocoaGraphicsWindow.h cocoaGraphicsWindow.I - cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I - cocoaPandaApp.h - cocoaPandaView.h - cocoaPandaWindow.h - cocoaPandaWindowDelegate.h - cocoaPandaAppDelegate.h) + config_cocoadisplay.h + cocoaGraphicsBuffer.h cocoaGraphicsBuffer.I + cocoaGraphicsPipe.h cocoaGraphicsPipe.I + cocoaGraphicsWindow.h cocoaGraphicsWindow.I + cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I + cocoaPandaApp.h + cocoaPandaView.h + cocoaPandaWindow.h + cocoaPandaWindowDelegate.h + cocoaPandaAppDelegate.h +) set(P3COCOADISPLAY_SOURCES - config_cocoadisplay.mm - cocoaGraphicsBuffer.mm - cocoaGraphicsPipe.mm - cocoaGraphicsStateGuardian.mm - cocoaGraphicsWindow.mm - cocoaPandaApp.mm - cocoaPandaView.mm - cocoaPandaWindow.mm - cocoaPandaWindowDelegate.mm - cocoaPandaAppDelegate.mm) + config_cocoadisplay.mm + cocoaGraphicsBuffer.mm + cocoaGraphicsPipe.mm + cocoaGraphicsStateGuardian.mm + cocoaGraphicsWindow.mm + cocoaPandaApp.mm + cocoaPandaView.mm + cocoaPandaWindow.mm + cocoaPandaWindowDelegate.mm + cocoaPandaAppDelegate.mm +) composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) add_component_library(p3cocoadisplay SYMBOL BUILDING_PANDA_COCOADISPLAY diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 9306e805c6..ec5c30a42a 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -31,6 +31,7 @@ set(P3COLLIDE_HEADERS collisionVisualizer.I collisionVisualizer.h config_collide.h ) + set(P3COLLIDE_SOURCES collisionBox.cxx collisionCapsule.cxx @@ -78,14 +79,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3COLLIDE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_collide - #define LOCAL_LIBS -# p3collide - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - - #define SOURCES -# test_collide.cxx - -#end test_bin_target diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index 84369c32fc..e8b5607ee2 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -2,18 +2,15 @@ set(AUX_DISPLAYS) if(HAVE_GL) - set(AUX_DISPLAYS "${AUX_DISPLAYS} -aux-display pandagl") + set(AUX_DISPLAYS "${AUX_DISPLAYS}\naux-display pandagl") endif() if(HAVE_DX9) - set(AUX_DISPLAYS "${AUX_DISPLAYS} -aux-display pandadx9") + set(AUX_DISPLAYS "${AUX_DISPLAYS}\naux-display pandadx9") endif() if(HAVE_TINYDISPLAY) - set(AUX_DISPLAYS "${AUX_DISPLAYS} -aux-display p3tinydisplay") + set(AUX_DISPLAYS "${AUX_DISPLAYS}\naux-display p3tinydisplay") endif() if(HAVE_RAD_MSS) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 0839ac57df..6cd11e69eb 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -62,9 +62,11 @@ target_interrogate(p3device ALL) if(WIN32) target_link_libraries(p3device Cfgmgr32.lib) + elseif(APPLE) find_library(IOKIT_LIBRARY IOKit) target_link_libraries(p3device ${IOKIT_LIBRARY}) + endif() if(NOT BUILD_METALIBS) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 3231ddf005..d5121948cd 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -4,6 +4,7 @@ set(P3DGRAPH_HEADERS dataNode.I dataNode.h dataNodeTransmit.I dataNodeTransmit.h ) + set(P3DGRAPH_SOURCES config_dgraph.cxx dataGraphTraverser.cxx diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 02d3c657dd..1ae0226d53 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -116,16 +116,5 @@ if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) add_library(p3subprocbuffer subprocessWindowBuffer.h subprocessWindowBuffer.I - subprocessWindowBuffer.cxx - ) + subprocessWindowBuffer.cxx) endif() - -#begin test_bin_target - #define TARGET test_display - #define LOCAL_LIBS \ -# p3display p3putil - - #define SOURCES \ -# test_display.cxx - -#end test_bin_target diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index bd3d3124ed..a306fe7ebb 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -7,35 +7,43 @@ endif() if(HAVE_OPENSSL) add_executable(apply_patch apply_patch.cxx) target_link_libraries(apply_patch panda) + add_executable(build_patch build_patch.cxx) target_link_libraries(build_patch panda) + add_executable(show_ddb show_ddb.cxx) target_link_libraries(show_ddb panda) + add_executable(check_md5 check_md5.cxx) target_link_libraries(check_md5 panda) + add_executable(pencrypt pencrypt.cxx) target_link_libraries(pencrypt panda) + add_executable(pdecrypt pdecrypt.cxx) target_link_libraries(pdecrypt panda) install(TARGETS apply_patch build_patch show_ddb check_md5 pencrypt pdecrypt - EXPORT Tools COMPONENT Tools - DESTINATION bin) + EXPORT Tools COMPONENT Tools + DESTINATION bin) endif() if(HAVE_ZLIB) add_executable(check_adler check_adler.cxx) target_link_libraries(check_adler panda) + add_executable(check_crc check_crc.cxx) target_link_libraries(check_crc panda) + add_executable(pzip pzip.cxx) target_link_libraries(pzip panda) + add_executable(punzip punzip.cxx) target_link_libraries(punzip panda) install(TARGETS check_adler check_crc pzip punzip - EXPORT Tools COMPONENT Tools - DESTINATION bin) + EXPORT Tools COMPONENT Tools + DESTINATION bin) endif() add_executable(multify multify.cxx) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 3636e6100f..29061bb0ba 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -2,9 +2,6 @@ if(NOT HAVE_EGG) return() endif() -add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) -add_flex_target(lexer.cxx lexer.lxx CASE_INSENSITIVE PREFIX eggyy) - set(P3EGG_HEADERS config_egg.h eggAnimData.I eggAnimData.h eggAnimPreload.I eggAnimPreload.h @@ -97,9 +94,9 @@ set(P3EGG_IGATEEXT ) # These cannot be interrogated, and are excluded from the composites. -set(P3EGG_PARSER_SOURCES - parser.cxx - lexer.cxx) +add_bison_target(parser.cxx parser.yxx DEFINES parser.h PREFIX eggyy) +add_flex_target(lexer.cxx lexer.lxx CASE_INSENSITIVE PREFIX eggyy) +set(P3EGG_PARSER_SOURCES parser.cxx lexer.cxx) composite_sources(p3egg P3EGG_SOURCES) add_component_library(p3egg SYMBOL BUILDING_PANDA_EGG diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index ee1982e464..fe58cb9347 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -1,39 +1,39 @@ set(P3EVENT_HEADERS - asyncFuture.h asyncFuture.I - asyncTask.h asyncTask.I - asyncTaskChain.h asyncTaskChain.I - asyncTaskCollection.h asyncTaskCollection.I - asyncTaskManager.h asyncTaskManager.I - asyncTaskPause.h asyncTaskPause.I - asyncTaskSequence.h asyncTaskSequence.I - config_event.h - buttonEvent.I buttonEvent.h - buttonEventList.I buttonEventList.h - genericAsyncTask.h genericAsyncTask.I - pointerEvent.I pointerEvent.h - pointerEventList.I pointerEventList.h - event.I event.h eventHandler.h eventHandler.I - eventParameter.I eventParameter.h - eventQueue.I eventQueue.h eventReceiver.h - pt_Event.h throw_event.I throw_event.h + asyncFuture.h asyncFuture.I + asyncTask.h asyncTask.I + asyncTaskChain.h asyncTaskChain.I + asyncTaskCollection.h asyncTaskCollection.I + asyncTaskManager.h asyncTaskManager.I + asyncTaskPause.h asyncTaskPause.I + asyncTaskSequence.h asyncTaskSequence.I + config_event.h + buttonEvent.I buttonEvent.h + buttonEventList.I buttonEventList.h + genericAsyncTask.h genericAsyncTask.I + pointerEvent.I pointerEvent.h + pointerEventList.I pointerEventList.h + event.I event.h eventHandler.h eventHandler.I + eventParameter.I eventParameter.h + eventQueue.I eventQueue.h eventReceiver.h + pt_Event.h throw_event.I throw_event.h ) set(P3EVENT_SOURCES - asyncFuture.cxx - asyncTask.cxx - asyncTaskChain.cxx - asyncTaskCollection.cxx - asyncTaskManager.cxx - asyncTaskPause.cxx - asyncTaskSequence.cxx - buttonEvent.cxx - buttonEventList.cxx - genericAsyncTask.cxx - pointerEvent.cxx - pointerEventList.cxx - config_event.cxx event.cxx eventHandler.cxx - eventParameter.cxx eventQueue.cxx eventReceiver.cxx - pt_Event.cxx + asyncFuture.cxx + asyncTask.cxx + asyncTaskChain.cxx + asyncTaskCollection.cxx + asyncTaskManager.cxx + asyncTaskPause.cxx + asyncTaskSequence.cxx + buttonEvent.cxx + buttonEventList.cxx + genericAsyncTask.cxx + pointerEvent.cxx + pointerEventList.cxx + config_event.cxx event.cxx eventHandler.cxx + eventParameter.cxx eventQueue.cxx eventReceiver.cxx + pt_Event.cxx ) set(P3EVENT_IGATEEXT @@ -58,15 +58,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3EVENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_task - #define LOCAL_LIBS $[LOCAL_LIBS] p3mathutil - #define OTHER_LIBS \ -# p3interrogatedb:c p3dconfig:c p3dtoolbase:c p3prc:c \ -# p3dtoolutil:c p3dtool:m p3dtoolconfig:m p3pystub - - #define SOURCES \ -# test_task.cxx - -#end test_bin_target diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 301baf6f56..592ad9abe9 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -62,7 +62,8 @@ set(P3EXPRESS_HEADERS weakPointerToVoid.I weakPointerToVoid.h weakReferenceList.I weakReferenceList.h windowsRegistry.h - zStream.I zStream.h zStreamBuf.h) + zStream.I zStream.h zStreamBuf.h +) set(P3EXPRESS_SOURCES buffer.cxx checksumHashGenerator.cxx @@ -112,11 +113,11 @@ set(P3EXPRESS_SOURCES weakPointerToVoid.cxx weakReferenceList.cxx windowsRegistry.cxx - zStream.cxx zStreamBuf.cxx) + zStream.cxx zStreamBuf.cxx +) if(ANDROID) - set(P3EXPRESS_SOURCES ${P3EXPRESS_SOURCES} - virtualFileMountAndroidAsset.cxx) + list(APPEND P3EXPRESS_SOURCES virtualFileMountAndroidAsset.cxx) endif() set(P3EXPRESS_IGATEEXT @@ -129,13 +130,12 @@ set(P3EXPRESS_IGATEEXT virtualFileSystem_ext.cxx virtualFileSystem_ext.h virtualFile_ext.cxx - virtualFile_ext.h) + virtualFile_ext.h +) composite_sources(p3express P3EXPRESS_SOURCES) - add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) - target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool PKG::TAR PKG::ZLIB PKG::OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) @@ -156,17 +156,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3EXPRESS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#add_executable(p3expressTestTypes test_types.cxx) -#target_link_libraries(p3expressTestTypes p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) -#add_test(p3express_test_types p3expressTestTypes) - -#add_executable(p3expressTestOrderedVector test_ordered_vector.cxx) -#target_link_libraries(p3expressTestOrderedVector p3putil p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) -#add_test(p3express_test_ordered_vector p3expressTestOrderedVector) - -if(HAVE_ZLIB) - #add_executable(p3expressTestZstream test_zstream.cxx) - #target_link_libraries(p3expressTestZstream p3express p3dtoolutil p3dtool p3prc p3dtoolconfig p3pystub) - #add_test(p3express_test_zstream p3expressTestZstream) -endif() diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index f832602996..9053f2fe45 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -3,21 +3,22 @@ if(NOT HAVE_FFMPEG) endif() set(P3FFMPEG_HEADERS - config_ffmpeg.h - ffmpegVideo.h ffmpegVideo.I - ffmpegVideoCursor.h ffmpegVideoCursor.I - ffmpegAudio.h ffmpegAudio.I - ffmpegAudioCursor.h ffmpegAudioCursor.I - ffmpegVirtualFile.h ffmpegVirtualFile.I) - + config_ffmpeg.h + ffmpegVideo.h ffmpegVideo.I + ffmpegVideoCursor.h ffmpegVideoCursor.I + ffmpegAudio.h ffmpegAudio.I + ffmpegAudioCursor.h ffmpegAudioCursor.I + ffmpegVirtualFile.h ffmpegVirtualFile.I +) set(P3FFMPEG_SOURCES - config_ffmpeg.cxx - ffmpegVideo.cxx - ffmpegVideoCursor.cxx - ffmpegAudio.cxx - ffmpegAudioCursor.cxx - ffmpegVirtualFile.cxx) + config_ffmpeg.cxx + ffmpegVideo.cxx + ffmpegVideoCursor.cxx + ffmpegAudio.cxx + ffmpegAudioCursor.cxx + ffmpegVirtualFile.cxx +) composite_sources(p3ffmpeg P3FFMPEG_SOURCES) add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 68bf38152c..06d28fdbc4 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -16,33 +16,20 @@ if(NOT BUILD_SHARED_LIBS) # If we're statically linking, we need to explicitly link with # at least one of the available renderers. if(HAVE_GL) - set(P3FRAMEWORK_LINK_TARGETS - ${P3FRAMEWORK_LINK_TARGETS} - pandagl - ) + list(APPEND P3FRAMEWORK_LINK_TARGETS pandagl) elseif(HAVE_DX9) - set(P3FRAMEWORK_LINK_TARGETS - ${P3FRAMEWORK_LINK_TARGETS} - pandadx9 - ) + list(APPEND P3FRAMEWORK_LINK_TARGETS pandadx9) elseif(HAVE_TINYDISPLAY) - set(P3FRAMEWORK_LINK_TARGETS - ${P3FRAMEWORK_LINK_TARGETS} - p3tinydisplay - ) + list(APPEND P3FRAMEWORK_LINK_TARGETS p3tinydisplay) else() - message(WARNING - "No renderer library available to link to p3framework." - ) + message(WARNING "No renderer library available to link to p3framework.") endif() # And we might like to have the p3egg loader available. if(HAVE_EGG) - set(P3FRAMEWORK_LINK_TARGETS - ${P3FRAMEWORK_LINK_TARGETS} - pandaegg - ) + list(APPEND P3FRAMEWORK_LINK_TARGETS pandaegg) endif() + endif() composite_sources(p3framework P3FRAMEWORK_SOURCES) diff --git a/panda/src/gles2gsg/CMakeLists.txt b/panda/src/gles2gsg/CMakeLists.txt index f12dd7be0c..eb9c69df93 100644 --- a/panda/src/gles2gsg/CMakeLists.txt +++ b/panda/src/gles2gsg/CMakeLists.txt @@ -4,11 +4,13 @@ endif() set(P3GLES2GSG_HEADERS config_gles2gsg.h - gles2gsg.h) + gles2gsg.h +) set(P3GLES2GSG_SOURCES config_gles2gsg.cxx - gles2gsg.cxx) + gles2gsg.cxx +) composite_sources(p3gles2gsg P3GLES2GSG_SOURCES) add_component_library(p3gles2gsg SYMBOL BUILDING_PANDAGLES2 diff --git a/panda/src/glesgsg/CMakeLists.txt b/panda/src/glesgsg/CMakeLists.txt index 455da8a0c7..25688084eb 100644 --- a/panda/src/glesgsg/CMakeLists.txt +++ b/panda/src/glesgsg/CMakeLists.txt @@ -4,11 +4,13 @@ endif() set(P3GLESGSG_HEADERS config_glesgsg.h - glesgsg.h) + glesgsg.h +) set(P3GLESGSG_SOURCES config_glesgsg.cxx - glesgsg.cxx) + glesgsg.cxx +) composite_sources(p3glesgsg P3GLESGSG_SOURCES) add_component_library(p3glesgsg SYMBOL BUILDING_PANDAGLES diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index de52d21b07..0700ecb5fa 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -3,30 +3,30 @@ if(NOT HAVE_GL) endif() set(P3GLSTUFF_HEADERS - glGeomContext_src.I - glGeomContext_src.h - glGeomMunger_src.I - glGeomMunger_src.h - glGraphicsStateGuardian_src.I - glGraphicsStateGuardian_src.h - glGraphicsBuffer_src.I - glGraphicsBuffer_src.h - glImmediateModeSender_src.I - glImmediateModeSender_src.h - glIndexBufferContext_src.I - glIndexBufferContext_src.h - glOcclusionQueryContext_src.I - glOcclusionQueryContext_src.h - glShaderContext_src.I - glShaderContext_src.h - glTextureContext_src.I - glTextureContext_src.h - glVertexBufferContext_src.I - glVertexBufferContext_src.h - glmisc_src.h - glstuff_src.h - glstuff_undef_src.h - panda_glext.h + glGeomContext_src.I + glGeomContext_src.h + glGeomMunger_src.I + glGeomMunger_src.h + glGraphicsStateGuardian_src.I + glGraphicsStateGuardian_src.h + glGraphicsBuffer_src.I + glGraphicsBuffer_src.h + glImmediateModeSender_src.I + glImmediateModeSender_src.h + glIndexBufferContext_src.I + glIndexBufferContext_src.h + glOcclusionQueryContext_src.I + glOcclusionQueryContext_src.h + glShaderContext_src.I + glShaderContext_src.h + glTextureContext_src.I + glTextureContext_src.h + glVertexBufferContext_src.I + glVertexBufferContext_src.h + glmisc_src.h + glstuff_src.h + glstuff_undef_src.h + panda_glext.h ) set(P3GLSTUFF_SOURCES diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index ef56c5d6f2..e50b8a3d6c 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -184,13 +184,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3GOBJ_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_gobj - #define LOCAL_LIBS \ -# p3gobj p3putil - - #define SOURCES \ -# test_gobj.cxx - -#end test_bin_target diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index ad8ce53e0f..d6c41ce415 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -17,6 +17,7 @@ set(P3GRUTIL_HEADERS pfmVizzer.I pfmVizzer.h rigidBodyCombiner.I rigidBodyCombiner.h ) + set(P3GRUTIL_SOURCES cardMaker.cxx movieTexture.cxx diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 9b3d31aee0..1bb116196d 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -24,13 +24,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3GSGBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_gsgbase - #define LOCAL_LIBS -# p3gsgbase - - #define SOURCES -# test_gsgbase.cxx - -#end test_bin_target diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index e737f95138..84b4479856 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -60,14 +60,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3LINMATH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_math - #define LOCAL_LIBS \ -# p3linmath - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - - #define SOURCES \ -# test_math.cxx - -#end test_bin_target diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index 2fa0e439f3..bacddece22 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -74,26 +74,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3MATHUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_mathutil - #define LOCAL_LIBS \ -# p3mathutil p3pipeline - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - - #define SOURCES \ -# test_mathutil.cxx - -#end test_bin_target - - -#begin test_bin_target - #define TARGET test_tri - #define LOCAL_LIBS \ -# p3mathutil p3pipeline - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - - #define SOURCES \ -# test_tri.cxx - -#end test_bin_target diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 62af1e46d3..36fce6a74b 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -1,46 +1,48 @@ set(P3MOVIES_HEADERS - dr_flac.h - config_movies.h - flacAudio.h flacAudio.I - flacAudioCursor.h flacAudioCursor.I - inkblotVideo.h inkblotVideo.I - inkblotVideoCursor.h inkblotVideoCursor.I - microphoneAudio.h microphoneAudio.I - movieAudio.h movieAudio.I - movieAudioCursor.h movieAudioCursor.I - movieTypeRegistry.h movieTypeRegistry.I - movieVideo.h movieVideo.I - movieVideoCursor.h movieVideoCursor.I - opusAudio.h opusAudio.I - opusAudioCursor.h opusAudioCursor.I - userDataAudio.h userDataAudio.I - userDataAudioCursor.h userDataAudioCursor.I - vorbisAudio.h vorbisAudio.I - vorbisAudioCursor.h vorbisAudioCursor.I - wavAudio.h wavAudio.I - wavAudioCursor.h wavAudioCursor.I) + dr_flac.h + config_movies.h + flacAudio.h flacAudio.I + flacAudioCursor.h flacAudioCursor.I + inkblotVideo.h inkblotVideo.I + inkblotVideoCursor.h inkblotVideoCursor.I + microphoneAudio.h microphoneAudio.I + movieAudio.h movieAudio.I + movieAudioCursor.h movieAudioCursor.I + movieTypeRegistry.h movieTypeRegistry.I + movieVideo.h movieVideo.I + movieVideoCursor.h movieVideoCursor.I + opusAudio.h opusAudio.I + opusAudioCursor.h opusAudioCursor.I + userDataAudio.h userDataAudio.I + userDataAudioCursor.h userDataAudioCursor.I + vorbisAudio.h vorbisAudio.I + vorbisAudioCursor.h vorbisAudioCursor.I + wavAudio.h wavAudio.I + wavAudioCursor.h wavAudioCursor.I +) set(P3MOVIES_SOURCES - config_movies.cxx - flacAudio.cxx - flacAudioCursor.cxx - inkblotVideo.cxx - inkblotVideoCursor.cxx - microphoneAudio.cxx - microphoneAudioDS.cxx - movieAudio.cxx - movieAudioCursor.cxx - movieTypeRegistry.cxx - movieVideo.cxx - movieVideoCursor.cxx - opusAudio.cxx - opusAudioCursor.cxx - userDataAudio.cxx - userDataAudioCursor.cxx - vorbisAudio.cxx - vorbisAudioCursor.cxx - wavAudio.cxx - wavAudioCursor.cxx) + config_movies.cxx + flacAudio.cxx + flacAudioCursor.cxx + inkblotVideo.cxx + inkblotVideoCursor.cxx + microphoneAudio.cxx + microphoneAudioDS.cxx + movieAudio.cxx + movieAudioCursor.cxx + movieTypeRegistry.cxx + movieVideo.cxx + movieVideoCursor.cxx + opusAudio.cxx + opusAudioCursor.cxx + userDataAudio.cxx + userDataAudioCursor.cxx + vorbisAudio.cxx + vorbisAudioCursor.cxx + wavAudio.cxx + wavAudioCursor.cxx +) composite_sources(p3movies P3MOVIES_SOURCES) add_component_library(p3movies SYMBOL BUILDING_PANDA_MOVIES diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 39d10ca686..b79f453e87 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -3,31 +3,33 @@ if(NOT WANT_NATIVE_NET) endif() set(P3NATIVENET_HEADERS - config_nativenet.h - buffered_datagramconnection.h - buffered_datagramreader.h buffered_datagramreader.I - ringbuffer.h ringbuffer.I socket_ip.h - socket_tcp.h socket_tcp_listen.h socket_tcp_ssl.h - time_accumulator.h time_out.h - socket_address.I socket_address.h - socket_portable.h time_base.h time_span.h buffered_datagramwriter.h - socket_base.h socket_selector.h - socket_udp.h - socket_udp_incoming.h time_clock.h - membuffer.h membuffer.I socket_fdset.h - socket_udp_outgoing.h time_general.h) + config_nativenet.h + buffered_datagramconnection.h + buffered_datagramreader.h buffered_datagramreader.I + ringbuffer.h ringbuffer.I socket_ip.h + socket_tcp.h socket_tcp_listen.h socket_tcp_ssl.h + time_accumulator.h time_out.h + socket_address.I socket_address.h + socket_portable.h time_base.h time_span.h buffered_datagramwriter.h + socket_base.h socket_selector.h + socket_udp.h + socket_udp_incoming.h time_clock.h + membuffer.h membuffer.I socket_fdset.h + socket_udp_outgoing.h time_general.h +) set(P3NATIVENET_SOURCES - config_nativenet.cxx - buffered_datagramconnection.cxx - socket_address.cxx - socket_ip.cxx - socket_tcp.cxx - socket_tcp_listen.cxx - socket_tcp_ssl.cxx - socket_udp.cxx - socket_udp_incoming.cxx - socket_udp_outgoing.cxx) + config_nativenet.cxx + buffered_datagramconnection.cxx + socket_address.cxx + socket_ip.cxx + socket_tcp.cxx + socket_tcp_listen.cxx + socket_tcp_ssl.cxx + socket_udp.cxx + socket_udp_incoming.cxx + socket_udp_outgoing.cxx +) composite_sources(p3nativenet P3NATIVENET_SOURCES) add_component_library(p3nativenet SYMBOL BUILDING_PANDA_NATIVENET diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 98c15c95cb..b8bd67cc36 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -3,30 +3,32 @@ if(NOT HAVE_NET OR NOT WANT_NATIVE_NET) endif() set(P3NET_HEADERS - config_net.h connection.h connectionListener.h - connectionManager.N connectionManager.h - connectionReader.I connectionReader.h - connectionWriter.h datagramQueue.h - datagramTCPHeader.I datagramTCPHeader.h - datagramUDPHeader.I datagramUDPHeader.h - netAddress.h netDatagram.I netDatagram.h - datagramGeneratorNet.I datagramGeneratorNet.h - datagramSinkNet.I datagramSinkNet.h - queuedConnectionListener.I - queuedConnectionListener.h queuedConnectionManager.h - queuedConnectionReader.h recentConnectionReader.h - queuedReturn.h queuedReturn.I) + config_net.h connection.h connectionListener.h + connectionManager.N connectionManager.h + connectionReader.I connectionReader.h + connectionWriter.h datagramQueue.h + datagramTCPHeader.I datagramTCPHeader.h + datagramUDPHeader.I datagramUDPHeader.h + netAddress.h netDatagram.I netDatagram.h + datagramGeneratorNet.I datagramGeneratorNet.h + datagramSinkNet.I datagramSinkNet.h + queuedConnectionListener.I + queuedConnectionListener.h queuedConnectionManager.h + queuedConnectionReader.h recentConnectionReader.h + queuedReturn.h queuedReturn.I +) set(P3NET_SOURCES - config_net.cxx connection.cxx connectionListener.cxx - connectionManager.cxx connectionReader.cxx - connectionWriter.cxx datagramQueue.cxx datagramTCPHeader.cxx - datagramUDPHeader.cxx netAddress.cxx netDatagram.cxx - datagramGeneratorNet.cxx - datagramSinkNet.cxx - queuedConnectionListener.cxx - queuedConnectionManager.cxx queuedConnectionReader.cxx - recentConnectionReader.cxx) + config_net.cxx connection.cxx connectionListener.cxx + connectionManager.cxx connectionReader.cxx + connectionWriter.cxx datagramQueue.cxx datagramTCPHeader.cxx + datagramUDPHeader.cxx netAddress.cxx netDatagram.cxx + datagramGeneratorNet.cxx + datagramSinkNet.cxx + queuedConnectionListener.cxx + queuedConnectionManager.cxx queuedConnectionReader.cxx + recentConnectionReader.cxx +) composite_sources(p3net P3NET_SOURCES) add_component_library(p3net SYMBOL BUILDING_PANDA_NET diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index ab548eed21..5703a7696c 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -16,6 +16,7 @@ set(P3PARAMETRICS_HEADERS ropeNode.I ropeNode.h sheetNode.I sheetNode.h ) + set(P3PARAMETRICS_SOURCES config_parametrics.cxx cubicCurveseg.cxx curveFitter.cxx hermiteCurve.cxx @@ -47,13 +48,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PARAMETRICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_parametrics - #define LOCAL_LIBS -# p3parametrics - - #define SOURCES -# test_parametrics.cxx - -#end test_bin_target diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index a38c7f85b2..5ce2896a5d 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -1,45 +1,48 @@ set(P3PARTICLESYSTEM_HEADERS - baseParticle.I baseParticle.h baseParticleEmitter.I - baseParticleEmitter.h baseParticleFactory.I - baseParticleFactory.h baseParticleRenderer.I - baseParticleRenderer.h arcEmitter.I arcEmitter.h - boxEmitter.I boxEmitter.h - config_particlesystem.h discEmitter.I discEmitter.h - emitters.h - geomParticleRenderer.I geomParticleRenderer.h lineEmitter.I - lineEmitter.h lineParticleRenderer.I lineParticleRenderer.h - particlefactories.h - particles.h - particleSystem.I particleSystem.h particleSystemManager.I - particleSystemManager.h pointEmitter.I pointEmitter.h - pointParticle.h pointParticleFactory.h - pointParticleRenderer.I pointParticleRenderer.h - rectangleEmitter.I rectangleEmitter.h ringEmitter.I - ringEmitter.h sparkleParticleRenderer.I - sparkleParticleRenderer.h sphereSurfaceEmitter.I - sphereSurfaceEmitter.h sphereVolumeEmitter.I - sphereVolumeEmitter.h spriteParticleRenderer.I - spriteParticleRenderer.h tangentRingEmitter.I - tangentRingEmitter.h zSpinParticle.I zSpinParticle.h - zSpinParticleFactory.I zSpinParticleFactory.h - particleCommonFuncs.h colorInterpolationManager.I - colorInterpolationManager.h) + baseParticle.I baseParticle.h baseParticleEmitter.I + baseParticleEmitter.h baseParticleFactory.I + baseParticleFactory.h baseParticleRenderer.I + baseParticleRenderer.h arcEmitter.I arcEmitter.h + boxEmitter.I boxEmitter.h + config_particlesystem.h discEmitter.I discEmitter.h + emitters.h + geomParticleRenderer.I geomParticleRenderer.h lineEmitter.I + lineEmitter.h lineParticleRenderer.I lineParticleRenderer.h + particlefactories.h + particles.h + particleSystem.I particleSystem.h particleSystemManager.I + particleSystemManager.h pointEmitter.I pointEmitter.h + pointParticle.h pointParticleFactory.h + pointParticleRenderer.I pointParticleRenderer.h + rectangleEmitter.I rectangleEmitter.h ringEmitter.I + ringEmitter.h sparkleParticleRenderer.I + sparkleParticleRenderer.h sphereSurfaceEmitter.I + sphereSurfaceEmitter.h sphereVolumeEmitter.I + sphereVolumeEmitter.h spriteParticleRenderer.I + spriteParticleRenderer.h tangentRingEmitter.I + tangentRingEmitter.h zSpinParticle.I zSpinParticle.h + zSpinParticleFactory.I zSpinParticleFactory.h + particleCommonFuncs.h colorInterpolationManager.I + colorInterpolationManager.h +) set(P3PARTICLESYSTEM_SOURCES - baseParticle.cxx baseParticleEmitter.cxx baseParticleFactory.cxx - baseParticleRenderer.cxx boxEmitter.cxx arcEmitter.cxx - config_particlesystem.cxx discEmitter.cxx - geomParticleRenderer.cxx lineEmitter.cxx - lineParticleRenderer.cxx particleSystem.cxx - particleSystemManager.cxx pointEmitter.cxx pointParticle.cxx - pointParticleFactory.cxx pointParticleRenderer.cxx - rectangleEmitter.cxx ringEmitter.cxx - sparkleParticleRenderer.cxx sphereSurfaceEmitter.cxx - sphereVolumeEmitter.cxx spriteParticleRenderer.cxx - tangentRingEmitter.cxx zSpinParticle.cxx - zSpinParticleFactory.cxx colorInterpolationManager.cxx) + baseParticle.cxx baseParticleEmitter.cxx baseParticleFactory.cxx + baseParticleRenderer.cxx boxEmitter.cxx arcEmitter.cxx + config_particlesystem.cxx discEmitter.cxx + geomParticleRenderer.cxx lineEmitter.cxx + lineParticleRenderer.cxx particleSystem.cxx + particleSystemManager.cxx pointEmitter.cxx pointParticle.cxx + pointParticleFactory.cxx pointParticleRenderer.cxx + rectangleEmitter.cxx ringEmitter.cxx + sparkleParticleRenderer.cxx sphereSurfaceEmitter.cxx + sphereVolumeEmitter.cxx spriteParticleRenderer.cxx + tangentRingEmitter.cxx zSpinParticle.cxx + zSpinParticleFactory.cxx colorInterpolationManager.cxx +) -set(P3PARTICLESYSTEM_IGATE_SOURCES "${P3PARTICLESYSTEM_HEADERS};${P3PARTICLESYSTEM_SOURCES}") +set(P3PARTICLESYSTEM_IGATE_SOURCES + ${P3PARTICLESYSTEM_HEADERS} ${P3PARTICLESYSTEM_SOURCES}) list(REMOVE_ITEM P3PARTICLESYSTEM_IGATE_SOURCES "emitters.h") list(REMOVE_ITEM P3PARTICLESYSTEM_IGATE_SOURCES "particlefactories.h") list(REMOVE_ITEM P3PARTICLESYSTEM_IGATE_SOURCES "particles.h") diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 0b6087cb57..013ac69adf 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -234,15 +234,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - - -#begin test_bin_target - #define TARGET test_pgraph - - #define SOURCES - # test_pgraph.cxx - - #define LOCAL_LIBS $[LOCAL_LIBS] p3pgraph - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - -#end test_bin_target diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index ffdab9ec02..6228fcbe5b 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -1,47 +1,47 @@ set(P3PGRAPHNODES_HEADERS - ambientLight.h ambientLight.I - callbackNode.h callbackNode.I - computeNode.h computeNode.I - config_pgraphnodes.h - directionalLight.h directionalLight.I - fadeLodNode.I fadeLodNode.h fadeLodNodeData.h - lightLensNode.h lightLensNode.I - lightNode.h lightNode.I - lodNode.I lodNode.h lodNodeType.h - nodeCullCallbackData.h nodeCullCallbackData.I - pointLight.h pointLight.I - rectangleLight.h rectangleLight.I - sceneGraphAnalyzer.h sceneGraphAnalyzer.I - selectiveChildNode.h selectiveChildNode.I - sequenceNode.h sequenceNode.I - shaderGenerator.h shaderGenerator.I - sphereLight.h sphereLight.I - spotlight.h spotlight.I - switchNode.h switchNode.I - uvScrollNode.I uvScrollNode.h + ambientLight.h ambientLight.I + callbackNode.h callbackNode.I + computeNode.h computeNode.I + config_pgraphnodes.h + directionalLight.h directionalLight.I + fadeLodNode.I fadeLodNode.h fadeLodNodeData.h + lightLensNode.h lightLensNode.I + lightNode.h lightNode.I + lodNode.I lodNode.h lodNodeType.h + nodeCullCallbackData.h nodeCullCallbackData.I + pointLight.h pointLight.I + rectangleLight.h rectangleLight.I + sceneGraphAnalyzer.h sceneGraphAnalyzer.I + selectiveChildNode.h selectiveChildNode.I + sequenceNode.h sequenceNode.I + shaderGenerator.h shaderGenerator.I + sphereLight.h sphereLight.I + spotlight.h spotlight.I + switchNode.h switchNode.I + uvScrollNode.I uvScrollNode.h ) set(P3PGRAPHNODES_SOURCES - ambientLight.cxx - callbackNode.cxx - computeNode.cxx - config_pgraphnodes.cxx - directionalLight.cxx - fadeLodNode.cxx fadeLodNodeData.cxx - lightLensNode.cxx - lightNode.cxx - lodNode.cxx lodNodeType.cxx - nodeCullCallbackData.cxx - pointLight.cxx - rectangleLight.cxx - sceneGraphAnalyzer.cxx - selectiveChildNode.cxx - sequenceNode.cxx - shaderGenerator.cxx - sphereLight.cxx - spotlight.cxx - switchNode.cxx - uvScrollNode.cxx + ambientLight.cxx + callbackNode.cxx + computeNode.cxx + config_pgraphnodes.cxx + directionalLight.cxx + fadeLodNode.cxx fadeLodNodeData.cxx + lightLensNode.cxx + lightNode.cxx + lodNode.cxx lodNodeType.cxx + nodeCullCallbackData.cxx + pointLight.cxx + rectangleLight.cxx + sceneGraphAnalyzer.cxx + selectiveChildNode.cxx + sequenceNode.cxx + shaderGenerator.cxx + sphereLight.cxx + spotlight.cxx + switchNode.cxx + uvScrollNode.cxx ) composite_sources(p3pgraphnodes P3PGRAPHNODES_SOURCES) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 1906ac0124..5bace60210 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -18,6 +18,7 @@ set(P3PGUI_HEADERS pgVirtualFrame.I pgVirtualFrame.h pgWaitBar.I pgWaitBar.h ) + set(P3PGUI_SOURCES config_pgui.cxx pgButton.cxx @@ -53,21 +54,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PGUI_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_pgentry - - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - - #define LOCAL_LIBS \ -# p3framework p3putil p3collide p3pgraph p3chan p3text \ -# p3pnmimage p3pnmimagetypes p3event p3gobj p3display \ -# p3mathutil p3putil p3express p3dgraph p3device p3tform \ -# p3linmath p3pstatclient panda - - #define UNIX_SYS_LIBS m - - #define SOURCES \ -# test_pgentry.cxx - -#end test_bin_target diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 836b4ece01..89cd33cc1e 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -1,40 +1,42 @@ set(P3PHYSICS_HEADERS - actorNode.I actorNode.h angularEulerIntegrator.h angularForce.h - angularIntegrator.h angularVectorForce.I - angularVectorForce.h baseForce.I baseForce.h - baseIntegrator.I baseIntegrator.h config_physics.h - forces.h - forceNode.I forceNode.h - linearControlForce.I linearControlForce.h - linearCylinderVortexForce.I linearCylinderVortexForce.h - linearDistanceForce.I - linearDistanceForce.h linearEulerIntegrator.h linearForce.I - linearForce.h linearFrictionForce.I linearFrictionForce.h - linearIntegrator.h linearJitterForce.h linearNoiseForce.I - linearNoiseForce.h linearRandomForce.I linearRandomForce.h - linearSinkForce.h linearSourceForce.h - linearUserDefinedForce.I linearUserDefinedForce.h - linearVectorForce.I linearVectorForce.h physical.I - physical.h physicalNode.I physicalNode.h - physicsCollisionHandler.I physicsCollisionHandler.h - physicsManager.I physicsManager.h - physicsObject.I physicsObject.h - physicsObjectCollection.I physicsObjectCollection.h) + actorNode.I actorNode.h angularEulerIntegrator.h angularForce.h + angularIntegrator.h angularVectorForce.I + angularVectorForce.h baseForce.I baseForce.h + baseIntegrator.I baseIntegrator.h config_physics.h + forces.h + forceNode.I forceNode.h + linearControlForce.I linearControlForce.h + linearCylinderVortexForce.I linearCylinderVortexForce.h + linearDistanceForce.I + linearDistanceForce.h linearEulerIntegrator.h linearForce.I + linearForce.h linearFrictionForce.I linearFrictionForce.h + linearIntegrator.h linearJitterForce.h linearNoiseForce.I + linearNoiseForce.h linearRandomForce.I linearRandomForce.h + linearSinkForce.h linearSourceForce.h + linearUserDefinedForce.I linearUserDefinedForce.h + linearVectorForce.I linearVectorForce.h physical.I + physical.h physicalNode.I physicalNode.h + physicsCollisionHandler.I physicsCollisionHandler.h + physicsManager.I physicsManager.h + physicsObject.I physicsObject.h + physicsObjectCollection.I physicsObjectCollection.h +) set(P3PHYSICS_SOURCES - actorNode.cxx angularEulerIntegrator.cxx angularForce.cxx - angularIntegrator.cxx angularVectorForce.cxx baseForce.cxx - baseIntegrator.cxx config_physics.cxx forceNode.cxx - linearControlForce.cxx - linearCylinderVortexForce.cxx linearDistanceForce.cxx - linearEulerIntegrator.cxx linearForce.cxx - linearFrictionForce.cxx linearIntegrator.cxx - linearJitterForce.cxx linearNoiseForce.cxx - linearRandomForce.cxx linearSinkForce.cxx - linearSourceForce.cxx linearUserDefinedForce.cxx - linearVectorForce.cxx physical.cxx physicalNode.cxx - physicsCollisionHandler.cxx physicsManager.cxx physicsObject.cxx - physicsObjectCollection.cxx) + actorNode.cxx angularEulerIntegrator.cxx angularForce.cxx + angularIntegrator.cxx angularVectorForce.cxx baseForce.cxx + baseIntegrator.cxx config_physics.cxx forceNode.cxx + linearControlForce.cxx + linearCylinderVortexForce.cxx linearDistanceForce.cxx + linearEulerIntegrator.cxx linearForce.cxx + linearFrictionForce.cxx linearIntegrator.cxx + linearJitterForce.cxx linearNoiseForce.cxx + linearRandomForce.cxx linearSinkForce.cxx + linearSourceForce.cxx linearUserDefinedForce.cxx + linearVectorForce.cxx physical.cxx physicalNode.cxx + physicsCollisionHandler.cxx physicsManager.cxx physicsObject.cxx + physicsObjectCollection.cxx +) composite_sources(p3physics P3PHYSICS_SOURCES) add_component_library(p3physics SYMBOL BUILDING_PANDA_PHYSICS diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index fad48fa244..4f2b7425f1 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -51,7 +51,8 @@ set(P3PIPELINE_HEADERS threadSimpleImpl.h threadSimpleImpl.I threadPosixImpl.h threadPosixImpl.I threadSimpleManager.h threadSimpleManager.I - threadPriority.h) + threadPriority.h +) set(P3PIPELINE_SOURCES contextSwitch.c @@ -100,22 +101,22 @@ set(P3PIPELINE_SOURCES threadPosixImpl.cxx threadSimpleImpl.cxx threadSimpleManager.cxx - threadPriority.cxx) + threadPriority.cxx +) if(WIN32) - set(P3PIPELINE_HEADERS - ${P3PIPELINE_HEADERS} + list(APPEND P3PIPELINE_HEADERS conditionVarWin32Impl.h conditionVarWin32Impl.I threadWin32Impl.h threadWin32Impl.I) - set(P3PIPELINE_SOURCES - ${P3PIPELINE_SOURCES} + list(APPEND P3PIPELINE_SOURCES conditionVarWin32Impl.cxx threadWin32Impl.cxx) endif() set(P3PIPELINE_IGATEEXT pythonThread.cxx - pythonThread.h) + pythonThread.h +) composite_sources(p3pipeline P3PIPELINE_SOURCES) add_component_library(p3pipeline SYMBOL BUILDING_PANDA_PIPELINE diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 37aa70931d..2171b54efc 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -9,6 +9,7 @@ set(P3PNMTEXT_HEADERS pnmTextGlyph.h pnmTextGlyph.I pnmTextMaker.h pnmTextMaker.I ) + set(P3PNMTEXT_SOURCES config_pnmtext.cxx freetypeFace.cxx diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 83a9b7e968..f43cc0cde1 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -1,24 +1,26 @@ set(P3PSTATCLIENT_HEADERS - config_pstatclient.h pStatClient.I pStatClient.h - pStatClientImpl.I pStatClientImpl.h - pStatClientVersion.I - pStatClientVersion.h pStatClientControlMessage.h - pStatCollector.I pStatCollector.h pStatCollectorDef.h - pStatCollectorForward.I pStatCollectorForward.h - pStatFrameData.I pStatFrameData.h pStatProperties.h - pStatServerControlMessage.h pStatThread.I pStatThread.h - pStatTimer.I pStatTimer.h) + config_pstatclient.h pStatClient.I pStatClient.h + pStatClientImpl.I pStatClientImpl.h + pStatClientVersion.I + pStatClientVersion.h pStatClientControlMessage.h + pStatCollector.I pStatCollector.h pStatCollectorDef.h + pStatCollectorForward.I pStatCollectorForward.h + pStatFrameData.I pStatFrameData.h pStatProperties.h + pStatServerControlMessage.h pStatThread.I pStatThread.h + pStatTimer.I pStatTimer.h +) set(P3PSTATCLIENT_SOURCES - config_pstatclient.cxx pStatClient.cxx pStatClientImpl.cxx - pStatClientVersion.cxx - pStatClientControlMessage.cxx - pStatCollector.cxx - pStatCollectorDef.cxx - pStatCollectorForward.cxx - pStatFrameData.cxx pStatProperties.cxx - pStatServerControlMessage.cxx - pStatThread.cxx) + config_pstatclient.cxx pStatClient.cxx pStatClientImpl.cxx + pStatClientVersion.cxx + pStatClientControlMessage.cxx + pStatCollector.cxx + pStatCollectorDef.cxx + pStatCollectorForward.cxx + pStatFrameData.cxx pStatProperties.cxx + pStatServerControlMessage.cxx + pStatThread.cxx +) composite_sources(p3pstatclient P3PSTATCLIENT_SOURCES) add_component_library(p3pstatclient SYMBOL BUILDING_PANDA_PSTATCLIENT diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 6547cac759..3ceb58b7be 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -147,61 +147,3 @@ if(NOT BUILD_METALIBS) endif() install(FILES ${P3PUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) install(FILES config_util.h COMPONENT CoreDevel DESTINATION include/panda3d) - -#begin test_bin_target - #define TARGET test_bamRead - #define LOCAL_LIBS - #p3putil p3pgraph - - #define SOURCES - #test_bam.cxx test_bam.h test_bamRead.cxx - -#end test_bin_target - -#begin test_bin_target - #define TARGET test_bamWrite - #define LOCAL_LIBS - #p3putil p3pgraph - - #define SOURCES - #test_bam.cxx test_bam.h test_bamWrite.cxx - -#end test_bin_target - -#begin test_bin_target - #define TARGET test_filename - - #define SOURCES - #test_filename.cxx - -#end test_bin_target - -#begin test_bin_target - #define TARGET test_uniqueIdAllocator - - #define SOURCES - #uniqueIdAllocator.cxx test_uniqueIdAllocator.cxx - -#end test_bin_target - -#begin test_bin_target - #define TARGET test_glob - - #define SOURCES - #test_glob.cxx - - #define LOCAL_LIBS $[LOCAL_LIBS] p3putil - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - -#end test_bin_target - -#begin test_bin_target - #define TARGET test_linestream - - #define SOURCES - #test_linestream.cxx - - #define LOCAL_LIBS $[LOCAL_LIBS] p3putil - #define OTHER_LIBS $[OTHER_LIBS] p3pystub - -#end test_bin_target diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 5df5b9a5c2..6ee0ca8e4f 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -8,6 +8,7 @@ set(P3RECORDER_HEADERS recorderTable.h recorderTable.I socketStreamRecorder.h socketStreamRecorder.I ) + set(P3RECORDER_SOURCES config_recorder.cxx mouseRecorder.cxx diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index b223a0a1f5..580c7847f1 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -12,6 +12,7 @@ set(P3TFORM_HEADERS trackball.h transform2sg.h ) + set(P3TFORM_SOURCES buttonThrower.cxx config_tform.cxx diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index 8d8b37f8ff..0b08f00a7d 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -3,20 +3,21 @@ if(NOT HAVE_WGL) endif() set(P3WGLDISPLAY_HEADERS - config_wgldisplay.h - wglGraphicsBuffer.I wglGraphicsBuffer.h - wglGraphicsPipe.I wglGraphicsPipe.h - wglGraphicsStateGuardian.I wglGraphicsStateGuardian.h - wglGraphicsWindow.I wglGraphicsWindow.h - wglext.h) + config_wgldisplay.h + wglGraphicsBuffer.I wglGraphicsBuffer.h + wglGraphicsPipe.I wglGraphicsPipe.h + wglGraphicsStateGuardian.I wglGraphicsStateGuardian.h + wglGraphicsWindow.I wglGraphicsWindow.h + wglext.h +) set(P3WGLDISPLAY_SOURCES - config_wgldisplay.cxx - wglGraphicsBuffer.cxx - wglGraphicsPipe.cxx - wglGraphicsStateGuardian.cxx - wglGraphicsWindow.cxx) - + config_wgldisplay.cxx + wglGraphicsBuffer.cxx + wglGraphicsPipe.cxx + wglGraphicsStateGuardian.cxx + wglGraphicsWindow.cxx +) composite_sources(p3wgldisplay P3WGLDISPLAY_SOURCES) add_component_library(p3wgldisplay SYMBOL BUILDING_PANDA_WGLDISPLAY diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index c351b9ee5e..d9025819ff 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -3,15 +3,17 @@ if(NOT WIN32) endif() set(P3WINDISPLAY_HEADERS - config_windisplay.h - winGraphicsPipe.I winGraphicsPipe.h - winGraphicsWindow.I winGraphicsWindow.h - winDetectDx.h) + config_windisplay.h + winGraphicsPipe.I winGraphicsPipe.h + winGraphicsWindow.I winGraphicsWindow.h + winDetectDx.h +) set(P3WINDISPLAY_SOURCES - config_windisplay.cxx winGraphicsPipe.cxx - winGraphicsWindow.cxx - winDetectDx9.cxx) + config_windisplay.cxx winGraphicsPipe.cxx + winGraphicsWindow.cxx + winDetectDx9.cxx +) composite_sources(p3windisplay P3WINDISPLAY_SOURCES) add_component_library(p3windisplay SYMBOL BUILDING_PANDAWIN diff --git a/pandatool/src/vrml/CMakeLists.txt b/pandatool/src/vrml/CMakeLists.txt index 0e0b410659..235ccbff4e 100644 --- a/pandatool/src/vrml/CMakeLists.txt +++ b/pandatool/src/vrml/CMakeLists.txt @@ -1,6 +1,3 @@ -add_bison_target(vrmlParser.cxx vrmlParser.yxx DEFINES vrmlParser.h PREFIX vrmlyy) -add_flex_target(vrmlLexer.cxx vrmlLexer.lxx CASE_INSENSITIVE PREFIX vrmlyy) - set(P3VRML_HEADERS parse_vrml.h standard_nodes.h @@ -22,6 +19,9 @@ set(P3VRML_PARSER_SOURCES vrmlLexer.cxx ) +add_bison_target(vrmlParser.cxx vrmlParser.yxx DEFINES vrmlParser.h PREFIX vrmlyy) +add_flex_target(vrmlLexer.cxx vrmlLexer.lxx CASE_INSENSITIVE PREFIX vrmlyy) + composite_sources(p3vrml P3VRML_SOURCES) add_library(p3vrml STATIC ${P3VRML_HEADERS} ${P3VRML_SOURCES} ${P3VRML_PARSER_SOURCES}) target_link_libraries(p3vrml p3pandatoolbase) diff --git a/pandatool/src/xfile/CMakeLists.txt b/pandatool/src/xfile/CMakeLists.txt index 597cb1eb58..1768ef35ed 100644 --- a/pandatool/src/xfile/CMakeLists.txt +++ b/pandatool/src/xfile/CMakeLists.txt @@ -1,6 +1,3 @@ -add_bison_target(xParser.cxx xParser.yxx DEFINES xParser.h PREFIX xyy) -add_flex_target(xLexer.cxx xLexer.lxx CASE_INSENSITIVE PREFIX xyy) - set(P3XFILE_HEADERS config_xfile.h standard_templates.h @@ -48,6 +45,9 @@ set(P3XFILE_PARSER_SOURCES xLexer.cxx ) +add_bison_target(xParser.cxx xParser.yxx DEFINES xParser.h PREFIX xyy) +add_flex_target(xLexer.cxx xLexer.lxx CASE_INSENSITIVE PREFIX xyy) + composite_sources(p3xfile P3XFILE_SOURCES) add_library(p3xfile STATIC ${P3XFILE_HEADERS} ${P3XFILE_SOURCES} ${P3XFILE_PARSER_SOURCES}) target_link_libraries(p3xfile p3pandatoolbase) From 12036c7ed0a9c60616c37a10bb758b20df151d7f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Apr 2019 22:38:25 -0600 Subject: [PATCH 621/744] CMake: Remove remaining references to HAVE_CARBON --- dtool/Config.cmake | 2 -- dtool/dtool_config.h.in | 1 - panda/metalibs/pandagl/CMakeLists.txt | 6 +----- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 55ee41a2c7..25e0b132fe 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -477,8 +477,6 @@ endif() cmake_dependent_option(HAVE_COCOA "Enable Cocoa. Requires Mac OS X." ON "APPLE" OFF) -cmake_dependent_option(HAVE_CARBON "Enable Carbon. Requires Mac OS X." OFF - "APPLE" OFF) # # Miscellaneous settings diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 3208b29c38..0d9f9e6a06 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -370,7 +370,6 @@ /* Define to compile for Cocoa or Carbon on Mac OS X. */ #cmakedefine HAVE_COCOA -#cmakedefine HAVE_CARBON /* Platform-identifying defines. */ #cmakedefine IS_OSX diff --git a/panda/metalibs/pandagl/CMakeLists.txt b/panda/metalibs/pandagl/CMakeLists.txt index cb627a2e91..f3bd4e8db9 100644 --- a/panda/metalibs/pandagl/CMakeLists.txt +++ b/panda/metalibs/pandagl/CMakeLists.txt @@ -17,15 +17,11 @@ elseif(HAVE_COCOA) set(PANDAGL_PIPE_TYPE "CocoaGraphicsPipe") set(PANDAGL_PIPE_INCLUDE "cocoaGraphicsPipe.h") -elseif(HAVE_CARBON) - list(APPEND PANDAGL_LINK_TARGETS p3osxdisplay) - set(PANDAGL_PIPE_TYPE "osxGraphicsPipe") - else() message("") # Add extra line before error message(SEND_ERROR "When compiling with OpenGL (HAVE_GL), at least one of: - HAVE_WGL, HAVE_COCOA, HAVE_CARBON, or HAVE_GLX must be defined.") + HAVE_WGL, HAVE_COCOA, or HAVE_GLX must be defined.") endif() From b3f5c38ef36a397c8d7ffdfe0bfd5a7a9fb65398 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 14 Apr 2019 22:41:48 -0600 Subject: [PATCH 622/744] CMake: Remove references to "panda3d" from Interrogate --- cmake/macros/Interrogate.cmake | 19 +++++++------------ contrib/CMakeLists.txt | 4 ++-- direct/CMakeLists.txt | 2 +- panda/CMakeLists.txt | 20 ++++++++++++-------- 4 files changed, 22 insertions(+), 23 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index fd94b68e69..414e2b6b8c 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -292,6 +292,8 @@ function(add_python_module module) set(link_targets ${targets}) endif() + string(REGEX REPLACE "^.*\\." "" modname "${module}") + foreach(target ${targets}) get_target_property(workdir_abs "${target}" TARGET_BINDIR) if(NOT workdir_abs) @@ -303,7 +305,7 @@ function(add_python_module module) interrogate_sources(${target} "${workdir_abs}/${target}_igate.cxx" "${workdir_abs}/${target}.in" - "-python-native;-module;panda3d.${module}") + "-python-native;-module;${module}") get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) list(APPEND infiles_rel "${workdir_rel}/${target}.in") @@ -316,16 +318,16 @@ function(add_python_module module) OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" COMMAND host_interrogate_module -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" - -module ${module} -library ${module} + -module ${modname} -library ${modname} ${import_flags} ${INTERROGATE_MODULE_OPTIONS} ${IMOD_FLAGS} ${infiles_rel} DEPENDS host_interrogate_module ${infiles_abs} COMMENT "Generating module ${module}") - add_python_target(panda3d.${module} COMPONENT "${component}" EXPORT "${component}" + add_python_target(${module} COMPONENT "${component}" EXPORT "${component}" "${module}_module.cxx" ${sources_abs} ${extensions}) - target_link_libraries(panda3d.${module} ${link_targets}) + target_link_libraries(${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11") # CMake <3.11 doesn't allow generator expressions on source files, so we @@ -334,7 +336,7 @@ function(add_python_module module) foreach(source ${sources_abs}) get_source_file_property(compile_definitions "${source}" COMPILE_DEFINITIONS) if(compile_definitions) - set_property(TARGET panda3d.${module} APPEND PROPERTY + set_property(TARGET ${module} APPEND PROPERTY COMPILE_DEFINITIONS ${compile_definitions}) set_source_files_properties("${source}" PROPERTIES COMPILE_DEFINITIONS "") @@ -345,10 +347,3 @@ function(add_python_module module) list(APPEND ALL_INTERROGATE_MODULES "${module}") set(ALL_INTERROGATE_MODULES "${ALL_INTERROGATE_MODULES}" CACHE INTERNAL "Internal variable") endfunction(add_python_module) - - -if(INTERROGATE_PYTHON_INTERFACE AND BUILD_SHARED_LIBS) - # The Interrogate path needs to be installed to the architecture-dependent - # Python directory. - install_python_package("${PROJECT_BINARY_DIR}/panda3d" ARCH) -endif() diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 19f8604966..ff5145261e 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -8,10 +8,10 @@ add_subdirectory(src/contribbase) add_subdirectory(src/rplight) if(HAVE_PYTHON) - add_python_module(ai p3ai + add_python_module(panda3d.ai p3ai IMPORT panda3d.core COMPONENT ContribPython) - add_python_module(_rplight p3rplight + add_python_module(panda3d._rplight p3rplight IMPORT panda3d.core COMPONENT ContribPython) endif() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 8d1c92329e..d14abb4d3b 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -37,7 +37,7 @@ install(TARGETS p3direct if(HAVE_PYTHON) # Now for the Python side of everything - add_python_module(direct + add_python_module(panda3d.direct p3dcparser p3deadrec p3distributed p3interval p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core COMPONENT Direct) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index f440327827..55de86dac9 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -103,37 +103,41 @@ if(HAVE_FREETYPE) list(APPEND CORE_MODULE_COMPONENTS p3pnmtext) endif() -if(HAVE_PYTHON) - add_python_module(core ${CORE_MODULE_COMPONENTS} LINK panda) +if(INTERROGATE_PYTHON_INTERFACE) + add_python_module(panda3d.core ${CORE_MODULE_COMPONENTS} LINK panda) + + if(BUILD_SHARED_LIBS) + install_python_package("${PROJECT_BINARY_DIR}/panda3d" ARCH) + endif() if(HAVE_BULLET) - add_python_module(bullet p3bullet IMPORT panda3d.core COMPONENT BulletPython) + add_python_module(panda3d.bullet p3bullet IMPORT panda3d.core COMPONENT BulletPython) export_targets(BulletPython NAMESPACE "Panda3D::Python::" COMPONENT BulletDevel) endif() if(HAVE_EGG) - add_python_module(egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core COMPONENT EggPython) + add_python_module(panda3d.egg p3egg p3egg2pg LINK pandaegg IMPORT panda3d.core COMPONENT EggPython) export_targets(EggPython NAMESPACE "Panda3D::Python::" COMPONENT EggDevel) endif() - add_python_module(physics p3physics p3particlesystem LINK pandaphysics IMPORT panda3d.core) + add_python_module(panda3d.physics p3physics p3particlesystem LINK pandaphysics IMPORT panda3d.core) if(HAVE_ODE) - add_python_module(ode p3ode IMPORT panda3d.core COMPONENT ODEPython) + add_python_module(panda3d.ode p3ode IMPORT panda3d.core COMPONENT ODEPython) export_targets(ODEPython NAMESPACE "Panda3D::Python::" COMPONENT ODEDevel) endif() if(HAVE_OPENCV OR HAVE_ARTOOLKIT) - add_python_module(vision p3vision IMPORT panda3d.core COMPONENT VisionPython) + add_python_module(panda3d.vision p3vision IMPORT panda3d.core COMPONENT VisionPython) export_targets(VisionPython NAMESPACE "Panda3D::Python::" COMPONENT VisionDevel) endif() if(HAVE_VRPN) - add_python_module(vrpn p3vrpn IMPORT panda3d.core COMPONENT VRPNPython) + add_python_module(panda3d.vrpn p3vrpn IMPORT panda3d.core COMPONENT VRPNPython) export_targets(VRPNPython NAMESPACE "Panda3D::Python::" COMPONENT VRPNDevel) endif() From a0f9068da8c78d913863acd3c21d1356d7840add Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Apr 2019 02:27:42 -0600 Subject: [PATCH 623/744] CMake: Some suggestions on how to improve 20_panda.prc - `win-origin -2 -2` - Prefer OpenAL over FMOD in default audio selection - Copy over `model-cache-dir` from makepanda's default prc --- panda/src/configfiles/CMakeLists.txt | 4 ++-- panda/src/configfiles/panda.prc.in | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index e8b5607ee2..7fa2db7a41 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -15,10 +15,10 @@ endif() if(HAVE_RAD_MSS) set(AUDIO_LIBRARY_NAME p3miles_audio) -elseif(HAVE_FMODEX) - set(AUDIO_LIBRARY_NAME p3fmod_audio) elseif(HAVE_OPENAL) set(AUDIO_LIBRARY_NAME p3openal_audio) +elseif(HAVE_FMODEX) + set(AUDIO_LIBRARY_NAME p3fmod_audio) else() set(AUDIO_LIBRARY_NAME none) endif() diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index 3ce806bd72..b18fb20ca2 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -1,12 +1,3 @@ -// -// panda.prc.in -// -// This file defines the script to auto-generate panda.prc at -// CMake time. This is intended to fill in some of the default -// parameters, in particular the default display types. -// - -#output 20_panda.prc notouch #### Generated automatically by CMake ${CMAKE_VERSION} from panda.prc.in. ################################# DO NOT EDIT ########################### @@ -16,6 +7,7 @@ model-path $THIS_PRC_DIR/../share/panda3d/models # Let's set up a default window size of 800x600. The user can # override this in his or her personal prc file. +win-origin -2 -2 win-size 800 600 # Define the display types that have been compiled in. Panda will @@ -42,6 +34,10 @@ audio-library-name ${AUDIO_LIBRARY_NAME} load-file-type egg pandaegg default-model-extension .egg +# Enable the model-cache, but only for models, not textures. +model-cache-dir $XDG_CACHE_HOME/panda3d +model-cache-textures #f + # These entries work very similar to load-file-type, except they are # used by the MovieVideo and MovieAudio code to determine which module From 865d824313d3e9aac09935bcc0e8894c8ab694a1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Apr 2019 17:31:07 -0600 Subject: [PATCH 624/744] CMake: Remove some unused #cmakedefine directives --- dtool/Config.cmake | 3 -- dtool/dtool_config.h.in | 41 --------------------------- dtool/src/dtoolbase/pandaVersion.h.in | 8 ------ panda/src/display/CMakeLists.txt | 10 ------- 4 files changed, 62 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 25e0b132fe..9e14cd31b4 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -237,9 +237,6 @@ mark_as_advanced(DEFAULT_PRC_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS # -option(HAVE_P3D_PLUGIN - "You may define this to build or develop the plugin." OFF) - option(HAVE_P3D_RTDIST "You may define this to build or develop the Panda3D rtdist, the environment packaged up for distribution with the plugin." diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 0d9f9e6a06..8f115c5a69 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -30,18 +30,9 @@ /* Define to use doubles for most numbers, intead of single-precision floats. */ #cmakedefine STDFLOAT_DOUBLE -/* Define if we have Maya available. */ -#cmakedefine HAVE_MAYA - -/* Define if we have libRocket available and built with the Rocket Debugger. */ -#cmakedefine HAVE_ROCKET_DEBUGGER - /* Define if we have built libRocket available and built with Python support. */ #cmakedefine HAVE_ROCKET_PYTHON -/* Define if we have SoftImage available. */ -#cmakedefine HAVE_SOFTIMAGE - /* Define if we have FCollada available. */ #cmakedefine HAVE_FCOLLADA @@ -90,15 +81,9 @@ /* Define if we have libsquish installed. */ #cmakedefine HAVE_SQUISH -/* Define if we have Berkeley DB installed. */ -#cmakedefine HAVE_BDB - /* Define if we have CG installed. */ #cmakedefine HAVE_CG -/* Define for dxerr.h instead of dxerr9.h. */ -#cmakedefine USE_GENERIC_DXERR_LIBRARY - /* Define if we have zlib installed. */ #cmakedefine HAVE_ZLIB @@ -117,12 +102,6 @@ #cmakedefine HAVE_SWSCALE #cmakedefine HAVE_SWRESAMPLE -/* Define if we have GLX installed and want to build for GLX. */ -#cmakedefine HAVE_GLX - -/* Define if we have Windows-GL installed and want to build for Wgl. */ -#cmakedefine HAVE_WGL - /* Define if we have DirectX installed and want to build for DX. */ #cmakedefine HAVE_DX9 @@ -209,11 +188,6 @@ variables that must be visible outside of the prc directory are exported here. */ -/* The filename that specifies the public keys to import into - config. */ -#cmakedefine PRC_PUBLIC_KEYS_FILENAME -#cmakedefine PRC_PUBLIC_KEYS_INCLUDE - /* Define if you want to save the descriptions for ConfigVariables. */ #cmakedefine PRC_SAVE_DESCRIPTIONS @@ -304,9 +278,6 @@ /* Define if you have the header file. */ #cmakedefine PHAVE_LIMITS_H -/* Define if you have the header file. */ -#cmakedefine PHAVE_MINMAX_H - /* Define if you have the header file. */ #cmakedefine PHAVE_SSTREAM @@ -356,21 +327,9 @@ // If we are to build the native net interfaces. #cmakedefine WANT_NATIVE_NET -/* Turn off warnings for using scanf and such */ -#if 0 - #cmakedefine _CRT_SECURE_NO_WARNINGS - #pragma warning( disable : 4996 4275 4267 4099 4049 4013 4005 ) -#endif - /* Static linkage instead of the normal dynamic linkage? */ #cmakedefine LINK_ALL_STATIC -/* Define to compile the plugin code. */ -#cmakedefine HAVE_P3D_PLUGIN - -/* Define to compile for Cocoa or Carbon on Mac OS X. */ -#cmakedefine HAVE_COCOA - /* Platform-identifying defines. */ #cmakedefine IS_OSX #cmakedefine IS_LINUX diff --git a/dtool/src/dtoolbase/pandaVersion.h.in b/dtool/src/dtoolbase/pandaVersion.h.in index 3e93349dca..ecaed20cd7 100644 --- a/dtool/src/dtoolbase/pandaVersion.h.in +++ b/dtool/src/dtoolbase/pandaVersion.h.in @@ -71,11 +71,3 @@ distributable package may be downloaded, or empty string if there is no associated package. */ #define PANDA_PACKAGE_HOST_URL "@PANDA_PACKAGE_HOST_URL@" - -#if HAVE_P3D_PLUGIN -/* Similar definitions for the plugin versioning, if in use. */ -#define P3D_PLUGIN_MAJOR_VERSION @P3D_PLUGIN_MAJOR_VERSION@ -#define P3D_PLUGIN_MINOR_VERSION @P3D_PLUGIN_MINOR_VERSION@ -#define P3D_PLUGIN_SEQUENCE_VERSION @P3D_PLUGIN_SEQUENCE_VERSION@ -#define P3D_COREAPI_VERSION_STR "@P3D_COREAPI_VERSION_STR@" -#endif diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 1ae0226d53..fa4a218c4f 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -108,13 +108,3 @@ if(NOT BUILD_METALIBS) ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DISPLAY_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - -if(OSX_PLATFORM AND HAVE_P3D_PLUGIN) - # We build a static library of just these files, so the plugin can - # link with it in direct/src/plugin, without pulling in the rest of - # Panda. - add_library(p3subprocbuffer - subprocessWindowBuffer.h - subprocessWindowBuffer.I - subprocessWindowBuffer.cxx) -endif() From b8f3c7eb63160a607e93e0bd4cf826cfdc585b93 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 15 Apr 2019 18:40:35 -0600 Subject: [PATCH 625/744] CMake: Move some symbols from dtool_config.h to -D flags The symbols moved aren't used in any headers, so they don't have to be in the installed dtool_config.h. Removing them keeps the recompiling to a minimum when an optional feature is toggled. --- dtool/dtool_config.h.in | 79 --------------------------- dtool/src/dtoolutil/CMakeLists.txt | 32 +++++++++++ panda/src/express/CMakeLists.txt | 8 +++ panda/src/ffmpeg/CMakeLists.txt | 8 +++ panda/src/framework/CMakeLists.txt | 13 +++++ panda/src/gobj/CMakeLists.txt | 8 +++ panda/src/mathutil/CMakeLists.txt | 7 ++- panda/src/pipeline/CMakeLists.txt | 8 +++ panda/src/text/CMakeLists.txt | 4 ++ panda/src/vision/CMakeLists.txt | 4 ++ panda/src/windisplay/CMakeLists.txt | 4 ++ pandatool/src/bam/CMakeLists.txt | 4 ++ pandatool/src/progbase/CMakeLists.txt | 4 ++ pandatool/src/ptloader/CMakeLists.txt | 1 + 14 files changed, 104 insertions(+), 80 deletions(-) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index 8f115c5a69..b05d4c5b53 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -21,9 +21,6 @@ /* Define if we have Freetype 2.0 or better available. */ #cmakedefine HAVE_FREETYPE -/* Define if we have HarfBuzz available. */ -#cmakedefine HAVE_HARFBUZZ - /* Define if we want to compile in a default font. */ #cmakedefine COMPILE_IN_DEFAULT_FONT @@ -33,9 +30,6 @@ /* Define if we have built libRocket available and built with Python support. */ #cmakedefine HAVE_ROCKET_PYTHON -/* Define if we have FCollada available. */ -#cmakedefine HAVE_FCOLLADA - /* Define if we have ARToolKit available. */ #cmakedefine HAVE_ARTOOLKIT @@ -47,7 +41,6 @@ /* Define if we have OpenSSL installed. */ #cmakedefine HAVE_OPENSSL -#cmakedefine REPORT_OPENSSL_ERRORS /* Define if we have libjpeg installed. */ #cmakedefine HAVE_JPEG @@ -75,12 +68,6 @@ /* Define if we have libtar installed. */ #cmakedefine HAVE_TAR -/* Define if we have libfftw3 installed. */ -#cmakedefine HAVE_FFTW - -/* Define if we have libsquish installed. */ -#cmakedefine HAVE_SQUISH - /* Define if we have CG installed. */ #cmakedefine HAVE_CG @@ -88,30 +75,16 @@ #cmakedefine HAVE_ZLIB /* Define if we have OpenGL installed and want to build for GL. */ -#cmakedefine HAVE_GL -#ifdef HAVE_GL #cmakedefine MIN_GL_VERSION_MAJOR #cmakedefine MIN_GL_VERSION_MINOR -#endif /* Define if we have OpenCV installed and want to build for OpenCV. */ #cmakedefine HAVE_OPENCV -/* Define if we have FFMPEG installed and want to build for FFMPEG. */ -#cmakedefine HAVE_FFMPEG -#cmakedefine HAVE_SWSCALE -#cmakedefine HAVE_SWRESAMPLE - -/* Define if we have DirectX installed and want to build for DX. */ -#cmakedefine HAVE_DX9 - /* The choice of generic vs. the specific dxerr library largely depends on which SDK you have installed. */ #cmakedefine USE_GENERIC_DXERR_LIBRARY -/* Define if we want to build tinydisplay. */ -#cmakedefine HAVE_TINYDISPLAY - /* Define if we have the SDL library. */ #cmakedefine HAVE_SDL @@ -124,10 +97,6 @@ /* Define if we want to use fast, user-space simulated threads. */ #cmakedefine SIMPLE_THREADS -/* Define if SIMPLE_THREADS should be implemented with the OS-provided - threading layer (if available). */ -#cmakedefine OS_SIMPLE_THREADS - /* Define to enable deadlock detection, mutex recursion checks, etc. */ #cmakedefine DEBUG_THREADS @@ -140,9 +109,6 @@ /* Define if we want to compile the net code. */ #cmakedefine HAVE_NET -/* Define if we want to compile the egg code. */ -#cmakedefine HAVE_EGG - /* Define if we want to compile the audio code. */ #cmakedefine HAVE_AUDIO @@ -196,9 +162,6 @@ byte first (like Motorola and SPARC, unlike Intel and VAX). */ #cmakedefine WORDS_BIGENDIAN -/* Define if we have a lockf() function. */ -#cmakedefine PHAVE_LOCKF - /* Define if we can trust the compiler not to insert extra bytes in structs between base structs and derived structs. */ #cmakedefine SIMPLE_STRUCT_POINTERS @@ -209,9 +172,6 @@ /* Define if we have STL hash_map etc. available */ #cmakedefine HAVE_STL_HASH -/* Define if gettimeofday() takes only one parameter. */ -#cmakedefine GETTIMEOFDAY_ONE_PARAM - /* Define if you have the getopt function. */ #cmakedefine HAVE_GETOPT @@ -221,36 +181,10 @@ /* Define if getopt appears in getopt.h. */ #cmakedefine PHAVE_GETOPT_H -/* Define if you have ioctl(TIOCGWINSZ) to determine terminal width. */ -#cmakedefine IOCTL_TERMINAL_WIDTH - /* Do the system headers define key ios typedefs like ios::openmode and ios::fmtflags? */ #cmakedefine HAVE_IOS_TYPEDEFS -/* Define if the C++ iostream library defines ios::binary. */ -#cmakedefine HAVE_IOS_BINARY - -/* Can we safely call getenv() at static init time? */ -#cmakedefine STATIC_INIT_GETENV - -/* Can we read the file /proc/self/[*] to determine our - environment variables at static init time? */ -#cmakedefine HAVE_PROC_SELF_EXE -#cmakedefine HAVE_PROC_SELF_MAPS -#cmakedefine HAVE_PROC_SELF_ENVIRON -#cmakedefine HAVE_PROC_SELF_CMDLINE -#cmakedefine HAVE_PROC_CURPROC_FILE -#cmakedefine HAVE_PROC_CURPROC_MAP -#cmakedefine HAVE_PROC_CURPROC_CMDLINE - -/* Do we have a global pair of argc/argv variables that we can read at - static init time? Should we prototype them? What are they called? */ -#cmakedefine HAVE_GLOBAL_ARGV -#cmakedefine PROTOTYPE_GLOBAL_ARGV -#cmakedefine GLOBAL_ARGV -#cmakedefine GLOBAL_ARGC - /* Define if you have the header file. */ #cmakedefine PHAVE_IO_H @@ -293,19 +227,6 @@ /* Define if you have the header file. */ #cmakedefine PHAVE_UNISTD_H -/* Define if you have the header file. */ -#cmakedefine PHAVE_UTIME_H - -/* Define if you have the header file. */ -#cmakedefine PHAVE_GLOB_H - -/* Define if you have the header file. */ -#cmakedefine PHAVE_DIRENT_H - -/* Do we have (and therefore makecontext() / - swapcontext())? */ -#cmakedefine PHAVE_UCONTEXT_H - /* Do we have ? This enables us to use raw mouse input. */ #cmakedefine PHAVE_LINUX_INPUT_H diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 94d8a9c059..2d6664a2da 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -83,6 +83,38 @@ if(APPLE) target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY}) endif() +# These are all used by executionEnvironment.cxx/filename.cxx +foreach(var + # executionEnvironment.cxx: + HAVE_GLOBAL_ARGV + PROTOTYPE_GLOBAL_ARGV + GLOBAL_ARGV + GLOBAL_ARGC + + HAVE_PROC_CURPROC_CMDLINE + HAVE_PROC_CURPROC_FILE + HAVE_PROC_CURPROC_MAP + HAVE_PROC_SELF_CMDLINE + HAVE_PROC_SELF_ENVIRON + HAVE_PROC_SELF_EXE + HAVE_PROC_SELF_MAPS + + STATIC_INIT_GETENV + + # filename.cxx: + HAVE_IOS_BINARY + PHAVE_DIRENT_H + PHAVE_GLOB_H + PHAVE_LOCKF + PHAVE_UTIME_H +) + + if(${var}) + target_compile_definitions(p3dtoolutil PRIVATE "${var}=${${var}}") + endif() + +endforeach(var) + if(NOT BUILD_METALIBS) install(TARGETS p3dtoolutil EXPORT Core COMPONENT Core diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 592ad9abe9..5ca2bf5ec0 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -140,6 +140,14 @@ target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool PKG::TAR PKG::ZLIB PKG::OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) +if(REPORT_OPENSSL_ERRORS) + target_compile_definitions(p3express PRIVATE REPORT_OPENSSL_ERRORS) +endif() + +if(GETTIMEOFDAY_ONE_PARAM) + target_compile_definitions(p3express PRIVATE GETTIMEOFDAY_ONE_PARAM) +endif() + if(WIN32) target_link_libraries(p3express advapi32.lib ws2_32.lib) endif() diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 9053f2fe45..b0ecaac68b 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -26,6 +26,14 @@ set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) target_link_libraries(p3ffmpeg panda PKG::FFMPEG PKG::SWSCALE PKG::SWRESAMPLE) +if(HAVE_SWSCALE) + target_compile_definitions(p3ffmpeg PRIVATE HAVE_SWSCALE) +endif() + +if(HAVE_SWRESAMPLE) + target_compile_definitions(p3ffmpeg PRIVATE HAVE_SWRESAMPLE) +endif() + install(TARGETS p3ffmpeg EXPORT FFmpeg COMPONENT FFmpeg DESTINATION lib diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 06d28fdbc4..9099dbd445 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -38,6 +38,19 @@ add_library(p3framework ${P3FRAMEWORK_HEADERS} ${P3FRAMEWORK_SOURCES}) set_target_properties(p3framework PROPERTIES DEFINE_SYMBOL BUILDING_FRAMEWORK) target_link_libraries(p3framework ${P3FRAMEWORK_LINK_TARGETS}) +foreach(var + HAVE_GL + HAVE_TINYDISPLAY + HAVE_DX9 + HAVE_EGG +) + + if(${var}) + target_compile_definitions(p3framework PRIVATE ${var}) + endif() + +endforeach(var) + install(TARGETS p3framework EXPORT Framework COMPONENT Framework DESTINATION lib diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index e50b8a3d6c..e72de3e47c 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -176,6 +176,14 @@ target_link_libraries(p3gobj p3gsgbase p3pnmimage PKG::ZLIB PKG::SQUISH PKG::CG) target_interrogate(p3gobj ALL EXTENSIONS ${P3GOBJ_IGATEEXT}) +if(HAVE_SQUISH) + target_compile_definitions(p3gobj PRIVATE HAVE_SQUISH) +endif() + +if(PHAVE_LOCKF) + target_compile_definitions(p3gobj PRIVATE PHAVE_LOCKF) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3gobj EXPORT Core COMPONENT Core diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index bacddece22..d34c0fc563 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -63,9 +63,14 @@ set(P3MATHUTIL_SOURCES composite_sources(p3mathutil P3MATHUTIL_SOURCES) add_component_library(p3mathutil SYMBOL BUILDING_PANDA_MATHUTIL ${P3MATHUTIL_HEADERS} ${P3MATHUTIL_SOURCES}) -target_link_libraries(p3mathutil p3event PKG::FFTW) +target_link_libraries(p3mathutil p3event + PKG::FFTW) target_interrogate(p3mathutil ALL) +if(HAVE_FFTW) + target_compile_definitions(p3mathutil PRIVATE HAVE_FFTW) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3mathutil EXPORT Core COMPONENT Core diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 4f2b7425f1..0835e9aa3c 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -125,6 +125,14 @@ target_link_libraries(p3pipeline pandaexpress PKG::THREADS) target_interrogate(p3pipeline ALL EXTENSIONS ${P3PIPELINE_IGATEEXT}) +if(PHAVE_UCONTEXT_H) + target_compile_definitions(p3pipeline PRIVATE PHAVE_UCONTEXT_H) +endif() + +if(OS_SIMPLE_THREADS) + target_compile_definitions(p3pipeline PRIVATE OS_SIMPLE_THREADS) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3pipeline EXPORT Core COMPONENT Core diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 1da06aba44..0caad3504d 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -43,6 +43,10 @@ if(HAVE_FREETYPE) endif() target_interrogate(p3text ALL) +if(HAVE_HARFBUZZ) + target_compile_definitions(p3text PRIVATE HAVE_HARFBUZZ) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3text EXPORT Core COMPONENT Core diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt index f1497fcf6e..4df746016f 100644 --- a/panda/src/vision/CMakeLists.txt +++ b/panda/src/vision/CMakeLists.txt @@ -39,6 +39,10 @@ elseif(OPENCV_VER_23) set_target_properties(p3vision PROPERTIES COMPILE_DEFINITIONS "OPENCV_VER_23") endif() +if(HAVE_FFMPEG) + target_compile_definitions(p3vision PRIVATE HAVE_FFMPEG) +endif() + install(TARGETS p3vision EXPORT Vision COMPONENT Vision DESTINATION lib diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index d9025819ff..7e0909a19e 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -20,6 +20,10 @@ add_component_library(p3windisplay SYMBOL BUILDING_PANDAWIN ${P3WINDISPLAY_HEADERS} ${P3WINDISPLAY_SOURCES}) target_link_libraries(p3windisplay panda User32.lib Imm32.lib) +if(HAVE_DX9) + target_compile_definitions(p3windisplay PRIVATE HAVE_DX9) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3windisplay EXPORT Core COMPONENT Core diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index 96dad943e8..fbbffc70a9 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -8,6 +8,10 @@ if(HAVE_EGG) target_link_libraries(egg2bam p3eggbase p3progbase panda) install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin) + if(HAVE_SQUISH) + target_compile_definitions(egg2bam PRIVATE HAVE_SQUISH) + endif() + add_executable(bam2egg bamToEgg.cxx bamToEgg.h) target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda) install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin) diff --git a/pandatool/src/progbase/CMakeLists.txt b/pandatool/src/progbase/CMakeLists.txt index 3b390c12a3..70e9212649 100644 --- a/pandatool/src/progbase/CMakeLists.txt +++ b/pandatool/src/progbase/CMakeLists.txt @@ -14,5 +14,9 @@ composite_sources(p3progbase P3PROGBASE_SOURCES) add_library(p3progbase STATIC ${P3PROGBASE_HEADERS} ${P3PROGBASE_SOURCES}) target_link_libraries(p3progbase p3pandatoolbase panda PKG::ZLIB) +if(IOCTL_TERMINAL_WIDTH) + target_compile_definitions(p3progbase PRIVATE IOCTL_TERMINAL_WIDTH) +endif() + # This is only needed for binaries in the pandatool package. It is not useful # for user applications, so it is not installed. diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt index 83c15713eb..66dd3b0b1a 100644 --- a/pandatool/src/ptloader/CMakeLists.txt +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -21,6 +21,7 @@ target_link_libraries(p3ptloader PRIVATE if(HAVE_FCOLLADA) target_link_libraries(p3ptloader PRIVATE p3daeegg) + target_compile_definitions(p3ptloader PRIVATE HAVE_FCOLLADA) endif() install(TARGETS p3ptloader EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) From 873c6b48d6d6dd1bd8211c707501635467719cc1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 16 Apr 2019 19:44:03 -0600 Subject: [PATCH 626/744] CMake: Generate interrogate_preamble_python_native.cxx at build time This also makes sure the file is only rebuilt if the inputs change, saving on unnecessary rebuilds. --- cmake/scripts/ConcatenateToCXX.cmake | 54 ++++++++++++++++++++++++++++ dtool/src/interrogate/CMakeLists.txt | 23 +++++------- 2 files changed, 63 insertions(+), 14 deletions(-) create mode 100644 cmake/scripts/ConcatenateToCXX.cmake diff --git a/cmake/scripts/ConcatenateToCXX.cmake b/cmake/scripts/ConcatenateToCXX.cmake new file mode 100644 index 0000000000..d8d5d1864d --- /dev/null +++ b/cmake/scripts/ConcatenateToCXX.cmake @@ -0,0 +1,54 @@ +# Filename: ConcatenateToCXX.cmake +# +# Description: When run, creates a single C++ file which includes a const char[] +# containing the bytes from one or more files. +# +# Usage: +# This script is invoked via add_custom_target, like this: +# cmake -D OUTPUT_FILE="out.cxx" -D SYMBOL_NAME=data -D INPUT_FILES="a.bin b.bin" -P ConcatenateToCXX.cmake +# + +if(NOT CMAKE_SCRIPT_MODE_FILE) + message(FATAL_ERROR "ConcatenateToCXX.cmake should not be included but run in script mode.") + return() +endif() + +if(NOT DEFINED OUTPUT_FILE) + message(FATAL_ERROR "OUTPUT_FILE should be defined when running ConcatenateToCXX.cmake!") + return() +endif() + +if(NOT DEFINED SYMBOL_NAME) + set(SYMBOL_NAME "data") +endif() + +file(WRITE "${OUTPUT_FILE}" "/* Generated by CMake. DO NOT EDIT. */\ +extern const char ${SYMBOL_NAME}[]; +const char ${SYMBOL_NAME}[] = {\n") + +separate_arguments(INPUT_FILES) +foreach(infile ${INPUT_FILES}) + file(APPEND "${OUTPUT_FILE}" " /* ${infile} */\n") + + set(offset 0) + while(1) + # Read up to 1024 bytes from the input file + file(READ "${infile}" data LIMIT 1024 OFFSET ${offset} HEX) + math(EXPR offset "${offset} + 1024") + + # If 'data' is empty, we're done + if(NOT data) + break() + endif() + + # Format runs of up to 32 hex chars by indenting and giving a newline + string(REGEX REPLACE + "(...?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?)" " \\1\n" + data "${data}") + # Format each byte (2 hex chars) in each line with 0x prefix and comma suffix + string(REGEX REPLACE "([0-9a-fA-F][0-9a-fA-F])" " 0x\\1," data "${data}") + file(APPEND "${OUTPUT_FILE}" "${data}") + endwhile() +endforeach(infile) + +file(APPEND "${OUTPUT_FILE}" "};\n") diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 639344d6d4..2ddc367aa7 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -64,20 +64,15 @@ target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub PKG::OPENSSL) # Python preamble for interrogate_module -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx - "extern const char interrogate_preamble_python_native[];\n") -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx - "const char interrogate_preamble_python_native[] = (\n") -foreach(preamble_file ${INTERROGATE_PREAMBLE_PYTHON_NATIVE}) - file(READ ${preamble_file} preamble_content) - string(REPLACE "\\" "\\\\" preamble_content "${preamble_content}") - string(REPLACE "\"" "\\\"" preamble_content "${preamble_content}") - string(REPLACE "\n" "\\n" preamble_content "${preamble_content}") - file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx - " \"${preamble_content}\"\n") -endforeach(preamble_file) -file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx - ");\n") +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx + COMMAND ${CMAKE_COMMAND} + -D OUTPUT_FILE="${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx" + -D INPUT_FILES="${INTERROGATE_PREAMBLE_PYTHON_NATIVE}" + -D SYMBOL_NAME="interrogate_preamble_python_native" + -P ${PROJECT_SOURCE_DIR}/cmake/scripts/ConcatenateToCXX.cmake + DEPENDS ${INTERROGATE_PREAMBLE_PYTHON_NATIVE} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}") add_executable(interrogate_module interrogate_module.cxx ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx) From 65d11a4cfa2b867ed47c4385df51b4b3c7244f0b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 20 Apr 2019 00:57:21 -0600 Subject: [PATCH 627/744] CMake: Fix pandac.PandaModules generation --- direct/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index d14abb4d3b..1606057711 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -72,7 +72,7 @@ print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core ins foreach(module ${ALL_INTERROGATE_MODULES}) file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" " try: - from panda3d.${module} import * + from ${module} import * except ImportError as err: if not (\"No module named\" in str(err) and \"${module}\" in str(err)): raise From cfa48789553a51d2dffc0892f0fb5475673ff474 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 26 Apr 2019 03:45:30 -0600 Subject: [PATCH 628/744] CMake: Use the same host_ prefix for pzip as we do for interrogate This is for better cross-compilation friendliness, so the pzip binary used during the build doesn't have to be the same as the pzip binary produced during the build. --- cmake/macros/RunPzip.cmake | 6 +++--- panda/src/downloadertools/CMakeLists.txt | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index 3a4d2e4d0f..1e4e777c20 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -1,5 +1,5 @@ function(run_pzip target_name source destination glob) - if(NOT TARGET pzip) + if(NOT TARGET host_pzip) # If pzip isn't built, we just copy instead. file(COPY "${source}" DESTINATION "${destination}" @@ -22,9 +22,9 @@ function(run_pzip target_name source destination glob) list(APPEND dstfiles "${destination}/${dstfile}") add_custom_command(OUTPUT "${destination}/${dstfile}" - COMMAND pzip -c > "${dstfile}" < "${srcfile}" + COMMAND host_pzip -c > "${dstfile}" < "${srcfile}" WORKING_DIRECTORY "${destination}" - DEPENDS pzip + DEPENDS host_pzip COMMENT "") endforeach(filename) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index a306fe7ebb..5de61edac2 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -38,6 +38,10 @@ if(HAVE_ZLIB) add_executable(pzip pzip.cxx) target_link_libraries(pzip panda) + if(NOT CMAKE_CROSSCOMPILING) + add_executable(host_pzip ALIAS pzip) + endif() + add_executable(punzip punzip.cxx) target_link_libraries(punzip panda) From f744951d25e433c101a6efb37e41f9e9ee9ee124 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 26 Apr 2019 03:46:25 -0600 Subject: [PATCH 629/744] CMake: Make Interrogate invocation friendly to multi-config generators --- cmake/macros/Interrogate.cmake | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 414e2b6b8c..e6a63c4aff 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -113,7 +113,7 @@ function(target_interrogate target) # Also store where the build files are kept, so the Interrogate output can go # there as well. set_target_properties("${target}" PROPERTIES - TARGET_BINDIR "${CMAKE_CURRENT_BINARY_DIR}") + TARGET_BINDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") endfunction(target_interrogate) @@ -212,10 +212,12 @@ function(interrogate_sources target output database language_flags) set(define_flags "$$,\t-D>") # If this is a release build that has NDEBUG defined, we need that too: - string(TOUPPER "${CMAKE_BUILD_TYPE}" build_type) - if("${CMAKE_CXX_FLAGS_${build_type}}" MATCHES ".*NDEBUG.*") - list(APPEND define_flags "-DNDEBUG") - endif() + foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) + string(TOUPPER "${build_type}" build_type) + if(CMAKE_CXX_FLAGS_${build_type} MATCHES ".*NDEBUG.*") + list(APPEND define_flags "$<$:-DNDEBUG>") + endif() + endforeach(build_type) add_custom_command( OUTPUT "${output}" "${database}" @@ -298,13 +300,14 @@ function(add_python_module module) get_target_property(workdir_abs "${target}" TARGET_BINDIR) if(NOT workdir_abs) # No TARGET_BINDIR was set, so we'll just use our current directory: - set(workdir_abs "${CMAKE_CURRENT_BINARY_DIR}") + set(workdir_abs "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") endif() # Keep command lines short file(RELATIVE_PATH workdir_rel "${CMAKE_CURRENT_BINARY_DIR}" "${workdir_abs}") interrogate_sources(${target} - "${workdir_abs}/${target}_igate.cxx" "${workdir_abs}/${target}.in" + "${workdir_abs}/${target}_igate.cxx" + "${workdir_abs}/${target}.in" "-python-native;-module;${module}") get_target_property(target_extensions "${target}" IGATE_EXTENSIONS) @@ -315,9 +318,9 @@ function(add_python_module module) endforeach(target) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" COMMAND host_interrogate_module - -oc "${CMAKE_CURRENT_BINARY_DIR}/${module}_module.cxx" + -oc "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" -module ${modname} -library ${modname} ${import_flags} ${INTERROGATE_MODULE_OPTIONS} @@ -326,7 +329,7 @@ function(add_python_module module) COMMENT "Generating module ${module}") add_python_target(${module} COMPONENT "${component}" EXPORT "${component}" - "${module}_module.cxx" ${sources_abs} ${extensions}) + "${CMAKE_CFG_INTDIR}/${module}_module.cxx" ${sources_abs} ${extensions}) target_link_libraries(${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11") From 49865c103a5c3cb54d1470d4d03c22b622fab199 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 29 Apr 2019 19:18:21 -0600 Subject: [PATCH 630/744] CMake: Modify install_python_package() so it keeps the build-dir copy up-to-date too --- cmake/macros/Python.cmake | 54 ++++++++++++----------- cmake/scripts/CopyPython.cmake | 78 ++++++++++++++++++++++++++++++++++ direct/CMakeLists.txt | 22 ++-------- panda/CMakeLists.txt | 2 +- 4 files changed, 113 insertions(+), 43 deletions(-) create mode 100644 cmake/scripts/CopyPython.cmake diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index ac30965400..4b8f20f440 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -80,9 +80,12 @@ function(add_python_target target) endfunction(add_python_target) # -# Function: install_python_package(path [ARCH/LIB] [COMPONENT component]) +# Function: install_python_package(name [SOURCE path] [ARCH/LIB] [COMPONENT component]) # -# Installs the Python package which was built at `path`. +# Installs the Python package `name` (which may have its source at `path`). +# +# The package is copied to (or created in) the build directory so that the user +# may import it before the install step. # # Note that this handles more than just installation; it will also invoke # Python's compileall utility to pregenerate .pyc/.pyo files. This will only @@ -96,10 +99,11 @@ endfunction(add_python_target) # documentation for more information on what this does). The default is # "Python". # -function(install_python_package path) +function(install_python_package package_name) set(type "LIB") + unset(keyword) set(component "Python") - set(component_keyword OFF) + unset(src_path) foreach(arg ${ARGN}) if(arg STREQUAL "ARCH") set(type "ARCH") @@ -108,11 +112,18 @@ function(install_python_package path) set(type "LIB") elseif(arg STREQUAL "COMPONENT") - set(component_keyword ON) + set(keyword "${arg}") - elseif(component_keyword) + elseif(keyword STREQUAL "COMPONENT") set(component "${arg}") - set(component_keyword OFF) + unset(keyword) + + elseif(arg STREQUAL "SOURCE") + set(keyword "${arg}") + + elseif(keyword STREQUAL "SOURCE") + set(src_path "${arg}") + unset(keyword) else() message(FATAL_ERROR "install_python_package got unexpected argument: ${ARGN}") @@ -120,26 +131,21 @@ function(install_python_package path) endif() endforeach(arg) - get_filename_component(package_name "${path}" NAME) - set(custom_target "bytecompile_${package_name}") + set(path "${PROJECT_BINARY_DIR}/${package_name}") - file(RELATIVE_PATH relpath "${PROJECT_BINARY_DIR}" "${path}") - - if(PYTHON_EXECUTABLE) - add_custom_target(${custom_target} ALL) - add_custom_command( - TARGET ${custom_target} - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" - COMMAND "${PYTHON_EXECUTABLE}" -m compileall -q "${relpath}") - add_custom_command( - TARGET ${custom_target} - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" - COMMAND "${PYTHON_EXECUTABLE}" -OO -m compileall -q "${relpath}") + set(args -D "OUTPUT_DIR=${path}") + if(src_path) + list(APPEND args -D "SOURCE_DIR=${src_path}") endif() + if(PYTHON_EXECUTABLE) + list(APPEND args -D "PYTHON_EXECUTABLES=${PYTHON_EXECUTABLE}") + endif() + add_custom_target(${package_name} ALL + COMMAND ${CMAKE_COMMAND} + ${args} + -P "${CMAKE_SOURCE_DIR}/cmake/scripts/CopyPython.cmake") - ensure_python_init("${path}") - - set(dir ${PYTHON_${type}_INSTALL_DIR}) + set(dir "${PYTHON_${type}_INSTALL_DIR}") if(dir) install(DIRECTORY "${path}" DESTINATION "${dir}" COMPONENT "${component}" diff --git a/cmake/scripts/CopyPython.cmake b/cmake/scripts/CopyPython.cmake new file mode 100644 index 0000000000..d1b786402a --- /dev/null +++ b/cmake/scripts/CopyPython.cmake @@ -0,0 +1,78 @@ +# Filename: CopyPython.cmake +# +# Description: When run, copies Python files from a source directory to a +# build directory located somewhere in the project's binary path. If +# PYTHON_EXECUTABLES is provided, it will also invoke compileall in the +# destination dir(s) to precache .pyc/.pyo files. +# +# Usage: +# This script is invoked via add_custom_target, like this: +# cmake -D OUTPUT_DIR="/out/dir/Release" +# -D SOURCE_DIR="/panda3d/direct/src/" +# -D PYTHON_EXECUTABLES="/usr/bin/python3.6" +# -P CopyPython.cmake +# + +if(NOT CMAKE_SCRIPT_MODE_FILE) + message(FATAL_ERROR "CopyPython.cmake should not be included but run in script mode.") + return() +endif() + +if(NOT DEFINED OUTPUT_DIR) + message(FATAL_ERROR "OUTPUT_DIR should be defined when running CopyPython.cmake!") + return() +endif() + +# Ensure OUTPUT_DIR exists +file(MAKE_DIRECTORY ${OUTPUT_DIR}) + +# If there's a SOURCE_DIR, glob for .py files and copy +# (this is done by hand to avoid the CMake bug where it creates empty dirs) +if(DEFINED SOURCE_DIR) + file(GLOB_RECURSE py_files RELATIVE "${SOURCE_DIR}" "${SOURCE_DIR}/*.py") + foreach(py_file ${py_files}) + get_filename_component(py_file_parent "${py_file}" DIRECTORY) + if(NOT EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py") + # The source file isn't part of a Python package, even though it is a .py + # file. Skip it. + continue() + endif() + + file(TIMESTAMP "${SOURCE_DIR}/${py_file}" src_stamp) + file(TIMESTAMP "${OUTPUT_DIR}/${py_file}" dst_stamp) + + if(NOT src_stamp STREQUAL dst_stamp) + file(COPY "${SOURCE_DIR}/${py_file}" DESTINATION "${OUTPUT_DIR}/${py_file_parent}") + set(changed YES) + endif() + + endforeach(py_file) + +else() + # No SOURCE_DIR; assume we're outdated since our caller might be populating + # the OUTPUT_DIR themselves + set(changed YES) + +endif() + +# Make sure Python recognizes OUTPUT_DIR as a package +if(NOT EXISTS "${OUTPUT_DIR}/__init__.py") + file(WRITE "${OUTPUT_DIR}/__init__.py" "") + set(changed YES) +endif() + +# Generate .pyc files for each Python version, if our caller wants +if(changed AND DEFINED PYTHON_EXECUTABLES) + foreach(interp ${PYTHON_EXECUTABLES}) + execute_process( + COMMAND "${interp}" -m compileall . + OUTPUT_QUIET + WORKING_DIRECTORY "${OUTPUT_DIR}") + + execute_process( + COMMAND "${interp}" -OO -m compileall . + OUTPUT_QUIET + WORKING_DIRECTORY "${OUTPUT_DIR}") + + endforeach(interp) +endif() diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 1606057711..18847d4b9b 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -42,21 +42,7 @@ if(HAVE_PYTHON) p3motiontrail p3showbase LINK p3direct IMPORT panda3d.core COMPONENT Direct) # Copy Python source files into the build directory - set(DIRECT_INSTALL_DIRECTORIES - actor cluster controls directbase directdevices directnotify directscripts - directtools directutil dist distributed extensions_native filter - fsm gui interval leveleditor motiontrail p3d particles physics - showbase showutil stdpy task tkpanels tkwidgets wxwidgets) - - foreach(dir ${DIRECT_INSTALL_DIRECTORIES}) - file(COPY - DIRECTORY "src/${dir}" - DESTINATION "${PROJECT_BINARY_DIR}/direct" - FILES_MATCHING PATTERN "*.py") - endforeach() - - # Install all files - install_python_package("${PROJECT_BINARY_DIR}/direct" LIB COMPONENT Direct) + install_python_package(direct SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/src" LIB COMPONENT Direct) # This bit is to generate the 'pandac' compatibility shim. It's deprecated now, # but in older versions of Panda3D, one would use @@ -64,13 +50,13 @@ if(HAVE_PYTHON) # instead of # from panda3d.FOO import * # Generate PandaModules: - file(WRITE "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" "\"This module is deprecated. Import from panda3d.core and other panda3d.* modules instead.\" print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") foreach(module ${ALL_INTERROGATE_MODULES}) - file(APPEND "${PROJECT_BINARY_DIR}/pandac/PandaModules.py" " + file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" " try: from ${module} import * except ImportError as err: @@ -80,7 +66,7 @@ except ImportError as err: endforeach() # Now install ourselves: - install_python_package("${PROJECT_BINARY_DIR}/pandac" LIB COMPONENT Direct) + install_python_package(pandac SOURCE "${CMAKE_CURRENT_BINARY_DIR}/pandac" LIB COMPONENT Direct) endif() # "Direct" component contains both the Python stuff and the non-Python stuff, diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 55de86dac9..a223e3e25f 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -107,7 +107,7 @@ if(INTERROGATE_PYTHON_INTERFACE) add_python_module(panda3d.core ${CORE_MODULE_COMPONENTS} LINK panda) if(BUILD_SHARED_LIBS) - install_python_package("${PROJECT_BINARY_DIR}/panda3d" ARCH) + install_python_package(panda3d ARCH) endif() if(HAVE_BULLET) From 059c78bade1bd1fe06ec9d80d37b88862d50f335 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 1 May 2019 18:13:30 -0600 Subject: [PATCH 631/744] CMake: Restructure multi-configuration binary directory layout This changes the structure to use paths like `build/Release/lib` instead of `build/lib/Release`, so that the `build/Release` directory more closely mimics the structure of `build` when in single-configuration mode. --- CMakeLists.txt | 13 ++- cmake/macros/Python.cmake | 143 +++-------------------- cmake/templates/win32_python/__init__.py | 20 ++++ dtool/CompilerFlags.cmake | 25 +++- dtool/LocalSetup.cmake | 4 +- dtool/src/dtoolbase/CMakeLists.txt | 2 +- 6 files changed, 70 insertions(+), 137 deletions(-) create mode 100644 cmake/templates/win32_python/__init__.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 7293d84d14..1eef5292b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -34,9 +34,6 @@ include(Interrogate) # Defines target_interrogate AND add_python_module include(RunPzip) # Defines run_pzip function include(Versioning) # Hooks 'add_library' to apply VERSION/SOVERSION -# Add the include path for source and header files generated by CMake -include_directories("${PROJECT_BINARY_DIR}/include/${CMAKE_CFG_INTDIR}") - # Determine which trees to build. option(BUILD_DTOOL "Build the dtool source tree." ON) option(BUILD_PANDA "Build the panda source tree." ON) @@ -90,7 +87,15 @@ if(INTERROGATE_PYTHON_INTERFACE) # for pytest before adding this test. If the user doesn't have pytest, we'd # like for the tests to fail. - add_test(pytest "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests") + if(CMAKE_CFG_INTDIR STREQUAL ".") + set(_workdir "${PROJECT_BINARY_DIR}") + else() + set(_workdir "${PROJECT_BINARY_DIR}/$") + endif() + + add_test(NAME pytest + COMMAND "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests" + WORKING_DIRECTORY "${_workdir}") endif() # Generate the Panda3DConfig.cmake file so find_package(Panda3D) works, and diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 4b8f20f440..cb8edad227 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -6,7 +6,6 @@ # Functions: # add_python_target(target [source1 [source2 ...]]) # install_python_package(path [ARCH/LIB]) -# ensure_python_init(path [ARCH] [ROOT] [OVERWRITE]) # # @@ -52,12 +51,21 @@ function(add_python_target target) target_link_libraries(${target} PKG::PYTHON) if(BUILD_SHARED_LIBS) + set(_outdir "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${slash_namespace}") + set_target_properties(${target} PROPERTIES - LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${slash_namespace}" + LIBRARY_OUTPUT_DIRECTORY "${_outdir}" OUTPUT_NAME "${basename}" PREFIX "" SUFFIX "${PYTHON_EXTENSION_SUFFIX}") + # This is explained over in CompilerFlags.cmake + foreach(_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${_config}" _config) + set_target_properties(${target} PROPERTIES + LIBRARY_OUTPUT_DIRECTORY_${_config} "${_outdir}") + endforeach(_config) + if(PYTHON_ARCH_INSTALL_DIR) install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION "${PYTHON_ARCH_INSTALL_DIR}/${slash_namespace}") endif() @@ -71,12 +79,6 @@ function(add_python_target target) endif() - set(keywords OVERWRITE ARCH) - if(NOT slash_namespace MATCHES ".*/.*") - list(APPEND keywords ROOT) - endif() - ensure_python_init("${PROJECT_BINARY_DIR}/${slash_namespace}" ${keywords}) - endfunction(add_python_target) # @@ -131,7 +133,13 @@ function(install_python_package package_name) endif() endforeach(arg) - set(path "${PROJECT_BINARY_DIR}/${package_name}") + if(NOT DEFINED src_path AND type STREQUAL "ARCH" AND WIN32 AND NOT CYGWIN) + # Win32 needs a special fixup so the DLLs in "bin" can be on the path; + # let's set src_path to the directory containing our fixup __init__.py + set(src_path "${CMAKE_SOURCE_DIR}/cmake/templates/win32_python") + endif() + + set(path "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${package_name}") set(args -D "OUTPUT_DIR=${path}") if(src_path) @@ -153,120 +161,3 @@ function(install_python_package package_name) endif() endfunction(install_python_package) - -# -# Function: ensure_python_init(path [ARCH] [ROOT] [OVERWRITE]) -# -# Makes sure that the directory - at `path` - contains a file named -# '__init__.py', which is necessary for Python to recognize the directory as a -# package. -# -# ARCH, if specified, means that this is a binary package, and the build tree -# might contain configuration-specific subdirectories. The __init__.py will be -# generated with a function that ensures that the appropriate configuration -# subdirectory is in the path. -# -# ROOT, if specified, means that the directory may sit directly adjacent to a -# 'bin' directory, which should be added to the DLL search path on Windows. -# -# OVERWRITE causes the __init__.py file to be overwritten if one is already -# present. -# -function(ensure_python_init path) - set(arch OFF) - set(root OFF) - set(overwrite OFF) - - foreach(arg ${ARGN}) - if(arg STREQUAL "ARCH") - set(arch ON) - - elseif(arg STREQUAL "ROOT") - set(root ON) - - elseif(arg STREQUAL "OVERWRITE") - set(overwrite ON) - - else() - message(FATAL_ERROR "ensure_python_init got unexpected argument: ${arg}") - - endif() - endforeach(arg) - - set(init_filename "${path}/__init__.py") - if(EXISTS "${init_filename}" AND NOT overwrite) - return() - endif() - - file(WRITE "${init_filename}" "") - - if(arch AND NOT "${CMAKE_CFG_INTDIR}" STREQUAL ".") - # ARCH set, and this is a multi-configuration generator - - set(configs "${CMAKE_CONFIGURATION_TYPES}") - - # Debug should be at the end (highest preference) - list(REMOVE_ITEM configs "Debug") - list(APPEND configs "Debug") - - string(REPLACE ";" "', '" configs "${configs}") - - file(APPEND "${init_filename}" " -def _fixup_path(): - try: - path = __path__[0] - except (NameError, IndexError): - return # Not a package, or not on filesystem - - import os - abspath = os.path.abspath(path) - - newpath = None - for config in ['${configs}']: - cfgpath = os.path.join(abspath, config) - if not os.path.isdir(cfgpath): - continue - - newpath = cfgpath - - if config.lower() == os.environ.get('CMAKE_CONFIGURATION', '').lower(): - break - - if newpath: - __path__.insert(0, newpath) - -_fixup_path() -del _fixup_path -") - - endif() - - if(root AND WIN32 AND NOT CYGWIN) - # ROOT set, and this is Windows - - file(APPEND "${init_filename}" " -def _fixup_dlls(): - try: - path = __path__[0] - except (NameError, IndexError): - return # Not a package, or not on filesystem - - import os - - relpath = os.path.relpath(path, __path__[-1]) - dll_path = os.path.abspath(os.path.join(__path__[-1], '../bin', relpath)) - if not os.path.isdir(dll_path): - return - - os_path = os.environ.get('PATH', '') - os_path = os_path.split(os.pathsep) if os_path else [] - os_path.insert(0, dll_path) - os.environ['PATH'] = os.pathsep.join(os_path) - -_fixup_dlls() -del _fixup_dlls -") - - endif() - -endfunction(ensure_python_init) diff --git a/cmake/templates/win32_python/__init__.py b/cmake/templates/win32_python/__init__.py new file mode 100644 index 0000000000..8228db8f46 --- /dev/null +++ b/cmake/templates/win32_python/__init__.py @@ -0,0 +1,20 @@ +def _fixup_dlls(): + try: + path = __path__[0] + except (NameError, IndexError): + return # Not a package, or not on filesystem + + import os + + relpath = os.path.relpath(path, __path__[-1]) + dll_path = os.path.abspath(os.path.join(__path__[-1], '../bin', relpath)) + if not os.path.isdir(dll_path): + return + + os_path = os.environ.get('PATH', '') + os_path = os_path.split(os.pathsep) if os_path else [] + os_path.insert(0, dll_path) + os.environ['PATH'] = os.pathsep.join(os_path) + +_fixup_dlls() +del _fixup_dlls diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 2ee0ed02eb..644135dd72 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -29,9 +29,9 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Set up the output directory structure, mimicking that of makepanda set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib") set(MODULE_DESTINATION "lib") # Runtime code assumes that dynamic modules have a "lib" prefix; Windows @@ -44,12 +44,29 @@ if(WIN32) set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # On Windows, modules (DLLs) are located in bin; lib is just for .lib files - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin") if(BUILD_SHARED_LIBS) set(MODULE_DESTINATION "bin") endif() endif() +# Since we're using CMAKE_CFG_INTDIR to put everything in a +# configuration-specific subdirectory when building on a multi-config +# generator, we need to suppress the usual configuration name appending +# behavior of CMake. In CMake 3.4+, it will suppress this behavior +# automatically if the *_OUTPUT_DIRECTORY property contains a generator +# expresssion, but: +# a) As of this writing we support as early as CMake 3.0.2 +# b) ${CMAKE_CFG_INTDIR} doesn't actually expand to a generator expression +# +# So, to solve both of these, let's just do this: +foreach(_type RUNTIME ARCHIVE LIBRARY) + foreach(_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${_config}" _config) + set(CMAKE_${_type}_OUTPUT_DIRECTORY_${_config} "${CMAKE_${_type}_OUTPUT_DIRECTORY}") + endforeach(_config) +endforeach(_type) + # Set warning levels if(MSVC) string(APPEND CMAKE_C_FLAGS " /W3") diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 6f526d98c2..aa0b5f2dad 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -193,8 +193,8 @@ else() set(intdir "${CMAKE_BUILD_TYPE}") endif() -configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h") -install(FILES "${PROJECT_BINARY_DIR}/include/${intdir}/dtool_config.h" +configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/${intdir}/include/dtool_config.h") +install(FILES "${PROJECT_BINARY_DIR}/${intdir}/include/dtool_config.h" COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 4e3c4b94f6..344dce51fd 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -91,7 +91,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE # Help other libraries find the autogenerated headers target_include_directories(p3dtoolbase PUBLIC $ - $) + $/include) target_link_libraries(p3dtoolbase PKG::EIGEN PKG::THREADS) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) From d058cb16fd248c23c0b021da152767fcc81a9d55 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 29 May 2019 16:59:06 -0600 Subject: [PATCH 632/744] CMake: Don't export(PACKAGE) when cross-compiling When cross-compiling, the build directory won't contain anything useful to the host system. Therefore, we shouldn't register the build directory in CMake's package registry. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1eef5292b0..5417493e6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,4 +114,6 @@ write_basic_package_version_file( install(FILES "${PROJECT_BINARY_DIR}/Panda3DConfigVersion.cmake" DESTINATION "lib/cmake/Panda3D") -export(PACKAGE Panda3D) +if(NOT CMAKE_CROSSCOMPILING) + export(PACKAGE Panda3D) +endif() From 26e60fe1061829185cab6b262e916348ad764825 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Jun 2019 00:16:33 -0600 Subject: [PATCH 633/744] CMake: Fix the ConcatenateToCXX script leaving off a null byte This also adds a _size symbol. Who knows, maybe something will find that useful. --- cmake/scripts/ConcatenateToCXX.cmake | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/cmake/scripts/ConcatenateToCXX.cmake b/cmake/scripts/ConcatenateToCXX.cmake index d8d5d1864d..2ed19085b1 100644 --- a/cmake/scripts/ConcatenateToCXX.cmake +++ b/cmake/scripts/ConcatenateToCXX.cmake @@ -3,6 +3,12 @@ # Description: When run, creates a single C++ file which includes a const char[] # containing the bytes from one or more files. # +# There is a {SYMBOL_NAME}_size symbol defined as well, storing the total +# number of bytes in the concatenated input files. +# +# A single null terminator byte is added for the benefit of programs that +# simply treat the data array as a string. +# # Usage: # This script is invoked via add_custom_target, like this: # cmake -D OUTPUT_FILE="out.cxx" -D SYMBOL_NAME=data -D INPUT_FILES="a.bin b.bin" -P ConcatenateToCXX.cmake @@ -22,10 +28,14 @@ if(NOT DEFINED SYMBOL_NAME) set(SYMBOL_NAME "data") endif() -file(WRITE "${OUTPUT_FILE}" "/* Generated by CMake. DO NOT EDIT. */\ +file(WRITE "${OUTPUT_FILE}" "/* Generated by CMake. DO NOT EDIT. */ + extern const char ${SYMBOL_NAME}[]; +extern const int ${SYMBOL_NAME}_size; + const char ${SYMBOL_NAME}[] = {\n") +set(byte_count 0) separate_arguments(INPUT_FILES) foreach(infile ${INPUT_FILES}) file(APPEND "${OUTPUT_FILE}" " /* ${infile} */\n") @@ -41,6 +51,10 @@ foreach(infile ${INPUT_FILES}) break() endif() + # Count the bytes we're adding + string(LENGTH "${data}" strlen) + math(EXPR byte_count "${byte_count} + (${strlen} / 2)") + # Format runs of up to 32 hex chars by indenting and giving a newline string(REGEX REPLACE "(...?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?.?)" " \\1\n" @@ -51,4 +65,6 @@ foreach(infile ${INPUT_FILES}) endwhile() endforeach(infile) -file(APPEND "${OUTPUT_FILE}" "};\n") +file(APPEND "${OUTPUT_FILE}" " 0\n}; + +extern const int ${SYMBOL_NAME}_size = ${byte_count};\n") From 2d5bdb351557ed1ee51e4026aac26e251045c2a0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Jun 2019 00:19:42 -0600 Subject: [PATCH 634/744] CMake: Fix Interrogate macro's -D flag generator This wraps everything in 'single-quotes' so that defines that contain spaces and/or double-quotes work properly. --- cmake/macros/Interrogate.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index e6a63c4aff..cdaea1e2a3 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -209,7 +209,8 @@ function(interrogate_sources target output database language_flags) # Get the compiler definition flags. These must be passed to Interrogate # in the same way that they are passed to the compiler so that Interrogate # will preprocess each file in the same way. - set(define_flags "$$,\t-D>") + set(_compile_defs "$") + set(define_flags "$<$:-D'$'>") # If this is a release build that has NDEBUG defined, we need that too: foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) From 668ad6e5597a10f704f5e1b19b998f646b73f198 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 2 Jun 2019 01:32:36 -0600 Subject: [PATCH 635/744] CMake: Don't build convert_srgb_sse2.cxx separately on AMD64 This is unnecessary on AMD64, where SSE2 is builtin and the file in question can be composited just like everything else. --- panda/src/pnmimage/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 5f66c24270..9c3f6fccbd 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -32,7 +32,8 @@ set(P3PNMIMAGE_IGATEEXT pfmFile_ext.h ) -if(HAVE_SSE2) +if(HAVE_SSE2 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "86") + # It's only necessary to do this on 32-bit x86; 64-bit makes SSE2 builtin. set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES SKIP_COMPOSITING YES COMPILE_FLAGS -msse2) From 81f0fb78f2dce32c2dbdb1513d6db5da67435f03 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 3 Jun 2019 21:47:07 -0600 Subject: [PATCH 636/744] CMake: Fix Interrogate macro not working on Windows This was broken by 2d5bdb351557ed1ee51e4026aac26e251045c2a0, which wrote -D flags as -D'symbol' -- this choked Windows, so this commit turns it off in that case. It's a shame there's no generator expression to escape quotes, otherwise this hack wouldn't even be needed. --- cmake/macros/Interrogate.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index cdaea1e2a3..d90c5edadf 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -210,7 +210,12 @@ function(interrogate_sources target output database language_flags) # in the same way that they are passed to the compiler so that Interrogate # will preprocess each file in the same way. set(_compile_defs "$") - set(define_flags "$<$:-D'$'>") + if(NOT CMAKE_HOST_WIN32) + # Win32's command-line parser doesn't understand "'" + # that's fine, it also ignores '"' + set(_q "'") + endif() + set(define_flags "$<$:-D${_q}$${_q}>") # If this is a release build that has NDEBUG defined, we need that too: foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) From 088949e2a1ae8751fc1e071f5c1f4c56db91e973 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Jun 2019 00:00:09 -0600 Subject: [PATCH 637/744] CMake: Update for upstream changes --- dtool/src/dtoolutil/CMakeLists.txt | 2 ++ panda/src/pipeline/CMakeLists.txt | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 2d6664a2da..8348442311 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -66,6 +66,8 @@ set(P3DTOOLUTIL_IGATEEXT filename_ext.h globPattern_ext.cxx globPattern_ext.h + iostream_ext.cxx + iostream_ext.h textEncoder_ext.cxx textEncoder_ext.h ) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 0835e9aa3c..0e117e8208 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -114,8 +114,12 @@ if(WIN32) endif() set(P3PIPELINE_IGATEEXT + pmutex_ext.h + pmutex_ext.I pythonThread.cxx pythonThread.h + reMutex_ext.h + reMutex_ext.I ) composite_sources(p3pipeline P3PIPELINE_SOURCES) From d7a093a45508c5265a28ae50fbf6731f55004a0a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 4 Jun 2019 00:07:11 -0600 Subject: [PATCH 638/744] CMake: Define LIBP3DTOOL_FILENAMES for p3dtoolutil --- dtool/src/dtoolutil/CMakeLists.txt | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 8348442311..efc0dbdc97 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -117,6 +117,32 @@ foreach(var endforeach(var) +if(BUILD_SHARED_LIBS) + # executionEnvironment.cxx needs to know the name(s) of the library file it + # will be linked into + if(BUILD_METALIBS) + set(library "p3dtool") + else() + set(library "p3dtoolutil") + endif() + + set(filenames) + foreach(prop TARGET_FILE_NAME TARGET_SONAME_FILE_NAME TARGET_LINKER_FILE_NAME) + list(APPEND filenames "$<${prop}:${library}>") + + if(CMAKE_IMPORT_LIBRARY_SUFFIX) + # Only the first property is valid/relevant on DLL platforms; bail out + # now and skip the others. + # (Yes, CMAKE_IMPORT_LIBRARY_SUFFIX being non-empty is how CMake defines + # a DLL platform where TARGET_SONAME_FILE_NAME is invalid.) + break() + endif() + endforeach(prop) + + target_compile_definitions(p3dtoolutil + PRIVATE "LIBP3DTOOL_FILENAMES=\"$\">\"") +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3dtoolutil EXPORT Core COMPONENT Core From 449a514f5f35c1380a87bb9153be5a4fae83c453 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Jun 2019 02:26:28 -0600 Subject: [PATCH 639/744] CMake: Fix typo causing bad paths in installed target files --- dtool/src/dtoolbase/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 344dce51fd..be2cc44394 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -91,7 +91,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE # Help other libraries find the autogenerated headers target_include_directories(p3dtoolbase PUBLIC $ - $/include) + $) target_link_libraries(p3dtoolbase PKG::EIGEN PKG::THREADS) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) From 1a237670e345e6b0278e47a8659b2e1a45109ccd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 5 Jun 2019 02:27:31 -0600 Subject: [PATCH 640/744] CMake: Make Interrogate macro ensure output directories exist This was causing problems on the Xcode generator under macOS, which wasn't automatically creating the output directories for us. --- cmake/macros/Interrogate.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index d90c5edadf..a7fb131916 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -225,8 +225,13 @@ function(interrogate_sources target output database language_flags) endif() endforeach(build_type) + get_filename_component(output_directory "${output}" DIRECTORY) + get_filename_component(database_directory "${database}" DIRECTORY) + add_custom_command( OUTPUT "${output}" "${database}" + COMMAND ${CMAKE_COMMAND} -E + make_directory "${output_directory}" "${database_directory}" COMMAND host_interrogate -oc "${output}" -od "${database}" @@ -325,6 +330,8 @@ function(add_python_module module) add_custom_command( OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" + COMMAND ${CMAKE_COMMAND} -E + make_directory "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" COMMAND host_interrogate_module -oc "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" -module ${modname} -library ${modname} From d3ef7bf12d34461220b947cd01e7a06d9affd4c4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 24 Jun 2019 23:46:16 -0600 Subject: [PATCH 641/744] CMake: Avoid using continue() This is, sadly, not added until CMake 3.4. This commit avoids continue() by restructuring the loops so that the conditions previously being used for continue() are no longer needed. The alternative would've been to encase the loop bodies massive ifs, but I find that to be a poor choice for readability. --- cmake/macros/PackageConfig.cmake | 25 ++++++++++++++++++------- cmake/modules/FindFCollada.cmake | 20 ++++++++++++++------ cmake/scripts/CopyPython.cmake | 13 ++++++------- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index f3032fc832..03fb49ff2f 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -329,15 +329,26 @@ function(export_packages filename) set(history) while(stack) # Remove head item from stack - list(GET stack 0 head) - list(REMOVE_AT stack 0) + unset(head) + while(NOT DEFINED head) + if(NOT stack) + break() + endif() - # Don't visit anything twice - list(FIND history "${head}" _index) - if(_index GREATER -1) - continue() - else() + list(GET stack 0 head) + list(REMOVE_AT stack 0) + + # Don't visit anything twice + list(FIND history "${head}" _index) + if(_index GREATER -1) + unset(head) + endif() + endwhile() + + if(head) list(APPEND history "${head}") + else() + break() endif() # If head isn't a target, add it to `libraries`, else recurse diff --git a/cmake/modules/FindFCollada.cmake b/cmake/modules/FindFCollada.cmake index 8db7f1ca00..fcf4ee492d 100644 --- a/cmake/modules/FindFCollada.cmake +++ b/cmake/modules/FindFCollada.cmake @@ -48,13 +48,17 @@ if(NOT MSVC AND list(APPEND _defines "FCOLLADA_DLL") endif() -foreach(_config RELEASE DEBUG) - # Make sure we have lib/includes for this config - if(NOT FCOLLADA_${_config}_LIBRARY OR NOT FCOLLADA_INCLUDE_DIR) - continue() +# Identify the configs which we have available +set(_configs) +if(FCOLLADA_INCLUDE_DIR) + if(FCOLLADA_RELEASE_LIBRARY) + list(APPEND _configs RELEASE) + endif() + if(FCOLLADA_DEBUG_LIBRARY) + list(APPEND _configs DEBUG) endif() - if(NOT _HAS_FCOLLADA_LIBRARY) + if(_configs) set(_HAS_FCOLLADA_LIBRARY ON) add_library(FCollada::FCollada UNKNOWN IMPORTED GLOBAL) @@ -63,7 +67,10 @@ foreach(_config RELEASE DEBUG) INTERFACE_INCLUDE_DIRECTORIES "${FCOLLADA_INCLUDE_DIR}") endif() - + +endif() + +foreach(_config ${_configs}) set_property(TARGET FCollada::FCollada APPEND PROPERTY IMPORTED_CONFIGURATIONS "${_config}") @@ -72,6 +79,7 @@ foreach(_config RELEASE DEBUG) endforeach(_config) unset(_config) +unset(_configs) unset(_defines) include(FindPackageHandleStandardArgs) diff --git a/cmake/scripts/CopyPython.cmake b/cmake/scripts/CopyPython.cmake index d1b786402a..b9fad3ef92 100644 --- a/cmake/scripts/CopyPython.cmake +++ b/cmake/scripts/CopyPython.cmake @@ -32,16 +32,15 @@ if(DEFINED SOURCE_DIR) file(GLOB_RECURSE py_files RELATIVE "${SOURCE_DIR}" "${SOURCE_DIR}/*.py") foreach(py_file ${py_files}) get_filename_component(py_file_parent "${py_file}" DIRECTORY) - if(NOT EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py") - # The source file isn't part of a Python package, even though it is a .py - # file. Skip it. - continue() - endif() - file(TIMESTAMP "${SOURCE_DIR}/${py_file}" src_stamp) file(TIMESTAMP "${OUTPUT_DIR}/${py_file}" dst_stamp) - if(NOT src_stamp STREQUAL dst_stamp) + # The file is only copied if: + # - there's an __init__.py in its dir (i.e. file belongs to a package), and + # - the modification timestamp differs (i.e. file changed or never copied) + if(EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py" + AND NOT src_stamp STREQUAL dst_stamp) + file(COPY "${SOURCE_DIR}/${py_file}" DESTINATION "${OUTPUT_DIR}/${py_file_parent}") set(changed YES) endif() From 24ba0d0e72b59772012c20c57c86a9d7e6703668 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 25 Jun 2019 03:04:35 -0600 Subject: [PATCH 642/744] CMake: Fix Interrogate macro not working on CMake 3.0.2 --- cmake/macros/Interrogate.cmake | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index a7fb131916..c50eabcecd 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -231,7 +231,9 @@ function(interrogate_sources target output database language_flags) add_custom_command( OUTPUT "${output}" "${database}" COMMAND ${CMAKE_COMMAND} -E - make_directory "${output_directory}" "${database_directory}" + make_directory "${output_directory}" + COMMAND ${CMAKE_COMMAND} -E + make_directory "${database_directory}" COMMAND host_interrogate -oc "${output}" -od "${database}" @@ -342,7 +344,8 @@ function(add_python_module module) COMMENT "Generating module ${module}") add_python_target(${module} COMPONENT "${component}" EXPORT "${component}" - "${CMAKE_CFG_INTDIR}/${module}_module.cxx" ${sources_abs} ${extensions}) + "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" + ${sources_abs} ${extensions}) target_link_libraries(${module} ${link_targets}) if(CMAKE_VERSION VERSION_LESS "3.11") From aed55d4e7ebd483ad05fef5587d6cda0dd63a2c5 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Tue, 4 Jun 2019 14:27:33 -0500 Subject: [PATCH 643/744] CMake: Don't compile PRC's encryptStream unless we have OpenSSL. --- dtool/src/prc/CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 0fb97b1e95..c1777bc6c4 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -53,7 +53,6 @@ set(P3PRC_SOURCES configVariableManager.cxx configVariableSearchPath.cxx configVariableString.cxx - encryptStreamBuf.cxx encryptStream.cxx nativeNumericData.cxx notify.cxx notifyCategory.cxx @@ -70,6 +69,10 @@ if(ANDROID) androidLogStream.cxx) endif() +if(HAVE_OPENSSL) + list(APPEND P3PRC_SOURCES encryptStreamBuf.cxx encryptStream.cxx) +endif() + set(P3PRC_IGATEEXT streamReader_ext.cxx streamReader_ext.h From f0c97723965592709591e3df865c000f8fe221ed Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 5 Jun 2019 11:50:45 -0500 Subject: [PATCH 644/744] CMake: Move copying of models to build-time. --- CMakeLists.txt | 29 ++++++++++++++++++++--------- cmake/scripts/CopyPattern.cmake | 27 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 9 deletions(-) create mode 100644 cmake/scripts/CopyPattern.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 5417493e6d..1ec2e26ce9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,21 +64,32 @@ if(BUILD_CONTRIB) endif() if(BUILD_MODELS) - # We don't really "build" the models, just pzip them - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" - DESTINATION "${PROJECT_BINARY_DIR}/models/maps") run_pzip(models "${CMAKE_CURRENT_SOURCE_DIR}/models/" - "${PROJECT_BINARY_DIR}/models" + "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" *.egg) - file(COPY "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" - DESTINATION "${PROJECT_BINARY_DIR}/models" - FILES_MATCHING PATTERN *.rgb PATTERN *.png PATTERN *.jpg PATTERN *.wav) run_pzip(dmodels "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" - "${PROJECT_BINARY_DIR}/models" + "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" *.egg) - install(DIRECTORY "${PROJECT_BINARY_DIR}/models" + + add_custom_command(TARGET models + POST_BUILD + COMMAND ${CMAKE_COMMAND} + -DSOURCE="${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" + -DDESTINATION="${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models/maps" + -P ${PROJECT_SOURCE_DIR}/cmake/scripts/CopyPattern.cmake + COMMENT "Copying models/maps") + add_custom_command(TARGET dmodels + POST_BUILD + COMMAND ${CMAKE_COMMAND} + -DSOURCE="${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" + -DDESTINATION="${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" + -DFILES_MATCHING="PATTERN;*.rgb;PATTERN;*.png;PATTERN;*.jpg;PATTERN;*.wav" + -P ${PROJECT_SOURCE_DIR}/cmake/scripts/CopyPattern.cmake + COMMENT "Copying dmodels' assets") + + install(DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" COMPONENT Models DESTINATION share/panda3d) endif() diff --git a/cmake/scripts/CopyPattern.cmake b/cmake/scripts/CopyPattern.cmake new file mode 100644 index 0000000000..52b66cb91c --- /dev/null +++ b/cmake/scripts/CopyPattern.cmake @@ -0,0 +1,27 @@ +# Filename: CopyPattern.cmake +# +# Description: This is a standalone version of CMake's file(COPY) command so we +# can use all of its features during build-time instead of +# config-time. +# +# Usage: +# This script is invoked via add_custom_target, like this: +# cmake -D SOURCE=[source directory] +# -D DESTINATION=[destination directory] +# -D FILES_MATCHING="[globbing patterns passed to file(COPY)]" +# -P CopyPattern.cmake +if(NOT DEFINED SOURCE OR NOT DEFINED DESTINATION) + message(SEND_ERROR "CopyPattern.cmake requires SOURCE and DESTINATION to be +defined.") +endif() + +if(DEFINED FILES_MATCHING) + separate_arguments(FILES_MATCHING UNIX_COMMAND ${FILES_MATCHING}) + + file(COPY "${SOURCE}" + DESTINATION "${DESTINATION}" + FILES_MATCHING ${FILES_MATCHING}) +else() + file(COPY "${SOURCE}" + DESTINATION "${DESTINATION}") +endif() From cb0def4eb39809d6a31eb5107da94fe6dabc9dbd Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 5 Jun 2019 11:56:18 -0500 Subject: [PATCH 645/744] CMake: Defer pzip's directory creation to build-time. --- cmake/macros/RunPzip.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index 1e4e777c20..dd72040714 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -13,17 +13,15 @@ function(run_pzip target_name source destination glob) set(dstfiles "") foreach(filename ${files}) string(REGEX REPLACE "^/" "" filename "${filename}") - file(RELATIVE_PATH srcfile "${destination}" "${source}/${filename}") get_filename_component(dstdir "${destination}/${filename}" DIRECTORY) - file(MAKE_DIRECTORY "${dstdir}") set(dstfile "${filename}.pz") list(APPEND dstfiles "${destination}/${dstfile}") add_custom_command(OUTPUT "${destination}/${dstfile}" - COMMAND host_pzip -c > "${dstfile}" < "${srcfile}" - WORKING_DIRECTORY "${destination}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${dstdir}" + COMMAND host_pzip -c > "${destination}/${dstfile}" < "${source}/${filename}" DEPENDS host_pzip COMMENT "") From 27fd87983a398cd009d841a71d5265010182150f Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 5 Jun 2019 12:49:42 -0500 Subject: [PATCH 646/744] CMake: Only use a default CMAKE_BUILD_TYPE if using a single-config generator. Create a variable that can be used to tell if a generator is multiconfig or not. Since this variable is only available on CMake 3.9 or higher, we'll try to make an educated guess on a lower CMake version. --- dtool/Config.cmake | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 9e14cd31b4..e8bfd4c0ac 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -22,13 +22,30 @@ if(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(IS_FREEBSD 1) endif() +if(CMAKE_VERSION VERSION_GREATER "3.8") + get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) +else() + message(WARNING "Multi-configuration builds may not work properly when using +a CMake < 3.9. Making a guess if this is a multi-config generator.") + if(DEFINED CMAKE_CONFIGURATION_TYPES) + set(IS_MULTICONFIG ON) + else() + set(IS_MULTICONFIG OFF) + endif() +endif() # Define the type of build we are setting up. -if(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo) +if(IS_MULTICONFIG) + set(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo Debug MinSizeRel Distribution) +else() + # CMAKE_BUILD_TYPE can't just be set using the usual set(CACHE) method since + # it's an empty string by default. + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE RelWithDebInfo) + endif() + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS + Release RelWithDebInfo Debug MinSizeRel Distribution) endif() -set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - Release RelWithDebInfo Debug MinSizeRel Distribution) # Provide convenient boolean expression based on build type if(CMAKE_BUILD_TYPE MATCHES "Debug") From 3eb189581183390e5a27440c6c4e3acf62fb39ef Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 5 Jun 2019 12:52:50 -0500 Subject: [PATCH 647/744] CMake: Use a generator expression to mitigate make's warning spam on the Xcode generator. --- cmake/macros/Python.cmake | 9 ++++++++- dtool/CompilerFlags.cmake | 16 +++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index cb8edad227..959e24c861 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -51,7 +51,14 @@ function(add_python_target target) target_link_libraries(${target} PKG::PYTHON) if(BUILD_SHARED_LIBS) - set(_outdir "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${slash_namespace}") + if(CMAKE_GENERATOR STREQUAL "Xcode") + # This is explained in CompilerFlags.cmake + set(intdir $$(EFFECTIVE_PLATFORM_NAME)) + else() + set(intdir ${CMAKE_CFG_INTDIR}) + endif() + + set(_outdir "${PROJECT_BINARY_DIR}/${intdir}/${slash_namespace}") set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${_outdir}" diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 644135dd72..ba8e5a829d 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -29,9 +29,19 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Set up the output directory structure, mimicking that of makepanda set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib") + +if(CMAKE_GENERATOR STREQUAL "Xcode") + # On the Xcode generator, CMake generates a separate make target definition for + # every config, so it ends up spamming warnings once we try to build. + set(intdir $$(EFFECTIVE_PLATFORM_NAME)) +else() + set(intdir ${CMAKE_CFG_INTDIR}) +endif() + +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/lib") + set(MODULE_DESTINATION "lib") # Runtime code assumes that dynamic modules have a "lib" prefix; Windows From 20db4115b865f06732069a492bd3ab6afd818770 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 5 Jun 2019 13:27:46 -0500 Subject: [PATCH 648/744] CMake: Add temporary solution for generating dtool_config.h Eventually, we'll want to customize dtool_config.h based on the configuration being used, but this should be good enough for now. --- CMakeLists.txt | 6 ++++++ dtool/LocalSetup.cmake | 9 ++++++++- panda/src/configfiles/CMakeLists.txt | 4 ++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ec2e26ce9..c576dcfac7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,12 @@ enable_testing() set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/macros/") +if(CMAKE_VERSION VERSION_GREATER "3.8") + # When using the Xcode generator, don't append the platform name to the + # intermediate configuration directory. + set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME OFF) +endif() + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index aa0b5f2dad..ed2df723c7 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -193,7 +193,14 @@ else() set(intdir "${CMAKE_BUILD_TYPE}") endif() -configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/${intdir}/include/dtool_config.h") +configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") + +# TODO: Add the ability to customize dtool_config.h based on configuration. +if(IS_MULTICONFIG) + file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/$/include/dtool_config.h" + INPUT "${PROJECT_BINARY_DIR}/include/dtool_config.h") +endif() + install(FILES "${PROJECT_BINARY_DIR}/${intdir}/include/dtool_config.h" COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index 7fa2db7a41..101ed67556 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -24,5 +24,9 @@ else() endif() configure_file(panda.prc.in "${CMAKE_BINARY_DIR}/etc/20_panda.prc") +if(IS_MULTICONFIG) + file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/$/etc/20_panda.prc" + INPUT "${PROJECT_BINARY_DIR}/etc/20_panda.prc") +endif() install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" COMPONENT Core DESTINATION etc) From f0b4d7637b4f1e19fa4f8252323b975850f895b9 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Tue, 4 Jun 2019 14:23:49 -0500 Subject: [PATCH 649/744] CMake: Separate composite files by extension. --- cmake/macros/CompositeSources.cmake | 129 ++++++++++++++++---------- direct/src/showbase/CMakeLists.txt | 4 - dtool/src/dtoolutil/CMakeLists.txt | 1 - panda/src/cocoadisplay/CMakeLists.txt | 1 - 4 files changed, 81 insertions(+), 54 deletions(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 1a0b8bbd0d..8d33825808 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -12,9 +12,6 @@ # composite_sources(my_lib MY_SOURCES) # add_library(my_lib ${MY_SOURCES}) # -# TODO: Only supports .cxx files so far, not yet .mm files -# It should probably sort the files by extension (.c, .cxx, .mm) first. -# # Settings for composite builds. Should be moved to Config.cmake? @@ -23,8 +20,8 @@ set(COMPOSITE_SOURCE_LIMIT "30" CACHE STRING known as SCU (single compilation unit). A high value will speed up the build dramatically but will be more memory intensive than a low value.") -set(COMPOSITE_SOURCE_EXTENSIONS ".cxx;.mm" CACHE STRING - "Only files of these extensions will be added to composite files.") +set(COMPOSITE_SOURCE_EXTENSIONS ".cxx;.mm;.c" CACHE STRING + "Only files of these extensions will be composited.") set(COMPOSITE_SOURCE_EXCLUSIONS "" CACHE STRING "A list of targets to skip when compositing sources. This is mainly @@ -47,57 +44,93 @@ function(composite_sources target sources_var) return() endif() - set(composite_files "") - set(composite_sources "") - - while(num_sources GREATER 0) - # Pop the first element - list(GET sources 0 source) - list(REMOVE_AT sources 0) - list(LENGTH sources num_sources) - - # Check if we can safely add this to a composite file. + # Sort each source file into a list. + foreach(source ${sources}) + get_filename_component(extension "${source}" EXT) get_source_file_property(generated "${source}" GENERATED) get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) get_source_file_property(skip_compositing "${source}" SKIP_COMPOSITING) - get_filename_component(extension "${source}" EXT) + # Check if we can safely add this to a composite file. if(NOT generated AND NOT is_header AND NOT skip_compositing AND ";${COMPOSITE_SOURCE_EXTENSIONS};" MATCHES ";${extension};") - # Add it to composite_sources. - list(APPEND composite_sources ${source}) - list(LENGTH composite_sources num_composite_sources) - if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT}) - # It's pointless to make a composite source from just one file. - if(num_composite_sources GREATER 1) - - # Figure out the name of our composite file. - list(LENGTH composite_files index) - math(EXPR index "1+${index}") - set(composite_file "${CMAKE_CURRENT_BINARY_DIR}/${target}_composite${index}.cxx") - list(APPEND composite_files "${composite_file}") - - # Set HEADER_FILE_ONLY to prevent it from showing up in the - # compiler command, but still show up in the IDE environment. - set_source_files_properties(${composite_sources} PROPERTIES HEADER_FILE_ONLY ON) - - # We'll interrogate the composite files, so exclude the original sources. - set_source_files_properties(${composite_sources} PROPERTIES WRAP_EXCLUDE YES) - - # Finally, add the target that generates the composite file. - add_custom_command( - OUTPUT "${composite_file}" - COMMAND ${CMAKE_COMMAND} - -DCOMPOSITE_FILE="${composite_file}" - -DCOMPOSITE_SOURCES="${composite_sources}" - -P "${COMPOSITE_GENERATOR}" - DEPENDS ${composite_sources}) - - # Reset for the next composite file. - set(composite_sources "") - endif() + if(NOT DEFINED sources_${extension}) + set(sources_${extension}) endif() + + # Append it to one of the lists. + list(APPEND sources_${extension} "${source}") + endif() + endforeach(source) + + # Now, put it all into one big list! + set(sorted_sources) + foreach(extension ${COMPOSITE_SOURCE_EXTENSIONS}) + if(DEFINED sources_${extension}) + list(APPEND sorted_sources ${sources_${extension}}) + endif() + endforeach(extension) + + set(composite_files) + set(composite_sources) + + # Fill in composite_ext so we can kick off the loop. + list(GET sorted_sources 0 first_source) + get_filename_component(first_source_ext "${first_source}" EXT) + set(composite_ext ${first_source_ext}) + + while(num_sources GREATER 0) + # Pop the first element and adjust the sorted_sources length accordingly. + list(GET sorted_sources 0 source) + list(REMOVE_AT sorted_sources 0) + list(LENGTH sorted_sources num_sources) + + # Add this file to our composite_sources buffer. + list(APPEND composite_sources ${source}) + list(LENGTH composite_sources num_composite_sources) + + # Get the next source file's extension, so we can see if we're done with + # this set of source files. + if(num_sources GREATER 0) + list(GET sorted_sources 0 next_source) + get_filename_component(next_extension "${next_source}" EXT) + else() + set(next_extension "") + endif() + + # Check if this is the point where we should cut the file. + if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT} + OR NOT composite_ext STREQUAL next_extension) + # It's pointless to make a composite source from just one file. + if(num_composite_sources GREATER 1) + + # Figure out the name of our composite file. + list(LENGTH composite_files index) + math(EXPR index "1+${index}") + set(composite_file "${CMAKE_CURRENT_BINARY_DIR}/${target}_composite${index}${composite_ext}") + list(APPEND composite_files "${composite_file}") + + # Set HEADER_FILE_ONLY to prevent it from showing up in the + # compiler command, but still show up in the IDE environment. + set_source_files_properties(${composite_sources} PROPERTIES HEADER_FILE_ONLY ON) + + # We'll interrogate the composite files, so exclude the original sources. + set_source_files_properties(${composite_sources} PROPERTIES WRAP_EXCLUDE YES) + + # Finally, add the target that generates the composite file. + add_custom_command( + OUTPUT "${composite_file}" + COMMAND ${CMAKE_COMMAND} + -DCOMPOSITE_FILE="${composite_file}" + -DCOMPOSITE_SOURCES="${composite_sources}" + -P "${COMPOSITE_GENERATOR}" + DEPENDS ${composite_sources}) + endif() + + # Reset for the next composite file. + set(composite_sources "") + set(composite_ext ${next_extension}) endif() endwhile() diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 571f36a1f0..348098aaf9 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -13,10 +13,6 @@ endif() add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE ${P3SHOWBASE_HEADERS} ${P3SHOWBASE_SOURCES}) -if(APPLE) - set_target_properties(p3showbase PROPERTIES COMPILE_FLAGS "-ObjC++") -endif() - target_link_libraries(p3showbase p3directbase panda) target_interrogate(p3showbase ALL) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index efc0dbdc97..98b374987b 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -79,7 +79,6 @@ target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS}) target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT}) if(APPLE) - set_target_properties(p3dtoolutil PROPERTIES COMPILE_FLAGS "-ObjC++") find_library(FOUNDATION_LIBRARY Foundation) find_library(APPKIT_LIBRARY AppKit) target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY}) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 6c5058d8a0..413eb1426d 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -31,7 +31,6 @@ set(P3COCOADISPLAY_SOURCES composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES) add_component_library(p3cocoadisplay SYMBOL BUILDING_PANDA_COCOADISPLAY ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES}) -set_target_properties(p3cocoadisplay PROPERTIES COMPILE_FLAGS "-ObjC++") target_link_libraries(p3cocoadisplay p3glgsg panda) # Frameworks: From 89bc83c48f91bf7d74378207cda6373846d7d898 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Sun, 23 Jun 2019 17:05:45 -0500 Subject: [PATCH 650/744] CMake: Suppress $(EFFECTIVE_PLATFORM_NAME). --- CMakeLists.txt | 14 ++++++++------ cmake/macros/Interrogate.cmake | 12 ++++++------ cmake/macros/Python.cmake | 6 +++--- dtool/CompilerFlags.cmake | 6 +++--- dtool/LocalSetup.cmake | 2 +- dtool/src/dtoolbase/CMakeLists.txt | 2 +- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c576dcfac7..bf07746e62 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,8 @@ unset(_version) enable_testing() +string(REPLACE "$(EFFECTIVE_PLATFORM_NAME)" "" PANDA_CFG_INTDIR "${CMAKE_CFG_INTDIR}") + # Add generic modules to cmake module path, # and add Panda3D specific modules to cmake module path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") @@ -72,30 +74,30 @@ endif() if(BUILD_MODELS) run_pzip(models "${CMAKE_CURRENT_SOURCE_DIR}/models/" - "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" + "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models" *.egg) run_pzip(dmodels "${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" - "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" + "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models" *.egg) add_custom_command(TARGET models POST_BUILD COMMAND ${CMAKE_COMMAND} -DSOURCE="${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" - -DDESTINATION="${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models/maps" + -DDESTINATION="${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models/maps" -P ${PROJECT_SOURCE_DIR}/cmake/scripts/CopyPattern.cmake COMMENT "Copying models/maps") add_custom_command(TARGET dmodels POST_BUILD COMMAND ${CMAKE_COMMAND} -DSOURCE="${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" - -DDESTINATION="${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" + -DDESTINATION="${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models" -DFILES_MATCHING="PATTERN;*.rgb;PATTERN;*.png;PATTERN;*.jpg;PATTERN;*.wav" -P ${PROJECT_SOURCE_DIR}/cmake/scripts/CopyPattern.cmake COMMENT "Copying dmodels' assets") - install(DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/models" + install(DIRECTORY "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models" COMPONENT Models DESTINATION share/panda3d) endif() @@ -104,7 +106,7 @@ if(INTERROGATE_PYTHON_INTERFACE) # for pytest before adding this test. If the user doesn't have pytest, we'd # like for the tests to fail. - if(CMAKE_CFG_INTDIR STREQUAL ".") + if(PANDA_CFG_INTDIR STREQUAL ".") set(_workdir "${PROJECT_BINARY_DIR}") else() set(_workdir "${PROJECT_BINARY_DIR}/$") diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index c50eabcecd..7d646f5045 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -113,7 +113,7 @@ function(target_interrogate target) # Also store where the build files are kept, so the Interrogate output can go # there as well. set_target_properties("${target}" PROPERTIES - TARGET_BINDIR "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + TARGET_BINDIR "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}") endfunction(target_interrogate) @@ -313,7 +313,7 @@ function(add_python_module module) get_target_property(workdir_abs "${target}" TARGET_BINDIR) if(NOT workdir_abs) # No TARGET_BINDIR was set, so we'll just use our current directory: - set(workdir_abs "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") + set(workdir_abs "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}") endif() # Keep command lines short file(RELATIVE_PATH workdir_rel "${CMAKE_CURRENT_BINARY_DIR}" "${workdir_abs}") @@ -331,11 +331,11 @@ function(add_python_module module) endforeach(target) add_custom_command( - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" COMMAND ${CMAKE_COMMAND} -E - make_directory "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + make_directory "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}" COMMAND host_interrogate_module - -oc "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" + -oc "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" -module ${modname} -library ${modname} ${import_flags} ${INTERROGATE_MODULE_OPTIONS} @@ -344,7 +344,7 @@ function(add_python_module module) COMMENT "Generating module ${module}") add_python_target(${module} COMPONENT "${component}" EXPORT "${component}" - "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${module}_module.cxx" + "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" ${sources_abs} ${extensions}) target_link_libraries(${module} ${link_targets}) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 959e24c861..9c01024e01 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -53,9 +53,9 @@ function(add_python_target target) if(BUILD_SHARED_LIBS) if(CMAKE_GENERATOR STREQUAL "Xcode") # This is explained in CompilerFlags.cmake - set(intdir $$(EFFECTIVE_PLATFORM_NAME)) + set(intdir $) else() - set(intdir ${CMAKE_CFG_INTDIR}) + set(intdir ${PANDA_CFG_INTDIR}) endif() set(_outdir "${PROJECT_BINARY_DIR}/${intdir}/${slash_namespace}") @@ -146,7 +146,7 @@ function(install_python_package package_name) set(src_path "${CMAKE_SOURCE_DIR}/cmake/templates/win32_python") endif() - set(path "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${package_name}") + set(path "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${package_name}") set(args -D "OUTPUT_DIR=${path}") if(src_path) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index ba8e5a829d..f22284b39b 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -33,9 +33,9 @@ set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") if(CMAKE_GENERATOR STREQUAL "Xcode") # On the Xcode generator, CMake generates a separate make target definition for # every config, so it ends up spamming warnings once we try to build. - set(intdir $$(EFFECTIVE_PLATFORM_NAME)) + set(intdir $) else() - set(intdir ${CMAKE_CFG_INTDIR}) + set(intdir ${PANDA_CFG_INTDIR}) endif() set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/bin") @@ -54,7 +54,7 @@ if(WIN32) set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # On Windows, modules (DLLs) are located in bin; lib is just for .lib files - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/bin") if(BUILD_SHARED_LIBS) set(MODULE_DESTINATION "bin") endif() diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index ed2df723c7..f11edfa4b0 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -185,7 +185,7 @@ message("See dtool_config.h for more details about the specified configuration." message("") # Generate dtool_config.h -if("${CMAKE_CFG_INTDIR}" STREQUAL ".") +if("${PANDA_CFG_INTDIR}" STREQUAL ".") # Single-configuration generator set(intdir ".") else() diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index be2cc44394..e2bfc81b90 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -91,7 +91,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE # Help other libraries find the autogenerated headers target_include_directories(p3dtoolbase PUBLIC $ - $) + $) target_link_libraries(p3dtoolbase PKG::EIGEN PKG::THREADS) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) From 10abe6e216c45c7259876af82361903173ef9042 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Mon, 24 Jun 2019 11:56:00 -0500 Subject: [PATCH 651/744] CMake: Remove usages of string(APPEND ...) --- cmake/macros/PackageConfig.cmake | 12 ++++++------ dtool/CompilerFlags.cmake | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 03fb49ff2f..8c1cf70ee5 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -301,10 +301,10 @@ function(export_packages filename) set(exports "# Exports for Panda3D PKG:: packages\n") foreach(pkg ${_ALL_PACKAGE_OPTIONS}) - string(APPEND exports "\n# Create imported target PKG::${pkg}\n") - string(APPEND exports "add_library(PKG::${pkg} INTERFACE IMPORTED)\n\n") + set(exports "${exports}\n# Create imported target PKG::${pkg}\n") + set(exports "${exports}add_library(PKG::${pkg} INTERFACE IMPORTED)\n\n") - string(APPEND exports "set_target_properties(PKG::${pkg} PROPERTIES\n") + set(exports "${exports}set_target_properties(PKG::${pkg} PROPERTIES\n") foreach(prop INTERFACE_COMPILE_DEFINITIONS INTERFACE_COMPILE_FEATURES @@ -318,7 +318,7 @@ function(export_packages filename) INTERFACE_SOURCES) set(prop_ex "$") - string(APPEND exports "$<$: ${prop} \"${prop_ex}\"\n>") + set(exports "${exports}$<$: ${prop} \"${prop_ex}\"\n>") endforeach(prop) @@ -412,9 +412,9 @@ function(export_packages filename) endif() endwhile(stack) - string(APPEND exports " INTERFACE_LINK_LIBRARIES \"${libraries}\"\n") + set(exports "${exports} INTERFACE_LINK_LIBRARIES \"${libraries}\"\n") - string(APPEND exports ")\n") + set(exports "${exports})\n") endforeach(pkg) file(GENERATE OUTPUT "${filename}" CONTENT "${exports}") diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index f22284b39b..5bda795d14 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -13,9 +13,9 @@ include(CheckCXXCompilerFlag) if(CMAKE_VERSION VERSION_LESS "3.1") check_cxx_compiler_flag("-std=gnu++11" COMPILER_SUPPORTS_CXX11) if(COMPILER_SUPPORTS_CXX11) - string(APPEND CMAKE_CXX_FLAGS " -std=gnu++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") else() - string(APPEND CMAKE_CXX_FLAGS " -std=gnu++0x") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x") endif() else() @@ -79,26 +79,26 @@ endforeach(_type) # Set warning levels if(MSVC) - string(APPEND CMAKE_C_FLAGS " /W3") - string(APPEND CMAKE_CXX_FLAGS " /W3") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") + set(CMAKE_CCXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") else() - string(APPEND CMAKE_C_FLAGS " -Wall") - string(APPEND CMAKE_CXX_FLAGS " -Wall") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall") endif() if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") set(disable_flags "-Wno-unused-function -Wno-unused-parameter") - string(APPEND CMAKE_C_FLAGS " ${disable_flags}") - string(APPEND CMAKE_CXX_FLAGS " ${disable_flags} -Wno-reorder") - string(APPEND CMAKE_CXX_FLAGS_RELEASE " -Wno-unused-variable") - string(APPEND CMAKE_CXX_FLAGS_RELWITHDEBINFO " -Wno-unused-variable") - string(APPEND CMAKE_CXX_FLAGS_MINSIZEREL " -Wno-unused-variable") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") if(MSVC) - # Clang behaving as MSVC - string(APPEND CMAKE_C_FLAGS " -Wno-unused-command-line-argument") + # Clang behaving as MSVC` + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") endif() From 7a3ea071a454fe1c7a0bef9ca4ada96d58248c75 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Thu, 27 Jun 2019 08:34:34 -0500 Subject: [PATCH 652/744] CMake: Don't use X11 on Apple. --- dtool/Package.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 4c1966c218..51e227649d 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -491,7 +491,10 @@ package_status(CG "Nvidia Cg Shading Language" "${cg_apis}") # # X11 (and GLX) -find_package(X11 QUIET) + +if(NOT APPLE) + find_package(X11 QUIET) +endif() if(NOT X11_Xkb_FOUND OR NOT X11_Xutil_FOUND) # Panda implicitly requires these supplementary X11 libs; if we can't find From 603e240788b91676487dbafc9f5ad961cfb3bd56 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 26 Jun 2019 21:39:07 -0500 Subject: [PATCH 653/744] CMake: Allow for config-specific dtool-config vars This makes it so some options can be toggled on a per-configuration basis (for multi-config generators), as long as they don't affect what targets are actually being generated. --- dtool/Config.cmake | 22 +++++++++++++++++----- dtool/LocalSetup.cmake | 26 +++++++++++++++++++++----- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index e8bfd4c0ac..5cadea605b 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -72,6 +72,7 @@ else() set(IS_NOT_DIST_BUILD True) endif() +set(PER_CONFIG_OPTIONS) # Are we building with static or dynamic linking? option(BUILD_SHARED_LIBS @@ -312,12 +313,16 @@ enables you to define the variable 'track-memory-usage' at runtime to help track memory leaks, and also report total memory usage on PStats. There is some small overhead for having this ability available, even if it is unused." ${IS_DEBUG_BUILD}) +list(APPEND PER_CONFIG_OPTIONS DO_MEMORY_USAGE) +set(DO_MEMORY_USAGE_Debug ON CACHE BOOL "") option(SIMULATE_NETWORK_DELAY "This option compiles in support for simulating network delay via the min-lag and max-lag prc variables. It adds a tiny bit of overhead even when it is not activated, so it is typically enabled only in a development build." ${IS_DEBUG_BUILD}) +list(APPEND PER_CONFIG_OPTIONS SIMULATE_NETWORK_DELAY) +set(SIMULATE_NETWORK_DELAY_Debug ON CACHE BOOL "") option(SUPPORT_IMMEDIATE_MODE "This option compiles in support for immediate-mode OpenGL @@ -326,11 +331,15 @@ buggy drivers, and since there is a tiny bit of per-primitive overhead to have this option available even if it is unused, it is by default enabled only in a development build. This has no effect on DirectX rendering." ${IS_DEBUG_BUILD}) +list(APPEND PER_CONFIG_OPTIONS SUPPORT_IMMEDIATE_MODE) +set(SUPPORT_IMMEDIATE_MODE_Debug ON CACHE BOOL "") option(NOTIFY_DEBUG "Do you want to include the 'debug' and 'spam' Notify messages? Normally, these are stripped out when we build for release, but sometimes it's useful to keep them around. Turn this setting on to achieve that." ${IS_DEBUG_BUILD}) +list(APPEND PER_CONFIG_OPTIONS NOTIFY_DEBUG) +set(NOTIFY_DEBUG_Debug ON CACHE BOOL "") option(SUPPORT_FIXED_FUNCTION "This option compiles in support for the fixed-function OpenGL @@ -423,7 +432,7 @@ if(WIN32 AND IS_DEBUG_BUILD) else() set(USE_DEBUG_PYTHON OFF) endif() - +list(APPEND PER_CONFIG_OPTIONS USE_DEBUG_PYTHON) option(HAVE_VIDEO4LINUX "Set this to enable webcam support on Linux." ${IS_LINUX}) @@ -578,6 +587,8 @@ slightly slow down Panda for the single CPU case." # Configure debug threads option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ${IS_DEBUG_BUILD}) +list(APPEND PER_CONFIG_OPTIONS DEBUG_THREADS) +set(DEBUG_THREADS_Debug ON CACHE BOOL "") option(SIMPLE_THREADS "If on, compile with simulated threads. Threads, by default, use @@ -587,7 +598,7 @@ On the other hand, compiling in this full OS-provided support can impose some substantial runtime overhead, making the application run slower on a single-CPU machine. This settings avoid the overhead, but still gain some of the basic functionality of threads." OFF) - +list(APPEND PER_CONFIG_OPTIONS SIMPLE_THREADS) option(OS_SIMPLE_THREADS "If on, OS threading constructs will be used to perform context switches. @@ -596,7 +607,7 @@ normal SIMPLE_THREADS optimizations still apply, and the normal SIMPLE_THREADS scheduler is used to switch between threads (instead of the OS scheduler). This may be more portable and more reliable, but it is a hybrid between user-space threads and os-provided threads." ON) - +list(APPEND PER_CONFIG_OPTIONS OS_SIMPLE_THREADS) ### Configure pipelining ### option(DO_PIPELINING "If on, compile with pipelined rendering." ON) @@ -605,8 +616,9 @@ option(DO_PIPELINING "If on, compile with pipelined rendering." ON) option(COMPILE_IN_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. -When turned off, the generated library will save a few kilobytes." - ${IS_NOT_MINSIZE_BUILD}) +When turned off, the generated library will save a few kilobytes." ${IS_NOT_MINSIZE_BUILD}) +list(APPEND PER_CONFIG_OPTIONS COMPILE_IN_DEFAULT_FONT) +set(COMPILE_IN_DEFAULT_FONT_MinSizeRel OFF CACHE BOOL "") option(STDFLOAT_DOUBLE "Define this true to compile a special version of Panda to use a diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index f11edfa4b0..70cf8d6683 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -193,12 +193,28 @@ else() set(intdir "${CMAKE_BUILD_TYPE}") endif() -configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") - -# TODO: Add the ability to customize dtool_config.h based on configuration. if(IS_MULTICONFIG) - file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/$/include/dtool_config.h" - INPUT "${PROJECT_BINARY_DIR}/include/dtool_config.h") + foreach(config ${CMAKE_CONFIGURATION_TYPES}) + foreach(option ${PER_CONFIG_OPTIONS}) + # Check for the presence of a config-specific option, and override what's + # in the cache if there is. + if(DEFINED ${option}_${config}) + set(${option} ${${option}_${config}}) + endif() + endforeach(option) + + # Generate a dtool_config.h for this specific config + configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/${config}/include/dtool_config.h") + + # unset() does not unset CACHE variables by default, just normal variables. + # By doing this we're reverting back to what was in the cache. + foreach(option ${PER_CONFIG_OPTIONS}) + unset(${option}) + endforeach(option) + endforeach(config) +else() + # Just configure things like normal. + configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") endif() install(FILES "${PROJECT_BINARY_DIR}/${intdir}/include/dtool_config.h" From 3160c77bc326a00ed0101f7dcb8f568e833b4ca3 Mon Sep 17 00:00:00 2001 From: Donny Lawrence Date: Wed, 26 Jun 2019 22:05:32 -0500 Subject: [PATCH 654/744] CMake: MODULEs should use .dylib, not .so --- dtool/CompilerFlags.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 5bda795d14..6deacff59b 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -60,6 +60,12 @@ if(WIN32) endif() endif() +# Though not technically correct, we'll still want MODULE type libraries +# (used for display and audio plugins) to use a .dylib extension. +if(APPLE) + set(CMAKE_SHARED_MODULE_SUFFIX ".dylib") +endif() + # Since we're using CMAKE_CFG_INTDIR to put everything in a # configuration-specific subdirectory when building on a multi-config # generator, we need to suppress the usual configuration name appending From e3cd658642fcf40c9d27c55076b93640518259c9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 7 Jul 2019 16:08:44 -0600 Subject: [PATCH 655/744] CMake: C++ code in direct.distributed should be an extension This code is so heavily dependent on Python (and makepanda doesn't even build it into libp3direct) that we shouldn't even try to put it in the libp3direct library ourselves. --- direct/CMakeLists.txt | 3 +++ direct/src/distributed/CMakeLists.txt | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 18847d4b9b..48d563eb06 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -20,6 +20,9 @@ set(P3DIRECT_COMPONENTS ) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) + get_target_property(_p3distributed_exts p3distributed IGATE_EXTENSIONS) + set_source_files_properties(${_p3distributed_exts} + PROPERTIES COMPILE_DEFINITIONS BUILDING_DIRECT_DISTRIBUTED) endif() set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "DirectDevel") diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index a5486d56c7..26f8f2414b 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -16,10 +16,10 @@ set(P3DISTRIBUTED_SOURCES cDistributedSmoothNodeBase.cxx ) -add_component_library(p3distributed SYMBOL BUILDING_DIRECT_DISTRIBUTED - ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) -target_link_libraries(p3distributed p3directbase p3dcparser panda PKG::PYTHON) -target_interrogate(p3distributed ALL) +add_component_library(p3distributed NOINIT SYMBOL BUILDING_DIRECT_DISTRIBUTED + ${P3DISTRIBUTED_HEADERS}) +target_link_libraries(p3distributed p3directbase p3dcparser panda) +target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_SOURCES}) if(NOT BUILD_METALIBS) install(TARGETS p3distributed From 1bd15dad60f7836a88639aed413f2740585d8994 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 10 Jul 2019 14:30:29 -0600 Subject: [PATCH 656/744] CMake: Manually set p3distributed's linker language It doesn't contain any source files anymore (see last commit), so for non-metalib builds, this is necessary for CMake to understand how to invoke the linker/archiver. --- direct/src/distributed/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 26f8f2414b..51a5dc7817 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -18,6 +18,7 @@ set(P3DISTRIBUTED_SOURCES add_component_library(p3distributed NOINIT SYMBOL BUILDING_DIRECT_DISTRIBUTED ${P3DISTRIBUTED_HEADERS}) +set_target_properties(p3distributed PROPERTIES LINKER_LANGUAGE CXX) target_link_libraries(p3distributed p3directbase p3dcparser panda) target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_SOURCES}) From 82d14d98d4ec91b3a4f48f2da5121678512d3f44 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 12 Aug 2019 19:07:20 -0600 Subject: [PATCH 657/744] travis: Fix Python version detection under newer CMake --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index f89aabe267..a906a91836 100644 --- a/.travis.yml +++ b/.travis.yml @@ -96,6 +96,7 @@ script: -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $PY2_CMAKE_ARGS .. else cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ + -DWANT_PYTHON_VERSION=$(python -V 2>&1 | cut -d' ' -f2) \ -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. fi From d008037244601f795a73c7202b1e85808ef0def5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 15 Aug 2019 15:05:37 -0600 Subject: [PATCH 658/744] CMake: Use Python::Module, not Python::Python, for extension linkage CMake 3.15+ provides the former, which extension modules should link against in order to ensure the ABI-appropriate linkage for the platform. For older versions of CMake, try to hack up the correct linkage for the platform. If the platform isn't recognized, tell the user to upgrade CMake. This also tweaks p3pystub just a bit, since now it's actually relied upon to resolve runtime link issues when p3dcparse pulls in direct, as p3dcparse doesn't link against Python at all. --- direct/src/dcparse/CMakeLists.txt | 2 +- dtool/Package.cmake | 37 +++++++++++++++++++++++++++- dtool/src/interrogate/CMakeLists.txt | 2 +- dtool/src/pystub/CMakeLists.txt | 7 +++++- panda/src/testbed/CMakeLists.txt | 2 +- 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index 747f5896b2..c84e8ecd15 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(p3dcparse dcparse.cxx) -target_link_libraries(p3dcparse p3direct) +target_link_libraries(p3dcparse p3direct p3pystub) install(TARGETS p3dcparse EXPORT Direct COMPONENT Direct DESTINATION bin) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 51e227649d..dca10e6ccc 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -11,6 +11,7 @@ if(Python_FOUND) set(PYTHON_FOUND ON) set(PYTHON_EXECUTABLE ${Python_EXECUTABLE}) set(PYTHON_INCLUDE_DIRS ${Python_INCLUDE_DIRS}) + set(PYTHON_LIBRARY_DIRS ${Python_LIBRARY_DIRS}) set(PYTHON_VERSION_STRING ${Python_VERSION}) else() @@ -27,11 +28,45 @@ else() endif() +if(CMAKE_VERSION VERSION_LESS "3.15") + # CMake versions this old don't provide Python::Module, so we need to hack up + # the variables to ensure no explicit linkage against libpython occurs + + if(WIN32) + # Nothing needed here; explicit linkage is appropriate + set(PYTHON_LIBRARY "${Python_LIBRARY}") + set(PYTHON_LIBRARIES ${Python_LIBRARIES}) + + elseif(APPLE OR UNIX) + # Just unset and let the implicit linkage take over + set(PYTHON_LIBRARY "") + set(PYTHON_LIBRARIES "") + + if(APPLE) + # macOS requires this explicit flag on the linker command line to allow the + # references to the Python symbols to resolve at dynamic link time + string(APPEND CMAKE_MODULE_LINKER_FLAGS " -undefined dynamic_lookup") + # TODO: p3dcparser contains some direct Python references; get rid of + # this once that's gone + string(APPEND CMAKE_SHARED_LINKER_FLAGS " -undefined dynamic_lookup") + + endif() + + else() + # On every other platform, guessing is a bad idea - insist the user upgrade + # their CMake instead. + message(WARNING "For Python support on this platform, please use CMake >= 3.15!") + set(PYTHON_FOUND OFF) + + endif() + +endif() + package_option(PYTHON DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE is also enabled, Python bindings will be generated." - IMPORTED_AS Python::Python) + IMPORTED_AS Python::Module) # Also detect the optimal install paths: if(HAVE_PYTHON) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 2ddc367aa7..86431b2bfa 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -60,7 +60,7 @@ set(INTERROGATE_PREAMBLE_PYTHON_NATIVE composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) -target_link_libraries(interrogate p3cppParser p3dtoolconfig p3pystub +target_link_libraries(interrogate p3cppParser p3dtoolconfig PKG::OPENSSL) # Python preamble for interrogate_module diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index 70b7b85898..b4f6f5a4a2 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -1,6 +1,11 @@ set(P3PYSTUB_HEADERS pystub.h) set(P3PYSTUB_SOURCES pystub.cxx) -add_library(p3pystub STATIC ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) +add_library(p3pystub ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) target_link_libraries(p3pystub p3dtool) install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(TARGETS p3pystub + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index e44ce3a2a5..8170c13d55 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -5,5 +5,5 @@ if(NOT BUILD_PANDATOOL) endif() add_executable(pview pview.cxx) -target_link_libraries(pview p3framework p3pystub) +target_link_libraries(pview p3framework) install(TARGETS pview EXPORT Tools COMPONENT Tools DESTINATION bin) From 31c9a88dcf3eda091f0513cb88e9f5ab34d5aa67 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 15 Aug 2019 16:47:40 -0600 Subject: [PATCH 659/744] CMake: Ugh, just give p3distributed a dummy .cxx instead Windows won't even create the .lib unless there's at least one source file. Whatever, this is easy to do. --- direct/src/distributed/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 51a5dc7817..10633d4d17 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -16,9 +16,12 @@ set(P3DISTRIBUTED_SOURCES cDistributedSmoothNodeBase.cxx ) +# Workaround for Windows which just *insists* on having something to build +set(P3DISTRIBUTED_EMPTY "${CMAKE_CURRENT_BINARY_DIR}/empty.cxx") +file(WRITE ${P3DISTRIBUTED_EMPTY} "") + add_component_library(p3distributed NOINIT SYMBOL BUILDING_DIRECT_DISTRIBUTED - ${P3DISTRIBUTED_HEADERS}) -set_target_properties(p3distributed PROPERTIES LINKER_LANGUAGE CXX) + ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_EMPTY}) target_link_libraries(p3distributed p3directbase p3dcparser panda) target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_SOURCES}) From b9e50da3ce9dca84241e04a4becf33bb6e994ce6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 19 Aug 2019 18:23:27 -0600 Subject: [PATCH 660/744] CMake: p3distort is NOT a component; it's its own pandafx library --- panda/CMakeLists.txt | 3 ++- panda/metalibs/panda/CMakeLists.txt | 2 +- panda/src/distort/CMakeLists.txt | 22 ++++++++++------------ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index a223e3e25f..0d32c9e7a1 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -81,7 +81,7 @@ add_subdirectory(metalibs/pandaphysics) # Now add the Python modules: set(CORE_MODULE_COMPONENTS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3downloader p3dxml p3event p3express p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pstatclient p3putil p3recorder p3text p3tform @@ -122,6 +122,7 @@ if(INTERROGATE_PYTHON_INTERFACE) export_targets(EggPython NAMESPACE "Panda3D::Python::" COMPONENT EggDevel) endif() + add_python_module(panda3d.fx pandafx IMPORT panda3d.core) add_python_module(panda3d.physics p3physics p3particlesystem LINK pandaphysics IMPORT panda3d.core) if(HAVE_ODE) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 260dc5294c..b43ded4701 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -1,5 +1,5 @@ set(PANDA_LINK_TARGETS - p3chan p3char p3collide p3cull p3device p3dgraph p3display p3distort p3dxml + p3chan p3char p3collide p3cull p3device p3dgraph p3display p3dxml p3event p3gobj p3grutil p3gsgbase p3linmath p3mathutil p3movies p3parametrics p3pgraph p3pgraphnodes p3pgui p3pipeline p3pnmimage p3pnmimagetypes p3pstatclient p3putil p3recorder p3text p3tform diff --git a/panda/src/distort/CMakeLists.txt b/panda/src/distort/CMakeLists.txt index 9711656648..6084e8a92e 100644 --- a/panda/src/distort/CMakeLists.txt +++ b/panda/src/distort/CMakeLists.txt @@ -18,17 +18,15 @@ set(P3DISTORT_SOURCES pSphereLens.cxx ) -composite_sources(p3distort P3DISTORT_SOURCES) -add_component_library(p3distort SYMBOL BUILDING_PANDAFX - ${P3DISTORT_HEADERS} ${P3DISTORT_SOURCES}) -target_link_libraries(p3distort p3pgraphnodes p3display) -target_interrogate(p3distort ALL) +composite_sources(pandafx P3DISTORT_SOURCES) +add_library(pandafx ${P3DISTORT_HEADERS} ${P3DISTORT_SOURCES}) +set_target_properties(pandafx PROPERTIES DEFINE_SYMBOL BUILDING_PANDAFX) +target_link_libraries(pandafx panda) +target_interrogate(pandafx ALL) -if(NOT BUILD_METALIBS) - install(TARGETS p3distort - EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - ARCHIVE COMPONENT CoreDevel) -endif() +install(TARGETS pandafx + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) install(FILES ${P3DISTORT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) From c16092fe8ad2332a3f2ba0e703c9b854a133bb79 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 19 Aug 2019 18:49:59 -0600 Subject: [PATCH 661/744] CMake: Workaround for some export errors when doing a static build This refuses to export/install the p3assimp/p3ptloader/p3txafile libraries when building statically, because they depend on libraries that are never installed, and static linkage would require all of the dependencies to be available. A more proper fix would involve installing these base libraries, but only when doing a static build. I suspect nobody will ask for that, so I haven't done it. --- pandatool/src/assimp/CMakeLists.txt | 6 +++++- pandatool/src/egg-palettize/CMakeLists.txt | 6 +++++- pandatool/src/ptloader/CMakeLists.txt | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pandatool/src/assimp/CMakeLists.txt b/pandatool/src/assimp/CMakeLists.txt index 4daec301cd..d4758f2f61 100644 --- a/pandatool/src/assimp/CMakeLists.txt +++ b/pandatool/src/assimp/CMakeLists.txt @@ -26,4 +26,8 @@ set_target_properties(p3assimp PROPERTIES DEFINE_SYMBOL BUILDING_ASSIMP) target_link_libraries(p3assimp PRIVATE p3pandatoolbase) target_link_libraries(p3assimp PUBLIC PKG::ASSIMP) -install(TARGETS p3assimp EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) +if(BUILD_SHARED_LIBS) + # We can't install this if we're doing a static build, because it depends on + # a static library that isn't installed. + install(TARGETS p3assimp EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) +endif() diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 6f799a4d3c..778ff0fc6c 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -9,4 +9,8 @@ install(TARGETS egg-palettize EXPORT Tools COMPONENT Tools DESTINATION bin) add_library(p3txafile txaFileFilter.cxx txaFileFilter.h txaFileFilter.I) set_target_properties(p3txafile PROPERTIES DEFINE_SYMBOL BUILDING_MISC) target_link_libraries(p3txafile PRIVATE p3palettizer) -install(TARGETS p3txafile EXPORT Tools COMPONENT Tools DESTINATION lib RUNTIME DESTINATION bin) +if(BUILD_SHARED_LIBS) + # We can't install this if we're doing a static build, because it depends on + # a static library that isn't installed. + install(TARGETS p3txafile EXPORT Tools COMPONENT Tools DESTINATION lib RUNTIME DESTINATION bin) +endif() diff --git a/pandatool/src/ptloader/CMakeLists.txt b/pandatool/src/ptloader/CMakeLists.txt index 66dd3b0b1a..0d98ee8377 100644 --- a/pandatool/src/ptloader/CMakeLists.txt +++ b/pandatool/src/ptloader/CMakeLists.txt @@ -24,4 +24,8 @@ if(HAVE_FCOLLADA) target_compile_definitions(p3ptloader PRIVATE HAVE_FCOLLADA) endif() -install(TARGETS p3ptloader EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) +if(BUILD_SHARED_LIBS) + # We can't install this if we're doing a static build, because it depends on + # a bunch of static libraries that aren't installed. + install(TARGETS p3ptloader EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) +endif() From 896a8dbca5776877bdb0c794c9c4f159f2f0f16e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Aug 2019 19:08:30 -0600 Subject: [PATCH 662/744] CMake: Some more changes to p3pystub - Don't build it at all on Win32 where it isn't needed - Don't link it into interrogate_module (oops, missed that) --- dtool/src/interrogate/CMakeLists.txt | 2 +- dtool/src/pystub/CMakeLists.txt | 23 +++++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 86431b2bfa..efa0933717 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -76,7 +76,7 @@ add_custom_command( add_executable(interrogate_module interrogate_module.cxx ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx) -target_link_libraries(interrogate_module p3cppParser p3dtoolconfig p3pystub +target_link_libraries(interrogate_module p3cppParser p3dtoolconfig PKG::OPENSSL) if(NOT CMAKE_CROSSCOMPILING) diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt index b4f6f5a4a2..5ae46fed92 100644 --- a/dtool/src/pystub/CMakeLists.txt +++ b/dtool/src/pystub/CMakeLists.txt @@ -1,11 +1,18 @@ set(P3PYSTUB_HEADERS pystub.h) set(P3PYSTUB_SOURCES pystub.cxx) -add_library(p3pystub ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) -target_link_libraries(p3pystub p3dtool) -install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) -install(TARGETS p3pystub - EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - ARCHIVE COMPONENT CoreDevel) +if(WIN32) + # Win32 doesn't actually need this hack + add_library(p3pystub INTERFACE) + +else() + add_library(p3pystub ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) + target_link_libraries(p3pystub p3dtool) + install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) + install(TARGETS p3pystub + EXPORT Core COMPONENT Core + DESTINATION lib + RUNTIME DESTINATION bin + ARCHIVE COMPONENT CoreDevel) + +endif() From 9ca4f19b900e8d9f0e75a3fd6bf7ff31e8d51e35 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Aug 2019 19:09:44 -0600 Subject: [PATCH 663/744] CMake: Make sure we define flags variables for Distribution This fixes a CMake error with the MSVC generator, but it's also generally good to have around. --- dtool/CompilerFlags.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 6deacff59b..3af78dad13 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -155,3 +155,11 @@ if(NOT MSVC) add_compile_options("-fvisibility=hidden") endif() endif() + +# These are flags for the custom configurations we add +# Distribution +set(CMAKE_C_FLAGS_DISTRIBUTION "") +set(CMAKE_CXX_FLAGS_DISTRIBUTION "") +set(CMAKE_SHARED_LINKER_FLAGS_DISTRIBUTION "") +set(CMAKE_MODULE_LINKER_FLAGS_DISTRIBUTION "") +set(CMAKE_EXE_LINKER_FLAGS_DISTRIBUTION "") From 6cb62d1d1815b8cf9acd237a585a67b224fabe3c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Aug 2019 19:10:47 -0600 Subject: [PATCH 664/744] CMake: When zlib isn't available, run_pzip() should copy at build-time This prevents copying to configurations that the user isn't going to build, and also plays nice with multi-configuration generators where the configuration isn't known until build-time. --- cmake/macros/RunPzip.cmake | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/cmake/macros/RunPzip.cmake b/cmake/macros/RunPzip.cmake index dd72040714..d8f0c4bec3 100644 --- a/cmake/macros/RunPzip.cmake +++ b/cmake/macros/RunPzip.cmake @@ -1,13 +1,4 @@ function(run_pzip target_name source destination glob) - if(NOT TARGET host_pzip) - # If pzip isn't built, we just copy instead. - file(COPY "${source}" - DESTINATION "${destination}" - FILES_MATCHING PATTERN "${glob}") - - return() - endif() - file(GLOB_RECURSE files RELATIVE "${source}" "${source}/${glob}") set(dstfiles "") @@ -16,14 +7,26 @@ function(run_pzip target_name source destination glob) get_filename_component(dstdir "${destination}/${filename}" DIRECTORY) - set(dstfile "${filename}.pz") - list(APPEND dstfiles "${destination}/${dstfile}") + if(TARGET host_pzip) + set(dstfile "${filename}.pz") + list(APPEND dstfiles "${destination}/${dstfile}") - add_custom_command(OUTPUT "${destination}/${dstfile}" - COMMAND ${CMAKE_COMMAND} -E make_directory "${dstdir}" - COMMAND host_pzip -c > "${destination}/${dstfile}" < "${source}/${filename}" - DEPENDS host_pzip - COMMENT "") + add_custom_command(OUTPUT "${destination}/${dstfile}" + COMMAND ${CMAKE_COMMAND} -E make_directory "${dstdir}" + COMMAND host_pzip -c > "${destination}/${dstfile}" < "${source}/${filename}" + DEPENDS host_pzip + COMMENT "") + + else() + # If pzip isn't built, we just copy instead. + list(APPEND dstfiles "${destination}/${filename}") + + add_custom_command(OUTPUT "${destination}/${filename}" + COMMAND ${CMAKE_COMMAND} -E + copy_if_different "${source}/${filename}" "${destination}/${filename}" + COMMENT "") + + endif() endforeach(filename) From c62d5fbe354a44094de0fde8d6c07147b2a261d6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 21 Aug 2019 19:13:09 -0600 Subject: [PATCH 665/744] CMake: Fix incorrect comment --- dtool/Config.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 5cadea605b..91a8fdad9a 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -8,7 +8,7 @@ include(CMakeDependentOption) -# Define the plaform we are building on. +# Define our target platform. # The values "UNIX", "WIN32", "MINGW", "MSYS", and "CYGWIN" # are automatically provided by CMAKE. "APPLE" is also provided by # CMAKE but may be True on systems that are not OS X. From afe7ffb9645b0cc4189692478d2220cfb623054c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 22 Aug 2019 20:19:41 -0600 Subject: [PATCH 666/744] CMake: Fix several modules' search behavior This makes these modules behave better when encountering the makepanda thirdparty/ directory. --- cmake/modules/FindCg.cmake | 85 ++++++++++++------------------ cmake/modules/FindFMODEx.cmake | 4 +- cmake/modules/FindOgg.cmake | 2 +- cmake/modules/FindSWScale.cmake | 2 +- cmake/modules/FindVorbisFile.cmake | 4 +- 5 files changed, 39 insertions(+), 58 deletions(-) diff --git a/cmake/modules/FindCg.cmake b/cmake/modules/FindCg.cmake index 3df0a7fd58..ed6805c4be 100644 --- a/cmake/modules/FindCg.cmake +++ b/cmake/modules/FindCg.cmake @@ -23,6 +23,13 @@ # Find Cg for OpenGL macro(find_cggl) + if(APPLE) + # GL support is built-in on Apple + set(CGGL_LIBRARY "${CG_LIBRARY}") + set(CGGL_LIBRARY_DIR "${CG_LIBRARY_DIR}") + set(CGGL_INCLUDE_DIR "${CG_INCLUDE_DIR}") + endif() + if(Cg_FIND_QUIETLY) set(CgGL_FIND_QUIETLY TRUE) endif() @@ -114,59 +121,33 @@ endmacro() # Find base Nvidia Cg if(NOT CG_LIBRARY_DIR OR NOT CG_INCLUDE_DIRS) - # On OSX default to using the framework version of Cg. - if(APPLE) - include(${CMAKE_ROOT}/Modules/CMakeFindFrameworks.cmake) - set(CG_INCLUDES) + # Find the include directory + find_path(CG_INCLUDE_DIR + NAMES "Cg/cg.h" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg/include" + "/usr/include" + "/usr/local/include" + "/opt/Cg" + "/opt/nvidia-cg-toolkit/include" # Gentoo + PATH_SUFFIXES "" "Cg" "cg" + DOC "The path to NvidiaCg's include directory." + ) - cmake_find_frameworks(Cg) - if(Cg_FRAMEWORKS) - foreach(dir ${Cg_FRAMEWORKS}) - list(APPEND CG_INCLUDES ${dir}/Headers ${dir}/PrivateHeaders) - endforeach(dir) - unset(Cg_FRAMEWORKS) - - # Find the include dir - find_path(CG_INCLUDE_DIR - NAMES "cg.h" - PATHS ${CG_INCLUDES} - DOC "The path to NvidiaCg's include directory." - ) - unset(CG_INCLUDES) - - # Set the library dir (TODO: Check the correctness on Mac OS X) - set(CG_LIBRARY_DIR "/Library/Frameworks/Cg.framework" CACHE PATH "The path to NvidiaCg's library directory.") - endif() - - else() - # Find the include directory - find_path(CG_INCLUDE_DIR - NAMES "cg.h" - PATHS "C:/Program Files/Cg" - "C:/Program Files/NVIDIA Corporation/Cg/include" - "/usr/include" - "/usr/local/include" - "/opt/Cg" - "/opt/nvidia-cg-toolkit/include" # Gentoo - PATH_SUFFIXES "" "Cg" "cg" - DOC "The path to NvidiaCg's include directory." - ) - - # Find the library directory - find_library(CG_LIBRARY - NAMES "Cg" "libCg" - PATHS "C:/Program Files/Cg" - "C:/Program Files/NVIDIA Corporation/Cg" - "/usr" - "/usr/lib/x86_64-linux-gnu" - "/usr/local" - "/opt/Cg" - "/opt/nvidia-cg-toolkit" # Gentoo - PATH_SUFFIXES "" "lib" "lib32" "lib64" - ) - get_filename_component(CG_LIBRARY_DIR "${CG_LIBRARY}" PATH) - set(CG_LIBRARY_DIR "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path - endif() + # Find the library directory + find_library(CG_LIBRARY + NAMES "Cg" "libCg" + PATHS "C:/Program Files/Cg" + "C:/Program Files/NVIDIA Corporation/Cg" + "/usr" + "/usr/lib/x86_64-linux-gnu" + "/usr/local" + "/opt/Cg" + "/opt/nvidia-cg-toolkit" # Gentoo + PATH_SUFFIXES "" "lib" "lib32" "lib64" + ) + get_filename_component(CG_LIBRARY_DIR "${CG_LIBRARY}" PATH) + set(CG_LIBRARY_DIR "${CG_LIBRARY_DIR}" CACHE PATH "The path to NvidiaCG's library directory.") # Library path string(REGEX REPLACE "/Cg$" "" CG_BASE_INCLUDE_DIR "${CG_INCLUDE_DIR}") set(CG_INCLUDE_DIRS ${CG_BASE_INCLUDE_DIR} ${CG_INCLUDE_DIR}) diff --git a/cmake/modules/FindFMODEx.cmake b/cmake/modules/FindFMODEx.cmake index 13ccbf39d1..caddb5dea3 100644 --- a/cmake/modules/FindFMODEx.cmake +++ b/cmake/modules/FindFMODEx.cmake @@ -32,7 +32,7 @@ find_path(FMODEX_INCLUDE_DIR # Find the 32-bit library find_library(FMODEX_32_LIBRARY - NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" + NAMES "fmodex_vc" "fmodex_bc" "fmodex" "fmodexL" "libfmodex" "libfmodexL" "fmodex_vc" "fmodexL_vc" PATHS "/usr" "/usr/local" "/usr/X11R6" @@ -49,7 +49,7 @@ find_library(FMODEX_32_LIBRARY # Find the 64-bit library find_library(FMODEX_64_LIBRARY - NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" + NAMES "fmodex64" "libfmodex64" "fmodexL64" "libfmodexL64" "fmodex64_vc" "fmodexL64_vc" PATHS "/usr" "/usr/local" "/usr/X11R6" diff --git a/cmake/modules/FindOgg.cmake b/cmake/modules/FindOgg.cmake index 88bcfe81cd..f9de72f127 100644 --- a/cmake/modules/FindOgg.cmake +++ b/cmake/modules/FindOgg.cmake @@ -12,7 +12,7 @@ find_path(OGG_INCLUDE_DIR NAMES "ogg/ogg.h") -find_library(OGG_LIBRARY NAMES "ogg") +find_library(OGG_LIBRARY NAMES "ogg" "libogg_static") mark_as_advanced(OGG_INCLUDE_DIR OGG_LIBRARY) diff --git a/cmake/modules/FindSWScale.cmake b/cmake/modules/FindSWScale.cmake index f6e8b3cc36..f337f9b988 100644 --- a/cmake/modules/FindSWScale.cmake +++ b/cmake/modules/FindSWScale.cmake @@ -47,4 +47,4 @@ endif() mark_as_advanced(SWSCALE_LIBRARY_DIR) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(SWSCALE DEFAULT_MSG SWSCALE_LIBRARY SWSCALE_INCLUDE_DIR SWSCALE_LIBRARY_DIR) +find_package_handle_standard_args(SWScale DEFAULT_MSG SWSCALE_LIBRARY SWSCALE_INCLUDE_DIR SWSCALE_LIBRARY_DIR) diff --git a/cmake/modules/FindVorbisFile.cmake b/cmake/modules/FindVorbisFile.cmake index efa16dd680..f85e847d0a 100644 --- a/cmake/modules/FindVorbisFile.cmake +++ b/cmake/modules/FindVorbisFile.cmake @@ -16,8 +16,8 @@ find_package(Ogg QUIET) # Find Vorbis find_path(VORBIS_INCLUDE_DIR NAMES "vorbis/vorbisfile.h") -find_library(VORBIS_vorbis_LIBRARY NAMES "vorbis") -find_library(VORBIS_vorbisfile_LIBRARY NAMES "vorbisfile") +find_library(VORBIS_vorbis_LIBRARY NAMES "vorbis" "libvorbis_static") +find_library(VORBIS_vorbisfile_LIBRARY NAMES "vorbisfile" "libvorbisfile_static") mark_as_advanced(VORBIS_INCLUDE_DIR VORBIS_vorbis_LIBRARY VORBIS_vorbisfile_LIBRARY) From 60c1570db85f9633b870c23a7e12ba3d2876e51e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 23 Aug 2019 15:58:47 -0600 Subject: [PATCH 667/744] CMake: Add support for makepanda-style thirdparty directories --- CMakeLists.txt | 6 +++ dtool/Package.cmake | 103 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf07746e62..fdc0008c1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.0.2) set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below +if(CMAKE_VERSION VERSION_GREATER "3.12" OR POLICY CMP0074) + # Needed for THIRDPARTY_DIRECTORY support; this will be enabled by default + # once the minimum CMake version is at least 3.12. + cmake_policy(SET CMP0074 NEW) +endif() + # Figure out the version file(STRINGS "setup.cfg" _version REGEX "^version = ") string(REGEX REPLACE "^.*= " "" _version "${_version}") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index dca10e6ccc..5c8442eabb 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,3 +1,106 @@ +set(THIRDPARTY_DIRECTORY "" CACHE PATH + "Optional location of a makepanda-style thirdparty directory. All libraries + located here will be prioritized over system libraries. Useful for + cross-compiling.") + +if(THIRDPARTY_DIRECTORY) + # This policy is necessary for PackageName_ROOT variables to be respected + if(POLICY CMP0074) + cmake_policy(GET CMP0074 _policy_cmp0074) + endif() + + if(NOT _policy_cmp0074 STREQUAL "NEW") + message(FATAL_ERROR + "Your version of CMake is too old; please upgrade or unset THIRDPARTY_DIRCTORY to continue.") + endif() + + # Dig up the actual "libs" directory + if(APPLE) + set(_package_dir "${THIRDPARTY_DIRECTORY}/darwin-libs-a") + + elseif(WIN32) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(_package_dir "${THIRDPARTY_DIRECTORY}/win-libs-vc14-x64") + + file(GLOB Python_ROOT "${THIRDPARTY_DIRECTORY}/win-python*-x64") + else() + set(_package_dir "${THIRDPARTY_DIRECTORY}/win-libs-vc14") + + file(GLOB Python_ROOT "${THIRDPARTY_DIRECTORY}/win-python*") + endif() + + list(REVERSE Python_ROOT) # Descending order of version + + set(BISON_ROOT "${THIRDPARTY_DIRECTORY}/win-util") + set(FLEX_ROOT "${THIRDPARTY_DIRECTORY}/win-util") + + else() + message(FATAL_ERROR + "You can't use THIRDPARTY_DIRECTORY on this platform. Unset it to continue.") + + endif() + + if(NOT EXISTS "${_package_dir}") + message(FATAL_ERROR + "Either your THIRDPARTY_DIRECTORY path does not exist, or it is for the wrong platform.") + + endif() + + foreach(_Package + ARToolKit + Assimp + Bullet + Cg + Eigen3 + FCollada + FFMPEG + FMODEx + Freetype + HarfBuzz + JPEG + LibSquish + ODE + Ogg + OpenAL + OpenEXR + OpenSSL + OpusFile + PNG + SWResample + SWScale + TIFF + VorbisFile + VRPN + ZLIB + ) + + string(TOLOWER "${_Package}" _package) + + # Some packages in the thirdparty dir have different subdirectory names from + # the name of the CMake package + if(_package STREQUAL "cg") + set(_package "nvidiacg") + elseif(_package STREQUAL "eigen3") + set(_package "eigen") + elseif(_package STREQUAL "ogg") + set(_package "vorbis") # It's in the same install dir here + elseif(_package STREQUAL "opusfile") + set(_package "opus") + elseif(_package STREQUAL "libsquish") + set(_package "squish") + elseif(_package STREQUAL "swresample" OR _package STREQUAL "swscale") + set(_package "ffmpeg") # These are also part of FFmpeg + elseif(_package STREQUAL "vorbisfile") + set(_package "vorbis") + endif() + + # Set search path + set(${_Package}_ROOT "${_package_dir}/${_package}") + + endforeach(_Package) + +endif() + # # ------------ Python ------------ # From fc54251f61c1bbee7314576a248dab317f9dd5b0 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 23 Aug 2019 17:50:43 -0600 Subject: [PATCH 668/744] CMake: Fix PandaModules.py not copying --- cmake/scripts/CopyPython.cmake | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmake/scripts/CopyPython.cmake b/cmake/scripts/CopyPython.cmake index b9fad3ef92..1a3c98839a 100644 --- a/cmake/scripts/CopyPython.cmake +++ b/cmake/scripts/CopyPython.cmake @@ -36,10 +36,11 @@ if(DEFINED SOURCE_DIR) file(TIMESTAMP "${OUTPUT_DIR}/${py_file}" dst_stamp) # The file is only copied if: - # - there's an __init__.py in its dir (i.e. file belongs to a package), and + # - there's an __init__.py in its dir (or file is in the root) (i.e. file belongs to a package), and # - the modification timestamp differs (i.e. file changed or never copied) - if(EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py" - AND NOT src_stamp STREQUAL dst_stamp) + if((py_file_parent STREQUAL "." OR NOT py_file_parent + OR EXISTS "${SOURCE_DIR}/${py_file_parent}/__init__.py") + AND NOT src_stamp STREQUAL dst_stamp) file(COPY "${SOURCE_DIR}/${py_file}" DESTINATION "${OUTPUT_DIR}/${py_file_parent}") set(changed YES) From 9ec66e3e281511d7fc056b8597c7face4058c512 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 23 Aug 2019 17:53:18 -0600 Subject: [PATCH 669/744] travis: Let's see what happens if we use ccache --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index a906a91836..e05921da66 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,8 @@ language: cpp sudo: false +cache: ccache + # Build matrix: os: - linux From 55cfc6c2b952a7d8606d67a61d41395d4bc93580 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 24 Aug 2019 18:03:39 -0600 Subject: [PATCH 670/744] CMake: Pass _MSC_VER to Interrogate under MSVC --- cmake/macros/Interrogate.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 7d646f5045..6cad20cac6 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -33,6 +33,9 @@ set(INTERROGATE_EXCLUDE_REGEXES if(WIN32) list(APPEND IGATE_FLAGS -D_X86_ -D__STDC__=1 -DWIN32_VC -D "_declspec(param)=" -D "__declspec(param)=" -D_near -D_far -D__near -D__far -D_WIN32 -D__stdcall -DWIN32) endif() +if(MSVC_VERSION) + list(APPEND IGATE_FLAGS "-D_MSC_VER=${MSVC_VERSION}") +endif() if(INTERROGATE_VERBOSE) list(APPEND IGATE_FLAGS "-v") endif() From 855d217f359286695e5a4703f77716b474cdda06 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 24 Aug 2019 18:07:22 -0600 Subject: [PATCH 671/744] CMake: Update for upstream changes - Miles is gone; remove all references - pystub is gone; remove all references - dcparser uses Interrogate extensions properly; don't depend on Python - stringStream* moved to express from downloader --- cmake/modules/FindFMODEx.cmake | 4 +- cmake/modules/FindMiles.cmake | 132 -------------------------- direct/CMakeLists.txt | 3 - direct/src/dcparse/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 12 ++- direct/src/distributed/CMakeLists.txt | 21 ++-- dtool/CMakeLists.txt | 1 - dtool/Package.cmake | 12 --- dtool/dtool_config.h.in | 3 - dtool/src/pystub/CMakeLists.txt | 18 ---- panda/src/audiotraits/CMakeLists.txt | 34 +------ panda/src/configfiles/CMakeLists.txt | 4 +- panda/src/downloader/CMakeLists.txt | 11 +-- panda/src/express/CMakeLists.txt | 6 ++ panda/src/pgraph/CMakeLists.txt | 4 + 15 files changed, 35 insertions(+), 232 deletions(-) delete mode 100644 cmake/modules/FindMiles.cmake delete mode 100644 dtool/src/pystub/CMakeLists.txt diff --git a/cmake/modules/FindFMODEx.cmake b/cmake/modules/FindFMODEx.cmake index caddb5dea3..63d0b2437a 100644 --- a/cmake/modules/FindFMODEx.cmake +++ b/cmake/modules/FindFMODEx.cmake @@ -10,8 +10,8 @@ # FMODEX_LIBRARY_DIR - the FMOD Ex library directory # 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 +# FMODEX_32_LIBRARY - the filepath of the FMOD Ex SDK 32-bit library +# FMOXEX_64_LIBRARY - the filepath of the FMOD Ex SDK 64-bit library # # Find the include directory diff --git a/cmake/modules/FindMiles.cmake b/cmake/modules/FindMiles.cmake deleted file mode 100644 index 187dd94a48..0000000000 --- a/cmake/modules/FindMiles.cmake +++ /dev/null @@ -1,132 +0,0 @@ -# Filename: FindMiles.cmake -# Author: kestred (9 Dec, 2013) -# -# Usage: -# find_package(Miles [REQUIRED] [QUIET]) -# -# Once done this will define: -# MILES_FOUND - system has Radgame's Miles SDK -# RAD_MSS_FOUND - system has Radgame's Miles SDK -# MILES_INCLUDE_DIR - the Miles SDK include directory -# MILES_LIBRARY_DIR - the Miles SDK library directory -# MILES_LIBRARY - the path to the library binary -# -# MILES_RELEASE_LIBRARY - the filepath of the Miles SDK release library -# MILES_RELDBG_LIBRARY - the filepath of the Miles SDK optimize debug library -# MILES_MINSIZE_LIBRARY - the filepath of the Miles SDK minimum size library -# MILES_DEBUG_LIBRARY - the filepath of the Miles SDK debug library -# - -# Find the Miles SDK include files -find_path(MILES_INCLUDE_DIR - NAMES "miles.h" - PATHS "/usr/include" - "/usr/local/include" - "/opt/" - "C:/Program Files" - "C:/Program Files (x86)" - PATH_SUFFIXES "" "miles" "Miles6" "miles/include" "Miles6/include" - DOC "The path to the Miles SDK include directory." -) - -# Find the Miles SDK libraries (.a, .so) -find_library(MILES_RELEASE_LIBRARY - NAMES "miles" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "/opt/Miles6" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" -) -find_library(MILES_MINSIZE_LIBRARY - NAMES "miles_s" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" -) -find_library(MILES_RELWITHDEBINFO_LIBRARY - NAMES "miles_rd" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" -) -find_library(MILES_DEBUG_LIBRARY - NAMES "miles_d" - PATHS "/usr" - "/usr/local" - "/opt/miles" - "C:/Program Files/miles" - "C:/Program Files (x86)/miles" - "C:/Program Files/Miles6" - "C:/Program Files (x86)/Miles6" - PATH_SUFFIXES "lib" "lib32" -) - -# Choose library -if(CMAKE_BUILD_TYPE MATCHES "Release" AND MILES_RELEASE_LIBRARY) - set(MILES_LIBRARY ${MILES_RELEASE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") -elseif(CMAKE_BUILD_TYPE MATCHES "RelWithDebInfo" AND MILES_RELDBG_LIBRARY) - set(MILES_LIBRARY ${MILES_RELWITHDEBINFO_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") -elseif(CMAKE_BUILD_TYPE MATCHES "MinSizeRel" AND MILES_MINSIZE_LIBRARY) - set(MILES_LIBRARY ${MILES_MINSIZE_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") -elseif(CMAKE_BUILD_TYPE MATCHES "Debug" AND MILES_DEBUG_LIBRARY) - set(MILES_LIBRARY ${MILES_DEBUG_LIBRARY} CACHE FILEPATH "The Miles SDK library file.") -endif() - -# Set library path -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.") - -# Check if we have everything we need -if(MILES_INCLUDE_DIR AND MILES_LIBRARY_DIR) - set(FOUND_MILES TRUE) - set(MILES_LIBS Mss32) -endif() - -mark_as_advanced(MILES_INCLUDE_DIR) -mark_as_advanced(MILES_DEBUG_LIBRARY) -mark_as_advanced(MILES_RELEASE_LIBRARY) -mark_as_advanced(MILES_RELWITHDEBINFO_LIBRARY) -mark_as_advanced(MILES_MINSIZE_LIBRARY) - -# 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) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 48d563eb06..18847d4b9b 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -20,9 +20,6 @@ set(P3DIRECT_COMPONENTS ) if(HAVE_PYTHON) list(APPEND P3DIRECT_COMPONENTS p3distributed) - get_target_property(_p3distributed_exts p3distributed IGATE_EXTENSIONS) - set_source_files_properties(${_p3distributed_exts} - PROPERTIES COMPILE_DEFINITIONS BUILDING_DIRECT_DISTRIBUTED) endif() set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "DirectDevel") diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index c84e8ecd15..747f5896b2 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(p3dcparse dcparse.cxx) -target_link_libraries(p3dcparse p3direct p3pystub) +target_link_libraries(p3dcparse p3direct) install(TARGETS p3dcparse EXPORT Direct COMPONENT Direct DESTINATION bin) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 0ca5910f2f..31bf51d2df 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -21,7 +21,6 @@ set(P3DCPARSER_HEADERS dcNumericRange.h dcNumericRange.I dcSwitch.h dcTypedef.h - dcPython.h dcbase.h dcindent.h dcmsgtypes.h @@ -55,6 +54,12 @@ set(P3DCPARSER_SOURCES primeNumberGenerator.cxx ) +set(P3DCPARSER_IGATEEXT + dcClass_ext.cxx dcClass_ext.h + dcField_ext.cxx dcField_ext.h + dcPacker_ext.cxx dcPacker_ext.h +) + add_bison_target(dcParser.cxx dcParser.yxx DEFINES dcParser.h PREFIX dcyy) add_flex_target(dcLexer.cxx dcLexer.lxx CASE_INSENSITIVE PREFIX dcyy) @@ -67,8 +72,9 @@ composite_sources(p3dcparser P3DCPARSER_SOURCES) add_component_library(p3dcparser NOINIT SYMBOL BUILDING_DIRECT_DCPARSER ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} ${P3DCPARSER_PARSER_SOURCES}) target_compile_definitions(p3dcparser PUBLIC WITHIN_PANDA) -target_link_libraries(p3dcparser p3directbase panda PKG::PYTHON) -target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES}) +target_link_libraries(p3dcparser p3directbase panda) +target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} + EXTENSIONS ${P3DCPARSER_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3dcparser diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 10633d4d17..46733e0cc6 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -4,26 +4,25 @@ endif() set(P3DISTRIBUTED_HEADERS config_distributed.h - cConnectionRepository.I - cConnectionRepository.h - cDistributedSmoothNodeBase.I - cDistributedSmoothNodeBase.h ) set(P3DISTRIBUTED_SOURCES config_distributed.cxx - cConnectionRepository.cxx - cDistributedSmoothNodeBase.cxx ) -# Workaround for Windows which just *insists* on having something to build -set(P3DISTRIBUTED_EMPTY "${CMAKE_CURRENT_BINARY_DIR}/empty.cxx") -file(WRITE ${P3DISTRIBUTED_EMPTY} "") +set(P3DISTRIBUTED_IGATEEXT + cConnectionRepository.cxx + cConnectionRepository.h + cConnectionRepository.I + cDistributedSmoothNodeBase.cxx + cDistributedSmoothNodeBase.h + cDistributedSmoothNodeBase.I +) add_component_library(p3distributed NOINIT SYMBOL BUILDING_DIRECT_DISTRIBUTED - ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_EMPTY}) + ${P3DISTRIBUTED_HEADERS} ${P3DISTRIBUTED_SOURCES}) target_link_libraries(p3distributed p3directbase p3dcparser panda) -target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_SOURCES}) +target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3distributed diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 018979f20a..60b6446e68 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -9,7 +9,6 @@ add_subdirectory(src/dtoolutil) add_subdirectory(src/interrogate) add_subdirectory(src/interrogatedb) add_subdirectory(src/prc) -add_subdirectory(src/pystub) # Include dtool metalibs add_subdirectory(metalibs/dtool) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 5c8442eabb..47158bd55b 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -430,18 +430,6 @@ package_status(OPUS "Opus") # ------------ Audio libraries ------------ # -# Miles Sound System -find_package(Miles QUIET) - -package_option(RAD_MSS - "This enables support for audio output via the Miles Sound System, - by RAD Game Tools. This requires a commercial license to use, so you'll know - if you need to enable this option." - FOUND_AS Miles - LICENSE "Miles") - -package_status(RAD_MSS "Miles Sound System") - # FMOD Ex find_package(FMODEx QUIET) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index b05d4c5b53..e684babf9d 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -12,9 +12,6 @@ /* Define if we have Python as a framework (Mac OS X). */ #cmakedefine PYTHON_FRAMEWORK -/* Define if we have RAD game tools, Miles Sound System installed. */ -#cmakedefine HAVE_RAD_MSS - /* Define if we have OpenAL installed as a framework. */ #cmakedefine HAVE_OPENAL_FRAMEWORK diff --git a/dtool/src/pystub/CMakeLists.txt b/dtool/src/pystub/CMakeLists.txt deleted file mode 100644 index 5ae46fed92..0000000000 --- a/dtool/src/pystub/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -set(P3PYSTUB_HEADERS pystub.h) -set(P3PYSTUB_SOURCES pystub.cxx) - -if(WIN32) - # Win32 doesn't actually need this hack - add_library(p3pystub INTERFACE) - -else() - add_library(p3pystub ${P3PYSTUB_HEADERS} ${P3PYSTUB_SOURCES}) - target_link_libraries(p3pystub p3dtool) - install(FILES ${P3PYSTUB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) - install(TARGETS p3pystub - EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - ARCHIVE COMPONENT CoreDevel) - -endif() diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 0990390469..b175d2a5f7 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -1,42 +1,10 @@ if(NOT HAVE_AUDIO) return() -elseif(NOT HAVE_RAD_MSS AND NOT HAVE_FMODEX AND NOT HAVE_OPENAL) +elseif(NOT HAVE_FMODEX AND NOT HAVE_OPENAL) message(SEND_ERROR "You must have an audio backend for audio support! Turn off HAVE_AUDIO to ignore this.") endif() -if(HAVE_RAD_MSS) - set(P3MILES_HEADERS - config_milesAudio.h - milesAudioManager.h - milesAudioSound.I milesAudioSound.h - milesAudioSample.I milesAudioSample.h - milesAudioSequence.I milesAudioSequence.h - milesAudioStream.I milesAudioStream.h - globalMilesManager.I globalMilesManager.h - ) - - set(P3MILES_SOURCES - config_milesAudio.cxx milesAudioManager.cxx milesAudioSound.cxx - milesAudioStream.cxx globalMilesManager.cxx milesAudioSample.cxx - milesAudioSequence.cxx - ) - - composite_sources(p3miles_audio P3MILES_SOURCES) - add_library(p3miles_audio ${P3MILES_HEADERS} ${P3MILES_SOURCES}) - set_target_properties(p3miles_audio PROPERTIES DEFINE_SYMBOL BUILDING_MILES_AUDIO) - target_link_libraries(p3miles_audio panda PKG::MILES) - - install(TARGETS p3miles_audio - EXPORT Miles COMPONENT Miles - DESTINATION lib - RUNTIME DESTINATION bin - ARCHIVE COMPONENT MilesDevel) - install(FILES ${P3MILES_HEADERS} COMPONENT MilesDevel DESTINATION include/panda3d) - - export_targets(Miles NAMESPACE "Panda3D::Miles::" COMPONENT MilesDevel) -endif() - if(HAVE_FMODEX) set(P3FMOD_HEADERS config_fmodAudio.h diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index 101ed67556..a95aa3d285 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -13,9 +13,7 @@ if(HAVE_TINYDISPLAY) set(AUX_DISPLAYS "${AUX_DISPLAYS}\naux-display p3tinydisplay") endif() -if(HAVE_RAD_MSS) - set(AUDIO_LIBRARY_NAME p3miles_audio) -elseif(HAVE_OPENAL) +if(HAVE_OPENAL) set(AUDIO_LIBRARY_NAME p3openal_audio) elseif(HAVE_FMODEX) set(AUDIO_LIBRARY_NAME p3fmod_audio) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index 29ba6d7fbf..cf9dc8e2b0 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -24,8 +24,6 @@ set(P3DOWNLOADER_HEADERS multiplexStreamBuf.I multiplexStreamBuf.h patcher.h patcher.I socketStream.h socketStream.I - stringStreamBuf.I stringStreamBuf.h - stringStream.I stringStream.h urlSpec.h urlSpec.I virtualFileHTTP.I virtualFileHTTP.h virtualFileMountHTTP.I virtualFileMountHTTP.h @@ -55,23 +53,16 @@ set(P3DOWNLOADER_SOURCES multiplexStream.cxx multiplexStreamBuf.cxx patcher.cxx socketStream.cxx - stringStreamBuf.cxx - stringStream.cxx urlSpec.cxx virtualFileHTTP.cxx virtualFileMountHTTP.cxx ) -set(P3DOWNLOADER_IGATEEXT - stringStream_ext.cxx - stringStream_ext.h -) - composite_sources(p3downloader P3DOWNLOADER_SOURCES) add_component_library(p3downloader SYMBOL BUILDING_PANDA_DOWNLOADER ${P3DOWNLOADER_HEADERS} ${P3DOWNLOADER_SOURCES}) target_link_libraries(p3downloader p3express) -target_interrogate(p3downloader ALL EXTENSIONS ${P3DOWNLOADER_IGATEEXT}) +target_interrogate(p3downloader ALL) if(NOT BUILD_METALIBS) install(TARGETS p3downloader diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 5ca2bf5ec0..a9223167ee 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -41,6 +41,8 @@ set(P3EXPRESS_HEADERS pta_stdfloat.h ramfile.I ramfile.h referenceCount.I referenceCount.h + stringStreamBuf.I stringStreamBuf.h + stringStream.I stringStream.h subStream.I subStream.h subStreamBuf.h subfileInfo.h subfileInfo.I temporaryFile.h temporaryFile.I @@ -96,6 +98,8 @@ set(P3EXPRESS_SOURCES pta_uchar.cxx pta_double.cxx pta_float.cxx ramfile.cxx referenceCount.cxx + stringStreamBuf.cxx + stringStream.cxx subStream.cxx subStreamBuf.cxx subfileInfo.cxx temporaryFile.cxx @@ -127,6 +131,8 @@ set(P3EXPRESS_IGATEEXT pointerToArray_ext.h ramfile_ext.cxx ramfile_ext.h + stringStream_ext.cxx + stringStream_ext.h virtualFileSystem_ext.cxx virtualFileSystem_ext.h virtualFile_ext.cxx diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 013ac69adf..ec83f00fa6 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -200,6 +200,8 @@ set(P3PGRAPH_SOURCES ) set(P3PGRAPH_IGATEEXT + loaderFileTypeRegistry_ext.cxx + loaderFileTypeRegistry_ext.h nodePathCollection_ext.cxx nodePathCollection_ext.h nodePath_ext.cxx @@ -207,6 +209,8 @@ set(P3PGRAPH_IGATEEXT nodePath_ext.I pandaNode_ext.cxx pandaNode_ext.h + pythonLoaderFileType.cxx + pythonLoaderFileType.h renderState_ext.cxx renderState_ext.h shaderAttrib_ext.cxx From 8588ddc3dc279db80b920e0de5e656fe2b58dc18 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 25 Aug 2019 15:54:02 -0600 Subject: [PATCH 672/744] CMake: When building on MSVC, add /bigobj to compiler where necessary --- dtool/CompilerFlags.cmake | 5 +++++ panda/src/display/CMakeLists.txt | 5 +++++ panda/src/grutil/CMakeLists.txt | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 3af78dad13..5192d57946 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -146,6 +146,11 @@ add_compile_options( "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" "$<$:${cxx_exceptions_off}>") +if(MSVC) + set(msvc_bigobj_property "$>") + add_compile_options("$<${msvc_bigobj_property}:/bigobj>") +endif() + # We should use -fvisibility=hidden everywhere, as it makes sure we think # about what symbols really should be exposed externally. For more info, see: # https://gcc.gnu.org/wiki/Visibility diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index fa4a218c4f..6b34e75c55 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -100,6 +100,11 @@ target_link_libraries(p3display p3cull p3device p3pgraphnodes PKG::X11) target_interrogate(p3display ALL EXTENSIONS ${P3DISPLAY_IGATEEXT}) +if(HAVE_EIGEN) + # Eigen puts this over the threshold where bigobj is needed on MSVC + set_target_properties(p3display PROPERTIES MSVC_BIGOBJ ON) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3display EXPORT Core COMPONENT Core diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index d6c41ce415..fc88b477d2 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -50,6 +50,11 @@ if(HAVE_AUDIO) endif() target_interrogate(p3grutil ALL) +if(HAVE_EIGEN) + # Eigen puts this over the threshold where bigobj is needed on MSVC + set_target_properties(p3grutil PROPERTIES MSVC_BIGOBJ ON) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3grutil EXPORT Core COMPONENT Core From e88f28e9c7c465e158b5f2c0047877c666f668a8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 25 Aug 2019 20:04:19 -0600 Subject: [PATCH 673/744] travis: Force CMake to use ccache --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e05921da66..736596345e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -65,7 +65,7 @@ install: - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python@3 eigen libtar libsquish zlib ffmpeg freetype \ - bullet opencv assimp libvorbis openssl || true + bullet opencv assimp libvorbis openssl ccache || true brew install ode --with-shared # We can't trust brew to make the right symlinks, so execute commands as modules @@ -93,12 +93,14 @@ script: fi cmake -DBUILD_METALIBS=$BUILD_METALIBS \ + -DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache \ -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $PY2_CMAKE_ARGS .. else cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ -DWANT_PYTHON_VERSION=$(python -V 2>&1 | cut -d' ' -f2) \ + -DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache \ -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. fi From 08b4793d9ac31481f0d3e8b676d9ec994c2c5267 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 25 Aug 2019 23:42:31 -0600 Subject: [PATCH 674/744] travis: Also set WANT_PYTHON_VERSION on macOS --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 736596345e..b07d01e5c0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -93,6 +93,7 @@ script: fi cmake -DBUILD_METALIBS=$BUILD_METALIBS \ + -DWANT_PYTHON_VERSION=$(python -V 2>&1 | cut -d' ' -f2) \ -DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache \ -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ From cde25670d6363890445c36263e5df475ec3b54a8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 28 Aug 2019 17:04:44 -0600 Subject: [PATCH 675/744] CMake: Remove some uses of CFG_INTDIR It's not install() friendly, so we use $ instead in some cases. Unfortunately, $ isn't friendly with add_custom_command's OUTPUT options while CMAKE_CFG_INTDIR explicitly is, so we use a hybrid approach until CMake gets its act together. --- CMakeLists.txt | 14 +++------ cmake/macros/Python.cmake | 11 ++----- dtool/CompilerFlags.cmake | 46 +++++++++++++++--------------- dtool/LocalSetup.cmake | 10 +------ dtool/src/dtoolbase/CMakeLists.txt | 2 +- 5 files changed, 31 insertions(+), 52 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fdc0008c1c..402f0e4c5b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,19 +91,19 @@ if(BUILD_MODELS) POST_BUILD COMMAND ${CMAKE_COMMAND} -DSOURCE="${CMAKE_CURRENT_SOURCE_DIR}/models/maps/" - -DDESTINATION="${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models/maps" + -DDESTINATION="${PANDA_OUTPUT_DIR}/models/maps" -P ${PROJECT_SOURCE_DIR}/cmake/scripts/CopyPattern.cmake COMMENT "Copying models/maps") add_custom_command(TARGET dmodels POST_BUILD COMMAND ${CMAKE_COMMAND} -DSOURCE="${CMAKE_CURRENT_SOURCE_DIR}/dmodels/src/" - -DDESTINATION="${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models" + -DDESTINATION="${PANDA_OUTPUT_DIR}/models" -DFILES_MATCHING="PATTERN;*.rgb;PATTERN;*.png;PATTERN;*.jpg;PATTERN;*.wav" -P ${PROJECT_SOURCE_DIR}/cmake/scripts/CopyPattern.cmake COMMENT "Copying dmodels' assets") - install(DIRECTORY "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/models" + install(DIRECTORY "${PANDA_OUTPUT_DIR}/models" COMPONENT Models DESTINATION share/panda3d) endif() @@ -112,15 +112,9 @@ if(INTERROGATE_PYTHON_INTERFACE) # for pytest before adding this test. If the user doesn't have pytest, we'd # like for the tests to fail. - if(PANDA_CFG_INTDIR STREQUAL ".") - set(_workdir "${PROJECT_BINARY_DIR}") - else() - set(_workdir "${PROJECT_BINARY_DIR}/$") - endif() - add_test(NAME pytest COMMAND "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests" - WORKING_DIRECTORY "${_workdir}") + WORKING_DIRECTORY "${PANDA_OUTPUT_DIR}") endif() # Generate the Panda3DConfig.cmake file so find_package(Panda3D) works, and diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index 9c01024e01..e247052214 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -51,14 +51,7 @@ function(add_python_target target) target_link_libraries(${target} PKG::PYTHON) if(BUILD_SHARED_LIBS) - if(CMAKE_GENERATOR STREQUAL "Xcode") - # This is explained in CompilerFlags.cmake - set(intdir $) - else() - set(intdir ${PANDA_CFG_INTDIR}) - endif() - - set(_outdir "${PROJECT_BINARY_DIR}/${intdir}/${slash_namespace}") + set(_outdir "${PANDA_OUTPUT_DIR}/${slash_namespace}") set_target_properties(${target} PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${_outdir}" @@ -146,7 +139,7 @@ function(install_python_package package_name) set(src_path "${CMAKE_SOURCE_DIR}/cmake/templates/win32_python") endif() - set(path "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${package_name}") + set(path "${PANDA_OUTPUT_DIR}/${package_name}") set(args -D "OUTPUT_DIR=${path}") if(src_path) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 5192d57946..2e4194ff9b 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -30,17 +30,19 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON) # Set up the output directory structure, mimicking that of makepanda set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") -if(CMAKE_GENERATOR STREQUAL "Xcode") - # On the Xcode generator, CMake generates a separate make target definition for - # every config, so it ends up spamming warnings once we try to build. - set(intdir $) +if(CMAKE_CFG_INTDIR STREQUAL ".") + # Single-configuration generator; output goes straight in the binary dir + set(PANDA_OUTPUT_DIR "${PROJECT_BINARY_DIR}") + else() - set(intdir ${PANDA_CFG_INTDIR}) + # Multi-configuration generator; add a per-configuration path prefix + set(PANDA_OUTPUT_DIR "${PROJECT_BINARY_DIR}/$") + endif() -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/bin") -set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/lib") -set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${intdir}/lib") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/bin") +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/lib") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/lib") set(MODULE_DESTINATION "lib") @@ -54,7 +56,7 @@ if(WIN32) set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # On Windows, modules (DLLs) are located in bin; lib is just for .lib files - set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/${PANDA_CFG_INTDIR}/bin") + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/bin") if(BUILD_SHARED_LIBS) set(MODULE_DESTINATION "bin") endif() @@ -66,22 +68,20 @@ if(APPLE) set(CMAKE_SHARED_MODULE_SUFFIX ".dylib") endif() -# Since we're using CMAKE_CFG_INTDIR to put everything in a -# configuration-specific subdirectory when building on a multi-config -# generator, we need to suppress the usual configuration name appending -# behavior of CMake. In CMake 3.4+, it will suppress this behavior +# We want the output structured like build/CONFIG/bin, not build/bin/CONFIG per +# the default for multi-configuration generators. In CMake 3.4+, it switches # automatically if the *_OUTPUT_DIRECTORY property contains a generator -# expresssion, but: -# a) As of this writing we support as early as CMake 3.0.2 -# b) ${CMAKE_CFG_INTDIR} doesn't actually expand to a generator expression +# expresssion, but as of this writing we support as early as CMake 3.0.2. # -# So, to solve both of these, let's just do this: -foreach(_type RUNTIME ARCHIVE LIBRARY) - foreach(_config ${CMAKE_CONFIGURATION_TYPES}) - string(TOUPPER "${_config}" _config) - set(CMAKE_${_type}_OUTPUT_DIRECTORY_${_config} "${CMAKE_${_type}_OUTPUT_DIRECTORY}") - endforeach(_config) -endforeach(_type) +# So, let's just do this: +if(CMAKE_VERSION VERSION_LESS "3.4") + foreach(_type RUNTIME ARCHIVE LIBRARY) + foreach(_config ${CMAKE_CONFIGURATION_TYPES}) + string(TOUPPER "${_config}" _config) + set(CMAKE_${_type}_OUTPUT_DIRECTORY_${_config} "${CMAKE_${_type}_OUTPUT_DIRECTORY}") + endforeach(_config) + endforeach(_type) +endif() # Set warning levels if(MSVC) diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index 70cf8d6683..a6fc3a0147 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -185,14 +185,6 @@ message("See dtool_config.h for more details about the specified configuration." message("") # Generate dtool_config.h -if("${PANDA_CFG_INTDIR}" STREQUAL ".") - # Single-configuration generator - set(intdir ".") -else() - # Multi-configuration generator - set(intdir "${CMAKE_BUILD_TYPE}") -endif() - if(IS_MULTICONFIG) foreach(config ${CMAKE_CONFIGURATION_TYPES}) foreach(option ${PER_CONFIG_OPTIONS}) @@ -217,7 +209,7 @@ else() configure_file(dtool_config.h.in "${PROJECT_BINARY_DIR}/include/dtool_config.h") endif() -install(FILES "${PROJECT_BINARY_DIR}/${intdir}/include/dtool_config.h" +install(FILES "${PANDA_OUTPUT_DIR}/include/dtool_config.h" COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index e2bfc81b90..b6a8de0952 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -91,7 +91,7 @@ add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE # Help other libraries find the autogenerated headers target_include_directories(p3dtoolbase PUBLIC $ - $) + $) target_link_libraries(p3dtoolbase PKG::EIGEN PKG::THREADS) target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_IGATEEXT}) From a42f1a49a4892fbae168c5c63edb83abd8a10c6d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 29 Aug 2019 23:09:28 -0600 Subject: [PATCH 676/744] CMake: Interrogate needs -DNDEBUG when -DNDEBUG is passed as a flag Some buildsystems (Gentoo's Portage, to be specific) are very roughshod about how they use CMake, and might bypass the "configuration types" system altogether, passing their own release flags instead. This change detects that and ensures that Interrogate picks up the NDEBUG flag when it's specified manually. --- cmake/macros/Interrogate.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 6cad20cac6..399b3acd20 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -228,6 +228,11 @@ function(interrogate_sources target output database language_flags) endif() endforeach(build_type) + # In case the user (or a distro buildsystem) is throwing NDEBUG in by hand: + if(CMAKE_CXX_FLAGS MATCHES ".*NDEBUG.*") + list(APPEND define_flags "-DNDEBUG") + endif() + get_filename_component(output_directory "${output}" DIRECTORY) get_filename_component(database_directory "${database}" DIRECTORY) From faced9aa499ece4e5e294cc548f571c450ef1df1 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 30 Aug 2019 16:53:45 -0600 Subject: [PATCH 677/744] CMake: Grab all CMAKE_CXX_FLAGS(_) -Ddefines for Interrogate --- cmake/macros/Interrogate.cmake | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 399b3acd20..c832d1f684 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -220,13 +220,30 @@ function(interrogate_sources target output database language_flags) endif() set(define_flags "$<$:-D${_q}$${_q}>") - # If this is a release build that has NDEBUG defined, we need that too: - foreach(build_type ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE}) - string(TOUPPER "${build_type}" build_type) - if(CMAKE_CXX_FLAGS_${build_type} MATCHES ".*NDEBUG.*") - list(APPEND define_flags "$<$:-DNDEBUG>") + # Some of the definitions may be specified using -D flags in the global + # CXX_FLAGS variables; parse those out (this also picks up NDEBUG) + set(_configs ${CMAKE_CONFIGURATION_TYPES} ${CMAKE_BUILD_TYPE} "") + list(REMOVE_DUPLICATES _configs) + foreach(_config ${_configs}) + if(_config STREQUAL "") + set(flags "${CMAKE_CXX_FLAGS}") + else() + string(TOUPPER "${_config}" _CONFIG) + set(flags "${CMAKE_CXX_FLAGS_${_CONFIG}}") endif() - endforeach(build_type) + + # Convert "/D define1" and "-Ddefine2" flags, interspersed with other + # compiler nonsense, into a basic "-Ddefine1 -Ddefine2" string + string(REGEX MATCHALL "[/-]D[ \t]*[A-Za-z0-9_]+" igate_flags "${flags}") + string(REPLACE ";" " " igate_flags "${igate_flags}") + string(REPLACE "/D" "-D" igate_flags "${igate_flags}") + + if(_config STREQUAL "") + list(APPEND define_flags "${igate_flags}") + else() + list(APPEND define_flags "$<$:${igate_flags}>") + endif() + endforeach(_config) # In case the user (or a distro buildsystem) is throwing NDEBUG in by hand: if(CMAKE_CXX_FLAGS MATCHES ".*NDEBUG.*") From 1a654cba04254bfcb94fd35b0fec31dbe50701f7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 30 Aug 2019 22:45:40 -0600 Subject: [PATCH 678/744] CMake: Record the location that headers are installed This populates INTERFACE_INCLUDE_DIRECTORIES on the targets after they're installed. --- contrib/src/ai/CMakeLists.txt | 1 + contrib/src/rplight/CMakeLists.txt | 1 + direct/src/dcparser/CMakeLists.txt | 1 + direct/src/deadrec/CMakeLists.txt | 1 + direct/src/distributed/CMakeLists.txt | 1 + direct/src/interval/CMakeLists.txt | 1 + direct/src/motiontrail/CMakeLists.txt | 1 + direct/src/showbase/CMakeLists.txt | 1 + dtool/metalibs/dtool/CMakeLists.txt | 1 + dtool/metalibs/dtoolconfig/CMakeLists.txt | 1 + dtool/src/dtoolbase/CMakeLists.txt | 1 + dtool/src/dtoolutil/CMakeLists.txt | 1 + dtool/src/interrogatedb/CMakeLists.txt | 1 + dtool/src/prc/CMakeLists.txt | 1 + panda/metalibs/panda/CMakeLists.txt | 1 + panda/metalibs/pandaegg/CMakeLists.txt | 1 + panda/metalibs/pandaexpress/CMakeLists.txt | 1 + panda/metalibs/pandaphysics/CMakeLists.txt | 1 + panda/src/audio/CMakeLists.txt | 1 + panda/src/audiotraits/CMakeLists.txt | 2 ++ panda/src/bullet/CMakeLists.txt | 1 + panda/src/chan/CMakeLists.txt | 1 + panda/src/char/CMakeLists.txt | 1 + panda/src/collide/CMakeLists.txt | 1 + panda/src/cull/CMakeLists.txt | 1 + panda/src/device/CMakeLists.txt | 1 + panda/src/dgraph/CMakeLists.txt | 1 + panda/src/display/CMakeLists.txt | 1 + panda/src/distort/CMakeLists.txt | 1 + panda/src/downloader/CMakeLists.txt | 1 + panda/src/dxgsg9/CMakeLists.txt | 1 + panda/src/dxml/CMakeLists.txt | 1 + panda/src/egg/CMakeLists.txt | 1 + panda/src/egg2pg/CMakeLists.txt | 1 + panda/src/egldisplay/CMakeLists.txt | 2 ++ panda/src/event/CMakeLists.txt | 1 + panda/src/express/CMakeLists.txt | 1 + panda/src/ffmpeg/CMakeLists.txt | 1 + panda/src/framework/CMakeLists.txt | 1 + panda/src/gles2gsg/CMakeLists.txt | 1 + panda/src/glesgsg/CMakeLists.txt | 1 + panda/src/glgsg/CMakeLists.txt | 1 + panda/src/glstuff/CMakeLists.txt | 1 + panda/src/gobj/CMakeLists.txt | 1 + panda/src/grutil/CMakeLists.txt | 1 + panda/src/gsgbase/CMakeLists.txt | 1 + panda/src/linmath/CMakeLists.txt | 1 + panda/src/mathutil/CMakeLists.txt | 1 + panda/src/movies/CMakeLists.txt | 1 + panda/src/nativenet/CMakeLists.txt | 1 + panda/src/net/CMakeLists.txt | 1 + panda/src/ode/CMakeLists.txt | 1 + panda/src/parametrics/CMakeLists.txt | 1 + panda/src/particlesystem/CMakeLists.txt | 1 + panda/src/pgraph/CMakeLists.txt | 1 + panda/src/pgraphnodes/CMakeLists.txt | 1 + panda/src/pgui/CMakeLists.txt | 1 + panda/src/physics/CMakeLists.txt | 1 + panda/src/pipeline/CMakeLists.txt | 1 + panda/src/pnmimage/CMakeLists.txt | 1 + panda/src/pnmtext/CMakeLists.txt | 1 + panda/src/pstatclient/CMakeLists.txt | 1 + panda/src/putil/CMakeLists.txt | 1 + panda/src/recorder/CMakeLists.txt | 1 + panda/src/text/CMakeLists.txt | 1 + panda/src/tform/CMakeLists.txt | 1 + panda/src/vision/CMakeLists.txt | 1 + panda/src/vrpn/CMakeLists.txt | 1 + panda/src/wgldisplay/CMakeLists.txt | 1 + 69 files changed, 71 insertions(+) diff --git a/contrib/src/ai/CMakeLists.txt b/contrib/src/ai/CMakeLists.txt index b32b3b878d..11bbd56c3e 100644 --- a/contrib/src/ai/CMakeLists.txt +++ b/contrib/src/ai/CMakeLists.txt @@ -49,5 +49,6 @@ install(TARGETS p3ai EXPORT Contrib COMPONENT Contrib DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT ContribDevel) install(FILES ${P3AI_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) diff --git a/contrib/src/rplight/CMakeLists.txt b/contrib/src/rplight/CMakeLists.txt index 5bb1f669f3..c4b21d057d 100644 --- a/contrib/src/rplight/CMakeLists.txt +++ b/contrib/src/rplight/CMakeLists.txt @@ -47,5 +47,6 @@ install(TARGETS p3rplight EXPORT Contrib COMPONENT Contrib DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT ContribDevel) install(FILES ${P3RPLIGHT_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 31bf51d2df..248197d21b 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -81,6 +81,7 @@ if(NOT BUILD_METALIBS) EXPORT Direct COMPONENT Direct DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DirectDevel) endif() install(FILES ${P3DCPARSER_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index 4a9f4ce512..e4ef5738fe 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -18,6 +18,7 @@ if(NOT BUILD_METALIBS) EXPORT Direct COMPONENT Direct DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DirectDevel) endif() install(FILES ${P3DEADREC_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 46733e0cc6..6a675e7319 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -29,6 +29,7 @@ if(NOT BUILD_METALIBS) EXPORT Direct COMPONENT Direct DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DirectDevel) endif() install(FILES ${P3DISTRIBUTED_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index bbc9e8bee5..0b7cf77d59 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -48,6 +48,7 @@ if(NOT BUILD_METALIBS) EXPORT Direct COMPONENT Direct DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DirectDevel) endif() install(FILES ${P3INTERVAL_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/motiontrail/CMakeLists.txt b/direct/src/motiontrail/CMakeLists.txt index dd06fad2af..30b9745c2f 100644 --- a/direct/src/motiontrail/CMakeLists.txt +++ b/direct/src/motiontrail/CMakeLists.txt @@ -18,6 +18,7 @@ if(NOT BUILD_METALIBS) EXPORT Direct COMPONENT Direct DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DirectDevel) endif() install(FILES ${P3MOTIONTRAIL_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 348098aaf9..c080fbf62c 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -21,6 +21,7 @@ if(NOT BUILD_METALIBS) EXPORT Direct COMPONENT Direct DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DirectDevel) endif() install(FILES ${P3SHOWBASE_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index 7c61e3abde..a952ff7f73 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -6,4 +6,5 @@ install(TARGETS p3dtool EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index aa24127592..e0527e310e 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -7,4 +7,5 @@ install(TARGETS p3dtoolconfig EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index b6a8de0952..69443ce6e4 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -100,6 +100,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DTOOLBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 98b374987b..7d92b1b405 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -147,6 +147,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DTOOLUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index e809111b90..5f89ce4777 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -43,6 +43,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3INTERROGATEDB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index c1777bc6c4..cb5fb7ebfc 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -96,6 +96,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PRC_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index b43ded4701..73cd958902 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -28,4 +28,5 @@ install(TARGETS panda EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index b6f5e56cdb..5836e38d2f 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -13,6 +13,7 @@ install(TARGETS pandaegg EXPORT Egg COMPONENT Egg DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT EggDevel) export_targets(Egg COMPONENT EggDevel) diff --git a/panda/metalibs/pandaexpress/CMakeLists.txt b/panda/metalibs/pandaexpress/CMakeLists.txt index a5718095f4..27d5d4f35f 100644 --- a/panda/metalibs/pandaexpress/CMakeLists.txt +++ b/panda/metalibs/pandaexpress/CMakeLists.txt @@ -8,4 +8,5 @@ install(TARGETS pandaexpress EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index 137ed8c9c0..a18e867f3e 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -8,4 +8,5 @@ install(TARGETS pandaphysics EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index d53df64d53..35f61710d4 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -33,6 +33,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3AUDIO_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index b175d2a5f7..b565d5ae05 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -25,6 +25,7 @@ if(HAVE_FMODEX) EXPORT FMOD COMPONENT FMOD DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT FMODDevel) install(FILES ${P3FMOD_HEADERS} COMPONENT FMODDevel DESTINATION include/panda3d) @@ -52,6 +53,7 @@ if(HAVE_OPENAL) EXPORT OpenAL COMPONENT OpenAL DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT OpenALDevel) install(FILES ${P3OPENAL_HEADERS} COMPONENT OpenALDevel DESTINATION include/panda3d) diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index 8d24bd2353..7f609a5264 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -118,6 +118,7 @@ install(TARGETS p3bullet EXPORT Bullet COMPONENT Bullet DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT BulletDevel) install(FILES ${P3BULLET_HEADERS} COMPONENT BulletDevel DESTINATION include/panda3d) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index 1e5ce7415c..b1256346c0 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -63,6 +63,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3CHAN_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index 3f8a0cee33..fd7dde17ee 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -30,6 +30,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3CHAR_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index ec5c30a42a..57640941db 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -76,6 +76,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3COLLIDE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index 80b96fc52f..a955276eb2 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -31,6 +31,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3CULL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index 6cd11e69eb..bf8294385c 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -74,6 +74,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DEVICE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index d5121948cd..08184c0df2 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -23,6 +23,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 6b34e75c55..bed17c1f5f 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -110,6 +110,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DISPLAY_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/distort/CMakeLists.txt b/panda/src/distort/CMakeLists.txt index 6084e8a92e..727d3e2856 100644 --- a/panda/src/distort/CMakeLists.txt +++ b/panda/src/distort/CMakeLists.txt @@ -28,5 +28,6 @@ install(TARGETS pandafx EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) install(FILES ${P3DISTORT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index cf9dc8e2b0..d453a53987 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -69,6 +69,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DOWNLOADER_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt index 962baefed7..426a8837b6 100644 --- a/panda/src/dxgsg9/CMakeLists.txt +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -50,6 +50,7 @@ if(NOT BUILD_METALIBS) EXPORT DX9 COMPONENT DX9 DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT DX9Devel) endif() install(FILES ${P3DXGSG9_HEADERS} COMPONENT DX9Devel DESTINATION include/panda3d) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 1a126295b5..56dc867099 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -22,6 +22,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3DXML_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 29061bb0ba..029d148f3c 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -109,6 +109,7 @@ if(NOT BUILD_METALIBS) EXPORT Egg COMPONENT Egg DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT EggDevel) endif() install(FILES ${P3EGG_HEADERS} COMPONENT EggDevel DESTINATION include/panda3d) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 83de71b2e4..5fcde65105 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -43,6 +43,7 @@ if(NOT BUILD_METALIBS) EXPORT Egg COMPONENT Egg DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT EggDevel) endif() install(FILES ${P3EGG2PG_HEADERS} COMPONENT EggDevel DESTINATION include/panda3d) diff --git a/panda/src/egldisplay/CMakeLists.txt b/panda/src/egldisplay/CMakeLists.txt index a20c64c083..7506bcaf95 100644 --- a/panda/src/egldisplay/CMakeLists.txt +++ b/panda/src/egldisplay/CMakeLists.txt @@ -40,6 +40,7 @@ if(HAVE_GLES1) EXPORT GLES COMPONENT GLES DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT GLESDevel) endif() endif() @@ -57,6 +58,7 @@ if(HAVE_GLES2) EXPORT GLES COMPONENT GLES DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT GLESDevel) endif() endif() diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index fe58cb9347..d100545b7d 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -55,6 +55,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3EVENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index a9223167ee..a6248ad97d 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -167,6 +167,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3EXPRESS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index b0ecaac68b..ccc820101b 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -38,6 +38,7 @@ install(TARGETS p3ffmpeg EXPORT FFmpeg COMPONENT FFmpeg DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT FFmpegDevel) install(FILES ${P3FFMPEG_HEADERS} COMPONENT FFmpegDevel DESTINATION include/panda3d) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 9099dbd445..9b407d1cf4 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -55,6 +55,7 @@ install(TARGETS p3framework EXPORT Framework COMPONENT Framework DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT FrameworkDevel) install(FILES ${P3FRAMEWORK_HEADERS} COMPONENT FrameworkDevel DESTINATION include/panda3d) diff --git a/panda/src/gles2gsg/CMakeLists.txt b/panda/src/gles2gsg/CMakeLists.txt index eb9c69df93..38ed68c621 100644 --- a/panda/src/gles2gsg/CMakeLists.txt +++ b/panda/src/gles2gsg/CMakeLists.txt @@ -23,6 +23,7 @@ if(NOT BUILD_METALIBS) EXPORT GLES COMPONENT GLES DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT GLESDevel) endif() install(FILES ${P3GLES2GSG_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) diff --git a/panda/src/glesgsg/CMakeLists.txt b/panda/src/glesgsg/CMakeLists.txt index 25688084eb..9e43f774c9 100644 --- a/panda/src/glesgsg/CMakeLists.txt +++ b/panda/src/glesgsg/CMakeLists.txt @@ -23,6 +23,7 @@ if(NOT BUILD_METALIBS) EXPORT GLES COMPONENT GLES DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT GLESDevel) endif() install(FILES ${P3GLESGSG_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index 4b033ad3b6..d3c923a99e 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -22,6 +22,7 @@ if(NOT BUILD_METALIBS) EXPORT OpenGL COMPONENT OpenGL DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT OpenGLDevel) endif() install(FILES ${P3GLGSG_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 0700ecb5fa..4304fe69e2 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -42,6 +42,7 @@ if(NOT BUILD_METALIBS) EXPORT OpenGL COMPONENT OpenGL DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT OpenGLDevel) endif() install(FILES ${P3GLSTUFF_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index e72de3e47c..1d62650e14 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -189,6 +189,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3GOBJ_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index fc88b477d2..2f88a25253 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -60,6 +60,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3GRUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index 1bb116196d..d83f31c90a 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -21,6 +21,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3GSGBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index 84b4479856..e60e1a5a59 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -57,6 +57,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3LINMATH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index d34c0fc563..ce03b71ee8 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -76,6 +76,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3MATHUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 36fce6a74b..53aff18c45 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -56,6 +56,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3MOVIES_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index b79f453e87..a91159e1c6 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -42,6 +42,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3NATIVENET_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index b8bd67cc36..3be1e77e40 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -45,6 +45,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3NET_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 18ff027cb9..1e636d80f8 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -96,6 +96,7 @@ install(TARGETS p3ode EXPORT ODE COMPONENT ODE DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT ODEDevel) install(FILES ${P3ODE_HEADERS} COMPONENT ODEDevel DESTINATION include/panda3d) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index 5703a7696c..ffeae49b97 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -45,6 +45,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PARAMETRICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index 5ce2896a5d..b5db39a429 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -58,6 +58,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PARTICLESYSTEM_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index ec83f00fa6..8110676c53 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -235,6 +235,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 6228fcbe5b..03dce3a677 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -55,6 +55,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PGRAPHNODES_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 5bace60210..626f88c54a 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -51,6 +51,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PGUI_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 89cd33cc1e..3e2f2d8c97 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -49,6 +49,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PHYSICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 0e117e8208..066c1a6a96 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -142,6 +142,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PIPELINE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 9c3f6fccbd..2301fba2fe 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -50,6 +50,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PNMIMAGE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 2171b54efc..2dd618a3b5 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -29,6 +29,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PNMTEXT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index f43cc0cde1..48bed3ae63 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -38,6 +38,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PSTATCLIENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index 3ceb58b7be..e40872b034 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -143,6 +143,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3PUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 6ee0ca8e4f..5c13272ae6 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -28,6 +28,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3RECORDER_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index 0caad3504d..b86aa33208 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -52,6 +52,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3TEXT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index 580c7847f1..5159323eef 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -39,6 +39,7 @@ if(NOT BUILD_METALIBS) EXPORT Core COMPONENT Core DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT CoreDevel) endif() install(FILES ${P3TFORM_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt index 4df746016f..38f1c474f4 100644 --- a/panda/src/vision/CMakeLists.txt +++ b/panda/src/vision/CMakeLists.txt @@ -47,6 +47,7 @@ install(TARGETS p3vision EXPORT Vision COMPONENT Vision DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT VisionDevel) install(FILES ${P3VISION_HEADERS} COMPONENT VisionDevel DESTINATION include/panda3d) diff --git a/panda/src/vrpn/CMakeLists.txt b/panda/src/vrpn/CMakeLists.txt index ff7e0f20c9..231269b070 100644 --- a/panda/src/vrpn/CMakeLists.txt +++ b/panda/src/vrpn/CMakeLists.txt @@ -39,6 +39,7 @@ install(TARGETS p3vrpn EXPORT VRPN COMPONENT VRPN DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT VRPNDevel) install(FILES ${P3VRPN_HEADERS} COMPONENT VRPNDevel DESTINATION include/panda3d) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index 0b08f00a7d..d5ea724ef5 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -29,6 +29,7 @@ if(NOT BUILD_METALIBS) EXPORT OpenGL COMPONENT OpenGL DESTINATION lib RUNTIME DESTINATION bin + INCLUDES DESTINATION include/panda3d ARCHIVE COMPONENT OpenGLDevel) endif() install(FILES ${P3WGLDISPLAY_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) From 5fa4af918964a968eff601e53e6970e567d317f8 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 31 Aug 2019 00:11:48 -0600 Subject: [PATCH 679/744] CMake: Rely on GNUInstallDirs to specify install paths This makes multiarch OSes happy as they can dictate that 64-bit libraries go into 'lib64' --- CMakeLists.txt | 9 ++++++--- cmake/macros/BuildMetalib.cmake | 4 ++-- cmake/macros/PackageConfig.cmake | 2 +- cmake/macros/Python.cmake | 2 +- contrib/src/ai/CMakeLists.txt | 8 ++++---- contrib/src/contribbase/CMakeLists.txt | 2 +- contrib/src/rplight/CMakeLists.txt | 8 ++++---- direct/CMakeLists.txt | 4 ++-- direct/src/dcparse/CMakeLists.txt | 2 +- direct/src/dcparser/CMakeLists.txt | 8 ++++---- direct/src/deadrec/CMakeLists.txt | 8 ++++---- direct/src/directbase/CMakeLists.txt | 2 +- direct/src/distributed/CMakeLists.txt | 8 ++++---- direct/src/interval/CMakeLists.txt | 8 ++++---- direct/src/motiontrail/CMakeLists.txt | 8 ++++---- direct/src/showbase/CMakeLists.txt | 8 ++++---- dtool/CompilerFlags.cmake | 2 +- dtool/LocalSetup.cmake | 4 ++-- dtool/metalibs/dtool/CMakeLists.txt | 6 +++--- dtool/metalibs/dtoolconfig/CMakeLists.txt | 6 +++--- dtool/src/cppparser/CMakeLists.txt | 2 +- dtool/src/dconfig/CMakeLists.txt | 2 +- dtool/src/dtoolbase/CMakeLists.txt | 8 ++++---- dtool/src/dtoolutil/CMakeLists.txt | 8 ++++---- dtool/src/interrogate/CMakeLists.txt | 4 ++-- dtool/src/interrogatedb/CMakeLists.txt | 10 +++++----- dtool/src/prc/CMakeLists.txt | 8 ++++---- panda/metalibs/panda/CMakeLists.txt | 6 +++--- panda/metalibs/pandaegg/CMakeLists.txt | 6 +++--- panda/metalibs/pandaexpress/CMakeLists.txt | 6 +++--- panda/metalibs/pandaphysics/CMakeLists.txt | 6 +++--- panda/src/audio/CMakeLists.txt | 8 ++++---- panda/src/audiotraits/CMakeLists.txt | 16 ++++++++-------- panda/src/bullet/CMakeLists.txt | 8 ++++---- panda/src/chan/CMakeLists.txt | 8 ++++---- panda/src/char/CMakeLists.txt | 8 ++++---- panda/src/cocoadisplay/CMakeLists.txt | 2 +- panda/src/collide/CMakeLists.txt | 8 ++++---- panda/src/configfiles/CMakeLists.txt | 11 ++++++++++- panda/src/cull/CMakeLists.txt | 8 ++++---- panda/src/device/CMakeLists.txt | 8 ++++---- panda/src/dgraph/CMakeLists.txt | 8 ++++---- panda/src/display/CMakeLists.txt | 8 ++++---- panda/src/distort/CMakeLists.txt | 8 ++++---- panda/src/downloader/CMakeLists.txt | 8 ++++---- panda/src/downloadertools/CMakeLists.txt | 6 +++--- panda/src/dxgsg9/CMakeLists.txt | 8 ++++---- panda/src/dxml/CMakeLists.txt | 8 ++++---- panda/src/egg/CMakeLists.txt | 8 ++++---- panda/src/egg2pg/CMakeLists.txt | 8 ++++---- panda/src/egldisplay/CMakeLists.txt | 14 +++++++------- panda/src/event/CMakeLists.txt | 8 ++++---- panda/src/express/CMakeLists.txt | 8 ++++---- panda/src/ffmpeg/CMakeLists.txt | 8 ++++---- panda/src/framework/CMakeLists.txt | 8 ++++---- panda/src/gles2gsg/CMakeLists.txt | 8 ++++---- panda/src/glesgsg/CMakeLists.txt | 8 ++++---- panda/src/glgsg/CMakeLists.txt | 8 ++++---- panda/src/glstuff/CMakeLists.txt | 8 ++++---- panda/src/glxdisplay/CMakeLists.txt | 2 +- panda/src/gobj/CMakeLists.txt | 8 ++++---- panda/src/grutil/CMakeLists.txt | 8 ++++---- panda/src/gsgbase/CMakeLists.txt | 8 ++++---- panda/src/linmath/CMakeLists.txt | 8 ++++---- panda/src/mathutil/CMakeLists.txt | 8 ++++---- panda/src/movies/CMakeLists.txt | 8 ++++---- panda/src/nativenet/CMakeLists.txt | 8 ++++---- panda/src/net/CMakeLists.txt | 8 ++++---- panda/src/ode/CMakeLists.txt | 8 ++++---- panda/src/pandabase/CMakeLists.txt | 2 +- panda/src/parametrics/CMakeLists.txt | 8 ++++---- panda/src/particlesystem/CMakeLists.txt | 8 ++++---- panda/src/pgraph/CMakeLists.txt | 8 ++++---- panda/src/pgraphnodes/CMakeLists.txt | 8 ++++---- panda/src/pgui/CMakeLists.txt | 8 ++++---- panda/src/physics/CMakeLists.txt | 8 ++++---- panda/src/pipeline/CMakeLists.txt | 8 ++++---- panda/src/pnmimage/CMakeLists.txt | 8 ++++---- panda/src/pnmimagetypes/CMakeLists.txt | 4 ++-- panda/src/pnmtext/CMakeLists.txt | 8 ++++---- panda/src/pstatclient/CMakeLists.txt | 10 +++++----- panda/src/putil/CMakeLists.txt | 10 +++++----- panda/src/recorder/CMakeLists.txt | 8 ++++---- panda/src/testbed/CMakeLists.txt | 2 +- panda/src/text/CMakeLists.txt | 8 ++++---- panda/src/tform/CMakeLists.txt | 8 ++++---- panda/src/vision/CMakeLists.txt | 8 ++++---- panda/src/vrpn/CMakeLists.txt | 8 ++++---- panda/src/wgldisplay/CMakeLists.txt | 8 ++++---- panda/src/windisplay/CMakeLists.txt | 4 ++-- panda/src/x11display/CMakeLists.txt | 2 +- pandatool/src/bam/CMakeLists.txt | 8 ++++---- pandatool/src/daeprogs/CMakeLists.txt | 4 ++-- pandatool/src/dxfprogs/CMakeLists.txt | 6 +++--- pandatool/src/egg-mkfont/CMakeLists.txt | 2 +- pandatool/src/egg-optchar/CMakeLists.txt | 2 +- pandatool/src/egg-palettize/CMakeLists.txt | 4 ++-- pandatool/src/egg-qtess/CMakeLists.txt | 2 +- pandatool/src/eggprogs/CMakeLists.txt | 18 +++++++++--------- pandatool/src/fltprogs/CMakeLists.txt | 8 ++++---- pandatool/src/gtk-stats/CMakeLists.txt | 2 +- pandatool/src/imageprogs/CMakeLists.txt | 10 +++++----- pandatool/src/lwoprogs/CMakeLists.txt | 4 ++-- pandatool/src/miscprogs/CMakeLists.txt | 2 +- pandatool/src/objprogs/CMakeLists.txt | 4 ++-- pandatool/src/pfmprogs/CMakeLists.txt | 4 ++-- pandatool/src/text-stats/CMakeLists.txt | 2 +- pandatool/src/vrmlprogs/CMakeLists.txt | 4 ++-- pandatool/src/win-stats/CMakeLists.txt | 2 +- pandatool/src/xfileprogs/CMakeLists.txt | 6 +++--- 110 files changed, 371 insertions(+), 359 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 402f0e4c5b..d3fd66addc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,6 +29,9 @@ if(CMAKE_VERSION VERSION_GREATER "3.8") set_property(GLOBAL PROPERTY XCODE_EMIT_EFFECTIVE_PLATFORM_NAME OFF) endif() +# Include modules builtin to CMake +include(GNUInstallDirs) # Defines CMAKE_INSTALL_ variables + # Include global modules needed for configure scripts include(PackageConfig) # Defines package_option @@ -104,7 +107,7 @@ if(BUILD_MODELS) COMMENT "Copying dmodels' assets") install(DIRECTORY "${PANDA_OUTPUT_DIR}/models" - COMPONENT Models DESTINATION share/panda3d) + COMPONENT Models DESTINATION ${CMAKE_INSTALL_DATADIR}/panda3d) endif() if(INTERROGATE_PYTHON_INTERFACE) @@ -123,7 +126,7 @@ endif() file(COPY "${PROJECT_SOURCE_DIR}/cmake/install/Panda3DConfig.cmake" DESTINATION "${PROJECT_BINARY_DIR}") install(FILES "${PROJECT_SOURCE_DIR}/cmake/install/Panda3DConfig.cmake" - DESTINATION "lib/cmake/Panda3D") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Panda3D") include(CMakePackageConfigHelpers) write_basic_package_version_file( @@ -131,7 +134,7 @@ write_basic_package_version_file( VERSION "${PROJECT_VERSION}" COMPATIBILITY AnyNewerVersion) install(FILES "${PROJECT_BINARY_DIR}/Panda3DConfigVersion.cmake" - DESTINATION "lib/cmake/Panda3D") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Panda3D") if(NOT CMAKE_CROSSCOMPILING) export(PACKAGE Panda3D) diff --git a/cmake/macros/BuildMetalib.cmake b/cmake/macros/BuildMetalib.cmake index 7b4c1d8173..079b794b85 100644 --- a/cmake/macros/BuildMetalib.cmake +++ b/cmake/macros/BuildMetalib.cmake @@ -411,7 +411,7 @@ function(add_metalib target_name) configure_file("${PROJECT_SOURCE_DIR}/cmake/templates/metalib_init.h.in" "${init_header_path}") - install(FILES "${init_header_path}" DESTINATION include/panda3d) + install(FILES "${init_header_path}" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) endif() add_library("${target_name}" ${sources}) @@ -421,6 +421,6 @@ function(add_metalib target_name) target_link_libraries("${target_name}" ${libs}) target_include_directories("${target_name}" PUBLIC ${includes} - INTERFACE "$/include/panda3d>") + INTERFACE "$/${CMAKE_INSTALL_INCLUDEDIR}/panda3d>") endfunction(add_metalib) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 8c1cf70ee5..2b692e543d 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -457,7 +457,7 @@ function(export_targets set) FILE "${PROJECT_BINARY_DIR}/Panda3D${set}Targets.cmake") install(EXPORT "${set}" NAMESPACE "${namespace}" FILE "Panda3D${set}Targets.cmake" - COMPONENT "${component}" DESTINATION lib/cmake/Panda3D) + COMPONENT "${component}" DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Panda3D) endfunction(export_targets) diff --git a/cmake/macros/Python.cmake b/cmake/macros/Python.cmake index e247052214..32258d4a6d 100644 --- a/cmake/macros/Python.cmake +++ b/cmake/macros/Python.cmake @@ -75,7 +75,7 @@ function(add_python_target target) OUTPUT_NAME "${basename}" PREFIX "libpy.${namespace}.") - install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION lib) + install(TARGETS ${target} EXPORT "${export}" COMPONENT "${component}" DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/contrib/src/ai/CMakeLists.txt b/contrib/src/ai/CMakeLists.txt index 11bbd56c3e..3e7f028444 100644 --- a/contrib/src/ai/CMakeLists.txt +++ b/contrib/src/ai/CMakeLists.txt @@ -47,8 +47,8 @@ target_interrogate(p3ai ALL) install(TARGETS p3ai EXPORT Contrib COMPONENT Contrib - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT ContribDevel) -install(FILES ${P3AI_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) +install(FILES ${P3AI_HEADERS} COMPONENT ContribDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/contrib/src/contribbase/CMakeLists.txt b/contrib/src/contribbase/CMakeLists.txt index a60e741c6e..630bffc0a6 100644 --- a/contrib/src/contribbase/CMakeLists.txt +++ b/contrib/src/contribbase/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(p3contribbase INTERFACE) target_link_libraries(p3contribbase INTERFACE panda) install(TARGETS p3contribbase EXPORT Contrib COMPONENT Contrib) -install(FILES ${P3CONTRIBBASE_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) +install(FILES ${P3CONTRIBBASE_HEADERS} COMPONENT ContribDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/contrib/src/rplight/CMakeLists.txt b/contrib/src/rplight/CMakeLists.txt index c4b21d057d..9f476c30cd 100644 --- a/contrib/src/rplight/CMakeLists.txt +++ b/contrib/src/rplight/CMakeLists.txt @@ -45,8 +45,8 @@ endif() install(TARGETS p3rplight EXPORT Contrib COMPONENT Contrib - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT ContribDevel) -install(FILES ${P3RPLIGHT_HEADERS} COMPONENT ContribDevel DESTINATION include/panda3d) +install(FILES ${P3RPLIGHT_HEADERS} COMPONENT ContribDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 18847d4b9b..1e4e57c842 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -30,8 +30,8 @@ set_property(TARGET p3direct PROPERTY LINKER_LANGUAGE "CXX") # Installation: install(TARGETS p3direct EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE COMPONENT DirectDevel) if(HAVE_PYTHON) diff --git a/direct/src/dcparse/CMakeLists.txt b/direct/src/dcparse/CMakeLists.txt index 747f5896b2..e5cdee5b18 100644 --- a/direct/src/dcparse/CMakeLists.txt +++ b/direct/src/dcparse/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(p3dcparse dcparse.cxx) target_link_libraries(p3dcparse p3direct) -install(TARGETS p3dcparse EXPORT Direct COMPONENT Direct DESTINATION bin) +install(TARGETS p3dcparse EXPORT Direct COMPONENT Direct DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/direct/src/dcparser/CMakeLists.txt b/direct/src/dcparser/CMakeLists.txt index 248197d21b..e90ca815d8 100644 --- a/direct/src/dcparser/CMakeLists.txt +++ b/direct/src/dcparser/CMakeLists.txt @@ -79,9 +79,9 @@ target_interrogate(p3dcparser ${P3DCPARSER_HEADERS} ${P3DCPARSER_SOURCES} if(NOT BUILD_METALIBS) install(TARGETS p3dcparser EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3DCPARSER_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3DCPARSER_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/src/deadrec/CMakeLists.txt b/direct/src/deadrec/CMakeLists.txt index e4ef5738fe..0a2bb1b96a 100644 --- a/direct/src/deadrec/CMakeLists.txt +++ b/direct/src/deadrec/CMakeLists.txt @@ -16,9 +16,9 @@ target_interrogate(p3deadrec ALL) if(NOT BUILD_METALIBS) install(TARGETS p3deadrec EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3DEADREC_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3DEADREC_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/src/directbase/CMakeLists.txt b/direct/src/directbase/CMakeLists.txt index c4ae151277..eea5100de2 100644 --- a/direct/src/directbase/CMakeLists.txt +++ b/direct/src/directbase/CMakeLists.txt @@ -11,4 +11,4 @@ add_library(p3directbase INTERFACE) target_link_libraries(p3directbase INTERFACE panda) install(TARGETS p3directbase EXPORT Direct COMPONENT Direct) -install(FILES ${P3DIRECTBASE_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3DIRECTBASE_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 6a675e7319..9b60daff62 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -27,9 +27,9 @@ target_interrogate(p3distributed ALL EXTENSIONS ${P3DISTRIBUTED_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3distributed EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3DISTRIBUTED_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3DISTRIBUTED_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/src/interval/CMakeLists.txt b/direct/src/interval/CMakeLists.txt index 0b7cf77d59..2eba8a917a 100644 --- a/direct/src/interval/CMakeLists.txt +++ b/direct/src/interval/CMakeLists.txt @@ -46,9 +46,9 @@ target_interrogate(p3interval ALL) if(NOT BUILD_METALIBS) install(TARGETS p3interval EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3INTERVAL_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3INTERVAL_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/src/motiontrail/CMakeLists.txt b/direct/src/motiontrail/CMakeLists.txt index 30b9745c2f..2c4ba8b78b 100644 --- a/direct/src/motiontrail/CMakeLists.txt +++ b/direct/src/motiontrail/CMakeLists.txt @@ -16,9 +16,9 @@ target_interrogate(p3motiontrail ALL) if(NOT BUILD_METALIBS) install(TARGETS p3motiontrail EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3MOTIONTRAIL_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3MOTIONTRAIL_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index c080fbf62c..815aeb5bc2 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -19,9 +19,9 @@ target_interrogate(p3showbase ALL) if(NOT BUILD_METALIBS) install(TARGETS p3showbase EXPORT Direct COMPONENT Direct - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DirectDevel) endif() -install(FILES ${P3SHOWBASE_HEADERS} COMPONENT DirectDevel DESTINATION include/panda3d) +install(FILES ${P3SHOWBASE_HEADERS} COMPONENT DirectDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 2e4194ff9b..2d430e81a7 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -44,7 +44,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/bin") set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/lib") set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PANDA_OUTPUT_DIR}/lib") -set(MODULE_DESTINATION "lib") +set(MODULE_DESTINATION "${CMAKE_INSTALL_LIBDIR}") # Runtime code assumes that dynamic modules have a "lib" prefix; Windows # assumes that debug libraries have a _d suffix. diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index a6fc3a0147..a181fb12e9 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -211,10 +211,10 @@ endif() install(FILES "${PANDA_OUTPUT_DIR}/include/dtool_config.h" COMPONENT CoreDevel - DESTINATION include/panda3d) + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) # Generate the package configuration file export_packages("${PROJECT_BINARY_DIR}/Panda3DPackages.cmake") install(FILES "${PROJECT_BINARY_DIR}/Panda3DPackages.cmake" COMPONENT CoreDevel - DESTINATION "lib/cmake/Panda3D") + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Panda3D") diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index a952ff7f73..fc5eb3c722 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -4,7 +4,7 @@ unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS p3dtool EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index e0527e310e..3d36dcf39e 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -5,7 +5,7 @@ unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS p3dtoolconfig EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/src/cppparser/CMakeLists.txt b/dtool/src/cppparser/CMakeLists.txt index 2f865933f1..4408a52198 100644 --- a/dtool/src/cppparser/CMakeLists.txt +++ b/dtool/src/cppparser/CMakeLists.txt @@ -41,4 +41,4 @@ composite_sources(p3cppParser P3CPPPARSER_SOURCES) add_library(p3cppParser STATIC ${P3CPPPARSER_HEADERS} ${P3CPPPARSER_SOURCES}) target_link_libraries(p3cppParser p3dtool) -install(TARGETS p3cppParser EXPORT Core COMPONENT CoreDevel DESTINATION lib) +install(TARGETS p3cppParser EXPORT Core COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/dtool/src/dconfig/CMakeLists.txt b/dtool/src/dconfig/CMakeLists.txt index 550d8debd3..ccd9e6c144 100644 --- a/dtool/src/dconfig/CMakeLists.txt +++ b/dtool/src/dconfig/CMakeLists.txt @@ -2,5 +2,5 @@ # We're only doing this to put the .h file on the path. add_library(p3dconfig INTERFACE) -install(FILES dconfig.h COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES dconfig.h COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) install(TARGETS p3dconfig EXPORT Core COMPONENT Core) diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 69443ce6e4..079e6a4e34 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -98,9 +98,9 @@ target_interrogate(p3dtoolbase ${P3DTOOLBASE_SOURCES} EXTENSIONS ${P3DTOOLBASE_I if(NOT BUILD_METALIBS) install(TARGETS p3dtoolbase EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DTOOLBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DTOOLBASE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 7d92b1b405..0ad93fd8c5 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -145,9 +145,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3dtoolutil EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DTOOLUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DTOOLUTIL_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index efa0933717..a4a70774d7 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -85,8 +85,8 @@ if(NOT CMAKE_CROSSCOMPILING) endif() if(WANT_INTERROGATE) - install(TARGETS interrogate interrogate_module EXPORT Core COMPONENT CoreDevel DESTINATION bin) - install(FILES ${INTERROGATE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) + install(TARGETS interrogate interrogate_module EXPORT Core COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_BINDIR}) + install(FILES ${INTERROGATE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) else() set_target_properties(interrogate interrogate_module diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 5f89ce4777..947bb93cc9 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -41,13 +41,13 @@ target_link_libraries(p3interrogatedb p3prc p3dconfig p3dtool) if(NOT BUILD_METALIBS) install(TARGETS p3interrogatedb EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3INTERROGATEDB_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) -install(FILES ${P3IGATERUNTIME_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3INTERROGATEDB_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) +install(FILES ${P3IGATERUNTIME_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) # ALSO: This has an Interrogate binding! Take care of that if we want it. # Note we don't use the regular Interrogate macros; this has some custom flags diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index cb5fb7ebfc..175494a716 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -94,9 +94,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3prc EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PRC_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PRC_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/metalibs/panda/CMakeLists.txt b/panda/metalibs/panda/CMakeLists.txt index 73cd958902..d9dd160c8b 100644 --- a/panda/metalibs/panda/CMakeLists.txt +++ b/panda/metalibs/panda/CMakeLists.txt @@ -26,7 +26,7 @@ unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS panda EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/panda/metalibs/pandaegg/CMakeLists.txt b/panda/metalibs/pandaegg/CMakeLists.txt index 5836e38d2f..b8c4ba3730 100644 --- a/panda/metalibs/pandaegg/CMakeLists.txt +++ b/panda/metalibs/pandaegg/CMakeLists.txt @@ -11,9 +11,9 @@ target_link_libraries(pandaegg panda) install(TARGETS pandaegg EXPORT Egg COMPONENT Egg - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT EggDevel) export_targets(Egg COMPONENT EggDevel) diff --git a/panda/metalibs/pandaexpress/CMakeLists.txt b/panda/metalibs/pandaexpress/CMakeLists.txt index 27d5d4f35f..0132dea0e9 100644 --- a/panda/metalibs/pandaexpress/CMakeLists.txt +++ b/panda/metalibs/pandaexpress/CMakeLists.txt @@ -6,7 +6,7 @@ unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS pandaexpress EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/panda/metalibs/pandaphysics/CMakeLists.txt b/panda/metalibs/pandaphysics/CMakeLists.txt index a18e867f3e..49041f5973 100644 --- a/panda/metalibs/pandaphysics/CMakeLists.txt +++ b/panda/metalibs/pandaphysics/CMakeLists.txt @@ -6,7 +6,7 @@ unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS pandaphysics EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) diff --git a/panda/src/audio/CMakeLists.txt b/panda/src/audio/CMakeLists.txt index 35f61710d4..3d37816b00 100644 --- a/panda/src/audio/CMakeLists.txt +++ b/panda/src/audio/CMakeLists.txt @@ -31,9 +31,9 @@ target_interrogate(p3audio ALL) if(NOT BUILD_METALIBS) install(TARGETS p3audio EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3AUDIO_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3AUDIO_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index b565d5ae05..71c4da09eb 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -23,11 +23,11 @@ if(HAVE_FMODEX) install(TARGETS p3fmod_audio EXPORT FMOD COMPONENT FMOD - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT FMODDevel) - install(FILES ${P3FMOD_HEADERS} COMPONENT FMODDevel DESTINATION include/panda3d) + install(FILES ${P3FMOD_HEADERS} COMPONENT FMODDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(FMOD NAMESPACE "Panda3D::FMOD::" COMPONENT FMODDevel) endif() @@ -51,11 +51,11 @@ if(HAVE_OPENAL) install(TARGETS p3openal_audio EXPORT OpenAL COMPONENT OpenAL - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT OpenALDevel) - install(FILES ${P3OPENAL_HEADERS} COMPONENT OpenALDevel DESTINATION include/panda3d) + install(FILES ${P3OPENAL_HEADERS} COMPONENT OpenALDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(OpenAL NAMESPACE "Panda3D::OpenAL::" COMPONENT OpenALDevel) endif() diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index 7f609a5264..29573468cd 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -116,10 +116,10 @@ target_interrogate(p3bullet ALL) install(TARGETS p3bullet EXPORT Bullet COMPONENT Bullet - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT BulletDevel) -install(FILES ${P3BULLET_HEADERS} COMPONENT BulletDevel DESTINATION include/panda3d) +install(FILES ${P3BULLET_HEADERS} COMPONENT BulletDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(Bullet COMPONENT BulletDevel) diff --git a/panda/src/chan/CMakeLists.txt b/panda/src/chan/CMakeLists.txt index b1256346c0..0b1565d198 100644 --- a/panda/src/chan/CMakeLists.txt +++ b/panda/src/chan/CMakeLists.txt @@ -61,9 +61,9 @@ target_interrogate(p3chan ALL) if(NOT BUILD_METALIBS) install(TARGETS p3chan EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3CHAN_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3CHAN_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/char/CMakeLists.txt b/panda/src/char/CMakeLists.txt index fd7dde17ee..d33bd470b0 100644 --- a/panda/src/char/CMakeLists.txt +++ b/panda/src/char/CMakeLists.txt @@ -28,9 +28,9 @@ target_interrogate(p3char ALL) if(NOT BUILD_METALIBS) install(TARGETS p3char EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3CHAR_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3CHAR_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/cocoadisplay/CMakeLists.txt b/panda/src/cocoadisplay/CMakeLists.txt index 413eb1426d..ed6e4ca521 100644 --- a/panda/src/cocoadisplay/CMakeLists.txt +++ b/panda/src/cocoadisplay/CMakeLists.txt @@ -43,5 +43,5 @@ target_link_libraries(p3cocoadisplay ${CORE_VIDEO_LIBRARY}) if(NOT BUILD_METALIBS) - install(TARGETS p3cocoadisplay EXPORT OpenGL COMPONENT OpenGL DESTINATION lib) + install(TARGETS p3cocoadisplay EXPORT OpenGL COMPONENT OpenGL DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/panda/src/collide/CMakeLists.txt b/panda/src/collide/CMakeLists.txt index 57640941db..63ac4163e8 100644 --- a/panda/src/collide/CMakeLists.txt +++ b/panda/src/collide/CMakeLists.txt @@ -74,9 +74,9 @@ target_interrogate(p3collide ALL) if(NOT BUILD_METALIBS) install(TARGETS p3collide EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3COLLIDE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3COLLIDE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index a95aa3d285..edaa95eeb2 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -27,4 +27,13 @@ if(IS_MULTICONFIG) INPUT "${PROJECT_BINARY_DIR}/etc/20_panda.prc") endif() -install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" COMPONENT Core DESTINATION etc) +if(WIN32) + set(_confdir "etc") + +else() + # On Unices, ask the GNUInstallDirs module where /etc is + set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}") + +endif() + +install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" COMPONENT Core DESTINATION ${_confdir}) diff --git a/panda/src/cull/CMakeLists.txt b/panda/src/cull/CMakeLists.txt index a955276eb2..0e5e099b00 100644 --- a/panda/src/cull/CMakeLists.txt +++ b/panda/src/cull/CMakeLists.txt @@ -29,9 +29,9 @@ target_interrogate(p3cull ALL) if(NOT BUILD_METALIBS) install(TARGETS p3cull EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3CULL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3CULL_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/device/CMakeLists.txt b/panda/src/device/CMakeLists.txt index bf8294385c..fb4145e131 100644 --- a/panda/src/device/CMakeLists.txt +++ b/panda/src/device/CMakeLists.txt @@ -72,9 +72,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3device EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DEVICE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DEVICE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/dgraph/CMakeLists.txt b/panda/src/dgraph/CMakeLists.txt index 08184c0df2..10caff45ef 100644 --- a/panda/src/dgraph/CMakeLists.txt +++ b/panda/src/dgraph/CMakeLists.txt @@ -21,9 +21,9 @@ target_interrogate(p3dgraph ALL) if(NOT BUILD_METALIBS) install(TARGETS p3dgraph EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index bed17c1f5f..3af8e1bbb2 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -108,9 +108,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3display EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DISPLAY_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DISPLAY_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/distort/CMakeLists.txt b/panda/src/distort/CMakeLists.txt index 727d3e2856..2a555fcdc9 100644 --- a/panda/src/distort/CMakeLists.txt +++ b/panda/src/distort/CMakeLists.txt @@ -26,8 +26,8 @@ target_interrogate(pandafx ALL) install(TARGETS pandafx EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) -install(FILES ${P3DISTORT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DISTORT_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/downloader/CMakeLists.txt b/panda/src/downloader/CMakeLists.txt index d453a53987..25ba1f6efc 100644 --- a/panda/src/downloader/CMakeLists.txt +++ b/panda/src/downloader/CMakeLists.txt @@ -67,9 +67,9 @@ target_interrogate(p3downloader ALL) if(NOT BUILD_METALIBS) install(TARGETS p3downloader EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DOWNLOADER_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DOWNLOADER_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index 5de61edac2..bed053fb61 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -25,7 +25,7 @@ if(HAVE_OPENSSL) install(TARGETS apply_patch build_patch show_ddb check_md5 pencrypt pdecrypt EXPORT Tools COMPONENT Tools - DESTINATION bin) + DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(HAVE_ZLIB) @@ -47,9 +47,9 @@ if(HAVE_ZLIB) install(TARGETS check_adler check_crc pzip punzip EXPORT Tools COMPONENT Tools - DESTINATION bin) + DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() add_executable(multify multify.cxx) target_link_libraries(multify panda) -install(TARGETS multify EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS multify EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt index 426a8837b6..6442a95e76 100644 --- a/panda/src/dxgsg9/CMakeLists.txt +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -48,9 +48,9 @@ target_compile_definitions(p3dxgsg9 PUBLIC USE_GENERIC_DXERR_LIBRARY) # FIXME if(NOT BUILD_METALIBS) install(TARGETS p3dxgsg9 EXPORT DX9 COMPONENT DX9 - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT DX9Devel) endif() -install(FILES ${P3DXGSG9_HEADERS} COMPONENT DX9Devel DESTINATION include/panda3d) +install(FILES ${P3DXGSG9_HEADERS} COMPONENT DX9Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/dxml/CMakeLists.txt b/panda/src/dxml/CMakeLists.txt index 56dc867099..8b67b09d35 100644 --- a/panda/src/dxml/CMakeLists.txt +++ b/panda/src/dxml/CMakeLists.txt @@ -20,9 +20,9 @@ target_interrogate(p3dxml ALL) if(NOT BUILD_METALIBS) install(TARGETS p3dxml EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3DXML_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3DXML_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/egg/CMakeLists.txt b/panda/src/egg/CMakeLists.txt index 029d148f3c..5cdd891182 100644 --- a/panda/src/egg/CMakeLists.txt +++ b/panda/src/egg/CMakeLists.txt @@ -107,9 +107,9 @@ target_interrogate(p3egg ${P3EGG_HEADERS} ${P3EGG_SOURCES} EXTENSIONS ${P3EGG_IG if(NOT BUILD_METALIBS) install(TARGETS p3egg EXPORT Egg COMPONENT Egg - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT EggDevel) endif() -install(FILES ${P3EGG_HEADERS} COMPONENT EggDevel DESTINATION include/panda3d) +install(FILES ${P3EGG_HEADERS} COMPONENT EggDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/egg2pg/CMakeLists.txt b/panda/src/egg2pg/CMakeLists.txt index 5fcde65105..e0dcd91763 100644 --- a/panda/src/egg2pg/CMakeLists.txt +++ b/panda/src/egg2pg/CMakeLists.txt @@ -41,9 +41,9 @@ target_interrogate(p3egg2pg ALL) if(NOT BUILD_METALIBS) install(TARGETS p3egg2pg EXPORT Egg COMPONENT Egg - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT EggDevel) endif() -install(FILES ${P3EGG2PG_HEADERS} COMPONENT EggDevel DESTINATION include/panda3d) +install(FILES ${P3EGG2PG_HEADERS} COMPONENT EggDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/egldisplay/CMakeLists.txt b/panda/src/egldisplay/CMakeLists.txt index 7506bcaf95..9d7879362a 100644 --- a/panda/src/egldisplay/CMakeLists.txt +++ b/panda/src/egldisplay/CMakeLists.txt @@ -38,9 +38,9 @@ if(HAVE_GLES1) if(NOT BUILD_METALIBS) install(TARGETS p3egldisplay_gles1 EXPORT GLES COMPONENT GLES - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT GLESDevel) endif() endif() @@ -56,11 +56,11 @@ if(HAVE_GLES2) if(NOT BUILD_METALIBS) install(TARGETS p3egldisplay_gles2 EXPORT GLES COMPONENT GLES - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT GLESDevel) endif() endif() -install(FILES ${P3EGLDISPLAY_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) +install(FILES ${P3EGLDISPLAY_HEADERS} COMPONENT GLESDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/event/CMakeLists.txt b/panda/src/event/CMakeLists.txt index d100545b7d..b0464ff793 100644 --- a/panda/src/event/CMakeLists.txt +++ b/panda/src/event/CMakeLists.txt @@ -53,9 +53,9 @@ target_interrogate(p3event ALL EXTENSIONS ${P3EVENT_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3event EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3EVENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3EVENT_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index a6248ad97d..cca0aa8874 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -165,9 +165,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3express EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3EXPRESS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3EXPRESS_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index ccc820101b..08e3b252cc 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -36,10 +36,10 @@ endif() install(TARGETS p3ffmpeg EXPORT FFmpeg COMPONENT FFmpeg - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT FFmpegDevel) -install(FILES ${P3FFMPEG_HEADERS} COMPONENT FFmpegDevel DESTINATION include/panda3d) +install(FILES ${P3FFMPEG_HEADERS} COMPONENT FFmpegDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(FFmpeg COMPONENT FFmpegDevel) diff --git a/panda/src/framework/CMakeLists.txt b/panda/src/framework/CMakeLists.txt index 9b407d1cf4..d299c86bd1 100644 --- a/panda/src/framework/CMakeLists.txt +++ b/panda/src/framework/CMakeLists.txt @@ -53,10 +53,10 @@ endforeach(var) install(TARGETS p3framework EXPORT Framework COMPONENT Framework - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT FrameworkDevel) -install(FILES ${P3FRAMEWORK_HEADERS} COMPONENT FrameworkDevel DESTINATION include/panda3d) +install(FILES ${P3FRAMEWORK_HEADERS} COMPONENT FrameworkDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(Framework COMPONENT FrameworkDevel) diff --git a/panda/src/gles2gsg/CMakeLists.txt b/panda/src/gles2gsg/CMakeLists.txt index 38ed68c621..515818f407 100644 --- a/panda/src/gles2gsg/CMakeLists.txt +++ b/panda/src/gles2gsg/CMakeLists.txt @@ -21,9 +21,9 @@ target_link_libraries(p3gles2gsg p3glstuff panda if(NOT BUILD_METALIBS) install(TARGETS p3gles2gsg EXPORT GLES COMPONENT GLES - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT GLESDevel) endif() -install(FILES ${P3GLES2GSG_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) +install(FILES ${P3GLES2GSG_HEADERS} COMPONENT GLESDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/glesgsg/CMakeLists.txt b/panda/src/glesgsg/CMakeLists.txt index 9e43f774c9..feb0641509 100644 --- a/panda/src/glesgsg/CMakeLists.txt +++ b/panda/src/glesgsg/CMakeLists.txt @@ -21,9 +21,9 @@ target_link_libraries(p3glesgsg p3glstuff panda if(NOT BUILD_METALIBS) install(TARGETS p3glesgsg EXPORT GLES COMPONENT GLES - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT GLESDevel) endif() -install(FILES ${P3GLESGSG_HEADERS} COMPONENT GLESDevel DESTINATION include/panda3d) +install(FILES ${P3GLESGSG_HEADERS} COMPONENT GLESDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/glgsg/CMakeLists.txt b/panda/src/glgsg/CMakeLists.txt index d3c923a99e..d8ddad03bb 100644 --- a/panda/src/glgsg/CMakeLists.txt +++ b/panda/src/glgsg/CMakeLists.txt @@ -20,9 +20,9 @@ target_link_libraries(p3glgsg p3glstuff panda if(NOT BUILD_METALIBS) install(TARGETS p3glgsg EXPORT OpenGL COMPONENT OpenGL - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT OpenGLDevel) endif() -install(FILES ${P3GLGSG_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) +install(FILES ${P3GLGSG_HEADERS} COMPONENT OpenGLDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index 4304fe69e2..dc5840d96e 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -40,9 +40,9 @@ target_link_libraries(p3glstuff panda) if(NOT BUILD_METALIBS) install(TARGETS p3glstuff EXPORT OpenGL COMPONENT OpenGL - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT OpenGLDevel) endif() -install(FILES ${P3GLSTUFF_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) +install(FILES ${P3GLSTUFF_HEADERS} COMPONENT OpenGLDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/glxdisplay/CMakeLists.txt b/panda/src/glxdisplay/CMakeLists.txt index a5153e54b1..06dcc5cc0e 100644 --- a/panda/src/glxdisplay/CMakeLists.txt +++ b/panda/src/glxdisplay/CMakeLists.txt @@ -29,5 +29,5 @@ add_component_library(p3glxdisplay SYMBOL BUILDING_PANDA_GLXDISPLAY target_link_libraries(p3glxdisplay p3glgsg p3x11display) if(NOT BUILD_METALIBS) - install(TARGETS p3glxdisplay EXPORT OpenGL COMPONENT OpenGL DESTINATION lib) + install(TARGETS p3glxdisplay EXPORT OpenGL COMPONENT OpenGL DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/panda/src/gobj/CMakeLists.txt b/panda/src/gobj/CMakeLists.txt index 1d62650e14..8ab4223467 100644 --- a/panda/src/gobj/CMakeLists.txt +++ b/panda/src/gobj/CMakeLists.txt @@ -187,9 +187,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3gobj EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3GOBJ_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3GOBJ_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 2f88a25253..5d3fb2c9a9 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -58,9 +58,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3grutil EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3GRUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3GRUTIL_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/gsgbase/CMakeLists.txt b/panda/src/gsgbase/CMakeLists.txt index d83f31c90a..8060686e04 100644 --- a/panda/src/gsgbase/CMakeLists.txt +++ b/panda/src/gsgbase/CMakeLists.txt @@ -19,9 +19,9 @@ target_interrogate(p3gsgbase ALL) if(NOT BUILD_METALIBS) install(TARGETS p3gsgbase EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3GSGBASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3GSGBASE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/linmath/CMakeLists.txt b/panda/src/linmath/CMakeLists.txt index e60e1a5a59..acbe732e93 100644 --- a/panda/src/linmath/CMakeLists.txt +++ b/panda/src/linmath/CMakeLists.txt @@ -55,9 +55,9 @@ target_interrogate(p3linmath ALL) if(NOT BUILD_METALIBS) install(TARGETS p3linmath EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3LINMATH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3LINMATH_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/mathutil/CMakeLists.txt b/panda/src/mathutil/CMakeLists.txt index ce03b71ee8..0716f4538d 100644 --- a/panda/src/mathutil/CMakeLists.txt +++ b/panda/src/mathutil/CMakeLists.txt @@ -74,9 +74,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3mathutil EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3MATHUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3MATHUTIL_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/movies/CMakeLists.txt b/panda/src/movies/CMakeLists.txt index 53aff18c45..30e01d254a 100644 --- a/panda/src/movies/CMakeLists.txt +++ b/panda/src/movies/CMakeLists.txt @@ -54,9 +54,9 @@ target_interrogate(p3movies ALL) if(NOT BUILD_METALIBS) install(TARGETS p3movies EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3MOVIES_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3MOVIES_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index a91159e1c6..3c10e8d7cc 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -40,9 +40,9 @@ target_interrogate(p3nativenet ALL) if(NOT BUILD_METALIBS) install(TARGETS p3nativenet EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3NATIVENET_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3NATIVENET_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/net/CMakeLists.txt b/panda/src/net/CMakeLists.txt index 3be1e77e40..b142134884 100644 --- a/panda/src/net/CMakeLists.txt +++ b/panda/src/net/CMakeLists.txt @@ -43,9 +43,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3net EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3NET_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3NET_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/ode/CMakeLists.txt b/panda/src/ode/CMakeLists.txt index 1e636d80f8..13bc422c74 100644 --- a/panda/src/ode/CMakeLists.txt +++ b/panda/src/ode/CMakeLists.txt @@ -94,10 +94,10 @@ target_interrogate(p3ode ${P3ODE_IGATE_SOURCES} EXTENSIONS ${P3ODE_IGATEEXT}) install(TARGETS p3ode EXPORT ODE COMPONENT ODE - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT ODEDevel) -install(FILES ${P3ODE_HEADERS} COMPONENT ODEDevel DESTINATION include/panda3d) +install(FILES ${P3ODE_HEADERS} COMPONENT ODEDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(ODE COMPONENT ODEDevel) diff --git a/panda/src/pandabase/CMakeLists.txt b/panda/src/pandabase/CMakeLists.txt index deb4428068..73633927c1 100644 --- a/panda/src/pandabase/CMakeLists.txt +++ b/panda/src/pandabase/CMakeLists.txt @@ -10,5 +10,5 @@ set(P3PANDABASE_SOURCES add_library(p3pandabase INTERFACE) target_link_libraries(p3pandabase INTERFACE p3dtool) -install(FILES ${P3PANDABASE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PANDABASE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) install(TARGETS p3pandabase EXPORT Core COMPONENT Core) diff --git a/panda/src/parametrics/CMakeLists.txt b/panda/src/parametrics/CMakeLists.txt index ffeae49b97..5f1a96593f 100644 --- a/panda/src/parametrics/CMakeLists.txt +++ b/panda/src/parametrics/CMakeLists.txt @@ -43,9 +43,9 @@ target_interrogate(p3parametrics ALL) if(NOT BUILD_METALIBS) install(TARGETS p3parametrics EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PARAMETRICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PARAMETRICS_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/particlesystem/CMakeLists.txt b/panda/src/particlesystem/CMakeLists.txt index b5db39a429..7a227f7dc6 100644 --- a/panda/src/particlesystem/CMakeLists.txt +++ b/panda/src/particlesystem/CMakeLists.txt @@ -56,9 +56,9 @@ target_interrogate(p3particlesystem ${P3PARTICLESYSTEM_IGATE_SOURCES}) if(NOT BUILD_METALIBS) install(TARGETS p3particlesystem EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PARTICLESYSTEM_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PARTICLESYSTEM_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 8110676c53..1852a7a15c 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -233,9 +233,9 @@ target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3pgraph EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PGRAPH_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pgraphnodes/CMakeLists.txt b/panda/src/pgraphnodes/CMakeLists.txt index 03dce3a677..7b25e2b5bf 100644 --- a/panda/src/pgraphnodes/CMakeLists.txt +++ b/panda/src/pgraphnodes/CMakeLists.txt @@ -53,9 +53,9 @@ target_interrogate(p3pgraphnodes ALL) if(NOT BUILD_METALIBS) install(TARGETS p3pgraphnodes EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PGRAPHNODES_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PGRAPHNODES_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pgui/CMakeLists.txt b/panda/src/pgui/CMakeLists.txt index 626f88c54a..0b68d56653 100644 --- a/panda/src/pgui/CMakeLists.txt +++ b/panda/src/pgui/CMakeLists.txt @@ -49,9 +49,9 @@ target_interrogate(p3pgui ALL) if(NOT BUILD_METALIBS) install(TARGETS p3pgui EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PGUI_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PGUI_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/physics/CMakeLists.txt b/panda/src/physics/CMakeLists.txt index 3e2f2d8c97..9b0b9456b6 100644 --- a/panda/src/physics/CMakeLists.txt +++ b/panda/src/physics/CMakeLists.txt @@ -47,9 +47,9 @@ target_interrogate(p3physics ALL) if(NOT BUILD_METALIBS) install(TARGETS p3physics EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PHYSICS_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PHYSICS_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pipeline/CMakeLists.txt b/panda/src/pipeline/CMakeLists.txt index 066c1a6a96..aa7852623b 100644 --- a/panda/src/pipeline/CMakeLists.txt +++ b/panda/src/pipeline/CMakeLists.txt @@ -140,9 +140,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3pipeline EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PIPELINE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PIPELINE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index 2301fba2fe..e22656a41d 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -48,9 +48,9 @@ target_interrogate(p3pnmimage ALL EXTENSIONS ${P3PNMIMAGE_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3pnmimage EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PNMIMAGE_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PNMIMAGE_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pnmimagetypes/CMakeLists.txt b/panda/src/pnmimagetypes/CMakeLists.txt index fc086ce9e3..84c8ceeab7 100644 --- a/panda/src/pnmimagetypes/CMakeLists.txt +++ b/panda/src/pnmimagetypes/CMakeLists.txt @@ -42,7 +42,7 @@ set_target_properties(p3pnmimagetypes PROPERTIES CXX_EXCEPTIONS ON) if(NOT BUILD_METALIBS) install(TARGETS p3pnmimagetypes EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE COMPONENT CoreDevel) endif() diff --git a/panda/src/pnmtext/CMakeLists.txt b/panda/src/pnmtext/CMakeLists.txt index 2dd618a3b5..6acc9bd910 100644 --- a/panda/src/pnmtext/CMakeLists.txt +++ b/panda/src/pnmtext/CMakeLists.txt @@ -27,9 +27,9 @@ target_interrogate(p3pnmtext ALL) if(NOT BUILD_METALIBS) install(TARGETS p3pnmtext EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PNMTEXT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PNMTEXT_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/pstatclient/CMakeLists.txt b/panda/src/pstatclient/CMakeLists.txt index 48bed3ae63..2aa8e37f77 100644 --- a/panda/src/pstatclient/CMakeLists.txt +++ b/panda/src/pstatclient/CMakeLists.txt @@ -36,10 +36,10 @@ target_interrogate(p3pstatclient ALL) if(NOT BUILD_METALIBS) install(TARGETS p3pstatclient EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PSTATCLIENT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) -install(FILES config_pstats.h COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PSTATCLIENT_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) +install(FILES config_pstats.h COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/putil/CMakeLists.txt b/panda/src/putil/CMakeLists.txt index e40872b034..5b5d841f19 100644 --- a/panda/src/putil/CMakeLists.txt +++ b/panda/src/putil/CMakeLists.txt @@ -141,10 +141,10 @@ target_interrogate(p3putil ALL EXTENSIONS ${P3PUTIL_IGATEEXT}) if(NOT BUILD_METALIBS) install(TARGETS p3putil EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3PUTIL_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) -install(FILES config_util.h COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3PUTIL_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) +install(FILES config_util.h COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/recorder/CMakeLists.txt b/panda/src/recorder/CMakeLists.txt index 5c13272ae6..b65627db79 100644 --- a/panda/src/recorder/CMakeLists.txt +++ b/panda/src/recorder/CMakeLists.txt @@ -26,9 +26,9 @@ target_interrogate(p3recorder ALL) if(NOT BUILD_METALIBS) install(TARGETS p3recorder EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3RECORDER_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3RECORDER_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/testbed/CMakeLists.txt b/panda/src/testbed/CMakeLists.txt index 8170c13d55..3c497f42ac 100644 --- a/panda/src/testbed/CMakeLists.txt +++ b/panda/src/testbed/CMakeLists.txt @@ -6,4 +6,4 @@ endif() add_executable(pview pview.cxx) target_link_libraries(pview p3framework) -install(TARGETS pview EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS pview EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/panda/src/text/CMakeLists.txt b/panda/src/text/CMakeLists.txt index b86aa33208..b7cbaee022 100644 --- a/panda/src/text/CMakeLists.txt +++ b/panda/src/text/CMakeLists.txt @@ -50,9 +50,9 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3text EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3TEXT_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3TEXT_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/tform/CMakeLists.txt b/panda/src/tform/CMakeLists.txt index 5159323eef..c8da2e176c 100644 --- a/panda/src/tform/CMakeLists.txt +++ b/panda/src/tform/CMakeLists.txt @@ -37,9 +37,9 @@ target_interrogate(p3tform ALL) if(NOT BUILD_METALIBS) install(TARGETS p3tform EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) endif() -install(FILES ${P3TFORM_HEADERS} COMPONENT CoreDevel DESTINATION include/panda3d) +install(FILES ${P3TFORM_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/vision/CMakeLists.txt b/panda/src/vision/CMakeLists.txt index 38f1c474f4..284e764807 100644 --- a/panda/src/vision/CMakeLists.txt +++ b/panda/src/vision/CMakeLists.txt @@ -45,10 +45,10 @@ endif() install(TARGETS p3vision EXPORT Vision COMPONENT Vision - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT VisionDevel) -install(FILES ${P3VISION_HEADERS} COMPONENT VisionDevel DESTINATION include/panda3d) +install(FILES ${P3VISION_HEADERS} COMPONENT VisionDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(Vision COMPONENT VisionDevel) diff --git a/panda/src/vrpn/CMakeLists.txt b/panda/src/vrpn/CMakeLists.txt index 231269b070..b3e6497dfe 100644 --- a/panda/src/vrpn/CMakeLists.txt +++ b/panda/src/vrpn/CMakeLists.txt @@ -37,10 +37,10 @@ target_interrogate(p3vrpn ALL) install(TARGETS p3vrpn EXPORT VRPN COMPONENT VRPN - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT VRPNDevel) -install(FILES ${P3VRPN_HEADERS} COMPONENT VRPNDevel DESTINATION include/panda3d) +install(FILES ${P3VRPN_HEADERS} COMPONENT VRPNDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) export_targets(VRPN COMPONENT VRPNDevel) diff --git a/panda/src/wgldisplay/CMakeLists.txt b/panda/src/wgldisplay/CMakeLists.txt index d5ea724ef5..77c5e75db5 100644 --- a/panda/src/wgldisplay/CMakeLists.txt +++ b/panda/src/wgldisplay/CMakeLists.txt @@ -27,9 +27,9 @@ target_link_libraries(p3wgldisplay p3glgsg p3windisplay) if(NOT BUILD_METALIBS) install(TARGETS p3wgldisplay EXPORT OpenGL COMPONENT OpenGL - DESTINATION lib - RUNTIME DESTINATION bin - INCLUDES DESTINATION include/panda3d + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT OpenGLDevel) endif() -install(FILES ${P3WGLDISPLAY_HEADERS} COMPONENT OpenGLDevel DESTINATION include/panda3d) +install(FILES ${P3WGLDISPLAY_HEADERS} COMPONENT OpenGLDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/windisplay/CMakeLists.txt b/panda/src/windisplay/CMakeLists.txt index 7e0909a19e..b8edc72995 100644 --- a/panda/src/windisplay/CMakeLists.txt +++ b/panda/src/windisplay/CMakeLists.txt @@ -27,7 +27,7 @@ endif() if(NOT BUILD_METALIBS) install(TARGETS p3windisplay EXPORT Core COMPONENT Core - DESTINATION lib - RUNTIME DESTINATION bin + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE COMPONENT CoreDevel) endif() diff --git a/panda/src/x11display/CMakeLists.txt b/panda/src/x11display/CMakeLists.txt index a35cdd0f2b..d3a3ebbe12 100644 --- a/panda/src/x11display/CMakeLists.txt +++ b/panda/src/x11display/CMakeLists.txt @@ -17,5 +17,5 @@ add_component_library(p3x11display SYMBOL BUILDING_PANDAX11 target_link_libraries(p3x11display panda PKG::X11) if(NOT BUILD_METALIBS) - install(TARGETS p3x11display EXPORT Core COMPONENT Core DESTINATION lib) + install(TARGETS p3x11display EXPORT Core COMPONENT Core DESTINATION ${CMAKE_INSTALL_LIBDIR}) endif() diff --git a/pandatool/src/bam/CMakeLists.txt b/pandatool/src/bam/CMakeLists.txt index fbbffc70a9..79389b92ff 100644 --- a/pandatool/src/bam/CMakeLists.txt +++ b/pandatool/src/bam/CMakeLists.txt @@ -1,12 +1,12 @@ add_executable(bam-info bamInfo.cxx bamInfo.h) target_link_libraries(bam-info p3progbase panda) -install(TARGETS bam-info EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS bam-info EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_EGG) add_executable(egg2bam eggToBam.cxx eggToBam.h) target_link_libraries(egg2bam p3eggbase p3progbase panda) - install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS egg2bam EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_SQUISH) target_compile_definitions(egg2bam PRIVATE HAVE_SQUISH) @@ -14,10 +14,10 @@ if(HAVE_EGG) add_executable(bam2egg bamToEgg.cxx bamToEgg.h) target_link_libraries(bam2egg p3converter p3eggbase p3progbase panda) - install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS bam2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(pts2bam ptsToBam.cxx ptsToBam.h) target_link_libraries(pts2bam p3progbase pandaegg panda) - install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS pts2bam EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/daeprogs/CMakeLists.txt b/pandatool/src/daeprogs/CMakeLists.txt index 432fc5ecd2..67ffc386c4 100644 --- a/pandatool/src/daeprogs/CMakeLists.txt +++ b/pandatool/src/daeprogs/CMakeLists.txt @@ -2,10 +2,10 @@ if(HAVE_EGG AND HAVE_FCOLLADA) add_executable(egg2dae eggToDAE.cxx eggToDAE.h) target_link_libraries(egg2dae p3daeegg p3eggbase p3progbase) - install(TARGETS egg2dae EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS egg2dae EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(dae2egg daeToEgg.cxx daeToEgg.h) target_link_libraries(dae2egg p3daeegg p3eggbase p3progbase) - install(TARGETS dae2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS dae2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/dxfprogs/CMakeLists.txt b/pandatool/src/dxfprogs/CMakeLists.txt index 627474b02a..3cd39a0baa 100644 --- a/pandatool/src/dxfprogs/CMakeLists.txt +++ b/pandatool/src/dxfprogs/CMakeLists.txt @@ -1,15 +1,15 @@ add_executable(dxf-points dxfPoints.cxx dxfPoints.h) target_link_libraries(dxf-points p3progbase p3dxf) -install(TARGETS dxf-points EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS dxf-points EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_EGG) add_executable(egg2dxf eggToDXF.cxx eggToDXF.h eggToDXFLayer.cxx eggToDXFLayer.h) target_link_libraries(egg2dxf p3dxfegg p3eggbase p3progbase) - install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS egg2dxf EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(dxf2egg dxfToEgg.cxx dxfToEgg.h) target_link_libraries(dxf2egg p3dxfegg p3eggbase p3progbase) - install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS dxf2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/egg-mkfont/CMakeLists.txt b/pandatool/src/egg-mkfont/CMakeLists.txt index 7f2bdaf538..d453b3a5f4 100644 --- a/pandatool/src/egg-mkfont/CMakeLists.txt +++ b/pandatool/src/egg-mkfont/CMakeLists.txt @@ -18,4 +18,4 @@ composite_sources(egg-mkfont P3EGG_MKFONT_SOURCES) add_executable(egg-mkfont ${P3EGG_MKFONT_HEADERS} ${P3EGG_MKFONT_SOURCES}) target_link_libraries(egg-mkfont p3palettizer p3eggbase p3pandatoolbase) -install(TARGETS egg-mkfont EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-mkfont EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/egg-optchar/CMakeLists.txt b/pandatool/src/egg-optchar/CMakeLists.txt index 4d2083e92e..b30a070224 100644 --- a/pandatool/src/egg-optchar/CMakeLists.txt +++ b/pandatool/src/egg-optchar/CMakeLists.txt @@ -20,4 +20,4 @@ composite_sources(egg-optchar P3EGG_OPTCHAR_SOURCES) add_executable(egg-optchar ${P3EGG_OPTCHAR_HEADERS} ${P3EGG_OPTCHAR_SOURCES}) target_link_libraries(egg-optchar p3eggcharbase) -install(TARGETS egg-optchar EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-optchar EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/egg-palettize/CMakeLists.txt b/pandatool/src/egg-palettize/CMakeLists.txt index 778ff0fc6c..18576f25d6 100644 --- a/pandatool/src/egg-palettize/CMakeLists.txt +++ b/pandatool/src/egg-palettize/CMakeLists.txt @@ -4,7 +4,7 @@ endif() add_executable(egg-palettize eggPalettize.cxx eggPalettize.h) target_link_libraries(egg-palettize p3palettizer p3eggbase p3progbase) -install(TARGETS egg-palettize EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-palettize EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_library(p3txafile txaFileFilter.cxx txaFileFilter.h txaFileFilter.I) set_target_properties(p3txafile PROPERTIES DEFINE_SYMBOL BUILDING_MISC) @@ -12,5 +12,5 @@ target_link_libraries(p3txafile PRIVATE p3palettizer) if(BUILD_SHARED_LIBS) # We can't install this if we're doing a static build, because it depends on # a static library that isn't installed. - install(TARGETS p3txafile EXPORT Tools COMPONENT Tools DESTINATION lib RUNTIME DESTINATION bin) + install(TARGETS p3txafile EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/egg-qtess/CMakeLists.txt b/pandatool/src/egg-qtess/CMakeLists.txt index a74919cfb5..c8f4244c8a 100644 --- a/pandatool/src/egg-qtess/CMakeLists.txt +++ b/pandatool/src/egg-qtess/CMakeLists.txt @@ -28,4 +28,4 @@ composite_sources(egg-qtess P3EGG_QTESS_SOURCES) add_executable(egg-qtess ${P3EGG_QTESS_HEADERS} ${P3EGG_QTESS_SOURCES}) target_link_libraries(egg-qtess p3eggbase) -install(TARGETS egg-qtess EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-qtess EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/eggprogs/CMakeLists.txt b/pandatool/src/eggprogs/CMakeLists.txt index 074ebc8e01..a14d33ab80 100644 --- a/pandatool/src/eggprogs/CMakeLists.txt +++ b/pandatool/src/eggprogs/CMakeLists.txt @@ -4,36 +4,36 @@ endif() add_executable(egg-crop eggCrop.cxx eggCrop.h) target_link_libraries(egg-crop p3eggbase) -install(TARGETS egg-crop EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-crop EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-list-textures eggListTextures.cxx eggListTextures.h) target_link_libraries(egg-list-textures p3eggbase) -install(TARGETS egg-list-textures EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-list-textures EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-make-tube eggMakeTube.cxx eggMakeTube.h) target_link_libraries(egg-make-tube p3eggbase) -install(TARGETS egg-make-tube EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-make-tube EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-rename eggRename.cxx eggRename.h) target_link_libraries(egg-rename p3eggbase) -install(TARGETS egg-rename EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-rename EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-retarget-anim eggRetargetAnim.cxx eggRetargetAnim.h) target_link_libraries(egg-retarget-anim p3eggcharbase) -install(TARGETS egg-retarget-anim EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-retarget-anim EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-texture-cards eggTextureCards.cxx eggTextureCards.h) target_link_libraries(egg-texture-cards p3eggbase) -install(TARGETS egg-texture-cards EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-texture-cards EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg2c eggToC.cxx eggToC.h) target_link_libraries(egg2c p3eggbase) -install(TARGETS egg2c EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg2c EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-topstrip eggTopstrip.cxx eggTopstrip.h) target_link_libraries(egg-topstrip p3eggcharbase) -install(TARGETS egg-topstrip EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-topstrip EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(egg-trans eggTrans.cxx eggTrans.h) target_link_libraries(egg-trans p3eggbase) -install(TARGETS egg-trans EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/fltprogs/CMakeLists.txt b/pandatool/src/fltprogs/CMakeLists.txt index 9fc69bb15a..29a04166b7 100644 --- a/pandatool/src/fltprogs/CMakeLists.txt +++ b/pandatool/src/fltprogs/CMakeLists.txt @@ -1,19 +1,19 @@ add_executable(flt-info fltInfo.cxx fltInfo.h) target_link_libraries(flt-info p3progbase p3flt) -install(TARGETS flt-info EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS flt-info EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(flt-trans fltTrans.cxx fltTrans.h) target_link_libraries(flt-trans p3progbase p3flt) -install(TARGETS flt-trans EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS flt-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_EGG) add_executable(egg2flt eggToFlt.cxx eggToFlt.h) target_link_libraries(egg2flt p3fltegg p3eggbase p3progbase) - install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS egg2flt EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(flt2egg fltToEgg.cxx fltToEgg.h) target_link_libraries(flt2egg p3fltegg p3eggbase p3progbase) - install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS flt2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/gtk-stats/CMakeLists.txt b/pandatool/src/gtk-stats/CMakeLists.txt index eb376985a9..b78ebf2e80 100644 --- a/pandatool/src/gtk-stats/CMakeLists.txt +++ b/pandatool/src/gtk-stats/CMakeLists.txt @@ -38,4 +38,4 @@ else() set_target_properties(gtk-stats PROPERTIES OUTPUT_NAME "pstats") endif() -install(TARGETS gtk-stats EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS gtk-stats EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/imageprogs/CMakeLists.txt b/pandatool/src/imageprogs/CMakeLists.txt index d89a4c62fe..f39b4b90fb 100644 --- a/pandatool/src/imageprogs/CMakeLists.txt +++ b/pandatool/src/imageprogs/CMakeLists.txt @@ -1,19 +1,19 @@ add_executable(image-fix-hidden-color imageFixHiddenColor.cxx imageFixHiddenColor.h) target_link_libraries(image-fix-hidden-color p3imagebase) -install(TARGETS image-fix-hidden-color EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS image-fix-hidden-color EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(image-info imageInfo.cxx imageInfo.h) target_link_libraries(image-info p3imagebase) -install(TARGETS image-info EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS image-info EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(image-resize imageResize.cxx imageResize.h) target_link_libraries(image-resize p3imagebase) -install(TARGETS image-resize EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS image-resize EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(image-transform-colors imageTransformColors.cxx imageTransformColors.h) target_link_libraries(image-transform-colors p3imagebase) -install(TARGETS image-transform-colors EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS image-transform-colors EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(image-trans imageTrans.cxx imageTrans.h) target_link_libraries(image-trans p3imagebase) -install(TARGETS image-trans EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS image-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/lwoprogs/CMakeLists.txt b/pandatool/src/lwoprogs/CMakeLists.txt index 50ec203a06..0a3c1de2e5 100644 --- a/pandatool/src/lwoprogs/CMakeLists.txt +++ b/pandatool/src/lwoprogs/CMakeLists.txt @@ -1,11 +1,11 @@ add_executable(lwo-scan lwoScan.cxx lwoScan.h) target_link_libraries(lwo-scan p3progbase p3lwo) -install(TARGETS lwo-scan EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS lwo-scan EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_EGG) add_executable(lwo2egg lwoToEgg.cxx lwoToEgg.h) target_link_libraries(lwo2egg p3lwoegg p3eggbase p3progbase) - install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS lwo2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/miscprogs/CMakeLists.txt b/pandatool/src/miscprogs/CMakeLists.txt index d42a8cd7ce..169cecc774 100644 --- a/pandatool/src/miscprogs/CMakeLists.txt +++ b/pandatool/src/miscprogs/CMakeLists.txt @@ -1,3 +1,3 @@ add_executable(bin2c binToC.cxx binToC.h) target_link_libraries(bin2c p3progbase) -install(TARGETS bin2c EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS bin2c EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/objprogs/CMakeLists.txt b/pandatool/src/objprogs/CMakeLists.txt index b93a62f6fd..adc398fab4 100644 --- a/pandatool/src/objprogs/CMakeLists.txt +++ b/pandatool/src/objprogs/CMakeLists.txt @@ -4,8 +4,8 @@ endif() add_executable(egg2obj eggToObj.cxx eggToObj.h) target_link_libraries(egg2obj p3objegg p3eggbase) -install(TARGETS egg2obj EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS egg2obj EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(obj2egg objToEgg.cxx objToEgg.h) target_link_libraries(obj2egg p3objegg p3eggbase p3progbase) -install(TARGETS obj2egg EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS obj2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/pfmprogs/CMakeLists.txt b/pandatool/src/pfmprogs/CMakeLists.txt index 800c94cd1b..13cb6af787 100644 --- a/pandatool/src/pfmprogs/CMakeLists.txt +++ b/pandatool/src/pfmprogs/CMakeLists.txt @@ -2,8 +2,8 @@ add_executable(pfm-bba config_pfmprogs.cxx config_pfmprogs.h pfmBba.cxx pfmBba.h) target_link_libraries(pfm-bba p3progbase) -install(TARGETS pfm-bba EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS pfm-bba EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(pfm-trans pfmTrans.cxx pfmTrans.h) target_link_libraries(pfm-trans p3progbase) -install(TARGETS pfm-trans EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS pfm-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/text-stats/CMakeLists.txt b/pandatool/src/text-stats/CMakeLists.txt index d5cff0d4fc..155b9013f3 100644 --- a/pandatool/src/text-stats/CMakeLists.txt +++ b/pandatool/src/text-stats/CMakeLists.txt @@ -16,4 +16,4 @@ composite_sources(text-stats TEXTSTATS_SOURCES) add_executable(text-stats ${TEXTSTATS_HEADERS} ${TEXTSTATS_SOURCES}) target_link_libraries(text-stats p3progbase p3pstatserver) -install(TARGETS text-stats EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS text-stats EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/vrmlprogs/CMakeLists.txt b/pandatool/src/vrmlprogs/CMakeLists.txt index 73fa9c9441..82a5e78bd3 100644 --- a/pandatool/src/vrmlprogs/CMakeLists.txt +++ b/pandatool/src/vrmlprogs/CMakeLists.txt @@ -1,11 +1,11 @@ add_executable(vrml-trans vrmlTrans.cxx vrmlTrans.h) target_link_libraries(vrml-trans p3progbase p3vrml) -install(TARGETS vrml-trans EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS vrml-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_EGG) add_executable(vrml2egg vrmlToEgg.cxx vrmlToEgg.h) target_link_libraries(vrml2egg p3vrmlegg p3eggbase p3progbase) - install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS vrml2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/pandatool/src/win-stats/CMakeLists.txt b/pandatool/src/win-stats/CMakeLists.txt index 7c36316fc5..0cd7768c3a 100644 --- a/pandatool/src/win-stats/CMakeLists.txt +++ b/pandatool/src/win-stats/CMakeLists.txt @@ -34,4 +34,4 @@ target_link_libraries(win-stats p3progbase p3pstatserver) # This program is NOT actually called win-stats. It's just pstats.exe set_target_properties(win-stats PROPERTIES OUTPUT_NAME "pstats") -install(TARGETS win-stats EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS win-stats EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) diff --git a/pandatool/src/xfileprogs/CMakeLists.txt b/pandatool/src/xfileprogs/CMakeLists.txt index d8b7f5e810..29562db00d 100644 --- a/pandatool/src/xfileprogs/CMakeLists.txt +++ b/pandatool/src/xfileprogs/CMakeLists.txt @@ -1,15 +1,15 @@ add_executable(x-trans xFileTrans.cxx xFileTrans.h) target_link_libraries(x-trans p3progbase p3xfile) -install(TARGETS x-trans EXPORT Tools COMPONENT Tools DESTINATION bin) +install(TARGETS x-trans EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) if(HAVE_EGG) add_executable(egg2x eggToX.cxx eggToX.h) target_link_libraries(egg2x p3xfileegg p3eggbase p3progbase) - install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS egg2x EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) add_executable(x2egg xFileToEgg.cxx xFileToEgg.h) target_link_libraries(x2egg p3xfileegg p3eggbase p3progbase) - install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION bin) + install(TARGETS x2egg EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() From 13a19109d488488d44cea5518567774399b8fa24 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 31 Aug 2019 15:07:03 -0600 Subject: [PATCH 680/744] CMake: Remove redundant -DNDEBUG This reverts a42f1a49a4892fbae168c5c63edb83abd8a10c6d, which should have been reverted by faced9aa499ece4e5e294cc548f571c450ef1df1. --- cmake/macros/Interrogate.cmake | 5 ----- 1 file changed, 5 deletions(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index c832d1f684..17d16d10ca 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -245,11 +245,6 @@ function(interrogate_sources target output database language_flags) endif() endforeach(_config) - # In case the user (or a distro buildsystem) is throwing NDEBUG in by hand: - if(CMAKE_CXX_FLAGS MATCHES ".*NDEBUG.*") - list(APPEND define_flags "-DNDEBUG") - endif() - get_filename_component(output_directory "${output}" DIRECTORY) get_filename_component(database_directory "${database}" DIRECTORY) From d77ad6d0edd8b7884a66f7d548aa485c5f28cb41 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 1 Sep 2019 15:36:33 -0600 Subject: [PATCH 681/744] CMake: vrpn (and its igate module) require -fexceptions Per #development comment by rdb earlier today --- panda/CMakeLists.txt | 1 + panda/src/vrpn/CMakeLists.txt | 2 ++ 2 files changed, 3 insertions(+) diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 0d32c9e7a1..a5b213a768 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -139,6 +139,7 @@ if(INTERROGATE_PYTHON_INTERFACE) if(HAVE_VRPN) add_python_module(panda3d.vrpn p3vrpn IMPORT panda3d.core COMPONENT VRPNPython) + set_target_properties(panda3d.vrpn PROPERTIES CXX_EXCEPTIONS ON) export_targets(VRPNPython NAMESPACE "Panda3D::Python::" COMPONENT VRPNDevel) endif() diff --git a/panda/src/vrpn/CMakeLists.txt b/panda/src/vrpn/CMakeLists.txt index b3e6497dfe..11e5a5fc61 100644 --- a/panda/src/vrpn/CMakeLists.txt +++ b/panda/src/vrpn/CMakeLists.txt @@ -35,6 +35,8 @@ set_target_properties(p3vrpn PROPERTIES DEFINE_SYMBOL BUILDING_VRPN) target_link_libraries(p3vrpn panda PKG::VRPN) target_interrogate(p3vrpn ALL) +set_target_properties(p3vrpn PROPERTIES CXX_EXCEPTIONS ON) + install(TARGETS p3vrpn EXPORT VRPN COMPONENT VRPN DESTINATION ${CMAKE_INSTALL_LIBDIR} From 5654e64645186eca49af0a62a2be3769f1c0778d Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 6 Sep 2019 01:11:50 -0600 Subject: [PATCH 682/744] CMake: First batch of improvements per review Addressing feedback per @rdb in GitHub #717 --- CMakeLists.txt | 10 ++++++---- cmake/install/Panda3DConfig.cmake | 2 +- dtool/CompilerFlags.cmake | 2 +- dtool/Config.cmake | 15 --------------- dtool/Package.cmake | 8 ++------ panda/CMakeLists.txt | 24 ++++++++++++++++++++++++ 6 files changed, 34 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d3fd66addc..6015bdac20 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,10 +9,12 @@ if(CMAKE_VERSION VERSION_GREATER "3.12" OR POLICY CMP0074) endif() # Figure out the version -file(STRINGS "setup.cfg" _version REGEX "^version = ") -string(REGEX REPLACE "^.*= " "" _version "${_version}") +set(_s "[\\t ]*") # CMake doesn't support \s* +file(STRINGS "setup.cfg" _version REGEX "^version${_s}=${_s}") +string(REGEX REPLACE "^.*=${_s}" "" _version "${_version}") project(Panda3D VERSION ${_version}) unset(_version) +unset(_s) enable_testing() @@ -52,8 +54,8 @@ include(RunPzip) # Defines run_pzip function include(Versioning) # Hooks 'add_library' to apply VERSION/SOVERSION # Determine which trees to build. -option(BUILD_DTOOL "Build the dtool source tree." ON) -option(BUILD_PANDA "Build the panda source tree." ON) +option(BUILD_DTOOL "Build the dtool source tree." ON) +option(BUILD_PANDA "Build the panda source tree." ON) option(BUILD_DIRECT "Build the direct source tree." ON) option(BUILD_PANDATOOL "Build the pandatool source tree." ON) option(BUILD_CONTRIB "Build the contrib source tree." ON) diff --git a/cmake/install/Panda3DConfig.cmake b/cmake/install/Panda3DConfig.cmake index 2514ac9ecb..1ec4b89beb 100644 --- a/cmake/install/Panda3DConfig.cmake +++ b/cmake/install/Panda3DConfig.cmake @@ -80,7 +80,7 @@ # # FMOD - Support for FMOD audio output. # -# Panda3D::OpenAL::p3fmod_audio +# Panda3D::FMOD::p3fmod_audio # # # OpenGL - Support for OpenGL rendering. diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 2d430e81a7..d48ffe3aa7 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -103,7 +103,7 @@ if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") if(MSVC) - # Clang behaving as MSVC` + # Clang behaving as MSVC set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-command-line-argument") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-microsoft-template -Wno-unused-command-line-argument") diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 91a8fdad9a..0248fbff20 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -254,21 +254,6 @@ mark_as_advanced(DEFAULT_PRC_DIR PRC_DIR_ENVVARS PRC_PATH_ENVVARS # remaining variables are of general interest to everyone. # - -option(HAVE_P3D_RTDIST - "You may define this to build or develop the Panda3D rtdist, -the environment packaged up for distribution with the plugin." - OFF) - -if(HAVE_P3D_RTDIST) - set(PANDA_PACKAGE_VERSION "local_dev" CACHE STRING "") - set(PANDA_PACKAGE_HOST_URL "http://localhost/" CACHE STRING "") -endif() - -mark_as_advanced(HAVE_P3D_RTDIST PANDA_PACKAGE_VERSION PANDA_PACKAGE_HOST) - - - # The following options relate to interrogate, the tool that is # used to generate bindings for non-C++ languages. diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 47158bd55b..d2b17feb23 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -149,9 +149,6 @@ if(CMAKE_VERSION VERSION_LESS "3.15") # macOS requires this explicit flag on the linker command line to allow the # references to the Python symbols to resolve at dynamic link time string(APPEND CMAKE_MODULE_LINKER_FLAGS " -undefined dynamic_lookup") - # TODO: p3dcparser contains some direct Python references; get rid of - # this once that's gone - string(APPEND CMAKE_SHARED_LINKER_FLAGS " -undefined dynamic_lookup") endif() @@ -263,7 +260,7 @@ package_status(ZLIB "zlib") # JPEG find_package(JPEG QUIET) -package_option(JPEG DEFAULT ON "Enable support for loading .jpg images.") +package_option(JPEG "Enable support for loading .jpg images.") package_status(JPEG "libjpeg") @@ -271,7 +268,6 @@ package_status(JPEG "libjpeg") find_package(PNG QUIET) package_option(PNG - DEFAULT ON "Enable support for loading .png images." IMPORTED_AS PNG::PNG) @@ -344,7 +340,7 @@ package_status(FCOLLADA "FCollada") find_package(Eigen3 QUIET) package_option(EIGEN - "Enables experimental support for the Eigen linear algebra library. + "Enables use of the Eigen linear algebra library. If this is provided, Panda will use this library as the fundamental implementation of its own linmath library; otherwise, it will use its own internal implementation. The primary advantage of using diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index a5b213a768..6535b42e72 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -106,6 +106,30 @@ endif() if(INTERROGATE_PYTHON_INTERFACE) add_python_module(panda3d.core ${CORE_MODULE_COMPONENTS} LINK panda) + # Generate our __init__.py + if(WIN32) + file(READ "${PROJECT_SOURCE_DIR}/cmake/templates/win32_python/__init__.py" win32_init) + else() + set(win32_init "") + endif() + + file(WRITE "${PROJECT_BINARY_DIR}/panda3d/__init__.py" + "\"Python bindings for the Panda3D libraries\" + +__version__ = '${PROJECT_VERSION}' + +if __debug__: + import sys + if sys.version_info < (3, 0): + sys.stderr.write('''\\ +WARNING: Python 2.7 will reach EOL after December 31, 2019. +To suppress this warning, upgrade to Python 3. +''') + sys.stdout.flush() + del sys + +${win32_init}") + if(BUILD_SHARED_LIBS) install_python_package(panda3d ARCH) endif() From b86332376ca2753506286924f586b0ed37e245fb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 6 Sep 2019 01:51:32 -0600 Subject: [PATCH 683/744] CMake: Move Assimp plugin to its own install component --- pandatool/src/assimp/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandatool/src/assimp/CMakeLists.txt b/pandatool/src/assimp/CMakeLists.txt index d4758f2f61..536d15ec39 100644 --- a/pandatool/src/assimp/CMakeLists.txt +++ b/pandatool/src/assimp/CMakeLists.txt @@ -29,5 +29,5 @@ target_link_libraries(p3assimp PUBLIC PKG::ASSIMP) if(BUILD_SHARED_LIBS) # We can't install this if we're doing a static build, because it depends on # a static library that isn't installed. - install(TARGETS p3assimp EXPORT Tools COMPONENT Tools DESTINATION ${MODULE_DESTINATION}) + install(TARGETS p3assimp EXPORT Assimp COMPONENT Assimp DESTINATION ${MODULE_DESTINATION}) endif() From 9512b2274b1d631bda86fc56cef5fd1dd8f0b282 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 6 Sep 2019 04:07:42 -0600 Subject: [PATCH 684/744] CMake: Remove libtar, unneeded downloadertools progs --- .travis.yml | 2 +- cmake/modules/FindTar.cmake | 39 ------------------------ dtool/Package.cmake | 13 -------- dtool/dtool_config.h.in | 3 -- panda/src/downloadertools/CMakeLists.txt | 22 ++----------- panda/src/express/CMakeLists.txt | 2 +- 6 files changed, 4 insertions(+), 77 deletions(-) delete mode 100644 cmake/modules/FindTar.cmake diff --git a/.travis.yml b/.travis.yml index b07d01e5c0..9a94a48ed2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,7 +64,7 @@ before_install: install: - > if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install python@3 eigen libtar libsquish zlib ffmpeg freetype \ + brew install python@3 eigen libsquish zlib ffmpeg freetype \ bullet opencv assimp libvorbis openssl ccache || true brew install ode --with-shared diff --git a/cmake/modules/FindTar.cmake b/cmake/modules/FindTar.cmake deleted file mode 100644 index 8db18b690c..0000000000 --- a/cmake/modules/FindTar.cmake +++ /dev/null @@ -1,39 +0,0 @@ -# Filename: FindTar.cmake -# Author: kestred (29 Nov, 2013) -# -# Usage: -# find_package(Tar [REQUIRED] [QUIET]) -# -# It sets the following variables: -# TAR_FOUND - system has libtar -# TAR_INCLUDE_DIR - the tar include directory -# TAR_LIBRARY_DIR - the tar library directory -# TAR_LIBRARY - the path to the library binary -# - -# Find the libtar include files -find_path(TAR_INCLUDE_DIR - NAMES "libtar.h" - PATHS "/usr/include" - "/usr/local/include" - PATH_SUFFIXES "" "tar" "libtar" - DOC "The path to libtar's include directory." -) - -# Find the libtar library (.a, .so) -find_library(TAR_LIBRARY - NAMES "tar" - "libtar" - PATHS "/usr" - "/usr/local" - PATH_SUFFIXES "lib" "lib32" "lib64" -) -get_filename_component(TAR_LIBRARY_DIR "${TAR_LIBRARY}" PATH) -set(TAR_LIBRARY_DIR "${TAR_LIBRARY_DIR}" CACHE PATH "The path to libtar's library directory.") # Library path - -mark_as_advanced(TAR_INCLUDE_DIR) -mark_as_advanced(TAR_LIBRARY_DIR) -mark_as_advanced(TAR_LIBRARY) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Tar DEFAULT_MSG TAR_LIBRARY TAR_INCLUDE_DIR TAR_LIBRARY_DIR) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index d2b17feb23..30250382c2 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -297,19 +297,6 @@ package_option(SQUISH package_status(SQUISH "libsquish") -# -# ------------ Archival formats ------------ -# - -# libtar -find_package(Tar QUIET) - -package_option(TAR - "This is used to optimize patch generation against tar files.") - -package_status(TAR "libtar") - - # # ------------ Asset formats ------------ # diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index e684babf9d..edfa19e061 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -62,9 +62,6 @@ #cmakedefine HAVE_BMP #cmakedefine HAVE_PNM -/* Define if we have libtar installed. */ -#cmakedefine HAVE_TAR - /* Define if we have CG installed. */ #cmakedefine HAVE_CG diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index bed053fb61..6946c9667e 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -5,36 +5,18 @@ if(NOT BUILD_PANDATOOL) endif() if(HAVE_OPENSSL) - add_executable(apply_patch apply_patch.cxx) - target_link_libraries(apply_patch panda) - - add_executable(build_patch build_patch.cxx) - target_link_libraries(build_patch panda) - - add_executable(show_ddb show_ddb.cxx) - target_link_libraries(show_ddb panda) - - add_executable(check_md5 check_md5.cxx) - target_link_libraries(check_md5 panda) - add_executable(pencrypt pencrypt.cxx) target_link_libraries(pencrypt panda) add_executable(pdecrypt pdecrypt.cxx) target_link_libraries(pdecrypt panda) - install(TARGETS apply_patch build_patch show_ddb check_md5 pencrypt pdecrypt + install(TARGETS pencrypt pdecrypt EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() if(HAVE_ZLIB) - add_executable(check_adler check_adler.cxx) - target_link_libraries(check_adler panda) - - add_executable(check_crc check_crc.cxx) - target_link_libraries(check_crc panda) - add_executable(pzip pzip.cxx) target_link_libraries(pzip panda) @@ -45,7 +27,7 @@ if(HAVE_ZLIB) add_executable(punzip punzip.cxx) target_link_libraries(punzip panda) - install(TARGETS check_adler check_crc pzip punzip + install(TARGETS pzip punzip EXPORT Tools COMPONENT Tools DESTINATION ${CMAKE_INSTALL_BINDIR}) endif() diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index cca0aa8874..08ae8be0d0 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -143,7 +143,7 @@ composite_sources(p3express P3EXPRESS_SOURCES) add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool - PKG::TAR PKG::ZLIB PKG::OPENSSL) + PKG::ZLIB PKG::OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(REPORT_OPENSSL_ERRORS) From 52f590e90af988366e9fbd439f15e7541d6f9891 Mon Sep 17 00:00:00 2001 From: rdb Date: Mon, 16 Sep 2019 13:58:13 +0200 Subject: [PATCH 685/744] CMake: do not use test_imports.py, it has been removed --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9a94a48ed2..13153b7c3c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -58,7 +58,6 @@ addons: before_install: # clean up remnants of makepanda -- mv makepanda/test_imports.py . - makepanda/selfdestruct.py --yes install: @@ -108,7 +107,6 @@ script: - make -j4 - export PYTHONPATH=$PWD -- python ../test_imports.py - pytest -v ../tests notifications: From fe7fdc09762940dcd58641f3504a1429194158eb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 16 Sep 2019 17:43:03 -0600 Subject: [PATCH 686/744] CMake: Reclassify direct/distributed/ headers as installed headers --- direct/src/distributed/CMakeLists.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/direct/src/distributed/CMakeLists.txt b/direct/src/distributed/CMakeLists.txt index 9b60daff62..898323f0d5 100644 --- a/direct/src/distributed/CMakeLists.txt +++ b/direct/src/distributed/CMakeLists.txt @@ -4,6 +4,10 @@ endif() set(P3DISTRIBUTED_HEADERS config_distributed.h + cConnectionRepository.h + cConnectionRepository.I + cDistributedSmoothNodeBase.h + cDistributedSmoothNodeBase.I ) set(P3DISTRIBUTED_SOURCES @@ -12,11 +16,7 @@ set(P3DISTRIBUTED_SOURCES set(P3DISTRIBUTED_IGATEEXT cConnectionRepository.cxx - cConnectionRepository.h - cConnectionRepository.I cDistributedSmoothNodeBase.cxx - cDistributedSmoothNodeBase.h - cDistributedSmoothNodeBase.I ) add_component_library(p3distributed NOINIT SYMBOL BUILDING_DIRECT_DISTRIBUTED From 9645aaee07528358e91b017bf8ecc43489fec309 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 18 Sep 2019 01:13:33 -0600 Subject: [PATCH 687/744] CMake: Fix generated pandac.PandaModules on Py2 Python 2 doesn't use the fully qualified module name in its ImportError output; only the local name. Test for that. --- direct/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/direct/CMakeLists.txt b/direct/CMakeLists.txt index 1e4e57c842..686ca23cc5 100644 --- a/direct/CMakeLists.txt +++ b/direct/CMakeLists.txt @@ -56,11 +56,12 @@ if(HAVE_PYTHON) print(\"Warning: pandac.PandaModules is deprecated, import from panda3d.core instead\")\n") foreach(module ${ALL_INTERROGATE_MODULES}) + string(REGEX REPLACE "^.*\\." "" module_name "${module}") file(APPEND "${CMAKE_CURRENT_BINARY_DIR}/pandac/PandaModules.py" " try: from ${module} import * except ImportError as err: - if not (\"No module named\" in str(err) and \"${module}\" in str(err)): + if not (\"No module named\" in str(err) and \"${module_name}\" in str(err)): raise ") endforeach() From 8429f50d3a34c7f5f035c2434825117274664f26 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 19 Sep 2019 04:44:46 -0600 Subject: [PATCH 688/744] CMake: Use -fno-rtti on most build configurations --- dtool/CompilerFlags.cmake | 27 +++++++++++++++++++++++++++ dtool/LocalSetup.cmake | 1 - dtool/dtool_config.h.in | 3 --- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index d48ffe3aa7..118e8f95d6 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -127,6 +127,9 @@ if(MSVC) set(cxx_exceptions_on "/EHsc") set(cxx_exceptions_off "/D_HAS_EXCEPTIONS=0") + set(cxx_rtti_on "/GR") + set(cxx_rtti_off "/GR-") + else() check_cxx_compiler_flag("-fno-exceptions" COMPILER_SUPPORTS_FEXCEPTIONS) if(COMPILER_SUPPORTS_FEXCEPTIONS) @@ -139,6 +142,17 @@ else() endif() + check_cxx_compiler_flag("-fno-rtti" COMPILER_SUPPORTS_FRTTI) + if(COMPILER_SUPPORTS_FRTTI) + set(cxx_rtti_on "-frtti") + set(cxx_rtti_off "-fno-rtti") + + else() + set(cxx_rtti_on) + set(cxx_rtti_off) + + endif() + endif() set(cxx_exceptions_property "$>") @@ -146,6 +160,19 @@ add_compile_options( "$<${cxx_exceptions_property}:${cxx_exceptions_on}>" "$<$:${cxx_exceptions_off}>") +set(cxx_rtti_property "$>") +if(NOT ANDROID) + # Normally, our Debug build defaults RTTI on. This is not the case on + # Android, where we don't use it even on Debug, to save space. + + set(cxx_rtti_property "$,${cxx_rtti_property}>") +endif() +add_compile_options( + "$<${cxx_rtti_property}:${cxx_rtti_on}>" + "$<$:${cxx_rtti_off}>") +set_property(DIRECTORY "${PROJECT_SOURCE_DIR}" APPEND PROPERTY + COMPILE_DEFINITIONS "$<${cxx_rtti_property}:HAVE_RTTI>") + if(MSVC) set(msvc_bigobj_property "$>") add_compile_options("$<${msvc_bigobj_property}:/bigobj>") diff --git a/dtool/LocalSetup.cmake b/dtool/LocalSetup.cmake index a181fb12e9..eed31b0e84 100644 --- a/dtool/LocalSetup.cmake +++ b/dtool/LocalSetup.cmake @@ -132,7 +132,6 @@ check_include_file_cxx(dirent.h PHAVE_DIRENT_H) check_include_file_cxx(ucontext.h PHAVE_UCONTEXT_H) #TODO doesn't work on OSX, use sys/ucontext.h check_include_file_cxx(linux/input.h PHAVE_LINUX_INPUT_H) check_include_file_cxx(stdint.h PHAVE_STDINT_H) -check_include_file_cxx(typeinfo HAVE_RTTI) # Do we have Posix threads? #set(HAVE_POSIX_THREADS ${CMAKE_USE_PTHREADS_INIT}) diff --git a/dtool/dtool_config.h.in b/dtool/dtool_config.h.in index edfa19e061..159488ab9d 100644 --- a/dtool/dtool_config.h.in +++ b/dtool/dtool_config.h.in @@ -227,9 +227,6 @@ /* Do we have ? */ #cmakedefine PHAVE_STDINT_H -/* Do we have RTTI (and )? */ -#cmakedefine HAVE_RTTI - /* Do we have Posix threads? */ #cmakedefine HAVE_POSIX_THREADS From bd1605907ee2d456f8c392b758cde6d33bd64ad5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 19 Sep 2019 22:15:34 -0600 Subject: [PATCH 689/744] CMake: Rename 'Distribution' config to 'Standard' This is the configuration shipped to Python developers in the form of the public SDK. --- dtool/CompilerFlags.cmake | 17 +++++++++-------- dtool/Config.cmake | 12 ++---------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 118e8f95d6..9dc85df8e9 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -8,6 +8,14 @@ include(CheckCXXCompilerFlag) +# These are flags for the custom configurations we add +# Standard +set(CMAKE_C_FLAGS_STANDARD "-O3") +set(CMAKE_CXX_FLAGS_STANDARD "-O3") +set(CMAKE_SHARED_LINKER_FLAGS_STANDARD "") +set(CMAKE_MODULE_LINKER_FLAGS_STANDARD "") +set(CMAKE_EXE_LINKER_FLAGS_STANDARD "") + # Panda3D is now a C++11 project. Newer versions of CMake support this out of # the box; for older versions we take a shot in the dark: if(CMAKE_VERSION VERSION_LESS "3.1") @@ -101,6 +109,7 @@ if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") + set(CMAKE_CXX_FLAGS_STANDARD "${CMAKE_CXX_FLAGS_STANDARD} -Wno-unused-variable") if(MSVC) # Clang behaving as MSVC @@ -187,11 +196,3 @@ if(NOT MSVC) add_compile_options("-fvisibility=hidden") endif() endif() - -# These are flags for the custom configurations we add -# Distribution -set(CMAKE_C_FLAGS_DISTRIBUTION "") -set(CMAKE_CXX_FLAGS_DISTRIBUTION "") -set(CMAKE_SHARED_LINKER_FLAGS_DISTRIBUTION "") -set(CMAKE_MODULE_LINKER_FLAGS_DISTRIBUTION "") -set(CMAKE_EXE_LINKER_FLAGS_DISTRIBUTION "") diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 0248fbff20..98146a1b83 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -36,7 +36,7 @@ endif() # Define the type of build we are setting up. if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo Debug MinSizeRel Distribution) + set(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo Debug MinSizeRel Standard) else() # CMAKE_BUILD_TYPE can't just be set using the usual set(CACHE) method since # it's an empty string by default. @@ -44,7 +44,7 @@ else() set(CMAKE_BUILD_TYPE RelWithDebInfo) endif() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - Release RelWithDebInfo Debug MinSizeRel Distribution) + Release RelWithDebInfo Debug MinSizeRel Standard) endif() # Provide convenient boolean expression based on build type @@ -64,14 +64,6 @@ else() set(IS_NOT_MINSIZE_BUILD True) endif() -if(CMAKE_BUILD_TYPE MATCHES "Distribution") - set(IS_DIST_BUILD True) - set(IS_NOT_DIST_BUILD False) -else() - set(IS_DIST_BUILD False) - set(IS_NOT_DIST_BUILD True) -endif() - set(PER_CONFIG_OPTIONS) # Are we building with static or dynamic linking? From 9bb59b03b96d4cc0d8d861a169ec6d2701db0bd4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 19 Sep 2019 22:33:11 -0600 Subject: [PATCH 690/744] CMake: Add several essential flags See GH #717 for relevant discussion --- dtool/CompilerFlags.cmake | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 9dc85df8e9..e179f3ee3d 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -103,13 +103,20 @@ else() endif() if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") - set(disable_flags "-Wno-unused-function -Wno-unused-parameter") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${disable_flags}") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${disable_flags} -Wno-reorder") - set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -Wno-unused-variable") - set(CMAKE_CXX_FLAGS_STANDARD "${CMAKE_CXX_FLAGS_STANDARD} -Wno-unused-variable") + set(global_flags + "-Wno-unused-function -Wno-unused-parameter -fno-strict-aliasing") + set(release_flags + "-Wno-unused-variable -fno-stack-protector -ffast-math -fno-unsafe-math-optimizations") + + # Allow NaN to occur in the public SDK + set(standard_flags "${release_flags} -fno-finite-math-only") + + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${global_flags}") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${global_flags} -Wno-reorder") + set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${release_flags}") + set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} ${release_flags}") + set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} ${release_flags}") + set(CMAKE_CXX_FLAGS_STANDARD "${CMAKE_CXX_FLAGS_STANDARD} ${standard_flags}") if(MSVC) # Clang behaving as MSVC From aadcb179d617203b162acf55fab6067ade912f7b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 21 Sep 2019 02:45:46 -0600 Subject: [PATCH 691/744] CMake: Change default build type to Standard --- dtool/Config.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 98146a1b83..cfe8e7a6c5 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -36,15 +36,15 @@ endif() # Define the type of build we are setting up. if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES Release RelWithDebInfo Debug MinSizeRel Standard) + set(CMAKE_CONFIGURATION_TYPES Standard Release RelWithDebInfo Debug MinSizeRel) else() # CMAKE_BUILD_TYPE can't just be set using the usual set(CACHE) method since # it's an empty string by default. if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE RelWithDebInfo) + set(CMAKE_BUILD_TYPE Standard) endif() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - Release RelWithDebInfo Debug MinSizeRel Standard) + Standard Release RelWithDebInfo Debug MinSizeRel) endif() # Provide convenient boolean expression based on build type From 73ed31b935b27c3c2ccfad894565494835cb98cd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 10 Oct 2019 10:42:46 -0600 Subject: [PATCH 692/744] CMake: audiotraits and ffmpeg are MODULE, not SHARED This is important as it forces the lib prefix on Windows, and omits creating an import .lib when building shared. --- panda/src/audiotraits/CMakeLists.txt | 4 ++-- panda/src/ffmpeg/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/panda/src/audiotraits/CMakeLists.txt b/panda/src/audiotraits/CMakeLists.txt index 71c4da09eb..27b70e1bb6 100644 --- a/panda/src/audiotraits/CMakeLists.txt +++ b/panda/src/audiotraits/CMakeLists.txt @@ -17,7 +17,7 @@ if(HAVE_FMODEX) ) composite_sources(p3fmod_audio P3FMOD_SOURCES) - add_library(p3fmod_audio ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) + add_library(p3fmod_audio ${MODULE_TYPE} ${P3FMOD_HEADERS} ${P3FMOD_SOURCES}) set_target_properties(p3fmod_audio PROPERTIES DEFINE_SYMBOL BUILDING_FMOD_AUDIO) target_link_libraries(p3fmod_audio panda PKG::FMODEX) @@ -45,7 +45,7 @@ if(HAVE_OPENAL) composite_sources(p3openal_audio P3OPENAL_SOURCES) - add_library(p3openal_audio ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) + add_library(p3openal_audio ${MODULE_TYPE} ${P3OPENAL_HEADERS} ${P3OPENAL_SOURCES}) set_target_properties(p3openal_audio PROPERTIES DEFINE_SYMBOL BUILDING_OPENAL_AUDIO) target_link_libraries(p3openal_audio panda PKG::OPENAL) diff --git a/panda/src/ffmpeg/CMakeLists.txt b/panda/src/ffmpeg/CMakeLists.txt index 08e3b252cc..a78a3d2cdc 100644 --- a/panda/src/ffmpeg/CMakeLists.txt +++ b/panda/src/ffmpeg/CMakeLists.txt @@ -21,7 +21,7 @@ set(P3FFMPEG_SOURCES ) composite_sources(p3ffmpeg P3FFMPEG_SOURCES) -add_library(p3ffmpeg ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) +add_library(p3ffmpeg ${MODULE_TYPE} ${P3FFMPEG_HEADERS} ${P3FFMPEG_SOURCES}) set_target_properties(p3ffmpeg PROPERTIES DEFINE_SYMBOL BUILDING_FFMPEG) target_link_libraries(p3ffmpeg panda PKG::FFMPEG PKG::SWSCALE PKG::SWRESAMPLE) From 9ecaa0056b590d6489829e1cd8b94ffd403f8273 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 15 Oct 2019 23:27:03 -0600 Subject: [PATCH 693/744] CMake: Break out p3interrogatedb as a first-class library --- dtool/metalibs/dtoolconfig/CMakeLists.txt | 2 +- dtool/src/interrogate/CMakeLists.txt | 4 ++-- dtool/src/interrogatedb/CMakeLists.txt | 21 ++++++++++----------- panda/src/express/CMakeLists.txt | 2 +- 4 files changed, 14 insertions(+), 15 deletions(-) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt index 3d36dcf39e..d77b5fd105 100644 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ b/dtool/metalibs/dtoolconfig/CMakeLists.txt @@ -1,4 +1,4 @@ -set(DTOOLCONFIG_LINK_TARGETS p3prc p3interrogatedb) +set(DTOOLCONFIG_LINK_TARGETS p3prc) set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index a4a70774d7..7959a81cc9 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -60,7 +60,7 @@ set(INTERROGATE_PREAMBLE_PYTHON_NATIVE composite_sources(interrogate INTERROGATE_SOURCES) add_executable(interrogate ${INTERROGATE_HEADERS} ${INTERROGATE_SOURCES}) -target_link_libraries(interrogate p3cppParser p3dtoolconfig +target_link_libraries(interrogate p3cppParser p3interrogatedb PKG::OPENSSL) # Python preamble for interrogate_module @@ -76,7 +76,7 @@ add_custom_command( add_executable(interrogate_module interrogate_module.cxx ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx) -target_link_libraries(interrogate_module p3cppParser p3dtoolconfig +target_link_libraries(interrogate_module p3cppParser p3interrogatedb PKG::OPENSSL) if(NOT CMAKE_CROSSCOMPILING) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index 947bb93cc9..acd55c72c3 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -34,18 +34,17 @@ set(P3IGATERUNTIME_HEADERS ) composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) -add_component_library(p3interrogatedb NOINIT SYMBOL BUILDING_INTERROGATEDB +add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) -target_link_libraries(p3interrogatedb p3prc p3dconfig p3dtool) +set_target_properties(p3interrogatedb PROPERTIES DEFINE_SYMBOL BUILDING_INTERROGATEDB) +target_link_libraries(p3interrogatedb p3dconfig p3dtoolconfig) -if(NOT BUILD_METALIBS) - install(TARGETS p3interrogatedb - EXPORT Core COMPONENT Core - DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT CoreDevel) -endif() +install(TARGETS p3interrogatedb + EXPORT Core COMPONENT Core + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d + ARCHIVE COMPONENT CoreDevel) install(FILES ${P3INTERROGATEDB_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) install(FILES ${P3IGATERUNTIME_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) @@ -74,4 +73,4 @@ add_custom_command( add_python_target(panda3d.interrogatedb "${CMAKE_CURRENT_BINARY_DIR}/interrogatedb_module.cxx") -target_link_libraries(panda3d.interrogatedb p3dtoolconfig) +target_link_libraries(panda3d.interrogatedb p3interrogatedb) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 08ae8be0d0..9324088175 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -142,7 +142,7 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool +target_link_libraries(p3express p3pandabase p3interrogatedb p3dtoolconfig p3dtool PKG::ZLIB PKG::OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) From 5b4ea0e277a8844d983fd88314a2d8638d7fabf4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 4 Nov 2019 13:41:13 -0700 Subject: [PATCH 694/744] CMake: Proper Standard compiler flags for MSVC --- dtool/CompilerFlags.cmake | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index e179f3ee3d..8f52bed3a3 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -10,8 +10,13 @@ include(CheckCXXCompilerFlag) # These are flags for the custom configurations we add # Standard -set(CMAKE_C_FLAGS_STANDARD "-O3") -set(CMAKE_CXX_FLAGS_STANDARD "-O3") +if(MSVC) + set(CMAKE_C_FLAGS_STANDARD "/Ox") + set(CMAKE_CXX_FLAGS_STANDARD "/Ox") +else() + set(CMAKE_C_FLAGS_STANDARD "-O3") + set(CMAKE_CXX_FLAGS_STANDARD "-O3") +endif() set(CMAKE_SHARED_LINKER_FLAGS_STANDARD "") set(CMAKE_MODULE_LINKER_FLAGS_STANDARD "") set(CMAKE_EXE_LINKER_FLAGS_STANDARD "") From f7ac439eb147e994b04767a661657fa86c423713 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 4 Nov 2019 13:41:36 -0700 Subject: [PATCH 695/744] CMake: Fix p3pgraph build with MSVC+Eigen --- panda/src/pgraph/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 1852a7a15c..178623eb3d 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -230,6 +230,11 @@ add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH target_link_libraries(p3pgraph p3gobj p3event p3gsgbase p3putil p3linmath pandaexpress) target_interrogate(p3pgraph ALL EXTENSIONS ${P3PGRAPH_IGATEEXT}) +if(HAVE_EIGEN) + # Eigen puts this over the threshold where bigobj is needed on MSVC + set_target_properties(p3pgraph PROPERTIES MSVC_BIGOBJ ON) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3pgraph EXPORT Core COMPONENT Core From cf59d3d983c265f03c6df27ff989dad30469f9cf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 4 Nov 2019 13:44:54 -0700 Subject: [PATCH 696/744] CMake: Remove p3dtoolconfig from build It's just p3prc now, so instead we install some symlinks --- dtool/CMakeLists.txt | 3 +- dtool/metalibs/dtoolconfig/CMakeLists.txt | 11 ---- dtool/src/interrogatedb/CMakeLists.txt | 2 +- dtool/src/prc/CMakeLists.txt | 73 ++++++++++++++++++++--- panda/src/express/CMakeLists.txt | 2 +- 5 files changed, 67 insertions(+), 24 deletions(-) delete mode 100644 dtool/metalibs/dtoolconfig/CMakeLists.txt diff --git a/dtool/CMakeLists.txt b/dtool/CMakeLists.txt index 60b6446e68..62308bd980 100644 --- a/dtool/CMakeLists.txt +++ b/dtool/CMakeLists.txt @@ -10,6 +10,5 @@ add_subdirectory(src/interrogate) add_subdirectory(src/interrogatedb) add_subdirectory(src/prc) -# Include dtool metalibs +# Include dtool metalib add_subdirectory(metalibs/dtool) -add_subdirectory(metalibs/dtoolconfig) diff --git a/dtool/metalibs/dtoolconfig/CMakeLists.txt b/dtool/metalibs/dtoolconfig/CMakeLists.txt deleted file mode 100644 index d77b5fd105..0000000000 --- a/dtool/metalibs/dtoolconfig/CMakeLists.txt +++ /dev/null @@ -1,11 +0,0 @@ -set(DTOOLCONFIG_LINK_TARGETS p3prc) -set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "CoreDevel") -add_metalib(p3dtoolconfig INIT init_libdtoolconfig dtoolconfig.h COMPONENTS ${DTOOLCONFIG_LINK_TARGETS}) -unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) - -install(TARGETS p3dtoolconfig - EXPORT Core COMPONENT Core - DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT CoreDevel) diff --git a/dtool/src/interrogatedb/CMakeLists.txt b/dtool/src/interrogatedb/CMakeLists.txt index acd55c72c3..adadd5a24b 100644 --- a/dtool/src/interrogatedb/CMakeLists.txt +++ b/dtool/src/interrogatedb/CMakeLists.txt @@ -37,7 +37,7 @@ composite_sources(p3interrogatedb P3INTERROGATEDB_SOURCES) add_library(p3interrogatedb ${P3INTERROGATEDB_HEADERS} ${P3INTERROGATEDB_SOURCES}) set_target_properties(p3interrogatedb PROPERTIES DEFINE_SYMBOL BUILDING_INTERROGATEDB) -target_link_libraries(p3interrogatedb p3dconfig p3dtoolconfig) +target_link_libraries(p3interrogatedb p3dconfig p3prc) install(TARGETS p3interrogatedb EXPORT Core COMPONENT Core diff --git a/dtool/src/prc/CMakeLists.txt b/dtool/src/prc/CMakeLists.txt index 175494a716..f2985662bd 100644 --- a/dtool/src/prc/CMakeLists.txt +++ b/dtool/src/prc/CMakeLists.txt @@ -81,8 +81,9 @@ set(P3PRC_IGATEEXT ) composite_sources(p3prc P3PRC_SOURCES) -add_component_library(p3prc NOINIT SYMBOL BUILDING_DTOOL_PRC +add_library(p3prc ${P3PRC_HEADERS} ${P3PRC_SOURCES}) +set_target_properties(p3prc PROPERTIES DEFINE_SYMBOL BUILDING_DTOOL_PRC) target_include_directories(p3prc PUBLIC $) target_link_libraries(p3prc p3dtool PKG::OPENSSL) target_interrogate(p3prc ALL EXTENSIONS ${P3PRC_IGATEEXT}) @@ -91,12 +92,66 @@ if(ANDROID) target_link_libraries(p3prc log) endif() -if(NOT BUILD_METALIBS) - install(TARGETS p3prc - EXPORT Core COMPONENT Core - DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} - INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT CoreDevel) -endif() +install(TARGETS p3prc + EXPORT Core COMPONENT Core + DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d + ARCHIVE COMPONENT CoreDevel) + install(FILES ${P3PRC_HEADERS} COMPONENT CoreDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) + +# Also install under the old name "p3dtoolconfig" +# TODO: Remove this once "p3dtoolconfig" is deprecated +if(WIN32) + # Symlinks aren't pretty under WIN32 + set(_symlink "copy") +else() + set(_symlink "create_symlink") +endif() + +get_target_property(_type p3prc TYPE) +if(_type STREQUAL "SHARED_LIBRARY") + + set(_suffix "${CMAKE_SHARED_LIBRARY_SUFFIX}") + if(UNIX) + get_target_property(_soversion p3prc SOVERSION) + if(APPLE) + set(_suffix ".${_soversion}${_suffix}") + else() + set(_suffix "${_suffix}.${_soversion}") + endif() + + set(_file_genex "TARGET_SONAME_FILE") + set(_install_dir "${CMAKE_INSTALL_LIBDIR}") + + else() + # Win32? + set(_file_genex "TARGET_FILE") + set(_install_dir "${CMAKE_INSTALL_BINDIR}") + + endif() + + set(_soname "${CMAKE_SHARED_LIBRARY_PREFIX}p3dtoolconfig${_suffix}") + + add_custom_command(TARGET p3prc POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E chdir "$<${_file_genex}_DIR:p3prc>" + "${CMAKE_COMMAND}" -E "${_symlink}" + "$<${_file_genex}_NAME:p3prc>" "${_soname}" + ) + install(FILES "$<${_file_genex}_DIR:p3prc>/${_soname}" + DESTINATION "${_install_dir}") +endif() + +if(WIN32) + set(_libname "${CMAKE_IMPORT_LIBRARY_PREFIX}p3dtoolconfig${CMAKE_IMPORT_LIBRARY_SUFFIX}") +else() + set(_libname "${CMAKE_${_type}_PREFIX}p3dtoolconfig${CMAKE_${_type}_SUFFIX}") +endif() +add_custom_command(TARGET p3prc POST_BUILD + COMMAND "${CMAKE_COMMAND}" -E chdir "$" + "${CMAKE_COMMAND}" -E "${_symlink}" + "$" "${_libname}" +) +install(FILES "$/${_libname}" + DESTINATION "${CMAKE_INSTALL_LIBDIR}") diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 9324088175..0890cb625c 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -142,7 +142,7 @@ set(P3EXPRESS_IGATEEXT composite_sources(p3express P3EXPRESS_SOURCES) add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS ${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS}) -target_link_libraries(p3express p3pandabase p3interrogatedb p3dtoolconfig p3dtool +target_link_libraries(p3express p3pandabase p3interrogatedb p3prc p3dtool PKG::ZLIB PKG::OPENSSL) target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) From 0e0b2186c78f3292129feffea35a63d6835bf1e3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 4 Nov 2019 16:43:12 -0700 Subject: [PATCH 697/744] CMake: Add #line directives to interrogate_preamble_python_native --- dtool/src/interrogate/CMakeLists.txt | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 7959a81cc9..96f01c2218 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -64,11 +64,24 @@ target_link_libraries(interrogate p3cppParser p3interrogatedb PKG::OPENSSL) # Python preamble for interrogate_module +set(_preamble_files) +foreach(_file ${INTERROGATE_PREAMBLE_PYTHON_NATIVE}) + # Resolve symlinks, use absolute path, and add a `#line 1 ...` directive + get_filename_component(_file "${_file}" REALPATH) + + string(SHA1 _hash "${_file}") + set(_line_file "${CMAKE_CURRENT_BINARY_DIR}/.${_hash}.h") + file(WRITE "${_line_file}" "#line 1 \"${_file}\"\n") + + list(APPEND _preamble_files "${_line_file}") + list(APPEND _preamble_files "${_file}") +endforeach(_file) + add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx COMMAND ${CMAKE_COMMAND} -D OUTPUT_FILE="${CMAKE_CURRENT_BINARY_DIR}/interrogate_preamble_python_native.cxx" - -D INPUT_FILES="${INTERROGATE_PREAMBLE_PYTHON_NATIVE}" + -D INPUT_FILES="${_preamble_files}" -D SYMBOL_NAME="interrogate_preamble_python_native" -P ${PROJECT_SOURCE_DIR}/cmake/scripts/ConcatenateToCXX.cmake DEPENDS ${INTERROGATE_PREAMBLE_PYTHON_NATIVE} From 1c866dff7802efc43e50c09289f6bdc883f2156a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Nov 2019 18:24:36 -0700 Subject: [PATCH 698/744] CMake: Don't override Python_ROOT --- dtool/Package.cmake | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 30250382c2..6f3bc82a1c 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -22,14 +22,17 @@ if(THIRDPARTY_DIRECTORY) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(_package_dir "${THIRDPARTY_DIRECTORY}/win-libs-vc14-x64") - file(GLOB Python_ROOT "${THIRDPARTY_DIRECTORY}/win-python*-x64") + file(GLOB _python_dirs "${THIRDPARTY_DIRECTORY}/win-python*-x64") else() set(_package_dir "${THIRDPARTY_DIRECTORY}/win-libs-vc14") - file(GLOB Python_ROOT "${THIRDPARTY_DIRECTORY}/win-python*") + file(GLOB _python_dirs "${THIRDPARTY_DIRECTORY}/win-python*") endif() - list(REVERSE Python_ROOT) # Descending order of version + list(REVERSE _python_dirs) # Descending order of version + if(NOT DEFINED Python_ROOT) + set(Python_ROOT "${_python_dirs}") + endif() set(BISON_ROOT "${THIRDPARTY_DIRECTORY}/win-util") set(FLEX_ROOT "${THIRDPARTY_DIRECTORY}/win-util") From 0b342d0f9fd6882e35a0507e798ab7520e8a741f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 10 Nov 2019 22:32:47 -0700 Subject: [PATCH 699/744] CMake: Don't use PythonInterp/PythonLibs when FindPython available --- dtool/Package.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 6f3bc82a1c..956814c11b 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -120,7 +120,7 @@ if(Python_FOUND) set(PYTHON_LIBRARY_DIRS ${Python_LIBRARY_DIRS}) set(PYTHON_VERSION_STRING ${Python_VERSION}) -else() +elseif(CMAKE_VERSION VERSION_LESS "3.12") find_package(PythonInterp ${WANT_PYTHON_VERSION} QUIET) find_package(PythonLibs ${PYTHON_VERSION_STRING} QUIET) From ae59bd031f1d1e03ecc940db44cf4cf92b74aba6 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 11 Nov 2019 20:16:00 -0700 Subject: [PATCH 700/744] CMake: Fix typo --- dtool/Package.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 956814c11b..6de060f922 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -11,7 +11,7 @@ if(THIRDPARTY_DIRECTORY) if(NOT _policy_cmp0074 STREQUAL "NEW") message(FATAL_ERROR - "Your version of CMake is too old; please upgrade or unset THIRDPARTY_DIRCTORY to continue.") + "Your version of CMake is too old; please upgrade or unset THIRDPARTY_DIRECTORY to continue.") endif() # Dig up the actual "libs" directory From f377bdfb29ca490a6be3eb2923579098f362facb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Nov 2019 00:29:00 -0700 Subject: [PATCH 701/744] CMake: Copy thirdparty/**/*.dll to bin/ directory --- dtool/Package.cmake | 37 +++++++++++++++++++++++++++++ dtool/metalibs/dtool/CMakeLists.txt | 3 +++ 2 files changed, 40 insertions(+) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 6de060f922..4677f62cf6 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -3,6 +3,8 @@ set(THIRDPARTY_DIRECTORY "" CACHE PATH located here will be prioritized over system libraries. Useful for cross-compiling.") +set(THIRDPARTY_DLLS) + if(THIRDPARTY_DIRECTORY) # This policy is necessary for PackageName_ROOT variables to be respected if(POLICY CMP0074) @@ -78,6 +80,7 @@ if(THIRDPARTY_DIRECTORY) ) string(TOLOWER "${_Package}" _package) + string(TOUPPER "${_Package}" _PACKAGE) # Some packages in the thirdparty dir have different subdirectory names from # the name of the CMake package @@ -100,10 +103,44 @@ if(THIRDPARTY_DIRECTORY) # Set search path set(${_Package}_ROOT "${_package_dir}/${_package}") + # Set up copying DLLs, if necessary + file(GLOB _dlls "${${_Package}_ROOT}/bin/*.dll") + if(_dlls) + set(_havevar "HAVE_${_PACKAGE}") + set(THIRDPARTY_DLLS_${_havevar} "${_dlls}") + list(APPEND THIRDPARTY_DLLS "${_havevar}") + + endif() + endforeach(_Package) endif() +# This is used to copy the DLLs alongside the output of `package` +function(thirdparty_copy_alongside package) + set(_dlls) + + foreach(_havevar ${THIRDPARTY_DLLS}) + if(${_havevar}) + list(APPEND _dlls ${THIRDPARTY_DLLS_${_havevar}}) + endif() + endforeach(_havevar) + + if(NOT _dlls) + # Don't try to copy/install nothingness + return() + endif() + + add_custom_command(TARGET ${package} POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_if_different + ${_dlls} $ + ) + + # Also install the DLLs + install(FILES ${_dlls} DESTINATION ${CMAKE_INSTALL_BINDIR}) + +endfunction(thirdparty_copy_alongside) + # # ------------ Python ------------ # diff --git a/dtool/metalibs/dtool/CMakeLists.txt b/dtool/metalibs/dtool/CMakeLists.txt index fc5eb3c722..812c457b72 100644 --- a/dtool/metalibs/dtool/CMakeLists.txt +++ b/dtool/metalibs/dtool/CMakeLists.txt @@ -8,3 +8,6 @@ install(TARGETS p3dtool RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d ARCHIVE COMPONENT CoreDevel) + +# Also handle thirdparty DLLs +thirdparty_copy_alongside(p3dtool) From 4556059c90e5e4909158dfb67722b78652611616 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Nov 2019 15:19:48 -0700 Subject: [PATCH 702/744] CMake: Use find_program to detect host tools when cross-compiling In the future, we should also try to do find_package(Panda3D) to use the host tools even if Panda3D isn't in a system path. --- dtool/src/interrogate/CMakeLists.txt | 20 ++++++++++++++++++++ panda/src/downloadertools/CMakeLists.txt | 9 +++++++++ 2 files changed, 29 insertions(+) diff --git a/dtool/src/interrogate/CMakeLists.txt b/dtool/src/interrogate/CMakeLists.txt index 96f01c2218..1ecba4623d 100644 --- a/dtool/src/interrogate/CMakeLists.txt +++ b/dtool/src/interrogate/CMakeLists.txt @@ -95,6 +95,26 @@ target_link_libraries(interrogate_module p3cppParser p3interrogatedb if(NOT CMAKE_CROSSCOMPILING) add_executable(host_interrogate ALIAS interrogate) add_executable(host_interrogate_module ALIAS interrogate_module) + +else() + # When cross-compiling, we must find the host Interrogate. + # TODO: We should also try to find_package(Panda3D ...) before falling back + # to searching manually. + find_program(HOST_PATH_INTERROGATE interrogate) + find_program(HOST_PATH_INTERROGATE_MODULE interrogate_module) + + add_executable(host_interrogate IMPORTED GLOBAL) + if(HOST_PATH_INTERROGATE) + set_target_properties(host_interrogate PROPERTIES + IMPORTED_LOCATION "${HOST_PATH_INTERROGATE}") + endif() + + add_executable(host_interrogate_module IMPORTED GLOBAL) + if(HOST_PATH_INTERROGATE_MODULE) + set_target_properties(host_interrogate_module PROPERTIES + IMPORTED_LOCATION "${HOST_PATH_INTERROGATE_MODULE}") + endif() + endif() if(WANT_INTERROGATE) diff --git a/panda/src/downloadertools/CMakeLists.txt b/panda/src/downloadertools/CMakeLists.txt index 6946c9667e..47abcb727f 100644 --- a/panda/src/downloadertools/CMakeLists.txt +++ b/panda/src/downloadertools/CMakeLists.txt @@ -22,6 +22,15 @@ if(HAVE_ZLIB) if(NOT CMAKE_CROSSCOMPILING) add_executable(host_pzip ALIAS pzip) + else() + find_program(HOST_PATH_PZIP pzip) + + add_executable(host_pzip IMPORTED GLOBAL) + if(HOST_PATH_PZIP) + set_target_properties(host_pzip PROPERTIES + IMPORTED_LOCATION "${HOST_PATH_PZIP}") + endif() + endif() add_executable(punzip punzip.cxx) From a37eabe08939d4bf9089574fc11c2c1566110efb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 25 Nov 2019 03:02:50 -0700 Subject: [PATCH 703/744] CMake: Set generated prc's `model-cache-dir` properly for Windows/macOS --- panda/src/configfiles/CMakeLists.txt | 11 +++++++++++ panda/src/configfiles/panda.prc.in | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index edaa95eeb2..69509806f9 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -21,6 +21,17 @@ else() set(AUDIO_LIBRARY_NAME none) endif() +if(WIN32) + set(BAM_CACHE_DIR + "$USER_APPDATA/Panda3D-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +elseif(APPLE) + set(BAM_CACHE_DIR + "$HOME/Library/Caches/Panda3D-${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}") +else() + set(BAM_CACHE_DIR + "$XDG_CACHE_HOME/panda3d") +endif() + configure_file(panda.prc.in "${CMAKE_BINARY_DIR}/etc/20_panda.prc") if(IS_MULTICONFIG) file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/$/etc/20_panda.prc" diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index b18fb20ca2..373852b241 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -35,7 +35,7 @@ load-file-type egg pandaegg default-model-extension .egg # Enable the model-cache, but only for models, not textures. -model-cache-dir $XDG_CACHE_HOME/panda3d +model-cache-dir ${BAM_CACHE_DIR} model-cache-textures #f From bc152f665cc7a9ac4b90174ac0f0d55f2cf61eb7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 13 Nov 2019 16:38:18 -0700 Subject: [PATCH 704/744] CMake: Escape $ in exported packages file --- cmake/macros/PackageConfig.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 2b692e543d..6c615376d5 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -417,6 +417,11 @@ function(export_packages filename) set(exports "${exports})\n") endforeach(pkg) + # file(GENERATE) does not like $ (and it's meant to be + # consumed by our importer) so we escape it + set(_bling "$<1:$>") # genex-escaped $ + string(REPLACE "$ Date: Mon, 18 Nov 2019 20:40:48 -0700 Subject: [PATCH 705/744] CMake: Disable searching macOS frameworks when using THIRDPARTY_DIRECTORY --- dtool/Package.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 4677f62cf6..004f992c47 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -20,6 +20,9 @@ if(THIRDPARTY_DIRECTORY) if(APPLE) set(_package_dir "${THIRDPARTY_DIRECTORY}/darwin-libs-a") + # Make sure thirdparty has the first shot, not system frameworks + set(CMAKE_FIND_FRAMEWORK LAST) + elseif(WIN32) if(CMAKE_SIZEOF_VOID_P EQUAL 8) set(_package_dir "${THIRDPARTY_DIRECTORY}/win-libs-vc14-x64") From 5c98b793a2b1c43fc8300dfea525d6e3026385b3 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 27 Nov 2019 09:39:09 -0700 Subject: [PATCH 706/744] CMake: Make sure C++11 is marked as the required standard --- dtool/CompilerFlags.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 8f52bed3a3..c38eafecc2 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -33,6 +33,7 @@ if(CMAKE_VERSION VERSION_LESS "3.1") else() set(CMAKE_CXX_STANDARD 11) + set(CMAKE_CXX_STANDARD_REQUIRED ON) endif() From 6bde9423dfba7a85e9a364472580476484e85362 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 1 Dec 2019 09:29:34 -0700 Subject: [PATCH 707/744] CMake: Don't pass GNU-like -f options to clang-cl --- dtool/CompilerFlags.cmake | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index c38eafecc2..da152bef99 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -108,14 +108,22 @@ else() endif() -if(NOT "x${CMAKE_CXX_COMPILER_ID}" STREQUAL "xMSVC") +if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") set(global_flags "-Wno-unused-function -Wno-unused-parameter -fno-strict-aliasing") - set(release_flags - "-Wno-unused-variable -fno-stack-protector -ffast-math -fno-unsafe-math-optimizations") + set(release_flags "-Wno-unused-variable") - # Allow NaN to occur in the public SDK - set(standard_flags "${release_flags} -fno-finite-math-only") + if(NOT MSVC) + # These flags upset Clang when it's in MSVC mode + set(release_flags "${release_flags} -fno-stack-protector -ffast-math -fno-unsafe-math-optimizations") + + # Allow NaN to occur in the public SDK + set(standard_flags "${release_flags} -fno-finite-math-only") + + else() + set(standard_flags "${release_flags}") + + endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${global_flags}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${global_flags} -Wno-reorder") From 4000199acb3fee8c69e7cff8c4e4d998e88685a4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 2 Dec 2019 18:19:27 -0700 Subject: [PATCH 708/744] CMake: Fix Bullet building under clang-cl --- panda/src/bullet/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/panda/src/bullet/CMakeLists.txt b/panda/src/bullet/CMakeLists.txt index 29573468cd..26c6b8762e 100644 --- a/panda/src/bullet/CMakeLists.txt +++ b/panda/src/bullet/CMakeLists.txt @@ -114,6 +114,11 @@ set_target_properties(p3bullet PROPERTIES DEFINE_SYMBOL BUILDING_PANDABULLET) target_link_libraries(p3bullet panda PKG::BULLET) target_interrogate(p3bullet ALL) +if(MSVC AND CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + # Clang emulating MSVC; it has builtin defines for __m128 + __m128 and co. + target_compile_definitions(p3bullet PUBLIC BT_NO_SIMD_OPERATOR_OVERLOADS) +endif() + install(TARGETS p3bullet EXPORT Bullet COMPONENT Bullet DESTINATION ${CMAKE_INSTALL_LIBDIR} From e474350a48ae235babfef737b128298ef98fdfca Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 5 Dec 2019 10:35:25 -0700 Subject: [PATCH 709/744] CMake: Add a "Coverage" configuration, when using GCC/Clang --- CMakeLists.txt | 3 +++ dtool/CompilerFlags.cmake | 27 +++++++++++++++++++++++++++ dtool/Config.cmake | 11 ++++++++--- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6015bdac20..76669756ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -117,8 +117,11 @@ if(INTERROGATE_PYTHON_INTERFACE) # for pytest before adding this test. If the user doesn't have pytest, we'd # like for the tests to fail. + # In the Coverage configuration, we also require pytest-cov + add_test(NAME pytest COMMAND "${PYTHON_EXECUTABLE}" -m pytest "${PROJECT_SOURCE_DIR}/tests" + $<$:--cov=.> WORKING_DIRECTORY "${PANDA_OUTPUT_DIR}") endif() diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index da152bef99..18f611352c 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -21,6 +21,33 @@ set(CMAKE_SHARED_LINKER_FLAGS_STANDARD "") set(CMAKE_MODULE_LINKER_FLAGS_STANDARD "") set(CMAKE_EXE_LINKER_FLAGS_STANDARD "") +# Coverage (when we know how to support it) +if(CMAKE_CXX_COMPILER_ID MATCHES "(AppleClang|Clang)") + set(CMAKE_C_FLAGS_COVERAGE + "${CMAKE_C_FLAGS_DEBUG} -fprofile-instr-generate -fcoverage-mapping") + set(CMAKE_CXX_FLAGS_COVERAGE + "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-instr-generate -fcoverage-mapping") + + set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE + "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -fprofile-instr-generate") + set(CMAKE_MODULE_LINKER_FLAGS_COVERAGE + "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} -fprofile-instr-generate") + set(CMAKE_EXE_LINKER_FLAGS_COVERAGE + "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fprofile-instr-generate") + +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GCC") + set(CMAKE_C_FLAGS_COVERAGE "${CMAKE_C_FLAGS_DEBUG} --coverage") + set(CMAKE_CXX_FLAGS_COVERAGE "${CMAKE_CXX_FLAGS_DEBUG} --coverage") + + set(CMAKE_SHARED_LINKER_FLAGS_COVERAGE + "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} --coverage") + set(CMAKE_MODULE_LINKER_FLAGS_COVERAGE + "${CMAKE_MODULE_LINKER_FLAGS_DEBUG} --coverage") + set(CMAKE_EXE_LINKER_FLAGS_COVERAGE + "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --coverage") + +endif() + # Panda3D is now a C++11 project. Newer versions of CMake support this out of # the box; for older versions we take a shot in the dark: if(CMAKE_VERSION VERSION_LESS "3.1") diff --git a/dtool/Config.cmake b/dtool/Config.cmake index cfe8e7a6c5..5587737cf9 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -35,16 +35,21 @@ a CMake < 3.9. Making a guess if this is a multi-config generator.") endif() # Define the type of build we are setting up. + +set(_configs Standard Release RelWithDebInfo Debug MinSizeRel) +if(DEFINED CMAKE_CXX_FLAGS_COVERAGE) + list(APPEND _configs Coverage) +endif() + if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES Standard Release RelWithDebInfo Debug MinSizeRel) + set(CMAKE_CONFIGURATION_TYPES ${_configs}) else() # CMAKE_BUILD_TYPE can't just be set using the usual set(CACHE) method since # it's an empty string by default. if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Standard) endif() - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - Standard Release RelWithDebInfo Debug MinSizeRel) + set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configs}) endif() # Provide convenient boolean expression based on build type From 10760d5f7aa0c6699925df0c9233c4c689e8c3f5 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 24 Dec 2019 16:16:31 -0700 Subject: [PATCH 710/744] CMake: Properly redetect Python if WANT_PYTHON_VERSION changes --- dtool/Package.cmake | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 004f992c47..a303b88766 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -151,6 +151,27 @@ endfunction(thirdparty_copy_alongside) set(WANT_PYTHON_VERSION "" CACHE STRING "Which Python version to seek out for building Panda3D against.") +if(DEFINED _PREV_WANT_PYTHON_VERSION + AND NOT _PREV_WANT_PYTHON_VERSION STREQUAL WANT_PYTHON_VERSION) + # The user changed WANT_PYTHON_VERSION. We need to force FindPython to start + # anew, deleting any variable that was autodetected last time + foreach(_prev_var ${_PREV_PYTHON_VALUES}) + string(REPLACE "=" ";" _prev_var "${_prev_var}") + list(GET _prev_var 0 _prev_var_name) + list(GET _prev_var 1 _prev_var_sha1) + string(SHA1 _current_var_sha1 "${${_prev_var_name}}") + + if(_prev_var_sha1 STREQUAL _current_var_sha1) + unset(${_prev_var_name} CACHE) + endif() + + endforeach(_prev_var) + + unset(_PREV_PYTHON_VALUES CACHE) + +endif() + +get_directory_property(_old_cache_vars CACHE_VARIABLES) find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development) if(Python_FOUND) @@ -263,6 +284,23 @@ if(HAVE_PYTHON) endif() +if(NOT DEFINED _PREV_PYTHON_VALUES) + # We need to make note of all auto-defined Python variables + set(_prev_python_values) + + get_directory_property(_new_cache_vars CACHE_VARIABLES) + foreach(_cache_var ${_new_cache_vars}) + if(_cache_var MATCHES "^(Python|PYTHON)_" AND NOT _old_cache_vars MATCHES ";${_cache_var};") + string(SHA1 _cache_var_sha1 "${${_cache_var}}") + list(APPEND _prev_python_values "${_cache_var}=${_cache_var_sha1}") + endif() + endforeach(_cache_var) + + set(_PREV_PYTHON_VALUES "${_prev_python_values}" CACHE INTERNAL "Internal." FORCE) +endif() + +set(_PREV_WANT_PYTHON_VERSION "${WANT_PYTHON_VERSION}" CACHE INTERNAL "Internal." FORCE) + # # ------------ Data handling libraries ------------ From cdc16291dd9c999ce68727dc92c77d2cf4d62114 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 24 Dec 2019 17:20:43 -0700 Subject: [PATCH 711/744] CMake: `SKIP_COMPOSITING` -> `SKIP_UNITY_BUILD_INCLUSION` The latter is what CMake (3.16+) itself uses; we should start using CMake's own unity build capabilities if available. --- cmake/macros/CompositeSources.cmake | 2 +- dtool/src/dtoolbase/CMakeLists.txt | 2 +- dtool/src/dtoolutil/CMakeLists.txt | 2 +- panda/src/display/CMakeLists.txt | 2 +- panda/src/dxgsg9/CMakeLists.txt | 2 +- panda/src/grutil/CMakeLists.txt | 2 +- panda/src/pgraph/CMakeLists.txt | 2 +- panda/src/pnmimage/CMakeLists.txt | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 8d33825808..790e5553bf 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -49,7 +49,7 @@ function(composite_sources target sources_var) get_filename_component(extension "${source}" EXT) get_source_file_property(generated "${source}" GENERATED) get_source_file_property(is_header "${source}" HEADER_FILE_ONLY) - get_source_file_property(skip_compositing "${source}" SKIP_COMPOSITING) + get_source_file_property(skip_compositing "${source}" SKIP_UNITY_BUILD_INCLUSION) # Check if we can safely add this to a composite file. if(NOT generated AND NOT is_header AND NOT skip_compositing AND diff --git a/dtool/src/dtoolbase/CMakeLists.txt b/dtool/src/dtoolbase/CMakeLists.txt index 079e6a4e34..aea0a1196f 100644 --- a/dtool/src/dtoolbase/CMakeLists.txt +++ b/dtool/src/dtoolbase/CMakeLists.txt @@ -83,7 +83,7 @@ set(P3DTOOLBASE_IGATEEXT typeHandle_ext.h ) -set_source_files_properties(indent.cxx PROPERTIES SKIP_COMPOSITING YES) +set_source_files_properties(indent.cxx PROPERTIES SKIP_UNITY_BUILD_INCLUSION YES) composite_sources(p3dtoolbase P3DTOOLBASE_SOURCES) add_component_library(p3dtoolbase NOINIT SYMBOL BUILDING_DTOOL_DTOOLBASE diff --git a/dtool/src/dtoolutil/CMakeLists.txt b/dtool/src/dtoolutil/CMakeLists.txt index 0ad93fd8c5..c3a43c319b 100644 --- a/dtool/src/dtoolutil/CMakeLists.txt +++ b/dtool/src/dtoolutil/CMakeLists.txt @@ -34,7 +34,7 @@ if(APPLE) set_source_files_properties( filename_assist.mm filename_assist.h PROPERTIES WRAP_EXCLUDE YES - SKIP_COMPOSITING YES) + SKIP_UNITY_BUILD_INCLUSION YES) endif() set(P3DTOOLUTIL_SOURCES diff --git a/panda/src/display/CMakeLists.txt b/panda/src/display/CMakeLists.txt index 3af8e1bbb2..d2e50e5fc9 100644 --- a/panda/src/display/CMakeLists.txt +++ b/panda/src/display/CMakeLists.txt @@ -91,7 +91,7 @@ if(APPLE) endif() # This is a large file; let's build it separately -set_source_files_properties(graphicsStateGuardian.cxx PROPERTIES SKIP_COMPOSITING YES) +set_source_files_properties(graphicsStateGuardian.cxx PROPERTIES SKIP_UNITY_BUILD_INCLUSION YES) composite_sources(p3display P3DISPLAY_SOURCES) add_component_library(p3display SYMBOL BUILDING_PANDA_DISPLAY diff --git a/panda/src/dxgsg9/CMakeLists.txt b/panda/src/dxgsg9/CMakeLists.txt index 6442a95e76..dd7ad9ff7f 100644 --- a/panda/src/dxgsg9/CMakeLists.txt +++ b/panda/src/dxgsg9/CMakeLists.txt @@ -36,7 +36,7 @@ set(P3DXGSG9_SOURCES ) # This is a large file; let's build it separately -set_source_files_properties(dxGraphicsStateGuardian9.cxx PROPERTIES SKIP_COMPOSITING YES) +set_source_files_properties(dxGraphicsStateGuardian9.cxx PROPERTIES SKIP_UNITY_BUILD_INCLUSION YES) composite_sources(p3dxgsg9 P3DXGSG9_SOURCES) add_component_library(p3dxgsg9 SYMBOL BUILDING_PANDADX diff --git a/panda/src/grutil/CMakeLists.txt b/panda/src/grutil/CMakeLists.txt index 5d3fb2c9a9..bffcce6559 100644 --- a/panda/src/grutil/CMakeLists.txt +++ b/panda/src/grutil/CMakeLists.txt @@ -39,7 +39,7 @@ set(P3GRUTIL_SOURCES ) # This is a large file; let's build it separately -set_source_files_properties(multitexReducer.cxx PROPERTIES SKIP_COMPOSITING YES) +set_source_files_properties(multitexReducer.cxx PROPERTIES SKIP_UNITY_BUILD_INCLUSION YES) composite_sources(p3grutil P3GRUTIL_SOURCES) add_component_library(p3grutil SYMBOL BUILDING_PANDA_GRUTIL diff --git a/panda/src/pgraph/CMakeLists.txt b/panda/src/pgraph/CMakeLists.txt index 178623eb3d..80559490c8 100644 --- a/panda/src/pgraph/CMakeLists.txt +++ b/panda/src/pgraph/CMakeLists.txt @@ -222,7 +222,7 @@ set(P3PGRAPH_IGATEEXT ) # This is a large file; let's build it separately -set_source_files_properties(nodePath.cxx PROPERTIES SKIP_COMPOSITING YES) +set_source_files_properties(nodePath.cxx PROPERTIES SKIP_UNITY_BUILD_INCLUSION YES) composite_sources(p3pgraph P3PGRAPH_SOURCES) add_component_library(p3pgraph SYMBOL BUILDING_PANDA_PGRAPH diff --git a/panda/src/pnmimage/CMakeLists.txt b/panda/src/pnmimage/CMakeLists.txt index e22656a41d..8c6e17abac 100644 --- a/panda/src/pnmimage/CMakeLists.txt +++ b/panda/src/pnmimage/CMakeLists.txt @@ -35,7 +35,7 @@ set(P3PNMIMAGE_IGATEEXT if(HAVE_SSE2 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND CMAKE_SYSTEM_PROCESSOR MATCHES "86") # It's only necessary to do this on 32-bit x86; 64-bit makes SSE2 builtin. set_source_files_properties(convert_srgb_sse2.cxx PROPERTIES - SKIP_COMPOSITING YES + SKIP_UNITY_BUILD_INCLUSION YES COMPILE_FLAGS -msse2) endif() From 74e9c610d311548e3ed8342357f3ecdf9d0d118e Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 31 Dec 2019 01:03:52 -0700 Subject: [PATCH 712/744] CMake: Don't assume _FOUND will always be caps This is more consistent with the new find_package() behavior, especially when CONFIG mode is involved. --- cmake/macros/PackageConfig.cmake | 30 ++++++++----- dtool/Package.cmake | 72 ++++++++++++++++---------------- 2 files changed, 55 insertions(+), 47 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 6c615376d5..574ef3f8b3 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -76,6 +76,8 @@ function(package_option name) set(license "") set(cache_string) + string(TOUPPER "${name}" name) + foreach(arg ${ARGN}) if(command STREQUAL "DEFAULT") set(default "${arg}") @@ -207,16 +209,26 @@ function(package_option name) endforeach(implib) if(use_variables) - if(${found_as}_INCLUDE_DIRS) + string(TOUPPER "${found_as}" FOUND_AS) + + if(DEFINED ${found_as}_INCLUDE_DIRS) set(includes ${${found_as}_INCLUDE_DIRS}) - else() + elseif(DEFINED ${found_as}_INCLUDE_DIR) set(includes "${${found_as}_INCLUDE_DIR}") + elseif(DEFINED ${FOUND_AS}_INCLUDE_DIRS) + set(includes ${${FOUND_AS}_INCLUDE_DIRS}) + else() + set(includes "${${FOUND_AS}_INCLUDE_DIR}") endif() - if(${found_as}_LIBRARIES) + if(DEFINED ${found_as}_LIBRARIES) set(libs ${${found_as}_LIBRARIES}) - else() + elseif(DEFINED ${found_as}_LIBRARY) set(libs "${${found_as}_LIBRARY}") + elseif(DEFINED ${FOUND_AS}_LIBRARIES) + set(libs ${${FOUND_AS}_LIBRARIES}) + else() + set(libs "${${FOUND_AS}_LIBRARY}") endif() target_link_libraries(PKG::${name} INTERFACE ${libs}) @@ -239,6 +251,8 @@ function(package_status name desc) set(note "${arg}") endforeach() + string(TOUPPER "${name}" name) + if(NOT ";${_ALL_PACKAGE_OPTIONS};" MATCHES ";${name};") message(SEND_ERROR "package_status(${name}) was called before package_option(${name}). This is a bug in the cmake build scripts.") @@ -481,18 +495,12 @@ macro(find_package name) _find_package(${ARGV}) else() - string(TOUPPER "${name}" __pkgname_upper) - # Try CONFIG _find_package("${name}" CONFIG ${ARGN}) + if(NOT ${name}_FOUND) # CONFIG didn't work, fall back to MODULE _find_package("${name}" MODULE ${ARGN}) - - else() - # Case-sensitivity - set(${__pkgname_upper}_FOUND 1) - endif() endif() endmacro(find_package) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index a303b88766..f563ac558e 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -226,7 +226,7 @@ if(CMAKE_VERSION VERSION_LESS "3.15") endif() -package_option(PYTHON +package_option(Python DEFAULT ON "Enables support for Python. If INTERROGATE_PYTHON_INTERFACE is also enabled, Python bindings will be generated." @@ -309,7 +309,7 @@ set(_PREV_WANT_PYTHON_VERSION "${WANT_PYTHON_VERSION}" CACHE INTERNAL "Internal. # OpenSSL find_package(OpenSSL COMPONENTS SSL Crypto QUIET) -package_option(OPENSSL +package_option(OpenSSL DEFAULT ON "Enable OpenSSL support" IMPORTED_AS OpenSSL::SSL OpenSSL::Crypto) @@ -319,9 +319,9 @@ option(REPORT_OPENSSL_ERRORS error messages when they occur." ${IS_DEBUG_BUILD}) if(REPORT_OPENSSL_ERRORS) - package_status(OPENSSL "OpenSSL" "with verbose error reporting") + package_status(OpenSSL "OpenSSL" "with verbose error reporting") else() - package_status(OPENSSL "OpenSSL") + package_status(OpenSSL "OpenSSL") endif() # zlib @@ -364,16 +364,16 @@ package_status(TIFF "libtiff") # OpenEXR find_package(OpenEXR QUIET) -package_option(OPENEXR "Enable support for loading .exr images.") +package_option(OpenEXR "Enable support for loading .exr images.") -package_status(OPENEXR "OpenEXR") +package_status(OpenEXR "OpenEXR") # libsquish find_package(LibSquish QUIET) package_option(SQUISH "Enables support for automatic compression of DXT textures." - FOUND_AS LIBSQUISH) + FOUND_AS LibSquish) package_status(SQUISH "libsquish") @@ -385,19 +385,19 @@ package_status(SQUISH "libsquish") # Assimp find_package(Assimp QUIET) -package_option(ASSIMP +package_option(Assimp "Build pandatool with support for loading 3D assets supported by Assimp.") -package_status(ASSIMP "Assimp") +package_status(Assimp "Assimp") # FCollada find_package(FCollada QUIET) -package_option(FCOLLADA +package_option(FCollada "Build pandatool with support for loading Collada files using FCollada." IMPORTED_AS FCollada::FCollada) -package_status(FCOLLADA "FCollada") +package_status(FCollada "FCollada") # @@ -414,7 +414,7 @@ implementation of its own linmath library; otherwise, it will use its own internal implementation. The primary advantage of using Eigen is SSE2 support, which is only activated if LINMATH_ALIGN is also enabled." - FOUND_AS EIGEN3 + FOUND_AS Eigen3 LICENSE "MPL-2") option(LINMATH_ALIGN @@ -456,9 +456,9 @@ find_package(SWResample QUIET) package_option(FFMPEG "Enables support for audio- and video-decoding using the FFmpeg library.") -package_option(SWSCALE +package_option(SWScale "Enables support for FFmpeg's libswscale for video rescaling.") -package_option(SWRESAMPLE +package_option(SWResample "Enables support for FFmpeg's libresample for audio resampling.") if(HAVE_SWSCALE AND HAVE_SWRESAMPLE) @@ -476,7 +476,7 @@ package_status(FFMPEG "FFmpeg" "${ffmpeg_features}") find_package(VorbisFile QUIET) package_option(VORBIS - FOUND_AS VORBISFILE + FOUND_AS VorbisFile "Enables support for decoding Vorbis-encoded .ogg audio files via libvorbisfile.") package_status(VORBIS "Vorbis") @@ -485,7 +485,7 @@ package_status(VORBIS "Vorbis") find_package(OpusFile QUIET) package_option(OPUS - FOUND_AS OPUSFILE + FOUND_AS OpusFile "Enables support for decoding .opus audio files via libopusfile.") package_status(OPUS "Opus") @@ -497,27 +497,27 @@ package_status(OPUS "Opus") # FMOD Ex find_package(FMODEx QUIET) -package_option(FMODEX +package_option(FMODEx "This enables support for the FMOD Ex sound library, from Firelight Technologies. This audio library is free for non-commercial use." LICENSE "FMOD") -package_status(FMODEX "FMOD Ex sound library") +package_status(FMODEx "FMOD Ex sound library") # OpenAL find_package(OpenAL QUIET) -package_option(OPENAL +package_option(OpenAL "This enables support for audio output via OpenAL. Some platforms, such as macOS, provide their own OpenAL implementation, which Panda3D can use. But, on most platforms this will imply OpenAL Soft, which is LGPL licensed." IMPORTED_AS OpenAL::OpenAL LICENSE "LGPL") -package_status(OPENAL "OpenAL sound library") +package_status(OpenAL "OpenAL sound library") -if(OPENAL_FOUND AND APPLE) +if(OpenAL_FOUND AND APPLE OR OPENAL_FOUND AND APPLE) set(HAVE_OPENAL_FRAMEWORK YES) endif() @@ -530,12 +530,12 @@ endif() find_package(Freetype QUIET) -package_option(FREETYPE +package_option(Freetype "This enables support for the FreeType font-rendering library. If disabled, Panda3D will only be able to read fonts specially made with egg-mkfont." IMPORTED_AS freetype) -package_status(FREETYPE "FreeType") +package_status(Freetype "FreeType") # HarfBuzz @@ -543,11 +543,11 @@ package_status(FREETYPE "FreeType") # force MODULE mode here. find_package(HarfBuzz MODULE QUIET) -package_option(HARFBUZZ +package_option(HarfBuzz "This enables support for the HarfBuzz text shaping library." IMPORTED_AS harfbuzz::harfbuzz) -package_status(HARFBUZZ "HarfBuzz") +package_status(HarfBuzz "HarfBuzz") # GTK2 @@ -567,10 +567,10 @@ package_status(GTK2 "gtk+-2") # Bullet find_package(Bullet MODULE QUIET) -package_option(BULLET +package_option(Bullet "Enable this option to support game dynamics with the Bullet physics library.") -package_status(BULLET "Bullet physics") +package_status(Bullet "Bullet physics") # ODE find_package(ODE QUIET) @@ -585,11 +585,11 @@ package_status(ODE "Open Dynamics Engine") # PhysX find_package(PhysX QUIET) -package_option(PHYSX +package_option(PhysX "Enable this option to support game dynamics with Nvidia PhysX." LICENSE "Nvidia") -package_status(PHYSX "Nvidia PhysX") +package_status(PhysX "Nvidia PhysX") # @@ -599,11 +599,11 @@ package_status(PHYSX "Nvidia PhysX") # SpeedTree find_package(SpeedTree QUIET) -package_option(SPEEDTREE +package_option(SpeedTree "Enable this option to include scenegraph support for SpeedTree trees." LICENSE "SpeedTree") -package_status(SPEEDTREE "SpeedTree") +package_status(SpeedTree "SpeedTree") # @@ -647,7 +647,7 @@ find_package(Direct3D9 QUIET COMPONENTS dxguid dxerr d3dx9) package_option(DX9 "Enable support for DirectX 9. This is typically only viable on Windows." - FOUND_AS DIRECT3D9) + FOUND_AS Direct3D9) package_status(DX9 "Direct3D 9.x") @@ -728,11 +728,11 @@ package_status(EGL "EGL") # OpenCV find_package(OpenCV QUIET COMPONENTS core highgui OPTIONAL_COMPONENTS videoio) -package_option(OPENCV +package_option(OpenCV "Enable support for OpenCV. This will be built into the 'vision' package." FOUND_AS OpenCV) -package_status(OPENCV "OpenCV") +package_status(OpenCV "OpenCV") # CMake <3.7 doesn't support GREATER_EQUAL, so this uses NOT LESS instead. if(NOT OpenCV_VERSION_MAJOR LESS 3) @@ -747,10 +747,10 @@ endif() # ARToolKit find_package(ARToolKit QUIET) -package_option(ARTOOLKIT +package_option(ARToolKit "Enable support for ARToolKit. This will be built into the 'vision' package.") -package_status(ARTOOLKIT "ARToolKit") +package_status(ARToolKit "ARToolKit") # From b00d7b23bc6321deadcdee7ffd6050b9c8442091 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 24 Dec 2019 19:17:23 -0700 Subject: [PATCH 713/744] CMake: Use `CMAKE_FIND_PACKAGE_PREFER_CONFIG` to control `find_package` override --- cmake/macros/PackageConfig.cmake | 38 ++++++++++++++++++-------------- dtool/CompilerFlags.cmake | 1 + 2 files changed, 22 insertions(+), 17 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 574ef3f8b3..8039039e1b 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -483,24 +483,28 @@ endfunction(export_targets) # # find_package # -# This override is necessary because CMake's default behavior is to run -# find_package in MODULE mode, *then* in CONFIG mode. This is silly! CONFIG -# mode makes more sense to be done first, since any system config file will -# know vastly more about the package's configuration than a module can hope to -# guess. +# This override implements CMAKE_FIND_PACKAGE_PREFER_CONFIG on versions of +# CMake too old to include it. # -macro(find_package name) - if(";${ARGN};" MATCHES ";(CONFIG|MODULE|NO_MODULE);") - # Caller explicitly asking for a certain mode; so be it. - _find_package(${ARGV}) +if(CMAKE_VERSION VERSION_LESS "3.15") + macro(find_package name) + if(";${ARGN};" MATCHES ";(CONFIG|MODULE|NO_MODULE);") + # Caller explicitly asking for a certain mode; so be it. + _find_package(${ARGV}) - else() - # Try CONFIG - _find_package("${name}" CONFIG ${ARGN}) + elseif(CMAKE_FIND_PACKAGE_PREFER_CONFIG) + # Try CONFIG + _find_package("${name}" CONFIG ${ARGN}) + + if(NOT ${name}_FOUND) + # CONFIG didn't work, fall back to MODULE + _find_package("${name}" MODULE ${ARGN}) + endif() + + else() + # Default behavior + _find_package(${ARGV}) - if(NOT ${name}_FOUND) - # CONFIG didn't work, fall back to MODULE - _find_package("${name}" MODULE ${ARGN}) endif() - endif() -endmacro(find_package) + endmacro(find_package) +endif() diff --git a/dtool/CompilerFlags.cmake b/dtool/CompilerFlags.cmake index 18f611352c..a947d50927 100644 --- a/dtool/CompilerFlags.cmake +++ b/dtool/CompilerFlags.cmake @@ -67,6 +67,7 @@ endif() # Set certain CMake flags we expect set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) +set(CMAKE_FIND_PACKAGE_PREFER_CONFIG ON) # Set up the output directory structure, mimicking that of makepanda set(CMAKE_BINARY_DIR "${CMAKE_BINARY_DIR}/cmake") From 15c7e6fbe593bebbbd4279e8646688da31379951 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 27 Dec 2019 23:19:13 -0700 Subject: [PATCH 714/744] CMake: Rename COMPOSITE_* to CMAKE_UNITY_BUILD* where appropriate This allows us to use 3.16+ unity build support when available, falling back to our own stuff when not. --- cmake/macros/CompositeSources.cmake | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index 790e5553bf..a624cebfb6 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -15,10 +15,13 @@ # Settings for composite builds. Should be moved to Config.cmake? -set(COMPOSITE_SOURCE_LIMIT "30" CACHE STRING - "Setting this to a value higher than 1 will enable unity builds, also -known as SCU (single compilation unit). A high value will speed up the -build dramatically but will be more memory intensive than a low value.") +set(CMAKE_UNITY_BUILD "ON" CACHE BOOL + "Enable unity builds; Panda defaults this to on.") + +set(CMAKE_UNITY_BUILD_BATCH_SIZE "30" CACHE STRING + "How many source files to build at a time through the unity build mechanism. + A high value will speed up the build dramatically but will be more memory + intensive than a low value.") set(COMPOSITE_SOURCE_EXTENSIONS ".cxx;.mm;.c" CACHE STRING "Only files of these extensions will be composited.") @@ -32,6 +35,16 @@ set(COMPOSITE_GENERATOR "${CMAKE_SOURCE_DIR}/cmake/scripts/MakeComposite.cmake") # Define composite_sources() function(composite_sources target sources_var) + if(NOT CMAKE_VERSION VERSION_LESS "3.16") + # CMake 3.16+ implements CMAKE_UNITY_BUILD* natively; no need to continue! + return() + endif() + + if(NOT CMAKE_UNITY_BUILD) + # We've been turned off + return() + endif() + # How many sources were specified? set(orig_sources ${${sources_var}}) set(sources ${orig_sources}) @@ -40,7 +53,7 @@ function(composite_sources target sources_var) # Don't composite if in the list of exclusions, and don't bother compositing # with too few sources list (FIND COMPOSITE_SOURCE_EXCLUSIONS ${target} _index) - if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2 OR ${_index} GREATER -1) + if(num_sources LESS 2 OR ${CMAKE_UNITY_BUILD_BATCH_SIZE} LESS 2 OR ${_index} GREATER -1) return() endif() @@ -100,7 +113,7 @@ function(composite_sources target sources_var) endif() # Check if this is the point where we should cut the file. - if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${COMPOSITE_SOURCE_LIMIT} + if(num_sources EQUAL 0 OR NOT num_composite_sources LESS ${CMAKE_UNITY_BUILD_BATCH_SIZE} OR NOT composite_ext STREQUAL next_extension) # It's pointless to make a composite source from just one file. if(num_composite_sources GREATER 1) From bff568798f5126b3df7e7d50ac4bd0f688b3ca42 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 31 Dec 2019 06:59:39 -0700 Subject: [PATCH 715/744] CMake: Make FindAssimp pull in libIrrXML as well, if found --- cmake/modules/FindAssimp.cmake | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/cmake/modules/FindAssimp.cmake b/cmake/modules/FindAssimp.cmake index 9535a3f489..2a73babc9b 100644 --- a/cmake/modules/FindAssimp.cmake +++ b/cmake/modules/FindAssimp.cmake @@ -7,16 +7,27 @@ # 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 +# ASSIMP_LIBRARIES - the libraries to link against for Assimp # find_path(ASSIMP_INCLUDE_DIR NAMES "assimp/Importer.hpp") -find_library(ASSIMP_LIBRARY +find_library(ASSIMP_ASSIMP_LIBRARY NAMES "assimp") -mark_as_advanced(ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY) +find_library(ASSIMP_IRRXML_LIBRARY + NAMES "IrrXML") + +if(ASSIMP_ASSIMP_LIBRARY) + set(ASSIMP_LIBRARIES "${ASSIMP_ASSIMP_LIBRARY}") + + if(ASSIMP_IRRXML_LIBRARY) + list(APPEND ASSIMP_LIBRARIES "${ASSIMP_IRRXML_LIBRARY}") + endif() +endif() + +mark_as_advanced(ASSIMP_INCLUDE_DIR ASSIMP_LIBRARIES) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARY) +find_package_handle_standard_args(Assimp DEFAULT_MSG ASSIMP_INCLUDE_DIR ASSIMP_LIBRARIES) From f92b88f35b5504b9bc931f0648591cd84dd37606 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 1 Jan 2020 05:55:08 -0700 Subject: [PATCH 716/744] CMake: Omit Interrogate-generated sources from unity builds This fixes an include path error when building under a multi-configuration generator and with CMake 3.16+ --- cmake/macros/Interrogate.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 17d16d10ca..9001d05ff1 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -363,6 +363,15 @@ function(add_python_module module) DEPENDS host_interrogate_module ${infiles_abs} COMMENT "Generating module ${module}") + # CMake chokes on ${CMAKE_CFG_INTDIR} in source paths when unity builds are + # enabled. The easiest way out of this is to skip unity for those paths. + # Since generated Interrogate .cxx files are pretty big already, this doesn't + # really inconvenience us at all. + set_source_files_properties( + "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" + ${sources_abs} PROPERTIES + SKIP_UNITY_BUILD_INCLUSION YES) + add_python_target(${module} COMPONENT "${component}" EXPORT "${component}" "${CMAKE_CURRENT_BINARY_DIR}/${PANDA_CFG_INTDIR}/${module}_module.cxx" ${sources_abs} ${extensions}) From c39bda57a07a2fba44f536539653074f17662675 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Thu, 2 Jan 2020 00:46:02 -0700 Subject: [PATCH 717/744] CMake: On Apple, silence build-time OpenGL deprecation warnings --- panda/src/glstuff/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panda/src/glstuff/CMakeLists.txt b/panda/src/glstuff/CMakeLists.txt index dc5840d96e..016dafa81a 100644 --- a/panda/src/glstuff/CMakeLists.txt +++ b/panda/src/glstuff/CMakeLists.txt @@ -37,6 +37,12 @@ composite_sources(p3glstuff P3GLSTUFF_SOURCES) add_component_library(p3glstuff NOINIT ${P3GLSTUFF_HEADERS} ${P3GLSTUFF_SOURCES}) target_link_libraries(p3glstuff panda) +if(APPLE) + # We acknowledge Apple's hostility to open standards so that the SDK won't + # bother our users about it. + target_compile_definitions(p3glstuff PUBLIC GL_SILENCE_DEPRECATION) +endif() + if(NOT BUILD_METALIBS) install(TARGETS p3glstuff EXPORT OpenGL COMPONENT OpenGL From b739919fe473add0deba389de2b15b6b246155e7 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 3 Jan 2020 09:30:26 -0700 Subject: [PATCH 718/744] CMake: Update FindFFMPEG to locate static ffmpeg dependencies too --- cmake/modules/FindFFMPEG.cmake | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/cmake/modules/FindFFMPEG.cmake b/cmake/modules/FindFFMPEG.cmake index 649f2b80e2..88a0021be6 100644 --- a/cmake/modules/FindFFMPEG.cmake +++ b/cmake/modules/FindFFMPEG.cmake @@ -85,6 +85,31 @@ if(FFMPEG_LIBAVUTIL) list(APPEND FFMPEG_LIBRARIES "${FFMPEG_LIBAVUTIL}") endif() +if(APPLE) + # When statically built for Apple, FFMPEG may have dependencies on these + # additional frameworks and libraries. + + find_library(APPLE_COREVIDEO_LIBRARY CoreVideo) + if(APPLE_COREVIDEO_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_COREVIDEO_LIBRARY}") + endif() + + find_library(APPLE_VDA_LIBRARY VideoDecodeAcceleration) + if(APPLE_VDA_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_VDA_LIBRARY}") + endif() + + find_library(APPLE_ICONV_LIBRARY iconv) + if(APPLE_ICONV_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_ICONV_LIBRARY}") + endif() + + find_library(APPLE_BZ2_LIBRARY bz2) + if(APPLE_BZ2_LIBRARY) + list(APPEND FFMPEG_LIBRARIES "${APPLE_BZ2_LIBRARY}") + endif() +endif() + mark_as_advanced(FFMPEG_LIBRARY_DIR) include(FindPackageHandleStandardArgs) From e08896deb71b726164e8c12b3760e2a0e1fc62ee Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 6 Jan 2020 13:23:22 -0700 Subject: [PATCH 719/744] CMake: Update panda3d/__init__.py - Python 2.7 EOL warning is now past tense - Use os.add_dll_directory() when available (instead of hacking up PATH) --- cmake/templates/win32_python/__init__.py | 11 +++++++---- panda/CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/cmake/templates/win32_python/__init__.py b/cmake/templates/win32_python/__init__.py index 8228db8f46..758478f46b 100644 --- a/cmake/templates/win32_python/__init__.py +++ b/cmake/templates/win32_python/__init__.py @@ -11,10 +11,13 @@ def _fixup_dlls(): if not os.path.isdir(dll_path): return - os_path = os.environ.get('PATH', '') - os_path = os_path.split(os.pathsep) if os_path else [] - os_path.insert(0, dll_path) - os.environ['PATH'] = os.pathsep.join(os_path) + if hasattr(os, 'add_dll_directory'): + os.add_dll_directory(dll_path) + else: + os_path = os.environ.get('PATH', '') + os_path = os_path.split(os.pathsep) if os_path else [] + os_path.insert(0, dll_path) + os.environ['PATH'] = os.pathsep.join(os_path) _fixup_dlls() del _fixup_dlls diff --git a/panda/CMakeLists.txt b/panda/CMakeLists.txt index 6535b42e72..a545ef14bd 100644 --- a/panda/CMakeLists.txt +++ b/panda/CMakeLists.txt @@ -122,7 +122,7 @@ if __debug__: import sys if sys.version_info < (3, 0): sys.stderr.write('''\\ -WARNING: Python 2.7 will reach EOL after December 31, 2019. +WARNING: Python 2.7 has reached EOL as of January 1, 2020. To suppress this warning, upgrade to Python 3. ''') sys.stdout.flush() From 4aff60392586310fd4d5973574dc381592bb08eb Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Mon, 6 Jan 2020 17:17:17 -0700 Subject: [PATCH 720/744] general: Reset back to master's travis, add CMake jobs to ci.yml --- .github/workflows/ci.yml | 330 +++++++++++++++++++++++++++++++++++++++ .travis.yml | 92 ++--------- 2 files changed, 344 insertions(+), 78 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e0e50f0467..7f173f531e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,6 +1,336 @@ name: Continuous Integration on: [push, pull_request] + jobs: + cmake: + name: CMake Buildsystem + + strategy: + fail-fast: false + + matrix: + profile: + - ubuntu-xenial-standard-unity-makefile + - ubuntu-bionic-coverage-ninja + - macos-eigen-coverage-unity-xcode + - macos-nometa-standard-makefile + - windows-standard-unity-msvc + - windows-nopython-nometa-standard-msvc + + include: + - profile: ubuntu-xenial-standard-unity-makefile + os: ubuntu-16.04 + config: Standard + unity: YES + generator: Unix Makefiles + compiler: Default + metalibs: YES + python: YES + eigen: NO + + - profile: ubuntu-bionic-coverage-ninja + os: ubuntu-18.04 + config: Coverage + unity: NO + generator: Ninja + compiler: Clang + metalibs: YES + python: YES + eigen: NO + + - profile: macos-eigen-coverage-unity-xcode + os: macOS-10.14 + config: Coverage + unity: YES + generator: Xcode + compiler: Default + metalibs: YES + python: YES + eigen: YES + + - profile: macos-nometa-standard-makefile + os: macOS-10.14 + config: Standard + unity: NO + generator: Unix Makefiles + compiler: Default + metalibs: NO + python: YES + eigen: NO + + - profile: windows-standard-unity-msvc + os: windows-2019 + config: Standard + unity: NO # FIXME when GH Actions runners upgrade CMake to >=3.16.1 + generator: Visual Studio 16 2019 + compiler: Default + metalibs: YES + python: YES + eigen: NO + + - profile: windows-nopython-nometa-standard-msvc + os: windows-2019 + config: Standard + unity: NO + generator: Visual Studio 16 2019 + compiler: Default + metalibs: NO + python: NO + eigen: NO + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 10 + + - name: Self-destruct makepanda + run: python makepanda/selfdestruct.py --yes + + - name: Install dependencies (macOS) + if: runner.os == 'macOS' + run: | + curl -O https://www.panda3d.org/download/panda3d-1.10.5/panda3d-1.10.5-tools-mac.tar.gz + tar -xf panda3d-1.10.5-tools-mac.tar.gz + + echo "##[set-env name=thirdpartyOption;]-D THIRDPARTY_DIRECTORY=../panda3d-1.10.5/thirdparty" -DHAVE_CG=OFF + + - name: Install dependencies (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') + run: > + sudo apt-get update + + sudo apt-get install + build-essential ninja-build clang llvm + bison flex + libeigen3-dev libfreetype6-dev libgl1-mesa-dev libjpeg-dev libode-dev + libopenal-dev libpng-dev libssl-dev libvorbis-dev libx11-dev + libxcursor-dev libxrandr-dev nvidia-cg-toolkit zlib1g-dev + + # Workaround for CMake 3.12 finding this first: + + sudo rm /usr/bin/x86_64-linux-gnu-python2.7-config + + - name: Cache dependencies (Windows) + if: runner.os == 'Windows' + uses: actions/cache@v1 + with: + path: thirdparty-tools + key: ci-cmake-${{ runner.OS }}-thirdparty-v1.10.5-r1 + - name: Install dependencies (Windows) + if: runner.os == 'Windows' + shell: powershell + run: | + if (!(Test-Path thirdparty-tools/panda3d-1.10.5)) { + $wc = New-Object System.Net.WebClient + $wc.DownloadFile("https://www.panda3d.org/download/panda3d-1.10.5/panda3d-1.10.5-tools-win64.zip", "thirdparty-tools.zip") + Expand-Archive -Path thirdparty-tools.zip + } + + echo "##[set-env name=thirdpartyOption;]-D THIRDPARTY_DIRECTORY=../thirdparty-tools/panda3d-1.10.5/thirdparty" + + - name: Configure + shell: bash + env: + CMAKE_GENERATOR: "${{ matrix.generator }}" + run: > + mkdir build + + cd build + + if ${{ matrix.compiler == 'Clang' }}; then + if [[ "$CMAKE_GENERATOR" == *Studio*2019* ]]; then + export CMAKE_GENERATOR_TOOLSET=ClangCL thirdpartyOption="$thirdpartyOption -DHAVE_HARFBUZZ=NO" + elif [[ "$CMAKE_GENERATOR" == *Studio* ]]; then + export CMAKE_GENERATOR_TOOLSET=LLVM thirdpartyOption="$thirdpartyOption -DHAVE_HARFBUZZ=NO" + else + export CC=clang CXX=clang++ + fi + fi + + cmake + -D CMAKE_UNITY_BUILD=${{ matrix.unity }} + -D CMAKE_BUILD_TYPE="${{ matrix.config }}" + -D BUILD_METALIBS=${{ matrix.metalibs }} + -D HAVE_PYTHON=${{ matrix.python }} + -D HAVE_EIGEN=${{ matrix.eigen }} + ${thirdpartyOption:-} + .. + + - name: Build (no Python) + if: contains(matrix.python, 'NO') + # BEGIN A + working-directory: build + run: cmake --build . --config ${{ matrix.config }} + # END A + + - name: Setup Python (Python 2.7) + if: contains(matrix.python, 'YES') + uses: actions/setup-python@v1 + with: + python-version: 2.7 + - name: Configure (Python 2.7) + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: > + cmake -DWANT_PYTHON_VERSION=2.7 + -DPython_FIND_REGISTRY=NEVER -DPython_ROOT=$pythonLocation . + - name: Build (Python 2.7) + if: contains(matrix.python, 'YES') + # BEGIN A + working-directory: build + run: cmake --build . --config ${{ matrix.config }} + # END A + - name: Test (Python 2.7) + # BEGIN B + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: | + PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:FILEPATH' CMakeCache.txt | sed 's/.*=//') + $PYTHON_EXECUTABLE -m pip install pytest pytest-cov + export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw + ctest -V -C ${{ matrix.config }} + # END B + + - name: Setup Python (Python 3.5) + if: contains(matrix.python, 'YES') + uses: actions/setup-python@v1 + with: + python-version: 3.5 + - name: Configure (Python 3.5) + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: > + cmake -DWANT_PYTHON_VERSION=3.5 + -DPython_FIND_REGISTRY=NEVER -DPython_ROOT=$pythonLocation . + - name: Build (Python 3.5) + if: contains(matrix.python, 'YES') + # BEGIN A + working-directory: build + run: cmake --build . --config ${{ matrix.config }} + # END A + - name: Test (Python 3.5) + # BEGIN B + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: | + PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:FILEPATH' CMakeCache.txt | sed 's/.*=//') + $PYTHON_EXECUTABLE -m pip install pytest pytest-cov + export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw + ctest -V -C ${{ matrix.config }} + # END B + + - name: Setup Python (Python 3.6) + if: contains(matrix.python, 'YES') + uses: actions/setup-python@v1 + with: + python-version: 3.6 + - name: Configure (Python 3.6) + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: > + cmake -DWANT_PYTHON_VERSION=3.6 + -DPython_FIND_REGISTRY=NEVER -DPython_ROOT=$pythonLocation . + - name: Build (Python 3.6) + if: contains(matrix.python, 'YES') + # BEGIN A + working-directory: build + run: cmake --build . --config ${{ matrix.config }} + # END A + - name: Test (Python 3.6) + # BEGIN B + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: | + PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:FILEPATH' CMakeCache.txt | sed 's/.*=//') + $PYTHON_EXECUTABLE -m pip install pytest pytest-cov + export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw + ctest -V -C ${{ matrix.config }} + # END B + + - name: Setup Python (Python 3.7) + if: contains(matrix.python, 'YES') + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: Configure (Python 3.7) + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: > + cmake -DWANT_PYTHON_VERSION=3.7 + -DPython_FIND_REGISTRY=NEVER -DPython_ROOT=$pythonLocation . + - name: Build (Python 3.7) + if: contains(matrix.python, 'YES') + # BEGIN A + working-directory: build + run: cmake --build . --config ${{ matrix.config }} + # END A + - name: Test (Python 3.7) + # BEGIN B + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: | + PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:FILEPATH' CMakeCache.txt | sed 's/.*=//') + $PYTHON_EXECUTABLE -m pip install pytest pytest-cov + export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw + ctest -V -C ${{ matrix.config }} + # END B + + - name: Setup Python (Python 3.8) + if: contains(matrix.python, 'YES') + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Configure (Python 3.8) + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: > + cmake -DWANT_PYTHON_VERSION=3.8 + -DPython_FIND_REGISTRY=NEVER -DPython_ROOT=$pythonLocation . + - name: Build (Python 3.8) + if: contains(matrix.python, 'YES') + # BEGIN A + working-directory: build + run: cmake --build . --config ${{ matrix.config }} + # END A + - name: Test (Python 3.8) + # BEGIN B + if: contains(matrix.python, 'YES') + working-directory: build + shell: bash + run: | + PYTHON_EXECUTABLE=$(grep 'Python_EXECUTABLE:FILEPATH' CMakeCache.txt | sed 's/.*=//') + $PYTHON_EXECUTABLE -m pip install pytest pytest-cov + export COVERAGE_FILE=.coverage.$RANDOM LLVM_PROFILE_FILE=$PWD/pid-%p.profraw + ctest -V -C ${{ matrix.config }} + # END B + + - name: Upload coverage reports + if: always() && matrix.config == 'Coverage' + working-directory: build + shell: bash + env: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + run: | + shopt -s expand_aliases + if ${{ runner.os == 'macOS' }}; then alias llvm-profdata='xcrun llvm-profdata' llvm-cov='xcrun llvm-cov'; fi + + python -m coverage combine $(find . -name '.coverage.*') + + llvm-profdata merge pid-*.profraw -o coverage.profdata + llvm-cov show $(grep -Rl LLVM_PROFILE_FILE . | sed 's/^/-object /') -instr-profile=coverage.profdata > coverage.txt + bash <(curl -s https://codecov.io/bash) + makepanda: strategy: matrix: diff --git a/.travis.yml b/.travis.yml index 13153b7c3c..ee9b09d37e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,28 +1,18 @@ language: cpp sudo: false - -cache: ccache - -# Build matrix: -os: -- linux -- osx -compiler: -- clang -env: -- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 -- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 PYTHON_INTERP=python2.7 -- BUILD_METALIBS=OFF COMPOSITE_SOURCE_LIMIT=30 -- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 matrix: - exclude: - - os: osx - env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=0 include: - - os: osx - env: BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 COMPOSITE_SOURCE_EXCLUSIONS='p3showbase;p3dtoolutil;p3cocoadisplay;p3osxdisplay;p3tinydisplay;p3display' + - compiler: clang + env: PYTHONV=python3 FLAGS=--installer + - compiler: clang + env: PYTHONV=python2.7 FLAGS=--override=STDFLOAT_DOUBLE=1 - compiler: gcc - + env: PYTHONV=python2.7 FLAGS=--optimize=4 + before_install: + - export CC=gcc-4.7 + - export CXX=g++-4.7 + - compiler: clang + env: PYTHONV=python3 FLAGS=--no-python SKIP_TESTS=1 addons: apt: sources: @@ -32,10 +22,6 @@ addons: - g++-4.7 - bison - flex - - libavcodec-dev - - libavformat-dev - - libavresample-dev - - libavutil-dev - libfreetype6-dev - libgl1-mesa-dev - libjpeg-dev @@ -43,7 +29,6 @@ addons: - libopenal-dev - libpng-dev - libssl-dev - - libswscale-dev - libvorbis-dev - libx11-dev - libxcursor-dev @@ -51,64 +36,15 @@ addons: - nvidia-cg-toolkit - python-dev - python3-dev - - python3-pip - python-virtualenv - zlib1g-dev - fakeroot - -before_install: -# clean up remnants of makepanda -- makepanda/selfdestruct.py --yes - install: -- > - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - brew install python@3 eigen libsquish zlib ffmpeg freetype \ - bullet opencv assimp libvorbis openssl ccache || true - brew install ode --with-shared - - # We can't trust brew to make the right symlinks, so execute commands as modules - ${PYTHON_INTERP:-python3} -m pip install virtualenv - ${PYTHON_INTERP:-python3} -m virtualenv venv - else - virtualenv --python=${PYTHON_INTERP:-python3} venv - fi -- source venv/bin/activate -- pip install pytest - -before_script: -- mkdir built -- cd built - + - virtualenv --python=$PYTHONV venv && source venv/bin/activate + - $PYTHONV -m pip install pytest script: -# This is kind of a hack, but needed to test non-metalib builds (until -# interrogate has a way of explicitly calling init_libpanda) -- '[ "x$BUILD_METALIBS" == "xON" -o "x$TRAVIS_OS_NAME" == "xosx" ] || export LDFLAGS=-Wl,--no-as-needed' - -- > - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - if [[ "$PYTHON_INTERP" == "python2.7" ]]; then - export PY2_CMAKE_ARGS=-DPYTHON_EXECUTABLE=/usr/local/Frameworks/Python.framework/Versions/2.7/bin/python - fi - - cmake -DBUILD_METALIBS=$BUILD_METALIBS \ - -DWANT_PYTHON_VERSION=$(python -V 2>&1 | cut -d' ' -f2) \ - -DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache \ - -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ - -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT \ - -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl $PY2_CMAKE_ARGS .. - else - cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS \ - -DWANT_PYTHON_VERSION=$(python -V 2>&1 | cut -d' ' -f2) \ - -DCMAKE_{C,CXX}_COMPILER_LAUNCHER=ccache \ - -DCOMPOSITE_SOURCE_EXCLUSIONS="$COMPOSITE_SOURCE_EXCLUSIONS" \ - -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT .. - fi -- make -j4 - -- export PYTHONPATH=$PWD -- pytest -v ../tests - + - $PYTHONV makepanda/makepanda.py --everything --git-commit $TRAVIS_COMMIT $FLAGS --threads 4 + - test -n "$SKIP_TESTS" || LD_LIBRARY_PATH=built/lib PYTHONPATH=built $PYTHONV -m pytest -v tests notifications: irc: channels: From ef238ca1fd9ef36dd077fe38a2a2a0f075a38e8a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 06:59:29 -0700 Subject: [PATCH 721/744] workflow: Just skip the Windows unity build for now --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f173f531e..efd0fbc481 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: - ubuntu-bionic-coverage-ninja - macos-eigen-coverage-unity-xcode - macos-nometa-standard-makefile - - windows-standard-unity-msvc +# - windows-standard-unity-msvc # FIXME when GH Actions runners upgrade CMake to >=3.16.1 - windows-nopython-nometa-standard-msvc include: @@ -61,7 +61,7 @@ jobs: - profile: windows-standard-unity-msvc os: windows-2019 config: Standard - unity: NO # FIXME when GH Actions runners upgrade CMake to >=3.16.1 + unity: YES generator: Visual Studio 16 2019 compiler: Default metalibs: YES From 69ff54a3d407a750e5adb0dddb895b9783aaa965 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 09:34:07 -0700 Subject: [PATCH 722/744] CMake: Break up "GLES" component into OpenGLES1/OpenGLES2 --- cmake/install/Panda3DConfig.cmake | 12 ++++++++---- panda/metalibs/pandagles/CMakeLists.txt | 11 ++++------- panda/metalibs/pandagles2/CMakeLists.txt | 8 ++++---- panda/src/egldisplay/CMakeLists.txt | 14 ++++++++------ panda/src/gles2gsg/CMakeLists.txt | 6 +++--- panda/src/glesgsg/CMakeLists.txt | 6 +++--- 6 files changed, 30 insertions(+), 27 deletions(-) diff --git a/cmake/install/Panda3DConfig.cmake b/cmake/install/Panda3DConfig.cmake index 1ec4b89beb..b062bcb175 100644 --- a/cmake/install/Panda3DConfig.cmake +++ b/cmake/install/Panda3DConfig.cmake @@ -93,10 +93,14 @@ # Panda3D::DX9::pandadx9 # # -# GLES - Support for OpenGL ES rendering. +# OpenGLES1 - Support for OpenGL ES 1.x rendering. # -# Panda3D::GLES::pandagles -# Panda3D::GLES::pandagles2 +# Panda3D::OpenGLES1::pandagles +# +# +# OpenGLES2 - Support for OpenGL ES 2.x+ rendering. +# +# Panda3D::OpenGLES2::pandagles2 # # # Vision - Support for vision processing. @@ -122,7 +126,7 @@ set(_panda_components Bullet ODE FFmpeg OpenAL FMOD - OpenGL DX9 GLES + OpenGL DX9 OpenGLES1 OpenGLES2 Vision VRPN ) diff --git a/panda/metalibs/pandagles/CMakeLists.txt b/panda/metalibs/pandagles/CMakeLists.txt index cdcb6525fd..d8563d4993 100644 --- a/panda/metalibs/pandagles/CMakeLists.txt +++ b/panda/metalibs/pandagles/CMakeLists.txt @@ -12,7 +12,7 @@ else() endif() -set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "GLESDevel") +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "OpenGLES1Devel") add_metalib(pandagles ${MODULE_TYPE} INCLUDE "${GLES1_PIPE_INCLUDE}" INIT init_libpandagles pandagles.h @@ -21,11 +21,8 @@ add_metalib(pandagles ${MODULE_TYPE} unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS pandagles - EXPORT GLES COMPONENT GLES + EXPORT OpenGLES1 COMPONENT OpenGLES1 DESTINATION ${MODULE_DESTINATION} - ARCHIVE COMPONENT GLESDevel) + ARCHIVE COMPONENT OpenGLES1Devel) -if(NOT HAVE_GLES2) - # If GLES2 won't export this, we should do so here. - export_targets(GLES COMPONENT GLESDevel) -endif() +export_targets(OpenGLES1 COMPONENT OpenGLES1Devel) diff --git a/panda/metalibs/pandagles2/CMakeLists.txt b/panda/metalibs/pandagles2/CMakeLists.txt index ebc0cbdcd2..f3e90f9dfb 100644 --- a/panda/metalibs/pandagles2/CMakeLists.txt +++ b/panda/metalibs/pandagles2/CMakeLists.txt @@ -2,7 +2,7 @@ if(NOT HAVE_GLES2 OR NOT HAVE_EGL) return() endif() -set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "GLESDevel") +set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "OpenGLES2Devel") add_metalib(pandagles2 ${MODULE_TYPE} INCLUDE eglGraphicsPipe.h INIT init_libpandagles2 pandagles2.h @@ -11,8 +11,8 @@ add_metalib(pandagles2 ${MODULE_TYPE} unset(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME) install(TARGETS pandagles2 - EXPORT GLES COMPONENT GLES + EXPORT OpenGLES2 COMPONENT OpenGLES2 DESTINATION ${MODULE_DESTINATION} - ARCHIVE COMPONENT GLESDevel) + ARCHIVE COMPONENT OpenGLES2Devel) -export_targets(GLES COMPONENT GLESDevel) +export_targets(OpenGLES2 COMPONENT OpenGLES2Devel) diff --git a/panda/src/egldisplay/CMakeLists.txt b/panda/src/egldisplay/CMakeLists.txt index 9d7879362a..d228f14f6c 100644 --- a/panda/src/egldisplay/CMakeLists.txt +++ b/panda/src/egldisplay/CMakeLists.txt @@ -37,12 +37,14 @@ if(HAVE_GLES1) if(NOT BUILD_METALIBS) install(TARGETS p3egldisplay_gles1 - EXPORT GLES COMPONENT GLES + EXPORT OpenGLES1 COMPONENT OpenGLES1 DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT GLESDevel) + ARCHIVE COMPONENT OpenGLES1Devel) endif() + + install(FILES ${P3EGLDISPLAY_HEADERS} COMPONENT OpenGLES1Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) endif() if(HAVE_GLES2) @@ -55,12 +57,12 @@ if(HAVE_GLES2) if(NOT BUILD_METALIBS) install(TARGETS p3egldisplay_gles2 - EXPORT GLES COMPONENT GLES + EXPORT OpenGLES2 COMPONENT OpenGLES2 DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT GLESDevel) + ARCHIVE COMPONENT OpenGLES2Devel) endif() -endif() -install(FILES ${P3EGLDISPLAY_HEADERS} COMPONENT GLESDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) + install(FILES ${P3EGLDISPLAY_HEADERS} COMPONENT OpenGLES2Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) +endif() diff --git a/panda/src/gles2gsg/CMakeLists.txt b/panda/src/gles2gsg/CMakeLists.txt index 515818f407..62c4c90c8b 100644 --- a/panda/src/gles2gsg/CMakeLists.txt +++ b/panda/src/gles2gsg/CMakeLists.txt @@ -20,10 +20,10 @@ target_link_libraries(p3gles2gsg p3glstuff panda if(NOT BUILD_METALIBS) install(TARGETS p3gles2gsg - EXPORT GLES COMPONENT GLES + EXPORT OpenGLES2 COMPONENT OpenGLES2 DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT GLESDevel) + ARCHIVE COMPONENT OpenGLES2Devel) endif() -install(FILES ${P3GLES2GSG_HEADERS} COMPONENT GLESDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) +install(FILES ${P3GLES2GSG_HEADERS} COMPONENT OpenGLES2Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) diff --git a/panda/src/glesgsg/CMakeLists.txt b/panda/src/glesgsg/CMakeLists.txt index feb0641509..c956b882d6 100644 --- a/panda/src/glesgsg/CMakeLists.txt +++ b/panda/src/glesgsg/CMakeLists.txt @@ -20,10 +20,10 @@ target_link_libraries(p3glesgsg p3glstuff panda if(NOT BUILD_METALIBS) install(TARGETS p3glesgsg - EXPORT GLES COMPONENT GLES + EXPORT OpenGLES1 COMPONENT OpenGLES1 DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d - ARCHIVE COMPONENT GLESDevel) + ARCHIVE COMPONENT OpenGLES1Devel) endif() -install(FILES ${P3GLESGSG_HEADERS} COMPONENT GLESDevel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) +install(FILES ${P3GLESGSG_HEADERS} COMPONENT OpenGLES1Devel DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/panda3d) From 1eaf1654cd58b5e0660cb769d8b4bc0f773078e9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 10:29:05 -0700 Subject: [PATCH 723/744] CMake: Don't build egg-mkfont without Freetype --- pandatool/src/egg-mkfont/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandatool/src/egg-mkfont/CMakeLists.txt b/pandatool/src/egg-mkfont/CMakeLists.txt index d453b3a5f4..8b548e2e91 100644 --- a/pandatool/src/egg-mkfont/CMakeLists.txt +++ b/pandatool/src/egg-mkfont/CMakeLists.txt @@ -1,4 +1,4 @@ -if(NOT HAVE_EGG) +if(NOT HAVE_EGG OR NOT HAVE_FREETYPE) return() endif() From fd94a33c560c65d4e101210660af42231db8f436 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 10:30:14 -0700 Subject: [PATCH 724/744] CMake: When compiling Python to .pyc, optimize with -O Distros seem to prefer having opt-1 Python modules and don't care as much about the opt-2. --- cmake/scripts/CopyPython.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/scripts/CopyPython.cmake b/cmake/scripts/CopyPython.cmake index 1a3c98839a..a611850b62 100644 --- a/cmake/scripts/CopyPython.cmake +++ b/cmake/scripts/CopyPython.cmake @@ -70,7 +70,7 @@ if(changed AND DEFINED PYTHON_EXECUTABLES) WORKING_DIRECTORY "${OUTPUT_DIR}") execute_process( - COMMAND "${interp}" -OO -m compileall . + COMMAND "${interp}" -O -m compileall . OUTPUT_QUIET WORKING_DIRECTORY "${OUTPUT_DIR}") From 4a307f9cdf40c7843b3aeb2f39366e2c7b61663f Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 13:05:21 -0700 Subject: [PATCH 725/744] CMake: Generate panda.prc with the correct model-path This also generates a second prc for installation purposes, which has the correct paths once installed --- panda/src/configfiles/CMakeLists.txt | 36 +++++++++++++++++++++++----- panda/src/configfiles/panda.prc.in | 6 +++-- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index 69509806f9..fe1e642589 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -32,19 +32,43 @@ else() "$XDG_CACHE_HOME/panda3d") endif() -configure_file(panda.prc.in "${CMAKE_BINARY_DIR}/etc/20_panda.prc") if(IS_MULTICONFIG) - file(GENERATE OUTPUT "${PROJECT_BINARY_DIR}/$/etc/20_panda.prc" - INPUT "${PROJECT_BINARY_DIR}/etc/20_panda.prc") + set(_out_path "${PROJECT_BINARY_DIR}/$/etc") +else() + set(_out_path "${PROJECT_BINARY_DIR}/etc") endif() if(WIN32) set(_confdir "etc") - else() # On Unices, ask the GNUInstallDirs module where /etc is set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}") - endif() -install(FILES "${CMAKE_BINARY_DIR}/etc/20_panda.prc" COMPONENT Core DESTINATION ${_confdir}) +# Path from the directory containing *.prc to the *parent of* models/ +# In the build tree, reckoning this is pretty easy +set(MODELS_PARENT_PATH "..") +configure_file(panda.prc.in "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc") + +# For the install tree, we need to introspect our paths +if(_confdir MATCHES "^/") + set(_abs_confdir "${_confdir}") +else() + set(_abs_confdir "${CMAKE_INSTALL_PREFIX}/${_confdir}") +endif() +if(CMAKE_INSTALL_DATADIR MATCHES "^/") + set(_abs_datadir "${CMAKE_INSTALL_DATADIR}") +else() + set(_abs_datadir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}") +endif() +file(RELATIVE_PATH MODELS_PARENT_PATH + "${_abs_confdir}" "${_abs_datadir}/panda3d") +configure_file(panda.prc.in "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc.install") + +file(GENERATE OUTPUT "${_out_path}/20_panda.prc" + INPUT "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc") +file(GENERATE OUTPUT "${_out_path}/20_panda.prc.install" + INPUT "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc.install") + +install(FILES "${_out_path}/20_panda.prc.install" RENAME "20_panda.prc" + COMPONENT Core DESTINATION ${_confdir}) diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index 373852b241..a1f3fd8b47 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -3,10 +3,12 @@ # Some paths first... plugin-path $THIS_PRC_DIR/../lib -model-path $THIS_PRC_DIR/../share/panda3d/models +model-path $MAIN_DIR +model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH} +model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models # Let's set up a default window size of 800x600. The user can -# override this in his or her personal prc file. +# override this in a separate, personal prc file. win-origin -2 -2 win-size 800 600 From f75a8d03e0053372d28b464c3f502c49b41742bc Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 13:11:42 -0700 Subject: [PATCH 726/744] CMake: Generate panda.prc with `notify-level warning` when not Debug --- panda/src/configfiles/panda.prc.in | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index a1f3fd8b47..f5f14f7dd2 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -12,6 +12,10 @@ model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models win-origin -2 -2 win-size 800 600 +# For debugging, it's nice to have notify-level at the default setting of +# "info", but everywhere else we turn the verbosity down to "warning" +$<$:#>notify-level warning + # Define the display types that have been compiled in. Panda will # pick one of these by going through the list in this order until one # is found that works, unless the user specifically requests a From 0aa599feeb4606e41580c27d38e29784dda8f7fa Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 13:16:51 -0700 Subject: [PATCH 727/744] CMake: Take away the HAVE_TINYDISPLAY option This is at least until we can support building it, so that other components in Panda don't assume TINYDISPLAY is present. --- dtool/Config.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 5587737cf9..bdad20b861 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -437,10 +437,10 @@ pointers.") # Should build tinydisplay? -option(HAVE_TINYDISPLAY - "Builds TinyDisplay, a light software renderer based on TinyGL, -that is built into Panda. TinyDisplay is not as full-featured as Mesa -but is many times faster." ${IS_NOT_MINSIZE_BUILD}) +#option(HAVE_TINYDISPLAY +# "Builds TinyDisplay, a light software renderer based on TinyGL, +#that is built into Panda. TinyDisplay is not as full-featured as Mesa +#but is many times faster." ${IS_NOT_MINSIZE_BUILD}) # Is SDL installed, and where? From ce6caa8d3e0218fade810d682eb9a20a20845d5b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 7 Jan 2020 13:35:23 -0700 Subject: [PATCH 728/744] CMake: `/etc/*.prc` -> `/etc/panda3d/*.prc` --- dtool/Config.cmake | 7 ++++++- panda/src/configfiles/CMakeLists.txt | 19 ++++++++++++------- panda/src/configfiles/panda.prc.in | 2 +- 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index bdad20b861..909782241a 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -121,7 +121,12 @@ endif() # tree starting at the location of libpandaexpress.dll for any # directories called 'etc'. -set(DEFAULT_PRC_DIR "etc" CACHE STRING +if(UNIX) + set(_default_prc "etc/panda3d") +else() + set(_default_prc "etc") +endif() +set(DEFAULT_PRC_DIR "${_default_prc}" CACHE STRING "The compiled-in default directory to look for the Config.prc file, in the absence of the PRC_DIR environment variable set, and in the absence of anything specified via the configpath directive.") diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index fe1e642589..cd7f61fc72 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -32,17 +32,22 @@ else() "$XDG_CACHE_HOME/panda3d") endif() -if(IS_MULTICONFIG) - set(_out_path "${PROJECT_BINARY_DIR}/$/etc") +if(UNIX) + # On Unices, ask the GNUInstallDirs module where /etc is -- and then install + # ourselves into /etc/panda3d + set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}/panda3d") + set(_out_path "etc/panda3d") + set(ETC_PARENT_PATH "../..") else() - set(_out_path "${PROJECT_BINARY_DIR}/etc") + set(_confdir "etc") + set(_out_path "etc") + set(ETC_PARENT_PATH "..") endif() -if(WIN32) - set(_confdir "etc") +if(IS_MULTICONFIG) + set(_out_path "${PROJECT_BINARY_DIR}/$/${_out_path}") else() - # On Unices, ask the GNUInstallDirs module where /etc is - set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}") + set(_out_path "${PROJECT_BINARY_DIR}/${_out_path}") endif() # Path from the directory containing *.prc to the *parent of* models/ diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index f5f14f7dd2..3d1dc5c444 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -2,7 +2,7 @@ ################################# DO NOT EDIT ########################### # Some paths first... -plugin-path $THIS_PRC_DIR/../lib +plugin-path $THIS_PRC_DIR/${ETC_PARENT_PATH}/lib model-path $MAIN_DIR model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH} model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models From b946b29f37b9835bd65acfc7a3dff595f1def4a4 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Jan 2020 10:00:00 -0700 Subject: [PATCH 729/744] workflow: Pass --parallel to `cmake --build` --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index efd0fbc481..34b991bf49 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,7 @@ jobs: if: contains(matrix.python, 'NO') # BEGIN A working-directory: build - run: cmake --build . --config ${{ matrix.config }} + run: cmake --build . --config ${{ matrix.config }} --parallel 4 # END A - name: Setup Python (Python 2.7) @@ -181,7 +181,7 @@ jobs: if: contains(matrix.python, 'YES') # BEGIN A working-directory: build - run: cmake --build . --config ${{ matrix.config }} + run: cmake --build . --config ${{ matrix.config }} --parallel 4 # END A - name: Test (Python 2.7) # BEGIN B @@ -211,7 +211,7 @@ jobs: if: contains(matrix.python, 'YES') # BEGIN A working-directory: build - run: cmake --build . --config ${{ matrix.config }} + run: cmake --build . --config ${{ matrix.config }} --parallel 4 # END A - name: Test (Python 3.5) # BEGIN B @@ -241,7 +241,7 @@ jobs: if: contains(matrix.python, 'YES') # BEGIN A working-directory: build - run: cmake --build . --config ${{ matrix.config }} + run: cmake --build . --config ${{ matrix.config }} --parallel 4 # END A - name: Test (Python 3.6) # BEGIN B @@ -271,7 +271,7 @@ jobs: if: contains(matrix.python, 'YES') # BEGIN A working-directory: build - run: cmake --build . --config ${{ matrix.config }} + run: cmake --build . --config ${{ matrix.config }} --parallel 4 # END A - name: Test (Python 3.7) # BEGIN B @@ -301,7 +301,7 @@ jobs: if: contains(matrix.python, 'YES') # BEGIN A working-directory: build - run: cmake --build . --config ${{ matrix.config }} + run: cmake --build . --config ${{ matrix.config }} --parallel 4 # END A - name: Test (Python 3.8) # BEGIN B From 6214f8fd608f9e12f395e8a32dcf777f70306724 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Jan 2020 10:24:08 -0700 Subject: [PATCH 730/744] workflow: Use ccache to accelerate CMake build --- .github/workflows/ci.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 34b991bf49..c14a31dd24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -94,6 +94,8 @@ jobs: curl -O https://www.panda3d.org/download/panda3d-1.10.5/panda3d-1.10.5-tools-mac.tar.gz tar -xf panda3d-1.10.5-tools-mac.tar.gz + brew install ccache + echo "##[set-env name=thirdpartyOption;]-D THIRDPARTY_DIRECTORY=../panda3d-1.10.5/thirdparty" -DHAVE_CG=OFF - name: Install dependencies (Ubuntu) @@ -102,7 +104,7 @@ jobs: sudo apt-get update sudo apt-get install - build-essential ninja-build clang llvm + build-essential ninja-build clang llvm ccache bison flex libeigen3-dev libfreetype6-dev libgl1-mesa-dev libjpeg-dev libode-dev libopenal-dev libpng-dev libssl-dev libvorbis-dev libx11-dev @@ -130,6 +132,13 @@ jobs: echo "##[set-env name=thirdpartyOption;]-D THIRDPARTY_DIRECTORY=../thirdparty-tools/panda3d-1.10.5/thirdparty" + - name: ccache (non-Windows) + if: runner.os != 'Windows' + uses: actions/cache@v1 + with: + path: ccache + key: ci-cmake-ccache-${{ matrix.profile }} + - name: Configure shell: bash env: @@ -149,7 +158,13 @@ jobs: fi fi + if ${{ runner.os != 'Windows' }}; then + compilerLauncher=$(echo -DCMAKE_C{,XX}_COMPILER_LAUNCHER=ccache) + echo "##[set-env name=CCACHE_DIR;]$(dirname $PWD)/ccache" + fi + cmake + ${compilerLauncher:-} -D CMAKE_UNITY_BUILD=${{ matrix.unity }} -D CMAKE_BUILD_TYPE="${{ matrix.config }}" -D BUILD_METALIBS=${{ matrix.metalibs }} From 1204de6e09e457673f22ed3feaf29d1ed3a52723 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Jan 2020 16:56:33 -0700 Subject: [PATCH 731/744] CMake: Set CMP0072 (prefer glvnd over direct libGL link) --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 76669756ec..3c6daf90b0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.0.2) set(CMAKE_DISABLE_SOURCE_CHANGES ON) # Must go before project() below set(CMAKE_DISABLE_IN_SOURCE_BUILD ON) # Must go before project() below +if(CMAKE_VERSION VERSION_GREATER "3.11" OR POLICY CMP0072) + # Prefer GLVND over libGL when available; this will be enabled by default + # once the minimum CMake version is at least 3.11. + cmake_policy(SET CMP0072 NEW) +endif() + if(CMAKE_VERSION VERSION_GREATER "3.12" OR POLICY CMP0074) # Needed for THIRDPARTY_DIRECTORY support; this will be enabled by default # once the minimum CMake version is at least 3.12. From 3104bf3710ba5c875cebb22af103158447d94f3c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Jan 2020 20:13:34 -0700 Subject: [PATCH 732/744] CMake: Fix issue with HAVE_X safety checks falsely failing --- cmake/macros/PackageConfig.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 8039039e1b..7ee5ca7f39 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -149,7 +149,8 @@ function(package_option name) endif() # If it was set by the user but not found, display an error. - if(HAVE_${name} AND NOT ${found_as}_FOUND) + string(TOUPPER "${found_as}" FOUND_AS) + if(HAVE_${name} AND NOT ${found_as}_FOUND AND NOT ${FOUND_AS}_FOUND) message(SEND_ERROR "NOT FOUND: ${name}. Disable HAVE_${name} to continue.") endif() @@ -209,8 +210,6 @@ function(package_option name) endforeach(implib) if(use_variables) - string(TOUPPER "${found_as}" FOUND_AS) - if(DEFINED ${found_as}_INCLUDE_DIRS) set(includes ${${found_as}_INCLUDE_DIRS}) elseif(DEFINED ${found_as}_INCLUDE_DIR) From a1d43f7b88c53f428df87a043b9ca262ed9b0917 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 8 Jan 2020 20:57:33 -0700 Subject: [PATCH 733/744] CMake: Fix WANT_PYTHON_VERSION not always being respected --- dtool/Package.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index f563ac558e..23f1b6c019 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -171,6 +171,11 @@ if(DEFINED _PREV_WANT_PYTHON_VERSION endif() +if(WANT_PYTHON_VERSION) + # A specific version is requested; ensure we get that specific version + list(APPEND WANT_PYTHON_VERSION "EXACT") +endif() + get_directory_property(_old_cache_vars CACHE_VARIABLES) find_package(Python ${WANT_PYTHON_VERSION} QUIET COMPONENTS Interpreter Development) From 28b85d2f58f1b2cd5730a461b031ecf84510358a Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Fri, 10 Jan 2020 14:17:59 -0700 Subject: [PATCH 734/744] CMake: Work around CMake issue 20206 --- cmake/macros/CompositeSources.cmake | 11 +++++++++++ direct/src/showbase/CMakeLists.txt | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/cmake/macros/CompositeSources.cmake b/cmake/macros/CompositeSources.cmake index a624cebfb6..82decc5400 100644 --- a/cmake/macros/CompositeSources.cmake +++ b/cmake/macros/CompositeSources.cmake @@ -37,6 +37,17 @@ set(COMPOSITE_GENERATOR "${CMAKE_SOURCE_DIR}/cmake/scripts/MakeComposite.cmake") function(composite_sources target sources_var) if(NOT CMAKE_VERSION VERSION_LESS "3.16") # CMake 3.16+ implements CMAKE_UNITY_BUILD* natively; no need to continue! + + # Actually - <=3.16.2 has difficulty with multi-language support, so only + # allow .cxx in. Hopefully this can be removed soon. + foreach(_source ${${sources_var}}) + get_filename_component(_source_ext "${_source}" EXT) + if(NOT _source_ext STREQUAL ".cxx") + set_source_files_properties(${_source} PROPERTIES + SKIP_UNITY_BUILD_INCLUSION YES) + endif() + endforeach(_source) + return() endif() diff --git a/direct/src/showbase/CMakeLists.txt b/direct/src/showbase/CMakeLists.txt index 815aeb5bc2..a45fa14b4b 100644 --- a/direct/src/showbase/CMakeLists.txt +++ b/direct/src/showbase/CMakeLists.txt @@ -8,6 +8,11 @@ set(P3SHOWBASE_SOURCES if(APPLE) list(APPEND P3SHOWBASE_SOURCES showBase_assist.mm) + + # Bug in CMake 3.16.2: it tries to put .mm with the .cxx + set_source_files_properties(showBase_assist.mm PROPERTIES + SKIP_UNITY_BUILD_INCLUSION YES) + endif() add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE From 7331692ae16aaeba86dbac66a97c77d85e121a8b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 11 Jan 2020 19:39:43 -0700 Subject: [PATCH 735/744] CMake: Generate consistent paths in 20_panda.prc on all platforms --- panda/src/configfiles/CMakeLists.txt | 50 ++++++++++++++-------------- panda/src/configfiles/panda.prc.in | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/panda/src/configfiles/CMakeLists.txt b/panda/src/configfiles/CMakeLists.txt index cd7f61fc72..58003c93e1 100644 --- a/panda/src/configfiles/CMakeLists.txt +++ b/panda/src/configfiles/CMakeLists.txt @@ -35,45 +35,45 @@ endif() if(UNIX) # On Unices, ask the GNUInstallDirs module where /etc is -- and then install # ourselves into /etc/panda3d - set(_confdir "${CMAKE_INSTALL_FULL_SYSCONFDIR}/panda3d") - set(_out_path "etc/panda3d") - set(ETC_PARENT_PATH "../..") + set(prc_install_path "${CMAKE_INSTALL_FULL_SYSCONFDIR}/panda3d") + set(prc_build_path "${PANDA_OUTPUT_DIR}/etc/panda3d") else() - set(_confdir "etc") - set(_out_path "etc") - set(ETC_PARENT_PATH "..") + set(prc_install_path "etc") + set(prc_build_path "${PANDA_OUTPUT_DIR}/etc") endif() -if(IS_MULTICONFIG) - set(_out_path "${PROJECT_BINARY_DIR}/$/${_out_path}") -else() - set(_out_path "${PROJECT_BINARY_DIR}/${_out_path}") -endif() +# Path from the directory containing *.prc to the directory containing plugins +file(RELATIVE_PATH PLUGINS_PATH + "${prc_build_path}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}") # Path from the directory containing *.prc to the *parent of* models/ # In the build tree, reckoning this is pretty easy -set(MODELS_PARENT_PATH "..") +file(RELATIVE_PATH MODELS_PARENT_PATH "${prc_build_path}" "${PANDA_OUTPUT_DIR}") configure_file(panda.prc.in "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc") # For the install tree, we need to introspect our paths -if(_confdir MATCHES "^/") - set(_abs_confdir "${_confdir}") -else() - set(_abs_confdir "${CMAKE_INSTALL_PREFIX}/${_confdir}") +set(abs_prc_install_path "${prc_install_path}") +set(abs_datadir "${CMAKE_INSTALL_DATADIR}") +set(abs_plugindir "${MODULE_DESTINATION}") +if(NOT IS_ABSOLUTE "${abs_prc_install_path}") + set(abs_prc_install_path "${CMAKE_INSTALL_PREFIX}/${abs_prc_install_path}") endif() -if(CMAKE_INSTALL_DATADIR MATCHES "^/") - set(_abs_datadir "${CMAKE_INSTALL_DATADIR}") -else() - set(_abs_datadir "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}") +if(NOT IS_ABSOLUTE "${abs_datadir}") + set(abs_datadir "${CMAKE_INSTALL_PREFIX}/${abs_datadir}") endif() +if(NOT IS_ABSOLUTE "${abs_plugindir}") + set(abs_plugindir "${CMAKE_INSTALL_PREFIX}/${abs_plugindir}") +endif() +file(RELATIVE_PATH PLUGINS_PATH + "${abs_prc_install_path}" "${abs_plugindir}") file(RELATIVE_PATH MODELS_PARENT_PATH - "${_abs_confdir}" "${_abs_datadir}/panda3d") + "${abs_prc_install_path}" "${abs_datadir}/panda3d") configure_file(panda.prc.in "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc.install") -file(GENERATE OUTPUT "${_out_path}/20_panda.prc" +file(GENERATE OUTPUT "${prc_build_path}/20_panda.prc" INPUT "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc") -file(GENERATE OUTPUT "${_out_path}/20_panda.prc.install" +file(GENERATE OUTPUT "${prc_build_path}/20_panda.prc.install" INPUT "${CMAKE_CURRENT_BINARY_DIR}/20_panda.prc.install") -install(FILES "${_out_path}/20_panda.prc.install" RENAME "20_panda.prc" - COMPONENT Core DESTINATION ${_confdir}) +install(FILES "${prc_build_path}/20_panda.prc.install" RENAME "20_panda.prc" + COMPONENT Core DESTINATION ${prc_install_path}) diff --git a/panda/src/configfiles/panda.prc.in b/panda/src/configfiles/panda.prc.in index 3d1dc5c444..bd04ccbe17 100644 --- a/panda/src/configfiles/panda.prc.in +++ b/panda/src/configfiles/panda.prc.in @@ -2,7 +2,7 @@ ################################# DO NOT EDIT ########################### # Some paths first... -plugin-path $THIS_PRC_DIR/${ETC_PARENT_PATH}/lib +plugin-path $THIS_PRC_DIR/${PLUGINS_PATH} model-path $MAIN_DIR model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH} model-path $THIS_PRC_DIR/${MODELS_PARENT_PATH}/models From d0b8593e96579dfe0bc1650975560f71bc973596 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Jan 2020 11:04:03 -0700 Subject: [PATCH 736/744] workflow: Switch macOS-10.14 to macOS-latest GitHub Actions is deprecating the former on the 15th --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c14a31dd24..c3772f8135 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: eigen: NO - profile: macos-eigen-coverage-unity-xcode - os: macOS-10.14 + os: macOS-latest config: Coverage unity: YES generator: Xcode @@ -49,7 +49,7 @@ jobs: eigen: YES - profile: macos-nometa-standard-makefile - os: macOS-10.14 + os: macOS-latest config: Standard unity: NO generator: Unix Makefiles From 151d51ef098ddfa5bf7c255ca5387bb73d0f770b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Jan 2020 12:02:22 -0700 Subject: [PATCH 737/744] CMake: Autodetect THIRDPARTY_DIRECTORY when in source root --- dtool/Package.cmake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index 23f1b6c019..e3a3ca4cee 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -1,4 +1,9 @@ -set(THIRDPARTY_DIRECTORY "" CACHE PATH +set(_thirdparty_dir_default "${PROJECT_SOURCE_DIR}/thirdparty") +if(NOT (APPLE OR WIN32) OR NOT IS_DIRECTORY "${_thirdparty_dir_default}") + set(_thirdparty_dir_default "") +endif() + +set(THIRDPARTY_DIRECTORY "${_thirdparty_dir_default}" CACHE PATH "Optional location of a makepanda-style thirdparty directory. All libraries located here will be prioritized over system libraries. Useful for cross-compiling.") From ed771e3c8eb95744c9fc5b3c9eafef4f6b48c499 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Jan 2020 12:02:35 -0700 Subject: [PATCH 738/744] doc: Update CMake's README --- cmake/README.md | 74 +++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 24 deletions(-) diff --git a/cmake/README.md b/cmake/README.md index 71c2ded070..e90246ccdb 100644 --- a/cmake/README.md +++ b/cmake/README.md @@ -1,31 +1,67 @@ Building with CMake ------------------- -The quickest way to build and install panda with CMake is to run: +On Windows and macOS, please ensure that you have the very latest version of +CMake installed; older versions may work, but if not, please upgrade to the +latest available version of CMake before requesting help. + +On systems that package CMake themselves (e.g. Linux distributions), we most +likely support the provided version of CMake as long as the system itself is +supported. + +CMake will also require that you already have your system's developer tools +installed. + +The quickest way to build and install Panda with CMake is to install any +third-party dependencies and then run: ```sh mkdir build && cd build cmake .. -make -[sudo] make install +cmake --build . --config Standard --parallel 4 +[sudo] cmake --build . --config Standard --target install ``` +Note that, if you are targeting 64-bit on Windows, it is necessary to supply +the `-A x64` option when first invoking `cmake` (as `cmake -A x64 ..`). + +CMake itself does not build Panda; rather, it generates project files for an +existing IDE or build tool. To select a build tool, pass the `-G` option when +first invoking CMake, (`cmake -G Ninja ..` is highly recommended on Linux). +Some of these (Xcode, Visual Studio) support targeting multiple configurations +(the `--config Standard`, above, selects the `Standard` configuration in those +cases). Other build tools (Ninja, Makefiles, ...) do not support multiple +configurations, and the `--config` option is ignored. To change the +configuration in these cases (from `Standard`, the default), it is necessary to +change the `CMAKE_BUILD_TYPE` variable as explained below. + +The configurations are: + +| Configuration | Explanation | +| -------------- | ------------------------------------------------------ | +| Standard | Default; build provided to users of SDK | +| Release | Distribution for end-users | +| MinSizeRel | Like Release, but optimized for size | +| RelWithDebInfo | Like Release, but include debug symbols | +| Debug | Do not optimize, enable optional debugging features | +| Coverage | Like Debug, but profile code coverage; developers only | + To configure CMake, it is recommended to use cmake-gui (`cmake-gui .`), -however it is also possible to configure it entirely through CMake's -command-line interface; see `man cmake` for more details. +or ccmake (`ccmake .`), however it is also possible to configure it entirely +through CMake's command-line interface; see `man cmake` for more details. In general, the config variable for a particular third party library is: ``` - HAVE_=True/False # Example: USE_JPEG + HAVE_=YES/NO # Example: USE_JPEG ``` Panda subpackage building is handled by: ``` - BUILD_=True/False # Example: BUILD_DTOOL, BUILD_PANDA + BUILD_=YES/NO # Example: BUILD_DTOOL, BUILD_PANDA ``` Other configuration settings use their historical names (same names as in-source): ``` # Examples PANDA_DISTRIBUTOR="MyDistributor" - LINMATH_ALIGN=On + LINMATH_ALIGN=YES # ... etc ... @@ -33,20 +69,10 @@ Other configuration settings use their historical names (same names as in-source For example, `makepanda.py --distributor X` becomes `cmake -DPANDA_DISTRIBUTOR=X` -All found third-party libraries are enabled by default. -Most config settings are set to a sensible default for typical -a PC/desktop Panda3D distribution. -Third-party libraries and other settings can be enabled or disabled -through configuration with the cmake gui or cli. +All found third-party libraries are enabled by default, and makepanda-style +tools packages are searched in the same path as makepanda (however this may be +overridden with the `THIRDPARTY_DIRECTORY` option). -Running Panda3D with `-DCMAKE_BUILD_TYPE=` and one of `Release`, `Debug`, -`MinSizeRel`, or `RelWithDebInfo` will cause some configuration settings -to change their defaults to more appropriate values. - -If cmake has already been generated, changing the build type will not cause -some of these values to change to their expected values, because the values -are cached so that they don't overwrite custom settings. - -To reset CMake's config to defaults, delete the CMakeCache.txt file, and rerun -CMake with the preferred build mode specified -(example: `cmake .. -DCMAKE_BUILD_TYPE=Debug`). +Most config settings are set to a sensible default for a typical PC/desktop +Panda3D distribution. Third-party libraries and other settings can be enabled +or disabled through configuration with the cmake GUI or CLI. From 572019bd5036a797b355dd4a16292499a8a5b71b Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sun, 12 Jan 2020 13:53:26 -0700 Subject: [PATCH 739/744] CMake: Remove reference to PhysX --- dtool/Package.cmake | 9 --------- 1 file changed, 9 deletions(-) diff --git a/dtool/Package.cmake b/dtool/Package.cmake index e3a3ca4cee..ccdc4b94d6 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -592,15 +592,6 @@ package_option(ODE package_status(ODE "Open Dynamics Engine") -# PhysX -find_package(PhysX QUIET) - -package_option(PhysX - "Enable this option to support game dynamics with Nvidia PhysX." - LICENSE "Nvidia") - -package_status(PhysX "Nvidia PhysX") - # # ------------ SpeedTree ------------ From 68f1083dbf84055f69b7b803ea2a2a247d84d23c Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 21 Jan 2020 17:07:04 -0700 Subject: [PATCH 740/744] CMake: Make HAVE_VIDEO4LINUX dependent on Linux --- dtool/Config.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 909782241a..853e4501fe 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -421,8 +421,9 @@ else() endif() list(APPEND PER_CONFIG_OPTIONS USE_DEBUG_PYTHON) -option(HAVE_VIDEO4LINUX - "Set this to enable webcam support on Linux." ${IS_LINUX}) +cmake_dependent_option(HAVE_VIDEO4LINUX + "Set this to enable webcam support on Linux." ON + "IS_LINUX" OFF) # If you are having trouble linking in OpenGL extension functions at From 36e06236a9b0b7bf985ffb8e6074ab91d2f88779 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 21 Jan 2020 17:42:17 -0700 Subject: [PATCH 741/744] CMake: Remove IS(_NOT)_DEBUG_BUILD --- dtool/Config.cmake | 25 ++++++++----------------- dtool/Package.cmake | 9 +++------ panda/src/express/CMakeLists.txt | 3 +++ 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/dtool/Config.cmake b/dtool/Config.cmake index 853e4501fe..b970609bd1 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -53,14 +53,6 @@ else() endif() # Provide convenient boolean expression based on build type -if(CMAKE_BUILD_TYPE MATCHES "Debug") - set(IS_DEBUG_BUILD True) - set(IS_NOT_DEBUG_BUILD False) -else() - set(IS_DEBUG_BUILD False) - set(IS_NOT_DEBUG_BUILD True) -endif() - if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") set(IS_MINSIZE_BUILD True) set(IS_NOT_MINSIZE_BUILD False) @@ -299,7 +291,7 @@ option(DO_MEMORY_USAGE enables you to define the variable 'track-memory-usage' at runtime to help track memory leaks, and also report total memory usage on PStats. There is some small overhead for having this ability -available, even if it is unused." ${IS_DEBUG_BUILD}) +available, even if it is unused." OFF) list(APPEND PER_CONFIG_OPTIONS DO_MEMORY_USAGE) set(DO_MEMORY_USAGE_Debug ON CACHE BOOL "") @@ -307,7 +299,7 @@ option(SIMULATE_NETWORK_DELAY "This option compiles in support for simulating network delay via the min-lag and max-lag prc variables. It adds a tiny bit of overhead even when it is not activated, so it is typically enabled -only in a development build." ${IS_DEBUG_BUILD}) +only in a development build." OFF) list(APPEND PER_CONFIG_OPTIONS SIMULATE_NETWORK_DELAY) set(SIMULATE_NETWORK_DELAY_Debug ON CACHE BOOL "") @@ -317,14 +309,14 @@ rendering. Since this is normally useful only for researching buggy drivers, and since there is a tiny bit of per-primitive overhead to have this option available even if it is unused, it is by default enabled only in a development build. This has no effect -on DirectX rendering." ${IS_DEBUG_BUILD}) +on DirectX rendering." OFF) list(APPEND PER_CONFIG_OPTIONS SUPPORT_IMMEDIATE_MODE) set(SUPPORT_IMMEDIATE_MODE_Debug ON CACHE BOOL "") option(NOTIFY_DEBUG "Do you want to include the 'debug' and 'spam' Notify messages? Normally, these are stripped out when we build for release, but sometimes it's -useful to keep them around. Turn this setting on to achieve that." ${IS_DEBUG_BUILD}) +useful to keep them around. Turn this setting on to achieve that." OFF) list(APPEND PER_CONFIG_OPTIONS NOTIFY_DEBUG) set(NOTIFY_DEBUG_Debug ON CACHE BOOL "") @@ -414,10 +406,9 @@ mark_as_advanced(ANDROID_NDK_HOME ANDROID_ABI ANDROID_STL # By default, we'll assume the user only wants to run with Debug # python if he has to--that is, on Windows when building a debug build. -if(WIN32 AND IS_DEBUG_BUILD) - set(USE_DEBUG_PYTHON ON) -else() - set(USE_DEBUG_PYTHON OFF) +set(USE_DEBUG_PYTHON OFF) +if(WIN32) + set(USE_DEBUG_PYTHON_Debug ON) endif() list(APPEND PER_CONFIG_OPTIONS USE_DEBUG_PYTHON) @@ -574,7 +565,7 @@ slightly slow down Panda for the single CPU case." IMPORTED_AS Threads::Threads) # Configure debug threads -option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" ${IS_DEBUG_BUILD}) +option(DEBUG_THREADS "If on, enables debugging of thread and sync operations (i.e. mutexes, deadlocks)" OFF) list(APPEND PER_CONFIG_OPTIONS DEBUG_THREADS) set(DEBUG_THREADS_Debug ON CACHE BOOL "") diff --git a/dtool/Package.cmake b/dtool/Package.cmake index ccdc4b94d6..fbf014390c 100644 --- a/dtool/Package.cmake +++ b/dtool/Package.cmake @@ -326,13 +326,10 @@ package_option(OpenSSL option(REPORT_OPENSSL_ERRORS "Define this true to include the OpenSSL code to report verbose -error messages when they occur." ${IS_DEBUG_BUILD}) +error messages when they occur." OFF) +option(REPORT_OPENSSL_ERRORS_Debug "" ON) -if(REPORT_OPENSSL_ERRORS) - package_status(OpenSSL "OpenSSL" "with verbose error reporting") -else() - package_status(OpenSSL "OpenSSL") -endif() +package_status(OpenSSL "OpenSSL") # zlib find_package(ZLIB QUIET) diff --git a/panda/src/express/CMakeLists.txt b/panda/src/express/CMakeLists.txt index 0890cb625c..b45a55d11c 100644 --- a/panda/src/express/CMakeLists.txt +++ b/panda/src/express/CMakeLists.txt @@ -149,6 +149,9 @@ target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT}) if(REPORT_OPENSSL_ERRORS) target_compile_definitions(p3express PRIVATE REPORT_OPENSSL_ERRORS) endif() +if(REPORT_OPENSSL_ERRORS_Debug) + target_compile_definitions(p3express PRIVATE $<$:REPORT_OPENSSL_ERRORS>) +endif() if(GETTIMEOFDAY_ONE_PARAM) target_compile_definitions(p3express PRIVATE GETTIMEOFDAY_ONE_PARAM) From d0b6e2275dfd2084ac01d0a4e72af0ebae47fccd Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 21 Jan 2020 18:04:00 -0700 Subject: [PATCH 742/744] CMake: Remove IS(_NOT)_MINSIZE_BUILD --- cmake/macros/PackageConfig.cmake | 3 --- dtool/Config.cmake | 44 +++++++++++++------------------- 2 files changed, 18 insertions(+), 29 deletions(-) diff --git a/cmake/macros/PackageConfig.cmake b/cmake/macros/PackageConfig.cmake index 7ee5ca7f39..b3160e49fe 100644 --- a/cmake/macros/PackageConfig.cmake +++ b/cmake/macros/PackageConfig.cmake @@ -139,9 +139,6 @@ function(package_option name) endif() - elseif(IS_MINSIZE_BUILD) - set(default OFF) - else() set(default "${${found_as}_FOUND}") diff --git a/dtool/Config.cmake b/dtool/Config.cmake index b970609bd1..e36d63b588 100644 --- a/dtool/Config.cmake +++ b/dtool/Config.cmake @@ -52,15 +52,6 @@ else() set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configs}) endif() -# Provide convenient boolean expression based on build type -if(CMAKE_BUILD_TYPE MATCHES "MinSizeRel") - set(IS_MINSIZE_BUILD True) - set(IS_NOT_MINSIZE_BUILD False) -else() - set(IS_MINSIZE_BUILD False) - set(IS_NOT_MINSIZE_BUILD True) -endif() - set(PER_CONFIG_OPTIONS) # Are we building with static or dynamic linking? @@ -437,7 +428,9 @@ pointers.") #option(HAVE_TINYDISPLAY # "Builds TinyDisplay, a light software renderer based on TinyGL, #that is built into Panda. TinyDisplay is not as full-featured as Mesa -#but is many times faster." ${IS_NOT_MINSIZE_BUILD}) +#but is many times faster." ON) +#option(HAVE_TINYDISPLAY_MinSizeRel "" OFF) +#list(APPEND PER_CONFIG_OPTIONS HAVE_TINYDISPLAY) # Is SDL installed, and where? @@ -511,23 +504,22 @@ option(USE_PANDAFILESTREAM # These image formats don't require the assistance of a third-party # library to read and write, so there's normally no reason to disable # them int he build, unless you are looking to reduce the memory footprint. -option(HAVE_SGI_RGB "Enable support for loading SGI RGB images." - ${IS_NOT_MINSIZE_BUILD}) -option(HAVE_TGA "Enable support for loading TGA images." - ${IS_NOT_MINSIZE_BUILD}) -option(HAVE_IMG "Enable support for loading IMG images." - ${IS_NOT_MINSIZE_BUILD}) -option(HAVE_SOFTIMAGE_PIC - "Enable support for loading SOFTIMAGE PIC images." - ${IS_NOT_MINSIZE_BUILD}) -option(HAVE_BMP "Enable support for loading BMP images." - ${IS_NOT_MINSIZE_BUILD}) -option(HAVE_PNM "Enable support for loading PNM images." - ${IS_NOT_MINSIZE_BUILD}) +option(HAVE_SGI_RGB "Enable support for loading SGI RGB images." ON) +option(HAVE_TGA "Enable support for loading TGA images." ON) +option(HAVE_IMG "Enable support for loading IMG images." ON) +option(HAVE_SOFTIMAGE_PIC "Enable support for loading SOFTIMAGE PIC images." ON) +option(HAVE_BMP "Enable support for loading BMP images." ON) +option(HAVE_PNM "Enable support for loading PNM images." ON) -mark_as_advanced(HAVE_SGI_RGB HAVE_TGA - HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM) +foreach(adv_image_format + HAVE_SGI_RGB HAVE_TGA HAVE_IMG HAVE_SOFTIMAGE_PIC HAVE_BMP HAVE_PNM) + option(${adv_image_format}_MinSizeRel "" OFF) + list(APPEND PER_CONFIG_OPTIONS ${adv_image_format}) + + mark_as_advanced(${adv_image_format} ${adv_image_format}_MinSizeRel) + +endforeach(adv_image_format) # How to invoke bison and flex. Panda takes advantage of some # bison/flex features, and therefore specifically requires bison and @@ -595,7 +587,7 @@ option(DO_PIPELINING "If on, compile with pipelined rendering." ON) option(COMPILE_IN_DEFAULT_FONT "If on, compiles in a default font, so that every TextNode will always have a font available without requiring the user to specify one. -When turned off, the generated library will save a few kilobytes." ${IS_NOT_MINSIZE_BUILD}) +When turned off, the generated library will save a few kilobytes." ON) list(APPEND PER_CONFIG_OPTIONS COMPILE_IN_DEFAULT_FONT) set(COMPILE_IN_DEFAULT_FONT_MinSizeRel OFF CACHE BOOL "") From f5b6761128910c57902fffc9850f9800b45599cf Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Tue, 21 Jan 2020 18:25:17 -0700 Subject: [PATCH 743/744] CMake: Don't build socket_tcp_ssl.* anymore (deleted upstream) --- panda/src/nativenet/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/panda/src/nativenet/CMakeLists.txt b/panda/src/nativenet/CMakeLists.txt index 3c10e8d7cc..614af16d33 100644 --- a/panda/src/nativenet/CMakeLists.txt +++ b/panda/src/nativenet/CMakeLists.txt @@ -7,7 +7,7 @@ set(P3NATIVENET_HEADERS buffered_datagramconnection.h buffered_datagramreader.h buffered_datagramreader.I ringbuffer.h ringbuffer.I socket_ip.h - socket_tcp.h socket_tcp_listen.h socket_tcp_ssl.h + socket_tcp.h socket_tcp_listen.h time_accumulator.h time_out.h socket_address.I socket_address.h socket_portable.h time_base.h time_span.h buffered_datagramwriter.h @@ -25,7 +25,6 @@ set(P3NATIVENET_SOURCES socket_ip.cxx socket_tcp.cxx socket_tcp_listen.cxx - socket_tcp_ssl.cxx socket_udp.cxx socket_udp_incoming.cxx socket_udp_outgoing.cxx From 1046b122a30d5f70af379ae3c71d760f4b11b2e9 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Wed, 22 Jan 2020 02:35:11 -0700 Subject: [PATCH 744/744] CMake: Fix Interrogate macro sometimes passing -D'' --- cmake/macros/Interrogate.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/macros/Interrogate.cmake b/cmake/macros/Interrogate.cmake index 9001d05ff1..6809d8eaec 100644 --- a/cmake/macros/Interrogate.cmake +++ b/cmake/macros/Interrogate.cmake @@ -218,7 +218,10 @@ function(interrogate_sources target output database language_flags) # that's fine, it also ignores '"' set(_q "'") endif() - set(define_flags "$<$:-D${_q}$${_q}>") + set(_compile_defs_flags "-D${_q}$${_q}") + # We may have just ended up with -D'' if there are no flags; filter that + set(define_flags + "$<$>:${_compile_defs_flags}>") # Some of the definitions may be specified using -D flags in the global # CXX_FLAGS variables; parse those out (this also picks up NDEBUG)