Changeset 9
- Timestamp:
- 03/20/07 08:27:50 (2 years ago)
- Files:
-
- downloads/README.samples (modified) (4 diffs)
- downloads/cmaked.tar.gz (modified) (previous)
- downloads/samples.tar.gz (modified) (previous)
- trunk/cmaked/CMakeDInformation.cmake (modified) (3 diffs)
- trunk/samples/Hello/Demo/demo.d (modified) (1 diff)
- trunk/samples/Hello/Hello/hello.d (modified) (2 diffs)
- trunk/samples/minwin_gtk/CMakeLists.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
downloads/README.samples
r7 r9 3 3 samples tested with gdc 0.23 (all samples) and DMD 1.009 4 4 under Arch Linux i686 and Windows XP with MinGW. Procedures 5 below. 5 below. to compile with dmd use "export DC=/path/to/dmd" on 6 GNU/Linux; "set DC=/path/to/dmd" on Windows/Dos. 7 6 8 7 9 samples/Hello … … 17 19 4. "Demo/helloDemo" 18 20 19 Windows : (known; don't generate full Makefiles)21 Windows/MinGW (GDC works Look Tickets: #1) 20 22 1. "cd Hello" 21 2. "cmake.exe . -G "Unix Makefiles" or "cmake.exe . -G "MSYS Makefiles"23 2. "cmake.exe . -G "Unix Makefiles" 22 24 3. "make" 25 4. "Demo/helloDemo" 26 27 Windows/DOS: (DMD works Look Tickets: #1) 28 1. "cd Hello" 29 2. "cmake.exe . -G "MinGW Makefiles" 30 3. "path/to/MinGW/bin/mingw32-make" 23 31 4. "Demo/helloDemo" 24 32 … … 30 38 a little complex. using GTK libraries and building lots of samples. 31 39 32 Linux: ( tested only with gdc)40 Linux: (works with both compilers) 33 41 1. "cd minwin_gtk" 34 42 2. "cmake ." 35 43 3. "make" 36 44 37 Windows: (not tested) 45 Windows/MinGW: (GDC not tested) 46 47 Windows/DOS: (DMD not tested) 38 48 39 49 You'll find working executables in "minwin/samples". no install procedure added only for sample. … … 49 59 3. "make" 50 60 51 Windows : (works with both compilers)61 Windows/MinGW: (GDC works) 52 62 1. "cd minwin_gtk" 53 2. "cmake.exe . -G "Unix Makefiles" or "cmake.exe . -G "MSYS Makefiles"63 2. "cmake.exe . -G "Unix Makefiles" 54 64 3. "make" 65 66 Windows/DOS: (DMD works) 67 1. "cd minwin_gtk" 68 2. "cmake.exe . -G "MinGW Makefiles" 69 3. "path/to/MinGW/bin/mingw32-make" trunk/cmaked/CMakeDInformation.cmake
r8 r9 108 108 ELSE(CMAKE_COMPILER_IS_GDC) 109 109 SET(CMAKE_OUTPUT_D_FLAG "-of") 110 IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 111 # not a good way but works because dmd using gcc 112 # for linker on Linux 113 SET(CMAKE_LINK_LIBRARY_FLAG "-L-l") 114 SET(CMAKE_LIBRARY_PATH_FLAG "-L-L") 115 ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 116 # dmd part doesn't work for now 110 IF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 117 111 SET(CMAKE_LINK_LIBRARY_FLAG "-L+") 118 112 SET(CMAKE_LIBRARY_PATH_FLAG "-I") 119 ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 113 FIND_PROGRAM(DMD_LIBRARIAN "lib.exe") 114 ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") 120 115 ENDIF(CMAKE_COMPILER_IS_GDC) 121 116 … … 134 129 # create a D static library 135 130 IF(NOT CMAKE_D_CREATE_STATIC_LIBRARY) 136 SET(CMAKE_D_CREATE_STATIC_LIBRARY 131 IF(CMAKE_COMPILER_IS_GDC) 132 SET(CMAKE_D_CREATE_STATIC_LIBRARY 137 133 "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " 138 134 "<CMAKE_RANLIB> <TARGET> ") 135 ELSE(CMAKE_COMPILER_IS_GDC) 136 IF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 137 SET(CMAKE_D_CREATE_STATIC_LIBRARY 138 "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " 139 "<CMAKE_RANLIB> <TARGET> ") 140 ELSE(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 141 SET(CMAKE_D_CREATE_STATIC_LIBRARY 142 "${DMD_LIBRARIAN} -c -p256 <TARGET> <OBJECTS>") 143 ENDIF(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") 144 ENDIF(CMAKE_COMPILER_IS_GDC) 139 145 ENDIF(NOT CMAKE_D_CREATE_STATIC_LIBRARY) 140 146 … … 146 152 147 153 IF(NOT CMAKE_D_LINK_EXECUTABLE) 154 IF(CMAKE_COMPILER_IS_GDC) 148 155 SET(CMAKE_D_LINK_EXECUTABLE 149 156 "<CMAKE_D_COMPILER> <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> ${CMAKE_OUTPUT_D_FLAG}<TARGET> <LINK_LIBRARIES>") 157 ELSE(CMAKE_COMPILER_IS_GDC) 158 SET(CMAKE_D_LINK_EXECUTABLE 159 "gcc <FLAGS> <CMAKE_D_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES> -lphobos -lpthread -lm") 160 ENDIF(CMAKE_COMPILER_IS_GDC) 150 161 ENDIF(NOT CMAKE_D_LINK_EXECUTABLE) 151 162 trunk/samples/Hello/Demo/demo.d
r8 r9 4 4 int main() 5 5 { 6 version (GNU) 7 { 8 Hail hello = new Hail(); 9 hello.Print(); 10 } 11 else 12 { 13 Print(); 14 } 15 6 Hail hello = new Hail(); 7 hello.Print(); 8 16 9 return 0; 17 10 } trunk/samples/Hello/Hello/hello.d
r8 r9 3 3 import std.stdio; 4 4 5 version (GNU) 5 class Hail 6 6 { 7 class Hail 8 { 9 public: 10 void Print() 11 { 12 writefln ("Hello, World!"); 13 } 14 } 15 } 16 else 17 { 7 public: 18 8 void Print() 19 9 { … … 21 11 } 22 12 } 13 14 trunk/samples/minwin_gtk/CMakeLists.txt
r8 r9 21 21 minwin/event.d minwin/label.d minwin/peer.d ) 22 22 23 ADD_DEFINITIONS (-fversion=GTK ${GTK2_DEFINITIONS}) 24 23 IF(CMAKE_COMPILER_IS_GDC) 24 ADD_DEFINITIONS (-fversion=GTK ${GTK2_DEFINITIONS}) 25 ELSE(CMAKE_COMPILER_IS_DMD) 26 ADD_DEFINITIONS (-version=GTK ${GTK2_DEFINITIONS}) 27 ENDIF(CMAKE_COMPILER_IS_GDC) 28 25 29 ADD_LIBRARY (minwin_gtk ${SRCS}) 26 30
