@@ -23,6 +23,7 @@ option( BUILD_PERFORMANCE "Copy the performance scripts that can measure and gra
2323option ( BUILD_SAMPLE "Build the sample programs" OFF )
2424option ( BUILD_CLIENT "Build a command line clBLAS client program with a variety of configurable parameters (dependency on Boost)" OFF )
2525option ( BUILD_KTEST "A command line tool for testing single clBLAS kernel" ON )
26+ option ( BUILD_SHARED_LIBS "Build shared libraries" ON )
2627
2728# By default test-correctness is linked and tested against ACML library.
2829# However, test-correctness can instead use NETLIB as a reference library
@@ -50,7 +51,7 @@ if( NOT DEFINED clBLAS_VERSION_MAJOR )
5051endif ( )
5152
5253if ( NOT DEFINED clBLAS_VERSION_MINOR )
53- set ( clBLAS_VERSION_MINOR 2 )
54+ set ( clBLAS_VERSION_MINOR 4 )
5455endif ( )
5556
5657if ( NOT DEFINED clBLAS_VERSION_PATCH )
@@ -67,7 +68,7 @@ set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR} )
6768
6869# On windows, it's convenient to change the default install prefix such that it does NOT point to 'program files' (permissions problems)
6970# 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 )
7172 set ( CMAKE_INSTALL_PREFIX "${PROJECT_BINARY_DIR} /package" CACHE PATH "Install path prefix, prepended onto install directories" FORCE )
7273endif ( )
7374
@@ -84,34 +85,33 @@ set( SUFFIX_BIN_DEFAULT "" )
8485
8586if (TARGET_PLATFORM EQUAL 32 OR TARGET_PLATFORM EQUAL 64)
8687 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 ( )
9088else ()
9189 if (CMAKE_SIZEOF_VOID_P MATCHES 8)
9290 set (TARGET_PLATFORM "64" CACHE STRING "Target platform type (32-bit or 64-bit)" FORCE)
93- set ( SUFFIX_LIB_DEFAULT "64" )
9491 else ()
9592 set (TARGET_PLATFORM "32" CACHE STRING "Target platform type (32-bit or 64-bit)" FORCE)
9693 endif ()
9794endif ()
9895
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-
10696message (STATUS "Target platform: ${TARGET_PLATFORM} -bit" )
10797if (TARGET_PLATFORM EQUAL 32)
10898 set (_arch "x86" INTERNAL )
10999 set_property (GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE )
110100else ()
111101 set (_arch "x86_64" INTERNAL )
112102 set_property (GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE )
103+ if ( NOT APPLE )
104+ set ( SUFFIX_LIB_DEFAULT "64" )
105+ endif ( )
113106endif ()
114107
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+
115115# add the math library for Linux
116116if ( UNIX )
117117 set (MATH_LIBRARY "m" )
@@ -197,9 +197,6 @@ endif( )
197197# This will define OPENCL_FOUND
198198find_package ( OpenCL )
199199
200- # Find Google Test package
201- find_package ( GTest )
202-
203200# Find Boost on the system, and configure the type of boost build we want
204201set ( Boost_USE_MULTITHREADED ON )
205202set ( Boost_USE_STATIC_LIBS ON )
@@ -297,6 +294,26 @@ if( BUILD_TEST )
297294 endif ( )
298295endif ( )
299296
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+
300317# The following code is setting variables to control the behavior of CPack to generate our
301318if ( WIN32 )
302319 set ( CPACK_SOURCE_GENERATOR "ZIP" )
0 commit comments