@@ -36,15 +36,15 @@ project( clFFT )
36
36
37
37
# Define a version for the code
38
38
if ( NOT DEFINED CLFFT_VERSION_MAJOR )
39
- set ( CLFFT_VERSION_MAJOR 2 )
39
+ set ( CLFFT_VERSION_MAJOR 2 )
40
40
endif ( )
41
41
42
42
if ( NOT DEFINED CLFFT_VERSION_MINOR )
43
- set ( CLFFT_VERSION_MINOR 12 )
43
+ set ( CLFFT_VERSION_MINOR 12 )
44
44
endif ( )
45
45
46
46
if ( NOT DEFINED CLFFT_VERSION_PATCH )
47
- set ( CLFFT_VERSION_PATCH 1 )
47
+ set ( CLFFT_VERSION_PATCH 1 )
48
48
endif ( )
49
49
50
50
set ( CLFFT_VERSION "${CLFFT_VERSION_MAJOR} .${CLFFT_VERSION_MINOR} .${CLFFT_VERSION_PATCH} " )
@@ -62,16 +62,16 @@ endif( )
62
62
63
63
# Set the default of CMAKE_BUILD_TYPE to be release, unless user specifies with -D. MSVC_IDE does not use CMAKE_BUILD_TYPE
64
64
if ( NOT MSVC_IDE AND NOT CMAKE_BUILD_TYPE )
65
- set ( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE )
65
+ set ( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE )
66
66
endif ()
67
67
68
68
# Options that the user or driver program can set to control various components of the build
69
69
option ( BUILD_RUNTIME "Build the FFT runtime library" ON )
70
70
option ( BUILD_CLIENT "Build a command line clFFT client program with a variety of configurable parameters (dependency on Boost)" OFF )
71
71
option ( BUILD_TEST "Build the library testing suite (dependency on google test, Boost, and FFTW)" OFF )
72
72
option ( BUILD_LOADLIBRARIES "Build the optional dynamic load libraries that the FFT runtime will search for" ON )
73
- option ( BUILD_SHARED_LIBS "Build shared libraries." ON )
74
- option ( BUILD_EXAMPLES "Build examples." ON )
73
+ option ( BUILD_SHARED_LIBS "Build shared libraries." ON )
74
+ option ( BUILD_EXAMPLES "Build examples." ON )
75
75
option ( BUILD_CALLBACK_CLIENT "Build a command line clFFT client program that tests callback functionality (dependency on Boost)" OFF )
76
76
77
77
# If BOOST_ROOT is defined as an environment value, use that value and cache it so it's visible in the cmake-gui.
@@ -87,14 +87,13 @@ if( WIN32 )
87
87
if ( UNICODE )
88
88
message ( STATUS "UNICODE build" )
89
89
endif ( )
90
- else ()
90
+ else ( )
91
91
set ( UNICODE OFF )
92
92
message ( STATUS "UNICODE feature disabled on linux" )
93
93
endif ()
94
94
95
95
if ( MSVC_IDE )
96
- set_property ( GLOBAL PROPERTY USE_FOLDERS TRUE )
97
-
96
+ set_property ( GLOBAL PROPERTY USE_FOLDERS TRUE )
98
97
set ( BUILD64 ${CMAKE_CL_64} )
99
98
else ()
100
99
option ( BUILD64 "Build a 64-bit product" ON )
@@ -117,9 +116,9 @@ set( SUFFIX_BIN_DEFAULT "" )
117
116
if ( BUILD64 )
118
117
set_property ( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE )
119
118
message ( STATUS "64bit build - FIND_LIBRARY_USE_LIB64_PATHS TRUE" )
120
- if ( NOT APPLE )
121
- set ( SUFFIX_LIB_DEFAULT "64" )
122
- endif ()
119
+ if ( NOT APPLE )
120
+ set ( SUFFIX_LIB_DEFAULT "64" )
121
+ endif ()
123
122
else ( )
124
123
set_property ( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE )
125
124
message ( STATUS "32bit build - FIND_LIBRARY_USE_LIB64_PATHS FALSE" )
@@ -137,19 +136,19 @@ set( SUFFIX_BIN ${SUFFIX_BIN_DEFAULT} CACHE STRING "String to append to 'bin' in
137
136
# Client is built only if boost is found; on windows, we need vs10 or higher
138
137
# Find Boost on the system, and configure the type of boost build we want
139
138
if ( NOT DEFINED Boost_USE_STATIC_LIBS )
140
- set ( Boost_USE_STATIC_LIBS ON )
139
+ set ( Boost_USE_STATIC_LIBS ON )
141
140
endif ( )
142
141
143
142
if ( NOT DEFINED Boost_USE_STATIC_RUNTIME )
144
- set ( Boost_USE_STATIC_RUNTIME OFF )
143
+ set ( Boost_USE_STATIC_RUNTIME OFF )
145
144
endif ( )
146
145
147
146
# This will define Boost_FOUND
148
147
find_package ( Boost 1.33.0 COMPONENTS program_options )
149
148
if ( Boost_FOUND )
150
- message ( STATUS "Boost_PROGRAM_OPTIONS_LIBRARY: ${Boost_PROGRAM_OPTIONS_LIBRARY} " )
149
+ message ( STATUS "Boost_PROGRAM_OPTIONS_LIBRARY: ${Boost_PROGRAM_OPTIONS_LIBRARY} " )
151
150
else ( )
152
- message ( WARNING "Try setting Boost_DEBUG and Boost_DETAILED_FAILURE_MSG for more information" )
151
+ message ( WARNING "Try setting Boost_DEBUG and Boost_DETAILED_FAILURE_MSG for more information" )
153
152
endif ( )
154
153
155
154
# This will define OPENCL_FOUND
@@ -168,12 +167,12 @@ endif( )
168
167
# Enable building of the googletest unit test framework if requested and all dependencies are found
169
168
set ( UNIT_TEST OFF )
170
169
if ( BUILD_TEST )
171
- include (gtest.cmake )
172
- if ( GTEST_FOUND AND Boost_FOUND AND FFTW_FOUND )
170
+ include (gtest.cmake )
171
+ if ( GTEST_FOUND AND Boost_FOUND AND FFTW_FOUND )
173
172
set ( UNIT_TEST ON )
174
173
else ( )
175
174
message ( "GoogleTest unit testing will NOT be built" )
176
- endif ( )
175
+ endif ( )
177
176
endif ( )
178
177
179
178
# Enable building of the callback client if requested and all dependencies are found
@@ -188,9 +187,9 @@ get_filename_component( C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE )
188
187
# message( "C_COMPILER_NAME: " ${C_COMPILER_NAME} )
189
188
# message( "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
190
189
191
- if (APPLE )
192
- # avoid warning on newer cmake versions
193
- set (CMAKE_MACOSX_RPATH 0 )
190
+ if ( APPLE )
191
+ # avoid warning on newer cmake versions
192
+ set ( CMAKE_MACOSX_RPATH 0 )
194
193
endif ()
195
194
196
195
# Set common compile and link options
@@ -206,11 +205,11 @@ if( MSVC )
206
205
elseif ( CMAKE_COMPILER_IS_GNUCXX )
207
206
message ( STATUS "Detected GNU fortran compiler." )
208
207
EXEC_PROGRAM ( ${CMAKE_CXX_COMPILER} ARGS --version OUTPUT_VARIABLE vnum )
209
- STRING (REGEX REPLACE ".*([0-9])\\ .([0-9])\\ .([0-9]).*" "\\ 1\\ 2\\ 3" vnum ${vnum} )
208
+ STRING ( REGEX REPLACE ".*([0-9])\\ .([0-9])\\ .([0-9]).*" "\\ 1\\ 2\\ 3" vnum ${vnum} )
210
209
if ( ${vnum} STREQUAL "452" )
211
210
# we only want c++0x if we're using gcc 4.5.2
212
211
set ( CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS} " )
213
- endif ()
212
+ endif ( )
214
213
215
214
set ( CMAKE_CXX_FLAGS "-pthread ${CMAKE_CXX_FLAGS} " )
216
215
set ( CMAKE_C_FLAGS "-pthread ${CMAKE_C_FLAGS} " )
@@ -228,10 +227,10 @@ elseif( CMAKE_COMPILER_IS_GNUCXX )
228
227
set ( CMAKE_C_FLAGS "-m32 ${CMAKE_C_FLAGS} " )
229
228
endif ( )
230
229
231
- if ( CODE_COVERAGE )
232
- set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
233
- set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
234
- endif ()
230
+ if ( CODE_COVERAGE )
231
+ set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage" )
232
+ set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage" )
233
+ endif ( )
235
234
endif ( )
236
235
237
236
# If UNICODE is defined for microsoft compilers, pass extra definitions
@@ -246,23 +245,23 @@ message( STATUS "CMAKE_CXX_COMPILER release flags: " ${CMAKE_CXX_FLAGS_RELEASE}
246
245
message ( STATUS "CMAKE_CXX_COMPILER relwithdebinfo flags: " ${CMAKE_CXX_FLAGS_RELWITHDEBINFO} )
247
246
message ( STATUS "CMAKE_EXE_LINKER link flags: " ${CMAKE_EXE_LINKER_FLAGS} )
248
247
249
- if (NOT BUILD_SHARED_LIBS )
250
- set (CLFFT_STATIC ON )
251
- endif ()
248
+ if ( NOT BUILD_SHARED_LIBS )
249
+ set ( CLFFT_STATIC ON )
250
+ endif ( )
252
251
# configure a header file to pass the CMake version settings to the source, and package the header files in the output archive
253
252
configure_file ( "${PROJECT_SOURCE_DIR} /include/clFFT.version.h.in" "${PROJECT_BINARY_DIR} /include/clFFT.version.h" )
254
253
install ( FILES
255
- "${PROJECT_BINARY_DIR} /include/clFFT.version.h"
256
- "include/clFFT.h"
257
- "include/clAmdFft.h"
258
- "include/clAmdFft.version.h"
259
- DESTINATION
260
- "./include" )
254
+ "${PROJECT_BINARY_DIR} /include/clFFT.version.h"
255
+ "include/clFFT.h"
256
+ "include/clAmdFft.h"
257
+ "include/clAmdFft.version.h"
258
+ DESTINATION
259
+ "./include" )
261
260
262
261
# Recurse into subdirectory and start building files there
263
262
if ( BUILD_RUNTIME AND IS_DIRECTORY "${PROJECT_SOURCE_DIR} /library" )
264
263
add_subdirectory ( library )
265
- else ()
264
+ else ( )
266
265
message ( "Runtime library will NOT be built" )
267
266
endif ( )
268
267
@@ -280,7 +279,7 @@ endif( )
280
279
# Recurse into subdirectory and start building files there
281
280
if ( BUILD_LOADLIBRARIES AND IS_DIRECTORY "${PROJECT_SOURCE_DIR} /statTimer" )
282
281
add_subdirectory ( statTimer )
283
- else ()
282
+ else ( )
284
283
message ( "LoadLibraries will NOT be built" )
285
284
endif ( )
286
285
@@ -299,27 +298,27 @@ else( )
299
298
endif ( )
300
299
301
300
if ( BUILD_EXAMPLES )
302
- add_subdirectory ( examples )
303
- endif ()
301
+ add_subdirectory ( examples )
302
+ endif ( )
304
303
305
- if (WIN32 )
306
- set (destdir CMake )
307
- else ()
308
- set (destdir lib${SUFFIX_LIB}/cmake/clFFT )
309
- endif ()
310
- string (REGEX REPLACE "[^/]+" ".." reldir "${destdir} " )
304
+ if ( WIN32 )
305
+ set ( destdir CMake )
306
+ else ( )
307
+ set ( destdir lib${SUFFIX_LIB}/cmake/clFFT )
308
+ endif ( )
309
+ string ( REGEX REPLACE "[^/]+" ".." reldir "${destdir} " )
311
310
configure_file (
312
- ${CMAKE_CURRENT_SOURCE_DIR} /clFFTConfigVersion.cmake.in
313
- ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfigVersion.cmake
314
- @ONLY )
311
+ ${CMAKE_CURRENT_SOURCE_DIR} /clFFTConfigVersion.cmake.in
312
+ ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfigVersion.cmake
313
+ @ONLY )
315
314
configure_file (
316
- ${CMAKE_CURRENT_SOURCE_DIR} /clFFTConfig.cmake.in
317
- ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfig.cmake
318
- @ONLY )
319
- install (EXPORT Library DESTINATION ${destdir} FILE clFFTTargets.cmake )
320
- install (FILES ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfigVersion.cmake
321
- ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfig.cmake
322
- DESTINATION ${destdir} )
315
+ ${CMAKE_CURRENT_SOURCE_DIR} /clFFTConfig.cmake.in
316
+ ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfig.cmake
317
+ @ONLY )
318
+ install ( EXPORT Library DESTINATION ${destdir} FILE clFFTTargets.cmake )
319
+ install ( FILES ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfigVersion.cmake
320
+ ${CMAKE_CURRENT_BINARY_DIR} /clFFTConfig.cmake
321
+ DESTINATION ${destdir} )
323
322
324
323
# The following code is setting variables to control the behavior of CPack to generate our
325
324
if ( WIN32 )
@@ -331,18 +330,18 @@ else( )
331
330
endif ( )
332
331
333
332
if ( BUILD64 )
334
- set ( CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${CLFFT_VERSION} -${CMAKE_HOST_SYSTEM_NAME} -x64" )
333
+ set ( CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${CLFFT_VERSION} -${CMAKE_HOST_SYSTEM_NAME} -x64" )
335
334
else ( )
336
- set ( CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${CLFFT_VERSION} -${CMAKE_HOST_SYSTEM_NAME} -x32" )
335
+ set ( CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${CLFFT_VERSION} -${CMAKE_HOST_SYSTEM_NAME} -x32" )
337
336
endif ( )
338
337
339
- set ( CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${CLFFT_VERSION} -${CMAKE_HOST_SYSTEM_NAME} -Source" )
338
+ set ( CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME} -${CLFFT_VERSION} -${CMAKE_HOST_SYSTEM_NAME} -Source" )
340
339
341
340
set ( CPACK_PACKAGE_VERSION_MAJOR ${CLFFT_VERSION_MAJOR} )
342
341
set ( CPACK_PACKAGE_VERSION_MINOR ${CLFFT_VERSION_MINOR} )
343
342
set ( CPACK_PACKAGE_VERSION_PATCH ${CLFFT_VERSION_PATCH} )
344
- set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCL implementation of an FFT library" )
345
- set ( CPACK_PACKAGE_VENDOR "Neutral" )
343
+ set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "OpenCL implementation of an FFT library" )
344
+ set ( CPACK_PACKAGE_VENDOR "Neutral" )
346
345
set ( CPACK_SOURCE_IGNORE_FILES "/\\\\ .hg/;/\\\\ .svn/;/\\\\ .git/" )
347
346
348
347
# Define all variables that influence CPack before including CPack, such as install targets
0 commit comments