25f4aa12dbea6eed2420b726abc6d3593a41f232
[alexxy/gromacs.git] / src / kernel / gmx_gpu_utils / CMakeLists.txt
1
2 # (slightly sloppy) OS definitions required by memtestG80
3 set(_os_def)
4 if(UNIX)
5     if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
6         set(_os_def "-DOSX")
7     else() # everything that's UNIX & UNIX-like except OS X
8         set(_os_def "-DLINUX")
9     endif()
10 else()
11     if(WIN32)
12         set(_os_def "-DWINDOWS")
13     else()
14         message(FATAL_ERROR " Could not detect OS required for memtestG80.")
15     endif()
16 endif()
17
18 CUDA_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
19 set(CUDA_ATTACH_VS_BUILD_RULE_TO_CUDA_FILE OFF)        
20 if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
21     CUDA_ADD_LIBRARY(gmx_gpu_utils  
22         gmx_gpu_utils.cu 
23         memtestG80_core.cu 
24         OPTIONS ${_os_def}
25         DEBUG -g -D_DEBUG_=1 
26         )
27 else()
28     CUDA_ADD_LIBRARY(gmx_gpu_utils 
29         gmx_gpu_utils.cu 
30         memtestG80_core.cu 
31         OPTIONS ${_os_def}
32         )
33 endif()
34 CUDA_BUILD_CLEAN_TARGET()
35
36 target_link_libraries(gmx_gpu_utils gmx)
37 install(TARGETS gmx_gpu_utils DESTINATION ${LIB_INSTALL_DIR})   
38