Skip to content

Commit

Permalink
(sample/CMakeLists.txt) compile wrl file to collada model
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Aug 28, 2014
1 parent 825d5d0 commit 82f4102
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions sample/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,22 @@ if(OPENRTM_VERSION STREQUAL OPENRTM_VERSION100 OR OPENRTM_VERSION STREQUAL OPENR
add_subdirectory(JoystickControl)
endif()

if( COLLADA_DOM_FOUND )
file(GLOB_RECURSE _wrlfiles *.wrl)
foreach(_wrlfile ${_wrlfiles})
string(REGEX REPLACE ".wrl$" ".dae" _daefile ${_wrlfile})
file(STRINGS ${_wrlfile} _robotmodel REGEX "DEF .* Humanoid")
if(NOT _robotmodel STREQUAL "")
add_custom_command(OUTPUT ${_daefile}
COMMAND ../bin/export-collada -i ${_wrlfile} -o ${_daefile}
DEPENDS ../bin/export-collada ${_wrlfile})
string(REGEX REPLACE "\\." "_" _daefile_target ${_daefile})
string(REGEX REPLACE "/" "_" _daefile_target ${_daefile_target})
add_custom_target(export_collada_${_daefile_target} ALL DEPENDS ${_daefile})
endif()
endforeach()
endif()

install(DIRECTORY model project script
DESTINATION ${RELATIVE_SAMPLE_INSTALL_PATH}
PATTERN ".svn" EXCLUDE PATTERN "mockup" EXCLUDE)

0 comments on commit 82f4102

Please sign in to comment.