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()