source: CLRX/CLRadeonExtender/trunk/CMakeLists.txt @ 3889

Last change on this file since 3889 was 3889, checked in by matszpk, 16 months ago

CLRadeonExtender: Fixed FreeBSD support.

  • Property svn:mime-type set to text/plain
File size: 15.2 KB
Line 
1####
2#  CLRadeonExtender - Unofficial OpenCL Radeon Extensions Library
3#  Copyright (C) 2014-2018 Mateusz Szpakowski
4#
5#  This library is free software; you can redistribute it and/or
6#  modify it under the terms of the GNU Lesser General Public
7#  License as published by the Free Software Foundation; either
8#  version 2.1 of the License, or (at your option) any later version.
9#
10#  This library is distributed in the hope that it will be useful,
11#  but WITHOUT ANY WARRANTY; without even the implied warranty of
12#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13#  Lesser General Public License for more details.
14#
15#  You should have received a copy of the GNU Lesser General Public
16#  License along with this library; if not, write to the Free Software
17#  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18####
19
20CMAKE_MINIMUM_REQUIRED(VERSION 2.8.1)
21
22PROJECT(CLRadeonExtender)
23
24SET(CLRX_MAJOR_VERSION 0)
25SET(CLRX_MINOR_VERSION 1)
26SET(CLRX_MICRO_VERSION 7)
27SET(CLRX_VERSION ${CLRX_MAJOR_VERSION}.${CLRX_MINOR_VERSION}.${CLRX_MICRO_VERSION}${CLRX_VERSION_REVISION})
28SET(CLRX_LIB_VERSION ${CLRX_MAJOR_VERSION}.${CLRX_MINOR_VERSION}.${CLRX_MICRO_VERSION})
29
30ENABLE_LANGUAGE(CXX)
31
32SET(EXTRA_OPTS CACHE STRING "add extra options")
33SET(CPU_ARCH CACHE STRING "Set CPU architecture option")
34OPTION(GCC5CXX11NEWABI "Force new GCC 5 C++11 ABI" OFF)
35IF(GCC5CXX11NEWABI)
36    MESSAGE(STATUS "GCC5 C++11 New ABI enabled")
37    SET(EXTRA_PACK_SUFFIX "-gcc5")
38ENDIF(GCC5CXX11NEWABI)
39
40#####
41# packacing
42SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Unofficial OpenCL Radeon extensions")
43SET(CPACK_PACKAGE_VENDOR "matszpk")
44SET(CPACK_PACKAGE_MAINTAINER "matszpk")
45SET(CPACK_PACKAGE_VERSION_MAJOR ${CLRX_MAJOR_VERSION})
46SET(CPACK_PACKAGE_VERSION_MINOR ${CLRX_MINOR_VERSION})
47SET(CPACK_PACKAGE_VERSION_PATCH ${CLRX_MICRO_VERSION})
48SET(CPACK_PACKAGE_VERSION ${CLRX_VERSION})
49SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME})
50IF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
51SET(CPACK_PACKAGE_FILE_NAME CLRadeonExtender-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-x64${EXTRA_PACK_SUFFIX})
52ELSE((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
53SET(CPACK_PACKAGE_FILE_NAME CLRadeonExtender-${CPACK_PACKAGE_VERSION}-${CPACK_SYSTEM_NAME}-x86${EXTRA_PACK_SUFFIX})
54ENDIF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
55
56INCLUDE(CPack)
57
58######
59## end packaging
60
61LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
62
63INCLUDE(CheckFunctionExists)
64INCLUDE(CheckLibraryExists)
65INCLUDE(CheckIncludeFileCXX)
66INCLUDE(CheckCCompilerFlag)
67INCLUDE(CheckCXXCompilerFlag)
68
69CHECK_CXX_COMPILER_FLAG("-std=gnu++11" HAVE_GNU11_FLAG)
70
71# workaround for
72SET(CMAKE_REQUIRED_FLAGS "-std=gnu++11")
73CHECK_INCLUDE_FILE_CXX(iostream HAVE_GNU11_IOSTREAM)
74UNSET(CMAKE_REQUIRED_FLAGS)
75
76IF("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
77    # FreeBSD support
78    MESSAGE(STATUS "Add -stdlib=libc++ for FreeBSD")
79    SET(CPP_STANDARD "-std=c++11 -stdlib=libc++")
80ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
81    IF(HAVE_GNU11_FLAG AND HAVE_GNU11_IOSTREAM)
82        SET(CPP_STANDARD "-std=gnu++11")
83        SET(HAVE_GNU11 1)
84    ELSE(HAVE_GNU11_FLAG AND HAVE_GNU11_IOSTREAM)
85        SET(CPP_STANDARD "-std=c++11")
86    ENDIF(HAVE_GNU11_FLAG AND HAVE_GNU11_IOSTREAM)
87ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
88
89MESSAGE(STATUS "Use standard ${CPP_STANDARD} for ${CMAKE_CXX_COMPILER}")
90
91IF(GCC5CXX11NEWABI)
92    ADD_DEFINITIONS(-D_GLIBCXX_USE_CXX11_ABI=1)
93ENDIF(GCC5CXX11NEWABI)
94
95### 32-bit compilation option
96OPTION(BUILD_32BIT "Build 32-bit version" OFF)
97
98IF(CPU_ARCH)
99    IF(MSVC)
100        SET(EXTRA_OPTS "${EXTRA_OPTS} /arch:${CPU_ARCH}")
101    ELSE(MSVC)
102        SET(EXTRA_OPTS "${EXTRA_OPTS} -march=${CPU_ARCH}")
103    ENDIF(MSVC)
104ENDIF(CPU_ARCH)
105
106IF(BUILD_32BIT)
107    SET(CMAKE_CXX_FLAGS "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD}")
108    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1")
109    SET(CMAKE_CXX_FLAGS_DEBUGCOV
110        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 --coverage")
111    SET(CMAKE_CXX_FLAGS_GCCSAN
112    "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all -fsanitize=address")
113    SET(CMAKE_CXX_FLAGS_GCCSSP
114        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all")
115    SET(CMAKE_CXX_FLAGS_RELEASE
116        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -O2 -fomit-frame-pointer")
117    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
118        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -funroll-loops -DDEBUG=1")
119    SET(CMAKE_CXX_FLAGS_RELWITHPROFILE
120        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -pg -funroll-loops")
121ELSE(BUILD_32BIT)
122    IF(MSVC)
123    SET(CMAKE_CXX_FLAGS "/W1 ${EXTRA_OPTS} /EHsc")
124    SET(CMAKE_CXX_FLAGS_DEBUG "/W1 ${EXTRA_OPTS} /EHsc /Zi /Od /DDEBUG=1")
125    SET(CMAKE_CXX_FLAGS_RELEASE "/W1 ${EXTRA_OPTS} /EHsc /O2")
126    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/W1 ${EXTRA_OPTS} /EHsc /Zi /O2 /DDEBUG=1")
127    ELSE(MSVC)
128    SET(CMAKE_CXX_FLAGS "-Wall ${EXTRA_OPTS} ${CPP_STANDARD}")
129    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1")
130    SET(CMAKE_CXX_FLAGS_DEBUGCOV
131        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 --coverage")
132    SET(CMAKE_CXX_FLAGS_GCCSAN
133        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all -fsanitize=address")
134    SET(CMAKE_CXX_FLAGS_GCCSSP
135        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all")
136    SET(CMAKE_CXX_FLAGS_RELEASE
137        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -O2 -fomit-frame-pointer")
138    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
139        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -funroll-loops -DDEBUG=1")
140    SET(CMAKE_CXX_FLAGS_RELWITHPROFILE
141        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -pg -funroll-loops")
142    ENDIF(MSVC)
143ENDIF(BUILD_32BIT)
144
145# check system bitness
146TRY_COMPILE(HAVE_64BIT "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/Check64Bit.cpp")
147IF(HAVE_64BIT)
148    MESSAGE(STATUS "Compile for 64-bit system")
149ELSE(HAVE_64BIT)
150    MESSAGE(STATUS "Compile for 32-bit system")
151ENDIF(HAVE_64BIT)
152
153# determine library directory name
154IF(NOT LIB_INSTALL_DIR)
155    IF(HAVE_64BIT AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
156        SET(LIB_INSTALL_DIR "lib64")
157    ELSE(HAVE_64BIT AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
158        SET(LIB_INSTALL_DIR "lib")
159    ENDIF(HAVE_64BIT AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
160    MESSAGE(STATUS "Using library install dirname ${LIB_INSTALL_DIR}")
161ENDIF(NOT LIB_INSTALL_DIR)
162
163IF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro" OR
164    IS_DIRECTORY "/usr/lib/i386-linux-gnu/amdgpu-pro")
165    SET(HAVE_UBUNTU_GPUPRO TRUE)
166    MESSAGE(STATUS "AMDGPU-PRO for Ubuntu is found")
167ENDIF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro" OR
168    IS_DIRECTORY "/usr/lib/i386-linux-gnu/amdgpu-pro")
169IF(IS_DIRECTORY "/opt/amdgpu-pro/lib/x86_64-linux-gnu" OR
170        IS_DIRECTORY "/opt/amdgpu-pro/lib/i386-linux-gnu")
171    SET(HAVE_GPUPRO_NEW TRUE)
172    MESSAGE(STATUS "New AMDGPU-PRO is found")
173ENDIF(IS_DIRECTORY "/opt/amdgpu-pro/lib/x86_64-linux-gnu" OR
174        IS_DIRECTORY "/opt/amdgpu-pro/lib/i386-linux-gnu")
175IF (NOT HAVE_GPUPRO_NEW AND NOT HAVE_UBUNTU_GPUPRO)
176    IF(IS_DIRECTORY "/opt/amdgpu-pro/lib64" OR IS_DIRECTORY "/opt/amdgpu-pro/lib")
177        SET(HAVE_GPUPRO_SLES TRUE)
178        MESSAGE(STATUS "SLES AMDGPU-PRO is found")
179    ENDIF(IS_DIRECTORY "/opt/amdgpu-pro/lib64" OR IS_DIRECTORY "/opt/amdgpu-pro/lib")
180ENDIF(NOT HAVE_GPUPRO_NEW AND NOT HAVE_UBUNTU_GPUPRO)
181
182IF("${PROJECT_SOURCE_DIR}" MATCHES "${PROJECT_BINARY_DIR}")
183    MESSAGE("Please do an out-of-tree build:")
184    MESSAGE("rm -f CMakeCache.txt; mkdir -p default; cd default; cmake ..; make")
185    MESSAGE(FATAL_ERROR "in-tree-build detected")
186ENDIF("${PROJECT_SOURCE_DIR}" MATCHES "${PROJECT_BINARY_DIR}")
187
188SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
189SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
190
191OPTION(NO_STATIC "Disable static during compiling" OFF)
192
193INCLUDE(PortUtils)
194IF(WIN32)
195  SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
196ENDIF(WIN32)
197
198####
199# Documentation
200####
201OPTION(BUILD_DOCUMENTATION "Build whole documentation" OFF)
202OPTION(BUILD_DOXYGEN "Use Doxygen to create the HTML based API documentation" OFF)
203OPTION(BUILD_MANUAL "Use Pod2Man to create the Unix manuals" OFF)
204OPTION(BUILD_CLRXDOC "Use markdown_py to create offline wiki pages" OFF)
205
206IF(BUILD_DOCUMENTATION)
207  SET(BUILD_DOXYGEN ON)
208  SET(BUILD_MANUAL ON)
209  SET(BUILD_CLRXDOC ON)
210ENDIF(BUILD_DOCUMENTATION)
211
212####
213# rules to build doxygen and clrx doc is in proper CMakeLists.txt files in subdirectories
214####
215
216IF(BUILD_MANUAL)
217    INCLUDE(Pod2Man)
218    ADD_MANPAGE_TARGET()
219ENDIF(BUILD_MANUAL)
220####
221# Documentation
222####
223
224INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}")
225INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
226
227OPTION(NO_OPENCL "Do not use OpenCL" OFF)
228OPTION(NO_CLWRAPPER "Do not enable CLRXWrapper" OFF)
229
230####
231# OpenCL find
232####
233SET(OPENCL_DIST_DIR "" CACHE PATH "OpenCL Distribution directory")
234
235IF(NOT OPENCL_DIST_DIR AND NOT NO_OPENCL)
236    IF(EXISTS /opt/AMDAPP)
237        SET(OPENCL_DIST_DIR "/opt/AMDAPP")
238        MESSAGE(STATUS "OpenCL AMDAPP found")
239    ELSEIF(EXISTS "/Program Files (x86)/AMD APP SDK")
240        FILE(GLOB OPENCL_DIST_DIR "/Program Files (x86)/AMD APP SDK/*")
241        MESSAGE(STATUS "OpenCL AMDAPP found")
242    ELSEIF(EXISTS "/Program Files/AMD APP SDK")
243        FILE(GLOB OPENCL_DIST_DIR "/Program Files/AMD APP SDK/*")
244        MESSAGE(STATUS "OpenCL AMDAPP found")
245    ELSEIF(EXISTS /usr/include/CL)
246        SET(OPENCL_DIST_DIR "/usr")
247        MESSAGE(STATUS "Standard OpenCL found.")
248    ENDIF(EXISTS /opt/AMDAPP)
249ENDIF(NOT OPENCL_DIST_DIR AND NOT NO_OPENCL)
250
251IF (NOT NO_OPENCL AND OPENCL_DIST_DIR)
252    SET(OPENCL_LIBRARY_DIRS "")
253    SET(OPENCL_INCLUDE_DIRS "${OPENCL_DIST_DIR}/include")
254    SET(OPENCL_LIBRARIES "OpenCL")
255    SET(HAVE_OPENCL 1)
256ENDIF(NOT NO_OPENCL AND OPENCL_DIST_DIR)
257
258# check for AMDAPP lib/x86 or lib/x86_64 libOpenCL.so file
259IF(HAVE_OPENCL)
260    IF(HAVE_64BIT)
261        IF(EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/libOpenCL.so OR
262            EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/OpenCL.lib)
263            SET(OPENCL_LIBRARY_DIRS "${OPENCL_DIST_DIR}/lib/x86_64")
264        ENDIF(EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/libOpenCL.so OR
265            EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/OpenCL.lib)
266    ELSE(HAVE_64BIT)
267        IF(EXISTS ${OPENCL_DIST_DIR}/lib/x86/libOpenCL.so OR
268            EXISTS ${OPENCL_DIST_DIR}/lib/x86/OpenCL.lib)
269            SET(OPENCL_LIBRARY_DIRS "${OPENCL_DIST_DIR}/lib/x86")
270        ENDIF(EXISTS ${OPENCL_DIST_DIR}/lib/x86/libOpenCL.so OR
271            EXISTS ${OPENCL_DIST_DIR}/lib/x86/OpenCL.lib)
272    ENDIF(HAVE_64BIT)
273    IF(HAVE_UBUNTU_GPUPRO)
274        IF(HAVE_64BIT)
275            SET(OPENCL_LIBRARY_DIRS "/usr/lib/x86_64-linux-gnu/amdgpu-pro")
276        ELSE(HAVE_64BIT)
277            SET(OPENCL_LIBRARY_DIRS "/usr/lib/i386-linux-gnu/amdgpu-pro")
278        ENDIF(HAVE_64BIT)
279    ENDIF(HAVE_UBUNTU_GPUPRO)
280    IF(HAVE_GPUPRO_NEW)
281        IF(HAVE_64BIT)
282            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib/x86_64-linux-gnu")
283        ELSE(HAVE_64BIT)
284            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib/i386-linux-gnu")
285        ENDIF(HAVE_64BIT)
286    ENDIF(HAVE_GPUPRO_NEW)
287    IF(HAVE_GPUPRO_SLES)
288        IF(HAVE_64BIT)
289            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib64")
290        ELSE(HAVE_64BIT)
291            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib")
292        ENDIF(HAVE_64BIT)
293    ENDIF(HAVE_GPUPRO_SLES)
294ENDIF(HAVE_OPENCL)
295
296###
297# end of OpenCL config
298###
299
300IF(HAVE_OPENCL)
301    MESSAGE(STATUS "OpenCL found")
302    MESSAGE(STATUS "OpenCL library dirs: " ${OPENCL_LIBRARY_DIRS})
303    MESSAGE(STATUS "OpenCL libraries: " ${OPENCL_LIBRARIES})
304    MESSAGE(STATUS "OpenCL include dirs: " ${OPENCL_INCLUDE_DIRS})
305ELSE(HAVE_OPENCL)
306    MESSAGE(STATUS "OpenCL not found")
307ENDIF(HAVE_OPENCL)
308
309## OpenGL finding
310
311IF(NOT NO_CLWRAPPER)
312    FIND_PACKAGE(OpenGL)
313    IF(OPENGL_INCLUDE_DIR)
314        FIND_PATH(HAVE_OPENGL GL/gl.h PATHS "${OPENGL_INCLUDE_DIR}")
315    ELSE(OPENGL_INCLUDE_DIR)
316        SET(OPENGL_INCLUDE_DIR "")
317    ENDIF(OPENGL_INCLUDE_DIR)
318    # check GL/gl.h even if OpenGL is not detected (library is not needed)
319    IF(HAVE_OPENGL)
320        MESSAGE(STATUS "OpenGL found")
321        MESSAGE(STATUS "OpenGL include dirs: " ${OPENGL_INCLUDE_DIR})
322    ELSE(HAVE_OPENGL)
323        MESSAGE(STATUS "OpenGL not found")
324    ENDIF(HAVE_OPENGL)
325ENDIF(NOT NO_CLWRAPPER)
326
327SET(CMAKE_THREAD_PREFER_PTHREAD 1)
328FIND_PACKAGE(Threads)
329
330TRY_COMPILE(HAVE_INT128 "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/Int128Detect.cpp")
331TRY_COMPILE(HAVE_CALL_ONCE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/ThreadOnce.cpp")
332
333IF(HAVE_INT128)
334    MESSAGE(STATUS "128-bit integer arithmetic detected")
335ELSE(HAVE_INT128)
336    MESSAGE(STATUS "128-bit integer arithmetic not supported by compiler")
337ENDIF(HAVE_INT128)
338
339IF(HAVE_CALL_ONCE)
340    MESSAGE(STATUS "Environment have C++11 std::call_once")
341ELSE(HAVE_CALL_ONCE)
342    MESSAGE(STATUS "Environment have no C++11 std::call_once")
343ENDIF(HAVE_CALL_ONCE)
344
345###
346# other dependencies and checks
347###
348
349FIND_PACKAGE(PNG)
350
351IF(PNG_FOUND)
352    MESSAGE(STATUS "Png found ${PNG_INCLUDE_DIRS}")
353ENDIF(PNG_FOUND)
354
355###
356# end of other dependencies and checks
357###
358
359IF(NOT WIN32)
360    SET(MATHLIB "m")
361ENDIF(NOT WIN32)
362
363CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/CLRX/Config.h.in"
364        "${PROJECT_BINARY_DIR}/CLRX/Config.h")
365
366OPTION(BUILD_TESTS "Compile tests" OFF)
367OPTION(BUILD_SAMPLES "Compile samples" OFF)
368OPTION(BUILD_STATIC_EXE "Compile static executables instead shared" OFF)
369
370# fixing CMAKE_DL_LIBS
371IF(CMAKE_DL_LIBS)
372    IF(CMAKE_DL_LIBS MATCHES "^-l")
373        SET(DL_LIBS "${CMAKE_DL_LIBS}")
374    ELSE(CMAKE_DL_LIBS MATCHES "^-l")
375        SET(DL_LIBS "-l${CMAKE_DL_LIBS}")
376    ENDIF(CMAKE_DL_LIBS MATCHES "^-l")
377ELSE(CMAKE_DL_LIBS)
378    SET(DL_LIBS "")
379ENDIF(CMAKE_DL_LIBS)
380
381IF(BUILD_STATIC_EXE)
382    SET(PROGRAM_LIB_SUFFIX "Static")
383ELSE(BUILD_STATIC_EXE)
384    SET(PROGRAM_LIB_SUFFIX "")
385ENDIF(BUILD_STATIC_EXE)
386
387IF(BUILD_TESTS)
388    ENABLE_TESTING()
389ENDIF(BUILD_TESTS)
390
391INCLUDE_DIRECTORIES(${OPENCL_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR})
392
393LINK_DIRECTORIES("${OPENCL_LIBRARY_DIRS}")
394
395ADD_SUBDIRECTORY(CLRX)
396ADD_SUBDIRECTORY(utils)
397IF(HAVE_OPENCL AND NOT NO_CLWRAPPER)
398    ADD_SUBDIRECTORY(clwrapper)
399ENDIF(HAVE_OPENCL AND NOT NO_CLWRAPPER)
400ADD_SUBDIRECTORY(amdbin)
401ADD_SUBDIRECTORY(amdasm)
402IF(HAVE_OPENCL)
403    ADD_SUBDIRECTORY(clhelper)
404ENDIF(HAVE_OPENCL)
405IF (BUILD_TESTS)
406    ADD_SUBDIRECTORY(tests)
407ENDIF(BUILD_TESTS)
408
409ADD_SUBDIRECTORY(editors)
410ADD_SUBDIRECTORY(programs)
411IF (BUILD_SAMPLES AND HAVE_OPENCL)
412    ADD_SUBDIRECTORY(samples)
413ENDIF(BUILD_SAMPLES AND HAVE_OPENCL)
414
415ADD_SUBDIRECTORY(doc)
416
417ADD_SUBDIRECTORY(pkgconfig)
418
419SET(DOCINSTALLDIR share/doc/CLRX)
420INSTALL(FILES "${PROJECT_SOURCE_DIR}/AUTHORS" DESTINATION "${DOCINSTALLDIR}")
421INSTALL(FILES "${PROJECT_SOURCE_DIR}/CONTRIBUTORS" DESTINATION "${DOCINSTALLDIR}")
422INSTALL(FILES "${PROJECT_SOURCE_DIR}/COPYING" DESTINATION "${DOCINSTALLDIR}")
423INSTALL(FILES "${PROJECT_SOURCE_DIR}/ChangeLog" DESTINATION "${DOCINSTALLDIR}")
424INSTALL(FILES "${PROJECT_SOURCE_DIR}/COPYING.LIB" DESTINATION "${DOCINSTALLDIR}")
425INSTALL(FILES "${PROJECT_SOURCE_DIR}/COPYING.DOC" DESTINATION "${DOCINSTALLDIR}")
426INSTALL(FILES "${PROJECT_SOURCE_DIR}/INSTALL" DESTINATION "${DOCINSTALLDIR}")
427INSTALL(FILES "${PROJECT_SOURCE_DIR}/README" DESTINATION "${DOCINSTALLDIR}")
428INSTALL(FILES "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${DOCINSTALLDIR}")
Note: See TracBrowser for help on using the repository browser.