Verified Commit 860db466 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

all: improve naming for test and example targets

parent 8072c7fb
......@@ -26,7 +26,7 @@ ENDIF(HPP_FCL_FOUND)
ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")
FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
SET(EXAMPLE_NAME "example-${EXAMPLE}")
SET(EXAMPLE_NAME "example-c++-${EXAMPLE}")
ADD_UNIT_TEST(${EXAMPLE_NAME} ${EXAMPLE})
TARGET_LINK_LIBRARIES(${EXAMPLE_NAME} ${PROJECT_NAME})
PKG_CONFIG_USE_DEPENDENCY(${EXAMPLE_NAME} eigen3)
......
......@@ -8,13 +8,13 @@
# --- MACROS ------------------------------------------------------------------
MACRO(ADD_TEST_CFLAGS target flag)
SET_PROPERTY(TARGET "test-${target}" APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
SET_PROPERTY(TARGET "test-c++-${target}" APPEND_STRING PROPERTY COMPILE_FLAGS " ${flag}")
ENDMACRO(ADD_TEST_CFLAGS)
MACRO(ADD_PINOCCHIO_UNIT_TEST NAME)
SET(PKGS ${ARGN}) # Optional arguments
SET(TEST_NAME "test-${NAME}")
SET(TEST_NAME "test-c++-${NAME}")
ADD_UNIT_TEST(${TEST_NAME} ${NAME}.cpp)
SET_TARGET_PROPERTIES(${TEST_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_INCLUDE_DIRECTORIES(${TEST_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
......@@ -80,14 +80,14 @@ ENDIF(LUA5_FOUND)
IF(BUILD_PYTHON_INTERFACE)
ADD_PINOCCHIO_UNIT_TEST(python_parser eigenpy)
TARGET_LINK_LIBRARIES(test-python_parser ${PYWRAP})
TARGET_LINK_LIBRARIES(test-python_parser ${PYTHON_LIBRARIES})
TARGET_LINK_LIBRARIES(test-c++-python_parser ${PYWRAP})
TARGET_LINK_LIBRARIES(test-c++-python_parser ${PYTHON_LIBRARIES})
SET(ENV_VARIABLES "PYTHONPATH=${CMAKE_BINARY_DIR}/bindings/python:$ENV{PYTHONPATH}")
IF(APPLE)
LIST(APPEND ENV_VARIABLES "LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH}")
LIST(APPEND ENV_VARIABLES "DYLD_LIBRARY_PATH=$ENV{DYLD_LIBRARY_PATH}")
ENDIF(APPLE)
SET_PROPERTY(TEST test-python_parser PROPERTY ENVIRONMENT ${ENV_VARIABLES})
SET_PROPERTY(TEST test-c++-python_parser PROPERTY ENVIRONMENT ${ENV_VARIABLES})
ADD_SUBDIRECTORY(python)
ENDIF(BUILD_PYTHON_INTERFACE)
......
#
# Copyright (c) 2015-2020 CNRS INRIA
#
SET(${PROJECT_NAME}_PYTHON_TESTS
bindings
bindings_model
......@@ -34,7 +38,7 @@ IF(URDFDOM_FOUND)
ENDIF(URDFDOM_FOUND)
FOREACH(TEST ${${PROJECT_NAME}_PYTHON_TESTS})
ADD_PYTHON_UNIT_TEST("test-python-${TEST}" "unittest/python/${TEST}.py" "bindings/python")
ADD_PYTHON_UNIT_TEST("test-py-${TEST}" "unittest/python/${TEST}.py" "bindings/python")
ENDFOREACH(TEST ${${PROJECT_NAME}_PYTHON_TESTS})
MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/serialization-data")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment