Skip to content

Commit 2ff824d

Browse files
committed
Upgrade template searching logic a bit, in light of new perplex build logic. In the 'standard' case, builds using perplex now stand a chance of 'just working' without requiring manual template specification.
1 parent 5e35646 commit 2ff824d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

cmake/FindPERPLEX.cmake

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,14 @@ if(PERPLEX_EXECUTABLE AND NOT PERPLEX_TEMPLATE)
5151
get_filename_component(perplex_path ${PERPLEX_EXECUTABLE} PATH)
5252
if(perplex_path)
5353
set(PERPLEX_TEMPLATE "")
54-
if(EXISTS ${perplex_path}/perplex_template.c)
55-
set(PERPLEX_TEMPLATE "${perplex_path}/perplex_template.c")
56-
endif(EXISTS ${perplex_path}/perplex_template.c)
57-
if(EXISTS /usr/share/perplex/perplex_template.c)
58-
set(PERPLEX_TEMPLATE "/usr/share/perplex/perplex_template.c")
59-
endif(EXISTS /usr/share/perplex/perplex_template.c)
54+
if(EXISTS ${perplex_path}/../share/perplex/perplex_template.c)
55+
get_filename_component(perplex_template_path "${perplex_path}/../share/perplex/perplex_template.c" ABSOLUTE)
56+
set(PERPLEX_TEMPLATE "${perplex_template_path}")
57+
endif(EXISTS ${perplex_path}/../share/perplex/perplex_template.c)
6058
endif(perplex_path)
59+
if(EXISTS /usr/share/perplex/perplex_template.c)
60+
set(PERPLEX_TEMPLATE "/usr/share/perplex/perplex_template.c")
61+
endif(EXISTS /usr/share/perplex/perplex_template.c)
6162
endif(PERPLEX_EXECUTABLE AND NOT PERPLEX_TEMPLATE)
6263
include(FindPackageHandleStandardArgs)
6364
FIND_PACKAGE_HANDLE_STANDARD_ARGS(PERPLEX DEFAULT_MSG PERPLEX_EXECUTABLE PERPLEX_TEMPLATE)

0 commit comments

Comments
 (0)