-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
72 lines (54 loc) · 2.02 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
70
71
72
cmake_minimum_required (VERSION 2.8)
################################
# Coconut project
project (Coconut)
############
# Add GLEW
set(GLEW_VERSION "glew-1.10.0")
set(GLEW_DIRECTORY ${CMAKE_SOURCE_DIR}/external/${GLEW_VERSION} )
set(GLEW_INCLUDE_DIR "${GLEW_DIRECTORY}/include")
SET(GLEW_LIBRARY "${GLEW_DIRECTORY}/lib/Release/Win32/glew32s.lib")
#include_directories( ${GLEW_INCLUDE_DIR} )
############
# Find GLFW
set(GLFW_VERSION "glfw-3.0.3")
set( SEARCH_PATHS
${GLFW_PATH}
${GLFW_PATH}/include
${GLFW_PATH}/lib
${CMAKE_SOURCE_DIR}/external/${GLFW_VERSION}/include
${CMAKE_SOURCE_DIR}/external/${GLFW_VERSION}/build_vs2012x86
${CMAKE_SOURCE_DIR}/external/${GLFW_VERSION}/build_vs2012x86/Release
)
FIND_PATH( GLFW_INCLUDE_DIR GLFW/glfw3.h PATHS ${SEARCH_PATHS} ) # cjren, glfw3
FIND_LIBRARY( GLFW_LIBRARY glfw3 PATHS ${SEARCH_PATHS} )
SET(GLFW_LIBRARY "${CMAKE_SOURCE_DIR}/external/${GLFW_VERSION}/build_vs2012x86/Release/glfw3.lib")
IF( GLFW_INCLUDE_DIR AND GLFW_LIBRARY )
SET( GLFW_FOUND TRUE )
ENDIF( GLFW_INCLUDE_DIR AND GLFW_LIBRARY )
IF( GLFW_FOUND )
MESSAGE (" Found GLFW ")
ELSE( GLFW_FOUND )
MESSAGE( FATAL_ERROR "Could not find GLFW! Please provide the path \n"
"containing the 'lib' and 'include' subdirectories \n"
"that have the glfw header and static library via \n"
"-DGLFW_PATH=\"path\"" )
ENDIF( GLFW_FOUND )
#include_directories( ${GLFW_INCLUDE_DIR} )
################################
# Coconut common
set( CoconutCommon_LIBS CoconutCommon )
set( CoconutCommon_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/common )
include_directories( ${CoconutCommon_INCLUDE_DIR} )
################################
#
add_subdirectory(common)
add_subdirectory(projects)
################################
# Add custom target to copy all data
# this will create a DATA_COPY project, for example in .vcproject, build it then it does the copying.
set(TARGET_DATA_COPY DATA_COPY)
add_custom_target(
${TARGET_DATA_COPY}
COMMAND cmake -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/data ${CMAKE_CURRENT_BINARY_DIR}/data
)