Skip to content

Commit 3333ca7

Browse files
committed
Fix pkgconfig install path on package
1 parent 4066171 commit 3333ca7

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

CMakeLists.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ if (NOT BIN_INSTALL_DIR)
205205
endif ()
206206

207207
if (NOT INCLUDE_INSTALL_DIR)
208-
set(INCLUDE_INSTALL_DIR include)
208+
set(INCLUDE_INSTALL_DIR include/${LIB_NAME})
209209
endif ()
210210

211211
# Always build the STATIC library
@@ -408,16 +408,14 @@ endif ()
408408
include(CPack)
409409

410410
# pkg-config
411-
set(INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}" CACHE PATH "Installation directory for libraries")
412-
set(INSTALL_INCDIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" CACHE PATH "Installation directory for headers")
413411
configure_file(
414412
"${CMAKE_CURRENT_SOURCE_DIR}/${LIB_NAME}.pc.cmake.in"
415413
"${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc"
416414
@ONLY
417415
)
418416
install(FILES
419417
"${CMAKE_CURRENT_BINARY_DIR}/${LIB_NAME}.pc"
420-
DESTINATION "${INSTALL_LIBDIR}/pkgconfig"
418+
DESTINATION "${LIB_INSTALL_DIR}/pkgconfig"
421419
)
422420

423421
# eof

README/BUILD.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ If you do **not** need the tidy library built as a 'shared' (DLL) library, then
4040

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

43+
## Build the tidy packages
44+
45+
1. `cd build/cmake`
46+
47+
2. `cmake ../.. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr`
48+
49+
3. Unix/OS X: `make package`
50+
4351
## Build PHP with the tidy-html5 library
4452

4553
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.

tidy.pc.cmake.in

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
libdir=@INSTALL_LIBDIR@
2-
includedir=@INSTALL_INCDIR@
1+
prefix=@CMAKE_INSTALL_PREFIX@
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/@LIB_INSTALL_DIR@
4+
includedir=${prefix}/@INCLUDE_INSTALL_DIR@
35

46
Name: @LIB_NAME@
57
Description: @LIBTIDY_DESCRIPTION@

0 commit comments

Comments
 (0)