CMakeLists.txt 3.03 KB
Newer Older
1
2
3
4
5
#
# Use this to compile ACGL as a library. To include it statically compiled into 
# your own project you can also just include the CMakeListsStaticInclude.txt:
# INCLUDE(${CMAKE_SOURCE_DIR}/CMakeListsStaticInclude.txt)
#
Robert Menzel's avatar
Robert Menzel committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CMAKE_MINIMUM_REQUIRED (VERSION 2.6) 

################################################################################
# Global Settings
################################################################################

# Name of the Project 
PROJECT(ACGL)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/CompileOptions.txt)

# Specify dependencies
SET(NEED_ACGL_GLOBAL_EXTERN_DIR TRUE)
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/GlobalAndLocalExternACGL.txt)

# OpenGL Support
21
22
IF(NOT DEFINED ACGL_OPENGL_SUPPORT)
    SET(ACGL_OPENGL_SUPPORT CORE_42 CACHE STRING "")
23
    SET_PROPERTY(CACHE ACGL_OPENGL_SUPPORT PROPERTY STRINGS CORE_32 CORE_33 CORE_40 CORE_41 CORE_42 CORE_43 CORE_42 FULL_21 FULL_30 FULL_31 FULL_32 FULL_33 FULL_40 FULL_41 FULL_42 FULL_43 ES_20)
24
ENDIF()
Robert Menzel's avatar
Robert Menzel committed
25

26
27
28
29
30
# Error Level
IF(NOT DEFINED ACGL_ERROR_LEVEL)
    SET(ACGL_ERROR_LEVEL EC0 CACHE STRING "")
    SET_PROPERTY(CACHE ACGL_ERROR_LEVEL PROPERTY STRINGS EC0 EC1 EC2 EC3)
ENDIF()
Robert Menzel's avatar
Robert Menzel committed
31

32
33
34
35
# UseQT
IF(NOT DEFINED ACGL_COMPILE_WITH_QT)
    SET(ACGL_COMPILE_WITH_QT Yes CACHE STRING "")
    SET_PROPERTY(CACHE ACGL_COMPILE_WITH_QT PROPERTY STRINGS Yes No)
Robert Menzel's avatar
Robert Menzel committed
36
37
ENDIF()

38
39
40
41
42
43
44
45
46
47
48
49
50
################################################################################
# Basic Configuration
################################################################################

# Where to find the cmake finders?
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})

# Target directory
SET(LIBRARY_OUTPUT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/lib")

################################################################################
# Project Files
################################################################################
Robert Menzel's avatar
Robert Menzel committed
51

52
53
54
55
#
# if ACGL should not get compiled as a library, just include the following file 
# into the projects CMakeList.txt
#
Janis Born's avatar
Janis Born committed
56
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/CMakeListsStaticInclude.txt)
Robert Menzel's avatar
Robert Menzel committed
57

58
59
60
################################################################################
# Defines
################################################################################
Robert Menzel's avatar
Robert Menzel committed
61

Lars Krecklau's avatar
Lars Krecklau committed
62
63
INCLUDE(${CMAKE_SOURCE_DIR}/cmake/DefinesACGL.txt)
ADD_DEFINITIONS(${ACGL_DEFINES})
Robert Menzel's avatar
Robert Menzel committed
64

65
66
67
################################################################################
# External Libraries
################################################################################
Robert Menzel's avatar
Robert Menzel committed
68

69
# Qt
70
IF(ACGL_COMPILE_WITH_QT)
71
    #MESSAGE("QT")
Robert Menzel's avatar
Robert Menzel committed
72
73
74
75
    SET(QT_USE_QTOPENGL TRUE)
    FIND_PACKAGE(Qt4 REQUIRED)
    INCLUDE(${QT_USE_FILE})
    SET(LIBRARIES ${LIBRARIES} ${QT_LIBRARIES})
76
ENDIF()
Robert Menzel's avatar
Robert Menzel committed
77

78
79
80
################################################################################
# Final Definition
################################################################################
Robert Menzel's avatar
Robert Menzel committed
81

82
# Define the Project, add all required sources and dependencies to it
Lars Krecklau's avatar
Lars Krecklau committed
83
84
ADD_LIBRARY(ACGL${COMPILE_POSTFIX} STATIC ${SOURCE_FILES} ${HEADER_FILES})
TARGET_LINK_LIBRARIES(ACGL${COMPILE_POSTFIX} ${LIBRARIES})
85
#MESSAGE(${LIBRARY_NAME})