-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #75 from RobotLocomotion/cmake
Implement CMake build system
- Loading branch information
Showing
36 changed files
with
2,971 additions
and
181 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,87 @@ | ||
cmake_minimum_required(VERSION 3.1) | ||
|
||
project(lcm) | ||
|
||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") | ||
if(CMAKE_VERSION VERSION_LESS 3.7) | ||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/3.7") | ||
endif() | ||
|
||
find_package(GLib2 REQUIRED COMPONENTS gthread) | ||
|
||
# Configuration and utility functions | ||
include(lcm-cmake/config.cmake) | ||
include(lcm-cmake/functions.cmake) | ||
include(lcm-cmake/version.cmake) | ||
|
||
set(CMAKE_INCLUDE_CURRENT_DIR ON) | ||
if (WIN32) | ||
add_definitions(-DWIN32 -D_CRT_SECURE_NO_WARNINGS) | ||
include_directories(${lcm_SOURCE_DIR}/WinSpecific/include) | ||
include_directories(${lcm_SOURCE_DIR}/WinSpecific/getopt) | ||
include_directories(${lcm_SOURCE_DIR}) | ||
add_subdirectory(WinSpecific) | ||
set(lcm-winport lcm-winport) | ||
get_filename_component(LCM_LCMGEN_PATH ${GLIB2_GLIB_RUNTIME} DIRECTORY) | ||
set(LCM_USE_GLIB_RUNTIME "set(LCM_LCMGEN_PATH \"${LCM_LCMGEN_PATH}\")") | ||
else() | ||
set(lcm-winport) | ||
endif() | ||
|
||
# Core modules | ||
add_subdirectory(lcm) | ||
add_subdirectory(lcmgen) | ||
add_subdirectory(lcm-logger) | ||
|
||
option(LCM_ENABLE_EXAMPLES "Build test and example programs" ON) | ||
if(LCM_ENABLE_EXAMPLES) | ||
add_subdirectory(liblcm-test) | ||
endif() | ||
|
||
# Documentation (Main, C/C++, .NET) | ||
add_subdirectory(docs) | ||
|
||
# Java | ||
lcm_option( | ||
LCM_ENABLE_JAVA | ||
"Build Java bindings and utilities" | ||
JAVA_FOUND Java 1.6) | ||
if(LCM_ENABLE_JAVA) | ||
add_subdirectory(lcm-java) | ||
add_custom_target(lcm-spy DEPENDS lcm-spy-alias) | ||
add_custom_target(lcm-logplayer-gui DEPENDS lcm-logplayer-gui-alias) | ||
endif() | ||
|
||
# Python | ||
lcm_option( | ||
LCM_ENABLE_PYTHON | ||
"Build Python bindings and utilities" | ||
PYTHONLIBS_FOUND PythonLibs) | ||
if(LCM_ENABLE_PYTHON) | ||
add_subdirectory(lcm-python) | ||
endif() | ||
|
||
# Lua | ||
lcm_option( | ||
LCM_ENABLE_LUA | ||
"Build Lua bindings and utilities" | ||
LUA_FOUND Lua) | ||
if(LCM_ENABLE_LUA) | ||
add_subdirectory(lcm-lua) | ||
endif() | ||
|
||
# .NET | ||
# TODO | ||
|
||
# Install rules | ||
include(lcm-cmake/install.cmake) | ||
|
||
option(LCM_INSTALL_M4MACROS "Install autotools support M4 macros" ON) | ||
if(LCM_INSTALL_M4MACROS) | ||
add_subdirectory(m4macros) | ||
endif() | ||
|
||
option(LCM_INSTALL_PKGCONFIG "Install pkg-config files" ON) | ||
if(LCM_INSTALL_PKGCONFIG) | ||
add_subdirectory(lcm-pkgconfig) | ||
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,4 @@ | ||
add_library(lcm-winport STATIC | ||
getopt/getopt.c | ||
getopt/getopt_long.c | ||
) |
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 |
---|---|---|
@@ -1,11 +1,17 @@ | ||
#ifndef GETOPT_H | ||
#define GETOPT_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
int getopt(int argc, char * const argv[], const char *optstring); | ||
extern char *optarg; | ||
extern int optind, opterr, optopt; | ||
#include "getopt_long.h" | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
#endif /* GETOPT_H */ |
Oops, something went wrong.