Skip to content

Commit fa026dc

Browse files
ghisvailKent Knox
authored andcommitted
Move OpenCL detection to the root of the project. (#196)
1 parent e99032b commit fa026dc

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,15 @@ message( STATUS "CMAKE_CXX_COMPILER release flags: " ${CMAKE_CXX_FLAGS_RELEASE}
163163
message( STATUS "CMAKE_CXX_COMPILER relwithdebinfo flags: " ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} )
164164
message( STATUS "CMAKE_EXE_LINKER link flags: " ${CMAKE_EXE_LINKER_FLAGS} )
165165

166+
# Query the user for which version of OpenCL they wish to build the library for
167+
set( BUILD_CLVERSION "1.2" CACHE STRING "The version of OpenCL we wish to compile the library against" )
168+
set_property( CACHE BUILD_CLVERSION PROPERTY STRINGS 2.0 1.2 1.1 )
169+
message( STATUS "clSPARSE is building using CL interface ='${BUILD_CLVERSION}'" )
170+
171+
# clSPARSE library requires OpenCL
172+
# A standard FindOpenCL.cmake module ships with cmake 3.1, but we supply our own until 3.1 becomes more $
173+
find_package( OpenCL ${BUILD_CLVERSION} REQUIRED )
174+
166175
# configure a header file to pass the CMake version settings to the source, and package the header files in the output archive
167176
message( STATUS "PROJECT SRC DIR = ${PROJECT_SOURCE_DIR}")
168177
configure_file( "${PROJECT_SOURCE_DIR}/include/clSPARSE-version.h.in" "${PROJECT_BINARY_DIR}/include/clSPARSE-version.h" )

src/library/CMakeLists.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,6 @@
1717

1818
include( GenerateExportHeader )
1919

20-
# Query the user for which version of OpenCL they wish to build the library for
21-
set( BUILD_CLVERSION "1.2" CACHE STRING "The version of OpenCL we wish to compile the library against" )
22-
set_property( CACHE BUILD_CLVERSION PROPERTY STRINGS 2.0 1.2 1.1 )
23-
message( STATUS "clSPARSE is building using CL interface ='${BUILD_CLVERSION}'" )
24-
25-
# clSPARSE library requires OpenCL
26-
# A standard FindOpenCL.cmake module ships with cmake 3.1, but we supply our own until 3.1 becomes more prevalent
27-
find_package( OpenCL ${BUILD_CLVERSION} REQUIRED )
28-
2920
# clSPARSE library requires clBLAS
3021
# find_package( clBLAS REQUIRED )
3122

0 commit comments

Comments
 (0)