-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (62 loc) · 3.22 KB
/
CMakeLists.txt
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
62
63
64
65
66
67
68
69
################################################################
# INITIALIZATION
################################################################
cmake_minimum_required( VERSION 2.8)
set( CMAKE_BUILD_TYPE "Release")
set( CMAKE_MACOSX_RPATH 1)
################################################################
#NumeRO application
################################################################
project(Numero)
set( NUMERO_PATH "${CMAKE_SOURCE_DIR}/APP_NUMERO")
configure_file( "${NUMERO_PATH}/numero.cpp" "${NUMERO_PATH}/numero.cpp")
include_directories( ~/include/ ~/include/GraphicsEngine/)
add_executable( numero "${NUMERO_PATH}/numero.cpp")
add_dependencies( numero GraphicsEngine)
target_link_libraries( numero GraphicsEngine)
################################################################
#Chemistry application
################################################################
project(Chemistry)
set( CHEM_PATH "${CMAKE_SOURCE_DIR}/APP_CHEMISTRY")
configure_file( "${CHEM_PATH}/chemistry.cpp" "${CHEM_PATH}/chemistry.cpp")
include_directories( ~/include/ ~/include/GraphicsEngine/)
add_executable( chemistry "${CHEM_PATH}/chemistry.cpp")
add_dependencies( chemistry GraphicsEngine)
target_link_libraries( chemistry GraphicsEngine)
################################################################
#Graphics Engine
################################################################
project( GraphicsEngine )
set( CMAKE_SOURCE_DIRECTORY ${CMAKE_SOURCE_DIR})
set( CMAKE_CXX_FLAGS "-std=c++0x -g3 -O2 -w")
include_directories( "~/include/" "include/" ${PNG_INCLUDE_DIR})
configure_file( "${CMAKE_SOURCE_DIR}/include/cgl/defs.h.in" "${CMAKE_SOURCE_DIR}/include/cgl/defs.h")
################################################################
#Dependencies
################################################################
find_library( common NAMES Commons HINTS "$ENV{HOME}/lib")
find_package( GLUT REQUIRED)
find_package( OpenGL REQUIRED)
find_package( X11 REQUIRED)
find_package( GLEW REQUIRED)
set(CORELIBS ${common} ${GLEW_LIBRARY} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${X11_LIBRARIES})
include_directories(${GLEW_INCLUDE_DIRS})
#if("${CMAKE_SYSTEM_NAME}" MATCHES "Linux")
# find_library( glew NAMES GLEW HINTS "$ENV{HOME}/lib")
# set(CORELIBS ${common} ${GLUT_LIBRARY} ${OPENGL_LIBRARY} ${X11_LIBRARIES} ${glew})
#endif()
################################################################
#Library
################################################################
file( GLOB_RECURSE source_files sources/* include/cgl/* include/*)
add_library( GraphicsEngine SHARED ${source_files})
target_link_libraries( GraphicsEngine ${CORELIBS})
add_dependencies( GraphicsEngine SHADERFILES)
################################################################
#Installation step
################################################################
install(DIRECTORY "${CMAKE_SOURCE_DIR}/include/" DESTINATION "$ENV{HOME}/include/GraphicsEngine")
install(TARGETS GraphicsEngine LIBRARY DESTINATION "$ENV{HOME}/lib/")
install(TARGETS numero RUNTIME DESTINATION "$ENV{HOME}/bin")
install(TARGETS chemistry RUNTIME DESTINATION "$ENV{HOME}/bin")