From 3cb80093e08e062b87987d1bc2d96088dcad1d5a Mon Sep 17 00:00:00 2001 From: Jon Trulson Date: Wed, 24 Aug 2016 15:40:30 -0600 Subject: [PATCH] src/CMakeLists.txt: add upm utilities as a link dependency for C libs Make sure that for all C libs, upmc-utilities is linked in. Also, do not do this for the utilities library itself. In addition, do not add the utilities library as a requirement for the libupmc-utilities pkgconfig file. Signed-off-by: Jon Trulson --- src/CMakeLists.txt | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 3c04d010..28cf68e1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -248,8 +248,10 @@ function (UPM_MIXED_MODULE_INIT) # Create the reqlibname list string(REPLACE ";" " " reqlibname "${UPM_MIXED_MODULE_INIT_REQUIRES}") - # Append upm-utilities to the reqlibs - set (reqlibname "${reqlibname} upm-utilities") + # Append upmc-utilities to the reqlibs (but not on upm-utilities itself) + if (NOT ${libname} MATCHES "utilities") + set (reqlibname "${reqlibname} upmc-utilities") + endif() # If building FTI, and FTI src exists, add it in if (BUILDFTI AND UPM_MIXED_MODULE_INIT_FTI_SRC) @@ -266,7 +268,13 @@ function (UPM_MIXED_MODULE_INIT) # Set a flag to tell upm_module_init that it's building a C library set (IS_C_LIBRARY TRUE) upm_module_init() - endif (UPM_MIXED_MODULE_INIT_C_SRC) + + # add upmc-utilities as a dependancy to all C libs (but NOT to the + # utilities lib itself) + if (NOT ${libname} MATCHES "utilities-c") + target_link_libraries (${libname} upmc-utilities) + endif() +endif (UPM_MIXED_MODULE_INIT_C_SRC) # Build C++ if enabled AND C++ headers exist if (BUILDCPP AND UPM_MIXED_MODULE_INIT_CPP_HDR)