Skip to content

Commit d80cce6

Browse files
committed
Restructure into src and include directories
1 parent d63124d commit d80cce6

16 files changed

+132
-8
lines changed

cmake/FindEigen3.cmake

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# - Try to find Eigen3 lib
2+
#
3+
# This module supports requiring a minimum version, e.g. you can do
4+
# find_package(Eigen3 3.1.2)
5+
# to require version 3.1.2 or newer of Eigen3.
6+
#
7+
# Once done this will define
8+
#
9+
# EIGEN_FOUND - system has eigen lib with correct version
10+
# EIGEN_INCLUDE_DIR - the eigen include directory
11+
# EIGEN_VERSION - eigen version
12+
13+
# Copyright (c) 2006, 2007 Montel Laurent, <[email protected]>
14+
# Copyright (c) 2008, 2009 Gael Guennebaud, <[email protected]>
15+
# Copyright (c) 2009 Benoit Jacob <[email protected]>
16+
# Redistribution and use is allowed according to the terms of the 2-clause BSD license.
17+
18+
if(NOT Eigen_FIND_VERSION)
19+
if(NOT Eigen_FIND_VERSION_MAJOR)
20+
set(Eigen_FIND_VERSION_MAJOR 2)
21+
endif(NOT Eigen_FIND_VERSION_MAJOR)
22+
if(NOT Eigen_FIND_VERSION_MINOR)
23+
set(Eigen_FIND_VERSION_MINOR 91)
24+
endif(NOT Eigen_FIND_VERSION_MINOR)
25+
if(NOT Eigen_FIND_VERSION_PATCH)
26+
set(Eigen_FIND_VERSION_PATCH 0)
27+
endif(NOT Eigen_FIND_VERSION_PATCH)
28+
29+
set(Eigen_FIND_VERSION "${Eigen_FIND_VERSION_MAJOR}.${Eigen_FIND_VERSION_MINOR}.${Eigen_FIND_VERSION_PATCH}")
30+
endif(NOT Eigen_FIND_VERSION)
31+
32+
macro(_eigen3_check_version)
33+
file(READ "${EIGEN_INCLUDE_DIR}/Eigen/src/Core/util/Macros.h" _eigen3_version_header)
34+
35+
string(REGEX MATCH "define[ \t]+EIGEN_WORLD_VERSION[ \t]+([0-9]+)" _eigen3_world_version_match "${_eigen3_version_header}")
36+
set(EIGEN_WORLD_VERSION "${CMAKE_MATCH_1}")
37+
string(REGEX MATCH "define[ \t]+EIGEN_MAJOR_VERSION[ \t]+([0-9]+)" _eigen3_major_version_match "${_eigen3_version_header}")
38+
set(EIGEN_MAJOR_VERSION "${CMAKE_MATCH_1}")
39+
string(REGEX MATCH "define[ \t]+EIGEN_MINOR_VERSION[ \t]+([0-9]+)" _eigen3_minor_version_match "${_eigen3_version_header}")
40+
set(EIGEN_MINOR_VERSION "${CMAKE_MATCH_1}")
41+
42+
set(EIGEN_VERSION ${EIGEN_WORLD_VERSION}.${EIGEN_MAJOR_VERSION}.${EIGEN_MINOR_VERSION})
43+
if(${EIGEN_VERSION} VERSION_LESS ${Eigen_FIND_VERSION})
44+
set(EIGEN_VERSION_OK FALSE)
45+
else(${EIGEN_VERSION} VERSION_LESS ${Eigen_FIND_VERSION})
46+
set(EIGEN_VERSION_OK TRUE)
47+
endif(${EIGEN_VERSION} VERSION_LESS ${Eigen_FIND_VERSION})
48+
49+
if(NOT EIGEN_VERSION_OK)
50+
51+
message(STATUS "Eigen version ${EIGEN_VERSION} found in ${EIGEN_INCLUDE_DIR}, "
52+
"but at least version ${Eigen_FIND_VERSION} is required")
53+
endif(NOT EIGEN_VERSION_OK)
54+
endmacro(_eigen3_check_version)
55+
56+
if (EIGEN_INCLUDE_DIRS)
57+
58+
# in cache already
59+
_eigen3_check_version()
60+
set(EIGEN_FOUND ${EIGEN_VERSION_OK})
61+
62+
else ()
63+
64+
find_path(EIGEN_INCLUDE_DIR NAMES signature_of_eigen3_matrix_library
65+
PATHS
66+
${CMAKE_INSTALL_PREFIX}/include
67+
${KDE4_INCLUDE_DIR}
68+
PATH_SUFFIXES eigen3 eigen
69+
)
70+
71+
if(EIGEN_INCLUDE_DIR)
72+
_eigen3_check_version()
73+
endif(EIGEN_INCLUDE_DIR)
74+
75+
include(FindPackageHandleStandardArgs)
76+
find_package_handle_standard_args(Eigen DEFAULT_MSG EIGEN_INCLUDE_DIR EIGEN_VERSION_OK)
77+
78+
mark_as_advanced(EIGEN_INCLUDE_DIR)
79+
SET(EIGEN_INCLUDE_DIRS ${EIGEN_INCLUDE_DIR} CACHE PATH "The Eigen include path.")
80+
81+
endif()
82+

cmake/simulation.cmake

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# *************************************************************************************************
2+
# @file simulation.cmake
3+
# @author Can Erdogan
4+
# @date May 03, 2013
5+
# @brief This is the cmake file to include if you want to use dart and grip.
6+
# *************************************************************************************************
7+
8+
# Macro to check if a set has a particular value. Useful to list the files that need to be linked
9+
# with dart/grip libraries
10+
MACRO(LIST_CONTAINS var value)
11+
SET(${var})
12+
FOREACH (value2 ${ARGN})
13+
IF (${value} STREQUAL ${value2})
14+
SET(${var} TRUE)
15+
ENDIF (${value} STREQUAL ${value2})
16+
ENDFOREACH (value2)
17+
ENDMACRO(LIST_CONTAINS)
18+
19+
# Include DART and GRIP config files
20+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/dart")
21+
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/grip")
22+
23+
find_package(DARTExt REQUIRED)
24+
find_package(DART REQUIRED)
25+
find_package(GRIP REQUIRED)
26+
27+
include_directories(${DARTExt_INCLUDEDIR})
28+
include_directories(${DART_INCLUDEDIR})
29+
include_directories(${GRIP_INCLUDEDIR})
30+
link_directories(${DART_LIBRARY_DIRS})
31+
link_directories(${GRIP_LIBRARY_DIRS})
32+
link_directories(/usr/local/lib)
33+
link_directories(/usr/local/lib/assimp3)
34+
35+
# Include OpenGL and GLUT
36+
Find_Package(OpenGL REQUIRED)
37+
Find_Package(GLUT REQUIRED)
38+
include_directories( ${GLUT_INCLUDE_DIRS} )
39+
40+
# Set wxWidgets-related parameters
41+
set (wxWidgets_USE_LIBS base core gl)
42+
find_package (wxWidgets)
43+
include (${wxWidgets_USE_FILE})
44+
45+
# Set the include and link directories
46+
include_directories(${DART_INCLUDE_DIRS} ${GRIP_HEADERS} ${WXWIDGETS_SHARED_INCLUDE_DIRS})
47+
link_directories(${CMAKE_SOURCE_DIR}/lib ${GRIP_LIBDIR} ${WXWIDGETS_SHARED_LIBRARY_DIRS} )
48+
49+
# Example of how to link to an executable
50+
#target_link_libraries (<executable name> ${GRIP_LIBRARIES} ${DART_LIBRARIES} ${DARTExt_LIBRARIES} ${wxWidgets_LIBRARIES})
File renamed without changes.

kore.h renamed to include/kore.h

File renamed without changes.
File renamed without changes.
File renamed without changes.

util.h renamed to include/util.h

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)