Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle external gau2grid #95

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 38 additions & 33 deletions cmake/gauxc-gau2grid.cmake
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
Loading