Help needed: libasm and others are not found (kdeedu/Kalzium)

Alexander Neundorf neundorf at kde.org
Sat Jan 20 16:26:15 CET 2007


On Saturday 20 January 2007 16:09, Carsten Niehaus wrote:
> Am Samstag, 20. Januar 2007 00:40 schrieb Alexander Neundorf:
> > find_library(ASMRUN_LIBRARY NAMES asmrun PATH_SUFFIXES ocaml)
>
> Ok, this is how my patch looks like... It works on my system.
>
>  if(LIBFACILE_FOUND)
> -   target_link_libraries(kalzium asmrun str nums m dl)
> +    find_library(ASMRUN_LIBRARY NAMES asmrun PATH_SUFFIXES ocaml)
> +    find_library(STR_LIBRARY NAMES str PATH_SUFFIXES ocaml)
> +    find_library(NUMS_LIBRARY NAMES nums PATH_SUFFIXES ocaml)
> +    find_library(M_LIBRARY NAMES m PATH_SUFFIXES ocaml)
> +    find_library(DL_LIBRARY NAMES dl PATH_SUFFIXES ocaml)
> +    target_link_libraries(kalzium
> +        ${ASMRUN_LIBRARY}
> +        ${STR_LIBRARY}
> +        ${NUMS_LIBRARY}
> +        ${M_LIBRARY}
> +        ${DL_LIBRARY}
> +        )
>  endif(LIBFACILE_FOUND)
>
> Is that ok?

Almost :-)
"m" and "dl" are libm.so and libdl.so, which are standard Linux libs, you 
probably shouldn't look for them with the ocaml "PATH_SUFFIX". Actually for 
now you can just keep the "m" and "dl" as they are in the 
target_link_libraries() calls.

For "dl" you'll have to add something special, cause this is different e.g. on 
Linux and FreeBSD AFAIK.
Do "str" and "nums" also have to do with ocaml ?
I think a good idea would be to add an additional prefix to the [STR|NUMS|
ASMRUN]_LIBRARY variable names, like OCAML_STR_LIBRARY or something like that 
(namespacing-like).

So I'd suggest:

set(kalziumExtraLibs)

find_library(OCAML_ASMRUN_LIBRARY NAMES asmrun PATH_SUFFIXES ocaml)
if (OCAML_ASMRUN_LIBRARY)
   set(kalziumExtraLibs ${kalziumExtraLibs} ${OCAML_ASMRUN_LIBRARY})
endif (OCAML_ASMRUN_LIBRARY)

find_library(OCAML_STR_LIBRARY NAMES str PATH_SUFFIXES ocaml)
if (OCAML_STR_LIBRARY)
   set(kalziumExtraLibs ${kalziumExtraLibs} ${OCAML_STR_LIBRARY})
endif (OCAML_STR_LIBRARY)

find_library(OCAML_NUMS_LIBRARY NAMES nums PATH_SUFFIXES ocaml)
if (OCAML_NUMS_LIBRARY)
   set(kalziumExtraLibs ${kalziumExtraLibs} ${OCAML_NUMS_LIBRARY})
endif (OCAML_NUMS_LIBRARY)

target_link_libraries(kalzium ${kalziumExtraLibs} m dl)

The if()s are required because if e.g.  asmrun isn't found, then the value of 
OCAML_ASMRUN_LIBRARY will be "OCAML_ASMRUN_LIBRARY-NOTFOUND" or something 
like this, and the linker won't find libOCAML_ASMRUN_LIBRARY-NOTFOUND.so I 
guess ;-)

Bye
Alex
-- 
Work: alexander.neundorf AT jenoptik.com - http://www.jenoptik-los.de
Home: neundorf AT kde.org                - http://www.kde.org
      alex AT neundorf.net               - http://www.neundorf.net


More information about the Kde-buildsystem mailing list