Skip to content

Commit

Permalink
use distinct var for top_level
Browse files Browse the repository at this point in the history
<PROJECT_NAME>_IS_TOP_LEVEL is not externally overridable,
even with CMAKE_CACHE_ARGS
  • Loading branch information
scivision committed Nov 28, 2023
1 parent 58be2bc commit c68c29d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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
6 changes: 5 additions & 1 deletion options.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
if(DEFINED SCALAPACK_IS_TOP)
set(SCALAPACK_IS_TOP_LEVEL ${SCALAPACK_IS_TOP})
endif()

if(local)
get_filename_component(local ${local} ABSOLUTE)

Expand Down Expand Up @@ -33,6 +37,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_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 c68c29d

Please sign in to comment.