File tree Expand file tree Collapse file tree 4 files changed +12
-19
lines changed
Expand file tree Collapse file tree 4 files changed +12
-19
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ INCLUDE(AddCFlagIfSupported)
3636INCLUDE (FindPkgLibraries)
3737INCLUDE (FindThreads)
3838INCLUDE (FindStatNsec)
39+ INCLUDE (GNUInstallDirs)
3940INCLUDE (IdeSplitSources)
4041INCLUDE (FeatureSummary)
4142INCLUDE (EnableWarnings)
Original file line number Diff line number Diff line change @@ -247,9 +247,9 @@ For more advanced use or questions about CMake please read <https://cmake.org/Wi
247247
248248The following CMake variables are declared:
249249
250- - ` BIN_INSTALL_DIR ` : Where to install binaries to.
251- - ` LIB_INSTALL_DIR ` : Where to install libraries to.
252- - ` INCLUDE_INSTALL_DIR ` : Where to install headers to.
250+ - ` CMAKE_INSTALL_BINDIR ` : Where to install binaries to.
251+ - ` CMAKE_INSTALL_LIBDIR ` : Where to install libraries to.
252+ - ` CMAKE_INSTALL_INCLUDEDIR ` : Where to install headers to.
253253- ` BUILD_SHARED_LIBS ` : Build libgit2 as a Shared Library (defaults to ON)
254254- ` BUILD_CLAR ` : Build [ Clar] ( https://github.com/vmg/clar ) -based test suite (defaults to ON)
255255- ` THREADSAFE ` : Build libgit2 with threading support (defaults to ON)
Original file line number Diff line number Diff line change @@ -27,8 +27,8 @@ function(pkg_build_config)
2727 # Write .pc "header"
2828 file (WRITE "${PKGCONFIG_FILE} "
2929 "prefix=\" ${CMAKE_INSTALL_PREFIX} \"\n "
30- "libdir=\" ${LIB_INSTALL_DIR } \"\n "
31- "includedir=\" ${INCLUDE_INSTALL_DIR } \"\n "
30+ "libdir=\" ${CMAKE_INSTALL_FULL_LIBDIR } \"\n "
31+ "includedir=\" ${CMAKE_INSTALL_FULL_INCLUDEDIR } \"\n "
3232 "\n "
3333 "Name: ${PKGCONFIG_NAME} \n "
3434 "Description: ${PKGCONFIG_DESCRIPTION} \n "
@@ -73,7 +73,5 @@ function(pkg_build_config)
7373 file (APPEND "${PKGCONFIG_FILE} " "Cflags: -I\$ {includedir} ${PKGCONFIG_CFLAGS} \n " )
7474
7575 # Install .pc file
76- install (FILES "${PKGCONFIG_FILE} "
77- DESTINATION "${LIB_INSTALL_DIR} /pkgconfig"
78- )
76+ install (FILES "${PKGCONFIG_FILE} " DESTINATION "${CMAKE_INSTALL_LIBDIR} /pkgconfig" )
7977endfunction ()
Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ SET(LIBGIT2_INCLUDES
2121SET (LIBGIT2_SYSTEM_INCLUDES "" )
2222SET (LIBGIT2_LIBS "" )
2323
24- # Installation paths
25- #
26- SET (BIN_INSTALL_DIR bin CACHE PATH "Where to install binaries to." )
27- SET (LIB_INSTALL_DIR lib CACHE PATH "Where to install libraries to." )
28- SET (INCLUDE_INSTALL_DIR include CACHE PATH "Where to install headers to." )
29-
3024# Enable tracing
3125IF (ENABLE_TRACE)
3226 SET (GIT_TRACE 1)
@@ -391,9 +385,9 @@ ENDIF ()
391385
392386# Install
393387INSTALL (TARGETS git2
394- RUNTIME DESTINATION ${BIN_INSTALL_DIR }
395- LIBRARY DESTINATION ${LIB_INSTALL_DIR }
396- ARCHIVE DESTINATION ${LIB_INSTALL_DIR }
388+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR }
389+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR }
390+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR }
397391)
398- INSTALL (DIRECTORY ${libgit2_SOURCE_DIR} /include /git2 DESTINATION ${INCLUDE_INSTALL_DIR} )
399- INSTALL (FILES ${libgit2_SOURCE_DIR} /include /git2.h DESTINATION ${INCLUDE_INSTALL_DIR} )
392+ INSTALL (DIRECTORY ${libgit2_SOURCE_DIR} /include /git2 DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
393+ INSTALL (FILES ${libgit2_SOURCE_DIR} /include /git2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} )
You can’t perform that action at this time.
0 commit comments