Skip to content

Commit

Permalink
cmake: Allow RUNPREFIX to be specified at build time.
Browse files Browse the repository at this point in the history
The code previously always assigned CMAKE_INSTALL_PREFIX to RUNPREFIX,
the location that the mythfrontend believes is its location.  Add a
new option, MYTH_RUN_PREFIX, allowing this variable to be specified
when the build tree is created.  This is analogous to the configure
--runprefix option.

Refs: #980
  • Loading branch information
linuxdude42 committed Dec 23, 2024
1 parent a9192ff commit 31ea30c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions cmake/MythOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ set(MYTH_DEFAULT_LIBS_PREFIX
CACHE PATH
"Default library install prefix if not specified on the command line."
)
set(MYTH_RUN_PREFIX
""
CACHE PATH
"The prefix where MythTV is expected to be at runtime. This may differ from MYTH_DEFAULT_PREFIX or CMAKE_INSTALL_PREFIX for packagers."
)

# Location for downloaded tarballs.
#
Expand Down
3 changes: 3 additions & 0 deletions mythtv/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ include(VersionInformation)
#
message(STATUS "Including user overrides ${MYTH_USER_OVERRIDES2}")
include(${MYTH_USER_OVERRIDES2} OPTIONAL)
if(NOT MYTH_RUN_PREFIX)
set(MYTH_RUN_PREFIX ${CMAKE_INSTALL_PREFIX})
endif()

#
# Inject code from cmake provided modules
Expand Down
2 changes: 1 addition & 1 deletion mythtv/cmake/PrintConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if(NOT "${quiet}" STREQUAL "yes")
message_vrbl("Ccache " CCACHE_FOUND)
message_vrbl("DistCC " DISTCC_FOUND)
message("install prefix ${CMAKE_INSTALL_PREFIX}")
message("runtime prefix ${CMAKE_INSTALL_PREFIX}")
message("runtime prefix ${MYTH_RUN_PREFIX}")
message("")
# ~~~
# if( CPU_OVERRIDE AND test x"$cpu" != x"generic")
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythbase/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ set_source_files_properties(
mythdirs.cpp
PROPERTIES
COMPILE_DEFINITIONS
"RUNPREFIX=\"${CMAKE_INSTALL_PREFIX}\";LIBDIRNAME=\"${CMAKE_INSTALL_LIBDIR}\""
"RUNPREFIX=\"${MYTH_RUN_PREFIX}\";LIBDIRNAME=\"${CMAKE_INSTALL_LIBDIR}\""
)
target_include_directories(
mythbase
Expand Down

0 comments on commit 31ea30c

Please sign in to comment.