# BEGIN CMAKE PREPARATION

# setup cmake modules
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/cmake/platform/shared)

INCLUDE(idetectos)

IF(NOT CMAKE_BUILD_TYPE)
    #SET(CMAKE_BUILD_TYPE Debug)
    SET(CMAKE_BUILD_TYPE Release)
ENDIF()

SET(BUILD_SHARED_LIBS OFF)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
SET(GLOBAL_PROJECT_FOLDER "null")

INCLUDE(ioption)
INCLUDE(imacro)
INCLUDE(icompiler)
INCLUDE(ilinker)

SETUP_COMPILER_FLAGS()
SETUP_LINKER()
SETUP_TOOL_FLAGS()

# @todo. try to found good place for this code
IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
    SET( GLOBAL_SEARCH_SUFFIX "x64" )
ELSE( CMAKE_SIZEOF_VOID_P EQUAL 8 )
    SET( GLOBAL_SEARCH_SUFFIX "x86" )
ENDIF( CMAKE_SIZEOF_VOID_P EQUAL 8 )

SET(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})

# END CMAKE PREPARATION
