From d23afa499eef353d44ca4bb441aef2cb9102e0ef Mon Sep 17 00:00:00 2001 From: Bernhard Miklautz Date: Wed, 23 Apr 2014 10:14:48 +0200 Subject: [PATCH] export_complex_library add support for long names If no MODULE is given the first part of LIBNAME is used as module. The expected format is still MODULE-LIBNAME but now LIBNAME can also contain -. --- cmake/ComplexLibrary.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/ComplexLibrary.cmake b/cmake/ComplexLibrary.cmake index 5e91582e9..98ef345e9 100644 --- a/cmake/ComplexLibrary.cmake +++ b/cmake/ComplexLibrary.cmake @@ -47,9 +47,11 @@ function(export_complex_library) message(FATAL_ERROR "export_complex_library requires a name to be set") endif() if (NOT ${PREFIX}_MODULE) + # get the module prefix and remove it from libname string(REPLACE "-" ";" LIBNAME_LIST "${${PREFIX}_LIBNAME}") list(GET LIBNAME_LIST 0 MODULE) - list(GET LIBNAME_LIST 1 LIBNAME) + list(REMOVE_AT LIBNAME_LIST 0) + string(REPLACE ";" "-" LIBNAME "${LIBNAME_LIST}") else() set(MODULE ${${PREFIX}_MODULE}) set(LIBNAME ${${PREFIX}_LIBNAME})