Skip to content

Commit

Permalink
Overlaid patches from 'patches'
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Jul 19, 2018
1 parent 6032267 commit b7d92c3
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 0 deletions.
104 changes: 104 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# http://ros.org/doc/groovy/api/catkin/html/user_guide/supposed.html
cmake_minimum_required(VERSION 2.8.3)
project(euslisp)

find_package(catkin)

# check arch and os
execute_process(COMMAND bash -c "gcc -dumpmachine" OUTPUT_VARIABLE gcc_dump_machine OUTPUT_STRIP_TRAILING_WHITESPACE)
message("-- gcc dumpmachine returns ${gcc_dump_machine}")
if(gcc_dump_machine MATCHES "x86_64-linux-.*" OR gcc_dump_machine MATCHES "x86_64-redhat-linux")
set(ARCHDIR "Linux64")
set(MAKEFILE "Makefile.Linux64")
elseif(gcc_dump_machine MATCHES "i686-linux-.*" OR gcc_dump_machine MATCHES "i686-redhat-linux")
set(ARCHDIR "Linux")
set(MAKEFILE "Makefile.Linux.thread")
elseif(gcc_dump_machine MATCHES "arm.*-.*")
set(ARCHDIR "LinuxARM")
set(MAKEFILE "Makefile.LinuxARM")
elseif(gcc_dump_machine MATCHES "aarch64.*-.*")
set(ARCHDIR "LinuxARM")
set(MAKEFILE "Makefile.LinuxARM")
elseif(gcc_dump_machine MATCHES "cygwin.*-.*")
set(ARCHDIR "Cygwin")
set(MAKEFILE "Makefile.Cygwin")
elseif(gcc_dump_machine MATCHES ".*darwin.*")
set(ARCHDIR "Darwin")
set(MAKEFILE "Makefile.Darwin")
else()
message(FATAL_ERROR "-- -- This machine is not supported")
endif()

# build euslisp
add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/lisp/Makefile
COMMAND cmake -E create_symlink ${MAKEFILE} Makefile
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/lisp/)
add_custom_target(compile_euslisp ALL
DEPENDS ${PROJECT_SOURCE_DIR}/lisp/Makefile
COMMAND export EUSDIR=${PROJECT_SOURCE_DIR} lt_cv_sys_lib_dlsearch_path_spec=${lt_cv_sys_lib_dlsearch_path_spec} LD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/${ARCHDIR}/lib:\$LD_LIBRARY_PATH && \$\(MAKE\) -C ${PROJECT_SOURCE_DIR}/lisp -f Makefile EUSRPATH=)

add_custom_target(install_euslisp
COMMAND export EUSDIR=${PROJECT_SOURCE_DIR} lt_cv_sys_lib_dlsearch_path_spec=${lt_cv_sys_lib_dlsearch_path_spec} LD_LIBRARY_PATH=${PROJECT_SOURCE_DIR}/${ARCHDIR}/lib:\$LD_LIBRARY_PATH && ${CMAKE_COMMAND} -E make_directory \${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin && \$\(MAKE\) -C ${PROJECT_SOURCE_DIR}/lisp -f Makefile install PUBBINDIR=\${DESTDIR}${CMAKE_INSTALL_PREFIX}/bin)

install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} --build . --target install_euslisp)")
install(DIRECTORY contrib lib lisp models ${ARCHDIR}
DESTINATION share/euslisp/jskeus/eus/
USE_SOURCE_PERMISSIONS)
install(DIRECTORY doc
DESTINATION share/euslisp/jskeus/eus/
USE_SOURCE_PERMISSIONS
PATTERN "doc/html" EXCLUDE
PATTERN "doc/mails" EXCLUDE
PATTERN "doc/hirukawa" EXCLUDE
PATTERN "doc/help.cltl" EXCLUDE
PATTERN "doc/publications" EXCLUDE
PATTERN "doc/latex/fig" EXCLUDE
PATTERN "doc/jlatex/fig" EXCLUDE
)
install(FILES package.xml DESTINATION share/euslisp/)
install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink lisp/c include WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/share/euslisp/jskeus/eus/)")

catkin_package(CFG_EXTRAS euslisp-extras.cmake)
catkin_add_env_hooks(99.euslisp SHELLS sh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks)

string(REGEX MATCH "catkin" need_catkin "$ENV{_}")
get_filename_component(install_dir_name ${CMAKE_INSTALL_PREFIX} NAME)
if(need_catkin AND NOT install_dir_name MATCHES "install") # check if install_prefix end with /install, we can remove this section of we remove all rosrun euslisp ... usage
install(CODE "
## this is tricky force write catkin marker file
set(_catkin_marker_file \"\${CMAKE_INSTALL_PREFIX}/.catkin\")
# check if the develspace marker file exists yet
if(EXISTS \${_catkin_marker_file})
file(READ \${_catkin_marker_file} _existing_sourcespaces)
if(_existing_sourcespaces STREQUAL \"\")
# write this sourcespace to the marker file
set(_catkin_marker_file_content \" ${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}\") # head space is necessary because it is converted to semicolon.
separate_arguments(_catkin_marker_file_content)
file(APPEND \${_catkin_marker_file} \"${_catkin_marker_file_content}\")
else()
# append to existing list of sourcespaces if it's not in the list
list(FIND _existing_sourcespaces \"${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}\" _existing_sourcespace_index)
if(_existing_sourcespace_index EQUAL -1)
set(_catkin_marker_file_content \" ${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}\") # head space is necessary because it is converted to semicolon.
separate_arguments(_catkin_marker_file_content)
file(APPEND \${_catkin_marker_file} \"${_catkin_marker_file_content}\")
endif()
endif()
else()
# create a new develspace marker file
# NOTE: extra care must be taken when running multiple catkin jobs in parallel
# so that this does not overwrite the result of a similar call in another package
set(_catkin_marker_file_content \" ${CMAKE_INSTALL_PREFIX}/${CATKIN_PACKAGE_SHARE_DESTINATION}\") # head space is necessary because it is converted to semicolon.
separate_arguments(_catkin_marker_file_content)
file(APPEND \${_catkin_marker_file} \"${_catkin_marker_file_content}\")
endif()
")
else()
install(CODE "
file(GLOB catkin_install_files \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/*.py \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/setup.* \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/env.* \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/.ros* \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/.catkin*)
foreach(file \${catkin_install_files})
message(\"Removing: \${file}\")
file(REMOVE \${file})
endforeach()
")
endif()
7 changes: 7 additions & 0 deletions cmake/euslisp-extras.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# euslisp.cmake
set(EUSDIR @CMAKE_INSTALL_PREFIX@/share/euslisp/jskeus/eus)
set(ARCHDIR @ARCHDIR@)
set(euslisp_INCLUDE_DIRS ${EUSDIR}/include)
message("-- set EUSDIR to ${EUSDIR}")
message("-- set ARCHDIR to ${ARCHDIR}")

5 changes: 5 additions & 0 deletions env-hooks/99.euslisp.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export ARCHDIR=@ARCHDIR@
export EUSDIR="@CMAKE_INSTALL_PREFIX@/share/euslisp/jskeus/eus/"
export LD_LIBRARY_PATH=$EUSDIR/$ARCHDIR/lib:$LD_LIBRARY_PATH
export PATH=$EUSDIR/$ARCHDIR/bin:$PATH

42 changes: 42 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<package>
<name>euslisp</name>
<version>9.24.0</version>
<description>EusLisp is an integrated programming system for the
research on intelligent robots based on Common Lisp and
Object-Oriented programming</description>
<maintainer email="[email protected]">Kei Okada</maintainer>

<license>BSD</license>

<url type="website">http://euslisp.github.io/EusLisp/manual.html</url>
<url type="bugtracker">https://github.com/euslisp/EusLisp/issues</url>

<author>Toshihiro Matsui</author>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>opengl</build_depend>
<build_depend>libjpeg</build_depend>
<build_depend>libx11-dev</build_depend>
<build_depend>libxext</build_depend>
<build_depend>libpng-dev</build_depend>
<build_depend>libpq-dev</build_depend>
<build_depend>cmake_modules</build_depend>
<build_depend>mk</build_depend>
<build_depend>xfonts-100dpi</build_depend>
<build_depend>xfonts-75dpi</build_depend>

<run_depend>opengl</run_depend>
<run_depend>libjpeg</run_depend>
<run_depend>libx11-dev</run_depend>
<run_depend>libxext</run_depend>
<run_depend>libpng-dev</run_depend>
<run_depend>libpq-dev</run_depend>
<run_depend>xfonts-100dpi</run_depend>
<run_depend>xfonts-75dpi</run_depend>

<export>
<cpp cflags="-I${prefix}/eus/include"/>
<build_type>cmake</build_type>
</export>
</package>

0 comments on commit b7d92c3

Please sign in to comment.