Add standard variables/location hints

There is a convention that one can do `pkg-config --variable=includedir`
and have it return the path to the source files (even if that should
have been taken care of by options in --cflags).
This commit is contained in:
Roland Kaufmann 2013-02-04 11:18:58 +01:00
parent ae14059a15
commit 6f3a7baccd
2 changed files with 12 additions and 3 deletions

View File

@ -15,7 +15,7 @@ function (unseparate_args var_name prefix value)
endfunction (unseparate_args var_name prefix value)
# wrapper to set variables in pkg-config file
function (configure_pc_file name source dest libdir includedir)
function (configure_pc_file name source dest prefix libdir includedir)
# escape set of standard strings
unseparate_args (includes "-I" "${${name}_INCLUDE_DIRS}")
unseparate_args (libs "-l" "${${name}_LIBRARIES}")
@ -27,7 +27,7 @@ function (configure_pc_file name source dest libdir includedir)
set (minor "${${name}_VERSION_MINOR}")
configure_file (${source} ${dest} @ONLY)
endfunction (configure_pc_file name source dist libdir includedir)
endfunction (configure_pc_file name source dist prefix libdir includedir)
# installation of CMake modules to help user programs locate the library
function (opm_cmake_config name)
@ -52,6 +52,7 @@ function (opm_cmake_config name)
${name}
${PROJECT_SOURCE_DIR}/${name}.pc.in
${PROJECT_BINARY_DIR}/${name}.pc
${PROJECT_BINARY_DIR}
${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
${PROJECT_SOURCE_DIR}
)
@ -101,7 +102,8 @@ function (opm_cmake_config name)
${name}
${PROJECT_SOURCE_DIR}/${name}.pc.in
${PROJECT_BINARY_DIR}/${name}-install.pc
${CMAKE_INSTALL_LIBDIR}
${CMAKE_INSTALL_PREFIX}
${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}
${CMAKE_INSTALL_PREFIX}/include
)

View File

@ -1,3 +1,10 @@
prefix=@prefix@
libdir=@libdir@
includedir=@includedir@
CXX=@CMAKE_CXX_COMPILER@ @CXX_STD0X_FLAGS@ @OpenMP_CXX_FLAGS@
CC=@CMAKE_C_COMPILER@ @C_STD99_FLAGS@ @OpenMP_C_FLAGS@
DEPENDENCIES=
Name: OPM Core
Description: Open Porous Media Initiative Core Library @major@.@minor@
Version: @major@.@minor@