Revision: 7243 http://playerstage.svn.sourceforge.net/playerstage/?rev=7243&view=rev Author: rtv Date: 2009-01-05 03:24:04 +0000 (Mon, 05 Jan 2009)
Log Message: ----------- applied Geoff Bigg's CMake patch to resolve FLTK link issues on various platforms. Thanks Geoff. Modified Paths: -------------- code/stage/trunk/CMakeLists.txt code/stage/trunk/examples/ctrl/CMakeLists.txt code/stage/trunk/libstage/CMakeLists.txt code/stage/trunk/libstageplugin/CMakeLists.txt code/stage/trunk/worlds/benchmark/CMakeLists.txt Modified: code/stage/trunk/CMakeLists.txt =================================================================== --- code/stage/trunk/CMakeLists.txt 2009-01-05 03:07:38 UTC (rev 7242) +++ code/stage/trunk/CMakeLists.txt 2009-01-05 03:24:04 UTC (rev 7243) @@ -93,6 +93,16 @@ MESSAGE( FATAL_ERROR "Cannot find fltk-config, aborting" ) ENDIF( NOT FLTK_CONFIG) + +OPTION (LINK_FLTK_STATICALLY "Link to the FLTK libraries statically" OFF) +IF (LINK_FLTK_STATICALLY) + SET (FLTK_CONFIG_CMD "--ldstaticflags") + MESSAGE (STATUS "Linking to FLTK statically.") +ELSE (LINK_FLTK_STATICALLY) + SET (FLTK_CONFIG_CMD "--ldflags") + MESSAGE (STATUS "Linking to FLTK dynamically.") +ENDIF (LINK_FLTK_STATICALLY) + EXECUTE_PROCESS ( COMMAND ${FLTK_CONFIG} --version OUTPUT_VARIABLE FLTK_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE ) @@ -100,7 +110,7 @@ EXECUTE_PROCESS ( COMMAND ${FLTK_CONFIG} --use-gl --use-images --cxxflags OUTPUT_VARIABLE FLTK_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ) -EXECUTE_PROCESS ( COMMAND ${FLTK_CONFIG} --use-gl --use-images --ldstaticflags +EXECUTE_PROCESS ( COMMAND ${FLTK_CONFIG} --use-gl --use-images ${FLTK_CONFIG_CMD} OUTPUT_VARIABLE FLTK_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE ) EXECUTE_PROCESS ( COMMAND ${FLTK_CONFIG} --use-gl --use-images --libs Modified: code/stage/trunk/examples/ctrl/CMakeLists.txt =================================================================== --- code/stage/trunk/examples/ctrl/CMakeLists.txt 2009-01-05 03:07:38 UTC (rev 7242) +++ code/stage/trunk/examples/ctrl/CMakeLists.txt 2009-01-05 03:24:04 UTC (rev 7243) @@ -10,9 +10,11 @@ # create a library module for each plugin and link libstage to each + foreach( PLUGIN ${PLUGINS} ) ADD_LIBRARY( ${PLUGIN} MODULE ${PLUGIN}.cc ) TARGET_LINK_LIBRARIES( ${PLUGIN} stage ) + set_source_files_properties( ${PLUGIN}.cc PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" ) endforeach( PLUGIN ) # delete the "lib" prefix from the plugin libraries Modified: code/stage/trunk/libstage/CMakeLists.txt =================================================================== --- code/stage/trunk/libstage/CMakeLists.txt 2009-01-05 03:07:38 UTC (rev 7242) +++ code/stage/trunk/libstage/CMakeLists.txt 2009-01-05 03:24:04 UTC (rev 7243) @@ -71,6 +71,8 @@ add_executable( stagetest ${stagetestSrcs} ) target_link_libraries( stagetest stage ) +set_target_properties( stagetest PROPERTIES LINK_FLAGS "${FLTK_LDFLAGS}" ) +set_source_files_properties( ${stagetestSrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" ) INSTALL(TARGETS stagebinary stage Modified: code/stage/trunk/libstageplugin/CMakeLists.txt =================================================================== --- code/stage/trunk/libstageplugin/CMakeLists.txt 2009-01-05 03:07:38 UTC (rev 7242) +++ code/stage/trunk/libstageplugin/CMakeLists.txt 2009-01-05 03:24:04 UTC (rev 7243) @@ -28,6 +28,8 @@ ) +set_source_files_properties( ${stagepluginSrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" ) + IF (BUILD_LSPTEST) ADD_SUBDIRECTORY(test) ENDIF (BUILD_LSPTEST) Modified: code/stage/trunk/worlds/benchmark/CMakeLists.txt =================================================================== --- code/stage/trunk/worlds/benchmark/CMakeLists.txt 2009-01-05 03:07:38 UTC (rev 7242) +++ code/stage/trunk/worlds/benchmark/CMakeLists.txt 2009-01-05 03:24:04 UTC (rev 7243) @@ -1,5 +1,6 @@ SET( expandSrcs expand.cc ) ADD_LIBRARY( expand MODULE ${expandSrcs} ) TARGET_LINK_LIBRARIES( expand stage ) +set_source_files_properties( ${expandSrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" ) SET_TARGET_PROPERTIES( expand PROPERTIES PREFIX "" ) INSTALL( TARGETS expand DESTINATION lib) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ _______________________________________________ Playerstage-commit mailing list Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit