diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-08-31 09:17:29 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-08-31 09:19:17 +0800 |
commit | b77d94038b215a5227950153195e8f3895b4c773 (patch) | |
tree | 57e33720c8cee50243842ecce18dab52b5a44a8d | |
parent | 6bc9ec41ddd0191748ef938909a3ed192c9e59cd (diff) |
Fix logics in deciding to build ColladaDOM or not
So that colladadom_installed won't throw USESYSTEMLIBS to the next
scope.
Also libpcrecpp_LIBRARIES doesn't take spaces (might work by escaping
the quotes, but only 1 pcrecpp needed anyway).
-rw-r--r-- | indra/cmake/LLPrimitive.cmake | 143 |
1 files changed, 72 insertions, 71 deletions
diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index ed57d6ed89..9ea7ff899e 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -28,84 +28,85 @@ if(LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD ) return () endif(LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD ) -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} - ) - - file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/collada/1.4) - include(FindPkgConfig) - pkg_check_modules(Minizip REQUIRED minizip) - pkg_check_modules(Libxml2 REQUIRED libxml-2.0) - pkg_check_modules(Libpcrecpp libpcrecpp) - 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/collada - -DCOLLADA_DOM_SOVERSION:STRING=0 - -DCOLLADA_DOM_VERSION:STRING=2.3-r4 - -DEXTRA_COMPILE_FLAGS:STRING="-I${Minizip_INCLUDE_DIRS} -I${Libxml2_INCLUDE_DIRS}" - -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L${Libxml2_LIBRARY_DIRS} -l${Libxml2_LIBRARIES}" - -Dlibpcrecpp_LIBRARIES:STRING="${Libpcrecpp_LIBRARIES}" - -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem-mt - -DBoost_SYSTEM_LIBRARY:STRING=boost_system-mt - -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/collada - -DCOLLADA_DOM_SOVERSION:STRING=0 - -DCOLLADA_DOM_VERSION:STRING=2.3-r4 - -DEXTRA_COMPILE_FLAGS:STRING="-I${Minizip_INCLUDE_DIRS} -I${Libxml2_INCLUDE_DIRS} -I${Libpcrecpp_INCLUDE_DIRS}" - -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L${Libxml2_LIBRARY_DIRS} -l${Libxml2_LIBRARIES}" - -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp - -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem - -DBoost_SYSTEM_LIBRARY:STRING=boost_system - OUTPUT_VARIABLE colladadom_installed - ) - endif (DARWIN) - if (${COLLADADOM_RESULT}) - file(REMOVE_RECURSE ${LIBS_PREBUILT_DIR}/include/collada) - file( - COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/include - DESTINATION ${LIBS_PREBUILT_DIR}/include/collada - ) - file( - COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/libcollada14dom.a - DESTINATION ${LIBS_PREBUILT_DIR}/lib/release +if( USESYSTEMLIBS ) + if ( ${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0 ) + 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} ) - file(WRITE ${PREBUILD_TRACKING_DIR}/colladadom_installed "0") - endif (${COLLADADOM_RESULT}) -else( (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0) AND USESYSTEMLIBS ) + file(MAKE_DIRECTORY ${LIBS_PREBUILT_DIR}/include/collada/1.4) + include(FindPkgConfig) + pkg_check_modules(Minizip REQUIRED minizip) + pkg_check_modules(Libxml2 REQUIRED libxml-2.0) + pkg_check_modules(Libpcrecpp libpcrecpp) + 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/collada + -DCOLLADA_DOM_SOVERSION:STRING=0 + -DCOLLADA_DOM_VERSION:STRING=2.3-r4 + -DEXTRA_COMPILE_FLAGS:STRING="-I${Minizip_INCLUDE_DIRS} -I${Libxml2_INCLUDE_DIRS}" + -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L${Libxml2_LIBRARY_DIRS} -l${Libxml2_LIBRARIES}" + -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp + -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem-mt + -DBoost_SYSTEM_LIBRARY:STRING=boost_system-mt + -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/collada + -DCOLLADA_DOM_SOVERSION:STRING=0 + -DCOLLADA_DOM_VERSION:STRING=2.3-r4 + -DEXTRA_COMPILE_FLAGS:STRING="-I${Minizip_INCLUDE_DIRS} -I${Libxml2_INCLUDE_DIRS} -I${Libpcrecpp_INCLUDE_DIRS}" + -DCMAKE_SHARED_LINKER_FLAGS:STRING="-L${Libxml2_LIBRARY_DIRS} -l${Libxml2_LIBRARIES}" + -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp + -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem + -DBoost_SYSTEM_LIBRARY:STRING=boost_system + OUTPUT_VARIABLE colladadom_installed + ) + endif (DARWIN) + if (${COLLADADOM_RESULT}) + file(REMOVE_RECURSE ${LIBS_PREBUILT_DIR}/include/collada) + file( + COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/dom/include + DESTINATION ${LIBS_PREBUILT_DIR}/include/collada + ) + 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 (${COLLADADOM_RESULT}) + endif( ${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0 ) +else( 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 ) +endif( USESYSTEMLIBS ) target_link_libraries( ll::pcre INTERFACE pcrecpp pcre ) |