Skip to content

Commit f70f38e

Browse files
committed
check for default prefix before (possibly) munging with prefix string
Signed-off-by: Stephen L Arnold <[email protected]>
1 parent 6549f7f commit f70f38e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

swig/perl/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ include(FindPerlLibs)
44
string(SUBSTRING "${PERL_VERSION_STRING}" 0 4 PERL_VERSION_MINOR)
55

66
# process cmake vendor paths to respect install prefix, use as Linux defaults below
7-
STRING(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" PERL_VENDORARCH "${PERL_VENDORARCH}")
8-
STRING(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" PERL_VENDORLIB "${PERL_VENDORLIB}")
7+
if (NOT CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
8+
STRING(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" PERL_VENDORARCH "${PERL_VENDORARCH}")
9+
STRING(REGEX REPLACE "^/usr/" "${CMAKE_INSTALL_PREFIX}/" PERL_VENDORLIB "${PERL_VENDORLIB}")
10+
endif()
11+
912
message(STATUS "perl install libdir: ${PERL_VENDORARCH}")
1013
message(STATUS "perl install archdir: ${PERL_VENDORLIB}")
1114

0 commit comments

Comments
 (0)