Sfoglia il codice sorgente

Disable pkg-config on Android, and use the existing macro for minizip

Antoine Bolvy 8 anni fa
parent
commit
125d2ab955
3 ha cambiato i file con 9 aggiunte e 9 eliminazioni
  1. 1 4
      CMakeLists.txt
  2. 7 4
      cmake-modules/FindPkgMacros.cmake
  3. 1 1
      cmake-modules/FindZLIB.cmake

+ 1 - 4
CMakeLists.txt

@@ -185,7 +185,6 @@ if (ASSIMP_COVERALLS)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage")
 endif()
 endif()
 
 
-INCLUDE (FindPkgConfig)
 INCLUDE_DIRECTORIES( include )
 INCLUDE_DIRECTORIES( include )
 
 
 INCLUDE (PrecompiledHeader)
 INCLUDE (PrecompiledHeader)
@@ -255,9 +254,7 @@ ENDIF(NOT ZLIB_FOUND)
 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
 
 
 # Search for unzip
 # Search for unzip
-IF (PKG_CONFIG_FOUND)
-  PKG_CHECK_MODULES(UNZIP minizip)
-ENDIF (PKG_CONFIG_FOUND)
+use_pkgconfig(UNZIP minizip)
 
 
 IF ( ASSIMP_NO_EXPORT )
 IF ( ASSIMP_NO_EXPORT )
   ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)
   ADD_DEFINITIONS( -DASSIMP_BUILD_NO_EXPORT)

+ 7 - 4
cmake-modules/FindPkgMacros.cmake

@@ -59,10 +59,13 @@ endmacro(clear_if_changed)
 
 
 # Try to get some hints from pkg-config, if available
 # Try to get some hints from pkg-config, if available
 macro(use_pkgconfig PREFIX PKGNAME)
 macro(use_pkgconfig PREFIX PKGNAME)
-  find_package(PkgConfig)
-  if (PKG_CONFIG_FOUND)
-    pkg_check_modules(${PREFIX} ${PKGNAME})
-  endif ()
+  # Android does not support PKG_CONFIG so we disable it
+  IF ( NOT ANDROID )
+    find_package(PkgConfig)
+    if (PKG_CONFIG_FOUND)
+      pkg_check_modules(${PREFIX} ${PKGNAME})
+    endif ()
+  ENDIF ( NOT ANDROID )
 endmacro (use_pkgconfig)
 endmacro (use_pkgconfig)
 
 
 # Couple a set of release AND debug libraries (or frameworks)
 # Couple a set of release AND debug libraries (or frameworks)

+ 1 - 1
cmake-modules/FindZLIB.cmake

@@ -11,7 +11,7 @@
 # Once done, this will define
 # Once done, this will define
 #
 #
 #  ZLIB_FOUND - system has ZLIB
 #  ZLIB_FOUND - system has ZLIB
-#  ZLIB_INCLUDE_DIRS - the ZLIB include directories 
+#  ZLIB_INCLUDE_DIRS - the ZLIB include directories
 #  ZLIB_LIBRARIES - link these to use ZLIB
 #  ZLIB_LIBRARIES - link these to use ZLIB
 
 
 include(FindPkgMacros)
 include(FindPkgMacros)