Permalink
Browse files

stage: applied gbiggs's patch to fix '[ 2021110 ] Stage 3 doesn't use…

… fltk-config output', several other build tweaks
  • Loading branch information...
1 parent 0922512 commit 75c61e53814869cb427b645d3127b1bfb0bcf07d jeremy_asher committed Jul 18, 2008
Showing with 50 additions and 42 deletions.
  1. +5 −5 CMakeLists.txt
  2. +5 −5 examples/ctrl/CMakeLists.txt
  3. +38 −31 libstage/CMakeLists.txt
  4. +2 −1 worlds/benchmark/CMakeLists.txt
View
10 CMakeLists.txt
@@ -68,7 +68,7 @@ IF (FLTKCONFIG)
OUTPUT_VARIABLE FLTK_CFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
EXECUTE_PROCESS (COMMAND fltk-config --ldflags --use-gl --use-images
- OUTPUT_VARIABLE FLTK_LIBRARIES
+ OUTPUT_VARIABLE FLTK_LDFLAGS
OUTPUT_STRIP_TRAILING_WHITESPACE)
MESSAGE (STATUS "Found FLTK")
SET (FLTK_FOUND TRUE)
@@ -89,17 +89,17 @@ ENDIF (APPLE)
include_directories( .
libstage
replace
- /opt/local/include/
- ${GLIB_INCLUDE_DIRS}
- ${LIBPNG_INCLUDE_DIRS}
+ /opt/local/include/
+ ${GLIB_INCLUDE_DIRS}
+ ${LIBPNG_INCLUDE_DIRS}
${CMAKE_INCLUDE_PATH}
)
# all targets need these library directories
link_directories(${GLIB_LIBRARY_DIRS}
${LIBPNG_LIBRARY_DIRS}
- ${OPENGL_LIBRARY_DIRS}
+ ${OPENGL_LIBRARY_DIRS}
)
# work through these subdirs
View
10 examples/ctrl/CMakeLists.txt
@@ -1,9 +1,9 @@
-SET( PLUGINS
- fasr
- lasernoise
- sink
- source
+SET( PLUGINS
+ fasr
+ lasernoise
+ sink
+ source
wander
)
View
69 libstage/CMakeLists.txt
@@ -1,46 +1,52 @@
-
-add_library(stage SHARED
- ancestor.cc
- block.cc
+set( stageSrcs ancestor.cc
+ block.cc
camera.cc
- canvas.cc
+ canvas.cc
file_manager.cc
file_manager.hh
- gl.cc
- glcolorstack.cc
- model.cc
+ gl.cc
+ glcolorstack.cc
+ model.cc
model_blinkenlight.cc
- model_blobfinder.cc
- model_callbacks.cc
- model_camera.cc
- model_fiducial.cc
- model_laser.cc
- model_load.cc
- model_position.cc
- model_props.cc
- model_ranger.cc
+ model_blobfinder.cc
+ model_callbacks.cc
+ model_camera.cc
+ model_fiducial.cc
+ model_laser.cc
+ model_load.cc
+ model_position.cc
+ model_props.cc
+ model_ranger.cc
option.cc
option.hh
options_dlg.cc
options_dlg.hh
resource.cc
- stage.cc
+ stage.cc
stage.hh
texture_manager.cc
- typetable.cc
- world.cc
- worldfile.cc
+ typetable.cc
+ world.cc
+ worldfile.cc
worldgui.cc
)
+add_library(stage SHARED ${stageSrcs})
+
target_link_libraries( stage
${GLIB_LIBRARIES}
${OPENGL_LIBRARIES}
- ${FLTK_LIBRARIES}
${APPLE_LIBRARIES}
ltdl
)
+# When linking stage, pass LDFLAGS from fltk-config
+# use quotes to prevent spaces being parsed as a list of properties
+set_target_properties( stage PROPERTIES LINK_FLAGS "${FLTK_LDFLAGS}" )
+
+# When compiling stageSrcs, pass CFLAGS from fltk-config
+set_source_files_properties( ${stageSrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" )
+
# for the config.h
include_directories(${PROJECT_BINARY_DIR})
@@ -49,26 +55,27 @@ set_target_properties( stage PROPERTIES
VERSION ${VERSION}
)
+set( stagebinarySrcs main.cc )
-add_executable( stagebinary main.cc )
-
-set_target_properties( stagebinary PROPERTIES
- OUTPUT_NAME stage
-)
+add_executable( stagebinary ${stagebinarySrcs} )
+# When compiling stagebinarySrcs, pass CFLAGS from fltk-config
+set_source_files_properties( ${stagebinarySrcs} PROPERTIES COMPILE_FLAGS "${FLTK_CFLAGS}" )
set_target_properties( stagebinary PROPERTIES
- OUTPUT_NAME stage
+ OUTPUT_NAME stage
)
-target_link_libraries( stagebinary stage )
+target_link_libraries( stagebinary stage )
+
+set( stagetestSrcs test.cc )
-add_executable( stagetest test.cc )
+add_executable( stagetest ${stagetestSrcs} )
target_link_libraries( stagetest stage )
INSTALL(TARGETS stagebinary stage
- RUNTIME DESTINATION bin
+ RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
)
View
3 worlds/benchmark/CMakeLists.txt
@@ -1,4 +1,5 @@
-ADD_LIBRARY( expand MODULE expand.cc )
+SET( expandSrcs expand.cc )
+ADD_LIBRARY( expand MODULE ${expandSrcs} )
TARGET_LINK_LIBRARIES( expand stage )
SET_TARGET_PROPERTIES( expand PROPERTIES PREFIX "" )
INSTALL( TARGETS expand DESTINATION lib)

0 comments on commit 75c61e5

Please sign in to comment.