CMakeLists.txt 3.06 KB
Newer Older
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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
cmake_minimum_required(VERSION 2.8)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

# Project Name
PROJECT(NOMADCaveT)
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
if(COMPILER_SUPPORTS_CXX11)
        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")        
else()
	MESSAGE(FATAL_ERROR "C++ 11 is required")
endif()

set(project_LIBRARIES)
set(project_INCLUDES)
set(project_DEFINITIONS -DCAVE -DINDICESGL32)

#########################################################
# ADD PTHREAD
#########################################################
list(APPEND project_LIBRARIES pthread)
find_package(synch REQUIRED)
#list(APPEND project_INCLUDES ${SYNCH_INCLUDE_DIRS})
list(APPEND project_LIBRARIES synch)

find_package(screen REQUIRED )

#plib
#find_library (PLIB_UL plibul HINTS $ENV{PLIBDIR} PATH_SUFFIXES lib REQUIRED)
#find_library (PLIB_FNT plibfnt HINTS $ENV{PLIBDIR} PATH_SUFFIXES lib REQUIRED)
#set (PLIB_LIBRARIES ${PLIB_FNT} ${PLIB_UL})
#message ("plib_libraries = ${PLIB_LIBRARIES} ")
#find_path (PLIB_INCLUDE_DIR plib/fnt.h HINTS $ENV{PLIBDIR} PATH_SUFFIXES include REQUIRED)
#message ("plib_include = ${PLIB_INCLUDE_DIR} ")

#freetype2
INCLUDE (FindPkgConfig)
pkg_search_module(FREETYPE REQUIRED freetype2)
message ("freetype LDFLAGS ${FREETYPE_LDFLAGS}")
message ("freetype CFLAGS ${FREETYPE_CFLAGS}")
#target_link_libraries(demoCO2CaO PUBLIC screen)
#target_link_libraries(demoCO2CaO_server PUBLIC screen)
#list(APPEND project_INCLUDES ${SCREEN_INCLUDE_DIRS})
list(APPEND project_LIBRARIES screen)



#########################################################
# Include Files
#########################################################
include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/src)
include_directories(${project_INCLUDES})
include_directories(${FREETYPE_INCLUDE_DIRS})
set(HEADERS

)
set(SOURCES
       src/main.cpp src/textRendering.cpp
	src/NOMADVRLib/atoms.cpp	src/NOMADVRLib/CompileGLShader.cpp	
	src/NOMADVRLib/polyhedron.cpp   src/NOMADVRLib/UnitCellShaders.cpp
62 63
	src/NOMADVRLib/atomsGL.cpp	src/NOMADVRLib/ConfigFile.cpp
	src/NOMADVRLib/ConfigFileAtoms.cpp	
64
	src/NOMADVRLib/TessShaders.cpp	src/NOMADVRLib/IsosurfacesGL.cpp
65
	src/NOMADVRLib/IsoShaders.cpp	src/NOMADVRLib/Grid.cpp
66 67
	src/NOMADVRLib/markerShaders.cpp src/NOMADVRLib/TexturedShaders.cpp
	src/NOMADVRLib/LoadPNG.cpp
68
	src/happyhttp/happyhttp.cpp
69
	src/rply/rply.c
70
	src/LodePNG/lodepng.cpp
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
)



set(HEADERS_SERVER
)

set(SOURCES_SERVER
	src/main_server.cpp src/textRendering.cpp
)



########################################################
# Add definitions
#########################################################
add_definitions(${project_DEFINITIONS})

########################################################
# Linking & stuff
#########################################################


add_executable(${PROJECT_NAME} ${SOURCES} ${HEADERS})
target_link_libraries(${PROJECT_NAME} ${project_LIBRARIES} ${FREETYPE_LDFLAGS})
add_executable(${PROJECT_NAME}_server ${SOURCES_SERVER} ${HEADERS_SERVER})
target_link_libraries(${PROJECT_NAME}_server ${project_LIBRARIES} ${FREETYPE_LIBRARIES})