Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
eigenpy
Commits
8e85b3fe
Commit
8e85b3fe
authored
Jun 30, 2016
by
jcarpent
Browse files
[CMake] Rework unit tests
parent
a6867bd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
8e85b3fe
...
...
@@ -48,6 +48,7 @@ ENDIF(APPLE)
# --- OPTIONS ---------------------------------------
# ----------------------------------------------------
OPTION
(
EIGEN_NUMPY_ALIGNED
"Directly aligned data between Numpy and Eigen"
OFF
)
OPTION
(
BUILD_UNIT_TESTS
"Build the unitary tests"
ON
)
IF
(
EIGEN_NUMPY_ALIGNED
)
ADD_DEFINITIONS
(
-DEIGENPY_ALIGNED
)
...
...
@@ -104,7 +105,6 @@ ENDFOREACH(header)
# ----------------------------------------------------
# --- TARGETS ----------------------------------------
# ----------------------------------------------------
SET
(
${
PROJECT_NAME
}
_SOURCES
src/exception.cpp
src/eigenpy.cpp
...
...
@@ -122,15 +122,11 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
# ----------------------------------------------------
# --- UNIT TEST --------------------------------------
# ----------------------------------------------------
ADD_LIBRARY
(
matrix SHARED unittest/matrix.cpp
)
TARGET_LINK_LIBRARIES
(
matrix
${
PROJECT_NAME
}
)
TARGET_LINK_BOOST_PYTHON
(
matrix
)
SET_TARGET_PROPERTIES
(
matrix PROPERTIES PREFIX
""
)
ADD_LIBRARY
(
geometry SHARED unittest/geometry.cpp
)
TARGET_LINK_LIBRARIES
(
geometry
${
PROJECT_NAME
}
)
TARGET_LINK_BOOST_PYTHON
(
geometry
)
SET_TARGET_PROPERTIES
(
geometry PROPERTIES PREFIX
""
)
ADD_SUBDIRECTORY
(
unittest
)
# ----------------------------------------------------
# --- EXECUTABLES ------------------------------------
# ----------------------------------------------------
IF
(
EIGEN_NUMPY_ALIGNED
)
PKG_CONFIG_APPEND_CFLAGS
(
"-DEIGENPY_ALIGNED"
)
...
...
unittest/CMakeLists.txt
0 → 100644
View file @
8e85b3fe
#
# Copyright (c) 2016 CNRS
#
# This file is part of eigenpy
# 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/>.
MACRO
(
ADD_LIB_UNIT_TEST test PKGS
)
IF
(
BUILD_UNIT_TESTS
)
ADD_LIBRARY
(
${
test
}
SHARED
${
test
}
)
ELSE
(
BUILD_UNIT_TESTS
)
ADD_LIBRARY
(
${
test
}
SHARED EXCLUDE_FROM_ALL
${
test
}
)
ENDIF
(
BUILD_UNIT_TESTS
)
FOREACH
(
PKG
${
PKGS
}
)
PKG_CONFIG_USE_DEPENDENCY
(
${
test
}
${
PKG
}
)
ENDFOREACH
(
PKG
)
TARGET_LINK_LIBRARIES
(
${
test
}
${
PROJECT_NAME
}
)
TARGET_LINK_BOOST_PYTHON
(
${
test
}
)
SET_TARGET_PROPERTIES
(
${
test
}
PROPERTIES PREFIX
""
)
IF
(
APPLE
)
# We need to change the extension for python bindings
SET_TARGET_PROPERTIES
(
${
test
}
PROPERTIES SUFFIX
".so"
)
ENDIF
(
APPLE
)
#ADD_TEST(test ${test} COMMAND ${test})
#ADD_DEPENDENCIES(check ${test})
ENDMACRO
(
ADD_LIB_UNIT_TEST
)
ADD_LIB_UNIT_TEST
(
matrix
"eigen3"
)
ADD_LIB_UNIT_TEST
(
geometry
"eigen3"
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment