Changeset 17

Show
Ignore:
Timestamp:
08/28/07 07:29:26 (1 year ago)
Author:
flithm
Message:

Add tango sample

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/samples/HelloTango/CMakeLists.txt

    r8 r17  
     1################################# 
     2# Preamble 
     3############## 
     4 
     5# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/  
     6# is checked 
     7set(CMAKE_MODULE_PATH 
     8    ${CMAKE_SOURCE_DIR}/cmake/Modules 
     9) 
     10 
     11# Using Tango 
     12set(CMAKE_D_USE_TANGO True) 
     13 
     14# check for DDoc usage 
     15include(UseDDoc) 
     16 
     17################################# 
     18# Project 
     19############## 
     20 
    121# The name of our project is "HELLO".  CMakeLists files in this project can 
    222# refer to the root source directory of the project as ${HELLO_SOURCE_DIR} and 
  • trunk/samples/HelloTango/Demo/CMakeLists.txt

    r8 r17  
    11# Make sure the compiler can find include files from our Hello library. 
    2 INCLUDE_DIRECTORIES (${HELLO_SOURCE_DIR}/Hello) 
     2INCLUDE_DIRECTORIES ( 
     3    ${CMAKE_BINARY_DIR} 
     4    ${CMAKE_SOURCE_DIR} 
     5
    36 
    47# Make sure the linker can find the Hello library once it is built. 
    5 LINK_DIRECTORIES (${HELLO_BINARY_DIR}/Hello) 
     8LINK_DIRECTORIES ( 
     9    ${HELLO_BINARY_DIR}/Hello 
     10
    611 
    712# Add executable called "helloDemo" that is built from the source files 
    813# "demo.cxx" and "demo_b.cxx".  The extensions are automatically found. 
    9 ADD_EXECUTABLE (helloDemo demo.d) 
     14ADD_EXECUTABLE (helloDemo  
     15    demo.d 
     16
    1017 
    1118# Link the executable to the Hello library. 
    12 TARGET_LINK_LIBRARIES (helloDemo Hello) 
     19TARGET_LINK_LIBRARIES (helloDemo  
     20    Hello 
     21
  • trunk/samples/HelloTango/Demo/demo.d

    r9 r17  
    1 import std.stdio; 
    21import Hello.hello; 
    32 
  • trunk/samples/HelloTango/Hello/CMakeLists.txt

    r8 r17  
     1include_directories( 
     2    ${CMAKE_BINARY_DIR} 
     3    ${CMAKE_SOURCE_DIR} 
     4) 
     5 
    16# Create a library called "Hello" which includes the source file "hello.cxx". 
    27# The extension is already found.  Any number of sources could be listed here. 
  • trunk/samples/HelloTango/Hello/hello.d

    r9 r17  
    11module Hello.hello; 
    22 
    3 import std.stdio
     3import tango.io.Stdout
    44 
    55class Hail 
     
    88  void Print() 
    99  { 
    10      writefln ("Hello, World!")
     10     Stdout("Hello, World!").newline
    1111  } 
    1212}