mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
update bullet so it actually works
Moved the addSourceDirectory for physics/Bullet into the Engine/Source/CMakeLists.txt file that way it can actually appear where we expect it to in the solution explorer.
This commit is contained in:
parent
c7be48130a
commit
13fa178cf6
5986 changed files with 1811270 additions and 453803 deletions
25
Engine/lib/bullet/build3/cmake/FindLibPython.py
Normal file
25
Engine/lib/bullet/build3/cmake/FindLibPython.py
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
# Note by Nikolaus Demmel 28.03.2014: My contributions are licensend under the
|
||||
# same as CMake (BSD). My adaptations are in part based
|
||||
# https://github.com/qgis/QGIS/tree/master/cmake which has the following
|
||||
# copyright note:
|
||||
|
||||
# FindLibPython.py
|
||||
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
import sys
|
||||
import distutils.sysconfig
|
||||
|
||||
print("exec_prefix:%s" % sys.exec_prefix)
|
||||
print("major_version:%s" % str(sys.version_info[0]))
|
||||
print("minor_version:%s" % str(sys.version_info[1]))
|
||||
print("patch_version:%s" % str(sys.version_info[2]))
|
||||
print("short_version:%s" % '.'.join(map(lambda x: str(x), sys.version_info[0:2])))
|
||||
print("long_version:%s" % '.'.join(map(lambda x: str(x), sys.version_info[0:3])))
|
||||
print("py_inc_dir:%s" % distutils.sysconfig.get_python_inc())
|
||||
print("site_packages_dir:%s" % distutils.sysconfig.get_python_lib(plat_specific=1))
|
||||
for e in distutils.sysconfig.get_config_vars('LIBDIR'):
|
||||
if e != None:
|
||||
print("py_lib_dir:%s" % e)
|
||||
break
|
||||
|
|
@ -1,41 +1,59 @@
|
|||
# Find the Python NumPy package
|
||||
# PYTHON_NUMPY_INCLUDE_DIR
|
||||
# PYTHON_NUMPY_FOUND
|
||||
# will be set by this script
|
||||
# - Find the NumPy libraries
|
||||
# This module finds if NumPy is installed, and sets the following variables
|
||||
# indicating where it is.
|
||||
#
|
||||
# TODO: Update to provide the libraries and paths for linking npymath lib.
|
||||
#
|
||||
# PYTHON_NUMPY_FOUND - was NumPy found
|
||||
# PYTHON_NUMPY_VERSION - the version of NumPy found as a string
|
||||
# PYTHON_NUMPY_VERSION_MAJOR - the major version number of NumPy
|
||||
# PYTHON_NUMPY_VERSION_MINOR - the minor version number of NumPy
|
||||
# PYTHON_NUMPY_VERSION_PATCH - the patch version number of NumPy
|
||||
# PYTHON_NUMPY_VERSION_DECIMAL - e.g. version 1.6.1 is 10601
|
||||
# PYTHON_NUMPY_INCLUDE_DIR - path to the NumPy include files
|
||||
|
||||
cmake_minimum_required(VERSION 2.6)
|
||||
unset(PYTHON_NUMPY_VERSION)
|
||||
unset(PYTHON_NUMPY_INCLUDE_DIR)
|
||||
|
||||
if(NOT PYTHON_EXECUTABLE)
|
||||
if(NumPy_FIND_QUIETLY)
|
||||
find_package(PythonInterp QUIET)
|
||||
else()
|
||||
find_package(PythonInterp)
|
||||
set(__numpy_out 1)
|
||||
if(PYTHONINTERP_FOUND)
|
||||
execute_process(COMMAND "${PYTHON_EXECUTABLE}" "-c"
|
||||
"import numpy as n; print(n.__version__); print(n.get_include());"
|
||||
RESULT_VARIABLE __result
|
||||
OUTPUT_VARIABLE __output
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
|
||||
if(__result MATCHES 0)
|
||||
string(REGEX REPLACE ";" "\\\\;" __values ${__output})
|
||||
string(REGEX REPLACE "\r?\n" ";" __values ${__values})
|
||||
list(GET __values 0 PYTHON_NUMPY_VERSION)
|
||||
list(GET __values 1 PYTHON_NUMPY_INCLUDE_DIR)
|
||||
|
||||
string(REGEX MATCH "^([0-9])+\\.([0-9])+\\.([0-9])+" __ver_check "${PYTHON_NUMPY_VERSION}")
|
||||
if(NOT "${__ver_check}" STREQUAL "")
|
||||
set(PYTHON_NUMPY_VERSION_MAJOR ${CMAKE_MATCH_1})
|
||||
set(PYTHON_NUMPY_VERSION_MINOR ${CMAKE_MATCH_2})
|
||||
set(PYTHON_NUMPY_VERSION_PATCH ${CMAKE_MATCH_3})
|
||||
math(EXPR PYTHON_NUMPY_VERSION_DECIMAL
|
||||
"(${PYTHON_NUMPY_VERSION_MAJOR} * 10000) + (${PYTHON_NUMPY_VERSION_MINOR} * 100) + ${PYTHON_NUMPY_VERSION_PATCH}")
|
||||
string(REGEX REPLACE "\\\\" "/" PYTHON_NUMPY_INCLUDE_DIR ${PYTHON_NUMPY_INCLUDE_DIR})
|
||||
else()
|
||||
unset(PYTHON_NUMPY_VERSION)
|
||||
unset(PYTHON_NUMPY_INCLUDE_DIR)
|
||||
message(STATUS "Requested NumPy version and include path, but got instead:\n${__output}\n")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
message(STATUS "To find NumPy Python interpretor is required to be found.")
|
||||
endif()
|
||||
|
||||
if (PYTHON_EXECUTABLE)
|
||||
# Find out the include path
|
||||
execute_process(
|
||||
COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept:pass\n"
|
||||
OUTPUT_VARIABLE __numpy_path)
|
||||
# And the version
|
||||
execute_process(
|
||||
COMMAND "${PYTHON_EXECUTABLE}" -c
|
||||
"from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept:pass\n"
|
||||
OUTPUT_VARIABLE __numpy_version)
|
||||
elseif(__numpy_out)
|
||||
message(STATUS "Python executable not found.")
|
||||
endif(PYTHON_EXECUTABLE)
|
||||
|
||||
find_path(PYTHON_NUMPY_INCLUDE_DIR numpy/arrayobject.h
|
||||
HINTS "${__numpy_path}" "${PYTHON_INCLUDE_PATH}" NO_DEFAULT_PATH)
|
||||
|
||||
if(PYTHON_NUMPY_INCLUDE_DIR)
|
||||
set(PYTHON_NUMPY_FOUND 1 CACHE INTERNAL "Python numpy found")
|
||||
endif(PYTHON_NUMPY_INCLUDE_DIR)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(NumPy REQUIRED_VARS PYTHON_NUMPY_INCLUDE_DIR
|
||||
VERSION_VAR __numpy_version)
|
||||
find_package_handle_standard_args(NumPy REQUIRED_VARS PYTHON_NUMPY_INCLUDE_DIR PYTHON_NUMPY_VERSION
|
||||
VERSION_VAR PYTHON_NUMPY_VERSION)
|
||||
|
||||
if(NUMPY_FOUND)
|
||||
set(PYTHON_NUMPY_FOUND TRUE)
|
||||
message(STATUS "NumPy ver. ${PYTHON_NUMPY_VERSION} found (include: ${PYTHON_NUMPY_INCLUDE_DIR})")
|
||||
endif()
|
||||
|
||||
# caffe_clear_vars(__result __output __error_value __values __ver_check __error_value)
|
||||
|
||||
|
|
|
|||
358
Engine/lib/bullet/build3/cmake/FindPythonLibs.cmake
Normal file
358
Engine/lib/bullet/build3/cmake/FindPythonLibs.cmake
Normal file
|
|
@ -0,0 +1,358 @@
|
|||
# - Find python libraries
|
||||
# This module finds if Python is installed and determines where the
|
||||
# include files and libraries are. It also determines what the name of
|
||||
# the library is. This code sets the following variables:
|
||||
#
|
||||
# PYTHONLIBS_FOUND - have the Python libs been found
|
||||
# PYTHON_LIBRARIES - path to the python library
|
||||
# PYTHON_INCLUDE_PATH - path to where Python.h is found (deprecated)
|
||||
# PYTHON_INCLUDE_DIRS - path to where Python.h is found
|
||||
# PYTHON_DEBUG_LIBRARIES - path to the debug library (deprecated)
|
||||
# PYTHONLIBS_VERSION_STRING - version of the Python libs found (since CMake 2.8.8)
|
||||
#
|
||||
# The Python_ADDITIONAL_VERSIONS variable can be used to specify a list of
|
||||
# version numbers that should be taken into account when searching for Python.
|
||||
# You need to set this variable before calling find_package(PythonLibs).
|
||||
#
|
||||
# If you'd like to specify the installation of Python to use, you should modify
|
||||
# the following cache variables:
|
||||
# PYTHON_LIBRARY - path to the python library
|
||||
# PYTHON_INCLUDE_DIR - path to where Python.h is found
|
||||
|
||||
#=============================================================================
|
||||
# Copyright 2001-2009 Kitware, Inc.
|
||||
#
|
||||
# Distributed under the OSI-approved BSD License (the "License");
|
||||
# see accompanying file Copyright.txt for details.
|
||||
#
|
||||
# This software is distributed WITHOUT ANY WARRANTY; without even the
|
||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
# See the License for more information.
|
||||
#=============================================================================
|
||||
# (To distribute this file outside of CMake, substitute the full
|
||||
# License text for the above reference.)
|
||||
|
||||
# Note by Nikolaus Demmel 28.03.2014: My contributions are licensend under the
|
||||
# same as CMake (BSD). My adaptations are in part based
|
||||
# https://github.com/qgis/QGIS/tree/master/cmake which has the following
|
||||
# copyright note:
|
||||
|
||||
# Copyright (c) 2007, Simon Edwards <simon@simonzone.com>
|
||||
# Redistribution and use is allowed according to the terms of the BSD license.
|
||||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
|
||||
|
||||
|
||||
if(NOT DEFINED PYTHON_INCLUDE_DIR)
|
||||
if(DEFINED PYTHON_INCLUDE_PATH)
|
||||
# For backward compatibility, repect PYTHON_INCLUDE_PATH.
|
||||
set(PYTHON_INCLUDE_DIR "${PYTHON_INCLUDE_PATH}" CACHE PATH
|
||||
"Path to where Python.h is found" FORCE)
|
||||
else()
|
||||
set(PYTHON_INCLUDE_DIR "" CACHE PATH
|
||||
"Path to where Python.h is found" FORCE)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(EXISTS "${PYTHON_INCLUDE_DIR}" AND EXISTS "${PYTHON_LIBRARY}")
|
||||
if(EXISTS "${PYTHON_INCLUDE_DIR}/patchlevel.h")
|
||||
file(STRINGS "${PYTHON_INCLUDE_DIR}/patchlevel.h" _PYTHON_VERSION_STR
|
||||
REGEX "^#define[ \t]+PY_VERSION[ \t]+\"[^\"]+\"")
|
||||
string(REGEX REPLACE "^#define[ \t]+PY_VERSION[ \t]+\"([^\"]+)\".*" "\\1"
|
||||
PYTHONLIBS_VERSION_STRING "${_PYTHON_VERSION_STR}")
|
||||
unset(_PYTHON_VERSION_STR)
|
||||
endif()
|
||||
else()
|
||||
set(_PYTHON1_VERSIONS 1.6 1.5)
|
||||
set(_PYTHON2_VERSIONS 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0)
|
||||
set(_PYTHON3_VERSIONS 3.6 3.5 3.4 3.3 3.2 3.1 3.0)
|
||||
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
if(PythonLibs_FIND_VERSION)
|
||||
if(PythonLibs_FIND_VERSION_COUNT GREATER 1)
|
||||
set(_PYTHON_FIND_MAJ_MIN "${PythonLibs_FIND_VERSION_MAJOR}.${PythonLibs_FIND_VERSION_MINOR}")
|
||||
if(NOT PythonLibs_FIND_VERSION_EXACT)
|
||||
foreach(_PYTHON_V ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS})
|
||||
if(NOT _PYTHON_V VERSION_LESS _PYTHON_FIND_MAJ_MIN)
|
||||
if(NOT _PYTHON_V STREQUAL PythonLibs_FIND_VERSION)
|
||||
list(APPEND _PYTHON_FIND_OTHER_VERSIONS ${_PYTHON_V})
|
||||
endif()
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
unset(_PYTHON_FIND_MAJ_MIN)
|
||||
else()
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON${PythonLibs_FIND_VERSION_MAJOR}_VERSIONS})
|
||||
endif()
|
||||
else()
|
||||
# add an empty version to check the `python` executable first in case no version is requested
|
||||
set(_PYTHON_FIND_OTHER_VERSIONS ${_PYTHON3_VERSIONS} ${_PYTHON2_VERSIONS} ${_PYTHON1_VERSIONS})
|
||||
endif()
|
||||
|
||||
unset(_PYTHON1_VERSIONS)
|
||||
unset(_PYTHON2_VERSIONS)
|
||||
unset(_PYTHON3_VERSIONS)
|
||||
|
||||
# Set up the versions we know about, in the order we will search. Always add
|
||||
# the user supplied additional versions to the front.
|
||||
# If FindPythonInterp has already found the major and minor version,
|
||||
# insert that version between the user supplied versions and the stock
|
||||
# version list.
|
||||
# If no specific version is requested or suggested by PythonInterp, always look
|
||||
# for "python" executable first
|
||||
set(_PYTHON_VERSIONS ${PythonLibs_FIND_VERSION} ${PythonLibs_ADDITIONAL_VERSIONS} )
|
||||
if(DEFINED PYTHON_VERSION_MAJOR AND DEFINED PYTHON_VERSION_MINOR)
|
||||
list(APPEND _PYTHON_VERSIONS ${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR})
|
||||
endif()
|
||||
if (NOT _PYTHON_VERSIONS)
|
||||
set(_PYTHON_VERSIONS ";") # empty entry at the front makeing sure we search for "python" first
|
||||
endif()
|
||||
list(APPEND _PYTHON_VERSIONS ${_PYTHON_FIND_OTHER_VERSIONS})
|
||||
|
||||
unset(_PYTHON_FIND_OTHER_VERSIONS)
|
||||
|
||||
message(STATUS "Looking for versions: ${_PYTHON_VERSIONS}")
|
||||
|
||||
FIND_FILE(_FIND_LIB_PYTHON_PY FindLibPython.py PATHS ${CMAKE_MODULE_PATH} ${CMAKE_ROOT}/Modules)
|
||||
|
||||
if(NOT _FIND_LIB_PYTHON_PY)
|
||||
message(FATAL_ERROR "Could not find required file 'FindLibPython.py'")
|
||||
endif()
|
||||
|
||||
unset(PYTHONLIBS_VERSION_STRING)
|
||||
foreach(_CURRENT_VERSION IN LISTS _PYTHON_VERSIONS)
|
||||
|
||||
STRING(REGEX REPLACE "^([0-9]+).*$" "\\1" _VERSION_MAJOR "${_CURRENT_VERSION}")
|
||||
STRING(REGEX REPLACE "^[0-9]+\\.([0-9]+).*$" "\\1" _VERSION_MINOR "${_CURRENT_VERSION}")
|
||||
|
||||
set(_PYTHON_NAMES ${PYTHON_EXECUTABLE} python)
|
||||
|
||||
if (_CURRENT_VERSION MATCHES "^[0-9]+.*$")
|
||||
list(APPEND _PYTHON_NAMES "python${_VERSION_MAJOR}")
|
||||
if (_CURRENT_VERSION MATCHES "^[0-9]+\\.[0-9].*$")
|
||||
list(APPEND _PYTHON_NAMES "python${_VERSION_MAJOR}.${_VERSION_MINOR}")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
message(STATUS "Looking for python version '${_CURRENT_VERSION}' by checking executables: ${_PYTHON_NAMES}.")
|
||||
|
||||
foreach(_CURRENT_PYTHON_NAME IN LISTS _PYTHON_NAMES)
|
||||
|
||||
unset(_PYTHON_EXECUTABLE CACHE)
|
||||
find_program(_PYTHON_EXECUTABLE ${_CURRENT_PYTHON_NAME}
|
||||
PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath])
|
||||
|
||||
if(_PYTHON_EXECUTABLE)
|
||||
|
||||
EXECUTE_PROCESS(
|
||||
COMMAND "${_PYTHON_EXECUTABLE}" "${_FIND_LIB_PYTHON_PY}"
|
||||
OUTPUT_VARIABLE _PYTHON_CONFIG
|
||||
RESULT_VARIABLE _PYTHON_CONFIG_RESULT
|
||||
ERROR_QUIET)
|
||||
|
||||
if(NOT ${_PYTHON_CONFIG_RESULT} AND (NOT ${_PYTHON_CONFIG} STREQUAL ""))
|
||||
STRING(REGEX REPLACE ".*\nmajor_version:([0-9]+).*$" "\\1" _PYTHON_MAJOR_VERSION ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\nminor_version:([0-9]+).*$" "\\1" _PYTHON_MINOR_VERSION ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\npatch_version:([0-9]+).*$" "\\1" _PYTHON_PATCH_VERSION ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\nshort_version:([^\n]+).*$" "\\1" _PYTHON_SHORT_VERSION ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\nlong_version:([^\n]+).*$" "\\1" _PYTHON_LONG_VERSION ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\npy_inc_dir:([^\n]+).*$" "\\1" _PYTHON_INCLUDE_DIR ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\npy_lib_dir:([^\n]+).*$" "\\1" _PYTHON_LIBRARY_DIR ${_PYTHON_CONFIG})
|
||||
STRING(REGEX REPLACE ".*\nexec_prefix:(^\n+).*$" "\\1" _PYTHON_PREFIX ${_PYTHON_CONFIG})
|
||||
|
||||
if ("${_CURRENT_VERSION}" STREQUAL "" OR
|
||||
"${_CURRENT_VERSION}" STREQUAL "${_PYTHON_MAJOR_VERSION}" OR
|
||||
"${_CURRENT_VERSION}" STREQUAL "${_PYTHON_SHORT_VERSION}" OR
|
||||
"${_CURRENT_VERSION}" STREQUAL "${_PYTHON_LONG_VERSION}")
|
||||
|
||||
message(STATUS "Found executable ${_PYTHON_EXECUTABLE} with suitable version ${_PYTHON_LONG_VERSION}")
|
||||
|
||||
if(NOT EXISTS "${PYTHON_INCLUDE_DIR}")
|
||||
set(PYTHON_INCLUDE_DIR "${_PYTHON_INCLUDE_DIR}")
|
||||
endif()
|
||||
|
||||
if(NOT EXISTS "${PYTHON_LIBRARY}")
|
||||
set(_PYTHON_SHORT_VERSION_NO_DOT "${_PYTHON_MAJOR_VERSION}${_PYTHON_MINOR_VERSION}")
|
||||
set(_PYTHON_LIBRARY_NAMES python${_PYTHON_SHORT_VERSION} python${_PYTHON_SHORT_VERSION_NO_DOT} python${_PYTHON_SHORT_VERSION}m python${_PYTHON_SHORT_VERSION_NO_DOT}m)
|
||||
FIND_LIBRARY(PYTHON_LIBRARY
|
||||
NAMES ${_PYTHON_LIBRARY_NAMES}
|
||||
PATH_SUFFIXES
|
||||
"python${_PYTHON_SHORT_VERSION}/config"
|
||||
"python${_PYTHON_SHORT_VERSION_NO_DOT}/config"
|
||||
PATHS
|
||||
${_PYTHON_LIBRARY_DIR}
|
||||
${_PYTHON_PREFIX}/lib
|
||||
${_PYTHON_PREFIX}/libs
|
||||
${_PYTHON_LIBRARY_DIR}/x86_64-linux-gnu/
|
||||
NO_DEFAULT_PATH)
|
||||
|
||||
if(WIN32)
|
||||
find_library(PYTHON_DEBUG_LIBRARY
|
||||
NAMES python${_PYTHON_SHORT_VERSION_NO_DOT}_d python
|
||||
PATHS
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs/Debug
|
||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
[HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\${_CURRENT_VERSION}\\InstallPath]/libs
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
set(PYTHONLIBS_VERSION_STRING ${_PYTHON_LONG_VERSION})
|
||||
if(_PYTHON_PATCH_VERSION STREQUAL "0")
|
||||
# it's called "Python 2.7", not "2.7.0"
|
||||
string(REGEX REPLACE "\\.0$" "" PYTHONLIBS_VERSION_STRING "${PYTHONLIBS_VERSION_STRING}")
|
||||
endif()
|
||||
|
||||
break()
|
||||
else()
|
||||
message(STATUS "Found executable ${_PYTHON_EXECUTABLE} with UNsuitable version ${_PYTHON_LONG_VERSION}")
|
||||
endif() # version ok
|
||||
else()
|
||||
message(WARNING "Found executable ${_PYTHON_EXECUTABLE}, but could not extract version info.")
|
||||
endif() # could extract config
|
||||
endif() # found executable
|
||||
endforeach() # python names
|
||||
if (PYTHONLIBS_VERSION_STRING)
|
||||
break()
|
||||
endif()
|
||||
endforeach() # python versions
|
||||
endif()
|
||||
|
||||
unset(_PYTHON_NAMES)
|
||||
unset(_PYTHON_VERSIONS)
|
||||
unset(_PYTHON_EXECUTABLE CACHE)
|
||||
unset(_PYTHON_MAJOR_VERSION)
|
||||
unset(_PYTHON_MINOR_VERSION)
|
||||
unset(_PYTHON_PATCH_VERSION)
|
||||
unset(_PYTHON_SHORT_VERSION)
|
||||
unset(_PYTHON_LONG_VERSION)
|
||||
unset(_PYTHON_LIBRARY_DIR)
|
||||
unset(_PYTHON_INCLUDE_DIR)
|
||||
unset(_PYTHON_PREFIX)
|
||||
unset(_PYTHON_SHORT_VERSION_NO_DOT)
|
||||
unset(_PYTHON_LIBRARY_NAMES)
|
||||
|
||||
|
||||
# For backward compatibility, set PYTHON_INCLUDE_PATH.
|
||||
set(PYTHON_INCLUDE_PATH "${PYTHON_INCLUDE_DIR}")
|
||||
|
||||
mark_as_advanced(
|
||||
PYTHON_DEBUG_LIBRARY
|
||||
PYTHON_LIBRARY
|
||||
PYTHON_INCLUDE_DIR
|
||||
)
|
||||
|
||||
# We use PYTHON_INCLUDE_DIR, PYTHON_LIBRARY and PYTHON_DEBUG_LIBRARY for the
|
||||
# cache entries because they are meant to specify the location of a single
|
||||
# library. We now set the variables listed by the documentation for this
|
||||
# module.
|
||||
set(PYTHON_INCLUDE_DIRS "${PYTHON_INCLUDE_DIR}")
|
||||
set(PYTHON_DEBUG_LIBRARIES "${PYTHON_DEBUG_LIBRARY}")
|
||||
|
||||
# These variables have been historically named in this module different from
|
||||
# what SELECT_LIBRARY_CONFIGURATIONS() expects.
|
||||
set(PYTHON_LIBRARY_DEBUG "${PYTHON_DEBUG_LIBRARY}")
|
||||
set(PYTHON_LIBRARY_RELEASE "${PYTHON_LIBRARY}")
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
|
||||
SELECT_LIBRARY_CONFIGURATIONS(PYTHON)
|
||||
|
||||
if(PYTHON_LIBRARY AND NOT PYTHON_LIBRARIES)
|
||||
set(PYTHON_LIBRARIES "${PYTHON_LIBRARY}")
|
||||
endif()
|
||||
# SELECT_LIBRARY_CONFIGURATIONS() sets ${PREFIX}_FOUND if it has a library.
|
||||
# Unset this, this prefix doesn't match the module prefix, they are different
|
||||
# for historical reasons.
|
||||
unset(PYTHON_FOUND)
|
||||
|
||||
# include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
|
||||
include(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PythonLibs
|
||||
REQUIRED_VARS PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS
|
||||
VERSION_VAR PYTHONLIBS_VERSION_STRING)
|
||||
|
||||
# PYTHON_ADD_MODULE(<name> src1 src2 ... srcN) is used to build modules for python.
|
||||
# PYTHON_WRITE_MODULES_HEADER(<filename>) writes a header file you can include
|
||||
# in your sources to initialize the static python modules
|
||||
function(PYTHON_ADD_MODULE _NAME )
|
||||
get_property(_TARGET_SUPPORTS_SHARED_LIBS
|
||||
GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS)
|
||||
option(PYTHON_ENABLE_MODULE_${_NAME} "Add module ${_NAME}" TRUE)
|
||||
option(PYTHON_MODULE_${_NAME}_BUILD_SHARED
|
||||
"Add module ${_NAME} shared" ${_TARGET_SUPPORTS_SHARED_LIBS})
|
||||
|
||||
# Mark these options as advanced
|
||||
mark_as_advanced(PYTHON_ENABLE_MODULE_${_NAME}
|
||||
PYTHON_MODULE_${_NAME}_BUILD_SHARED)
|
||||
|
||||
if(PYTHON_ENABLE_MODULE_${_NAME})
|
||||
if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
|
||||
set(PY_MODULE_TYPE MODULE)
|
||||
else()
|
||||
set(PY_MODULE_TYPE STATIC)
|
||||
set_property(GLOBAL APPEND PROPERTY PY_STATIC_MODULES_LIST ${_NAME})
|
||||
endif()
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY PY_MODULES_LIST ${_NAME})
|
||||
add_library(${_NAME} ${PY_MODULE_TYPE} ${ARGN})
|
||||
# target_link_libraries(${_NAME} ${PYTHON_LIBRARIES})
|
||||
|
||||
if(PYTHON_MODULE_${_NAME}_BUILD_SHARED)
|
||||
set_target_properties(${_NAME} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}")
|
||||
if(WIN32 AND NOT CYGWIN)
|
||||
set_target_properties(${_NAME} PROPERTIES SUFFIX ".pyd")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
function(PYTHON_WRITE_MODULES_HEADER _filename)
|
||||
|
||||
get_property(PY_STATIC_MODULES_LIST GLOBAL PROPERTY PY_STATIC_MODULES_LIST)
|
||||
|
||||
get_filename_component(_name "${_filename}" NAME)
|
||||
string(REPLACE "." "_" _name "${_name}")
|
||||
string(TOUPPER ${_name} _nameUpper)
|
||||
set(_filename ${CMAKE_CURRENT_BINARY_DIR}/${_filename})
|
||||
|
||||
set(_filenameTmp "${_filename}.in")
|
||||
file(WRITE ${_filenameTmp} "/*Created by cmake, do not edit, changes will be lost*/\n")
|
||||
file(APPEND ${_filenameTmp}
|
||||
"#ifndef ${_nameUpper}
|
||||
#define ${_nameUpper}
|
||||
|
||||
#include <Python.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern \"C\" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
")
|
||||
|
||||
foreach(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||
file(APPEND ${_filenameTmp} "extern void init${PYTHON_MODULE_PREFIX}${_currentModule}(void);\n\n")
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${_filenameTmp}
|
||||
"#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
")
|
||||
|
||||
|
||||
foreach(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||
file(APPEND ${_filenameTmp} "int ${_name}_${_currentModule}(void) \n{\n static char name[]=\"${PYTHON_MODULE_PREFIX}${_currentModule}\"; return PyImport_AppendInittab(name, init${PYTHON_MODULE_PREFIX}${_currentModule});\n}\n\n")
|
||||
endforeach()
|
||||
|
||||
file(APPEND ${_filenameTmp} "void ${_name}_LoadAllPythonModules(void)\n{\n")
|
||||
foreach(_currentModule ${PY_STATIC_MODULES_LIST})
|
||||
file(APPEND ${_filenameTmp} " ${_name}_${_currentModule}();\n")
|
||||
endforeach()
|
||||
file(APPEND ${_filenameTmp} "}\n\n")
|
||||
file(APPEND ${_filenameTmp} "#ifndef EXCLUDE_LOAD_ALL_FUNCTION\nvoid CMakeLoadAllPythonModules(void)\n{\n ${_name}_LoadAllPythonModules();\n}\n#endif\n\n#endif\n")
|
||||
|
||||
# with configure_file() cmake complains that you may not use a file created using file(WRITE) as input file for configure_file()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_filenameTmp}" "${_filename}" OUTPUT_QUIET ERROR_QUIET)
|
||||
|
||||
endfunction()
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
# Distributed under the OSI-approved BSD 3-Clause License. See accompanying
|
||||
# file Copyright.txt or https://cmake.org/licensing for details.
|
||||
|
||||
#.rst:
|
||||
# SelectLibraryConfigurations
|
||||
# ---------------------------
|
||||
#
|
||||
#
|
||||
#
|
||||
# select_library_configurations( basename )
|
||||
#
|
||||
# This macro takes a library base name as an argument, and will choose
|
||||
# good values for basename_LIBRARY, basename_LIBRARIES,
|
||||
# basename_LIBRARY_DEBUG, and basename_LIBRARY_RELEASE depending on what
|
||||
# has been found and set. If only basename_LIBRARY_RELEASE is defined,
|
||||
# basename_LIBRARY will be set to the release value, and
|
||||
# basename_LIBRARY_DEBUG will be set to basename_LIBRARY_DEBUG-NOTFOUND.
|
||||
# If only basename_LIBRARY_DEBUG is defined, then basename_LIBRARY will
|
||||
# take the debug value, and basename_LIBRARY_RELEASE will be set to
|
||||
# basename_LIBRARY_RELEASE-NOTFOUND.
|
||||
#
|
||||
# If the generator supports configuration types, then basename_LIBRARY
|
||||
# and basename_LIBRARIES will be set with debug and optimized flags
|
||||
# specifying the library to be used for the given configuration. If no
|
||||
# build type has been set or the generator in use does not support
|
||||
# configuration types, then basename_LIBRARY and basename_LIBRARIES will
|
||||
# take only the release value, or the debug value if the release one is
|
||||
# not set.
|
||||
|
||||
# This macro was adapted from the FindQt4 CMake module and is maintained by Will
|
||||
# Dicharry <wdicharry@stellarscience.com>.
|
||||
|
||||
macro( select_library_configurations basename )
|
||||
if(NOT ${basename}_LIBRARY_RELEASE)
|
||||
set(${basename}_LIBRARY_RELEASE "${basename}_LIBRARY_RELEASE-NOTFOUND" CACHE FILEPATH "Path to a library.")
|
||||
endif()
|
||||
if(NOT ${basename}_LIBRARY_DEBUG)
|
||||
set(${basename}_LIBRARY_DEBUG "${basename}_LIBRARY_DEBUG-NOTFOUND" CACHE FILEPATH "Path to a library.")
|
||||
endif()
|
||||
|
||||
if( ${basename}_LIBRARY_DEBUG AND ${basename}_LIBRARY_RELEASE AND
|
||||
NOT ${basename}_LIBRARY_DEBUG STREQUAL ${basename}_LIBRARY_RELEASE AND
|
||||
( CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE ) )
|
||||
# if the generator supports configuration types or CMAKE_BUILD_TYPE
|
||||
# is set, then set optimized and debug options.
|
||||
set( ${basename}_LIBRARY "" )
|
||||
foreach( _libname IN LISTS ${basename}_LIBRARY_RELEASE )
|
||||
list( APPEND ${basename}_LIBRARY optimized "${_libname}" )
|
||||
endforeach()
|
||||
foreach( _libname IN LISTS ${basename}_LIBRARY_DEBUG )
|
||||
list( APPEND ${basename}_LIBRARY debug "${_libname}" )
|
||||
endforeach()
|
||||
elseif( ${basename}_LIBRARY_RELEASE )
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY_RELEASE} )
|
||||
elseif( ${basename}_LIBRARY_DEBUG )
|
||||
set( ${basename}_LIBRARY ${${basename}_LIBRARY_DEBUG} )
|
||||
else()
|
||||
set( ${basename}_LIBRARY "${basename}_LIBRARY-NOTFOUND")
|
||||
endif()
|
||||
|
||||
set( ${basename}_LIBRARIES "${${basename}_LIBRARY}" )
|
||||
|
||||
if( ${basename}_LIBRARY )
|
||||
set( ${basename}_FOUND TRUE )
|
||||
endif()
|
||||
|
||||
mark_as_advanced( ${basename}_LIBRARY_RELEASE
|
||||
${basename}_LIBRARY_DEBUG
|
||||
)
|
||||
endmacro()
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h")) then
|
||||
links {"GL"}
|
||||
else
|
||||
print("No GL/gl.h found, using dynamic loading of GL using glew")
|
||||
print("No GL/gl.h found, using dynamic loading of GL using glad")
|
||||
defines {"GLEW_INIT_OPENGL11_FUNCTIONS=1"}
|
||||
links {"dl"}
|
||||
end
|
||||
|
|
@ -43,36 +43,6 @@
|
|||
configuration{}
|
||||
end
|
||||
|
||||
|
||||
function initGlew()
|
||||
configuration {}
|
||||
if os.is("Windows") then
|
||||
configuration {"Windows"}
|
||||
defines { "GLEW_STATIC"}
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/Glew"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/Glew/glew.c"}
|
||||
end
|
||||
if os.is("Linux") then
|
||||
configuration{"Linux"}
|
||||
if _OPTIONS["enable_system_opengl"] and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/gl.h") and os.isfile("/usr/include/GL/glew.h")) then
|
||||
links {"GLEW"}
|
||||
print ("linking against system GLEW")
|
||||
else
|
||||
print("Using static glew and dynamic loading of glx functions")
|
||||
defines { "GLEW_STATIC","GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/Glew"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/Glew/glew.c"}
|
||||
links {"dl"}
|
||||
end
|
||||
|
||||
end
|
||||
configuration{}
|
||||
end
|
||||
|
||||
function initX11()
|
||||
if os.is("Linux") then
|
||||
if _OPTIONS["enable_system_x11"] and (os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h")) then
|
||||
|
|
@ -88,3 +58,64 @@
|
|||
end
|
||||
end
|
||||
|
||||
|
||||
function initX11()
|
||||
if os.is("Linux") then
|
||||
if _OPTIONS["enable_system_x11"] and (os.isdir("/usr/include") and os.isfile("/usr/include/X11/X.h")) then
|
||||
links{"X11","pthread"}
|
||||
else
|
||||
print("No X11/X.h found, using dynamic loading of X11")
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/optionalX11"
|
||||
}
|
||||
defines {"DYNAMIC_LOAD_X11_FUNCTIONS"}
|
||||
links {"dl","pthread"}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function initGlew()
|
||||
configuration {}
|
||||
if os.is("Windows") then
|
||||
configuration {"Windows"}
|
||||
defines { "GLEW_STATIC"}
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/gl.c"}
|
||||
end
|
||||
if os.is("MacOSX") then
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/gl.c"}
|
||||
end
|
||||
|
||||
if os.is("Linux") then
|
||||
configuration{"Linux"}
|
||||
initX11()
|
||||
if _OPTIONS["enable_system_glx"] then --# and (os.isdir("/usr/include") and os.isfile("/usr/include/GL/glx.h")) then
|
||||
links{"pthread"}
|
||||
print("Using system GL/glx.h")
|
||||
else
|
||||
print("Using glad_glx")
|
||||
defines { "GLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1"}
|
||||
files {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glx.c"}
|
||||
end
|
||||
|
||||
print("Using glad and dynamic loading of GL functions")
|
||||
defines { "GLEW_STATIC"}
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/gl.c",
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad/glx.c"}
|
||||
links {"dl"}
|
||||
|
||||
end
|
||||
configuration{}
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -23,11 +23,20 @@
|
|||
act = _ACTION
|
||||
end
|
||||
|
||||
projectRootDir = os.getcwd() .. "/../"
|
||||
print("Project root directory: " .. projectRootDir);
|
||||
|
||||
newoption {
|
||||
trigger = "ios",
|
||||
description = "Enable iOS target (requires xcode4)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_system_glx",
|
||||
description = "Try to link against system glx instead of using glad_glx (default)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_system_opengl",
|
||||
|
|
@ -45,6 +54,45 @@
|
|||
description = "Try to link and use system X11 headers instead of dynamically loading X11 (dlopen is default)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_stable_pd",
|
||||
description = "Enable Stable PD control in PyBullet"
|
||||
}
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_vr_plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/vrSyncPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_test_plugin",
|
||||
description = "Statically link test plugin (in examples/SharedMemory/plugins/testPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_tiny_renderer__plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/tinyRendererPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_pd_control_plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/pdControlPlugin)"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_static_collision_filter_plugin",
|
||||
description = "Statically link vr plugin (in examples/SharedMemory/plugins/collisionFilterPlugin)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_physx",
|
||||
description = "Allow optional PhysX backend for PyBullet, use pybullet.connect(pybullet.PhysX)."
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "noopengl3",
|
||||
|
|
@ -56,8 +104,160 @@
|
|||
trigger = "midi",
|
||||
description = "Use Midi controller to control parameters"
|
||||
}
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_egl",
|
||||
value = false,
|
||||
description = "Build an experimental eglPlugin"
|
||||
}
|
||||
|
||||
-- --_OPTIONS["midi"] = "1";
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_grpc",
|
||||
description = "Build GRPC server/client features for PyBullet/BulletRobotics"
|
||||
|
||||
}
|
||||
|
||||
if os.is("Linux") then
|
||||
default_grpc_include_dir = "usr/local/include/GRPC"
|
||||
default_grpc_lib_dir = "/usr/local/lib"
|
||||
default_protobuf_include_dir = "/usr/local/include/protobuf"
|
||||
default_protobuf_lib_dir = "/usr/local/lib"
|
||||
end
|
||||
|
||||
if os.is("macosx") then
|
||||
default_grpc_include_dir = "/usr/local/Cellar/grpc/1.14.1/include"
|
||||
default_grpc_lib_dir = "/usr/local/Cellar/grpc/1.14.1/lib"
|
||||
default_protobuf_include_dir = "/usr/local/Cellar/protobuf/3.6.0/include"
|
||||
default_protobuf_lib_dir = "/usr/local/Cellar/protobuf/3.6.0/lib"
|
||||
end
|
||||
|
||||
if os.is("Windows") then
|
||||
default_grpc_include_dir = projectRootDir .. "examples/ThirdPartyLibs/grpc/include"
|
||||
default_grpc_lib_dir = projectRootDir .. "examples/ThirdPartyLibs/grpc/lib"
|
||||
default_protobuf_include_dir =projectRootDir .. "examples/ThirdPartyLibs/grpc/include"
|
||||
default_protobuf_lib_dir = projectRootDir .. "examples/ThirdPartyLibs/grpc/lib"
|
||||
end
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "grpc_include_dir",
|
||||
value = default_grpc_include_dir,
|
||||
description = "(optional) GRPC include directory"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "grpc_lib_dir",
|
||||
value = default_grpc_lib_dir,
|
||||
description = "(optional) GRPC library directory "
|
||||
}
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "protobuf_include_dir",
|
||||
value = default_protobuf_include_dir,
|
||||
description = "(optional) protobuf include directory"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "protobuf_lib_dir",
|
||||
value = default_protobuf_lib_dir,
|
||||
description = "(optional) protobuf library directory "
|
||||
}
|
||||
|
||||
|
||||
if not _OPTIONS["grpc_lib_dir"] then
|
||||
_OPTIONS["grpc_lib_dir"] = default_grpc_lib_dir
|
||||
end
|
||||
if not _OPTIONS["grpc_include_dir"] then
|
||||
_OPTIONS["grpc_include_dir"] = default_grpc_include_dir
|
||||
end
|
||||
if not _OPTIONS["protobuf_include_dir"] then
|
||||
_OPTIONS["protobuf_include_dir"] = default_protobuf_include_dir
|
||||
end
|
||||
|
||||
if not _OPTIONS["protobuf_lib_dir"] then
|
||||
_OPTIONS["protobuf_lib_dir"] = default_protobuf_lib_dir
|
||||
end
|
||||
|
||||
|
||||
if _OPTIONS["enable_egl"] then
|
||||
function initEGL()
|
||||
defines {"BT_USE_EGL"}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if _OPTIONS["enable_grpc"] then
|
||||
function initGRPC()
|
||||
|
||||
|
||||
print "BT_ENABLE_GRPC"
|
||||
|
||||
print("grpc_include_dir=")
|
||||
print(_OPTIONS["grpc_include_dir"])
|
||||
print("grpc_lib_dir=")
|
||||
print(_OPTIONS["grpc_lib_dir"])
|
||||
print("protobuf_include_dir=")
|
||||
print(_OPTIONS["protobuf_include_dir"])
|
||||
print("protobuf_lib_dir=")
|
||||
print(_OPTIONS["protobuf_lib_dir"])
|
||||
|
||||
defines {"BT_ENABLE_GRPC"}
|
||||
|
||||
if os.is("macosx") then
|
||||
buildoptions { "-std=c++11" }
|
||||
links{ "dl"}
|
||||
end
|
||||
|
||||
if os.is("Linux") then
|
||||
buildoptions { "-std=c++11" }
|
||||
links{ "dl"}
|
||||
end
|
||||
|
||||
if os.is("Windows") then
|
||||
defines {"_WIN32_WINNT=0x0600"}
|
||||
links{ "zlibstatic","ssl","crypto"}
|
||||
end
|
||||
|
||||
includedirs {
|
||||
projectRootDir .. "examples", _OPTIONS["grpc_include_dir"], _OPTIONS["protobuf_include_dir"],
|
||||
}
|
||||
|
||||
if os.is("Windows") then
|
||||
configuration {"x64", "debug"}
|
||||
libdirs {_OPTIONS["grpc_lib_dir"] .. "/win64_debug" , _OPTIONS["protobuf_lib_dir"] .. "win64_debug",}
|
||||
configuration {"x86", "debug"}
|
||||
libdirs {_OPTIONS["grpc_lib_dir"] .. "/win32_debug" , _OPTIONS["protobuf_lib_dir"] .. "win32_debug",}
|
||||
configuration {"x64", "release"}
|
||||
libdirs {_OPTIONS["grpc_lib_dir"] .. "/win64_release", _OPTIONS["protobuf_lib_dir"] .. "win64_release",}
|
||||
configuration {"x86", "release"}
|
||||
libdirs {_OPTIONS["grpc_lib_dir"] .. "/win32_release" , _OPTIONS["protobuf_lib_dir"] .. "win32_release",}
|
||||
configuration{}
|
||||
|
||||
else
|
||||
libdirs {_OPTIONS["grpc_lib_dir"], _OPTIONS["protobuf_lib_dir"],}
|
||||
end
|
||||
|
||||
links { "grpc","grpc++", "grpc++_reflection", "gpr", "protobuf"}
|
||||
files {
|
||||
projectRootDir .. "examples/SharedMemory/grpc/ConvertGRPCBullet.cpp",
|
||||
projectRootDir .. "examples/SharedMemory/grpc/ConvertGRPCBullet.h",
|
||||
projectRootDir .. "examples/SharedMemory/grpc/proto/pybullet.grpc.pb.cpp",
|
||||
projectRootDir .. "examples/SharedMemory/grpc/proto/pybullet.grpc.pb.h",
|
||||
projectRootDir .. "examples/SharedMemory/grpc/proto/pybullet.pb.cpp",
|
||||
projectRootDir .. "examples/SharedMemory/grpc/proto/pybullet.pb.h", }
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
-- _OPTIONS["midi"] = "1";
|
||||
|
||||
newoption
|
||||
{
|
||||
|
|
@ -73,8 +273,21 @@
|
|||
|
||||
newoption
|
||||
{
|
||||
trigger = "enet",
|
||||
description = "Enable enet NAT punchthrough test"
|
||||
trigger = "standalone-examples",
|
||||
description = "Build standalone examples with reduced dependencies."
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "no-clsocket",
|
||||
description = "Disable clsocket and clsocket tests (used for optional TCP networking in pybullet and shared memory C-API)"
|
||||
}
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "no-enet",
|
||||
description = "Disable enet and enet tests (used for optional UDP networking in pybullet and shared memory C-API)"
|
||||
}
|
||||
|
||||
newoption
|
||||
|
|
@ -126,6 +339,12 @@ end
|
|||
trigger = "no-test",
|
||||
description = "Disable all tests"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "test-bullet2",
|
||||
|
||||
description = "Enable Bullet2 LinearMath test"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
|
|
@ -144,18 +363,57 @@ end
|
|||
trigger = "double",
|
||||
description = "Double precision version of Bullet"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "clamp-velocities",
|
||||
description = "Limit maximum velocities to reduce FP exception risk"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "serial",
|
||||
description = "Enable serial, for testing the VR glove in C++"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "audio",
|
||||
description = "Enable audio"
|
||||
}
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_multithreading",
|
||||
description = "enable CPU multithreading for bullet2 libs"
|
||||
}
|
||||
if _OPTIONS["enable_multithreading"] then
|
||||
defines {"BT_THREADSAFE=1"}
|
||||
end
|
||||
if _OPTIONS["double"] then
|
||||
defines {"BT_USE_DOUBLE_PRECISION"}
|
||||
end
|
||||
if _OPTIONS["clamp-velocities"] then
|
||||
defines {"BT_CLAMP_VELOCITY_TO=9999"}
|
||||
end
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "dynamic-runtime",
|
||||
description = "Enable dynamic DLL CRT runtime"
|
||||
}
|
||||
configurations {"Release", "Debug"}
|
||||
configuration "Release"
|
||||
flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"}
|
||||
flags { "Optimize", "EnableSSE2", "NoMinimalRebuild", "FloatFast"}
|
||||
if not _OPTIONS["dynamic-runtime"] then
|
||||
flags { "StaticRuntime" }
|
||||
end
|
||||
configuration "Debug"
|
||||
defines {"_DEBUG=1"}
|
||||
flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
|
||||
flags { "Symbols" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"}
|
||||
if not _OPTIONS["dynamic-runtime"] then
|
||||
flags { "StaticRuntime" }
|
||||
end
|
||||
|
||||
|
||||
if os.is("Linux") or os.is("macosx") then
|
||||
if os.is64bit() then
|
||||
|
|
@ -200,8 +458,8 @@ end
|
|||
else
|
||||
xcodebuildsettings
|
||||
{
|
||||
'ARCHS = "$(ARCHS_STANDARD_32_BIT) $(ARCHS_STANDARD_64_BIT)"',
|
||||
'VALID_ARCHS = "x86_64 i386"',
|
||||
'ARCHS = "$(ARCHS_STANDARD_64_BIT)"',
|
||||
'VALID_ARCHS = "x86_64"',
|
||||
-- 'SDKROOT = "macosx10.9"',
|
||||
}
|
||||
end
|
||||
|
|
@ -215,6 +473,8 @@ end
|
|||
targetdir( _OPTIONS["targetdir"] or "../bin" )
|
||||
location("./" .. act .. postfix)
|
||||
|
||||
|
||||
|
||||
if not _OPTIONS["python_include_dir"] then
|
||||
_OPTIONS["python_include_dir"] = default_python_include_dir
|
||||
end
|
||||
|
|
@ -222,35 +482,133 @@ end
|
|||
if not _OPTIONS["python_lib_dir"] then
|
||||
_OPTIONS["python_lib_dir"] = default_python_lib_dir
|
||||
end
|
||||
|
||||
if os.is("Linux") then
|
||||
default_glfw_include_dir = "usr/local/include/GLFW"
|
||||
default_glfw_lib_dir = "/usr/local/lib/"
|
||||
default_glfw_lib_name = "glfw3"
|
||||
end
|
||||
|
||||
if os.is("macosx") then
|
||||
default_glfw_include_dir = "/usr/local/Cellar/glfw/3.2.1/include"
|
||||
default_glfw_lib_dir = "/usr/local/Cellar/glfw/3.2.1/lib"
|
||||
default_glfw_lib_name = "glfw"
|
||||
end
|
||||
|
||||
if os.is("Windows") then
|
||||
default_glfw_include_dir = "c:/glfw/include"
|
||||
default_glfw_lib_dir = "c:/glfw/lib"
|
||||
default_glfw_lib_name = "glfw3"
|
||||
end
|
||||
|
||||
|
||||
|
||||
projectRootDir = os.getcwd() .. "/../"
|
||||
print("Project root directory: " .. projectRootDir);
|
||||
|
||||
if not _OPTIONS["glfw_lib_dir"] then
|
||||
_OPTIONS["glfw_lib_dir"] = default_glfw_lib_dir
|
||||
end
|
||||
if not _OPTIONS["glfw_include_dir"] then
|
||||
_OPTIONS["glfw_include_dir"] = default_glfw_include_dir
|
||||
end
|
||||
if not _OPTIONS["glfw_lib_name"] then
|
||||
_OPTIONS["glfw_lib_name"] = default_glfw_lib_name
|
||||
end
|
||||
|
||||
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "glfw_include_dir",
|
||||
value = default_glfw_include_dir,
|
||||
description = "GLFW 3.x include directory"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "glfw_lib_name",
|
||||
value = default_glfw_lib_name,
|
||||
description = "GLFW 3.x library name (glfw, glfw3)"
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "glfw_lib_dir",
|
||||
value = default_glfw_lib_dir,
|
||||
description = "(optional) GLFW 3.x library directory "
|
||||
}
|
||||
|
||||
newoption
|
||||
{
|
||||
trigger = "enable_glfw",
|
||||
value = false,
|
||||
description = "(optional) use GLFW 3.x library"
|
||||
}
|
||||
|
||||
if _OPTIONS["enable_glfw"] then
|
||||
defines {"B3_USE_GLFW"}
|
||||
|
||||
function initOpenGL()
|
||||
includedirs {
|
||||
projectRootDir .. "examples/ThirdPartyLibs/glad"
|
||||
}
|
||||
|
||||
includedirs {
|
||||
_OPTIONS["glfw_include_dir"],
|
||||
}
|
||||
|
||||
libdirs {
|
||||
_OPTIONS["glfw_lib_dir"]
|
||||
}
|
||||
links { _OPTIONS["glfw_lib_name"]}
|
||||
files { projectRootDir .. "examples/ThirdPartyLibs/glad/glad.c" }
|
||||
end
|
||||
function findOpenGL3()
|
||||
return true
|
||||
end
|
||||
function initGlew()
|
||||
end
|
||||
function initX11()
|
||||
links {"X11", "dl","pthread"}
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
dofile ("findOpenGLGlewGlut.lua")
|
||||
if (not findOpenGL3()) then
|
||||
defines {"NO_OPENGL3"}
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
dofile ("findOpenCL.lua")
|
||||
dofile ("findDirectX11.lua")
|
||||
dofile ("findOpenGLGlewGlut.lua")
|
||||
|
||||
|
||||
|
||||
language "C++"
|
||||
|
||||
if (not findOpenGL3()) then
|
||||
defines {"NO_OPENGL3"}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if _OPTIONS["audio"] then
|
||||
include "../examples/TinyAudio"
|
||||
end
|
||||
|
||||
language "C++"
|
||||
if _OPTIONS["serial"] then
|
||||
include "../examples/ThirdPartyLibs/serial"
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-demos"] then
|
||||
include "../examples/ExampleBrowser"
|
||||
include "../examples/RobotSimulator"
|
||||
include "../examples/OpenGLWindow"
|
||||
include "../examples/ThirdPartyLibs/Gwen"
|
||||
include "../examples/SimpleOpenGL3"
|
||||
include "../examples/TinyRenderer"
|
||||
|
||||
include "../examples/HelloWorld"
|
||||
include "../examples/BasicDemo"
|
||||
include "../examples/InverseDynamics"
|
||||
include "../examples/ExtendedTutorials"
|
||||
include "../examples/SharedMemory"
|
||||
include "../examples/ThirdPartyLibs/BussIK"
|
||||
include "../examples/MultiThreading"
|
||||
|
||||
if _OPTIONS["lua"] then
|
||||
include "../examples/ThirdPartyLibs/lua-5.2.3"
|
||||
|
|
@ -258,17 +616,42 @@ end
|
|||
if _OPTIONS["enable_pybullet"] then
|
||||
include "../examples/pybullet"
|
||||
end
|
||||
include "../examples/SimpleOpenGL3"
|
||||
|
||||
if _OPTIONS["standalone-examples"] then
|
||||
|
||||
include "../examples/TinyRenderer"
|
||||
include "../examples/BasicDemo"
|
||||
include "../examples/InverseDynamics"
|
||||
include "../examples/ExtendedTutorials"
|
||||
include "../examples/MultiThreading"
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-test"] then
|
||||
include "../test/SharedMemory"
|
||||
if _OPTIONS["enet"] then
|
||||
include "../examples/ThirdPartyLibs/enet"
|
||||
include "../test/enet/client"
|
||||
include "../test/enet/server"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if _OPTIONS["midi"] then
|
||||
include "../examples/ThirdPartyLibs/midi"
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-clsocket"] then
|
||||
defines {"BT_ENABLE_CLSOCKET"}
|
||||
include "../examples/ThirdPartyLibs/clsocket"
|
||||
include "../test/clsocket"
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-enet"] then
|
||||
defines {"BT_ENABLE_ENET"}
|
||||
|
||||
include "../examples/ThirdPartyLibs/enet"
|
||||
include "../test/enet/nat_punchthrough/client"
|
||||
include "../test/enet/nat_punchthrough/server"
|
||||
include "../test/enet/chat/client"
|
||||
include "../test/enet/chat/server"
|
||||
end
|
||||
|
||||
if _OPTIONS["no-bullet3"] then
|
||||
print "--no-bullet3 implies --no-demos"
|
||||
_OPTIONS["no-demos"] = "1"
|
||||
|
|
@ -289,7 +672,9 @@ end
|
|||
end
|
||||
|
||||
if not _OPTIONS["no-test"] then
|
||||
if _OPTIONS["test-bullet2"] then
|
||||
include "../test/Bullet2"
|
||||
end
|
||||
|
||||
if not _OPTIONS["no-gtest"] then
|
||||
include "../test/gtest-1.7.0"
|
||||
|
|
@ -314,4 +699,7 @@ end
|
|||
include "../src/BulletDynamics"
|
||||
include "../src/BulletCollision"
|
||||
include "../src/LinearMath"
|
||||
if _OPTIONS["enable_physx"] then
|
||||
include "../src/physx"
|
||||
end
|
||||
|
||||
|
|
|
|||
BIN
Engine/lib/bullet/build3/premake4_arm64
Normal file
BIN
Engine/lib/bullet/build3/premake4_arm64
Normal file
Binary file not shown.
|
|
@ -56,7 +56,8 @@ premake4 --file=stringifyKernel.lua --kernelfile="../btgui/OpenGLWindow/Shaders/
|
|||
premake4 --file=stringifyKernel.lua --kernelfile="../btgui/OpenGLWindow/Shaders/useShadowMapInstancingPS.glsl" --headerfile="../btgui/OpenGLWindow/Shaders/useShadowMapInstancingPS.h" --stringname="useShadowMapInstancingFragmentShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../btgui/OpenGLWindow/Shaders/useShadowMapInstancingVS.glsl" --headerfile="../btgui/OpenGLWindow/Shaders/useShadowMapInstancingVS.h" --stringname="useShadowMapInstancingVertexShader" stringify
|
||||
|
||||
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../btgui/OpenGLWindow/Shaders/projectiveTextureInstancingPS.glsl" --headerfile="../btgui/OpenGLWindow/Shaders/projectiveTextureInstancingPS.h" --stringname="projectiveTextureInstancingFragmentShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../btgui/OpenGLWindow/Shaders/projectiveTextureInstancingVS.glsl" --headerfile="../btgui/OpenGLWindow/Shaders/projectiveTextureInstancingVS.h" --stringname="projectiveTextureInstancingVertexShader" stringify
|
||||
|
||||
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../Demos3/GpuDemos/broadphase/pairsKernel.cl" --headerfile="../Demos3/GpuDemos/broadphase/pairsKernel.h" --stringname="pairsKernelsCL" stringify
|
||||
|
|
|
|||
|
|
@ -62,6 +62,8 @@ eval '$mypremake --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWin
|
|||
|
||||
eval '$mypremake --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingPS.h" --stringname="useShadowMapInstancingFragmentShader" stringify'
|
||||
eval '$mypremake --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingVS.h" --stringname="useShadowMapInstancingVertexShader" stringify'
|
||||
eval '$mypremake --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingPS.h" --stringname="projectiveTextureInstancingFragmentShader" stringify'
|
||||
eval '$mypremake --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingVS.h" --stringname="projectiveTextureInstancingVertexShader" stringify'
|
||||
eval '$mypremake --file=stringifyKernel.lua --kernelfile="../examples/OpenCL/broadphase/pairsKernel.cl" --headerfile="../examples/OpenCL/broadphase/pairsKernel.h" --stringname="pairsKernelsCL" stringify'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,12 @@
|
|||
rem @echo off
|
||||
|
||||
|
||||
|
||||
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/segmentationMaskInstancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/segmentationMaskInstancingVS.h" --stringname="segmentationMaskInstancingVertexShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/segmentationMaskInstancingPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/segmentationMaskInstancingPS.h" --stringname="segmentationMaskInstancingFragmentShader" stringify
|
||||
|
||||
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/instancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/instancingVS.h" --stringname="instancingVertexShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/instancingPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/instancingPS.h" --stringname="instancingFragmentShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/pointSpriteVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/pointSpriteVS.h" --stringname="pointSpriteVertexShader" stringify
|
||||
|
|
@ -10,6 +16,8 @@ premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shade
|
|||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/createShadowMapInstancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/createShadowMapInstancingVS.h" --stringname="createShadowMapInstancingVertexShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingPS.h" --stringname="useShadowMapInstancingFragmentShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/useShadowMapInstancingVS.h" --stringname="useShadowMapInstancingVertexShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingPS.h" --stringname="projectiveTextureInstancingFragmentShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/projectiveTextureInstancingVS.h" --stringname="projectiveTextureInstancingVertexShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/linesVS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/linesVS.h" --stringname="linesVertexShader" stringify
|
||||
premake4 --file=stringifyKernel.lua --kernelfile="../examples/OpenGLWindow/Shaders/linesPS.glsl" --headerfile="../examples/OpenGLWindow/Shaders/linesPS.h" --stringname="linesFragmentShader" stringify
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
|
||||
rem premake4 --with-pe vs2010
|
||||
premake4 --bullet2gpu vs2010
|
||||
|
||||
mkdir vs2010\cache
|
||||
pause
|
||||
Loading…
Add table
Add a link
Reference in a new issue