From: Mattia Basaglia Date: Tue, 28 Jul 2015 13:44:07 +0000 (+0200) Subject: Compile module plugins X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=c92f2806fac72ace0c90f76fd800727994b9683a;p=xonotic%2Fnetradiant.git Compile module plugins --- diff --git a/CMakeLists.txt b/CMakeLists.txt index e4087305..ba2fcc8e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -174,6 +174,12 @@ include_directories(include) add_subdirectory(libs) include_directories(libs) + +macro(radiant_plugin name) + message(STATUS "Found Plugin ${name}") + add_library(${name} MODULE ${ARGN}) +endmacro() + add_subdirectory(contrib) add_subdirectory(plugins) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 4502b276..7c2aa799 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,9 +1,3 @@ -# Todo split further and actually compile the plugins - -macro(radiant_plugin name) - message(STATUS "Found Plugin ${name}") - add_library(${name} MODULE ${ARGN}) -endmacro() set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/plugins") diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index cc0babec..c4d4f8cb 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -22,6 +22,16 @@ add_subdirectory(stream) add_subdirectory(string) add_subdirectory(xml) +add_library(etclib SHARED + etclib.c + etclib.h +) + +add_library(filematch SHARED + filematch.c + filematch.h +) + add_library(libs archivelib.cpp archivelib.h diff --git a/libs/container/CMakeLists.txt b/libs/container/CMakeLists.txt index 2e1984c2..0159daa3 100644 --- a/libs/container/CMakeLists.txt +++ b/libs/container/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(container +add_library(container SHARED array.cpp array.h cache.cpp diff --git a/libs/ddslib/CMakeLists.txt b/libs/ddslib/CMakeLists.txt index e9c40054..9a695431 100644 --- a/libs/ddslib/CMakeLists.txt +++ b/libs/ddslib/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(ddslib +add_library(ddslib SHARED ddslib.c ) diff --git a/libs/debugging/CMakeLists.txt b/libs/debugging/CMakeLists.txt index 7743f210..6209d657 100644 --- a/libs/debugging/CMakeLists.txt +++ b/libs/debugging/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(debugging +add_library(debugging SHARED debugging.cpp debugging.h ) diff --git a/libs/generic/CMakeLists.txt b/libs/generic/CMakeLists.txt index c7fbebe3..172515db 100644 --- a/libs/generic/CMakeLists.txt +++ b/libs/generic/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(generic +add_library(generic SHARED arrayrange.cpp arrayrange.h bitfield.cpp diff --git a/libs/gtkutil/CMakeLists.txt b/libs/gtkutil/CMakeLists.txt index 09be33bb..3356c061 100644 --- a/libs/gtkutil/CMakeLists.txt +++ b/libs/gtkutil/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(gtkutil +add_library(gtkutil SHARED accelerator.cpp accelerator.h button.cpp diff --git a/libs/l_net/CMakeLists.txt b/libs/l_net/CMakeLists.txt index 29a792d7..1e7f2578 100644 --- a/libs/l_net/CMakeLists.txt +++ b/libs/l_net/CMakeLists.txt @@ -8,7 +8,7 @@ if(WIN32) else() set(L_NETLIST ${L_NETLIST} l_net_berkley.c) endif() -add_library(l_net ${L_NETLIST}) +add_library(l_net SHARED ${L_NETLIST}) if(WIN32) target_link_libraries(l_net ws2_32) endif() diff --git a/libs/math/CMakeLists.txt b/libs/math/CMakeLists.txt index 46332bfe..d7b3b3d0 100644 --- a/libs/math/CMakeLists.txt +++ b/libs/math/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(math +add_library(math SHARED aabb.cpp aabb.h curve.cpp diff --git a/libs/md5lib/CMakeLists.txt b/libs/md5lib/CMakeLists.txt index ed8a84a1..fe79afed 100644 --- a/libs/md5lib/CMakeLists.txt +++ b/libs/md5lib/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(md5lib +add_library(md5lib SHARED md5lib.c ) diff --git a/libs/memory/CMakeLists.txt b/libs/memory/CMakeLists.txt index 820e274a..8fd5f330 100644 --- a/libs/memory/CMakeLists.txt +++ b/libs/memory/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(memory +add_library(memory SHARED allocator.cpp allocator.h ) diff --git a/libs/modulesystem/CMakeLists.txt b/libs/modulesystem/CMakeLists.txt index 24778356..17cd6585 100644 --- a/libs/modulesystem/CMakeLists.txt +++ b/libs/modulesystem/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(modulesystem +add_library(modulesystem SHARED moduleregistry.cpp moduleregistry.h modulesmap.cpp diff --git a/libs/os/CMakeLists.txt b/libs/os/CMakeLists.txt index 26234d37..0c8c27a9 100644 --- a/libs/os/CMakeLists.txt +++ b/libs/os/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(os +add_library(os SHARED dir.cpp dir.h file.cpp diff --git a/libs/picomodel/CMakeLists.txt b/libs/picomodel/CMakeLists.txt index 2f88a847..f54f8135 100644 --- a/libs/picomodel/CMakeLists.txt +++ b/libs/picomodel/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(picomodel +add_library(picomodel SHARED lwo/clip.c lwo/envelope.c lwo/list.c diff --git a/libs/script/CMakeLists.txt b/libs/script/CMakeLists.txt index 72b699ee..42c50cb8 100644 --- a/libs/script/CMakeLists.txt +++ b/libs/script/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(script +add_library(script SHARED scripttokeniser.cpp scripttokeniser.h scripttokenwriter.cpp diff --git a/libs/signal/CMakeLists.txt b/libs/signal/CMakeLists.txt index c48c84e4..8d023347 100644 --- a/libs/signal/CMakeLists.txt +++ b/libs/signal/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(signal +add_library(signal SHARED isignal.cpp isignal.h signal.cpp diff --git a/libs/splines/CMakeLists.txt b/libs/splines/CMakeLists.txt index 5afefe02..7c070cbb 100644 --- a/libs/splines/CMakeLists.txt +++ b/libs/splines/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(splines +add_library(splines SHARED math_angles.cpp math_angles.h math_matrix.cpp diff --git a/libs/stream/CMakeLists.txt b/libs/stream/CMakeLists.txt index dc928dfe..945f2887 100644 --- a/libs/stream/CMakeLists.txt +++ b/libs/stream/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(stream +add_library(stream SHARED filestream.cpp filestream.h memstream.cpp diff --git a/libs/string/CMakeLists.txt b/libs/string/CMakeLists.txt index a0b8f195..0f569222 100644 --- a/libs/string/CMakeLists.txt +++ b/libs/string/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(string +add_library(string SHARED pooledstring.cpp pooledstring.h string.h diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt index a7a4adc1..b5bbc4a0 100644 --- a/plugins/CMakeLists.txt +++ b/plugins/CMakeLists.txt @@ -1,211 +1,20 @@ -# Todo split further and actually compile the plugins -set(ARCHIVEPAKLIST - plugins/archivepak/archive.cpp - plugins/archivepak/archive.h - plugins/archivepak/pak.cpp - plugins/archivepak/pak.h - plugins/archivepak/plugin.cpp - plugins/archivepak/plugin.h -) - -set(ARCHIVEWADLIST - plugins/archivewad/archive.cpp - plugins/archivewad/archive.h - plugins/archivewad/plugin.cpp - plugins/archivewad/plugin.h - plugins/archivewad/wad.cpp - plugins/archivewad/wad.h -) - -set(ARCHIVEZIPLIST - plugins/archivezip/archive.cpp - plugins/archivezip/archive.h - plugins/archivezip/pkzip.cpp - plugins/archivezip/pkzip.h - plugins/archivezip/plugin.cpp - plugins/archivezip/plugin.h - plugins/archivezip/zlibstream.cpp - plugins/archivezip/zlibstream.h -) - -set(ENTITYLIST - plugins/entity/angle.cpp - plugins/entity/angle.h - plugins/entity/angles.cpp - plugins/entity/angles.h - plugins/entity/colour.cpp - plugins/entity/colour.h - plugins/entity/curve.cpp - plugins/entity/curve.h - plugins/entity/doom3group.cpp - plugins/entity/doom3group.h - plugins/entity/eclassmodel.cpp - plugins/entity/eclassmodel.h - plugins/entity/entity.cpp - plugins/entity/entity.h - plugins/entity/filters.cpp - plugins/entity/filters.h - plugins/entity/generic.cpp - plugins/entity/generic.h - plugins/entity/group.cpp - plugins/entity/group.h - plugins/entity/keyobservers.cpp - plugins/entity/keyobservers.h - plugins/entity/light.cpp - plugins/entity/light.h - plugins/entity/miscmodel.cpp - plugins/entity/miscmodel.h - plugins/entity/model.cpp - plugins/entity/model.h - plugins/entity/modelskinkey.cpp - plugins/entity/modelskinkey.h - plugins/entity/namedentity.cpp - plugins/entity/namedentity.h - plugins/entity/namekeys.cpp - plugins/entity/namekeys.h - plugins/entity/origin.cpp - plugins/entity/origin.h - plugins/entity/plugin.cpp - plugins/entity/plugin.h - plugins/entity/rotation.cpp - plugins/entity/rotation.h - plugins/entity/scale.cpp - plugins/entity/scale.h - plugins/entity/skincache.cpp - plugins/entity/skincache.h - plugins/entity/targetable.cpp - plugins/entity/targetable.h -) - -set(IMAGELIST - plugins/image/bmp.cpp - plugins/image/bmp.h - plugins/image/dds.cpp - plugins/image/dds.h - plugins/image/image.h - plugins/image/jpeg.cpp - plugins/image/jpeg.h - plugins/image/pcx.cpp - plugins/image/pcx.h - plugins/image/tga.cpp - plugins/image/tga.h - plugins/image/image.cpp - plugins/image/ktx.cpp - plugins/image/ktx.h -) - -set(IMAGEHLLIST - plugins/imagehl/hlw.cpp - plugins/imagehl/hlw.h - plugins/imagehl/imagehl.cpp - plugins/imagehl/imagehl.h - plugins/imagehl/mip.cpp - plugins/imagehl/mip.h - plugins/imagehl/sprite.cpp - plugins/imagehl/sprite.h -) - -set(IMAGEPNGLIST - plugins/imagepng/plugin.cpp - plugins/imagepng/plugin.h -) - -set(IMAGEQ2LIST - plugins/imageq2/imageq2.cpp - plugins/imageq2/imageq2.h - plugins/imageq2/wal.cpp - plugins/imageq2/wal.h - plugins/imageq2/wal32.cpp - plugins/imageq2/wal32.h -) - -set(MAPQ3LIST - plugins/mapq3/parse.cpp - plugins/mapq3/parse.h - plugins/mapq3/plugin.cpp - plugins/mapq3/plugin.h - plugins/mapq3/write.cpp - plugins/mapq3/write.h -) - -set(MAPXMLLIST - plugins/mapxml/plugin.cpp - plugins/mapxml/plugin.h - plugins/mapxml/xmlparse.cpp - plugins/mapxml/xmlparse.h - plugins/mapxml/xmlwrite.cpp - plugins/mapxml/xmlwrite.h -) - -set(MD3MODELLIST - plugins/md3model/ident.h - plugins/md3model/md2.cpp - plugins/md3model/md2.h - plugins/md3model/md3.cpp - plugins/md3model/md3.h - plugins/md3model/md3normals.cpp - plugins/md3model/md3normals.h - plugins/md3model/md5.cpp - plugins/md3model/md5.h - plugins/md3model/mdc.cpp - plugins/md3model/mdc.h - plugins/md3model/mdl.cpp - plugins/md3model/mdl.h - plugins/md3model/mdlformat.cpp - plugins/md3model/mdlformat.h - plugins/md3model/mdlimage.cpp - plugins/md3model/mdlimage.h - plugins/md3model/mdlnormals.cpp - plugins/md3model/mdlnormals.h - plugins/md3model/model.cpp - plugins/md3model/model.h - plugins/md3model/plugin.cpp - plugins/md3model/plugin.h -) - -set(MODELLIST - plugins/model/model.cpp - plugins/model/model.h - plugins/model/plugin.cpp - plugins/model/plugin.h -) - -set(SAMPLELIST - plugins/sample/sample.cpp - plugins/sample/sample.h -) - -set(SHADERSLIST - plugins/shaders/plugin.cpp - plugins/shaders/plugin.h - plugins/shaders/shaders.cpp - plugins/shaders/shaders.h -) - -set(SPRITEMODELLIST - plugins/spritemodel/plugin.cpp - plugins/spritemodel/plugin.h - plugins/spritemodel/spritemodel.cpp - plugins/spritemodel/spritemodel.h -) - -set(TEXTOOLLIST - plugins/textool/2DView.cpp - plugins/textool/2DView.h - plugins/textool/ControlPointsManager.cpp - plugins/textool/ControlPointsManager.h - plugins/textool/StdAfx.cpp - plugins/textool/StdAfx.h - plugins/textool/TexTool.cpp - plugins/textool/resource.h -) - -set(VFSPK3LIST - plugins/vfspk3/archive.cpp - plugins/vfspk3/archive.h - plugins/vfspk3/vfs.cpp - plugins/vfspk3/vfs.h - plugins/vfspk3/vfspk3.cpp - plugins/vfspk3/vfspk3.h -) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules") + +add_subdirectory(archivepak) +add_subdirectory(archivewad) +add_subdirectory(archivezip) +add_subdirectory(entity) +add_subdirectory(image) +add_subdirectory(imagehl) +add_subdirectory(imagepng) +add_subdirectory(imageq2) +add_subdirectory(mapq3) +add_subdirectory(mapxml) +add_subdirectory(md3model) +add_subdirectory(model) +# add_subdirectory(sample) +add_subdirectory(shaders) +# add_subdirectory(spritemodel) +# add_subdirectory(textool) +add_subdirectory(vfspk3) diff --git a/plugins/archivepak/CMakeLists.txt b/plugins/archivepak/CMakeLists.txt new file mode 100644 index 00000000..bc11e423 --- /dev/null +++ b/plugins/archivepak/CMakeLists.txt @@ -0,0 +1,8 @@ +radiant_plugin(archivepak + archive.cpp + archive.h + pak.cpp + pak.h + plugin.cpp + plugin.h +) diff --git a/plugins/archivewad/CMakeLists.txt b/plugins/archivewad/CMakeLists.txt new file mode 100644 index 00000000..8f561e30 --- /dev/null +++ b/plugins/archivewad/CMakeLists.txt @@ -0,0 +1,9 @@ + +radiant_plugin(archivewad + archive.cpp + archive.h + plugin.cpp + plugin.h + wad.cpp + wad.h +) diff --git a/plugins/archivezip/CMakeLists.txt b/plugins/archivezip/CMakeLists.txt new file mode 100644 index 00000000..42ab4614 --- /dev/null +++ b/plugins/archivezip/CMakeLists.txt @@ -0,0 +1,11 @@ + +radiant_plugin(archivezip + archive.cpp + archive.h + pkzip.cpp + pkzip.h + plugin.cpp + plugin.h + zlibstream.cpp + zlibstream.h +) diff --git a/plugins/entity/CMakeLists.txt b/plugins/entity/CMakeLists.txt new file mode 100644 index 00000000..669b8fb8 --- /dev/null +++ b/plugins/entity/CMakeLists.txt @@ -0,0 +1,49 @@ + +radiant_plugin(entity + angle.cpp + angle.h + angles.cpp + angles.h + colour.cpp + colour.h + curve.cpp + curve.h + doom3group.cpp + doom3group.h + eclassmodel.cpp + eclassmodel.h + entity.cpp + entity.h + filters.cpp + filters.h + generic.cpp + generic.h + group.cpp + group.h + keyobservers.cpp + keyobservers.h + light.cpp + light.h + miscmodel.cpp + miscmodel.h + model.cpp + model.h + modelskinkey.cpp + modelskinkey.h + namedentity.cpp + namedentity.h + namekeys.cpp + namekeys.h + origin.cpp + origin.h + plugin.cpp + plugin.h + rotation.cpp + rotation.h + scale.cpp + scale.h + skincache.cpp + skincache.h + targetable.cpp + targetable.h +) diff --git a/plugins/image/CMakeLists.txt b/plugins/image/CMakeLists.txt new file mode 100644 index 00000000..4954696f --- /dev/null +++ b/plugins/image/CMakeLists.txt @@ -0,0 +1,21 @@ + +radiant_plugin(image + bmp.cpp + bmp.h + dds.cpp + dds.h + image.h + jpeg.cpp + jpeg.h + pcx.cpp + pcx.h + tga.cpp + tga.h + image.cpp + ktx.cpp + ktx.h +) + +find_package(JPEG REQUIRED) +include_directories(${JPEG_INCLUDE_DIR}) +target_link_libraries(image ddslib etclib ${JPEG_LIBRARIES}) diff --git a/plugins/imagehl/CMakeLists.txt b/plugins/imagehl/CMakeLists.txt new file mode 100644 index 00000000..0e7deb61 --- /dev/null +++ b/plugins/imagehl/CMakeLists.txt @@ -0,0 +1,10 @@ +radiant_plugin(imagehl + hlw.cpp + hlw.h + imagehl.cpp + imagehl.h + mip.cpp + mip.h + sprite.cpp + sprite.h +) diff --git a/plugins/imagepng/CMakeLists.txt b/plugins/imagepng/CMakeLists.txt new file mode 100644 index 00000000..e6b32c1d --- /dev/null +++ b/plugins/imagepng/CMakeLists.txt @@ -0,0 +1,4 @@ +radiant_plugin(imagepng + plugin.cpp + plugin.h +) diff --git a/plugins/imageq2/CMakeLists.txt b/plugins/imageq2/CMakeLists.txt new file mode 100644 index 00000000..61cae0dd --- /dev/null +++ b/plugins/imageq2/CMakeLists.txt @@ -0,0 +1,9 @@ + +radiant_plugin(imageq2 + imageq2.cpp + imageq2.h + wal.cpp + wal.h + wal32.cpp + wal32.h +) diff --git a/plugins/mapq3/CMakeLists.txt b/plugins/mapq3/CMakeLists.txt new file mode 100644 index 00000000..67521743 --- /dev/null +++ b/plugins/mapq3/CMakeLists.txt @@ -0,0 +1,8 @@ +radiant_plugin(mapq3 + parse.cpp + parse.h + plugin.cpp + plugin.h + write.cpp + write.h +) diff --git a/plugins/mapxml/CMakeLists.txt b/plugins/mapxml/CMakeLists.txt new file mode 100644 index 00000000..f8ef4830 --- /dev/null +++ b/plugins/mapxml/CMakeLists.txt @@ -0,0 +1,9 @@ + +radiant_plugin(mapxml + plugin.cpp + plugin.h + xmlparse.cpp + xmlparse.h + xmlwrite.cpp + xmlwrite.h +) diff --git a/plugins/md3model/CMakeLists.txt b/plugins/md3model/CMakeLists.txt new file mode 100644 index 00000000..580c7419 --- /dev/null +++ b/plugins/md3model/CMakeLists.txt @@ -0,0 +1,26 @@ + +radiant_plugin(md3model + ident.h + md2.cpp + md2.h + md3.cpp + md3.h + md3normals.cpp + md3normals.h + md5.cpp + md5.h + mdc.cpp + mdc.h + mdl.cpp + mdl.h + mdlformat.cpp + mdlformat.h + mdlimage.cpp + mdlimage.h + mdlnormals.cpp + mdlnormals.h + model.cpp + model.h + plugin.cpp + plugin.h +) diff --git a/plugins/model/CMakeLists.txt b/plugins/model/CMakeLists.txt new file mode 100644 index 00000000..c40b7249 --- /dev/null +++ b/plugins/model/CMakeLists.txt @@ -0,0 +1,9 @@ + +radiant_plugin(model + model.cpp + model.h + plugin.cpp + plugin.h +) + +target_link_libraries(model picomodel) diff --git a/plugins/sample/CMakeLists.txt b/plugins/sample/CMakeLists.txt new file mode 100644 index 00000000..e20f3ab2 --- /dev/null +++ b/plugins/sample/CMakeLists.txt @@ -0,0 +1,5 @@ + +radiant_plugin(sample + sample.cpp + sample.h +) diff --git a/plugins/shaders/CMakeLists.txt b/plugins/shaders/CMakeLists.txt new file mode 100644 index 00000000..eeb7c24c --- /dev/null +++ b/plugins/shaders/CMakeLists.txt @@ -0,0 +1,7 @@ + +radiant_plugin(shaders + plugin.cpp + plugin.h + shaders.cpp + shaders.h +) diff --git a/plugins/spritemodel/CMakeLists.txt b/plugins/spritemodel/CMakeLists.txt new file mode 100644 index 00000000..8ec0cb2e --- /dev/null +++ b/plugins/spritemodel/CMakeLists.txt @@ -0,0 +1,7 @@ + +radiant_plugin(spritemodel + plugin.cpp + plugin.h + spritemodel.cpp + spritemodel.h +) diff --git a/plugins/textool/CMakeLists.txt b/plugins/textool/CMakeLists.txt new file mode 100644 index 00000000..113e4740 --- /dev/null +++ b/plugins/textool/CMakeLists.txt @@ -0,0 +1,11 @@ + +radiant_plugin(textool + 2DView.cpp + 2DView.h + ControlPointsManager.cpp + ControlPointsManager.h + StdAfx.cpp + StdAfx.h + TexTool.cpp + resource.h +) diff --git a/plugins/vfspk3/CMakeLists.txt b/plugins/vfspk3/CMakeLists.txt new file mode 100644 index 00000000..2b0efc36 --- /dev/null +++ b/plugins/vfspk3/CMakeLists.txt @@ -0,0 +1,11 @@ + +radiant_plugin(vfspk3 + archive.cpp + archive.h + vfs.cpp + vfs.h + vfspk3.cpp + vfspk3.h +) + +target_link_libraries(vfspk3 filematch) diff --git a/radiant/server.cpp b/radiant/server.cpp index bca6baa7..10e9cf73 100644 --- a/radiant/server.cpp +++ b/radiant/server.cpp @@ -152,6 +152,12 @@ typedef int ( *FunctionPointer )(); DynamicLibrary( const char* filename ){ m_library = dlopen( filename, RTLD_NOW ); + if ( !m_library ) + { + globalErrorStream() << "LoadLibrary failed: '" << filename << "'\n"; + if ( const char* error = dlerror() ) + globalErrorStream() << "GetLastError: " << error; + } } ~DynamicLibrary(){ if ( !failed() ) {