CMakeLists.txt 1.98 KB
Newer Older
Pierre Kraemer's avatar
Pierre Kraemer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
cmake_minimum_required(VERSION 2.6)

project(CGoGN)

# a decommenter si on veut voir ce qui se passe a la compilation
#set( CMAKE_VERBOSE_MAKEFILE 1 )

SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)

SET(CMAKE_MODULE_PATH " ${CMAKE_MODULE_PATH} ${CGoGN_ROOT_DIR}/cmake_modules/")

find_package(OpenGL)
find_package(GLUT)

# qq definition specifiques pour mac
IF(APPLE)
# attention a changer pour chercher la bonne version automatiquement
	SET(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX10.6.sdk")
	SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-undefined -Wl,dynamic_lookup")
ENDIF(APPLE)

IF(WIN32)
	SET(GLEW_LIBRARY glew32)
	SET(DEVIL_LIBRARIES DevIL ILU ILUT)
	SET(ZLIB_LIBRARIES zlib)
	SET(LIBXML2_LIBRARIES xml2)
sylvain thery's avatar
sylvain thery committed
27 28
	INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/)
	LINK_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/lib/)
29
#	add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
Pierre Kraemer's avatar
Pierre Kraemer committed
30 31 32 33 34
	add_subdirectory(Release)
	add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
	if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
                add_subdirectory(${CGoGN_ROOT_DIR}/Perso Perso)
	endif (EXISTS "${CGoGN_ROOT_DIR}/Perso")
sylvain thery's avatar
sylvain thery committed
35 36 37 38 39 40

	if(CMAKE_CONFIGURATION_TYPES)
		set(CMAKE_CONFIGURATION_TYPES Release Debug)
		set(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "Use only Release configuration for ThirdParty" FORCE)
	endif()
	
Pierre Kraemer's avatar
Pierre Kraemer committed
41 42 43 44 45 46 47 48 49 50 51
ELSE(WIN32)
	SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
	find_package(DevIL)
	find_package(ZLIB)
	find_package(LibXml2)
	SET(GLEW_LIBRARY GLEW)
	IF (IL_LIBRARIES)
		SET(DEVIL_LIBRARIES ${IL_LIBRARIES} ${ILU_LIBRARIES} ${ILUT_LIBRARIES})
	ELSE(IL_LIBRARIES)
		SET(DEVIL_LIBRARIES ${IL_LIBRARY} ${ILU_LIBRARY} ${ILUT_LIBRARY})
	ENDIF(IL_LIBRARIES)
52
#	add_subdirectory(${CGoGN_ROOT_DIR}/ThirdParty ThirdParty)
Pierre Kraemer's avatar
Pierre Kraemer committed
53 54 55 56 57 58 59
	add_subdirectory(Release)
	add_subdirectory(Debug)
	add_subdirectory(${CGoGN_ROOT_DIR}/Apps Apps)
	if (EXISTS "${CGoGN_ROOT_DIR}/Perso")
                add_subdirectory(${CGoGN_ROOT_DIR}/Perso Perso)
	endif (EXISTS "${CGoGN_ROOT_DIR}/Perso")
ENDIF(WIN32)