-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
executable file
·49 lines (40 loc) · 1.73 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 3.9 )
PROJECT(glinfo)
# Use GNUInstallDirs for Unix predefined directories
INCLUDE(GNUInstallDirs)
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE INTERNAL "" FORCE)
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE INTERNAL "" FORCE)
SET(MAJOR 1)
SET(MINOR 0)
SET(PATCH 0)
SET(STATE a)
SET(VERSION ${MAJOR}.${MINOR}${STATE}${PATCH} )
ADD_DEFINITIONS(-DGLIF_VERSION="${VERSION}")
IF(CMAKE_BUILD_TYPE STREQUAL "Release")
MESSAGE(STATUS "Compile for release.")
ADD_DEFINITIONS(-DNDEBUG=1)
ADD_DEFINITIONS(-O2)
SET(CMAKE_RELEASE TRUE)
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
ELSE()
MESSAGE(STATUS "Compile for debug.")
ADD_DEFINITIONS(-D_DEBUG)
ADD_DEFINITIONS(-g3 -O0)
SET(CMAKE_DEBUG TRUE)
ENDIF()
# ###########################################
# Backend libraries
# ###########################################
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/extern/fragcore EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/extern/fragcore/modules/image EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/extern/fragcore/modules/window EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/extern/fragcore/modules/window/sdl EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/extern/fragcore/modules/renderer EXCLUDE_FROM_ALL)
ADD_SUBDIRECTORY(${CMAKE_CURRENT_SOURCE_DIR}/extern/fragcore/modules/renderer/opengl EXCLUDE_FROM_ALL)
FILE(GLOB source ${CMAKE_CURRENT_SOURCE_DIR}/src/main.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/argument.cpp)
#
ADD_EXECUTABLE(glinfo ${source} ${glsrc})
TARGET_LINK_LIBRARIES(glinfo fragcore fragcore-rgl)
TARGET_INCLUDE_DIRECTORIES(glinfo PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
INSTALL(TARGETS glinfo DESTINATION bin)