@@ -23,6 +23,7 @@ option( BUILD_PERFORMANCE "Copy the performance scripts that can measure and gra
23
23
option ( BUILD_SAMPLE "Build the sample programs" OFF )
24
24
option ( BUILD_CLIENT "Build a command line clBLAS client program with a variety of configurable parameters (dependency on Boost)" OFF )
25
25
option ( BUILD_KTEST "A command line tool for testing single clBLAS kernel" ON )
26
+ option ( BUILD_SHARED_LIBS "Build shared libraries" ON )
26
27
27
28
# By default test-correctness is linked and tested against ACML library.
28
29
# However, test-correctness can instead use NETLIB as a reference library
@@ -50,7 +51,7 @@ if( NOT DEFINED clBLAS_VERSION_MAJOR )
50
51
endif ( )
51
52
52
53
if ( NOT DEFINED clBLAS_VERSION_MINOR )
53
- set ( clBLAS_VERSION_MINOR 2 )
54
+ set ( clBLAS_VERSION_MINOR 4 )
54
55
endif ( )
55
56
56
57
if ( NOT DEFINED clBLAS_VERSION_PATCH )
@@ -67,7 +68,7 @@ set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR} )
67
68
68
69
# On windows, it's convenient to change the default install prefix such that it does NOT point to 'program files' (permissions problems)
69
70
# Need to check out CMAKE_RUNTIME_OUTPUT_DIRECTORY variable, and see if that eliminates the need to modify install path
70
- if ( CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
71
+ if ( WIN32 AND CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT )
71
72
set ( CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR} /package" CACHE PATH "Install path prefix, prepended onto install directories" FORCE )
72
73
endif ( )
73
74
@@ -84,34 +85,33 @@ set( SUFFIX_BIN_DEFAULT "" )
84
85
85
86
if (TARGET_PLATFORM EQUAL 32 OR TARGET_PLATFORM EQUAL 64)
86
87
set (TARGET_PLATFORM ${TARGET_PLATFORM} CACHE STRING "Target platform type (32-bit or 64-bit)" FORCE)
87
- if ( TARGET_PLATFORM EQUAL 64 )
88
- set ( SUFFIX_LIB_DEFAULT "64" )
89
- endif ( )
90
88
else ()
91
89
if (CMAKE_SIZEOF_VOID_P MATCHES 8)
92
90
set (TARGET_PLATFORM "64" CACHE STRING "Target platform type (32-bit or 64-bit)" FORCE)
93
- set ( SUFFIX_LIB_DEFAULT "64" )
94
91
else ()
95
92
set (TARGET_PLATFORM "32" CACHE STRING "Target platform type (32-bit or 64-bit)" FORCE)
96
93
endif ()
97
94
endif ()
98
95
99
- set ( SUFFIX_LIB ${SUFFIX_LIB_DEFAULT} CACHE STRING "String to append to 'lib' install path" )
100
- set ( SUFFIX_BIN ${SUFFIX_BIN_DEFAULT} CACHE STRING "String to append to 'bin' install path" )
101
-
102
- if ( MSVC_IDE )
103
- set_property ( GLOBAL PROPERTY USE_FOLDERS TRUE )
104
- endif ( )
105
-
106
96
message (STATUS "Target platform: ${TARGET_PLATFORM} -bit" )
107
97
if (TARGET_PLATFORM EQUAL 32)
108
98
set (_arch "x86" INTERNAL )
109
99
set_property (GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE )
110
100
else ()
111
101
set (_arch "x86_64" INTERNAL )
112
102
set_property (GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE )
103
+ if ( NOT APPLE )
104
+ set ( SUFFIX_LIB_DEFAULT "64" )
105
+ endif ( )
113
106
endif ()
114
107
108
+ set ( SUFFIX_LIB ${SUFFIX_LIB_DEFAULT} CACHE STRING "String to append to 'lib' install path" )
109
+ set ( SUFFIX_BIN ${SUFFIX_BIN_DEFAULT} CACHE STRING "String to append to 'bin' install path" )
110
+
111
+ if ( MSVC_IDE )
112
+ set_property ( GLOBAL PROPERTY USE_FOLDERS TRUE )
113
+ endif ( )
114
+
115
115
# add the math library for Linux
116
116
if ( UNIX )
117
117
set (MATH_LIBRARY "m" )
@@ -197,9 +197,6 @@ endif( )
197
197
# This will define OPENCL_FOUND
198
198
find_package ( OpenCL )
199
199
200
- # Find Google Test package
201
- find_package ( GTest )
202
-
203
200
# Find Boost on the system, and configure the type of boost build we want
204
201
set ( Boost_USE_MULTITHREADED ON )
205
202
set ( Boost_USE_STATIC_LIBS ON )
@@ -297,6 +294,26 @@ if( BUILD_TEST )
297
294
endif ( )
298
295
endif ( )
299
296
297
+ if (WIN32 )
298
+ set (destdir CMake)
299
+ else ()
300
+ set (destdir share/clBLAS)
301
+ endif ()
302
+ string (REGEX REPLACE "[^/]+" ".." reldir "${destdir} " )
303
+ configure_file (
304
+ ${CMAKE_CURRENT_SOURCE_DIR} /clBLASConfigVersion.cmake.in
305
+ ${CMAKE_CURRENT_BINARY_DIR} /clBLASConfigVersion.cmake
306
+ @ONLY)
307
+ configure_file (
308
+ ${CMAKE_CURRENT_SOURCE_DIR} /clBLASConfig.cmake.in
309
+ ${CMAKE_CURRENT_BINARY_DIR} /clBLASConfig.cmake
310
+ @ONLY)
311
+ install (EXPORT Library DESTINATION ${destdir} FILE clBLASTargets.cmake)
312
+ install (FILES ${CMAKE_CURRENT_BINARY_DIR} /clBLASConfigVersion.cmake
313
+ ${CMAKE_CURRENT_BINARY_DIR} /clBLASConfig.cmake
314
+ DESTINATION ${destdir} )
315
+
316
+
300
317
# The following code is setting variables to control the behavior of CPack to generate our
301
318
if ( WIN32 )
302
319
set ( CPACK_SOURCE_GENERATOR "ZIP" )
0 commit comments