소스 검색

Merge pull request #405 from TimothyGu/patch-1

Correctly set Libs.private field in pkgconfig file
Alexander Gessler 11 년 전
부모
커밋
2d7ce22569
2개의 변경된 파일10개의 추가작업 그리고 4개의 파일을 삭제
  1. 9 4
      CMakeLists.txt
  2. 1 0
      assimp.pc.in

+ 9 - 4
CMakeLists.txt

@@ -90,10 +90,6 @@ ELSE ( ASSIMP_BUILD_STATIC_LIB )
     option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )
     option ( BUILD_SHARED_LIBS "Build a shared version of the library" ON )
 ENDIF ( ASSIMP_BUILD_STATIC_LIB )
 ENDIF ( ASSIMP_BUILD_STATIC_LIB )
 
 
-# Generate a pkg-config .pc for the Assimp library.
-CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
-INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
-
 # Only generate this target if no higher-level project already has
 # Only generate this target if no higher-level project already has
 IF (NOT TARGET uninstall)
 IF (NOT TARGET uninstall)
 	# add make uninstall capability
 	# add make uninstall capability
@@ -136,6 +132,10 @@ option ( ASSIMP_NO_EXPORT
 	OFF
 	OFF
 )
 )
 
 
+if( CMAKE_COMPILER_IS_GNUCXX )
+  set(LIBSTDC++_LIBRARIES -lstdc++)
+endif( CMAKE_COMPILER_IS_GNUCXX )
+
 # Search for external dependencies, and build them from source if not found
 # Search for external dependencies, and build them from source if not found
 # Search for zlib
 # Search for zlib
 find_package(ZLIB)
 find_package(ZLIB)
@@ -151,6 +151,7 @@ if( NOT ZLIB_FOUND )
   set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
   set(ZLIB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/contrib/zlib ${CMAKE_CURRENT_BINARY_DIR}/contrib/zlib)
 else(NOT ZLIB_FOUND)
 else(NOT ZLIB_FOUND)
   ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
   ADD_DEFINITIONS(-DASSIMP_BUILD_NO_OWN_ZLIB)
+  set(ZLIB_LIBRARIES_LINKED -lz)
 endif(NOT ZLIB_FOUND)
 endif(NOT ZLIB_FOUND)
 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
 INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIR})
 
 
@@ -228,6 +229,10 @@ IF(MSVC)
 	)
 	)
 ENDIF(MSVC)
 ENDIF(MSVC)
 
 
+# Generate a pkg-config .pc for the Assimp library.
+CONFIGURE_FILE( "${PROJECT_SOURCE_DIR}/assimp.pc.in" "${PROJECT_BINARY_DIR}/assimp.pc" @ONLY )
+INSTALL( FILES "${PROJECT_BINARY_DIR}/assimp.pc" DESTINATION ${ASSIMP_LIB_INSTALL_DIR}/pkgconfig/ COMPONENT ${LIBASSIMP-DEV_COMPONENT})
+
 if(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
 if(CMAKE_CPACK_COMMAND AND UNIX AND ASSIMP_OPT_BUILD_PACKAGES)
   # Packing information
   # Packing information
   set(CPACK_PACKAGE_NAME                    "assimp{ASSIMP_VERSION_MAJOR}")
   set(CPACK_PACKAGE_NAME                    "assimp{ASSIMP_VERSION_MAJOR}")

+ 1 - 0
assimp.pc.in

@@ -7,4 +7,5 @@ Name: @CMAKE_PROJECT_NAME@
 Description: Import various well-known 3D model formats in an uniform manner.
 Description: Import various well-known 3D model formats in an uniform manner.
 Version: @PROJECT_VERSION@
 Version: @PROJECT_VERSION@
 Libs: -L${libdir} -lassimp@ASSIMP_LIBRARY_SUFFIX@
 Libs: -L${libdir} -lassimp@ASSIMP_LIBRARY_SUFFIX@
+Libs.private: @LIBSTDC++_LIBRARIES@ @ZLIB_LIBRARIES_LINKED@
 Cflags: -I${includedir}
 Cflags: -I${includedir}