Skip to content

Commit fd8f79a

Browse files
committed
Added cmake statements to setup RPATH upon 'make install'
1 parent d225cff commit fd8f79a

File tree

7 files changed

+28
-5
lines changed

7 files changed

+28
-5
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to this project will be documented in this file.
55
* added `dataflow::Result::create_modules` function that takes nothing but group IDs for easier module creation
66
* changed and unified context menus for all widgets related to netlist elements
77
* fixed module colors not updating on creation of modules with previously used ids
8+
* fixed `netlist_preprocessing` build dependencies
9+
* fixed cmake warnings that minimum version 3.5 is required
10+
* added RPATH setting so that libraries get found after `make install`
811
* added python bindings `gui.View` for management of contexts and directories
912

1013
## [4.4.1](v4.4.1) - 2024-07-29 14:21:42+02:00 (urgency: medium)

CMakeLists.txt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,25 @@ set(CMAKE_C_STANDARD_REQUIRED on)
130130
set(CMAKE_CXX_STANDARD 17)
131131
set(CMAKE_CXX_STANDARD_REQUIRED on)
132132

133+
# Do not hardcode install RPATH into build tree binaries
134+
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
135+
set(CMAKE_SKIP_BUILD_RPATH FALSE)
136+
137+
# Add the install RPATH (for use after make install)
138+
if (DEFINED LIBRARY_INSTALL_DIRECTORY_FULL)
139+
set(CMAKE_INSTALL_RPATH "${LIBRARY_INSTALL_DIRECTORY_FULL}")
140+
elseif (DEFINED CMAKE_INSTALL_PREFIX)
141+
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
142+
else()
143+
set(CMAKE_INSTALL_RPATH "/usr/local/lib")
144+
endif()
145+
146+
# Also include the library path from linked targets in the install RPATH
147+
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
148+
149+
# Optional: Make sure build tree still works by allowing RPATH in build
150+
set(CMAKE_SKIP_BUILD_RPATH FALSE)
151+
133152
# Set Build Timestamp (used in configured file)
134153
string(TIMESTAMP BUILD_TIMESTAMP UTC)
135154
string(TIMESTAMP CURRENT_YEAR "%Y")

app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ set(SRC main.cpp)
33
add_executable(hal ${SRC})
44
set_target_properties(hal PROPERTIES OUTPUT_NAME "hal")
55
set_target_properties(hal PROPERTIES ENABLE_EXPORTS 1)
6+
set_target_properties(hal PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_RPATH}")
67
target_compile_options(hal
78
PUBLIC ${COMPILE_OPTIONS_PUBLIC}
89
PRIVATE ${COMPILE_OPTIONS_PRIVATE}

deps/abc/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.3.0)
1+
cmake_minimum_required(VERSION 3.5.0)
22

33
include(CMakeParseArguments)
44
include(CheckCCompilerFlag)

plugins/gui/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
option(PL_GUI "PL_GUI" ON)
22
if(PL_GUI OR BUILD_ALL_PLUGINS)
3-
cmake_minimum_required(VERSION 3.1.0)
3+
cmake_minimum_required(VERSION 3.5.0)
44

55

66
if(APPLE AND CMAKE_HOST_APPLE AND NOT Qt5_DIR)

plugins/simulator/netlist_simulator_controller/saleae_cli/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cmake_minimum_required(VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.5.0)
22
project(
33
saleae_cli
44
VERSION 0.0.1

tools/genversion.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ def _execute_git_describe(cmd, regex_str, workdir):
2828
"git describe --tags --match \"v[0-9]*\" --dirty="" --always --abbrev=9"
2929
]
3030
regex_strings = [
31-
"v((?P<major>\d+)\.(?P<minor>\d+)\.?(?P<patch>\d+)?(\.?(?P<tweak>\d+))?)(-(?P<add_commit>\d+))?(-g(?P<hash>[0-9,a-f]{9}))?(-(?P<dirty>dirty))?(-(?P<broken>broken))?",
32-
"v((?P<major>\d+)\.(?P<minor>\d+)\.?(?P<patch>\d+)?(\.?(?P<tweak>\d+))?)(-(?P<add_commit>\d+))?(-g(?P<hash>[0-9,a-f]{9}))?(-(?P<dirty>dirty))?"
31+
"v((?P<major>\\d+)\\.(?P<minor>\\d+)\\.?(?P<patch>\\d+)?(\\.?(?P<tweak>\\d+))?)(-(?P<add_commit>\\d+))?(-g(?P<hash>[0-9,a-f]{9}))?(-(?P<dirty>dirty))?(-(?P<broken>broken))?",
32+
"v((?P<major>\\d+)\\.(?P<minor>\\d+)\\.?(?P<patch>\\d+)?(\\.?(?P<tweak>\\d+))?)(-(?P<add_commit>\\d+))?(-g(?P<hash>[0-9,a-f]{9}))?(-(?P<dirty>dirty))?"
3333
]
3434

3535
result, r = _execute_git_describe(commands[0], regex_strings[0], workdir)

0 commit comments

Comments
 (0)