Commit 8bbda71d authored by Mike Kremer's avatar Mike Kremer
Browse files

Corrected cmake THRUST finder to behave correctly.

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@12202 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 55128e3b
......@@ -21,31 +21,33 @@ if( THRUST_INCLUDE_DIR )
list( REMOVE_DUPLICATES THRUST_INCLUDE_DIR )
endif( THRUST_INCLUDE_DIR )
# Parse version file to get the thrust version numbers
file( STRINGS ${THRUST_INCLUDE_DIR}/thrust/version.h
version
REGEX "#define THRUST_VERSION[ \t]+([0-9x]+)"
)
# Check for required components
if ( THRUST_INCLUDE_DIR )
string( REGEX REPLACE "#define THRUST_VERSION[ \t]+" "" version ${version} )
# Parse version file to get the thrust version numbers
string( REGEX MATCH "^[0-9]" major ${version} )
string( REGEX REPLACE "^${major}00" "" version ${version} )
string( REGEX MATCH "^[0-9]" minor ${version} )
string( REGEX REPLACE "^${minor}0" "" version ${version} )
set( THRUST_VERSION "${major}.${minor}.${version}")
file( STRINGS ${THRUST_INCLUDE_DIR}/thrust/version.h
version
REGEX "#define THRUST_VERSION[ \t]+([0-9x]+)"
)
string( REGEX REPLACE "#define THRUST_VERSION[ \t]+" "" version ${version} )
string( REGEX MATCH "^[0-9]" major ${version} )
string( REGEX REPLACE "^${major}00" "" version ${version} )
string( REGEX MATCH "^[0-9]" minor ${version} )
string( REGEX REPLACE "^${minor}0" "" version ${version} )
set( THRUST_VERSION "${major}.${minor}.${version}")
# Check for required components
if ( THRUST_INCLUDE_DIR )
SET( THRUST_FOUND TRUE )
SET( THRUST_FOUND TRUE )
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Thrust
REQUIRED_VARS
THRUST_INCLUDE_DIR
VERSION_VAR
THRUST_VERSION
)
include( FindPackageHandleStandardArgs )
find_package_handle_standard_args( Thrust
REQUIRED_VARS
THRUST_INCLUDE_DIR
VERSION_VAR
THRUST_VERSION
)
endif()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment