Revision: 6427
          http://playerstage.svn.sourceforge.net/playerstage/?rev=6427&view=rev
Author:   gbiggs
Date:     2008-05-11 18:43:38 -0700 (Sun, 11 May 2008)

Log Message:
-----------
Fixed module for compiling plugin interfaces so that it actually works now

Modified Paths:
--------------
    code/player/trunk/cmake/UsePlayerPlugin.cmake
    code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt
    
code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in
    code/player/trunk/examples/plugins/exampleinterface/example.cfg
    code/player/trunk/examples/plugins/exampleinterface/example_client.c

Modified: code/player/trunk/cmake/UsePlayerPlugin.cmake
===================================================================
--- code/player/trunk/cmake/UsePlayerPlugin.cmake       2008-05-12 01:22:45 UTC 
(rev 6426)
+++ code/player/trunk/cmake/UsePlayerPlugin.cmake       2008-05-12 01:43:38 UTC 
(rev 6427)
@@ -21,17 +21,17 @@
 # This is slightly different from the one used by the Player build system 
itself.
 # It takes a single file instead of a directory. It also expects 
playerinterfacegen.py
 # to have been installed in the system path (as it should have been with 
Player).
-MACRO (PROCESS_INTERFACES _options _file _outputFile)
+MACRO (PROCESS_INTERFACES _file _outputFile)
     ADD_CUSTOM_COMMAND (OUTPUT ${_outputFile}
-        COMMAND playerinterfacegen.py ${_options} ${_file} > ${_outputFile}
+        COMMAND playerinterfacegen.py ${ARGN} ${_file} > ${_outputFile}
         WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
-        DEPENDS ${_file} ${ARGN}
+        DEPENDS ${_file}
     )
 ENDMACRO (PROCESS_INTERFACES)
 
 MACRO (PROCESS_XDR _interfaceH _xdrH _xdrC)
     ADD_CUSTOM_COMMAND (OUTPUT ${_xdrH} ${_xdrC}
-        COMMAND playerxdrgen.py ${_interfaceH} ${_xdrH} ${_xdrC}
+        COMMAND playerxdrgen.py ${_interfaceH} ${_xdrC} ${_xdrH}
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
         DEPENDS ${_interfaceH})
 ENDMACRO (PROCESS_XDR)
@@ -98,26 +98,28 @@
         MESSAGE (FATAL_ERROR "No sources specified to 
PLAYER_ADD_PLUGIN_INTERFACE. Did you remember to include blank strings for 
unused arguments?")
     ENDIF (NOT ${ARGC} GREATER 6)
 
-    IF (_includeDirs OR PLAYERC_INC_DIR)
-        INCLUDE_DIRECTORIES (${_includeDirs} ${PLAYERC_INC_DIR} 
${CMAKE_CURRENT_BINARY_DIR})
-    ENDIF (_includeDirs OR PLAYERC_INC_DIR)
-    IF (_libDirs OR PLAYERC_LINK_DIR)
-        LINK_DIRECTORIES (${_libDirs} ${PLAYERC_LINK_DIR})
-    ENDIF (_libDirs OR PLAYERC_LINK_DIR)
+    IF (_includeDirs OR PLUGIN_PLAYERC_INC_DIR)
+        INCLUDE_DIRECTORIES (${_includeDirs} ${PLUGIN_PLAYERC_INC_DIR} 
${CMAKE_CURRENT_BINARY_DIR})
+    ENDIF (_includeDirs OR PLUGIN_PLAYERC_INC_DIR)
+    IF (_libDirs OR PLUGIN_PLAYERC_LINK_DIR)
+        LINK_DIRECTORIES (${_libDirs} ${PLUGIN_PLAYERC_LINK_DIR})
+    ENDIF (_libDirs OR PLUGIN_PLAYERC_LINK_DIR)
 
     # Have to generate some source files
     SET (interface_h ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_interface.h)
-    PROCESS_INTERFACES ("--plugin" ${_interfDef} ${interface_h})
+    PROCESS_INTERFACES (${_interfDef} ${interface_h} --plugin)
     SET (functiontable_c 
${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_functiontable.c)
-    PROCESS_INTERFACES ("--plugin --functiontable" ${_interfDef} 
${functiontable_c})
+    PROCESS_INTERFACES (${_interfDef} ${functiontable_c} --plugin 
--functiontable)
+    SET_SOURCE_FILES_PROPERTIES (${functiontable_c} PROPERTIES COMPILE_FLAGS 
${PLUGIN_PLAYERC_CFLAGS})
     SET (xdr_h ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_xdr.h)
     SET (xdr_c ${CMAKE_CURRENT_BINARY_DIR}/${_interfName}_xdr.c)
     PROCESS_XDR (${interface_h} ${xdr_h} ${xdr_c})
+    SET_SOURCE_FILES_PROPERTIES (${xdr_c} PROPERTIES COMPILE_FLAGS 
${PLUGIN_PLAYERC_CFLAGS})
 
     ADD_LIBRARY (${_interfName} SHARED ${interface_h} ${functiontable_c} 
${xdr_h} ${xdr_c} ${ARGN})
     SET_TARGET_PROPERTIES (${_interfName} PROPERTIES
-        LINK_FLAGS ${PLAYERC_LINK_FLAGS} ${_linkFlags}
-        INSTALL_RPATH ${PLAYERC_LIBDIR}
+        LINK_FLAGS ${PLUGIN_PLAYERC_LINK_FLAGS} ${_linkFlags}
+        INSTALL_RPATH ${PLAYERCORE_LIBDIR}
         BUILD_WITH_INSTALL_RPATH TRUE)
 
     # Get the current cflags for each source file, and add the global ones

Modified: code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt
===================================================================
--- code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt  
2008-05-12 01:22:45 UTC (rev 6426)
+++ code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt  
2008-05-12 01:43:38 UTC (rev 6427)
@@ -25,12 +25,12 @@
 )
 
 INCLUDE_DIRECTORIES (${PROJECT_BINARY_DIR} ${PROJECT_SOURCE_DIR}/client_libs 
${CMAKE_CURRENT_BINARY_DIR})
-ADD_LIBRARY (eginterf SHARED ${example_interface_h} ${example_xdr_h} 
${example_xdr_c} eginterf_client.c ${example_functiontable_c})
-TARGET_LINK_LIBRARIES (eginterf playerc)
-ADD_LIBRARY (eginterfdriver SHARED ${example_interface_h} ${example_xdr_h} 
eginterf_driver.cc)
-TARGET_LINK_LIBRARIES (eginterfdriver playercore)
+ADD_LIBRARY (example SHARED ${example_interface_h} ${example_xdr_h} 
${example_xdr_c} eginterf_client.c ${example_functiontable_c})
+TARGET_LINK_LIBRARIES (example playerc)
+ADD_LIBRARY (example_driver SHARED ${example_interface_h} ${example_xdr_h} 
eginterf_driver.cc)
+TARGET_LINK_LIBRARIES (example_driver playercore)
 ADD_EXECUTABLE (example_client example_client.c ${example_interface_h})
-TARGET_LINK_LIBRARIES (example_client playerc playerxdr playererror 
${PLAYERC_EXTRA_LINK_LIBRARIES} eginterf)
+TARGET_LINK_LIBRARIES (example_client playerc playerxdr playererror 
${PLAYERC_EXTRA_LINK_LIBRARIES} example)
 
 SET (exampleCMakeLists_in 
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt.example.in)
 SET (exampleCMakeLists ${CMAKE_CURRENT_BINARY_DIR}/CMakeLists.txt.example)

Modified: 
code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in
===================================================================
--- 
code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in   
    2008-05-12 01:22:45 UTC (rev 6426)
+++ 
code/player/trunk/examples/plugins/exampleinterface/CMakeLists.txt.example.in   
    2008-05-12 01:43:38 UTC (rev 6427)
@@ -5,7 +5,8 @@
 INCLUDE (UsePlayerPlugin)
 INCLUDE (UsePlayerC)
 
-PLAYER_ADD_PLUGIN_INTERFACE (eginterf 128_example.def "" "" "" "" 
eginterf_client.c)
+PLAYER_ADD_PLUGIN_INTERFACE (example 128_example.def "" "" "" "" 
eginterf_client.c)
 # Note the use of files generated during the PLAYER_ADD_PLUGIN_INTERFACE step
-PLAYER_ADD_PLUGIN_DRIVER (eginterf_driver "" "" "" "" eginterf_driver.cc 
eginterf_interface.h eginterf_xdr.h)
-PLAYER_ADD_PLAYERC_CLIENT (example_client "" "" "" "" example_client.c 
eginterf_interface.h)
\ No newline at end of file
+PLAYER_ADD_PLUGIN_DRIVER (example_driver "" "" "" "" eginterf_driver.cc 
example_interface.h example_xdr.h)
+PLAYER_ADD_PLAYERC_CLIENT (example_client "" "" "" "" example_client.c 
example_interface.h)
+TARGET_LINK_LIBRARIES (example_client example)
\ No newline at end of file

Modified: code/player/trunk/examples/plugins/exampleinterface/example.cfg
===================================================================
--- code/player/trunk/examples/plugins/exampleinterface/example.cfg     
2008-05-12 01:22:45 UTC (rev 6426)
+++ code/player/trunk/examples/plugins/exampleinterface/example.cfg     
2008-05-12 01:43:38 UTC (rev 6427)
@@ -5,12 +5,12 @@
 (
   name "example"
   code 128
-  plugin "libeginterf"
+  plugin "libexample"
 )
 
 driver
 (
   name "eginterfdriver"
-  plugin "libeginterfdriver"
+  plugin "libexample_driver"
   provides ["example:0"]
 )

Modified: code/player/trunk/examples/plugins/exampleinterface/example_client.c
===================================================================
--- code/player/trunk/examples/plugins/exampleinterface/example_client.c        
2008-05-12 01:22:45 UTC (rev 6426)
+++ code/player/trunk/examples/plugins/exampleinterface/example_client.c        
2008-05-12 01:43:38 UTC (rev 6427)
@@ -29,10 +29,11 @@
                return -1;
        }
 
+       // Load the plugin interface
        if (playerc_add_xdr_ftable (player_plugininterf_gettable (), 0) < 0)
                printf ("Could not add xdr functions\n");
 
-       // Create and subscribe to a position2d device.
+       // Create and subscribe to a device using the interface.
        device = eginterf_create(client, 0);
        if (eginterf_subscribe(device, PLAYER_OPEN_MODE) != 0)
        {


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to