Applied Daniel Macks' patch to use ${CMAKE_INSTALL_LIBDIR} instead of
authorJohn Tsiombikas <nuclear@member.fsf.org>
Wed, 18 Feb 2015 00:37:05 +0000 (00:37 +0000)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Wed, 18 Feb 2015 00:37:05 +0000 (00:37 +0000)
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

CMakeLists.txt
freeglut.pc.in

index a00e54a..909884c 100644 (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
 # CMAKE_RUNTIME_OUTPUT_DIRECTORY, while their corresponding import
 # libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY. On other
 # 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
 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
     )
     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
 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
     )
     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)
   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
 # TODO: change the library and .pc name when building for GLES,
 # e.g. -lglut-GLES
index 54340b3..bc9249c 100644 (file)
@@ -1,5 +1,5 @@
 prefix=@CMAKE_INSTALL_PREFIX@
 prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/lib
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
 includedir=${prefix}/include
 
 Name: glut
 includedir=${prefix}/include
 
 Name: glut