CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
PROJECT(bear-editor)

SET( BF_E_TARGET_NAME bear-editor )

INCLUDE_DIRECTORIES( .. )

#-------------------------------------------------------------------------------
SET( BF_E_SOURCE_FILES
  code/animation.cpp
  code/animation_file_edit.cpp
  code/animation_file_xml_reader.cpp
  code/animation_file_xml_writer.cpp
  code/animation_frame.cpp
  code/animation_player.cpp
  code/animation_view_ctrl.cpp
  code/bitmap_rendering_attributes.cpp
  code/bitmap_rendering_attributes_edit.cpp
  code/bool_edit.cpp
  code/class_not_found.cpp
  code/class_tree_ctrl.cpp
  code/compiled_file.cpp
  code/config_frame.cpp
  code/custom_type.cpp
  code/font_file_edit.cpp
  code/frame_edit.cpp
  code/human_readable.cpp
  code/image_list_ctrl.cpp
  code/image_pool.cpp
  code/image_selection_dialog.cpp
  code/item_class.cpp
  code/item_class_pool.cpp
  code/item_class_selection_dialog.cpp
  code/item_class_xml_parser.cpp
  code/item_comparator.cpp
  code/item_field_edit.cpp
  code/item_instance.cpp
  code/item_reference_edit.cpp
  code/item_rendering_parameters.cpp
  code/path_configuration.cpp
  code/sample_file_edit.cpp
  code/slider_ctrl.cpp
  code/slider_with_ticks.cpp
  code/sprite.cpp
  code/sprite_edit.cpp
  code/sprite_image_cache.cpp
  code/sprite_view.cpp
  code/sprite_view_ctrl.cpp
  code/stream_conv.cpp
  code/tree_builder.cpp
  code/type_field.cpp
  code/type_field_interval.cpp
  code/type_field_set.cpp

  xml/code/exception.cpp
  xml/code/item_class_inherit_node.cpp
  xml/code/item_instance_field_node.cpp
  xml/code/item_instance_fields_node.cpp
  xml/code/reader_tool.cpp
  xml/code/value_to_xml.cpp
  xml/code/xml_to_value.cpp
)

IF( WIN32 )
  SET( wxWidgets_LIBRARIES
    ${wxWidgets_LIBRARIES}
    gdi32
    comdlg32
    ole32
    oleaut32
    uuid
    )
ENDIF( WIN32 )

INCLUDE(${wxWidgets_USE_FILE})

IF( WIN32 )
  ADD_LIBRARY( ${BF_E_TARGET_NAME} STATIC ${BF_E_SOURCE_FILES} )
  ADD_DEFINITIONS( "-DBEAR_EDITOR_EXPORT" )
ELSE( WIN32 )
  ADD_LIBRARY( ${BF_E_TARGET_NAME} SHARED ${BF_E_SOURCE_FILES} )
ENDIF( WIN32 )

TARGET_LINK_LIBRARIES(
  ${BF_E_TARGET_NAME}
  ${wxWidgets_LIBRARIES}
  ${CLAW_LOGGER_LIBRARIES}
  ${CLAW_CONFIGURATION_FILE_LIBRARIES}
  ${Boost_FILESYSTEM_LIBRARY}
  )

INSTALL(
  TARGETS ${BF_E_TARGET_NAME}
  DESTINATION "${BEAR_FACTORY_INSTALL_LIBRARY_DIR}"
  )
