Fix compilation in Visual C++ 2013.
I had to fix the following things to make Ceres compile in 2013:
* Not link to 'm' (GNU math library).
* Excplicitly convert an std::ostream to bool.
* Include <algorithm> for std::max.
Change-Id: I3ff65413baf8711364360d46dd71fd553fa63e72
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 28eec9b..ac96de8 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -41,11 +41,13 @@
TARGET_LINK_LIBRARIES(curve_fitting ceres)
ADD_EXECUTABLE(curve_fitting_c curve_fitting.c)
+TARGET_LINK_LIBRARIES(curve_fitting_c ceres)
# As this is a C file #including <math.h> we have to explicitly add the math
# library (libm). Although some compilers (dependent upon options) will accept
# the indirect link to libm via Ceres, at least GCC 4.8 on pure Debian won't.
-TARGET_LINK_LIBRARIES(curve_fitting_c ceres m)
-
+IF (NOT MSVC)
+ TARGET_LINK_LIBRARIES(curve_fitting_c m)
+ENDIF (NOT MSVC)
ADD_EXECUTABLE(robust_curve_fitting robust_curve_fitting.cc)
TARGET_LINK_LIBRARIES(robust_curve_fitting ceres)