Enable parallel tests.
[hoomd-blue.git] / CMake / cuda / FindThrust.cmake
blobd048d92acacd4d7d854f8a47aac2d03ff217fc8b
1 # Maintainer: jglaser
2 # Find Thrust header files
3 # based on a source from ryuuta@gmail.com
5 find_path( THRUST_INCLUDE_DIR
6     HINTS /usr/include/cuda /usr/local/include ${CUDA_INCLUDE_DIRS}
7     NAMES thrust/version.h
8     DOC "Thrust headers"
11 # Find thrust version
12 file( STRINGS ${THRUST_INCLUDE_DIR}/thrust/version.h
13       version
14       REGEX "#define THRUST_VERSION[ \t]+([0-9x]+)"
17 string( REGEX REPLACE "#define THRUST_VERSION[ \t]+" "" version ${version} )
18 string( REGEX MATCH "^[0-9]" major ${version} )
19 string( REGEX REPLACE "^${major}00" "" version ${version} )
20 string( REGEX MATCH "^[0-9]" minor ${version} )
21 string( REGEX REPLACE "^${minor}0" "" version ${version} )
22 set( THRUST_VERSION "${major}.${minor}.${version}")
24 # Check for required components
25 set( THRUST_FOUND TRUE )
27 find_package_handle_standard_args( Thrust REQUIRED_VARS THRUST_INCLUDE_DIR THRUST_VERSION )