Commit 5789938c authored by Martin Heistermann's avatar Martin Heistermann

cmake: apply partial ordering to optional libraries.

We need to make sure that optional libraries are loaded in an order
compatible with their depencency graph. This change makes sure CoMISo,
OpenVolumeMesh and HexEx are loaded first, so other libraries can depend
on them.
parent 8eb406a6
......@@ -267,9 +267,24 @@ file (
set( REMAINING_LOCAL_LIBS "" )
# move the following libraries to the front of the list
# to have add_subdirectory() order match the dependency graph.
set( _local_libs_ordered "" )
foreach(_pattern CoMISo OpenVolumeMesh libHexEx)
foreach (_localLib ${_local_libs_in})
if ( "${_localLib}" MATCHES ".*${_pattern}.*" )
LIST(APPEND _local_libs_ordered ${_localLib})
endif()
endforeach()
endforeach()
LIST(APPEND _local_libs_ordered ${_local_libs_in})
LIST(REMOVE_DUPLICATES _local_libs_ordered)
# Special Comiso case:
# The library has to be configured first
foreach (_localLib ${_local_libs_in})
foreach (_localLib ${_local_libs_ordered})
if ( "${_localLib}" MATCHES .*CoMISo.* )
get_filename_component (_local_lib_dir ${_localLib} PATH)
if ( NOT DEFINED LIB_COMISO_BUILD )
......@@ -286,7 +301,6 @@ foreach (_localLib ${_local_libs_in})
endif()
endforeach ()
# add all found libs to the build
foreach (_localLib ${REMAINING_LOCAL_LIBS})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment