-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
CMakeLists.txt
49 lines (39 loc) · 1.17 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
cmake_minimum_required(VERSION 2.8)
project(craft)
FILE(GLOB SOURCE_FILES src/*.c)
add_executable(
craft
${SOURCE_FILES}
deps/glew/src/glew.c
deps/lodepng/lodepng.c
deps/noise/noise.c
deps/sqlite/sqlite3.c
deps/tinycthread/tinycthread.c)
add_definitions(-std=c99 -O3)
add_subdirectory(deps/glfw)
include_directories(deps/glew/include)
include_directories(deps/glfw/include)
include_directories(deps/lodepng)
include_directories(deps/noise)
include_directories(deps/sqlite)
include_directories(deps/tinycthread)
if(MINGW)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH}
"C:/Program Files/CURL/lib" "C:/Program Files (x86)/CURL/lib")
set(CMAKE_INCLUDE_PATH ${CMAKE_INCLUDE_PATH}
"C:/Program Files/CURL/include" "C:/Program Files (x86)/CURL/include")
endif()
find_package(CURL REQUIRED)
include_directories(${CURL_INCLUDE_DIR})
if(APPLE)
target_link_libraries(craft glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()
if(UNIX)
target_link_libraries(craft dl glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()
if(MINGW)
target_link_libraries(craft ws2_32.lib glfw
${GLFW_LIBRARIES} ${CURL_LIBRARIES})
endif()