summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-30 22:22:52 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-30 22:22:52 +0800
commitd604302d942d26ccfd8e0e5de548fa437d1425d5 (patch)
tree2775bb4bbe583499ae0cf5591df4e24dab139945 /indra/cmake
parent1713ef9a05cdbda684a045af1ffa96aff86fd7b4 (diff)
Fix Error: Dae parsing issue - see log for details
https://megapahit.com/show_bug.cgi?id=76 It seems like we have to use LL's Collada DOM 2.3. Make sure minizip is installed on macOS. It should be safe to uninstall your system Collada DOM package now. The CMake arguments might have to be completed for non-Darwin platforms in a next commit.
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/LLPrimitive.cmake74
1 files changed, 64 insertions, 10 deletions
diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake
index 539f5c0d55..8174e8a851 100644
--- a/indra/cmake/LLPrimitive.cmake
+++ b/indra/cmake/LLPrimitive.cmake
@@ -11,16 +11,6 @@ add_library( ll::minizip-ng INTERFACE IMPORTED )
add_library( ll::libxml INTERFACE IMPORTED )
add_library( ll::colladadom INTERFACE IMPORTED )
-if ( NOT (USE_AUTOBUILD_3P OR USE_CONAN) )
- include(FindPkgConfig)
- pkg_check_modules(Colladadom REQUIRED collada-dom)
- target_compile_definitions( ll::colladadom INTERFACE COLLADA_DOM_SUPPORT141 )
- target_include_directories( ll::colladadom SYSTEM INTERFACE ${Colladadom_INCLUDE_DIRS} ${Colladadom_INCLUDE_DIRS}/1.4 )
- target_link_directories( ll::colladadom INTERFACE ${Colladadom_LIBRARY_DIRS} )
- target_link_libraries( ll::colladadom INTERFACE ${Colladadom_LIBRARIES} )
- return ()
-endif ()
-
# ND, needs fixup in collada conan pkg
if( USE_CONAN )
target_include_directories( ll::colladadom SYSTEM INTERFACE
@@ -28,12 +18,76 @@ if( USE_CONAN )
"${CONAN_INCLUDE_DIRS_COLLADADOM}/collada-dom/1.4/" )
endif()
+if( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS )
+ if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz)
+ file(DOWNLOAD
+ https://github.com/secondlife/3p-colladadom/archive/refs/tags/v2.3-r4.tar.gz
+ ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz
+ )
+ endif (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz)
+ file(ARCHIVE_EXTRACT
+ INPUT ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4.tar.gz
+ DESTINATION ${CMAKE_BINARY_DIR}
+ )
+ if (DARWIN)
+ try_compile(COLLADADOM_RESULT
+ PROJECT colladadom
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ BINARY_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ TARGET collada14dom
+ CMAKE_FLAGS
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DOPT_COLLADA14:BOOL=ON
+ -DCOLLADA_DOM_INCLUDE_INSTALL_DIR:FILEPATH=${LIBS_PREBUILT_DIR}/include/colladadom
+ -DCOLLADA_DOM_SOVERSION:STRING=0
+ -DCOLLADA_DOM_VERSION:STRING=2.3-r4
+ -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp
+ -DZLIB_LIBRARIES:STRING=xml2
+ -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem-mt
+ -DBoost_SYSTEM_LIBRARY:STRING=boost_system-mt
+ -DEXTRA_COMPILE_FLAGS:STRING=-I/opt/local/include/minizip
+ -DBoost_CFLAGS:STRING=-I/opt/local/include
+ -DCMAKE_SHARED_LINKER_FLAGS:STRING=-L/opt/local/lib
+ -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}
+ -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15
+ OUTPUT_VARIABLE colladadom_installed
+ )
+ else (DARWIN)
+ try_compile(COLLADADOM_RESULT
+ PROJECT colladadom
+ SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ BINARY_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4
+ TARGET collada14dom
+ CMAKE_FLAGS
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ -DOPT_COLLADA14:BOOL=ON
+ -DCOLLADA_DOM_INCLUDE_INSTALL_DIR:FILEPATH=${LIBS_PREBUILT_DIR}/include/colladadom
+ -DCOLLADA_DOM_SOVERSION:STRING=0
+ -DCOLLADA_DOM_VERSION:STRING=2.3-r4
+ -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp
+ -DZLIB_LIBRARIES:STRING=xml2
+ OUTPUT_VARIABLE colladadom_installed
+ )
+ endif (DARWIN)
+ if (${MESHOPTIMIZER_RESULT})
+ file(
+ COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/include
+ DESTINATION ${LIBS_PREBUILT_DIR}/include/colladadom
+ )
+ file(
+ COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/libcollada14dom.a
+ DESTINATION ${LIBS_PREBUILT_DIR}/lib/release
+ )
+ file(WRITE ${PREBUILD_TRACKING_DIR}/colladadom_installed "0")
+ endif (${MESHOPTIMIZER_RESULT})
+else( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS )
use_system_binary( colladadom )
use_prebuilt_binary(colladadom)
use_prebuilt_binary(minizip-ng) # needed for colladadom
use_prebuilt_binary(pcre)
use_prebuilt_binary(libxml2)
+endif( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS )
target_link_libraries( ll::pcre INTERFACE pcrecpp pcre )