Only compile code if non-empty code was submitted for DUNE/OPM.
Also make the search fail if the compilation fails.
This commit is contained in:
parent
d5388ba653
commit
7c30586fde
@ -115,6 +115,7 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
# without config.h
|
# without config.h
|
||||||
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
config_cmd_line (${module}_CMD_CONFIG ${module}_CONFIG_VARS)
|
||||||
|
|
||||||
|
if(prog)
|
||||||
# check that we can compile a small test-program
|
# check that we can compile a small test-program
|
||||||
include (CMakePushCheckState)
|
include (CMakePushCheckState)
|
||||||
cmake_push_check_state ()
|
cmake_push_check_state ()
|
||||||
@ -128,13 +129,20 @@ macro (find_opm_package module deps header lib defs prog conf)
|
|||||||
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
|
list (APPEND CMAKE_REQUIRED_DEFINITIONS ${${module}_CMD_CONFIG})
|
||||||
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
|
check_cxx_source_compiles ("${prog}" HAVE_${MODULE})
|
||||||
cmake_pop_check_state ()
|
cmake_pop_check_state ()
|
||||||
|
else(prog)
|
||||||
|
if(${module}_FOUND)
|
||||||
|
# No test code provided, mark compilation as successful
|
||||||
|
# if module was founf
|
||||||
|
set(HAVE_${MODULE} 1)
|
||||||
|
endif(${module}_FOUND)
|
||||||
|
endif(prog)
|
||||||
|
|
||||||
# write status message in the same manner as everyone else
|
# write status message in the same manner as everyone else
|
||||||
include (FindPackageHandleStandardArgs)
|
include (FindPackageHandleStandardArgs)
|
||||||
find_package_handle_standard_args (
|
find_package_handle_standard_args (
|
||||||
${module}
|
${module}
|
||||||
DEFAULT_MSG
|
DEFAULT_MSG
|
||||||
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS
|
${module}_INCLUDE_DIRS ${module}_LIBRARIES ${module}_FOUND ${module}_ALL_PREREQS HAVE_${MODULE}
|
||||||
)
|
)
|
||||||
|
|
||||||
# some genius that coded the FindPackageHandleStandardArgs figured out
|
# some genius that coded the FindPackageHandleStandardArgs figured out
|
||||||
|
Loading…
Reference in New Issue
Block a user