summarylogtreecommitdiffstats
path: root/cmake-muparser-fix.patch
blob: 5299878ac8241c861b29e71895d0d101b964a539 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From b65dc1b766fc54da3117d44f612f6a93d5caa602 Mon Sep 17 00:00:00 2001
From: Danilo Bargen <mail@dbrgn.ch>
Date: Mon, 18 Apr 2022 21:05:43 +0200
Subject: [PATCH] CMake: Add alias for muparser target

Building LibrePCB with unbundled MuParser on Arch Linux currently fails,
because the target `MuParser::MuParser` is not defined. Because this
used to work before, I assume the target was renamed from
`MuParser::MuParser` to `muparser::muparser` some time ago.

To fix this, add an alias if the CMake package was found, but the pascal
case alias isn't defined yet.
---
 cmake/FindMuParser.cmake | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/cmake/FindMuParser.cmake b/cmake/FindMuParser.cmake
index 193898d8c..2e113d084 100644
--- a/cmake/FindMuParser.cmake
+++ b/cmake/FindMuParser.cmake
@@ -37,6 +37,11 @@ find_package(muparser 2.0 QUIET)
 if(muparser_FOUND)
   message(STATUS "Using system MuParser")
 
+  # Add uppercase alias if only the lowercase target is defined
+  if(NOT TARGET MuParser::MuParser)
+    add_library(MuParser::MuParser ALIAS muparser::muparser)
+  endif()
+
   # Stop here, we're done
   return()
 endif()