CMakeLists.txt 2.15 KB
Newer Older
jcarpent's avatar
jcarpent committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#
# Copyright (c) 2015-2016 CNRS
#
# This file is part of Pinocchio
# pinocchio is free software: you can redistribute it
# and/or modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation, either version
# 3 of the License, or (at your option) any later version.
# pinocchio is distributed in the hope that it will be
# useful, but WITHOUT ANY WARRANTY; without even the implied warranty
# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Lesser Public License for more details. You should have
# received a copy of the GNU Lesser General Public License along with
# pinocchio If not, see
# <http://www.gnu.org/licenses/>.

17
18
19
# ----------------------------------------------------
# --- BENCHMARK --------------------------------------
# ----------------------------------------------------
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
MACRO(ADD_BENCH bench_name)
IF(BUILD_BENCHMARK)
  ADD_EXECUTABLE(${bench_name} ${bench_name}.cpp)
ELSE(BUILD_BENCHMARK)
  ADD_EXECUTABLE(${bench_name} EXCLUDE_FROM_ALL ${bench_name}.cpp)
ENDIF(BUILD_BENCHMARK)
SET(ExtraMacroArgs ${ARGN})
LIST(LENGTH ExtraMacroArgs NumExtraMacroArgs)
IF(NumExtraMacroArgs GREATER 0)
  SET(link_to_main_lib ${ARGV1})
  IF(link_to_main_lib)
    SET_TARGET_PROPERTIES(${bench_name} PROPERTIES COMPILE_DEFINITIONS PINOCCHIO_SOURCE_DIR="${${PROJECT_NAME}_SOURCE_DIR}")
    TARGET_LINK_LIBRARIES(${bench_name} ${PROJECT_NAME})
  ENDIF(link_to_main_lib)
ENDIF()
ENDMACRO(ADD_BENCH)

37
38
39
MACRO(ADD_TEST_CFLAGS target flag)
  SET_PROPERTY(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
ENDMACRO(ADD_TEST_CFLAGS)
40

41
42
# timings
# 
43
ADD_BENCH(timings TRUE)
44

45
# timings-eigen
46
# 
47

48
49
# 
ADD_BENCH(timings-eigen)
50

51
# timings-geometry
52
53
# 
IF(URDFDOM_FOUND AND HPP_FCL_FOUND)
54
55
  ADD_BENCH(timings-geometry TRUE)
  PKG_CONFIG_USE_DEPENDENCY(timings-geometry hpp-fcl)
56

57
58
59
60
61
62
63
  IF(BUILD_TESTS_WITH_HPP)
    ADD_OPTIONAL_DEPENDENCY("hpp-model-urdf")
    IF(HPP_MODEL_URDF_FOUND)
      PKG_CONFIG_USE_DEPENDENCY(timings-geometry hpp-model-urdf)
      ADD_TEST_CFLAGS(timings-geometry "-DWITH_HPP_MODEL_URDF")
    ENDIF(HPP_MODEL_URDF_FOUND)
  ENDIF(BUILD_TESTS_WITH_HPP)
64

65
66
67
ENDIF(URDFDOM_FOUND AND HPP_FCL_FOUND)