-
Notifications
You must be signed in to change notification settings - Fork 9
/
CMakeLists.txt
61 lines (39 loc) · 1.52 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
cmake_minimum_required(VERSION 2.8)
project(cppcraft)
FILE(GLOB SOURCE_FILES src/** src/World/** src/Render/**)
FILE(GLOB JSONCPP_SOURCE_FILES deps/jsoncpp/dist/**)
FILE(GLOB PROCTREE_SOURCE_FILES deps/proctree/**)
add_executable(
cppcraft
${SOURCE_FILES}
${JSONCPP_SOURCE_FILES}
${PROCTREE_SOURCE_FILES}
deps/lodepng/lodepng.cpp)
add_subdirectory(deps/glfw)
include_directories(deps/glfw/include)
include_directories(deps/glm)
include_directories(deps/lodepng)
include_directories(deps/proctree)
include_directories(deps/jsoncpp/include)
include_directories(deps/libnoise/include)
find_package(OpenGL REQUIRED)
include_directories(deps/glew/include)
if (MINGW)
set(GLEW_LIBRARY "" CACHE FILEPATH deps/glew/lib/libglew32.a )
endif ()
#if (MSVC)
# set(GLEW_LIBRARY "" CACHE FILEPATH deps/glew/lib/Release/Win32/glew32s.lib )
#endif ()
set(CMAKE_LIBRARY_PATH "deps/libnoise/bin/")
find_library(NOISE_LIBRARY NAMES LIBNOISE libnoise)
if (MSVC)
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_PREFIX_PATH "deps/glew")
set(CMAKE_LIBRARY_PATH "deps/glew/lib/Release/Win32/")
find_path(GLEW_INCLUDE_DIR include)
find_library(GLEW_LIBRARY NAMES GLEW glew32 glew glew32s PATH_SUFFIXES lib64)
find_package(GLEW REQUIRED)
endif ()
target_link_libraries(cppcraft ${GLEW_LIBRARY} ${OPENGL_LIBRARY} glfw ${GLFW_LIBRARIES} ${NOISE_LIBRARY})