PROJECT(epubinfo)
cmake_minimum_required(VERSION 2.6)

# set flags
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -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(epubinfo epubinfo.c)

# link libraries
TARGET_LINK_LIBRARIES(epubinfo inkview xml2 zip ibitmap)

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