Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Commit

Permalink
thrust: separate out determination of whether Thrust is top-level pro…
Browse files Browse the repository at this point in the history
…ject
  • Loading branch information
germasch committed Sep 26, 2020
1 parent bd6d6e9 commit 9fda8b1
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,17 @@ endif()

project(Thrust NONE)

# Determine whether Thrust is the top-level project or included into
# another project via add_subdirectory()
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}")
set(THRUST_TOPLEVEL_PROJECT ON)
else()
set(THRUST_TOPLEVEL_PROJECT OFF)
endif()

# Support adding Thrust to a parent project via add_subdirectory.
# See examples/cmake/add_subdir/CMakeLists.txt for details.
if (NOT "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_LIST_DIR}")
if (NOT THRUST_TOPLEVEL_PROJECT)
include(cmake/ThrustAddSubdir.cmake)
return()
endif()
Expand Down

0 comments on commit 9fda8b1

Please sign in to comment.