Skip to content

Commit

Permalink
Fix pkgconfig install path on package
Browse files Browse the repository at this point in the history
  • Loading branch information
spk committed May 2, 2017
1 parent 4066171 commit 3333ca7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
6 changes: 2 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ if (NOT BIN_INSTALL_DIR)
endif ()

if (NOT INCLUDE_INSTALL_DIR)
set(INCLUDE_INSTALL_DIR include)
set(INCLUDE_INSTALL_DIR include/${LIB_NAME})
endif ()

# Always build the STATIC library
Expand Down Expand Up @@ -408,16 +408,14 @@ endif ()
include(CPack)

# pkg-config
set(INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" CACHE PATH "Installation directory for libraries")
set(INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" CACHE PATH "Installation directory for headers")
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc"
@ONLY
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc"
DESTINATION "${INSTALL_LIBDIR}/pkgconfig"
DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
)

# eof
8 changes: 8 additions & 0 deletions README/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ If you do **not** need the tidy library built as a 'shared' (DLL) library, then

See the `CMakeLists.txt` file for other CMake **options** offered.

## Build the tidy packages

1. `cd build/cmake`

2. `cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr`

3. Unix/OS X: `make package`

## Build PHP with the tidy-html5 library

Due to API changes in the PHP source, `buffio.h` needs to be renamed to `tidybuffio.h` in the file `ext/tidy/tidy.c` in PHP's source.
Expand Down
6 changes: 4 additions & 2 deletions tidy.pc.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
libdir=@INSTALL_LIBDIR@
includedir=@INSTALL_INCDIR@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@LIB_INSTALL_DIR@
includedir=${prefix}/@INCLUDE_INSTALL_DIR@

Name: @LIB_NAME@
Description: @LIBTIDY_DESCRIPTION@
Expand Down

0 comments on commit 3333ca7

Please sign in to comment.