mirror of
https://github.com/love2d/megasource.git
synced 2026-08-19 20:20:11 +02:00
Add libpng to the main CMakeLists.txt.
This commit is contained in:
+5
-1
@@ -10,6 +10,9 @@ project(ldep)
|
|||||||
set(DEP_ZLIB_VER "1.2.8")
|
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(SKIP_INSTALL_ALL TRUE)
|
||||||
|
|
||||||
set(ZLIB_FOUND TRUE)
|
set(ZLIB_FOUND TRUE)
|
||||||
set(ZLIB_LIBRARY zlibstatic)
|
set(ZLIB_LIBRARY zlibstatic)
|
||||||
@@ -18,6 +21,7 @@ set(ZLIB_INCLUDE_DIR .)
|
|||||||
add_subdirectory("libs/zlib-${DEP_ZLIB_VER}" ${CMAKE_BINARY_DIR}/zlib)
|
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_executable(ldeptest src/test.cpp)
|
add_executable(ldeptest src/test.cpp)
|
||||||
target_link_libraries(ldeptest zlibstatic physfs-static lua51-static)
|
target_link_libraries(ldeptest zlibstatic physfs-static lua51-static ${PNG_LIB_NAME_STATIC})
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
#include <physfs.h>
|
#include <physfs.h>
|
||||||
|
#include <png.h>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
# include "lua.h"
|
# include "lua.h"
|
||||||
@@ -55,10 +56,18 @@ int main(int argc, const char **argv)
|
|||||||
return "Lua";
|
return "Lua";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vfunc png = [](strs &c, strs &l)
|
||||||
|
{
|
||||||
|
c << PNG_LIBPNG_VER_STRING;
|
||||||
|
l << png_libpng_ver;
|
||||||
|
return "libpng";
|
||||||
|
};
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
for (size_t i = 0; i < funcs.size(); ++i)
|
for (size_t i = 0; i < funcs.size(); ++i)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user