mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
Merge branch 'cmake' of https://github.com/treamology/panda3d into cmake
# Conflicts: # .travis.yml # direct/src/showbase/CMakeLists.txt # dtool/dtool_config.h.in # dtool/src/prc/CMakeLists.txt # panda/src/cocoadisplay/CMakeLists.txt # panda/src/express/CMakeLists.txt # panda/src/osxdisplay/CMakeLists.txt
This commit is contained in:
commit
b3f1b7d40b
46
.travis.yml
46
.travis.yml
@ -2,15 +2,24 @@ language: cpp
|
|||||||
sudo: false
|
sudo: false
|
||||||
|
|
||||||
# Build matrix:
|
# Build matrix:
|
||||||
|
os:
|
||||||
|
- linux
|
||||||
|
- osx
|
||||||
compiler:
|
compiler:
|
||||||
- gcc
|
|
||||||
- clang
|
- clang
|
||||||
env:
|
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
|
||||||
- BUILD_METALIBS=ON COMPOSITE_SOURCE_LIMIT=30 PYTHON_INTERP=python2.7
|
- 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: gcc
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
@ -40,6 +49,7 @@ addons:
|
|||||||
- nvidia-cg-toolkit
|
- nvidia-cg-toolkit
|
||||||
- python-dev
|
- python-dev
|
||||||
- python3-dev
|
- python3-dev
|
||||||
|
- python3-pip
|
||||||
- python-virtualenv
|
- python-virtualenv
|
||||||
- zlib1g-dev
|
- zlib1g-dev
|
||||||
- fakeroot
|
- fakeroot
|
||||||
@ -50,7 +60,19 @@ before_install:
|
|||||||
- makepanda/selfdestruct.py --yes
|
- makepanda/selfdestruct.py --yes
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- virtualenv --python=${PYTHON_INTERP:-python3.4} venv && source venv/bin/activate
|
- >
|
||||||
|
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
|
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
|
||||||
|
fi
|
||||||
|
- source venv/bin/activate
|
||||||
- pip install pytest
|
- pip install pytest
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
@ -62,7 +84,19 @@ script:
|
|||||||
# interrogate has a way of explicitly calling init_libpanda)
|
# interrogate has a way of explicitly calling init_libpanda)
|
||||||
- '[ "x$BUILD_METALIBS" == "xON" ] || export LDFLAGS=-Wl,--no-as-needed'
|
- '[ "x$BUILD_METALIBS" == "xON" ] || export LDFLAGS=-Wl,--no-as-needed'
|
||||||
|
|
||||||
- cmake -DHAVE_GTK2=NO -DBUILD_METALIBS=$BUILD_METALIBS -DCOMPOSITE_SOURCE_LIMIT=$COMPOSITE_SOURCE_LIMIT ..
|
- >
|
||||||
|
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 -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 ..
|
||||||
|
fi
|
||||||
- make -j4
|
- make -j4
|
||||||
|
|
||||||
- export PYTHONPATH=$PWD
|
- export PYTHONPATH=$PWD
|
||||||
|
@ -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
|
set(COMPOSITE_SOURCE_EXTENSIONS "cxx;c;mm" CACHE STRING
|
||||||
"Only files of these extensions will be added to composite files.")
|
"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")
|
set(COMPOSITE_GENERATOR "${CMAKE_SOURCE_DIR}/cmake/scripts/MakeComposite.cmake")
|
||||||
|
|
||||||
|
|
||||||
@ -36,8 +40,12 @@ function(composite_sources target sources_var)
|
|||||||
set(sources ${orig_sources})
|
set(sources ${orig_sources})
|
||||||
list(LENGTH sources num_sources)
|
list(LENGTH sources num_sources)
|
||||||
|
|
||||||
if(num_sources LESS 2 OR ${COMPOSITE_SOURCE_LIMIT} LESS 2)
|
# Don't composite if in the list of exclusions, and don't bother compositing
|
||||||
# It's silly to do this for a single source.
|
# 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()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@ -1,5 +1,18 @@
|
|||||||
|
set(P3SHOWBASE_FILES
|
||||||
|
showBase.cxx
|
||||||
|
showBase.h)
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
list(APPEND P3SHOWBASE_FILES showBase_assist.mm)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE
|
add_component_library(p3showbase NOINIT SYMBOL BUILDING_DIRECT_SHOWBASE
|
||||||
showBase.cxx showBase.h)
|
${P3SHOWBASE_FILES})
|
||||||
|
|
||||||
|
if(APPLE)
|
||||||
|
set_target_properties(p3showbase PROPERTIES COMPILE_FLAGS "-ObjC++")
|
||||||
|
endif()
|
||||||
|
|
||||||
target_link_libraries(p3showbase p3directbase panda)
|
target_link_libraries(p3showbase p3directbase panda)
|
||||||
target_interrogate(p3showbase ALL)
|
target_interrogate(p3showbase ALL)
|
||||||
|
|
||||||
|
@ -515,7 +515,7 @@ endif()
|
|||||||
#package_option(XCURSOR
|
#package_option(XCURSOR
|
||||||
# "This enables custom cursor support in x11display.")
|
# "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)
|
option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." ON)
|
||||||
else()
|
else()
|
||||||
option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." OFF)
|
option(HAVE_GLX "Enables GLX. Requires OpenGL and X11." OFF)
|
||||||
|
@ -294,6 +294,10 @@ package_option(OPENAL
|
|||||||
LICENSE "LGPL")
|
LICENSE "LGPL")
|
||||||
config_package(OPENAL "OpenAL sound library")
|
config_package(OPENAL "OpenAL sound library")
|
||||||
|
|
||||||
|
if(OPENAL_FOUND AND APPLE)
|
||||||
|
set(HAVE_OPENAL_FRAMEWORK YES)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# ------------ FreeType ------------
|
# ------------ FreeType ------------
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
/* Define if we have RAD game tools, Miles Sound System installed. */
|
/* Define if we have RAD game tools, Miles Sound System installed. */
|
||||||
#cmakedefine HAVE_RAD_MSS
|
#cmakedefine HAVE_RAD_MSS
|
||||||
|
|
||||||
|
/* Define if we have OpenAL installed as a framework. */
|
||||||
|
#cmakedefine HAVE_OPENAL_FRAMEWORK
|
||||||
|
|
||||||
/* Define if we have Freetype 2.0 or better available. */
|
/* Define if we have Freetype 2.0 or better available. */
|
||||||
#cmakedefine HAVE_FREETYPE
|
#cmakedefine HAVE_FREETYPE
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@ set(P3DTOOLUTIL_HEADERS
|
|||||||
if(APPLE)
|
if(APPLE)
|
||||||
set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS}
|
set(P3DTOOLUTIL_HEADERS ${P3DTOOLUTIL_HEADERS}
|
||||||
filename_assist.mm filename_assist.h)
|
filename_assist.mm filename_assist.h)
|
||||||
|
set_source_files_properties(filename_assist.mm filename_assist.h PROPERTIES WRAP_EXCLUDE YES)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(P3DTOOLUTIL_SOURCES
|
set(P3DTOOLUTIL_SOURCES
|
||||||
@ -72,6 +73,7 @@ target_link_libraries(p3dtoolutil p3dtoolbase ${CMAKE_DL_LIBS})
|
|||||||
target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT})
|
target_interrogate(p3dtoolutil ALL EXTENSIONS ${P3DTOOLUTIL_IGATEEXT})
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
|
set_target_properties(p3dtoolutil PROPERTIES COMPILE_FLAGS "-ObjC++")
|
||||||
find_library(FOUNDATION_LIBRARY Foundation)
|
find_library(FOUNDATION_LIBRARY Foundation)
|
||||||
find_library(APPKIT_LIBRARY AppKit)
|
find_library(APPKIT_LIBRARY AppKit)
|
||||||
target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY})
|
target_link_libraries(p3dtoolutil ${FOUNDATION_LIBRARY} ${APPKIT_LIBRARY})
|
||||||
|
@ -7,7 +7,8 @@ set(P3COCOADISPLAY_HEADERS
|
|||||||
cocoaGraphicsPipe.h cocoaGraphicsPipe.I
|
cocoaGraphicsPipe.h cocoaGraphicsPipe.I
|
||||||
cocoaGraphicsWindow.h cocoaGraphicsWindow.I
|
cocoaGraphicsWindow.h cocoaGraphicsWindow.I
|
||||||
cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I
|
cocoaGraphicsStateGuardian.h cocoaGraphicsStateGuardian.I
|
||||||
cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h)
|
cocoaPandaApp.h cocoaPandaView.h cocoaPandaWindowDelegate.h
|
||||||
|
cocoaPandaAppDelegate.h)
|
||||||
|
|
||||||
set(P3COCOADISPLAY_SOURCES
|
set(P3COCOADISPLAY_SOURCES
|
||||||
config_cocoadisplay.mm
|
config_cocoadisplay.mm
|
||||||
@ -18,11 +19,13 @@ set(P3COCOADISPLAY_SOURCES
|
|||||||
cocoaPandaApp.mm
|
cocoaPandaApp.mm
|
||||||
cocoaPandaView.mm
|
cocoaPandaView.mm
|
||||||
cocoaPandaWindow.mm
|
cocoaPandaWindow.mm
|
||||||
cocoaPandaWindowDelegate.mm)
|
cocoaPandaWindowDelegate.mm
|
||||||
|
cocoaPandaAppDelegate.mm)
|
||||||
|
|
||||||
#composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES)
|
composite_sources(p3cocoadisplay P3COCOADISPLAY_SOURCES)
|
||||||
add_library(p3cocoadisplay ${P3COCOADISPLAY_HEADERS} ${P3COCOADISPLAY_SOURCES})
|
add_component_library(p3cocoadisplay SYMBOL BUILDING_PANDA_COCOADISPLAY
|
||||||
set_target_properties(p3cocoadisplay PROPERTIES DEFINE_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 p3display p3putil p3glgsg)
|
||||||
|
|
||||||
# Frameworks:
|
# Frameworks:
|
||||||
@ -32,4 +35,6 @@ find_library(CARBON_LIBRARY Carbon)
|
|||||||
target_link_libraries(p3cocoadisplay
|
target_link_libraries(p3cocoadisplay
|
||||||
${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY})
|
${APPLICATIONSERVICES_LIBRARY} ${APPKIT_LIBRARY} ${CARBON_LIBRARY})
|
||||||
|
|
||||||
install(TARGETS p3cocoadisplay DESTINATION lib)
|
if(NOT BUILD_METALIBS)
|
||||||
|
install(TARGETS p3cocoadisplay DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#import "cocoaPandaApp.h"
|
#import "cocoaPandaApp.h"
|
||||||
|
#include "config_cocoadisplay.h"
|
||||||
|
|
||||||
@implementation CocoaPandaApp
|
@implementation CocoaPandaApp
|
||||||
- (void) sendEvent: (NSEvent *) event {
|
- (void) sendEvent: (NSEvent *) event {
|
||||||
|
@ -18,6 +18,8 @@
|
|||||||
#include "graphicsEngine.h"
|
#include "graphicsEngine.h"
|
||||||
#include "config_display.h"
|
#include "config_display.h"
|
||||||
#include "nativeWindowHandle.h"
|
#include "nativeWindowHandle.h"
|
||||||
|
#include "mouseButton.h"
|
||||||
|
#include "throw_event.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ add_component_library(p3express SYMBOL BUILDING_PANDA_EXPRESS
|
|||||||
${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS})
|
${P3EXPRESS_SOURCES} ${P3EXPRESS_HEADERS})
|
||||||
|
|
||||||
target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool
|
target_link_libraries(p3express p3pandabase p3dtoolconfig p3dtool
|
||||||
PKG::TAR PKG::ZLIB)
|
PKG::TAR PKG::ZLIB PKG::OPENSSL)
|
||||||
target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT})
|
target_interrogate(p3express ALL EXTENSIONS ${P3EXPRESS_IGATEEXT})
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
|
@ -13,8 +13,9 @@ set(P3OSXDISPLAY_SOURCES
|
|||||||
osxGraphicsBuffer.cxx)
|
osxGraphicsBuffer.cxx)
|
||||||
|
|
||||||
composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES)
|
composite_sources(p3osxdisplay P3OSXDISPLAY_SOURCES)
|
||||||
add_library(p3osxdisplay ${P3OSXDISPLAY_HEADERS} ${P3OSXDISPLAY_SOURCES})
|
add_component_library(p3osxdisplay SYMBOL BUILDING_PANDA_OSXDISPLAY
|
||||||
set_target_properties(p3osxdisplay PROPERTIES DEFINE_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 p3display p3putil p3glgsg)
|
||||||
|
|
||||||
# Frameworks:
|
# Frameworks:
|
||||||
@ -27,4 +28,6 @@ target_link_libraries(p3osxdisplay
|
|||||||
${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY}
|
${APPLICATIONSERVICES_LIBRARY} ${CARBON_LIBRARY} ${AGL_LIBRARY}
|
||||||
${CORESERVICES_LIBRARY} ${COCOA_LIBRARY})
|
${CORESERVICES_LIBRARY} ${COCOA_LIBRARY})
|
||||||
|
|
||||||
install(TARGETS p3osxdisplay DESTINATION lib)
|
if(NOT BUILD_METALIBS)
|
||||||
|
install(TARGETS p3osxdisplay DESTINATION lib)
|
||||||
|
endif()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user