From: John Tsiombikas Date: Wed, 18 Feb 2015 00:37:05 +0000 (+0000) Subject: Applied Daniel Macks' patch to use ${CMAKE_INSTALL_LIBDIR} instead of X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=7bfd924830b2a26d2bf8d1bd6d83de49576077ff;p=freeglut 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: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1743 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/CMakeLists.txt b/CMakeLists.txt index a00e54a..909884c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,9 @@ -CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) 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 # CMAKE_RUNTIME_OUTPUT_DIRECTORY, while their corresponding import # libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY. On other @@ -413,8 +416,8 @@ ENDIF() IF(FREEGLUT_BUILD_SHARED_LIBS) INSTALL(TARGETS freeglut RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) IF(INSTALL_PDB) INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb @@ -425,8 +428,8 @@ ENDIF() IF(FREEGLUT_BUILD_STATIC_LIBS) INSTALL(TARGETS freeglut_static RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ) IF(INSTALL_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") ENDIF() 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, # e.g. -lglut-GLES diff --git a/freeglut.pc.in b/freeglut.pc.in index 54340b3..bc9249c 100644 --- a/freeglut.pc.in +++ b/freeglut.pc.in @@ -1,5 +1,5 @@ prefix=@CMAKE_INSTALL_PREFIX@ -libdir=${prefix}/lib +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=${prefix}/include Name: glut