From 855d217f359286695e5a4703f77716b474cdda06 Mon Sep 17 00:00:00 2001 From: Sam Edwards Date: Sat, 24 Aug 2019 18:07:22 -0600 Subject: [PATCH] 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