forked from orocos-toolchain/rtt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First take at cmake cleanup and refactoring
* Removed old/dead/suspicious cmake code * Put all dependency checking in FindX.cmake macros This breaks CORBA and .pc file generation
- Loading branch information
Peter Soetens
committed
Jun 4, 2009
1 parent
62eee46
commit a10984e
Showing
7 changed files
with
244 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
# This macro is a dirty hack, Orocos specific. Don't base your macros on it, look into the other | ||
# Find*cmake files for better examples | ||
|
||
# This script creates the following variables: | ||
# Ecos_FOUND: Boolean that indicates if the package was found | ||
# Ecos_INCLUDE_DIRS: Paths to the necessary header files | ||
# Ecos_LIBRARIES: Package libraries | ||
|
||
set(ECOS_INSTALL_DIR ${ECOS_INSTALL_DIR} CACHE PATH "path to ecos installation dir" FORCE) | ||
|
||
if (ECOS_INSTALL_DIR STREQUAL "") | ||
set(ECOS_INSTALL_DIR "/opt/ecos/install") | ||
endif (ECOS_INSTALL_DIR STREQUAL "") | ||
|
||
if(EXISTS ${ECOS_INSTALL_DIR}/include/pkgconf/system.h) | ||
message("-- Looking for ECOS - found in ${ECOS_INSTALL_DIR}") | ||
set(ECOS_FOUND TRUE) | ||
set(ECOS_INCLUDE_DIRS ${ECOS_INSTALL_DIR}/include ) | ||
set(ECOS_LIBRARIES -L${ECOS_INSTALL_DIR}/lib -ltarget ) | ||
else() | ||
message(FATAL_ERROR "-- Looking for ECOS - not found (tried: ${ECOS_INSTALL_DIR}/include/pkgconf/system.h)") | ||
set(ECOS_FOUND FALSE) | ||
ENDIF() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
################################################################################ | ||
# | ||
# CMake script for finding RTAI/LXRT. | ||
# If the optional RTAI_ROOT_DIR environment variable exists, header files and | ||
# libraries will be searched in the RTAI_ROOT_DIR/include and RTAI_ROOT_DIR/lib | ||
# directories, respectively. Otherwise the default CMake search process will be | ||
# used. | ||
# | ||
# This script creates the following variables: | ||
# RTAI_FOUND: Boolean that indicates if the package was found | ||
# RTAI_INCLUDE_DIRS: Paths to the necessary header files | ||
# RTAI_LIBRARIES: Package libraries | ||
# | ||
################################################################################ | ||
|
||
include(LibFindMacros) | ||
|
||
# Get hint from environment variable (if any) | ||
if(NOT $ENV{RTAI_ROOT_DIR} STREQUAL "") | ||
set(RTAI_ROOT_DIR $ENV{RTAI_ROOT_DIR} CACHE PATH "RTAI base directory location (optional, used for nonstandard installation paths)" FORCE) | ||
mark_as_advanced(RTAI_ROOT_DIR) | ||
endif() | ||
|
||
# Header files to find | ||
set(header_NAME rtai_lxrt.h) | ||
|
||
# Libraries to find | ||
set(rtai_NAME lxrt) | ||
|
||
# Find headers and libraries | ||
if(RTAI_ROOT_DIR) | ||
# Use location specified by environment variable | ||
find_path(RTAI_INCLUDE_DIR NAMES ${header_NAME} PATHS ${RTAI_ROOT_DIR}/include PATH_SUFFIXES rtai NO_DEFAULT_PATH) | ||
find_library(RTAI_LIBRARY NAMES ${rtai_NAME} PATHS ${RTAI_ROOT_DIR}/lib NO_DEFAULT_PATH) | ||
else() | ||
# Use default CMake search process | ||
find_path(RTAI_INCLUDE_DIR NAMES ${header_NAME} PATH_SUFFIXES rtai ) | ||
find_library(RTAI_LIBRARY NAMES ${rtai_NAME}) | ||
endif() | ||
|
||
# Set the include dir variables and the libraries and let libfind_process do the rest. | ||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on. | ||
set(RTAI_PROCESS_INCLUDES RTAI_INCLUDE_DIR) | ||
set(RTAI_PROCESS_LIBS RTAI_LIBRARY) | ||
|
||
# If user provides Linux source dir, check and append it as well | ||
if( LINUX_SOURCE_DIR ) | ||
set(linux_header_NAME linux/kernel.h) | ||
find_path(Linux_INCLUDE_DIR NAMES ${linux_header_NAME} PATHS ${LINUX_SOURCE_DIR} NO_DEFAULT_PATH) | ||
list(APPEND RTAI_PROCESS_INCLUDES Linux_INCLUDE_DIR) | ||
endif() | ||
|
||
libfind_process(RTAI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
################################################################################ | ||
# | ||
# CMake script for finding XENOMAI. | ||
# If the optional XENOMAI_ROOT_DIR environment variable exists, header files and | ||
# libraries will be searched in the XENOMAI_ROOT_DIR/include and XENOMAI_ROOT_DIR/lib | ||
# directories, respectively. Otherwise the default CMake search process will be | ||
# used. | ||
# | ||
# This script creates the following variables: | ||
# XENOMAI_FOUND: Boolean that indicates if the package was found | ||
# XENOMAI_INCLUDE_DIRS: Paths to the necessary header files | ||
# XENOMAI_LIBRARIES: Package libraries | ||
# | ||
################################################################################ | ||
|
||
include(LibFindMacros) | ||
|
||
# Get hint from environment variable (if any) | ||
if(NOT $ENV{XENOMAI_ROOT_DIR} STREQUAL "") | ||
set(XENOMAI_ROOT_DIR $ENV{XENOMAI_ROOT_DIR} CACHE PATH "Xenomai base directory location (optional, used for nonstandard installation paths)" FORCE) | ||
mark_as_advanced(XENOMAI_ROOT_DIR) | ||
endif() | ||
|
||
# Header files to find | ||
set(header_NAME native/task.h) | ||
|
||
# Libraries to find | ||
set(XENOMAI_NAME native) | ||
|
||
# Find headers and libraries | ||
if(XENOMAI_ROOT_DIR) | ||
# Use location specified by environment variable | ||
find_path(XENOMAI_INCLUDE_DIR NAMES ${header_NAME} PATHS ${XENOMAI_ROOT_DIR}/include PATH_SUFFIXES xenomai NO_DEFAULT_PATH) | ||
find_library(XENOMAI_LIBRARY NAMES ${XENOMAI_NAME} PATHS ${XENOMAI_ROOT_DIR}/lib NO_DEFAULT_PATH) | ||
else() | ||
# Use default CMake search process | ||
find_path(XENOMAI_INCLUDE_DIR NAMES ${header_NAME} PATH_SUFFIXES xenomai ) | ||
find_library(XENOMAI_LIBRARY NAMES ${XENOMAI_NAME}) | ||
endif() | ||
|
||
# Set the include dir variables and the libraries and let libfind_process do the rest. | ||
# NOTE: Singular variables for this library, plural for libraries this this lib depends on. | ||
set(XENOMAI_PROCESS_INCLUDES XENOMAI_INCLUDE_DIR) | ||
set(XENOMAI_PROCESS_LIBS XENOMAI_LIBRARY) | ||
|
||
libfind_process(XENOMAI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.