-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle potential external gau2grid with higher-level target check (#95)
- Loading branch information
1 parent
843fe01
commit 211ba12
Showing
1 changed file
with
38 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
if( GAUXC_ENABLE_GAU2GRID ) | ||
|
||
if( GAUXC_FORCE_EXTERNAL_GAU2GRID ) | ||
|
||
find_package( gau2grid CONFIG QUIET ) | ||
if( NOT gau2grid_FOUND ) | ||
|
||
include( gauxc-dep-versions ) | ||
|
||
message( STATUS "Could not find Gau2grid... Building" ) | ||
message( STATUS "GAU2GRID REPO = ${GAUXC_GAU2GRID_REPOSITORY}" ) | ||
message( STATUS "GAU2GRID REV = ${GAUXC_GAU2GRID_REVISION}" ) | ||
|
||
FetchContent_Declare( | ||
gau2grid | ||
GIT_REPOSITORY ${GAUXC_GAU2GRID_REPOSITORY} | ||
GIT_TAG ${GAUXC_GAU2GRID_REVISION} | ||
) | ||
|
||
set( MAX_AM 6 CACHE STRING "" ) | ||
set( DISABLE_PRAGMA ON CACHE BOOL "" ) | ||
FetchContent_MakeAvailable( gau2grid ) | ||
|
||
endif() | ||
|
||
if( NOT TARGET gau2grid::gg ) | ||
message( STATUS "Something Went Horribly Wrong With Gau2Grid discovery!" ) | ||
endif() | ||
|
||
else() | ||
|
||
add_subdirectory( ${PROJECT_SOURCE_DIR}/external/gau2grid ${PROJECT_BINARY_DIR}/external/gau2grid ) | ||
|
||
endif() | ||
|
||
|
||
# First try to find the package if target doesn't exist | ||
find_package( gau2grid CONFIG QUIET ) | ||
|
||
if( NOT gau2grid_FOUND ) | ||
|
||
message( STATUS "Could not find Gau2grid... Building" ) | ||
|
||
if( GAUXC_FORCE_EXTERNAL_GAU2GRID ) | ||
|
||
include( gauxc-dep-versions ) | ||
|
||
message( STATUS "GAU2GRID REPO = ${GAUXC_GAU2GRID_REPOSITORY}" ) | ||
message( STATUS "GAU2GRID REV = ${GAUXC_GAU2GRID_REVISION}" ) | ||
|
||
FetchContent_Declare( | ||
gau2grid | ||
GIT_REPOSITORY ${GAUXC_GAU2GRID_REPOSITORY} | ||
GIT_TAG ${GAUXC_GAU2GRID_REVISION} | ||
) | ||
|
||
set( MAX_AM 6 CACHE STRING "" ) | ||
set( DISABLE_PRAGMA ON CACHE BOOL "" ) | ||
FetchContent_MakeAvailable( gau2grid ) | ||
|
||
if( NOT TARGET gau2grid::gg ) | ||
message( STATUS "Something Went Horribly Wrong With Gau2Grid discovery!" ) | ||
endif() | ||
|
||
else() | ||
|
||
message( STATUS "Building Pregenerated Gau2grid" ) | ||
add_subdirectory( ${PROJECT_SOURCE_DIR}/external/gau2grid ${PROJECT_BINARY_DIR}/external/gau2grid ) | ||
|
||
endif() | ||
|
||
endif() # If not discoverable | ||
endif() # If target not present | ||
endif() # If enabled |