diff options
author | Erik Kundiman <erik@megapahit.org> | 2024-09-30 11:48:20 +0800 |
---|---|---|
committer | Erik Kundiman <erik@megapahit.org> | 2024-09-30 11:48:20 +0800 |
commit | f7873910039b45b4426172cea1f0db3f79f349c5 (patch) | |
tree | 85ef3c36ed31ba135a012014bf26fc004ccca31d /indra | |
parent | e6165435ab48673612bf8896d68bcd2543176692 (diff) |
Windows configuration, with MSYS2 in MinGW for now
Also simplify CMake-based dependency projects, the parameters that
have been set for the viewer seem to have been implied all this time
for the subprojects.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/cmake/Boost.cmake | 12 | ||||
-rw-r--r-- | indra/cmake/CURL.cmake | 2 | ||||
-rw-r--r-- | indra/cmake/LLPrimitive.cmake | 43 | ||||
-rw-r--r-- | indra/cmake/LLWindow.cmake | 2 | ||||
-rw-r--r-- | indra/cmake/Meshoptimizer.cmake | 99 | ||||
-rw-r--r-- | indra/cmake/NDOF.cmake | 18 | ||||
-rw-r--r-- | indra/cmake/OpenJPEG.cmake | 96 | ||||
-rw-r--r-- | indra/cmake/OpenSSL.cmake | 6 | ||||
-rw-r--r-- | indra/cmake/ViewerMiscLibs.cmake | 8 | ||||
-rw-r--r-- | indra/cmake/WebRTC.cmake | 2 |
10 files changed, 124 insertions, 164 deletions
diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 31bb4124c2..26c0843300 100644 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -9,13 +9,17 @@ if( USE_CONAN ) target_compile_definitions( ll::boost INTERFACE BOOST_ALLOW_DEPRECATED_HEADERS BOOST_BIND_GLOBAL_PLACEHOLDERS ) return() elseif( NOT USE_AUTOBUILD_3P ) - if (DARWIN) - set(sfx "-mt") + if (WINDOWS) + set(sfx -mt) + target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/x86_64-w64-mingw32/include) + target_link_directories( ll::boost INTERFACE /opt/local/x86_64-w64-mingw32/lib) + elseif (DARWIN) + set(sfx -mt) target_include_directories( ll::boost SYSTEM INTERFACE /opt/local/libexec/boost/1.81/include) target_link_directories( ll::boost INTERFACE /opt/local/libexec/boost/1.81/lib) - else (DARWIN) + else (WINDOWS) find_package( Boost REQUIRED ) - endif (DARWIN) + endif (WINDOWS) target_link_libraries( ll::boost INTERFACE boost_context${sfx} boost_fiber${sfx} diff --git a/indra/cmake/CURL.cmake b/indra/cmake/CURL.cmake index 678e7c43c8..b85de3b845 100644 --- a/indra/cmake/CURL.cmake +++ b/indra/cmake/CURL.cmake @@ -89,7 +89,7 @@ elseif (CMAKE_SYSTEM_NAME MATCHES FreeBSD AND (${PREBUILD_TRACKING_DIR}/sentinel ) file(WRITE ${PREBUILD_TRACKING_DIR}/curl_installed "${curl_installed}") endif (DARWIN OR LINUX OR NOT USESYSTEMLIBS) -if (WINDOWS) +if (WINDOWS AND NOT USESYSTEMLIBS) target_link_libraries(ll::libcurl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libcurl.lib ll::openssl diff --git a/indra/cmake/LLPrimitive.cmake b/indra/cmake/LLPrimitive.cmake index e491eb2e32..0a6e55efeb 100644 --- a/indra/cmake/LLPrimitive.cmake +++ b/indra/cmake/LLPrimitive.cmake @@ -19,24 +19,31 @@ if( USE_CONAN ) endif() if( USESYSTEMLIBS ) - if( LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) - # Build of the collada-dom for Linux and FreeBSD is done in - # indra/llprimitive/CMakeLists.txt - return () - endif( LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) include(FindPkgConfig) pkg_check_modules(Minizip REQUIRED minizip) pkg_check_modules(Libxml2 REQUIRED libxml-2.0) pkg_check_modules(Libpcrecpp libpcrecpp) target_link_libraries( ll::minizip-ng INTERFACE ${Minizip_LIBRARIES} ) target_link_libraries( ll::libxml INTERFACE ${Libxml2_LIBRARIES} ) - 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) + if( WINDOWS ) + include(FindPkgConfig) + pkg_check_modules(Colladadom REQUIRED collada-dom-141) + target_compile_definitions( ll::colladadom INTERFACE COLLADA_DOM_SUPPORT141 ) + target_include_directories( ll::colladadom SYSTEM INTERFACE ${Colladadom_INCLUDE_DIRS} ) + target_link_directories( ll::colladadom INTERFACE ${Colladadom_LIBRARY_DIRS} ) + target_link_libraries( ll::colladadom INTERFACE ${Colladadom_LIBRARIES} ) + return () + elseif( LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD ) + # Build of the collada-dom for Linux and FreeBSD is done in + # indra/llprimitive/CMakeLists.txt + return () + elseif( ${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) + 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} @@ -49,7 +56,6 @@ if( USESYSTEMLIBS ) BINARY_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4 TARGET collada14dom CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS:STRING=-I${Minizip_INCLUDE_DIRS} "-DCMAKE_SHARED_LINKER_FLAGS:STRING=-L${Minizip_LIBRARY_DIRS} -L${Minizip_LIBRARY_DIRS}exec/boost/1.81/lib" -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp @@ -63,11 +69,9 @@ if( USESYSTEMLIBS ) -DCOLLADA_DOM_INCLUDE_INSTALL_DIR:FILEPATH=${LIBS_PREBUILT_DIR}/include/collada -DCOLLADA_DOM_SOVERSION:STRING=0 -DCOLLADA_DOM_VERSION:STRING=2.3-r4 - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 OUTPUT_VARIABLE colladadom_installed ) - if (${COLLADADOM_RESULT}) + if( ${COLLADADOM_RESULT} ) file( COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/src/1.4/libcollada14dom.2.3-r4.dylib @@ -76,7 +80,7 @@ if( USESYSTEMLIBS ) DESTINATION ${LIBS_PREBUILT_DIR}/lib/release FOLLOW_SYMLINK_CHAIN ) - endif (${COLLADADOM_RESULT}) + endif( ${COLLADADOM_RESULT} ) else( DARWIN ) execute_process( COMMAND sed -i "" -e "s/SHARED/STATIC/g" 1.4/CMakeLists.txt @@ -88,29 +92,28 @@ if( USESYSTEMLIBS ) BINARY_DIR ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4 TARGET collada14dom CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} -DCMAKE_CXX_FLAGS:STRING=-I${Minizip_INCLUDE_DIRS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=-L${Minizip_LIBRARY_DIRS} -Dlibpcrecpp_LIBRARIES:STRING=pcrecpp -DZLIB_LIBRARIES:STRING=${Libxml2_LIBRARIES} -DBoost_FILESYSTEM_LIBRARY:STRING=boost_filesystem -DBoost_SYSTEM_LIBRARY:STRING=boost_system + -Dlibpcrecpp_CFLAGS_OTHERS:STRING=-I${Libpcrecpp_INCLUDE_DIRS} -DEXTRA_COMPILE_FLAGS:STRING=-I${Libxml2_INCLUDE_DIRS} - -DBoost_CFLAGS:STRING=-I${Libpcrecpp_INCLUDE_DIRS} -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 OUTPUT_VARIABLE colladadom_installed ) - if (${COLLADADOM_RESULT}) + if( ${COLLADADOM_RESULT} ) file( COPY ${CMAKE_BINARY_DIR}/3p-colladadom-2.3-r4/src/1.4/libcollada14dom.a DESTINATION ${LIBS_PREBUILT_DIR}/lib/release ) - endif (${COLLADADOM_RESULT}) + endif( ${COLLADADOM_RESULT} ) endif( DARWIN ) - if (${COLLADADOM_RESULT}) + if( ${COLLADADOM_RESULT} ) file(REMOVE_RECURSE ${LIBS_PREBUILT_DIR}/include/collada/1.4) file( COPY @@ -123,8 +126,8 @@ if( USESYSTEMLIBS ) DESTINATION ${LIBS_PREBUILT_DIR}/include/collada ) file(WRITE ${PREBUILD_TRACKING_DIR}/colladadom_installed "${colladadom_installed}") - endif (${COLLADADOM_RESULT}) - endif( ${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/colladadom_installed OR NOT ${colladadom_installed} EQUAL 0 ) + endif( ${COLLADADOM_RESULT} ) + endif( WINDOWS ) else( USESYSTEMLIBS ) use_system_binary( colladadom ) diff --git a/indra/cmake/LLWindow.cmake b/indra/cmake/LLWindow.cmake index 383051a4a6..31907d31df 100644 --- a/indra/cmake/LLWindow.cmake +++ b/indra/cmake/LLWindow.cmake @@ -7,7 +7,7 @@ include(Prebuilt) include_guard() add_library( ll::SDL INTERFACE IMPORTED ) -if (USESYSTEMLIBS AND NOT DARWIN) +if (USESYSTEMLIBS AND NOT (WINDOWS OR DARWIN)) include(FindPkgConfig) pkg_check_modules(Sdl2 REQUIRED sdl2) target_compile_definitions( ll::SDL INTERFACE LL_SDL=1) diff --git a/indra/cmake/Meshoptimizer.cmake b/indra/cmake/Meshoptimizer.cmake index 0dc4069431..e1bfe10e93 100644 --- a/indra/cmake/Meshoptimizer.cmake +++ b/indra/cmake/Meshoptimizer.cmake @@ -8,72 +8,49 @@ add_library( ll::meshoptimizer INTERFACE IMPORTED ) if (NOT USESYSTEMLIBS) use_system_binary(meshoptimizer) -else (NOT USESYSTEMLIBS) - if (NOT (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN)) - find_package(meshoptimizer) - target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) - endif (NOT (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN)) +elseif (${LINUX_DISTRO} MATCHES debian OR (${LINUX_DISTRO} MATCHES ubuntu) OR CMAKE_SYSTEM_NAME MATCHES FreeBSD) + find_package(meshoptimizer) + target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer) + return () endif (NOT USESYSTEMLIBS) -if (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR NOT USESYSTEMLIBS) - if (USESYSTEMLIBS) - if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed OR NOT ${meshoptimizer_installed} EQUAL 0) - if (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz) - file(DOWNLOAD - https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz - ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz - ) - endif (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz) - file(ARCHIVE_EXTRACT - INPUT ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz - DESTINATION ${CMAKE_BINARY_DIR} - ) - if (DARWIN) - try_compile(MESHOPTIMIZER_RESULT - PROJECT meshoptimizer - SOURCE_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 - BINARY_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 - TARGET meshoptimizer - CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 - OUTPUT_VARIABLE meshoptimizer_installed - ) - else (DARWIN) - try_compile(MESHOPTIMIZER_RESULT - PROJECT meshoptimizer - SOURCE_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 - BINARY_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 - TARGET meshoptimizer - CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - OUTPUT_VARIABLE meshoptimizer_installed - ) - endif (DARWIN) - if (${MESHOPTIMIZER_RESULT}) - file( - COPY ${CMAKE_BINARY_DIR}/meshoptimizer-0.21/src/meshoptimizer.h - DESTINATION ${LIBS_PREBUILT_DIR}/include/meshoptimizer - ) - file( - COPY ${CMAKE_BINARY_DIR}/meshoptimizer-0.21/libmeshoptimizer.a - DESTINATION ${LIBS_PREBUILT_DIR}/lib/release - ) - file(WRITE ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed "0") - endif (${MESHOPTIMIZER_RESULT}) - endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed OR NOT ${meshoptimizer_installed} EQUAL 0) - else (USESYSTEMLIBS) +if (LINUX OR NOT USESYSTEMLIBS) use_prebuilt_binary(meshoptimizer) - endif (USESYSTEMLIBS) +elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed OR NOT ${meshoptimizer_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz) + file(DOWNLOAD + https://github.com/zeux/meshoptimizer/archive/refs/tags/v0.21.tar.gz + ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/meshoptimizer-0.21.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + try_compile(MESHOPTIMIZER_RESULT + PROJECT meshoptimizer + SOURCE_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 + BINARY_DIR ${CMAKE_BINARY_DIR}/meshoptimizer-0.21 + TARGET meshoptimizer + OUTPUT_VARIABLE meshoptimizer_installed + ) + if (${MESHOPTIMIZER_RESULT}) + file( + COPY ${CMAKE_BINARY_DIR}/meshoptimizer-0.21/src/meshoptimizer.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/meshoptimizer + ) + file( + COPY ${CMAKE_BINARY_DIR}/meshoptimizer-0.21/libmeshoptimizer.a + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/meshoptimizer_installed "${meshoptimizer_installed}") + endif (${MESHOPTIMIZER_RESULT}) +endif (LINUX OR NOT USESYSTEMLIBS) -if (WINDOWS) +if (NOT USESYSTEMLIBS AND WINDOWS) target_link_libraries( ll::meshoptimizer INTERFACE meshoptimizer.lib) -elseif (LINUX) +else (NOT USESYSTEMLIBS AND WINDOWS) target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) -elseif (DARWIN) - target_link_libraries( ll::meshoptimizer INTERFACE libmeshoptimizer.a) -endif (WINDOWS) +endif (NOT USESYSTEMLIBS AND WINDOWS) target_include_directories( ll::meshoptimizer SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include/meshoptimizer) -endif (${LINUX_DISTRO} MATCHES fedora OR (${LINUX_DISTRO} MATCHES opensuse-tumbleweed) OR DARWIN OR NOT USESYSTEMLIBS) diff --git a/indra/cmake/NDOF.cmake b/indra/cmake/NDOF.cmake index 1bf6c5086c..b75bb2509d 100644 --- a/indra/cmake/NDOF.cmake +++ b/indra/cmake/NDOF.cmake @@ -8,8 +8,9 @@ add_library( ll::ndof INTERFACE IMPORTED ) if (NDOF) if (WINDOWS OR DARWIN) - if (USESYSTEMLIBS) - if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/libndofdev_installed OR NOT ${libndofdev_installed} EQUAL 0) + if (NOT USESYSTEMLIBS) + use_prebuilt_binary(libndofdev) + elseif (DARWIN AND (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/libndofdev_installed OR NOT ${libndofdev_installed} EQUAL 0)) file(DOWNLOAD https://github.com/secondlife/3p-libndofdev/archive/refs/tags/v0.1.8e9edc7.tar.gz ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7.tar.gz @@ -23,11 +24,7 @@ if (NDOF) SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev BINARY_DIR ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev TARGET ndofdev - CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 - -DCMAKE_C_FLAGS:STRING=-DTARGET_OS_MAC\ -Wno-int-conversion + CMAKE_FLAGS -DCMAKE_C_FLAGS:STRING=-DTARGET_OS_MAC\ -Wno-int-conversion OUTPUT_VARIABLE libndofdev_installed ) if (${LIBNDOFDEV_RESULT}) @@ -39,12 +36,9 @@ if (NDOF) COPY ${CMAKE_BINARY_DIR}/3p-libndofdev-0.1.8e9edc7/libndofdev/src/libndofdev.dylib DESTINATION ${LIBS_PREBUILT_DIR}/lib/release ) - file(WRITE ${PREBUILD_TRACKING_DIR}/libndofdev_installed "0") + file(WRITE ${PREBUILD_TRACKING_DIR}/libndofdev_installed "${libndofdev_installed}") endif (${LIBNDOFDEV_RESULT}) - endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/libndofdev_installed OR NOT ${libndofdev_installed} EQUAL 0) - else (USESYSTEMLIBS) - use_prebuilt_binary(libndofdev) - endif (USESYSTEMLIBS) + endif (NOT USESYSTEMLIBS) elseif (LINUX) use_prebuilt_binary(open-libndofdev) endif (WINDOWS OR DARWIN) diff --git a/indra/cmake/OpenJPEG.cmake b/indra/cmake/OpenJPEG.cmake index b1f776ad1d..34028e0f76 100644 --- a/indra/cmake/OpenJPEG.cmake +++ b/indra/cmake/OpenJPEG.cmake @@ -7,65 +7,45 @@ add_library( ll::openjpeg INTERFACE IMPORTED ) if (NOT USESYSTEMLIBS) use_system_binary(openjpeg) endif (NOT USESYSTEMLIBS) -if (USESYSTEMLIBS AND NOT LINUX) - if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0) - if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz) - file(DOWNLOAD - https://github.com/secondlife/3p-openjpeg/archive/refs/tags/v2.5.0.ea12248.tar.gz - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz - ) - endif (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz) - file(ARCHIVE_EXTRACT - INPUT ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz - DESTINATION ${CMAKE_BINARY_DIR} - ) - if (DARWIN) - try_compile(OPENJPEG_RESULT - PROJECT OPENJPEG - SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg - BINARY_DIR ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg - TARGET openjp2 - CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DBUILD_SHARED_LIBS:BOOL=OFF - -DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES} - -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.15 - OUTPUT_VARIABLE openjpeg_installed - ) - else (DARWIN) - try_compile(OPENJPEG_RESULT - PROJECT OPENJPEG - SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg - BINARY_DIR ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg - TARGET openjp2 - CMAKE_FLAGS - -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} - -DBUILD_SHARED_LIBS:BOOL=OFF - -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON - OUTPUT_VARIABLE openjpeg_installed - ) - endif (DARWIN) - if (${OPENJPEG_RESULT}) - file( - COPY - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/cio.h - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/event.h - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/openjpeg.h - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/opj_config.h - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/opj_config_private.h - ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/opj_stdint.h - DESTINATION ${LIBS_PREBUILT_DIR}/include/openjpeg - ) - file( - COPY ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/bin/libopenjp2.a - DESTINATION ${LIBS_PREBUILT_DIR}/lib/release - ) - file(WRITE ${PREBUILD_TRACKING_DIR}/openjpeg_installed "${openjpeg_installed}") - endif (${OPENJPEG_RESULT}) - endif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0) -else (USESYSTEMLIBS AND NOT LINUX) +if (LINUX OR NOT USESYSTEMLIBS) use_prebuilt_binary(openjpeg) -endif (USESYSTEMLIBS AND NOT LINUX) +elseif (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/openjpeg_installed OR NOT ${openjpeg_installed} EQUAL 0) + if (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz) + file(DOWNLOAD + https://github.com/secondlife/3p-openjpeg/archive/refs/tags/v2.5.0.ea12248.tar.gz + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz + ) + endif (NOT EXISTS ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz) + file(ARCHIVE_EXTRACT + INPUT ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248.tar.gz + DESTINATION ${CMAKE_BINARY_DIR} + ) + try_compile(OPENJPEG_RESULT + PROJECT OPENJPEG + SOURCE_DIR ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg + BINARY_DIR ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg + TARGET openjp2 + CMAKE_FLAGS -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON + OUTPUT_VARIABLE openjpeg_installed + ) + if (${OPENJPEG_RESULT}) + file( + COPY + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/cio.h + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/event.h + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/openjpeg.h + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/opj_config.h + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/opj_config_private.h + ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/src/lib/openjp2/opj_stdint.h + DESTINATION ${LIBS_PREBUILT_DIR}/include/openjpeg + ) + file( + COPY ${CMAKE_BINARY_DIR}/3p-openjpeg-2.5.0.ea12248/openjpeg/bin/libopenjp2.a + DESTINATION ${LIBS_PREBUILT_DIR}/lib/release + ) + file(WRITE ${PREBUILD_TRACKING_DIR}/openjpeg_installed "${openjpeg_installed}") + endif (${OPENJPEG_RESULT}) +endif (LINUX OR NOT USESYSTEMLIBS) target_link_libraries(ll::openjpeg INTERFACE openjp2 ) target_include_directories( ll::openjpeg SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) diff --git a/indra/cmake/OpenSSL.cmake b/indra/cmake/OpenSSL.cmake index 94550b9e2a..c6481c89e9 100644 --- a/indra/cmake/OpenSSL.cmake +++ b/indra/cmake/OpenSSL.cmake @@ -178,12 +178,14 @@ elseif (CMAKE_SYSTEM_NAME MATCHES FreeBSD AND (${PREBUILD_TRACKING_DIR}/sentinel ) file(WRITE ${PREBUILD_TRACKING_DIR}/openssl_installed "${openssl_installed}") endif (DARWIN OR LINUX OR NOT USESYSTEMLIBS) -if (WINDOWS) +if (WINDOWS AND NOT USESYSTEMLIBS) target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.lib ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.lib Crypt32.lib) elseif (LINUX) target_link_libraries(ll::openssl INTERFACE ${ARCH_PREBUILT_DIRS_RELEASE}/libssl.a ${ARCH_PREBUILT_DIRS_RELEASE}/libcrypto.a dl) else() target_link_libraries(ll::openssl INTERFACE ssl crypto) -endif (WINDOWS) +endif (WINDOWS AND NOT USESYSTEMLIBS) +if (NOT (WINDOWS AND USESYSTEMLIBS)) target_include_directories( ll::openssl SYSTEM INTERFACE ${LIBS_PREBUILT_DIR}/include) +endif (NOT (WINDOWS AND USESYSTEMLIBS)) diff --git a/indra/cmake/ViewerMiscLibs.cmake b/indra/cmake/ViewerMiscLibs.cmake index 0a5191ff08..13f5ebf862 100644 --- a/indra/cmake/ViewerMiscLibs.cmake +++ b/indra/cmake/ViewerMiscLibs.cmake @@ -1,12 +1,12 @@ # -*- cmake -*- include(Prebuilt) -if (NOT DARWIN) +if (NOT (WINDOWS OR DARWIN)) add_library( ll::fontconfig INTERFACE IMPORTED ) find_package(Fontconfig REQUIRED) target_link_libraries( ll::fontconfig INTERFACE Fontconfig::Fontconfig ) -endif (NOT DARWIN) +endif (NOT (WINDOWS OR DARWIN)) if( USE_AUTOBUILD_3P ) use_prebuilt_binary(libhunspell) @@ -16,8 +16,8 @@ if (NOT USESYSTEMLIBS) use_prebuilt_binary(slvoice) endif (NOT USESYSTEMLIBS) -if ((${LINUX_DISTRO} MATCHES debian OR DARWIN) OR NOT USESYSTEMLIBS) +if ((${LINUX_DISTRO} MATCHES debian OR WINDOWS OR DARWIN) OR NOT USESYSTEMLIBS) use_prebuilt_binary(nanosvg) -endif ((${LINUX_DISTRO} MATCHES debian OR DARWIN) OR NOT USESYSTEMLIBS) +endif ((${LINUX_DISTRO} MATCHES debian OR WINDOWS OR DARWIN) OR NOT USESYSTEMLIBS) use_prebuilt_binary(viewer-fonts) use_prebuilt_binary(emoji_shortcodes) diff --git a/indra/cmake/WebRTC.cmake b/indra/cmake/WebRTC.cmake index 89ac794c89..eec4e2ce7a 100644 --- a/indra/cmake/WebRTC.cmake +++ b/indra/cmake/WebRTC.cmake @@ -8,7 +8,7 @@ add_library( ll::webrtc INTERFACE IMPORTED ) target_include_directories( ll::webrtc SYSTEM INTERFACE "${LIBS_PREBUILT_DIR}/include/webrtc" "${LIBS_PREBUILT_DIR}/include/webrtc/third_party/abseil-cpp") if (${LINUX_DISTRO} MATCHES debian OR CMAKE_OSX_ARCHITECTURES MATCHES x86_64) use_prebuilt_binary(webrtc) -elseif (NOT CMAKE_SYSTEM_NAME MATCHES FreeBSD) +elseif (NOT (WINDOWS OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)) target_compile_definitions(ll::webrtc INTERFACE CM_WEBRTC=1) if (${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/webrtc_installed OR NOT ${webrtc_installed} EQUAL 0) if (DARWIN) |