2 # This file is part of the GROMACS molecular simulation package.
4 # Copyright (c) 2012,2013,2014,2015, by the GROMACS development team, led by
5 # Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
6 # and including many others, as listed in the AUTHORS file in the
7 # top-level source directory and at http://www.gromacs.org.
9 # GROMACS is free software; you can redistribute it and/or
10 # modify it under the terms of the GNU Lesser General Public License
11 # as published by the Free Software Foundation; either version 2.1
12 # of the License, or (at your option) any later version.
14 # GROMACS is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 # Lesser General Public License for more details.
19 # You should have received a copy of the GNU Lesser General Public
20 # License along with GROMACS; if not, see
21 # http://www.gnu.org/licenses, or write to the Free Software Foundation,
22 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 # If you want to redistribute modifications to GROMACS, please
25 # consider that scientific software is very special. Version
26 # control is crucial - bugs must be traceable. We will be happy to
27 # consider code for inclusion in the official distribution, but
28 # derived work must not be called official GROMACS. Details are found
29 # in the README & COPYING files - if they are missing, get the
30 # official version at http://www.gromacs.org.
32 # To help us fund GROMACS development, we humbly ask that you cite
33 # the research papers on the package. Check out http://www.gromacs.org.
41 # Once done this will define::
43 # OPENCL_FOUND - True if OPENCL was found
44 # OPENCL_INCLUDE_DIRS - include directories for OPENCL
45 # OPENCL_LIBRARIES - link against this library to use OPENCL
46 # OPENCL_VERSION_STRING - Highest supported OPENCL version (eg. 1.2)
47 # OPENCL_VERSION_MAJOR - The major version of the OPENCL implementation
48 # OPENCL_VERSION_MINOR - The minor version of the OPENCL implementation
50 # The module will also define two cache variables::
52 # OPENCL_INCLUDE_DIR - the OPENCL include directory
53 # OPENCL_LIBRARY - the path to the OPENCL library
55 # This is a modified version of FindOpenCL.cmake from cmake v3.1.0
56 # (see comments at the end of the file).
57 # The following changes have been made:
58 # 1. OpenCL is written in all caps (OPENCL)
59 # 2. The following block has been modified:
60 #include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
61 #find_package_handle_standard_args(
63 # FOUND_VAR OpenCL_FOUND
64 # REQUIRED_VARS OpenCL_LIBRARY OpenCL_INCLUDE_DIR
65 # VERSION_VAR OpenCL_VERSION_STRING)
66 # has been replaced by:
67 #include(FindPackageHandleStandardArgs)
68 #FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENCL
69 # REQUIRED_VARS OPENCL_LIBRARY OPENCL_INCLUDE_DIR
70 # VERSION_VAR OPENCL_VERSION_STRING)
71 # 3. The following block has been modified:
72 # find_library(OPENCL_LIBRARY
74 # has been replaced by:
75 # find_library(OPENCL_LIBRARY
78 function(_FIND_OPENCL_VERSION)
79 include(CheckSymbolExists)
80 include(CMakePushCheckState)
81 set(CMAKE_REQUIRED_QUIET ${OPENCL_FIND_QUIETLY})
83 CMAKE_PUSH_CHECK_STATE()
84 foreach(VERSION "2_0" "1_2" "1_1" "1_0")
85 set(CMAKE_REQUIRED_INCLUDES "${OPENCL_INCLUDE_DIR}")
91 OPENCL_VERSION_${VERSION})
96 OPENCL_VERSION_${VERSION})
99 if(OPENCL_VERSION_${VERSION})
100 string(REPLACE "_" "." VERSION "${VERSION}")
101 set(OPENCL_VERSION_STRING ${VERSION} PARENT_SCOPE)
102 string(REGEX MATCHALL "[0-9]+" version_components "${VERSION}")
103 list(GET version_components 0 major_version)
104 list(GET version_components 1 minor_version)
105 set(OPENCL_VERSION_MAJOR ${major_version} PARENT_SCOPE)
106 set(OPENCL_VERSION_MINOR ${minor_version} PARENT_SCOPE)
110 CMAKE_POP_CHECK_STATE()
113 find_path(OPENCL_INCLUDE_DIR
117 ENV "PROGRAMFILES(X86)"
120 ENV NVSDKCOMPUTE_ROOT
129 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
130 find_library(OPENCL_LIBRARY
133 ENV "PROGRAMFILES(X86)"
138 ENV NVSDKCOMPUTE_ROOT
145 OPENCL/common/lib/Win32)
146 elseif(CMAKE_SIZEOF_VOID_P EQUAL 8)
147 find_library(OPENCL_LIBRARY
150 ENV "PROGRAMFILES(X86)"
155 ENV NVSDKCOMPUTE_ROOT
162 OPENCL/common/lib/x64)
165 _FIND_OPENCL_VERSION()
167 set(OPENCL_LIBRARIES ${OPENCL_LIBRARY})
168 set(OPENCL_INCLUDE_DIRS ${OPENCL_INCLUDE_DIR})
170 include(FindPackageHandleStandardArgs)
171 FIND_PACKAGE_HANDLE_STANDARD_ARGS(OPENCL
172 REQUIRED_VARS OPENCL_LIBRARY OPENCL_INCLUDE_DIR
173 VERSION_VAR OPENCL_VERSION_STRING)
179 #=============================================================================
180 # Copyright 2014 Matthaeus G. Chajdas
182 # Distributed under the OSI-approved BSD License (the "License");
183 # see accompanying file Copyright.txt for details.
185 # This software is distributed WITHOUT ANY WARRANTY; without even the
186 # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
187 # See the License for more information.
188 #=============================================================================
189 # cmake 3.1.0 Copyright.txt file content is attached below:
191 #CMake - Cross Platform Makefile Generator
192 #Copyright 2000-2014 Kitware, Inc.
193 #Copyright 2000-2011 Insight Software Consortium
194 #All rights reserved.
196 #Redistribution and use in source and binary forms, with or without
197 #modification, are permitted provided that the following conditions
200 #* Redistributions of source code must retain the above copyright
201 # notice, this list of conditions and the following disclaimer.
203 #* Redistributions in binary form must reproduce the above copyright
204 # notice, this list of conditions and the following disclaimer in the
205 # documentation and/or other materials provided with the distribution.
207 #* Neither the names of Kitware, Inc., the Insight Software Consortium,
208 # nor the names of their contributors may be used to endorse or promote
209 # products derived from this software without specific prior written
212 #THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
213 #"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
214 #LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
215 #A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
216 #HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
217 #SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
218 #LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
219 #DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
220 #THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
221 #(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
222 #OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
224 #------------------------------------------------------------------------------
226 #The above copyright and license notice applies to distributions of
227 #CMake in source and binary form. Some source files contain additional
228 #notices of original copyright by their contributors; see each source
229 #for details. Third-party software packages supplied with CMake under
230 #compatible licenses provide their own copyright notices documented in
231 #corresponding subdirectories.
233 #------------------------------------------------------------------------------
235 #CMake was initially developed by Kitware with the following sponsorship:
237 # * National Library of Medicine at the National Institutes of Health
238 # as part of the Insight Segmentation and Registration Toolkit (ITK).
240 # * US National Labs (Los Alamos, Livermore, Sandia) ASC Parallel
241 # Visualization Initiative.
243 # * National Alliance for Medical Image Computing (NAMIC) is funded by the
244 # National Institutes of Health through the NIH Roadmap for Medical Research,
245 # Grant U54 EB005149.