diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2022-02-26 23:13:20 +0100 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2022-02-26 23:13:20 +0100 |
commit | df179f7a92a24f83d70157768147e59fa5c63935 (patch) | |
tree | 732464722c4f68b852c29da27b4847bdc0c53ffe /src/CMakeLists.txt | |
parent | 1f1a17873db401ebcfab6c3e6be0d84731bb84c1 (diff) | |
download | sameboy-thumbnailer-df179f7a92a24f83d70157768147e59fa5c63935.tar.gz sameboy-thumbnailer-df179f7a92a24f83d70157768147e59fa5c63935.zip |
add libpng support
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r-- | src/CMakeLists.txt | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f5d8646..a3fdafb 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -3,14 +3,29 @@ find_package(SameBoy REQUIRED) find_package(SameBoyBootRom REQUIRED) find_package(SameBoyTemplate REQUIRED) -include_directories(${SAMEBOY_INCLUDE_DIRS}) +if (USE_LIBPNG) + find_package(libpng REQUIRED) + add_compile_definitions(USE_LIBPNG) + set(PNG_INCLUDE_DIRS ${LIBPNG_INCLUDE_DIRS}) + set(PNG_LIBRARIES ${LIBPNG_LIBRARIES}) +else() + find_package(lodepng REQUIRED) + add_compile_definitions(USE_LODEPNG) + set(PNG_INCLUDE_DIRS ${LODEPNG_INCLUDE_DIRS}) + set(PNG_LIBRARIES ${LODEPNG_LIBRARIES}) +endif() -add_subdirectory(png) +include_directories(${SAMEBOY_INCLUDE_DIRS}) list(APPEND THUMBNAILER_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/common.c + ${CMAKE_CURRENT_SOURCE_DIR}/common.h + ${CMAKE_CURRENT_SOURCE_DIR}/embed.h ${CMAKE_CURRENT_SOURCE_DIR}/get_image_for_rom.c ${CMAKE_CURRENT_SOURCE_DIR}/get_image_for_rom.h + ${CMAKE_CURRENT_SOURCE_DIR}/image.c + ${CMAKE_CURRENT_SOURCE_DIR}/image.h ${CMAKE_CURRENT_SOURCE_DIR}/main.c ${SAMEBOY_BOOTROM_SOURCES} ${SAMEBOY_TEMPLATE_SOURCES} @@ -22,7 +37,9 @@ add_executable(sameboy-thumbnailer ${THUMBNAILER_SOURCES}) add_dependencies(sameboy-thumbnailer sameboy_bootrom sameboy_template) -target_link_libraries(sameboy-thumbnailer LINK_PUBLIC lodepng) +target_include_directories(sameboy-thumbnailer PUBLIC ${PNG_INCLUDE_DIRS}) + +target_link_libraries(sameboy-thumbnailer LINK_PUBLIC ${PNG_LIBRARIES}) target_link_libraries(sameboy-thumbnailer LINK_PUBLIC ${SAMEBOY_LIBRARIES}) target_link_libraries(sameboy-thumbnailer LINK_PUBLIC ${CMAKE_DL_LIBS}) target_link_libraries(sameboy-thumbnailer LINK_PUBLIC m) |