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

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

CLRadeonExtender: Add support for FreeBSD with clang.

  • Property svn:mime-type set to text/plain
File size: 15.3 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(HAVE_GNU11_FLAG AND HAVE_GNU11_IOSTREAM)
77    SET(CPP_STANDARD "-std=gnu++11")
78    SET(HAVE_GNU11 1)
79ELSE(HAVE_GNU11_FLAG AND HAVE_GNU11_IOSTREAM)
80    SET(CPP_STANDARD "-std=c++11")
81ENDIF(HAVE_GNU11_FLAG AND HAVE_GNU11_IOSTREAM)
82
83MESSAGE(STATUS "Use standard ${CPP_STANDARD} for ${CMAKE_CXX_COMPILER}")
84
85IF(GCC5CXX11NEWABI)
86    ADD_DEFINITIONS(-D_GLIBCXX_USE_CXX11_ABI=1)
87ENDIF(GCC5CXX11NEWABI)
88
89### 32-bit compilation option
90OPTION(BUILD_32BIT "Build 32-bit version" OFF)
91
92IF(CPU_ARCH)
93    IF(MSVC)
94        SET(EXTRA_OPTS "${EXTRA_OPTS} /arch:${CPU_ARCH}")
95    ELSE(MSVC)
96        SET(EXTRA_OPTS "${EXTRA_OPTS} -march=${CPU_ARCH}")
97    ENDIF(MSVC)
98ENDIF(CPU_ARCH)
99
100IF(BUILD_32BIT)
101    SET(CMAKE_CXX_FLAGS "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD}")
102    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1")
103    SET(CMAKE_CXX_FLAGS_DEBUGCOV
104        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 --coverage")
105    SET(CMAKE_CXX_FLAGS_GCCSAN
106    "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all -fsanitize=address")
107    SET(CMAKE_CXX_FLAGS_GCCSSP
108        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all")
109    SET(CMAKE_CXX_FLAGS_RELEASE
110        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -O2 -fomit-frame-pointer")
111    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
112        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -funroll-loops -DDEBUG=1")
113    SET(CMAKE_CXX_FLAGS_RELWITHPROFILE
114        "-Wall -m32 ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -pg -funroll-loops")
115ELSE(BUILD_32BIT)
116    IF(MSVC)
117    SET(CMAKE_CXX_FLAGS "/W1 ${EXTRA_OPTS} /EHsc")
118    SET(CMAKE_CXX_FLAGS_DEBUG "/W1 ${EXTRA_OPTS} /EHsc /Zi /Od /DDEBUG=1")
119    SET(CMAKE_CXX_FLAGS_RELEASE "/W1 ${EXTRA_OPTS} /EHsc /O2")
120    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/W1 ${EXTRA_OPTS} /EHsc /Zi /O2 /DDEBUG=1")
121    ELSE(MSVC)
122    SET(CMAKE_CXX_FLAGS "-Wall ${EXTRA_OPTS} ${CPP_STANDARD}")
123    SET(CMAKE_CXX_FLAGS_DEBUG "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1")
124    SET(CMAKE_CXX_FLAGS_DEBUGCOV
125        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 --coverage")
126    SET(CMAKE_CXX_FLAGS_GCCSAN
127        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all -fsanitize=address")
128    SET(CMAKE_CXX_FLAGS_GCCSSP
129        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O0 -DDEBUG=1 -fstack-protector-all")
130    SET(CMAKE_CXX_FLAGS_RELEASE
131        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -O2 -fomit-frame-pointer")
132    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO
133        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -funroll-loops -DDEBUG=1")
134    SET(CMAKE_CXX_FLAGS_RELWITHPROFILE
135        "-Wall ${EXTRA_OPTS} ${CPP_STANDARD} -g -O2 -pg -funroll-loops")
136    ENDIF(MSVC)
137ENDIF(BUILD_32BIT)
138
139# FreeBSD support
140IF("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
141    MESSAGE(STATUS "Add -stdlib=libc++ for FreeBSD")
142    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
143    SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -stdlib=libc++")
144    SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -stdlib=libc++")
145    SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -stdlib=libc++")
146ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
147
148# check system bitness
149TRY_COMPILE(HAVE_64BIT "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/Check64Bit.cpp")
150IF(HAVE_64BIT)
151    MESSAGE(STATUS "Compile for 64-bit system")
152ELSE(HAVE_64BIT)
153    MESSAGE(STATUS "Compile for 32-bit system")
154ENDIF(HAVE_64BIT)
155
156# determine library directory name
157IF(NOT LIB_INSTALL_DIR)
158    IF(HAVE_64BIT AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
159        SET(LIB_INSTALL_DIR "lib64")
160    ELSE(HAVE_64BIT AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
161        SET(LIB_INSTALL_DIR "lib")
162    ENDIF(HAVE_64BIT AND CMAKE_SYSTEM_NAME STREQUAL "Linux")
163    MESSAGE(STATUS "Using library install dirname ${LIB_INSTALL_DIR}")
164ENDIF(NOT LIB_INSTALL_DIR)
165
166IF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro" OR
167    IS_DIRECTORY "/usr/lib/i386-linux-gnu/amdgpu-pro")
168    SET(HAVE_UBUNTU_GPUPRO TRUE)
169    MESSAGE(STATUS "AMDGPU-PRO for Ubuntu is found")
170ENDIF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro" OR
171    IS_DIRECTORY "/usr/lib/i386-linux-gnu/amdgpu-pro")
172IF(IS_DIRECTORY "/opt/amdgpu-pro/lib/x86_64-linux-gnu" OR
173        IS_DIRECTORY "/opt/amdgpu-pro/lib/i386-linux-gnu")
174    SET(HAVE_GPUPRO_NEW TRUE)
175    MESSAGE(STATUS "New AMDGPU-PRO is found")
176ENDIF(IS_DIRECTORY "/opt/amdgpu-pro/lib/x86_64-linux-gnu" OR
177        IS_DIRECTORY "/opt/amdgpu-pro/lib/i386-linux-gnu")
178IF (NOT HAVE_GPUPRO_NEW AND NOT HAVE_UBUNTU_GPUPRO)
179    IF(IS_DIRECTORY "/opt/amdgpu-pro/lib64" OR IS_DIRECTORY "/opt/amdgpu-pro/lib")
180        SET(HAVE_GPUPRO_SLES TRUE)
181        MESSAGE(STATUS "SLES AMDGPU-PRO is found")
182    ENDIF(IS_DIRECTORY "/opt/amdgpu-pro/lib64" OR IS_DIRECTORY "/opt/amdgpu-pro/lib")
183ENDIF(NOT HAVE_GPUPRO_NEW AND NOT HAVE_UBUNTU_GPUPRO)
184
185IF("${PROJECT_SOURCE_DIR}" MATCHES "${PROJECT_BINARY_DIR}")
186    MESSAGE("Please do an out-of-tree build:")
187    MESSAGE("rm -f CMakeCache.txt; mkdir -p default; cd default; cmake ..; make")
188    MESSAGE(FATAL_ERROR "in-tree-build detected")
189ENDIF("${PROJECT_SOURCE_DIR}" MATCHES "${PROJECT_BINARY_DIR}")
190
191SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
192SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}")
193
194OPTION(NO_STATIC "Disable static during compiling" OFF)
195
196INCLUDE(PortUtils)
197IF(WIN32)
198  SET(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
199ENDIF(WIN32)
200
201####
202# Documentation
203####
204OPTION(BUILD_DOCUMENTATION "Build whole documentation" OFF)
205OPTION(BUILD_DOXYGEN "Use Doxygen to create the HTML based API documentation" OFF)
206OPTION(BUILD_MANUAL "Use Pod2Man to create the Unix manuals" OFF)
207OPTION(BUILD_CLRXDOC "Use markdown_py to create offline wiki pages" OFF)
208
209IF(BUILD_DOCUMENTATION)
210  SET(BUILD_DOXYGEN ON)
211  SET(BUILD_MANUAL ON)
212  SET(BUILD_CLRXDOC ON)
213ENDIF(BUILD_DOCUMENTATION)
214
215####
216# rules to build doxygen and clrx doc is in proper CMakeLists.txt files in subdirectories
217####
218
219IF(BUILD_MANUAL)
220    INCLUDE(Pod2Man)
221    ADD_MANPAGE_TARGET()
222ENDIF(BUILD_MANUAL)
223####
224# Documentation
225####
226
227INCLUDE_DIRECTORIES("${PROJECT_SOURCE_DIR}")
228INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}")
229
230OPTION(NO_OPENCL "Do not use OpenCL" OFF)
231OPTION(NO_CLWRAPPER "Do not enable CLRXWrapper" OFF)
232
233####
234# OpenCL find
235####
236SET(OPENCL_DIST_DIR "" CACHE PATH "OpenCL Distribution directory")
237
238IF(NOT OPENCL_DIST_DIR AND NOT NO_OPENCL)
239    IF(EXISTS /opt/AMDAPP)
240        SET(OPENCL_DIST_DIR "/opt/AMDAPP")
241        MESSAGE(STATUS "OpenCL AMDAPP found")
242    ELSEIF(EXISTS "/Program Files (x86)/AMD APP SDK")
243        FILE(GLOB OPENCL_DIST_DIR "/Program Files (x86)/AMD APP SDK/*")
244        MESSAGE(STATUS "OpenCL AMDAPP found")
245    ELSEIF(EXISTS "/Program Files/AMD APP SDK")
246        FILE(GLOB OPENCL_DIST_DIR "/Program Files/AMD APP SDK/*")
247        MESSAGE(STATUS "OpenCL AMDAPP found")
248    ELSEIF(EXISTS /usr/include/CL)
249        SET(OPENCL_DIST_DIR "/usr")
250        MESSAGE(STATUS "Standard OpenCL found.")
251    ENDIF(EXISTS /opt/AMDAPP)
252ENDIF(NOT OPENCL_DIST_DIR AND NOT NO_OPENCL)
253
254IF (NOT NO_OPENCL AND OPENCL_DIST_DIR)
255    SET(OPENCL_LIBRARY_DIRS "")
256    SET(OPENCL_INCLUDE_DIRS "${OPENCL_DIST_DIR}/include")
257    SET(OPENCL_LIBRARIES "OpenCL")
258    SET(HAVE_OPENCL 1)
259ENDIF(NOT NO_OPENCL AND OPENCL_DIST_DIR)
260
261# check for AMDAPP lib/x86 or lib/x86_64 libOpenCL.so file
262IF(HAVE_OPENCL)
263    IF(HAVE_64BIT)
264        IF(EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/libOpenCL.so OR
265            EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/OpenCL.lib)
266            SET(OPENCL_LIBRARY_DIRS "${OPENCL_DIST_DIR}/lib/x86_64")
267        ENDIF(EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/libOpenCL.so OR
268            EXISTS ${OPENCL_DIST_DIR}/lib/x86_64/OpenCL.lib)
269    ELSE(HAVE_64BIT)
270        IF(EXISTS ${OPENCL_DIST_DIR}/lib/x86/libOpenCL.so OR
271            EXISTS ${OPENCL_DIST_DIR}/lib/x86/OpenCL.lib)
272            SET(OPENCL_LIBRARY_DIRS "${OPENCL_DIST_DIR}/lib/x86")
273        ENDIF(EXISTS ${OPENCL_DIST_DIR}/lib/x86/libOpenCL.so OR
274            EXISTS ${OPENCL_DIST_DIR}/lib/x86/OpenCL.lib)
275    ENDIF(HAVE_64BIT)
276    IF(HAVE_UBUNTU_GPUPRO)
277        IF(HAVE_64BIT)
278            SET(OPENCL_LIBRARY_DIRS "/usr/lib/x86_64-linux-gnu/amdgpu-pro")
279        ELSE(HAVE_64BIT)
280            SET(OPENCL_LIBRARY_DIRS "/usr/lib/i386-linux-gnu/amdgpu-pro")
281        ENDIF(HAVE_64BIT)
282    ENDIF(HAVE_UBUNTU_GPUPRO)
283    IF(HAVE_GPUPRO_NEW)
284        IF(HAVE_64BIT)
285            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib/x86_64-linux-gnu")
286        ELSE(HAVE_64BIT)
287            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib/i386-linux-gnu")
288        ENDIF(HAVE_64BIT)
289    ENDIF(HAVE_GPUPRO_NEW)
290    IF(HAVE_GPUPRO_SLES)
291        IF(HAVE_64BIT)
292            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib64")
293        ELSE(HAVE_64BIT)
294            SET(OPENCL_LIBRARY_DIRS "/opt/amdgpu-pro/lib")
295        ENDIF(HAVE_64BIT)
296    ENDIF(HAVE_GPUPRO_SLES)
297ENDIF(HAVE_OPENCL)
298
299###
300# end of OpenCL config
301###
302
303IF(HAVE_OPENCL)
304    MESSAGE(STATUS "OpenCL found")
305    MESSAGE(STATUS "OpenCL library dirs: " ${OPENCL_LIBRARY_DIRS})
306    MESSAGE(STATUS "OpenCL libraries: " ${OPENCL_LIBRARIES})
307    MESSAGE(STATUS "OpenCL include dirs: " ${OPENCL_INCLUDE_DIRS})
308ELSE(HAVE_OPENCL)
309    MESSAGE(STATUS "OpenCL not found")
310ENDIF(HAVE_OPENCL)
311
312## OpenGL finding
313
314IF(NOT NO_CLWRAPPER)
315    FIND_PACKAGE(OpenGL)
316    IF(OPENGL_INCLUDE_DIR)
317        FIND_PATH(HAVE_OPENGL GL/gl.h PATHS "${OPENGL_INCLUDE_DIR}")
318    ELSE(OPENGL_INCLUDE_DIR)
319        SET(OPENGL_INCLUDE_DIR "")
320    ENDIF(OPENGL_INCLUDE_DIR)
321    # check GL/gl.h even if OpenGL is not detected (library is not needed)
322    IF(HAVE_OPENGL)
323        MESSAGE(STATUS "OpenGL found")
324        MESSAGE(STATUS "OpenGL include dirs: " ${OPENGL_INCLUDE_DIR})
325    ELSE(HAVE_OPENGL)
326        MESSAGE(STATUS "OpenGL not found")
327    ENDIF(HAVE_OPENGL)
328ENDIF(NOT NO_CLWRAPPER)
329
330SET(CMAKE_THREAD_PREFER_PTHREAD 1)
331FIND_PACKAGE(Threads)
332
333TRY_COMPILE(HAVE_INT128 "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/Int128Detect.cpp")
334TRY_COMPILE(HAVE_CALL_ONCE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/ThreadOnce.cpp")
335
336IF(HAVE_INT128)
337    MESSAGE(STATUS "128-bit integer arithmetic detected")
338ELSE(HAVE_INT128)
339    MESSAGE(STATUS "128-bit integer arithmetic not supported by compiler")
340ENDIF(HAVE_INT128)
341
342IF(HAVE_CALL_ONCE)
343    MESSAGE(STATUS "Environment have C++11 std::call_once")
344ELSE(HAVE_CALL_ONCE)
345    MESSAGE(STATUS "Environment have no C++11 std::call_once")
346ENDIF(HAVE_CALL_ONCE)
347
348###
349# other dependencies and checks
350###
351
352FIND_PACKAGE(PNG)
353
354IF(PNG_FOUND)
355    MESSAGE(STATUS "Png found ${PNG_INCLUDE_DIRS}")
356ENDIF(PNG_FOUND)
357
358###
359# end of other dependencies and checks
360###
361
362IF(NOT WIN32)
363    SET(MATHLIB "m")
364ENDIF(NOT WIN32)
365
366CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/CLRX/Config.h.in"
367        "${PROJECT_BINARY_DIR}/CLRX/Config.h")
368
369OPTION(BUILD_TESTS "Compile tests" OFF)
370OPTION(BUILD_SAMPLES "Compile samples" OFF)
371OPTION(BUILD_STATIC_EXE "Compile static executables instead shared" OFF)
372
373# fixing CMAKE_DL_LIBS
374IF(CMAKE_DL_LIBS)
375    IF(CMAKE_DL_LIBS MATCHES "^-l")
376        SET(DL_LIBS "${CMAKE_DL_LIBS}")
377    ELSE(CMAKE_DL_LIBS MATCHES "^-l")
378        SET(DL_LIBS "-l${CMAKE_DL_LIBS}")
379    ENDIF(CMAKE_DL_LIBS MATCHES "^-l")
380ELSE(CMAKE_DL_LIBS)
381    SET(DL_LIBS "")
382ENDIF(CMAKE_DL_LIBS)
383
384IF(BUILD_STATIC_EXE)
385    SET(PROGRAM_LIB_SUFFIX "Static")
386ELSE(BUILD_STATIC_EXE)
387    SET(PROGRAM_LIB_SUFFIX "")
388ENDIF(BUILD_STATIC_EXE)
389
390IF(BUILD_TESTS)
391    ENABLE_TESTING()
392ENDIF(BUILD_TESTS)
393
394INCLUDE_DIRECTORIES(${OPENCL_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIR})
395
396LINK_DIRECTORIES("${OPENCL_LIBRARY_DIRS}")
397
398ADD_SUBDIRECTORY(CLRX)
399ADD_SUBDIRECTORY(utils)
400IF(HAVE_OPENCL AND NOT NO_CLWRAPPER)
401    ADD_SUBDIRECTORY(clwrapper)
402ENDIF(HAVE_OPENCL AND NOT NO_CLWRAPPER)
403ADD_SUBDIRECTORY(amdbin)
404ADD_SUBDIRECTORY(amdasm)
405IF(HAVE_OPENCL)
406    ADD_SUBDIRECTORY(clhelper)
407ENDIF(HAVE_OPENCL)
408IF (BUILD_TESTS)
409    ADD_SUBDIRECTORY(tests)
410ENDIF(BUILD_TESTS)
411
412ADD_SUBDIRECTORY(editors)
413ADD_SUBDIRECTORY(programs)
414IF (BUILD_SAMPLES AND HAVE_OPENCL)
415    ADD_SUBDIRECTORY(samples)
416ENDIF(BUILD_SAMPLES AND HAVE_OPENCL)
417
418ADD_SUBDIRECTORY(doc)
419
420ADD_SUBDIRECTORY(pkgconfig)
421
422SET(DOCINSTALLDIR share/doc/CLRX)
423INSTALL(FILES "${PROJECT_SOURCE_DIR}/AUTHORS" DESTINATION "${DOCINSTALLDIR}")
424INSTALL(FILES "${PROJECT_SOURCE_DIR}/CONTRIBUTORS" DESTINATION "${DOCINSTALLDIR}")
425INSTALL(FILES "${PROJECT_SOURCE_DIR}/COPYING" DESTINATION "${DOCINSTALLDIR}")
426INSTALL(FILES "${PROJECT_SOURCE_DIR}/ChangeLog" DESTINATION "${DOCINSTALLDIR}")
427INSTALL(FILES "${PROJECT_SOURCE_DIR}/COPYING.LIB" DESTINATION "${DOCINSTALLDIR}")
428INSTALL(FILES "${PROJECT_SOURCE_DIR}/COPYING.DOC" DESTINATION "${DOCINSTALLDIR}")
429INSTALL(FILES "${PROJECT_SOURCE_DIR}/INSTALL" DESTINATION "${DOCINSTALLDIR}")
430INSTALL(FILES "${PROJECT_SOURCE_DIR}/README" DESTINATION "${DOCINSTALLDIR}")
431INSTALL(FILES "${PROJECT_SOURCE_DIR}/README.md" DESTINATION "${DOCINSTALLDIR}")
Note: See TracBrowser for help on using the repository browser.