summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake5
-rw-r--r--indra/cmake/Python.cmake51
-rwxr-xr-xindra/cmake/run_build_test.py2
3 files changed, 40 insertions, 18 deletions
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index ff705101de..c2e1bb4b85 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -151,6 +151,11 @@ elseif(DARWIN)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources")
+ # Support our "@executable_path/../Resources" load path for executables
+ # that end up in any of the above SHARED_LIB_STAGING_DIR_MUMBLE
+ # directories.
+ file(CREATE_LINK "Release/Resources" "${SHARED_LIB_STAGING_DIR}/Resources"
+ SYMBOLIC)
set(vivox_lib_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(slvoice_files SLVoice)
diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake
index ed595f6966..dbf5033ce5 100644
--- a/indra/cmake/Python.cmake
+++ b/indra/cmake/Python.cmake
@@ -5,32 +5,49 @@ set(PYTHONINTERP_FOUND)
if (WINDOWS)
# On Windows, explicitly avoid Cygwin Python.
- find_program(PYTHON_EXECUTABLE
- NAMES python.exe
+ # if the user has their own version of Python installed, prefer that
+ foreach(hive HKEY_CURRENT_USER HKEY_LOCAL_MACHINE)
+ # prefer more recent Python versions to older ones, if multiple versions
+ # are installed
+ foreach(pyver 3.11 3.10 3.9 3.8 3.7)
+ list(APPEND regpaths "[${hive}\\SOFTWARE\\Python\\PythonCore\\${pyver}\\InstallPath]")
+ endforeach()
+ endforeach()
+
+ # TODO: This logic has the disadvantage that if you have multiple versions
+ # of Python installed, the selected path won't necessarily be the newest -
+ # e.g. this GLOB will prefer Python310 to Python311. But since pymaybe is
+ # checked AFTER the registry entries, this will only surface as a problem if
+ # no installed Python appears in the registry.
+ file(GLOB pymaybe
+ "$ENV{PROGRAMFILES}/Python*"
+## "$ENV{PROGRAMFILES(X86)}/Python*"
+ # The Windows environment variable is in fact as shown above, but CMake
+ # disallows querying an environment variable containing parentheses -
+ # thanks, Windows. Fudge by just appending " (x86)" to $PROGRAMFILES and
+ # hoping for the best.
+ "$ENV{PROGRAMFILES} (x86)/Python*"
+ "c:/Python*")
+
+ find_program(python
+ NAMES python3.exe python.exe
NO_DEFAULT_PATH # added so that cmake does not find cygwin python
PATHS
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.7\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.8\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.9\\InstallPath]
- [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\3.10\\InstallPath]
- [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\3.11\\InstallPath]
+ ${regpaths}
+ ${pymaybe}
)
include(FindPythonInterp)
else()
- find_program(PYTHON_EXECUTABLE python3)
+ find_program(python python3)
- if (PYTHON_EXECUTABLE)
+ if (python)
set(PYTHONINTERP_FOUND ON)
- endif (PYTHON_EXECUTABLE)
+ endif (python)
endif (WINDOWS)
-if (NOT PYTHON_EXECUTABLE)
+if (NOT python)
message(FATAL_ERROR "No Python interpreter found")
-endif (NOT PYTHON_EXECUTABLE)
+endif (NOT python)
+set(PYTHON_EXECUTABLE "${python}" CACHE FILEPATH "Python interpreter for builds")
mark_as_advanced(PYTHON_EXECUTABLE)
diff --git a/indra/cmake/run_build_test.py b/indra/cmake/run_build_test.py
index 1e92868ae7..1f040bded5 100755
--- a/indra/cmake/run_build_test.py
+++ b/indra/cmake/run_build_test.py
@@ -73,7 +73,7 @@ def main(command, arguments=[], libpath=[], vars={}):
if sys.platform == "win32":
lpvars = ["PATH"]
elif sys.platform == "darwin":
- lpvars = ["LD_LIBRARY_PATH", "DYLD_LIBRARY_PATH"]
+ lpvars = ["LD_LIBRARY_PATH"] # , "DYLD_LIBRARY_PATH"]
elif sys.platform.startswith("linux"):
lpvars = ["LD_LIBRARY_PATH"]
else: