CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(mocca LANGUAGES CXX)

SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

IF (UNIX)
	ADD_COMPILE_OPTIONS(-std=c++11)
ENDIF()

ADD_SUBDIRECTORY(ext/AES)
ADD_SUBDIRECTORY(ext/base64)
ADD_SUBDIRECTORY(ext/sha1)
ADD_SUBDIRECTORY(ext/jsoncpp)
ADD_SUBDIRECTORY(ext/lz4)

ADD_SUBDIRECTORY(mocca)

OPTION(MOCCA_BUILD_TESTS "Build tests for mocca" ON)
IF (MOCCA_BUILD_TESTS)
	IF (MSVC)
		SET(gtest_force_shared_crt ON CACHE BOOL "Always use msvcrt.dll" FORCE)
	ENDIF ()
	ADD_SUBDIRECTORY(ext/googletest)
    ADD_SUBDIRECTORY(tests)
ENDIF()

CMAKE_MINIMUM_REQUIRED(VERSION 3.0.0)
PROJECT(mocca LANGUAGES CXX)

SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)

IF (UNIX)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF()

ADD_SUBDIRECTORY(ext/AES)
ADD_SUBDIRECTORY(ext/base64)
ADD_SUBDIRECTORY(ext/sha1)
ADD_SUBDIRECTORY(ext/jsoncpp)
ADD_SUBDIRECTORY(ext/lz4)

ADD_SUBDIRECTORY(mocca)

OPTION(MOCCA_BUILD_TESTS "Build tests for mocca" ON)
IF (MOCCA_BUILD_TESTS)
	IF (MSVC)
		SET(gtest_force_shared_crt ON CACHE BOOL "Always use msvcrt.dll" FORCE)
	ENDIF ()
	ADD_SUBDIRECTORY(ext/googletest)
    ADD_SUBDIRECTORY(tests)
ENDIF()

Use C++11 compiler options only for C++ sources
Use C++11 compiler options only for C++ sources

fixes OS X build
