# *******************************************************************************
# * CMakeList.txt - samples CMake build file
# *
# * ScaleOut NamedCache C++ API Library
# *
# * Copyright (c) 2013-2016 by ScaleOut Software, Inc.
# *
# * Licensed under the Apache License, Version 2.0 (the "License");
# * you may not use this file except in compliance with the License.
# * You may obtain a copy of the License at
# *
# * http://www.apache.org/licenses/LICENSE-2.0
# *
# * Unless required by applicable law or agreed to in writing, software
# * distributed under the License is distributed on an "AS IS" BASIS,
# * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# * See the License for the specific language governing permissions and
# * limitations under the License.
# *******************************************************************************

# Define minimum CMake version
cmake_minimum_required(VERSION 2.6)

# Define the project name
# This is how it will be called in Visual Studio and other Makefiles
project(SossClientSample)

# Include the local modules directory
set(CMAKE_MODULE_PATH           "${CMAKE_CURRENT_SOURCE_DIR}/../CMakeModules")

# Setup project directories
set(SAMPLE_INCLUDE_DIR          "${CMAKE_CURRENT_SOURCE_DIR}/include")
set(SAMPLE_SOURCE_DIR           "${CMAKE_CURRENT_SOURCE_DIR}")

set(CURRENT_TARGET_NAME         "sample")

if(UNIX)
	add_definitions(-DUNIX)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif(UNIX)

# Add include directories
include_directories("${SAMPLE_INCLUDE_DIR}")

# Automatically scan the include directories for header files
file(GLOB INCLUDE_FILES
	"${SAMPLE_INCLUDE_DIR}/*.h"
)

# Automatically scan the source directories for source files
file(GLOB SOURCE_FILES
	"${SAMPLE_SOURCE_DIR}/src/*.cpp"
)

# Add target executable
add_executable(${CURRENT_TARGET_NAME} ${SOURCE_FILES} ${INCLUDE_FILES})

# Configure Sample executable dependency on soss_client
find_package(SossClient REQUIRED)
include_directories(${SOSS_CLIENT_INCLUDE_DIRS})
target_link_libraries(${CURRENT_TARGET_NAME} ${SOSS_CLIENT_LIBRARIES})
