I'm a cmake novice, so please forgive any misconceptions that I have.

I'm attempting to use cmake for a project that contains multiple libraries, which in turn have dependencies on libraries both inside the project and outside. For example, let's call the project "a" and it has two libraries named "one" and "two". "two" depends on "one" and one then needs Motif, Xt, X11, etc to link. What is the best way to export the information needed to compile and link these different libraries so that another version of cmake can use "two" and "everything just works"?

I tried EXPORT_LIBRARY_DEPENDENCIES and while this writes out "one" and "two"'s libraries it does not give me any information on how the code was compiled. I have also attempted to use:

CONFIGURE_FILE("one.pc.cmake" "${CMAKE_BINARY_DIR}/one.pc" @ONLY)
INSTALL(FILES "${CMAKE_BINARY_DIR}/one.pc" DESTINATION $ {PKGCONFIG_INSTALL_PREFIX})

Where one.pc.cmake contains:

[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@

Name: one
Description: one library
Version:
Requires:
Libs: [EMAIL PROTECTED]@ @MOTIF_LIBRARIES@ @X11_Xt_LIB@ @X11_LIBRARIES@
Cflags: @CMAKE_C_FLAGS@ -I${includedir}

This is a bit better since Cflags now contains the -D commands but it still is missing the compiler options.

The show stopping problem with this idea is that Libs: is not in a form that pkg-config can use since it contains:

Libs: -L/usr/lib64 /usr/lib64/libXm.so /usr/lib64/libXt.so -lSM;/usr/ lib64/libICE.so;/usr/lib64/libX11.so;/usr/lib64/lib/Xext.so

What should I be doing?




_______________________________________________
CMake mailing list
[email protected]
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to