summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-08-11 15:49:22 +0800
committerErik Kundiman <erik@megapahit.org>2024-08-11 15:59:24 +0800
commit1685e1590f7cb6e03d697f7abd1570f51dd37778 (patch)
tree55006310d11e48c105f1167a8534aa45b87e1e6d
parent1b2d37285d4ae85bb10dd543ff2a40ea3e5419ee (diff)
Minimise UnixInstall.cmake difference from SLv's
The variables set in this file are used only in llfilesystem/CMakeLists.txt, and only used within a Linux (& FreeBSD) section, which then later used in llfilesystem/lldir_linux.cpp, so Darwin doesn't need these variables set specifically for it.
-rw-r--r--README.md6
-rw-r--r--indra/cmake/UnixInstall.cmake92
-rw-r--r--indra/llfilesystem/CMakeLists.txt11
3 files changed, 41 insertions, 68 deletions
diff --git a/README.md b/README.md
index f7811ee9c1..f46e97a74c 100644
--- a/README.md
+++ b/README.md
@@ -146,7 +146,7 @@ $ cd packages
$ tar xf ~/Downloads/nanosvg-2022.09.27-linux-580337.tar.bz2
$ cd ..
$ sudo apt install pkg-config libaprutil1-dev libboost-fiber-dev libboost-program-options-dev libboost-regex-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libfontconfig-dev libfreetype-dev libglu1-mesa-dev libhunspell-dev libjpeg-dev libjsoncpp-dev libmeshoptimizer-dev libnghttp2-dev libpng-dev libpipewire-0.3-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxft-dev libxmlrpc-epi-dev libxxhash-dev
-$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../../indra
+$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../../indra
$ make -j`nproc`
$ cpack -G DEB
$ sudo apt install megapahit-`cat newview/viewer_version.txt`-Linux.deb
@@ -157,7 +157,7 @@ $ megapahit
```
$ sudo apt install pkg-config libaprutil1-dev libboost-fiber-dev libboost-program-options-dev libboost-regex-dev libcollada-dom-dev libexpat1-dev libfltk1.3-dev libglu1-mesa-dev libhunspell-dev libjsoncpp-dev libmeshoptimizer-dev libnanosvg-dev libnghttp2-dev libpipewire-0.3-dev libsdl2-dev liburiparser-dev libvlc-dev libvlccore-dev libvorbis-dev libxmlrpc-epi-dev libxxhash-dev
-$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../../indra
+$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../../indra
$ make -j`nproc`
$ cpack -G DEB
$ sudo apt install megapahit-`cat newview/viewer_version.txt`-Linux.deb
@@ -168,7 +168,7 @@ $ megapahit
```
$ sudo dnf install gcc-c++ patchelf apr-util-devel boost-devel collada-dom-devel expat-devel fltk-devel mesa-libGLU-devel hunspell-devel jsoncpp-devel libnghttp2-devel nanosvg-devel pipewire-devel pulseaudio-libs-devel SDL2-devel uriparser-devel vlc-devel libvorbis-devel xmlrpc-epi-devel xxhash-devel
-$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../../indra
+$ cmake -DCMAKE_BUILD_TYPE:STRING=Release -DADDRESS_SIZE:INTERNAL=64 -DUSESYSTEMLIBS:BOOL=ON -DUSE_OPENAL:BOOL=OFF -DUSE_FMODSTUDIO:BOOL=ON -DLL_TESTS:BOOL=OFF -DNDOF:BOOL=ON -DVIEWER_CHANNEL:STRING=Megapahit -DVIEWER_BINARY_NAME:STRING=megapahit -DBUILD_SHARED_LIBS:BOOL=OFF -DINSTALL:BOOL=ON -DPACKAGE:BOOL=ON ../../indra
$ make -j`nproc`
$ cpack -G RPM
$ sudo rpm -i megapahit-`cat newview/viewer_version.txt`-Linux.rpm
diff --git a/indra/cmake/UnixInstall.cmake b/indra/cmake/UnixInstall.cmake
index 59620b60b4..021700b374 100644
--- a/indra/cmake/UnixInstall.cmake
+++ b/indra/cmake/UnixInstall.cmake
@@ -6,64 +6,36 @@ set(INSTALL OFF CACHE BOOL
"Generate install target.")
if (INSTALL)
-
- if (DARWIN)
-
- set(INSTALL_PREFIX
- ${viewer_BINARY_DIR}/${VIEWER_CHANNEL}.app/Contents
- CACHE PATH
- "Top-level installation directory.")
-
- set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/Resources
- CACHE PATH
- "Installation directory for read-only shared files.")
-
- set(INSTALL_SHARE_DIR ${INSTALL_LIBRARY_DIR} CACHE PATH
- "Installation directory for read-only shared files.")
-
- set(APP_BINARY_DIR ${INSTALL_PREFIX}/MacOS
- CACHE PATH
- "Installation directory for binaries.")
-
- set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}
- CACHE PATH
- "Installation directory for read-only data files.")
-
- set(APP_LIBEXEC_DIR ${INSTALL_LIBRARY_DIR}
- CACHE PATH
- "Installation directory for non-manual executables.")
-
- else (DARWIN)
-
- set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH
- "Top-level installation directory.")
-
- if (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu)
- set(_LIB lib/${ARCH}-linux-gnu)
- elseif (EXISTS /lib64)
- set(_LIB lib64)
- else ()
- set(_LIB lib)
- endif ()
-
- set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH
- "Installation directory for read-only shared files.")
-
- set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH
- "Installation directory for read-only shared files.")
-
- set(APP_BINARY_DIR ${INSTALL_PREFIX}/bin
- CACHE PATH
- "Installation directory for binaries.")
-
- set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME}
- CACHE PATH
- "Installation directory for read-only data files.")
-
- set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME}
- CACHE PATH
- "Installation directory for non-manual executables.")
-
- endif (DARWIN)
-
+ if (CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+ set(INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX} CACHE PATH
+ "Top-level installation directory.")
+ else (CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+ set(INSTALL_PREFIX /usr CACHE PATH
+ "Top-level installation directory.")
+ endif (CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+
+ if (EXISTS /lib64)
+ set(_LIB lib64)
+ elseif (EXISTS ${CMAKE_SYSROOT}/usr/lib/${ARCH}-linux-gnu)
+ set(_LIB lib/${ARCH}-linux-gnu)
+ else (EXISTS /lib64)
+ set(_LIB lib)
+ endif (EXISTS /lib64)
+
+ set(INSTALL_LIBRARY_DIR ${INSTALL_PREFIX}/${_LIB} CACHE PATH
+ "Installation directory for read-only shared files.")
+
+ set(INSTALL_SHARE_DIR ${INSTALL_PREFIX}/share CACHE PATH
+ "Installation directory for read-only shared files.")
+
+ set(APP_BINARY_DIR ${INSTALL_LIBRARY_DIR}/secondlife-${viewer_VERSION}
+ CACHE PATH
+ "Installation directory for binaries.")
+
+ set(APP_SHARE_DIR ${INSTALL_SHARE_DIR}/${VIEWER_BINARY_NAME}
+ CACHE PATH
+ "Installation directory for read-only data files.")
+ set(APP_LIBEXEC_DIR ${INSTALL_PREFIX}/libexec/${VIEWER_BINARY_NAME}
+ CACHE PATH
+ "Installation directory for non-manual executables.")
endif (INSTALL)
diff --git a/indra/llfilesystem/CMakeLists.txt b/indra/llfilesystem/CMakeLists.txt
index 22c30c55d9..8d85f739b3 100644
--- a/indra/llfilesystem/CMakeLists.txt
+++ b/indra/llfilesystem/CMakeLists.txt
@@ -4,7 +4,9 @@ project(llfilesystem)
include(00-Common)
include(LLCommon)
-include(UnixInstall)
+if (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
+ include(UnixInstall)
+endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
set(llfilesystem_SOURCE_FILES
lldir.cpp
@@ -31,17 +33,17 @@ if (DARWIN)
LIST(APPEND llfilesystem_HEADER_FILES lldir_mac.h)
endif (DARWIN)
-if (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+if (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
LIST(APPEND llfilesystem_SOURCE_FILES lldir_linux.cpp)
LIST(APPEND llfilesystem_HEADER_FILES lldir_linux.h)
if (INSTALL)
set_source_files_properties(lldir_linux.cpp
PROPERTIES COMPILE_FLAGS
- "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\" -DAPP_PLUGIN_DIR=\\\"${INSTALL_LIBRARY_DIR}\\\""
+ "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\" -DAPP_LIBEXEC_DIR=\\\"${APP_LIBEXEC_DIR}\\\" -DAPP_PLUGIN_DIR=\\\"${INSTALL_LIBRARY_DIR}\\\""
)
endif (INSTALL)
-endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES "FreeBSD")
+endif (LINUX OR CMAKE_SYSTEM_NAME MATCHES FreeBSD)
if (WINDOWS)
LIST(APPEND llfilesystem_SOURCE_FILES lldir_win32.cpp)
@@ -56,7 +58,6 @@ target_link_libraries(llfilesystem
llcommon
)
target_include_directories( llfilesystem INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
-
include(LibraryInstall)
# Add tests