PROJECT(pbimageviewer)
cmake_minimum_required(VERSION 2.6)

# set flags
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -D_UNIX")

# mark build type
if(BUILD_360)
  Message("Will build for PocketBook 360")
  ADD_DEFINITIONS("-DBUILD_360=1")
else(BUILD_360)
  if(BUILD_FW2)
    Message("Will build for PocketBook FW2")
    ADD_DEFINITIONS("-DBUILD_FW2=1")
  else(BUILD_FW2)
    if(BUILD_FW4)
      Message("Will build for PocketBook FW4")
      ADD_DEFINITIONS("-DBUILD_FW4=1")
    else(BUILD_FW4)
      if(BUILD_FW5)
        Message("Will build for PocketBook FW5")
        ADD_DEFINITIONS("-DBUILD_FW5=1")
      endif(BUILD_FW5)
    endif(BUILD_FW4)
  endif(BUILD_FW2)
endif(BUILD_360)

# add sources
ADD_EXECUTABLE(pbimageviewer main.cpp C7zHandler.cpp DevCaps.cpp images.c ImagesMng.cpp Log.cpp RarHandler.cpp Viewer.cpp ZipHandler.cpp)

# link libraries
TARGET_LINK_LIBRARIES(pbimageviewer inkview jpeg png z dl zip unrar 7zip ibitmap tiff)

# strip
EXECUTE_PROCESS( COMMAND ${CMAKE_STRIP} ${CMAKE_BINARY_DIR}/pbimageviewer )
