Applied Daniel Macks' patch to use ${CMAKE_INSTALL_LIBDIR} instead of

hardcoding lib for the installation directory of libraries, with the
additional modification of installing the pkg-config files there too.
closing bug #217


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1743 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
jtsiomb 2015-02-18 00:37:05 +00:00
parent 3d4b5a78a9
commit 7229171bf4
2 changed files with 10 additions and 7 deletions

View File

@ -1,6 +1,9 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR)
PROJECT(freeglut) PROJECT(freeglut)
# for multiarch LIBDIR support (requires cmake>=2.8.8)
INCLUDE(GNUInstallDirs)
# NOTE: On Windows and Cygwin, the dll's are placed in the # NOTE: On Windows and Cygwin, the dll's are placed in the
# CMAKE_RUNTIME_OUTPUT_DIRECTORY, while their corresponding import # CMAKE_RUNTIME_OUTPUT_DIRECTORY, while their corresponding import
# libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY. On other # libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY. On other
@ -413,8 +416,8 @@ ENDIF()
IF(FREEGLUT_BUILD_SHARED_LIBS) IF(FREEGLUT_BUILD_SHARED_LIBS)
INSTALL(TARGETS freeglut INSTALL(TARGETS freeglut
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
IF(INSTALL_PDB) IF(INSTALL_PDB)
INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb
@ -425,8 +428,8 @@ ENDIF()
IF(FREEGLUT_BUILD_STATIC_LIBS) IF(FREEGLUT_BUILD_STATIC_LIBS)
INSTALL(TARGETS freeglut_static INSTALL(TARGETS freeglut_static
RUNTIME DESTINATION bin RUNTIME DESTINATION bin
LIBRARY DESTINATION lib LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION lib ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
) )
IF(INSTALL_PDB) IF(INSTALL_PDB)
INSTALL(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/Debug/freeglut_static${CMAKE_DEBUG_POSTFIX}.pdb INSTALL(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/Debug/freeglut_static${CMAKE_DEBUG_POSTFIX}.pdb
@ -522,6 +525,6 @@ IF(FREEGLUT_GLES)
SET(PC_FILENAME "freeglut-gles.pc") SET(PC_FILENAME "freeglut-gles.pc")
ENDIF() ENDIF()
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeglut.pc.in ${CMAKE_BINARY_DIR}/freeglut.pc @ONLY) CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/freeglut.pc.in ${CMAKE_BINARY_DIR}/freeglut.pc @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/freeglut.pc DESTINATION lib/pkgconfig/ RENAME ${PC_FILENAME}) INSTALL(FILES ${CMAKE_BINARY_DIR}/freeglut.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig/ RENAME ${PC_FILENAME})
# TODO: change the library and .pc name when building for GLES, # TODO: change the library and .pc name when building for GLES,
# e.g. -lglut-GLES # e.g. -lglut-GLES

View File

@ -1,5 +1,5 @@
prefix=@CMAKE_INSTALL_PREFIX@ prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib libdir=@CMAKE_INSTALL_FULL_LIBDIR@
includedir=${prefix}/include includedir=${prefix}/include
Name: glut Name: glut