Skip to content

Commit

Permalink
Install binary and its shared library dependencies
Browse files Browse the repository at this point in the history
Install the darkradiant binary and the shared libraries it links against
(wxutil, math etc), and set a relative -rpath so that the executable can find
its libraries. Unlike with Automake, the use of "$ORIGIN/.." just works without
needing to figure out how to escape the syntax through two levels of shell
scripts plus the Makefile.

The binary does now start to run without any linker error, but the application
does not yet work because it cannot load the main module (probably because it
is called 'libradiantcore.so' not 'radiantcore.so').
  • Loading branch information
Matthew Mott committed Dec 4, 2020
1 parent a151ee8 commit f80b6d8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -9,6 +9,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED True)

# Build shared libraries by default
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/darkradiant")

# Define GNU-style directory structure by default, and pass directories to the
# code with defines
Expand Down Expand Up @@ -51,3 +52,10 @@ add_subdirectory(libs/module)
# Main radiant components
add_subdirectory(radiantcore)
add_subdirectory(radiant)

# Installation
install(TARGETS darkradiant math xmlutil scenegraph wxutil module
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib/darkradiant)
install(TARGETS radiantcore
LIBRARY DESTINATION lib/darkradiant/modules)

0 comments on commit f80b6d8

Please sign in to comment.