CMakeLists.txt
1.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#Specify the version being used aswell as the language
cmake_minimum_required(VERSION 2.8)
#Name your project here
project(bimsim)
#set the module directory
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}")
#set up CUDA
find_package(CUDA)
#find OpenCV
find_package(OpenCV REQUIRED )
find_package(Boost REQUIRED)
#find the STIM library
find_package(STIM)
#build the executable in the binary directory on MS Visual Studio
if ( MSVC )
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}")
SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
SET( LIBRARY_OUTPUT_DIRECTORY_DEBUG "${OUTPUT_DIRECTORY}")
SET( LIBRARY_OUTPUT_DIRECTORY_RELEASE "${OUTPUT_DIRECTORY}")
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_SCL_SECURE_NO_WARNINGS)
endif ( MSVC )
#MAYBE REMOVE-----------------
#set C++11 flags if using GCC
if( CMAKE_COMPILER_IS_GNUCC )
SET( CMAKE_CXX_FLAGS "-std=c++11")
# SET( CUDA_NVCC_FLAGS "-std=c++11")
endif( CMAKE_COMPILER_IS_GNUCC )
#-----------------------------
#set the include directories
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
${STIM_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
)
#SET(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS};/maxregcount=60)
#create an executable
cuda_add_executable(bimsim
bimsim.cu
sources.h
)
#set the link libraries
target_link_libraries(bimsim
${CUDA_cufft_LIBRARY}
${CUDA_cublas_LIBRARY}
${OpenCV_LIBS}
)