-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
69 lines (57 loc) · 1.94 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
# The name of our project is "CALYPSO". CMakeLists files in this project can
# refer to the root source directory of the project as ${CALYPSO_SOURCE_DIR} and
# to the root binary directory of the project as ${CALYPSO_BINARY_DIR}.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(CALYPSO C)
# Set the CalypsoView version
SET(VERSION 0.1)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/src/cmake/Modules/")
ENABLE_LANGUAGE(Fortran C)
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CALYPSO_BINARY_DIR}/bin")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CALYPSO_BINARY_DIR}/lib")
# Use the preprocessor to handle #ifdefs
# ADD_DEFINITIONS(-cpp)
# Check OSX
IF (CMAKE_HOST_APPLE)
message(STATUS "System is Darwin")
ADD_DEFINITIONS(-D__APPLE__)
ENDIF (CMAKE_HOST_APPLE)
# Find pkg-config
FIND_PACKAGE(PkgConfig REQUIRED)
# Find zlib
FIND_PACKAGE(ZLIB REQUIRED)
IF (ZLIB_FOUND)
message(STATUS "zlib Ver. ${ZLIB_VERSION_STRING} is found")
ADD_DEFINITIONS(-DZLIB_IO)
INCLUDE_DIRECTORIES(${ZLIB_INCLUDE_DIRS})
ENDIF(ZLIB_FOUND)
# Find libpng
FIND_PACKAGE(PNG REQUIRED)
IF (PNG_FOUND)
message(STATUS "libpng Ver. ${PNG_VERSION_STRING} is found")
ADD_DEFINITIONS(-DPNG_OUTPUT)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIRS})
ENDIF(PNG_FOUND)
# Find GTK+-3
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)
IF (GTK3_FOUND)
message(STATUS "gtk+-3 is found")
INCLUDE_DIRECTORIES(${GTK3_INCLUDE_DIRS})
LINK_DIRECTORIES(${GTK3_LIBRARY_DIRS})
ADD_DEFINITIONS(${GTK3_CFLAGS_OTHER})
ENDIF(GTK3_FOUND)
# Find GLFW
FIND_PACKAGE(OpenGL REQUIRED)
IF (OPENGL_FOUND)
message(STATUS "OpenGL is found")
INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
LINK_DIRECTORIES(${OPENGL_LIBRARIES})
ENDIF(OPENGL_FOUND)
PKG_CHECK_MODULES(GLFW REQUIRED glfw3)
IF (GLFW_FOUND)
message(STATUS "GLFW3 is found")
INCLUDE_DIRECTORIES(${GLFW_INCLUDE_DIRS})
LINK_DIRECTORIES(${GLFW_LIBRARY_DIRS})
ENDIF(GLFW_FOUND)
# Recurse into the "src" subdirectory
ADD_SUBDIRECTORY (src)