Browse Source

Add jpeg to main CMakeLists.txt.

rude 12 years ago
parent
commit
29e5d9903e
2 changed files with 18 additions and 1 deletions
  1. 9 1
      CMakeLists.txt
  2. 9 0
      src/test.cpp

+ 9 - 1
CMakeLists.txt

@@ -11,6 +11,7 @@ set(DEP_ZLIB_VER "1.2.8")
 set(DEP_PHYSFS_VER "2.0.3")
 set(DEP_PHYSFS_VER "2.0.3")
 set(DEP_LUA51_VER "5.1.5")
 set(DEP_LUA51_VER "5.1.5")
 set(DEP_LIBPNG_VER "166")
 set(DEP_LIBPNG_VER "166")
+set(DEP_JPEG_VER "9")
 
 
 set(SKIP_INSTALL_ALL TRUE)
 set(SKIP_INSTALL_ALL TRUE)
 
 
@@ -22,6 +23,13 @@ add_subdirectory("libs/zlib-${DEP_ZLIB_VER}" ${CMAKE_BINARY_DIR}/zlib)
 add_subdirectory("libs/physfs-${DEP_PHYSFS_VER}" ${CMAKE_BINARY_DIR}/physfs)
 add_subdirectory("libs/physfs-${DEP_PHYSFS_VER}" ${CMAKE_BINARY_DIR}/physfs)
 add_subdirectory("libs/lua-${DEP_LUA51_VER}" ${CMAKE_BINARY_DIR}/lua51)
 add_subdirectory("libs/lua-${DEP_LUA51_VER}" ${CMAKE_BINARY_DIR}/lua51)
 add_subdirectory("libs/lpng${DEP_LIBPNG_VER}" ${CMAKE_BINARY_DIR}/lpng)
 add_subdirectory("libs/lpng${DEP_LIBPNG_VER}" ${CMAKE_BINARY_DIR}/lpng)
+add_subdirectory("libs/jpeg-${DEP_JPEG_VER}" ${CMAKE_BINARY_DIR}/jpeg)
 
 
 add_executable(ldeptest src/test.cpp)
 add_executable(ldeptest src/test.cpp)
-target_link_libraries(ldeptest zlibstatic physfs-static lua51-static ${PNG_LIB_NAME_STATIC})
+target_link_libraries(ldeptest
+	zlibstatic
+	physfs-static
+	lua51-static
+	${PNG_LIB_NAME_STATIC}
+	jpeg-static
+)

+ 9 - 0
src/test.cpp

@@ -7,6 +7,7 @@
 #include <zlib.h>
 #include <zlib.h>
 #include <physfs.h>
 #include <physfs.h>
 #include <png.h>
 #include <png.h>
+#include <jpeglib.h>
 
 
 extern "C" {
 extern "C" {
 #	include "lua.h"
 #	include "lua.h"
@@ -63,11 +64,19 @@ int main(int argc, const char **argv)
 		return "libpng";
 		return "libpng";
 	};
 	};
 
 
+	vfunc jpeg = [](strs &c, strs &l)
+	{
+		c << (int)JPEG_LIB_VERSION;
+		l << "N/A";
+		return "jpeg";
+	};
+
 	std::vector<vfunc> funcs;
 	std::vector<vfunc> funcs;
 	funcs.push_back(zlib);
 	funcs.push_back(zlib);
 	funcs.push_back(physfs);
 	funcs.push_back(physfs);
 	funcs.push_back(lua);
 	funcs.push_back(lua);
 	funcs.push_back(png);
 	funcs.push_back(png);
+	funcs.push_back(jpeg);
 
 
 	for (size_t i = 0; i < funcs.size(); ++i)
 	for (size_t i = 0; i < funcs.size(); ++i)
 	{
 	{