Browse Source

lib != lib64, lib != lib32

Kolan Sh 11 months ago
parent
commit
9ba1995060
3 changed files with 17 additions and 8 deletions
  1. 5
    1
      CPackCommonRules.cmake
  2. 5
    1
      PkgConfigCommonRules.cmake
  3. 7
    6
      ValaLibCommonRules.cmake

+ 5
- 1
CPackCommonRules.cmake View File

@@ -12,7 +12,11 @@ SET (CPACK_PACKAGE_DESCRIPTION_FILE
12 12
     "${CMAKE_SOURCE_DIR}/README")
13 13
 SET (pkgconfig_file "${PROJECT_BINARY_DIR}/pkg-config/${PROJECT_LOWERCASE_NAME}-${MAJOR}.pc")
14 14
 IF (EXISTS ${pkgconfig_file})
15
-  INSTALL (FILES ${pkgconfig_file} DESTINATION lib/pkgconfig)
15
+  SET (lib "lib")
16
+  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
17
+    SET (lib "lib64")
18
+  ENDIF()
19
+  INSTALL (FILES ${pkgconfig_file} DESTINATION ${lib}/pkgconfig)
16 20
 ENDIF ()
17 21
 #SET (CPACK_NSIS_PACKAGE_NAME "${PROJECT_NAME}")
18 22
 #SET (CPACK_NSIS_DISPLAY_NAME "${PROJECT_NAME}")

+ 5
- 1
PkgConfigCommonRules.cmake View File

@@ -4,7 +4,11 @@ ELSE (WIN32)
4 4
   SET (PkgConfigPrefix ${CMAKE_INSTALL_PREFIX})
5 5
 ENDIF (WIN32)
6 6
 SET (PkgConfigExecPrefix "\${prefix}")
7
-SET (PkgConfigLibDir "\${exec_prefix}/lib")
7
+SET (lib "lib")
8
+IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
9
+  SET (lib "lib64")
10
+ENDIF()
11
+SET (PkgConfigLibDir "\${exec_prefix}/${lib}")
8 12
 SET (PkgConfigIncludeDir "\${prefix}/include")
9 13
 
10 14
 SET (PkgConfigName "${CMAKE_PROJECT_NAME}")

+ 7
- 6
ValaLibCommonRules.cmake View File

@@ -42,12 +42,13 @@ IF (LibIsPlugin)
42 42
   SET (install_prefix "/${LibInstallPrefix}/${LibName}-${MAJOR}")
43 43
 ENDIF (LibIsPlugin)
44 44
 
45
+SET (lib "lib")
46
+IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
47
+  SET (lib "lib64")
48
+ENDIF()
49
+
45 50
 IF (UNIX)
46
-  IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
47
-    SET (install_dest lib64${install_prefix})
48
-  ELSE()
49
-    SET (install_dest lib${install_prefix})
50
-  ENDIF()
51
+  SET (install_dest ${lib}${install_prefix})
51 52
   #INCLUDE (GNUInstallDirs)
52 53
   #SET (install_dest ${CMAKE_INSTALL_FULL_LIBDIR}${install_prefix})
53 54
 ELSEIF (WIN32)
@@ -61,7 +62,7 @@ IF (LibInstall)
61 62
   ELSE (LibNoApi)
62 63
     INSTALL (TARGETS ${LibName} RUNTIME DESTINATION ${install_dest}
63 64
                                 LIBRARY DESTINATION ${install_dest}
64
-                                ARCHIVE DESTINATION lib)
65
+                                ARCHIVE DESTINATION ${lib})
65 66
     INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.h DESTINATION include)
66 67
     INSTALL (FILES ${CMAKE_CURRENT_BINARY_DIR}/${LibName}-${MAJOR}.vapi DESTINATION share/vala/vapi)
67 68
   ENDIF (LibNoApi)

Loading…
Cancel
Save