Added application_ and example_ before application and example projects.

Converted the application CMakeLists.txt and macros to work with the ADD_OSG_APPLICATION macro.

Removed the GDAL checks in the examples/CMakeLists.txt
This commit is contained in:
Robert Osfield 2007-03-09 13:47:37 +00:00
parent d4303ceb73
commit 1fd22b8722
3 changed files with 42 additions and 41 deletions

View File

@ -98,59 +98,62 @@ ENDMACRO(ADD_OSG_LIB)
MACRO(ADD_OSG_APP SUBDIR)
SET(TARGET "${SUBDIR}_app")
FILE(GLOB APP_SRC ${OPENSCENEGRAPH_DIR}/applications/${SUBDIR}/*.cpp)
FILE(GLOB APP_H ${OPENSCENEGRAPH_DIR}/applications/${SUBDIR}/*.h)
ADD_EXECUTABLE(${TARGET} ${APP_SRC} ${APP_H})
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES OUTPUT_NAME ${SUBDIR})
MESSAGE(STATUS "adding osg app ${TARGET}")
#orig#TARGET_LINK_LIBRARIES(${TARGET} osg osgDB osgUtil osgProducer ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5})
# IF(UNIX)
# MESSAGE("so no qui!!!!!!!!!!")
FOREACH(LINKLIB osg osgDB osgGA osgUtil osgText OpenThreads ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5})
MACRO(ADD_OSG_APPLICATION SUBDIR)
#PROJECT("application_${SUBDIR}")
SET(MYTARGET application_${SUBDIR})
FILE(GLOB APPLICATION_SRC ${OPENSCENEGRAPH_APPLICATION_DIR}/${SUBDIR}/*.cpp)
FILE(GLOB APPLICATION_H ${OPENSCENEGRAPH_APPLICATION_DIR}/${SUBDIR}/*.h)
IF(NOT APPLICATION_SRC)
MESSAGE("application_${SUBDIR}")
ELSE(NOT APPLICATION_SRC)
ADD_EXECUTABLE(${MYTARGET} ${APPLICATION_SRC} ${APPLICATION_H})
ENDIF(NOT APPLICATION_SRC)
SET_TARGET_PROPERTIES(${MYTARGET} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
SET_TARGET_PROPERTIES(${MYTARGET} PROPERTIES OUTPUT_NAME ${SUBDIR})
#IF(UNIX)
# MESSAGE("so no qui!!!!!!!!!!")
FOREACH(LINKLIB osg osgDB osgUtil osgViewer osgText osgGA OpenThreads ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5})
IF(${LINKLIB} MATCHES "osg")
#MESSAGE("TARGET_LINK_LIBRARIES(${TARGET} ${LINKLIB}")
TARGET_LINK_LIBRARIES(${TARGET} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
#MESSAGE("TARGET_LINK_LIBRARIES(${MYTARGET} ${LINKLIB}")
TARGET_LINK_LIBRARIES(${MYTARGET} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ELSE(${LINKLIB} MATCHES "osg")
IF(${LINKLIB} MATCHES "Producer")
#MESSAGE("TARGET_LINK_LIBRARIES(${MYTARGET} ${LINKLIB}")
TARGET_LINK_LIBRARIES(${TARGET} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
TARGET_LINK_LIBRARIES(${MYTARGET} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ELSE(${LINKLIB} MATCHES "Producer")
IF(${LINKLIB} MATCHES "OpenThreads")
#MESSAGE("TARGET_LINK_LIBRARIES(${MYTARGET} ${LINKLIB}")
IF(MSVC)
TARGET_LINK_LIBRARIES(${TARGET} optimized "${LINKLIB}Win32" debug "${LINKLIB}Win32d" )
#change in name from standar VS projects TARGET_LINK_LIBRARIES(${MYTARGET} optimized "${LINKLIB}Win32" debug "${LINKLIB}Win32d" )
TARGET_LINK_LIBRARIES(${MYTARGET} optimized "${LINKLIB}" debug "${LINKLIB}d" )
ELSE(MSVC)
TARGET_LINK_LIBRARIES(${TARGET} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ENDIF(MSVC)
TARGET_LINK_LIBRARIES(${MYTARGET} optimized ${LINKLIB} debug "${LINKLIB}${CMAKE_DEBUG_POSTFIX}")
ENDIF(MSVC)
ELSE(${LINKLIB} MATCHES "OpenThreads")
#MESSAGE("EXTERNAL LIB:TARGET_LINK_LIBRARIES(${MYTARGET} ${LINKLIB}")
TARGET_LINK_LIBRARIES(${MYTARGET} ${LINKLIB} )
ENDIF(${LINKLIB} MATCHES "OpenThreads")
ENDIF(${LINKLIB} MATCHES "Producer")
ENDIF(${LINKLIB} MATCHES "osg")
ENDFOREACH(LINKLIB)
# ELSE(UNIX)
# TARGET_LINK_LIBRARIES(${TARGET} osg osgDB osgUtil osgProducer ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5})
# ENDIF(UNIX)
SET_TARGET_PROPERTIES(${TARGET} PROPERTIES PROJECT_LABEL "Application ${TARGET}")
SET_TARGET_PROPERTIES(${MYTARGET} PROPERTIES DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
#speed#TARGET_LOCATIONS_ACCUM(${TARGET})
MESSAGE(STATUS "install_target->${TARGET}<--")
#old form#INSTALL_TARGETS(/bin ${TARGET} )
INSTALL(TARGETS ${TARGET} RUNTIME DESTINATION bin )
ENDMACRO(ADD_OSG_APP)
#ELSE(UNIX)
# TARGET_LINK_LIBRARIES(${MYTARGET} osg osgDB osgUtil osgProducer ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5})
#ENDIF(UNIX)
SET_TARGET_PROPERTIES(${MYTARGET} PROPERTIES PROJECT_LABEL "application ${SUBDIR}")
#speed#TARGET_LOCATIONS_ACCUM(${MYTARGET})
#MESSAGE(STATUS "adding osg application ${MYTARGET}")
##INSTALL_TARGETS(/bin ${MYTARGET} )
INSTALL(TARGETS ${MYTARGET} RUNTIME DESTINATION bin )
ENDMACRO(ADD_OSG_APPLICATION)
MACRO(ADD_OSG_EXAMPLE SUBDIR)
#PROJECT("Example_${SUBDIR}")
SET(MYTARGET ${SUBDIR}_example)
#PROJECT("example_${SUBDIR}")
SET(MYTARGET example_${SUBDIR})
FILE(GLOB EXAMPLE_SRC ${OPENSCENEGRAPH_EXAMPLE_DIR}/${SUBDIR}/*.cpp)
FILE(GLOB EXAMPLE_H ${OPENSCENEGRAPH_EXAMPLE_DIR}/${SUBDIR}/*.h)
IF(NOT EXAMPLE_SRC)
MESSAGE("Example_${SUBDIR}")
MESSAGE("example_${SUBDIR}")
ELSE(NOT EXAMPLE_SRC)
ADD_EXECUTABLE(${MYTARGET} ${EXAMPLE_SRC} ${EXAMPLE_H})
ENDIF(NOT EXAMPLE_SRC)
@ -185,7 +188,7 @@ MACRO(ADD_OSG_EXAMPLE SUBDIR)
#ELSE(UNIX)
# TARGET_LINK_LIBRARIES(${MYTARGET} osg osgDB osgUtil osgProducer ${ARGV1} ${ARGV2} ${ARGV3} ${ARGV4} ${ARGV5})
#ENDIF(UNIX)
SET_TARGET_PROPERTIES(${MYTARGET} PROPERTIES PROJECT_LABEL "Example ${SUBDIR}")
SET_TARGET_PROPERTIES(${MYTARGET} PROPERTIES PROJECT_LABEL "example ${SUBDIR}")
#speed#TARGET_LOCATIONS_ACCUM(${MYTARGET})
#MESSAGE(STATUS "adding osg example ${MYTARGET}")

View File

@ -11,7 +11,7 @@ IF(NOT OSGCORE_BUNDLED)
ENDIF(OSGCORE_FOUND)
SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/../../Macros)
ENDIF(NOT OSGCORE_BUNDLED)
SET(OPENSCENEGRAPH_EXAMPLE_DIR ${PROJECT_SOURCE_DIR})
SET(OPENSCENEGRAPH_APPLICATION_DIR ${PROJECT_SOURCE_DIR})
SET(EXAMPLES_EXE_PATH ${PROJECT_BINARY_DIR}/bin)
MAKE_DIRECTORY(${EXAMPLES_EXE_PATH})
@ -20,10 +20,10 @@ SET(EXECUTABLE_OUTPUT_PATH ${EXAMPLES_EXE_PATH})
INCLUDE(OsgMacroUtils)
ADD_OSG_EXAMPLE( osgviewer )
ADD_OSG_EXAMPLE( osgarchive )
ADD_OSG_EXAMPLE( osgconv )
ADD_OSG_EXAMPLE( osgversion )
ADD_OSG_APPLICATION( osgviewer )
ADD_OSG_APPLICATION( osgarchive )
ADD_OSG_APPLICATION( osgconv )
ADD_OSG_APPLICATION( osgversion )
#MESSAGE("---->${MY_EXAMPLE_LIST}<---------")

View File

@ -85,9 +85,7 @@ ADD_OSG_EXAMPLE( osgsimple )
#ADD_OSG_EXAMPLE( osgsimpleviewerXXX )
##################################################
ADD_OSG_EXAMPLE( osgsimplifier )
#IF(GDAL_FOUND)
# ADD_OSG_EXAMPLE( osgsimulation osgSim osgTerrain Producer osgGA)
#ENDIF(GDAL_FOUND)
ADD_OSG_EXAMPLE( osgsimulation osgSim osgGA)
ADD_OSG_EXAMPLE( osgslice )
ADD_OSG_EXAMPLE( osgspacewarp )
ADD_OSG_EXAMPLE( osgspheresegment osgSim osgParticle)