← Back to team overview

dolfin team mailing list archive

Re: [Branch ~dolfin-core/dolfin/main] Rev 4942: Generating pkg-config file with CMake now works. More work is needed though.

 

On Wed, 2010-08-11 at 10:10 +0000, noreply@xxxxxxxxxxxxx wrote:
> ------------------------------------------------------------
> revno: 4942
> committer: Johannes Ring <johannr@xxxxxxxxx>
> branch nick: dolfin
> timestamp: Wed 2010-08-11 12:08:09 +0200
> message:
>   Generating pkg-config file with CMake now works. More work is needed though.

Nice. Looks like it's almost there.

Garth

> modified:
>   CMakeLists.txt
>   dolfin/CMakeLists.txt
>   dolfin/dolfin.pc.cmake.in
> 
> 
> --
> lp:dolfin
> https://code.launchpad.net/~dolfin-core/dolfin/main
> 
> Your team DOLFIN Core Team is subscribed to branch lp:dolfin.
> To unsubscribe from this branch go to https://code.launchpad.net/~dolfin-core/dolfin/main/+edit-subscription
> differences between files attachment (revision-diff.txt)
> === modified file 'CMakeLists.txt'
> --- CMakeLists.txt	2010-08-10 21:18:41 +0000
> +++ CMakeLists.txt	2010-08-11 10:08:09 +0000
> @@ -123,6 +123,7 @@
>  set(DOLFIN_BIN_DIR "bin")
>  set(DOLFIN_LIB_DIR "lib")
>  set(DOLFIN_INCLUDE_DIR "include")
> +set(DOLFIN_PKGCONFIG_DIR "lib/pkgconfig")
>  set(DOLFIN_SHARE_DIR "share")
>  set(DOLFIN_MAN_DIR "share/man")
>  set(DOLFIN_INSTALL_PYTHON_MODULE_DIR "lib/python2.6/site-packages")
> 
> === modified file 'dolfin/CMakeLists.txt'
> --- dolfin/CMakeLists.txt	2010-08-11 07:44:07 +0000
> +++ dolfin/CMakeLists.txt	2010-08-11 10:08:09 +0000
> @@ -101,11 +101,28 @@
>  
>  add_subdirectory(swig)
>  
> -# Generate and install pkg-config file
> -set(PACKAGE_REQUIRES "ufc-1 libxml-2.0")
> -configure_file("${CMAKE_CURRENT_SOURCE_DIR}/dolfin.pc.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/dolfin.pc" @ONLY)
> -install(FILES "${CMAKE_CURRENT_BINARY_DIR}/dolfin.pc"
> -  DESTINATION ${DOLFIN_LIB_DIR}/pkgconfig
> +# Define packages that should be required by pkg-config file
> +set(PKG_REQUIRES "ufc-1 libxml-2.0")
> +
> +# Convert include dirs to -I<incdir> form for use in pkg-config file
> +foreach(_inc_dir ${DOLFIN_INCLUDE_DIRECTORIES})
> +  set(PKG_CXXFLAGS "-I${_inc_dir} ${PKG_CXXFLAGS}")
> +endforeach()
> +
> +# Convert libraries to -L<libdir> -l<lib> form for use in pkg-config file 
> +# FIXME: this is not cross-platform ready
> +foreach(_lib ${DOLFIN_TARGET_LINK_LIBRARIES})
> +  string(REGEX REPLACE "(/[^ ]*)/lib([^ ]*)\\.so" "-L\\1 -l\\2"
> +    _linkflags
> +    "${_lib}"
> +    )
> +  set(PKG_LINKFLAGS "${_linkflags} ${PKG_LINKFLAGS}")
> +endforeach()
> +
> +# Configure and install pkg-config file
> +configure_file(dolfin.pc.cmake.in dolfin.pc @ONLY)
> +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/dolfin.pc
> +  DESTINATION ${DOLFIN_PKGCONFIG_DIR}
>    COMPONENT Development
>    )
>  
> 
> === modified file 'dolfin/dolfin.pc.cmake.in'
> --- dolfin/dolfin.pc.cmake.in	2010-08-10 07:05:07 +0000
> +++ dolfin/dolfin.pc.cmake.in	2010-08-11 10:08:09 +0000
> @@ -11,7 +11,7 @@
>  Name: DOLFIN
>  Description: Dynamic Object-oriented Library for FINite element computation
>  Version: @DOLFIN_VERSION@
> -Requires: @PACKAGE_REQUIRES@
> +Requires: @PKG_REQUIRES@
>  Conflicts:
> -Libs: @PACKAGE_LINKFLAGS@ -L${libdir} -ldolfin 
> -Cflags: @PACKAGE_CXXFLAGS@ -I${includedir} 
> +Libs: @PKG_LINKFLAGS@ -L${libdir} -ldolfin 
> +Cflags: @PKG_CXXFLAGS@ -I${includedir} 
>