cmake_minimum_required (VERSION 3.0)

project (MulleScion)


set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/mulle-configuration)
message(STATUS "CMAKE_MODULE_PATH is ${CMAKE_MODULE_PATH}")
message(STATUS "CMAKE_BUILD_TYPE is ${CMAKE_BUILD_TYPE}")
if( "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
  include( Debug)
else()
  include( Release)
endif()

find_library( FOUNDATION_LIBRARY NAMES Foundation)
FIND_PACKAGE( ZLIB REQUIRED)

message( STATUS "FOUNDATION_LIBRARY is ${FOUNDATION_LIBRARY}")
message( STATUS "ZLIB_LIBRARIES is ${ZLIB_LIBRARIES}")

add_definitions( -DPROJECT_VERSION=1856)

include( CMakeSourcesAndHeaders.txt )

set( GOOGLE_TOOLBOX_SOURCES
"google-toolbox-for-mac/Foundation/GTMNSString+HTML.m"
)


add_library( MulleScion STATIC
${MULLE_SCION_SOURCES}
${MULLE_SCION_FOUNDATION_SOURCES}
${MULLE_SCION_PARSER_SOURCES}
${MULLE_SCION_PRINTER_SOURCES}
${GOOGLE_TOOLBOX_SOURCES}
${HOEDOWN_SOURCES}
)


add_executable( mulle-scion
${MONGOOSE_SOURCES}
${TOOL_SOURCES}
)


set( HEADERS
${MULLE_SCION_HEADERS}
${MULLE_SCION_FOUNDATION_HEADERS}
${MULLE_SCION_PARSER_HEADERS}
${MULLE_SCION_PRINTER_HEADERS}
)


target_link_libraries( mulle-scion
${BEGIN_ALL_LOAD}
MulleScion
${DEPENDENCY_LIBRARIES}
${FOUNDATION_LIBRARY}
${ZLIB_LIBRARIES}
${END_ALL_LOAD}
${OS_SPECIFIC_LIBS}
)


# INSTALL( TARGETS MulleScion DESTINATION "lib")
# INSTALL( FILES ${HEADERS} DESTINATION "include/MulleScion")
INSTALL( TARGETS mulle-scion DESTINATION "bin")
INSTALL( FILES ${SCIONS} DESTINATION "share/mulle-scion/dox")