cmake_minimum_required(VERSION 3.0)

#MESSAGE( STATUS "processor:         " ${CMAKE_SYSTEM_PROCESSOR} )

if(CMAKE_SYSTEM_PROCESSOR STREQUAL mipsel)
include (mozart2)
endif(CMAKE_SYSTEM_PROCESSOR STREQUAL mipsel)

# General Definitions.
SET(CMAKE_INSTALL_RPATH "/usr/local/lib")

# C++
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions -fno-rtti")

#  
# Release
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG -Os")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall -DNDEBUG -Os")

# Debug
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG -g -O0")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${CMAKE_C_FLAGS_DEBUG} -Wall")

# Linker
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -DPIC")
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fPIC -DPIC")
