blob: c26dece7b7efad04f25ab4a0939e34cc27c63fd2 [file] [log] [blame]
# Copyright 2017 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
cmake_minimum_required (VERSION 2.8.10)
# The only way we found to override the compiler is setting these variables
# prior to the project definition. Otherwise enable_language() sets these
# variables and gcc will be picked up instead. Also, new versions of cmake will
# complain if one compiler is first set (say to gcc via enable_language), and
# then we later switch it to (say) clang.
SET (CMAKE_C_COMPILER "clang")
SET (CMAKE_CXX_COMPILER "clang++")
project(lossmin)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -std=c++11 -stdlib=libstdc++ -fcolor-diagnostics")
enable_language(C)
enable_language(CXX)
include_directories(${CMAKE_SOURCE_DIR})
# NOTE: Lossmin depends on eigen. We assume that eigen can be found at
# ../../third_party/eigen.
include_directories(${CMAKE_SOURCE_DIR}/../..)
add_subdirectory(lossmin)
add_executable(sample sample.cc)
target_link_libraries(sample
lossmin_loss_functions
lossmin_minimizers)