git-svn-id: svn://db.shs.com.ru/pip@559 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 2.6)
|
||||
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
|
||||
include(CheckFunctionExists)
|
||||
include(PIPMacros.cmake)
|
||||
|
||||
|
||||
# Options
|
||||
@@ -33,7 +34,7 @@ set(PIP_SRC_CRYPT "src_crypt")
|
||||
set(PIP_SRC_COMPRESS "src_compress")
|
||||
set(PIP_SRC_USB "src_usb")
|
||||
set(PIP_SRC_FFTW "src_fftw")
|
||||
#set(PIP_SRC_RESOURCES "src_resources")
|
||||
set(PIP_SRC_OPENCL "src_opencl")
|
||||
set(PIP_LIBS_TARGETS pip)
|
||||
set(LIBS_MAIN)
|
||||
set(LIBS_STATUS)
|
||||
@@ -86,7 +87,7 @@ endif()
|
||||
# Sources
|
||||
|
||||
# Main lib
|
||||
set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io" "console" "math" "code" "geo" "resources")
|
||||
set(PIP_FOLDERS "." "core" "containers" "thread" "system" "io" "console" "math" "code" "geo" "resources" "opencl")
|
||||
include_directories("${PIP_SRC_MAIN}")
|
||||
foreach(F ${PIP_FOLDERS})
|
||||
include_directories("${PIP_SRC_MAIN}/${F}")
|
||||
@@ -105,8 +106,8 @@ gather_src("${PIP_SRC_USB}" CPP_LIB_USB HDRS PHDRS)
|
||||
# FFTW lib
|
||||
gather_src("${PIP_SRC_FFTW}" CPP_LIB_FFTW HDRS PHDRS)
|
||||
|
||||
# Resources lib
|
||||
#gather_src("${PIP_SRC_RESOURCES}" CPP_LIB_RESOURCES HDRS PHDRS)
|
||||
# OpenCL lib
|
||||
gather_src("${PIP_SRC_OPENCL}" CPP_LIB_OPENCL HDRS PHDRS)
|
||||
|
||||
|
||||
# Check Bessel functions
|
||||
@@ -361,10 +362,23 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
# Add resource system
|
||||
#add_library(pip_resources SHARED ${CPP_LIB_RESOURCES})
|
||||
#target_link_libraries(pip_resources pip )
|
||||
#list(APPEND PIP_LIBS_TARGETS pip_resources)
|
||||
# Check if PIP support OpenCL
|
||||
find_package(OpenCL QUIET)
|
||||
if(OpenCL_FOUND)
|
||||
message(STATUS "Building with OpenCL support")
|
||||
include_directories(${OpenCL_INCLUDE_DIRS})
|
||||
add_definitions(-DPIP_OPENCL)
|
||||
pip_resources(CL_RES "src_opencl/resources.conf")
|
||||
add_library(pip_opencl SHARED ${CPP_LIB_OPENCL} ${CL_RES})
|
||||
add_dependencies(pip_opencl pip_rc)
|
||||
target_link_libraries(pip_opencl pip ${OpenCL_LIBRARIES})
|
||||
list(APPEND LIBS_STATUS OpenCL)
|
||||
list(APPEND PIP_LIBS_TARGETS pip_opencl)
|
||||
set(OpenCL_FOUND ${OpenCL_LIBRARIES})
|
||||
else()
|
||||
message(STATUS "Building without OpenCL support")
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
# Test program
|
||||
@@ -386,6 +400,7 @@ if(LIB)
|
||||
#message("${STDLIB}")
|
||||
if (STDLIB)
|
||||
file(COPY "${STDLIB}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/utils/code_model_generator")
|
||||
file(COPY "${STDLIB}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/utils/resources_compiler")
|
||||
endif()
|
||||
endif()
|
||||
else()
|
||||
|
||||
Reference in New Issue
Block a user