Changeset 518
- Timestamp:
- 04/06/08 06:15:01 (6 months ago)
- Location:
- trunk/thune
- Files:
-
- 9 modified
-
CMakeLists.txt (modified) (3 diffs)
-
cmake_modules/FindThuneGL.cmake (modified) (1 diff)
-
console.c (modified) (1 diff)
-
gl/CMakeLists.txt (modified) (7 diffs)
-
gl/gx.h (modified) (1 diff)
-
gl/gx_dt.c (modified) (1 diff)
-
gl/project.r (modified) (3 diffs)
-
project.r (modified) (2 diffs)
-
thune-gl.spec (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/thune/CMakeLists.txt
r517 r518 16 16 17 17 18 # Why isn't this the default? 19 # Having to repeat the conditional expression is retarded. 20 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) 21 18 22 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/") 19 23 … … 22 26 add_definitions(-std=c99 -pedantic -D_GNU_SOURCE) 23 27 set(OS_FILE unix/os.c) 24 endif ( UNIX)28 endif () 25 29 26 30 if (WIN32) 27 31 include_directories(. win32) 28 32 set(OS_FILE win32/os.c) 29 endif ( WIN32)33 endif () 30 34 31 35 … … 54 58 set_target_properties(thune-lib PROPERTIES OUTPUT_NAME "thune") 55 59 60 if (APPLE) 61 target_link_libraries(thune-lib m bz2) 62 endif () 63 if (UNIX AND NOT APPLE) 64 target_link_libraries(thune-lib m bz2 pthread) 65 endif () 66 if (WIN32) 67 target_link_libraries(thune-lib ws2_32) 68 endif () 56 69 57 add_executable(thune58 console.c59 )60 70 61 if (APPLE) 62 target_link_libraries(thune thune-lib m bz2) 63 endif (APPLE) 71 add_executable(thune-bin console.c) 72 set_target_properties(thune-bin PROPERTIES OUTPUT_NAME "thune") 64 73 65 if (UNIX AND NOT APPLE) 66 target_link_libraries(thune thune-lib m bz2 pthread) 67 endif (UNIX AND NOT APPLE) 74 # NOTE: This links the binary with the libraries thune-lib links against. 75 # This creates unneeded linker dependencies, but the CMake FAQ says that 76 # there is no way to change this behavior. 77 # Here is a blog entry which talks about this problem: 78 # http://blogs.sun.com/rie/entry/tt_dependencies_tt_define_what 68 79 69 if (WIN32) 70 target_link_libraries(thune thune-lib ws2_32) 71 endif (WIN32) 80 target_link_libraries(thune-bin thune-lib) 72 81 73 82 74 83 if (UNIX) 75 install(TARGETS thune DESTINATION /usr/local/bin)84 install(TARGETS thune-bin DESTINATION /usr/local/bin) 76 85 install(TARGETS thune-lib DESTINATION /usr/local/lib) 77 86 install(FILES urlan.h DESTINATION /usr/local/include) 78 endif (UNIX) 79 80 81 find_package( FreeType ) 82 find_package( OpenGL ) 83 find_package( OpenAL ) 84 find_package( PNG ) 85 find_package( GLV ) 86 87 # Holy shit CMake authors, having to repeat the conditional expression 88 # is retarded! 89 90 if (FREETYPE_FOUND AND OPENGL_FOUND AND OPENAL_FOUND AND PNG_FOUND AND GLV_FOUND) 91 add_subdirectory( gl . ) 92 else (FREETYPE_FOUND AND OPENGL_FOUND AND OPENAL_FOUND AND PNG_FOUND AND GLV_FOUND) 93 message(STATUS "Skipping Thune-GL. Missing these dependencies:") 94 if (NOT FREETYPE_FOUND) 95 message(STATUS " FreeType not found") 96 endif (NOT FREETYPE_FOUND) 97 if (NOT OPENGL_FOUND) 98 message(STATUS " OpenGL not found") 99 endif (NOT OPENGL_FOUND) 100 if (NOT OPENAL_FOUND) 101 message(STATUS " OpenAL not found") 102 endif (NOT OPENAL_FOUND) 103 if (NOT PNG_FOUND) 104 message(STATUS " PNG not found") 105 endif (NOT PNG_FOUND) 106 if (NOT GLV_FOUND) 107 message(STATUS " GLV not found") 108 endif (NOT GLV_FOUND) 109 endif (FREETYPE_FOUND AND OPENGL_FOUND AND OPENAL_FOUND AND PNG_FOUND AND GLV_FOUND) 87 endif () 110 88 111 89 # eof -
trunk/thune/cmake_modules/FindThuneGL.cmake
r517 r518 1 FIND_PATH(THUNEGL_INCLUDE_DIR thune-gl.h /usr/include /usr/local/include) 2 1 3 FIND_LIBRARY(THUNEGL_LIBRARY NAMES thune-gl PATH /usr/lib64 /usr/local/lib64 /usr/lib /usr/local/lib) 2 4 3 IF (THUNEGL_ LIBRARY)5 IF (THUNEGL_INCLUDE_DIR AND THUNEGL_LIBRARY) 4 6 SET(THUNEGL_FOUND TRUE) 5 ENDIF (THUNEGL_ LIBRARY)7 ENDIF (THUNEGL_INCLUDE_DIR AND THUNEGL_LIBRARY) 6 8 7 9 IF (THUNEGL_FOUND) 8 10 IF (NOT ThuneGL_FIND_QUIETLY) 9 MESSAGE(STATUS "Found Thune-GL: ${THUNE _LIBRARY}")11 MESSAGE(STATUS "Found Thune-GL: ${THUNEGL_LIBRARY}") 10 12 ENDIF (NOT ThuneGL_FIND_QUIETLY) 11 13 ELSE (THUNEGL_FOUND) -
trunk/thune/console.c
r468 r518 31 31 #elif defined(THUNE_GL) 32 32 33 extern int gx_startup( UrlanEnv* ); 34 extern void gx_shutdown( UrlanEnv* ); 35 extern UDatatype ug_datatypes[]; 33 #include "gx.h" 36 34 #define APPNAME "Thune-GL" 37 35 #define CUSTOM_DT ug_datatypes 38 #define CUSTOM_DT_COUNT 636 #define CUSTOM_DT_COUNT UG_DT_COUNT 39 37 40 38 #else -
trunk/thune/gl/CMakeLists.txt
r517 r518 1 1 project(ThuneGL C) 2 3 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake_modules/")4 2 5 3 # set(CMAKE_BUILD_TYPE Debug) … … 7 5 8 6 9 # These package checks are only needed when ../CMakeLists.txt is not used. 10 #find_package( FreeType REQUIRED ) 11 #find_package( OpenGL REQUIRED ) 12 #find_package( OpenAL REQUIRED ) 13 #find_package( PNG REQUIRED ) 14 #find_package( GLV REQUIRED ) 7 # Why isn't this the default? 8 # Having to repeat the conditional expression is retarded. 9 set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true) 10 11 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/../cmake_modules/") 12 13 14 find_package( Thune REQUIRED ) 15 find_package( FreeType REQUIRED ) 16 find_package( OpenGL REQUIRED ) 17 find_package( OpenAL REQUIRED ) 18 find_package( PNG REQUIRED ) 19 find_package( GLV REQUIRED ) 15 20 16 21 … … 19 24 add_definitions(-std=c99) 20 25 # set(GLV_FILE glv/mac/glv.c) 21 endif ( APPLE)26 endif () 22 27 23 28 if (UNIX AND NOT APPLE) … … 28 33 # set(GLV_FILE glv/x11/glv.c) 29 34 set(JOYSTICK_FILE joystick.c) 30 endif ( UNIX AND NOT APPLE)35 endif () 31 36 32 37 if (WIN32) 33 38 include_directories(../win32) 34 39 # set(GLV_FILE glv/win32/glv.c) 35 endif ( WIN32)40 endif () 36 41 37 42 … … 70 75 set_target_properties(thuneGL-lib PROPERTIES OUTPUT_NAME "thune-gl") 71 76 77 if (APPLE) 78 target_link_libraries(thuneGL-lib bz2 m) 79 endif () 80 81 if (UNIX AND NOT APPLE) 82 target_link_libraries(thuneGL-lib 83 vorbis vorbisfile alut 84 X11 Xxf86vm 85 bz2 m pthread 86 ) 87 endif () 88 89 if (WIN32) 90 target_link_libraries(thuneGL-lib ws2_32) 91 endif () 92 72 93 link_directories(../) 73 94 target_link_libraries(thuneGL-lib 74 thune-lib95 ${THUNE_LIBRARY} 75 96 ${PNG_LIBRARY} 76 97 ${FREETYPE_LIBRARY} … … 82 103 83 104 84 add_executable(thune-gl 85 ../console.c 86 ) 87 105 add_executable(thune-gl ../console.c) 88 106 target_link_libraries(thune-gl thuneGL-lib) 89 90 91 if (APPLE)92 target_link_libraries(thuneGL-lib bz2 m)93 endif (APPLE)94 95 if (UNIX AND NOT APPLE)96 target_link_libraries(thuneGL-lib97 vorbis vorbisfile alut98 X11 Xxf86vm99 bz2 m pthread100 )101 endif (UNIX AND NOT APPLE)102 103 if (WIN32)104 target_link_libraries(thuneGL-lib ws2_32)105 endif (WIN32)106 107 107 108 … … 110 111 install(TARGETS thuneGL-lib DESTINATION /usr/local/lib) 111 112 #install(FILES urlan.h DESTINATION /usr/local/include) 112 endif ( UNIX)113 endif () 113 114 114 115 -
trunk/thune/gl/gx.h
r517 r518 174 174 }; 175 175 176 177 #define UG_DT_COUNT 6 178 extern UDatatype ug_datatypes[ UG_DT_COUNT ]; 176 179 177 180 extern struct GrRenderState grState; -
trunk/thune/gl/gx_dt.c
r516 r518 1135 1135 1136 1136 1137 UDatatype ug_datatypes[ 6] =1137 UDatatype ug_datatypes[ UG_DT_COUNT ] = 1138 1138 { 1139 1139 {"draw-list!", 0, 0, -
trunk/thune/gl/project.r
r517 r518 13 13 include_from %. 14 14 include_from %.. 15 libs_from %.. %thune015 ;libs_from %.. %thune0 16 16 cflags {-DLANG_THUNE} 17 17 cflags {-DNO_AUDIO} … … 22 22 include_from %/usr/include/freetype2 23 23 sources [%joystick.c] 24 25 ;libs [%X11 %Xxf86vm] 26 ;libs [%freetype %bz2 %png %glv %GL %GLU 27 ; %openal %alut %vorbis %vorbisfile] 24 28 ] 25 29 macx [ … … 76 80 77 81 exe %thune-gl [ 78 opengl79 82 cflags {-DLANG_THUNE -DTHUNE_GL} 83 include_from %. 80 84 libs_from %. %thune-gl0 85 libs_from %.. %thune0 81 86 linux [ 82 libs_from %/usr/X11R6/lib64 [%X11 %Xxf86vm]83 87 ;libs_from %/usr/X11R6/lib [%X11 %Xxf86vm] 88 libs [%X11 %Xxf86vm] 84 89 libs [%freetype %bz2 %png %glv] 85 90 libs [%openal %alut %vorbis %vorbisfile] -
trunk/thune/project.r
r516 r518 82 82 unix [ 83 83 sources [ %unix/os.c ] 84 ;libs {m bz2 pthread} 84 85 ] 85 86 win32 [ … … 99 100 100 101 macx [ 101 libs %m 102 libs %bz2 102 libs {m bz2} 103 103 ] 104 104 unix [ -
trunk/thune/thune-gl.spec
r517 r518 11 11 BuildRoot: %{_tmppath}/thune-%{version}-build 12 12 %if 0%{?fedora_version} 13 BuildRequires: cmake libglv mesa-libGL-devel mesa-libGLU-devel freetype-devel openal-devel freealut-devel libvorbis-devel libpng-devel libXxf86vm-devel13 BuildRequires: cmake libglv thune mesa-libGL-devel mesa-libGLU-devel freetype-devel openal-devel freealut-devel libvorbis-devel libpng-devel libXxf86vm-devel 14 14 %endif 15 15 %if 0%{?mandriva_version} 16 BuildRequires: cmake libglv libmesagl1-devel libmesaglu1-devel freetype2-devel openal0-devel libfreealut0-devel libvorbis-devel libpng-devel libbzip2_1-devel16 BuildRequires: cmake libglv thune libmesagl1-devel libmesaglu1-devel freetype2-devel openal0-devel libfreealut0-devel libvorbis-devel libpng-devel libbzip2_1-devel 17 17 %endif 18 18 %if 0%{?suse_version} 19 BuildRequires: cmake libglv Mesa-devel freetype2-devel openal-devel freealut-devel libvorbis-devel libpng-devel19 BuildRequires: cmake libglv thune Mesa-devel freetype2-devel openal-devel freealut-devel libvorbis-devel libpng-devel 20 20 %endif 21 21 … … 29 29 30 30 %build 31 cmake . 31 cmake ./gl 32 32 make 33 33
