|
1 # Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
2 # |
|
3 # Permission is hereby granted, free of charge, to any person obtaining a |
|
4 # copy of this software and /or associated documentation files |
|
5 # (the "Materials "), to deal in the Materials without restriction, |
|
6 # including without limitation the rights to use, copy, modify, merge, |
|
7 # publish, distribute, sublicense, and/or sell copies of the Materials, |
|
8 # and to permit persons to whom the Materials are furnished to do so, |
|
9 # subject to the following conditions: |
|
10 # |
|
11 # The above copyright notice and this permission notice shall be included |
|
12 # in all copies or substantial portions of the Materials. |
|
13 # |
|
14 # THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
|
15 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
|
16 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
|
17 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
|
18 # DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR |
|
19 # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR |
|
20 # THE USE OR OTHER DEALINGS IN THE MATERIALS. |
|
21 # |
|
22 # Initial Contributors: |
|
23 # Nokia Corporation - initial contribution. |
|
24 # |
|
25 # Contributors: |
|
26 # |
|
27 # Description: |
|
28 # CMake meta build file for host libEGL |
|
29 |
|
30 set(EGL_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src) |
|
31 set(EGL_INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/inc) |
|
32 |
|
33 find_package(OpenGL) |
|
34 |
|
35 if(WIN32) |
|
36 message("*** EGL Win32") |
|
37 set(EGL_SSE_FLAGS "/arch:SSE2") |
|
38 set(EGL_PLATFORM_LINK_LIBRARIES "") |
|
39 set(EGL_PLATFORM_SOURCE_DIR "win32") |
|
40 else(WIN32) |
|
41 set(EGL_SSE_FLAGS "-msse2 -mfpmath=sse -march=pentium4") |
|
42 set(EGL_PLATFORM_LINK_LIBRARIES m stdc++) |
|
43 set(EGL_PLATFORM_SOURCE_DIR "linux") |
|
44 endif(WIN32) |
|
45 |
|
46 set(EGL_SRC_FILES |
|
47 ${COMMON_INC_DIR}/SurfaceDescriptor.h |
|
48 ${COMMON_INC_DIR}/ColorDescriptor.h |
|
49 ${COMMON_INC_DIR}/GLESInterface.h |
|
50 ${COMMON_INC_DIR}/GLES2Interface.h |
|
51 ${COMMON_INC_DIR}/VGInterface.h |
|
52 ${COMMON_INC_DIR}/BufferContainer.h |
|
53 ${COMMON_INC_DIR}/ImageTarget.h |
|
54 ${EGL_INC_DIR}/EGLConfig.h |
|
55 ${EGL_INC_DIR}/EGLContext.h |
|
56 ${EGL_INC_DIR}/eglDefinitions.h |
|
57 ${EGL_INC_DIR}/EGLDisplay.h |
|
58 ${EGL_INC_DIR}/eglInternal.h |
|
59 ${EGL_INC_DIR}/EGLPbufferSurface.h |
|
60 ${EGL_INC_DIR}/EGLProcess.h |
|
61 ${EGL_INC_DIR}/EGLState.h |
|
62 ${EGL_INC_DIR}/EGLSurface.h |
|
63 ${EGL_INC_DIR}/EGLThread.h |
|
64 ${EGL_INC_DIR}/EGLWindowSurface.h |
|
65 ${EGL_INC_DIR}/TransparentColor.h |
|
66 ${EGL_INC_DIR}/EGLUtils.h |
|
67 ${EGL_INC_DIR}/EGLImage.h |
|
68 ${EGL_INC_DIR}/EGLExtension.h |
|
69 ${EGL_INC_DIR}/EGLOs.h |
|
70 ${EGL_INC_DIR}/EGLStructs.h |
|
71 |
|
72 ${EGL_SRC_DIR}/ColorDescriptor.cpp |
|
73 ${EGL_SRC_DIR}/eglapi.cpp |
|
74 ${EGL_SRC_DIR}/EGLConfig.cpp |
|
75 ${EGL_SRC_DIR}/EGLContext.cpp |
|
76 ${EGL_SRC_DIR}/EGLDisplay.cpp |
|
77 ${EGL_SRC_DIR}/EGLPbufferSurface.cpp |
|
78 ${EGL_SRC_DIR}/EGLProcess.cpp |
|
79 ${EGL_SRC_DIR}/EGLState.cpp |
|
80 ${EGL_SRC_DIR}/EGLSurface.cpp |
|
81 ${EGL_SRC_DIR}/EGLThread.cpp |
|
82 ${EGL_SRC_DIR}/EGLWindowSurface.cpp |
|
83 ${EGL_SRC_DIR}/TransparentColor.cpp |
|
84 ${EGL_SRC_DIR}/EGLUtils.cpp |
|
85 ${EGL_SRC_DIR}/EGLImage.cpp |
|
86 ${EGL_SRC_DIR}/EGLExtension.cpp |
|
87 ${EGL_SRC_DIR}/${EGL_PLATFORM_SOURCE_DIR}/EGLOs.cpp |
|
88 ) |
|
89 |
|
90 include_directories( |
|
91 ${EGL_SRC_DIR} |
|
92 ${EGL_INC_DIR} |
|
93 ${COMMON_INC_DIR} |
|
94 ) |
|
95 |
|
96 # \todo MSVC: |
|
97 # Probably not needed for EGL, but it might be a good idea to define these: |
|
98 # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse2 -mfpmath=sse -march=pentium4") |
|
99 # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse2 -mfpmath=sse -march=pentium4") |
|
100 |
|
101 if(PLATSIM_EXTENSIONS) |
|
102 add_definitions(-DKHRONOS_APICALL_EXPORT -DEGLI_USE_PLATSIM_EXTENSIONS) |
|
103 else(PLATSIM_EXNTENSIONS) |
|
104 add_definitions(-DKHRONOS_APICALL_EXPORT) |
|
105 endif(PLATSIM_EXTENSIONS) |
|
106 |
|
107 add_library(${LIBRARY_NAME_PREFIX}EGL SHARED ${EGL_SRC_FILES}) |
|
108 |
|
109 set_target_properties(${LIBRARY_NAME_PREFIX}EGL PROPERTIES LINK_INTERFACE_LIBRARIES "") |
|
110 |
|
111 target_link_libraries(${LIBRARY_NAME_PREFIX}EGL ${EGL_PLATFORM_LINK_LIBRARIES} ${OPENGL_LIBRARIES}) |