SET(CMAKE_VERBOSE_MAKEFILE ON)

set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../cmake)
set(CMAKE_COLOR_MAKEFILE ON)

############################
## SEPARATE BUILD OPTIONS ##
############################

find_package(ANTTWEAKBAR REQUIRED)
find_package(OpenGL REQUIRED)
find_package(EIGEN REQUIRED)
find_package(LIBIGL REQUIRED)
find_package(TINYXML2 REQUIRED)
find_package(GLFW REQUIRED)

if(WIN32)
	find_package(GLEW REQUIRED)
endif(WIN32)

if(APPLE)
	set(CMAKE_CXX_LINK_FLAGS "-framework OpenGL -framework Cocoa -framework IOKit -framework CoreVideo")
endif (APPLE) #APPLE

include_directories( ${ANT_TWEAK_BAR_INCLUDE_DIR} )

# message(FATAL_ERROR ${ANT_TWEAK_BAR_INCLUDE_DIR})

if(WIN32)
	include_directories( ${GLEW_INCLUDE_DIR} )
endif(WIN32)

include_directories( ${EIGEN_INCLUDE_DIR})
include_directories( ${LIBIGL_INCLUDE_DIR})
include_directories( ${TINYXML2_INCLUDE_DIR})
include_directories( ${GLFW_INCLUDE_DIR})
include_directories(
	/usr/local/include
	/opt/local/include
    ${PROJECT_SOURCE_DIR}
    ${OPENGL_INCLUDE_DIR}
)

link_directories(
	/usr/local/lib
	/opt/local/lib
	${ANT_TWEAK_BAR_DIRS}
	${EIGEN_DIRS}
)

#set(CMAKE_CXX_FLAGS -Wall -W -pedantic -std=c99)

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
endif()

set(SHARED_SOURCES ${LIBIGL_SOURCES})

if(WIN32)
	set(SHARED_SOURCES ${SHARED_SOURCES} ${GLEW_SOURCES})
endif(WIN32)

# message(FATAL_ERROR ${LIBIGL_SOURCES})


set(SHARED_LIBRARIES
		${LIBIGL_LIBRARIES}
		${OPENGL_LIBRARIES}
		${ANT_TWEAK_BAR_LIBRARY}
		${EIGEN_LIBRARIES}
		${GLEW_LIBRARIES}
		${GLFW_LIBRARIES}
)

#message(FATAL_ERROR ${SHARED_LIBRARIES})
