Install pkgconfig file to /usr/local/libdata/pkgconfig when FreeBSD is detected.
authorHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Thu, 8 May 2014 16:16:42 +0000 (00:16 +0800)
committerHong Jen Yee (PCMan) <pcman.tw@gmail.com>
Thu, 8 May 2014 16:16:42 +0000 (00:16 +0800)
cmake/create_pkgconfig_file.cmake

index 18eb2ab..e635ea1 100644 (file)
@@ -22,5 +22,12 @@ macro (create_pkgconfig_file name desc)
             "\n"
     )
 
-    install(FILES ${_pkgfname} DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+    # FreeBSD loves to install files to different locations
+    # http://www.freebsd.org/doc/handbook/dirstructure.html
+    if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
+        install(FILES ${_pkgfname} DESTINATION libdata/pkgconfig)
+    else()
+        install(FILES ${_pkgfname} DESTINATION lib${LIB_SUFFIX}/pkgconfig)
+    endif()
+
 endmacro()