Skip to content

Commit

Permalink
use overridable cache var for top_level
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Nov 28, 2023
1 parent 7880ac2 commit 8df812d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion cmake/lapack.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
include(GNUInstallDirs)
include(ExternalProject)

if(NOT PROJECT_IS_TOP_LEVEL)
if(NOT SCALAPACK_IS_TOP_LEVEL)
message(STATUS "${PROJECT_NAME} ${PROJECT_VERSION} deferring to ${CMAKE_PROJECT_NAME} for LAPACK")
return()
endif()
Expand Down
9 changes: 1 addition & 8 deletions options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
# Necessary for shared library with Visual Studio / Windows oneAPI
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS true)

if(CMAKE_VERSION VERSION_LESS 3.21)
get_property(not_top DIRECTORY PROPERTY PARENT_DIRECTORY)
if(NOT not_top)
set(PROJECT_IS_TOP_LEVEL true)
endif()
endif()

if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND PROJECT_IS_TOP_LEVEL)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT AND SCALAPACK_IS_TOP_LEVEL)
set(CMAKE_INSTALL_PREFIX ${PROJECT_BINARY_DIR}/local CACHE PATH "Install path" FORCE)
endif()

0 comments on commit 8df812d

Please sign in to comment.