2
2
# FindComputeCpp
3
3
#---------------
4
4
#
5
- # Copyright 2016-2018 Codeplay Software Ltd.
5
+ # Copyright Codeplay Software Ltd.
6
6
#
7
7
# Licensed under the Apache License, Version 2.0 (the "License");
8
8
# you may not use these files except in compliance with the License.
@@ -73,22 +73,21 @@ find_package(OpenCL REQUIRED)
73
73
74
74
# Find ComputeCpp package
75
75
76
- if (DEFINED ComputeCpp_DIR)
77
- set (computecpp_find_hint ${ComputeCpp_DIR} )
78
- elseif (DEFINED ENV{COMPUTECPP_DIR})
79
- set (computecpp_find_hint $ENV{COMPUTECPP_DIR} )
80
- endif ()
76
+ set (computecpp_find_hint
77
+ "${ComputeCpp_DIR} "
78
+ "$ENV{COMPUTECPP_DIR} "
79
+ )
81
80
82
81
# Used for running executables on the host
83
82
set (computecpp_host_find_hint ${computecpp_find_hint} )
84
83
85
84
if (CMAKE_CROSSCOMPILING )
86
85
# ComputeCpp_HOST_DIR is used to find executables that are run on the host
87
- if ( DEFINED ComputeCpp_HOST_DIR)
88
- set (computecpp_host_find_hint ${ComputeCpp_HOST_DIR} )
89
- elseif ( DEFINED ENV{COMPUTECPP_HOST_DIR})
90
- set (computecpp_host_find_hint $ENV{COMPUTECPP_HOST_DIR} )
91
- endif ( )
86
+ set (computecpp_host_find_hint
87
+ " ${ComputeCpp_HOST_DIR} "
88
+ " $ ENV{COMPUTECPP_HOST_DIR}"
89
+ ${computecpp_find_hint}
90
+ )
92
91
endif ()
93
92
94
93
find_program (ComputeCpp_DEVICE_COMPILER_EXECUTABLE compute++
@@ -102,13 +101,17 @@ find_program(ComputeCpp_INFO_EXECUTABLE computecpp_info
102
101
NO_SYSTEM_ENVIRONMENT_PATH)
103
102
104
103
find_library (COMPUTECPP_RUNTIME_LIBRARY
105
- NAMES ComputeCpp ComputeCpp_vs2015
104
+ NAMES ComputeCpp
106
105
HINTS ${computecpp_find_hint}
107
106
PATH_SUFFIXES lib
108
107
DOC "ComputeCpp Runtime Library" )
109
108
109
+ # Found the library, use only single hint from now on
110
+ get_filename_component (computecpp_library_path "${COMPUTECPP_RUNTIME_LIBRARY} " DIRECTORY )
111
+ set (computecpp_find_hint "${computecpp_library_path} /.." )
112
+
110
113
find_library (COMPUTECPP_RUNTIME_LIBRARY_DEBUG
111
- NAMES ComputeCpp_d ComputeCpp ComputeCpp_vs2015_d
114
+ NAMES ComputeCpp_d ComputeCpp
112
115
HINTS ${computecpp_find_hint}
113
116
PATH_SUFFIXES lib
114
117
DOC "ComputeCpp Debug Runtime Library" )
0 commit comments