Commit 77579eb3 authored by Nicolas Van der Noot's avatar Nicolas Van der Noot
Browse files

recursive iterative separate symbolic

parent de0420ea
......@@ -97,7 +97,7 @@ if (NOT FLAG_SEPARATE_SYMBOLIC)
increment_src( ${PROJECT_SOURCE_DIR}/../symbolicR )
endif ( )
increment_void_symbolic(symbolicR)
increment_void_symbolic( symbolicR )
# list include directories (to find headers)
......@@ -186,15 +186,12 @@ endif ( )
# separate symbolic files compilation
if ( FLAG_SEPARATE_SYMBOLIC )
set ( SYMBOLIC_PATH symbolicR )
find_package( LibSymbolicR REQUIRED )
target_link_libraries( ${Executable} ${LIB_PROJ_SYMB} )
endif ( )
# math external library (for Unix)
if (UNIX)
target_link_libraries ( ${Executable} m )
endif ( )
......@@ -19,7 +19,7 @@ function(list_files arg0 arg1 arg2)
string(REPLACE ${arg2} "" END_FILE ${FILE_PATH})
string(FIND ${END_FILE} "build" BUILD_PLACE)
if (${BUILD_PLACE} LESS 0)
set(CUR_DIR_LIST ${CUR_DIR_LIST} ${FILE_PATH})
set(CUR_DIR_LIST ${CUR_DIR_LIST} ${FILE_PATH})
endif ()
endforeach(FILE_PATH)
set(${arg0} ${CUR_DIR_LIST} PARENT_SCOPE)
......@@ -107,68 +107,68 @@ endfunction()
function(increment_void_symbolic arg0)
set(VOID_SYMBOLIC "")
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_cons_hJ*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_cons_hJ not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_cons_hJ_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_cons_jdqd*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_cons_jdqd not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_cons_jdqd_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_dirdyna*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_dirdyna not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_dirdyna_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_accelred*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_accelred not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_accelred_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_extforces*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_extforces not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_extforces_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_gensensor*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_gensensor not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_gensensor_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_invdyna*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_invdyna not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_invdyna_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_link*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_link not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_link_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_link3D*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_link3D not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_link3D_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_sensor*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_sensor not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_sensor_void.c)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${VOID_SYMBOLIC} PARENT_SCOPE)
set(VOID_SYMBOLIC "")
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_cons_hJ*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_cons_hJ not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_cons_hJ_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_cons_jdqd*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_cons_jdqd not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_cons_jdqd_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_dirdyna*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_dirdyna not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_dirdyna_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_accelred*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_accelred not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_accelred_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_extforces*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_extforces not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_extforces_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_gensensor*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_gensensor not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_gensensor_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_invdyna*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_invdyna not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_invdyna_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_link*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_link not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_link_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_link3D*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_link3D not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_link3D_void.c)
endif()
file(GLOB SYMBOLIC_FILES "${PROJECT_SOURCE_DIR}/../${arg0}/mbs_sensor*")
if (NOT SYMBOLIC_FILES)
message("Symbolic mbs_sensor not found, linking to void function")
set(VOID_SYMBOLIC ${VOID_SYMBOLIC} ${ROBOTRAN_SOURCE_DIR}/mbs_common/mbs_void_symbolicR/mbs_sensor_void.c)
endif()
set(SOURCE_FILES ${SOURCE_FILES} ${VOID_SYMBOLIC} PARENT_SCOPE)
endfunction()
......@@ -10,6 +10,7 @@ function(make_options)
if (UNIX)
# general variables
set( SCRIPTS_PATH ${ROBOTRAN_SOURCE_DIR}/cmake_aux/scripts )
# scripts executable
......@@ -35,10 +36,10 @@ function(make_options)
add_custom_target(dyn_clean COMMAND ${CMAKE_COMMAND} -E chdir ${SCRIPTS_PATH} ./dyn_build ${ROBOTRAN_SOURCE_DIR} "clean")
# symb_stat
add_custom_target(symb_stat COMMAND ${CMAKE_COMMAND} -E chdir ${SCRIPTS_PATH} ./stat_symbolic ${PROJECT_SOURCE_DIR}/../symbolicR)
add_custom_target(symb_stat COMMAND ${CMAKE_COMMAND} -P ${SCRIPTS_PATH}/iterative_symb ${PROJECT_SOURCE_DIR} ${ROBOTRAN_SOURCE_DIR})
# symb_clean
add_custom_target(symb_clean COMMAND ${CMAKE_COMMAND} -E chdir ${SCRIPTS_PATH} ./stat_symbolic ${PROJECT_SOURCE_DIR}/../symbolicR "clean")
add_custom_target(symb_clean COMMAND ${CMAKE_COMMAND} -P ${SCRIPTS_PATH}/iterative_symb ${PROJECT_SOURCE_DIR} ${ROBOTRAN_SOURCE_DIR} "clean")
endif ( )
......
......@@ -18,7 +18,10 @@ else
fi
# create empty directory
rm -r $1/build/
if [ -d $1/build/ ]
then
rm -r $1/build/
fi
mkdir $1/build/
# generate CMake project
......
......@@ -17,11 +17,11 @@ else
exit
fi
# create empty directory
rm -r $1/build/
if [ -d $1/build/ ]
then
rm -r $1/build/
fi
mkdir $1/build/
# generate CMake project
......
......@@ -28,6 +28,7 @@ ELSE (APPLE)
# possible paths for: 'libMBproj_symbolicR.a'
SET(TRIAL_PATHS_LIB_PROJ_SYMB
"${PROJECT_SOURCE_DIR}/../${SYMBOLIC_PATH}/build"
"${PROJECT_SOURCE_DIR}/../symbolicR/build"
)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment