CMakeLists.txt
author Matt Plumtree <matt.plumtree@nokia.com>
Mon, 01 Nov 2010 18:11:59 +0000
branchbug235_bringup_0
changeset 70 08233365fef6
parent 56 40cc73c24bf8
child 71 243bbc1d70db
permissions -rw-r--r--
Add /clean to build.bat to delete the build directory and its contents before building.
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
56
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
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:
56
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    14
# CMake meta build file for the host components
24
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
56
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    18
set(CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo" CACHE STRING "Config types" FORCE)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    19
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    20
project(HostGraphics)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    21
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    22
set(LLVM_INSTALL_DIR ${PROJECT_SOURCE_DIR}/holdingarea/llvm)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    23
include(FindLLVM.cmake)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    24
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    25
add_definitions(-DUSE_FULL_EGL)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    26
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    27
if(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    28
    message("*** Defining profiling flags")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    29
    add_definitions(-DSF_PROFILE)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    30
endif(CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    31
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    32
# Some LLVM-definitions:
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    33
message("*** LLVM binaries ***")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    34
if(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    35
    set(LLVM_CC "${LLVM_INSTALL_DIR}/llvm-gcc4.2-2.7-x86-mingw32/bin/llvm-g++")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    36
    set(LLVM_LINK "${LLVM_INSTALL_DIR}/llvm-2.7/bin/llvm-link")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    37
    set(LLVM_DIS "${LLVM_INSTALL_DIR}/llvm-2.7/bin/llvm-dis")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    38
else(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    39
    set(LLVM_CC "llvm-g++")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    40
    set(LLVM_LINK "llvm-link")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    41
    set(LLVM_DIS "llvm-dis")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    42
endif(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    43
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    44
# Compiler flags before including any subprojects:
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    45
if(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    46
# Use defaults
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    47
else(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    48
    set(C_DEFAULT_FLAGS "-Wall -std=c99 -pedantic-errors -Wno-variadic-macros -Wno-long-long -Wextra")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    49
    set(CXX_DEFAULT_FLAGS "-Wall -std=c++98 -pedantic-errors -Wno-variadic-macros -Wno-long-long -Wextra")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    50
    add_definitions(-D_GNU_SOURCE)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    51
endif(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    52
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${C_DEFAULT_FLAGS}")
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    53
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_DEFAULT_FLAGS}")
24
a3f46bb01be2 Fix line endings
Faisal Memon <faisal.memon@nokia.com>
parents: 23
diff changeset
    54
56
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    55
if(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    56
    set(LIBRARY_NAME_PREFIX lib)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    57
else(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    58
    set(LIBRARY_NAME_PREFIX)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    59
endif(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    60
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    61
set(EXECUTABLE_BASE_DIR ${EPOCROOT}epoc32/release/tools2)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    62
set(GLOBAL_LIB_DIR ${EXECUTABLE_BASE_DIR}/lib)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    63
set(EXPORTED_INC_DIR ${EPOCROOT}epoc32/include/tools)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    64
set(COMMON_INC_DIR ${PROJECT_SOURCE_DIR}/inc)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    65
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    66
add_subdirectory(hostsupport/hostegl)                   # EGL for subprojects
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    67
add_subdirectory(hostsupport/hostopenvg)                # Optimized OpenVG with RI as starting point
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    68
add_subdirectory(hostsupport/hostopengles11)            # GLES to OGL wrapper
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    69
add_subdirectory(hostsupport/hostopengles20)            # GLES2 to OGL wrapper
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    70
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    71
if(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    72
    if (SIMULATOR_EXTENSIONS)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    73
        add_subdirectory(vghwinterface/vghwapiwrapper)	# Simulator serialization (host)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    74
        add_dependencies(KhronosAPIWrapper libEGL libGLESv1 libGLESv2)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    75
        add_dependencies(syborg-graphicswrapper libEGL libGLESv1 libGLESv2)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    76
        set(ALL_TARGETS libEGL libOpenVG libGLESv1 libGLESv2 KhronosAPIWrapper syborg-graphicswrapper)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    77
    else(SIMULATOR_EXTENSIONS)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    78
        set(ALL_TARGETS libEGL libOpenVG libGLESv1 libGLESv2)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    79
    endif(SIMULATOR_EXTENSIONS)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    80
else(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    81
# Wrapper not implemented
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    82
    set(ALL_TARGETS libEGL libOpenVG libGLESv1 libGLESv2)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    83
endif(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    84
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    85
if(WIN32)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    86
    # These help create the win32 release
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    87
    # \todo Use CMake on linux to do the same: Should create zips automatically.
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    88
    if(CMAKE_BUILD_TYPE STREQUAL Debug)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    89
        set_target_properties(${ALL_TARGETS} PROPERTIES
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    90
                LIBRARY_OUTPUT_DIRECTORY ${GLOBAL_LIB_DIR}
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    91
                ARCHIVE_OUTPUT_DIRECTORY ${GLOBAL_LIB_DIR}
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    92
                RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_BASE_DIR}/deb)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    93
    else(CMAKE_BUILD_TYPE STREQUAL Debug)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    94
        set_target_properties(${ALL_TARGETS} PROPERTIES
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    95
                LIBRARY_OUTPUT_DIRECTORY ${GLOBAL_LIB_DIR}
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    96
                ARCHIVE_OUTPUT_DIRECTORY ${GLOBAL_LIB_DIR}
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    97
                RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE_BASE_DIR}/rel)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    98
    endif(CMAKE_BUILD_TYPE STREQUAL Debug)
40cc73c24bf8 Host components now buildable in their correct locations (although stil using CMake). Use build.bat in package root.
Matt Plumtree <matt.plumtree@nokia.com>
parents: 24
diff changeset
    99
endif(WIN32)