auto-enabling prerequisite packages with CMake
This commit is contained in:
@ -99,8 +99,15 @@ function(check_for_autogen_files source_dir)
|
|||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
macro(pkg_depends PKG1 PKG2)
|
macro(pkg_depends PKG1 PKG2)
|
||||||
if(PKG_${PKG1} AND NOT (PKG_${PKG2} OR BUILD_${PKG2}))
|
if(DEFINED BUILD_${PKG2})
|
||||||
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be built with the ${PKG2} package")
|
if(PKG_${PKG1} AND NOT BUILD_${PKG2})
|
||||||
|
message(FATAL_ERROR "The ${PKG1} package needs LAMMPS to be built with -D BUILD_${PKG2}=ON")
|
||||||
|
endif()
|
||||||
|
elseif(DEFINED PKG_${PKG2})
|
||||||
|
if(PKG_${PKG1} AND NOT PKG_${PKG2})
|
||||||
|
message(WARNING "The ${PKG1} package depends on the ${PKG2} package. Enabling it.")
|
||||||
|
set(PKG_${PKG2} ON CACHE BOOL "" FORCE)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endmacro()
|
endmacro()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user