if(COMMAND cmake_policy)
cmake_policy(SET CMP0005 OLD)
endif(COMMAND cmake_policy)

# note: change this BEFORE making a release !!
ADD_DEFINITIONS(-DPERFECTSPOT_VERSION=\"CVS\" )
# note: to build a static perfectspot on windows with jpeg support uncomment this
# ADD_DEFINITIONS(-DPERFECTSPOT_STATIC)

set(perfectspot_SOURCES
main.cpp 
mainwindow.cpp 
canvas.cpp 
renderer.cpp
aboutbox.cpp
odg/FemtoZip.cpp
odg/OutputFileHelper.cpp
odg/StringDocumentHandler.cpp)

set(perfectspot_HEADERS
mainwindow.h
canvas.h
renderer.h
aboutbox.h
odg/FemtoZip.h
odg/OutputFileHelper.h
odg/StringDocumentHandler.h)

set(perfectspot_RESOURCES perfectspot.qrc)

qt4_automoc( ${perfectspot_SOURCES} )
qt4_add_resources(perfectspot_RESOURCES_SOURCES ${perfectspot_RESOURCES})

add_executable(perfectspot ${perfectspot_SOURCES} ${perfectspot_RESOURCES_SOURCES})
IF (NOT WIN32)
target_link_libraries(perfectspot ${QT_LIBRARIES} ${QT_QTSVG_LIBRARIES} ${LIBWPG_LDFLAGS} ${LIBODFGEN_LDFLAGS} ${LIBREVENGE_LDFLAGS} ${LIBREVENGE_STREAM_LDFLAGS})
ELSE (NOT WIN32)
target_link_libraries(perfectspot ${QT_LIBRARIES} ${LIBWPG_LDFLAGS} ${QT_QTSVG_LIBRARIES} ${LIBODFGEN_LDFLAGS} ${LIBREVENGE_LDFLAGS} ${LIBREVENGE_STREAM_LDFLAGS} -mwindows)
ENDIF (NOT WIN32)

install(TARGETS ${PROGNAME} DESTINATION bin)
install(FILES perfectspot.png DESTINATION share/pixmaps)
install(FILES perfectspot.desktop DESTINATION share/applications)
