Skip to content

Commit

Permalink
more.
Browse files Browse the repository at this point in the history
  • Loading branch information
Troy D. Straszheim committed Nov 21, 2011
1 parent 962a1f1 commit bd27e5a
Show file tree
Hide file tree
Showing 9 changed files with 46 additions and 25 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,6 @@ set(catkin_EXTRAS_DIR ${catkin_EXTRAS_DIR_VALUE} CACHE FILEPATH "catkin extras")

include(${catkin_EXTRAS_DIR}/all.cmake)

find_package(PythonInterp)
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${catkin_EXTRAS_DIR}/python_version.py
OUTPUT_VARIABLE PYTHON_VERSION_XDOTY
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(PYTHON_VERSION_XDOTY ${PYTHON_VERSION_XDOTY})


install_cmake_infrastructure(catkin
VERSION 0.0.7
)
Expand Down
1 change: 1 addition & 0 deletions cmake/all.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ include(${catkin_EXTRAS_DIR}/assert.cmake)
assert(catkin_EXTRAS_DIR)

foreach(f
python
empy
stamp
set_once
Expand Down
5 changes: 2 additions & 3 deletions cmake/catkin-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
set(catkin_INSTALL_PREFIX @CMAKE_INSTALL_PREFIX@)
set(catkin_EXTRAS_DIR @CMAKE_INSTALL_PREFIX@/share/cmake/catkin)
include(${catkin_EXTRAS_DIR}/all.cmake)

set(CATKIN YES CACHE INTERNAL "YES")

if (NOT catkin_FOUND)
#set(CATKIN_PACKAGE_PREFIX "")
#set(CATKIN_LINUX_DISTRIBUTIONS "lucid maverick natty oneiric")
set(catkin_FOUND)

set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH}:${CMAKE_BINARY_DIR}/cmake)

# set(CMAKE_PREFIX_PATH "${CMAKE_BINARY_DIR}/CMAKE_PREFIX_PATH:${CMAKE_PREFIX_PATH}")
endif()
13 changes: 7 additions & 6 deletions cmake/catkin_workspace.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ function(catkin_workspace)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)

em_expand(
${catkin_EXTRAS_DIR}/topologically_traverse.py.in
${CMAKE_CURRENT_BINARY_DIR}/topologically_traverse.py
${catkin_EXTRAS_DIR}/topologically_traverse.cmake.em
${CMAKE_CURRENT_BINARY_DIR}/topologically_traverse.cmake)

foreach(shfile setup.sh setup.zsh setup.bash env.sh)
configure_file(${catkin_EXTRAS_DIR}/${shfile}.in ${CMAKE_BINARY_DIR}/${shfile}
@ONLY)
endforeach()

em_expand(
${catkin_EXTRAS_DIR}/topologically_traverse.py.in
${CMAKE_CURRENT_BINARY_DIR}/topologically_traverse.py
${catkin_EXTRAS_DIR}/topologically_traverse.cmake.em
${CMAKE_CURRENT_BINARY_DIR}/topologically_traverse.cmake
)

endfunction()

10 changes: 8 additions & 2 deletions cmake/enable_python.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
function(enable_python pkg_name)
set(PACKAGE_NAME ${pkg_name})
configure_file(${catkin_EXTRAS_DIR}/__init__.py.in
${CMAKE_BINARY_DIR}/gen/py/${pkg_name}/__init__.py
@ONLY)
${CMAKE_BINARY_DIR}/gen/py/${pkg_name}/__init__.py
@ONLY)
if(EXISTS ${${pkg_name}_SOURCE_DIR}/setup.py)
assert(INSTALLED_PYTHONPATH)
set(CMD "/usr/bin/env PYTHONPATH=${INSTALLED_PYTHONPATH} ${PYTHON_EXECUTABLE} setup.py install --install-layout=deb --prefix=${CMAKE_INSTALL_PREFIX} WORKING_DIRECTORY ${${pkg_name}_SOURCE_DIR}")
install(CODE "message(COMMAND = ${CMD})")
install(CODE "execute_process(COMMAND ${CMD})")
endif()
endfunction()
16 changes: 13 additions & 3 deletions cmake/install_cmake_infrastructure.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ function(install_cmake_infrastructure PACKAGE_NAME)
set(PKG_MSG_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/msg)
set(PKG_CMAKE_DIR ${CMAKE_BINARY_DIR}/cmake)
set(PKG_CMAKE_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
set(PKG_BIN_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/scripts ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(PKG_BIN_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/scripts
${CMAKE_CURRENT_BINARY_DIR}/bin)
set(PKG_LOCATION "Source")

foreach(extra ${PACKAGE_CFG_EXTRAS})
Expand All @@ -42,13 +43,22 @@ function(install_cmake_infrastructure PACKAGE_NAME)
# Versions find_packageable from the buildspace
#
string(TOLOWER ${PACKAGE_NAME} package_lower)
set(_cfgdir ${CMAKE_BINARY_DIR}/CMAKE_PREFIX_PATH/share/cmake/${package_lower})
set(_cfgout ${_cfgdir}/${package_lower}-config.cmake)
log(2 "Writing config to ${_cfgout}")

# THIS IS IMPORTANT. CMAKE_PREFIX_PATH appears to be twitchy: just
# spent hours figuring out that having /opt/ros/fuerte first is
# necessary for this finding to work. Very strange. xxx_DIR
# circumvents this twitchiness.
set(${PACKAGE_NAME}_DIR ${_cfgdir} CACHE FILEPATH "${PACKAGE_NAME} cmake config file dir")
configure_file(${catkin_EXTRAS_DIR}/pkg-config.cmake.in
${CMAKE_BINARY_DIR}/cmake/${package_lower}-config.cmake
${_cfgout}
@ONLY
)

configure_file(${catkin_EXTRAS_DIR}/pkg-config-version.cmake.in
${CMAKE_BINARY_DIR}/cmake/${package_lower}-config-version.cmake
${_cfgdir}/${package_lower}-config-version.cmake
@ONLY
)

Expand Down
5 changes: 2 additions & 3 deletions cmake/pkg-config.cmake.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
if (NOT @PACKAGE_INCLUDE_DIRS@ STREQUAL "")
log(2 "!!! ${CMAKE_CURRENT_LIST_FILE}")
if (NOT "@PACKAGE_INCLUDE_DIRS@" STREQUAL "")
set(@PACKAGE_NAME@_INCLUDE_DIRS @PKG_INCLUDE_PREFIX@/@PACKAGE_INCLUDE_DIRS@)
endif()

Expand Down Expand Up @@ -31,5 +32,3 @@ foreach(extra @PACKAGE_CFG_EXTRAS@)
endforeach()

set(@PACKAGE_NAME@_MSG_INCLUDE_DIRS @PKG_MSG_DIRS@)

set(@PACKAGE_NAME@_FOUND TRUE)
10 changes: 10 additions & 0 deletions cmake/python.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
find_package(PythonInterp)
execute_process(COMMAND ${PYTHON_EXECUTABLE} ${catkin_EXTRAS_DIR}/python_version.py
OUTPUT_VARIABLE PYTHON_VERSION_XDOTY
OUTPUT_STRIP_TRAILING_WHITESPACE)

set(PYTHON_VERSION_XDOTY ${PYTHON_VERSION_XDOTY})
set(INSTALLED_PYTHONPATH ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_VERSION_XDOTY}/dist-packages
CACHE INTERNAL "This needs to be in pythonpath when setup.py install is called. And it needs to match. But setuptools won't tell us where it will install things.")


3 changes: 3 additions & 0 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ Design sketch
poorest taste. Exception: sphinx-generated Makefiles used to
generate documentation.

* ``stack.yaml`` contains everything necessary to to make debian
source packages.


Build Parameters
----------------
Expand Down

0 comments on commit bd27e5a

Please sign in to comment.