holdingarea/CMakeLists.txt
author Matt Plumtree <matt.plumtree@nokia.com>
Wed, 10 Nov 2010 15:26:31 +0000
branchbug235_bringup_0
changeset 75 82d8da1d79c7
parent 49 3b4f7e9d873f
permissions -rw-r--r--
Move increment of EGL state reference count to where new threads are discovered for simulator version, to balance releaseState in eglReleaseThread.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     1
# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     2
# All rights reserved.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     3
# This component and the accompanying materials are made available
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     4
# under the terms of "Eclipse Public License v1.0"
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     5
# which accompanies this distribution, and is available
49
3b4f7e9d873f Fix accidentally corrupted EPL URLs in CMakeLists.txt files.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 36
diff changeset
     6
# at the URL "http://www.eclipse.org/legal/epl-v10.html".
24
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     7
#
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     8
# Initial Contributors:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
     9
# Nokia Corporation - initial contribution.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    10
#
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    11
# Contributors:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    12
#
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    13
# Description:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    14
# CMake meta build file for the host components in the holdingarea
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    15
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    16
cmake_minimum_required (VERSION 2.8)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    17
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    18
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "Config types" FORCE)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    19
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    20
project(PlatsimGraphics)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    21
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    22
include(cmake/FindLLVM.cmake)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    23
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    24
option(
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    25
    USE_MINI_EGL
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    26
    "Use the small EGL implementation that came with the RI."
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    27
    OFF)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    28
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    29
option(
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    30
    DEV_EXTRAS
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    31
    "Compile internally used components. Not available in public release."
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    32
    OFF)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    33
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    34
if(NOT USE_MINI_EGL)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    35
    message("*** Using proper EGL")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    36
    add_definitions(-DUSE_FULL_EGL)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    37
else(NOT USE_MINI_EGL)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    38
    message("*** Using riMiniEGL")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    39
endif(NOT USE_MINI_EGL)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    40
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    41
if(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    42
    message("*** Defining profiling flags")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    43
    add_definitions(-DSF_PROFILE)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    44
endif(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    45
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    46
# Some LLVM-definitions:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    47
message("*** LLVM binaries ***")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    48
if(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    49
    set(LLVM_CC "${PROJECT_SOURCE_DIR}/llvm/llvm-gcc4.2-2.7-x86-mingw32/bin/llvm-g++")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    50
    set(LLVM_LINK "${PROJECT_SOURCE_DIR}/llvm/llvm-2.7/bin/llvm-link")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    51
    set(LLVM_DIS "${PROJECT_SOURCE_DIR}/llvm/llvm-2.7/bin/llvm-dis")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    52
else(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    53
    set(LLVM_CC "llvm-g++")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    54
    set(LLVM_LINK "llvm-link")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    55
    set(LLVM_DIS "llvm-dis")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    56
endif(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    57
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    58
# Compiler flags before including any subprojects:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    59
if(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    60
# Use defaults
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    61
else(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    62
    set(C_DEFAULT_FLAGS "-Wall -std=c99 -pedantic-errors -Wno-variadic-macros -Wno-long-long -Wextra")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    63
    set(CXX_DEFAULT_FLAGS "-Wall -std=c++98 -pedantic-errors -Wno-variadic-macros -Wno-long-long -Wextra")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    64
    add_definitions(-D_GNU_SOURCE)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    65
endif(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    66
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_DEFAULT_FLAGS}")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    67
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_DEFAULT_FLAGS}")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    68
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    69
if(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    70
    set(LIBRARY_NAME_PREFIX lib)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    71
else(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    72
    set(LIBRARY_NAME_PREFIX)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    73
endif(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    74
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    75
set(GLOBAL_LIB_DIR ${PROJECT_SOURCE_DIR}/lib)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    76
set(COMMON_INC_DIR ${PROJECT_SOURCE_DIR}/inc)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    77
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    78
add_subdirectory(libEGL)					# EGL for subprojects
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    79
add_subdirectory(vg/2D_OpenVG_1_1_SF)                 	      	# Optimized OpenVG with RI as starting point
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    80
# Any project using OpenVG can use this to get access to VG/ include directory.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    81
# \note If OpenVG was to be made into a module, this should be in, e.g., FindOpenVG.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    82
set(OPENVG_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/vg/2D_OpenVG_1_1_SF/ri/include/)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    83
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    84
add_subdirectory(libGLESv1)					# GLES to OGL wrapper
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    85
add_subdirectory(libGLESv2)					# GLES2 to OGL wrapper
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    86
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    87
if(DEV_EXTRAS)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    88
    set(DEV_EXTRA_TARGETS conformes11-conform conformes11-covegl conformes11-covgl conformes11-primtest expat conformes20)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    89
    add_subdirectory(vg/tiger)                          # Initial benchmark for solid-fill changes, aa.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    90
    add_subdirectory(conformes11)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    91
    add_subdirectory(conformes20)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    92
    if(NOT WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    93
        # Disabled from win32-build since we should use binaries there:
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    94
        add_subdirectory(spandex/parser)                       # Parser generator from customer
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    95
        add_subdirectory(spandex/vg)                           # Test suite from customer
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    96
    endif(NOT WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    97
endif(DEV_EXTRAS)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    98
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    99
if(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   100
    if (PLATSIM_EXTENSIONS)
36
563aa0c4cea3 Moved syborggraphicswrapper from qemu package
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 24
diff changeset
   101
        add_subdirectory(serialization/Graphics/KhronosAPIWrapper)	# Simulator serialization (host)
24
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   102
        add_dependencies(KhronosAPIWrapper libEGL libGLESv1 libGLESv2 hostthreadadapter)
36
563aa0c4cea3 Moved syborggraphicswrapper from qemu package
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 24
diff changeset
   103
		add_subdirectory(syborggraphicswrapper) # Simulator serialization (guest)
563aa0c4cea3 Moved syborggraphicswrapper from qemu package
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 24
diff changeset
   104
        add_dependencies(syborg-graphicswrapper KhronosAPIWrapper hostthreadadapter)
563aa0c4cea3 Moved syborggraphicswrapper from qemu package
Gareth Stockwell <gareth.stockwell@accenture.com>
parents: 24
diff changeset
   105
        set(ALL_TARGETS libEGL libOpenVG libGLESv1 libGLESv2 hostthreadadapter KhronosAPIWrapper syborg-graphicswrapper ${DEV_EXTRA_TARGETS})
24
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   106
    else(PLATSIM_EXTENSIONS)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   107
        set(ALL_TARGETS libEGL libOpenVG libGLESv1 libGLESv2 ${DEV_EXTRA_TARGETS})
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   108
    endif(PLATSIM_EXTENSIONS)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   109
else(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   110
# Wrapper not implemented
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   111
    set(ALL_TARGETS libEGL libOpenVG libGLESv1 libGLESv2 ${DEV_EXTRA_TARGETS})
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   112
    if(DEV_EXTRAS)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   113
        add_subdirectory(vg/2D_OpenVG_1_1)                  # Accelerated reference provided by customer ("s60")
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   114
        add_subdirectory(vg/s60_tiger)                      # "s60" build of the tiger benchmark
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   115
        add_subdirectory(vg/original_sf)                    # Original OpenVG before optimizations
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   116
        add_subdirectory(vg/2D_OpenVG_tests/vg_gremlin)     # Fuzzer
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   117
    endif(DEV_EXTRAS)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   118
endif(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   119
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   120
if(WIN32)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   121
    # These help create the win32 release
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   122
    # \todo Use CMake on linux to do the same: Should create zips automatically.
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   123
    set_target_properties(${ALL_TARGETS} PROPERTIES
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   124
            LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   125
            ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   126
            RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
   127
endif(WIN32)