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

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

CLRadeonExtender: Change version to 0.1.5.

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