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 -.
This commit is contained in:
Bernhard Miklautz 2014-04-23 10:14:48 +02:00
parent 1ba793b126
commit d23afa499e

View File

@ -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})