mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-26 21:00:34 +05:00
Propagate all user-defined CMake variables to subproject
This commit is contained in:
parent
360e6fba86
commit
ef3d7c9270
@ -4,7 +4,7 @@ set_property (DIRECTORY PROPERTY EP_PREFIX dependencies)
|
|||||||
|
|
||||||
set (NETGEN_DEPENDENCIES)
|
set (NETGEN_DEPENDENCIES)
|
||||||
set (LAPACK_DEPENDENCIES)
|
set (LAPACK_DEPENDENCIES)
|
||||||
set (NETGEN_CMAKE_ARGS)
|
set (NETGEN_CMAKE_ARGS "" CACHE INTERNAL "")
|
||||||
|
|
||||||
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake_modules")
|
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake_modules")
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ macro(set_vars VAR_OUT)
|
|||||||
foreach(varname ${ARGN})
|
foreach(varname ${ARGN})
|
||||||
if(NOT "${${varname}}" STREQUAL "")
|
if(NOT "${${varname}}" STREQUAL "")
|
||||||
string(REPLACE ";" "$<SEMICOLON>" varvalue "${${varname}}" )
|
string(REPLACE ";" "$<SEMICOLON>" varvalue "${${varname}}" )
|
||||||
list(APPEND ${VAR_OUT} -D${varname}=${varvalue})
|
set(${VAR_OUT} ${${VAR_OUT}};-D${varname}=${varvalue} CACHE INTERNAL "")
|
||||||
endif()
|
endif()
|
||||||
endforeach()
|
endforeach()
|
||||||
endmacro()
|
endmacro()
|
||||||
@ -132,10 +132,19 @@ set_vars( NETGEN_CMAKE_ARGS
|
|||||||
INSTALL_DEPENDENCIES
|
INSTALL_DEPENDENCIES
|
||||||
INTEL_MIC
|
INTEL_MIC
|
||||||
CMAKE_PREFIX_PATH
|
CMAKE_PREFIX_PATH
|
||||||
OCC_INCLUDE_DIR
|
|
||||||
OCC_LIBRARY_DIR
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# propagate all variables set on the command line using cmake -DFOO=BAR
|
||||||
|
# to Netgen subproject
|
||||||
|
get_cmake_property(CACHE_VARS CACHE_VARIABLES)
|
||||||
|
foreach(CACHE_VAR ${CACHE_VARS})
|
||||||
|
get_property(CACHE_VAR_HELPSTRING CACHE ${CACHE_VAR} PROPERTY HELPSTRING)
|
||||||
|
if(CACHE_VAR_HELPSTRING STREQUAL "No help, variable specified on the command line.")
|
||||||
|
get_property(CACHE_VAR_TYPE CACHE ${CACHE_VAR} PROPERTY TYPE)
|
||||||
|
set(NETGEN_CMAKE_ARGS ${NETGEN_CMAKE_ARGS};-D${CACHE_VAR}:${CACHE_VAR_TYPE}=${${CACHE_VAR}} CACHE INTERNAL "")
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
if(${CMAKE_GENERATOR} STREQUAL "Unix Makefiles")
|
||||||
set(NETGEN_BUILD_COMMAND $(MAKE) --silent )
|
set(NETGEN_BUILD_COMMAND $(MAKE) --silent )
|
||||||
else()
|
else()
|
||||||
|
Loading…
Reference in New Issue
Block a user