Commit 596f0b3f authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

change test/CMakelist to uniformize with hpp packages

parent ab5e3837
......@@ -11,7 +11,7 @@ SET(PROJECT_URL "")
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/;${PROJECT_SOURCE_DIR}/cmake2/")
set(LIBRARY_OUTPUT_PATH "${PROJECT_SOURCE_DIR}/lib/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/bin/")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_SOURCE_DIR}/build/")
set(SRC_DIR "${PROJECT_SOURCE_DIR}/src")
set(INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include")
......
cmake_minimum_required(VERSION 2.6)
include_directories("${SRC_DIR}")
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/src)
include_directories("${INCLUDE_DIR}")
include_directories("${EIGEN3_INCLUDE_DIR}")
include_directories("${CDD_INCLUDE_DIR}")
# no need to include directories for qpOASES as it is automatically done through pkgconfig
if(CLP_FOUND)
include_directories("${CLP_INCLUDE_DIR}")
endif()
PROJECT(centroidal-dynamics-lib)
# Make Boost.Test generates the main function in test cases.
#ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
# ADD_TESTCASE(NAME)
# ------------------------
#
# Define a test named `NAME'.
#
# This macro will create a binary from `NAME.cc', link it against
# Boost and add it to the test suite.
#
MACRO(ADD_TESTCASE NAME GENERATED)
IF (${GENERATED} STREQUAL TRUE)
ADD_EXECUTABLE(${NAME} ${CMAKE_CURRENT_BINARY_DIR}/${NAME}.cpp)
ELSE()
ADD_EXECUTABLE(${NAME} ${NAME}.cpp)
ENDIF()
ADD_TEST(${NAME} ${RUNTIME_OUTPUT_DIRECTORY}/${NAME})
# Link against Boost and project library.
TARGET_LINK_LIBRARIES(${NAME}
${Boost_LIBRARIES}
${PROJECT_NAME}
)
ENDMACRO(ADD_TESTCASE)
if ( MSVC )
SET(CMAKE_DEBUG_POSTFIX d)
endif ( MSVC )
add_executable(test_static_equilibrium test_static_equilibrium.cpp)
add_executable(test_LP_solvers test_LP_solvers.cpp)
ADD_TESTCASE(test_static_equilibrium FALSE)
ADD_TESTCASE(test_LP_solvers FALSE)
TARGET_LINK_LIBRARIES(test_LP_solvers centroidal-dynamics-lib)
PKG_CONFIG_USE_DEPENDENCY(test_LP_solvers qpOASES)
TARGET_LINK_LIBRARIES(test_static_equilibrium centroidal-dynamics-lib)
#~ TARGET_LINK_LIBRARIES(polytopetest polytope ${SRC_DIR}/../external/cddlib-094b/lib-src/libcdd.a)
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