Verified Commit a87a0719 authored by Francois Keith's avatar Francois Keith Committed by Justin Carpentier
Browse files

Clang + windows

parent 834416ad
...@@ -56,6 +56,10 @@ ENDIF(HPP_FCL_FOUND) ...@@ -56,6 +56,10 @@ ENDIF(HPP_FCL_FOUND)
ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}") ADD_DEFINITIONS(-DPINOCCHIO_MODEL_DIR="${PINOCCHIO_MODEL_DIR}")
IF(WIN32)
ADD_DEFINITIONS("-DNOMINMAX -D_USE_MATH_DEFINES")
ENDIF(WIN32)
FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES}) FOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
ADD_PINOCCHIO_CPP_EXAMPLE(${EXAMPLE}) ADD_PINOCCHIO_CPP_EXAMPLE(${EXAMPLE})
ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES}) ENDFOREACH(EXAMPLE ${${PROJECT_NAME}_EXAMPLES})
......
...@@ -17,7 +17,7 @@ ENDIF() ...@@ -17,7 +17,7 @@ ENDIF()
# Extract the compile definitions of the project for export # Extract the compile definitions of the project for export
GET_DIRECTORY_PROPERTY(CURRENT_COMPILE_DEFINITIONS COMPILE_DEFINITIONS) GET_DIRECTORY_PROPERTY(CURRENT_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
IF(UNIX) IF(UNIX OR "${CMAKE_GENERATOR_TOOLSET}" MATCHES "ClangCl")
# Create target libpinocchio.so # Create target libpinocchio.so
ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES}) ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX) SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
...@@ -58,8 +58,11 @@ IF(UNIX) ...@@ -58,8 +58,11 @@ IF(UNIX)
ADD_HEADER_GROUP(HEADERS) ADD_HEADER_GROUP(HEADERS)
ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES) ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)
INSTALL(TARGETS ${PROJECT_NAME}
# IF(UNIX)
INSTALL(TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME} EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib) DESTINATION lib)
ENDIF(UNIX) # ENDIF(UNIX)
ENDIF(UNIX OR "${CMAKE_GENERATOR_TOOLSET}" MATCHES "ClangCl")
...@@ -23,19 +23,29 @@ MACRO(ADD_PINOCCHIO_UNIT_TEST NAME) ...@@ -23,19 +23,29 @@ MACRO(ADD_PINOCCHIO_UNIT_TEST NAME)
SET(MODULE_NAME "${NAME}Test") SET(MODULE_NAME "${NAME}Test")
STRING(REGEX REPLACE "-" "_" MODULE_NAME ${MODULE_NAME}) STRING(REGEX REPLACE "-" "_" MODULE_NAME ${MODULE_NAME})
ADD_TEST_CFLAGS(${NAME} "-DBOOST_TEST_MODULE=${MODULE_NAME}") ADD_TEST_CFLAGS(${NAME} "-DBOOST_TEST_MODULE=${MODULE_NAME}")
ADD_TEST_CFLAGS(${NAME} '-DPINOCCHIO_MODEL_DIR=\\\"${PINOCCHIO_MODEL_DIR}\\\"') ADD_TEST_CFLAGS(${NAME} "-DPINOCCHIO_MODEL_DIR=\\\\\"${PINOCCHIO_MODEL_DIR}\\\\\"")
IF(WIN32)
ADD_TEST_CFLAGS(${NAME} "-DNOMINMAX -D_USE_MATH_DEFINES")
ENDIF(WIN32)
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} eigen3) PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} eigen3)
FOREACH(PKG ${PKGS}) FOREACH(PKG ${PKGS})
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} ${PKG}) PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} ${PKG})
ENDFOREACH(PKG) ENDFOREACH(PKG)
IF(URDFDOM_FOUND AND (UNIX OR "${CMAKE_GENERATOR_TOOLSET}" MATCHES "ClangCl"))
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} urdfdom)
ENDIF(URDFDOM_FOUND AND (UNIX OR "${CMAKE_GENERATOR_TOOLSET}" MATCHES "ClangCl"))
IF(HPP_FCL_FOUND) IF(HPP_FCL_FOUND)
PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} hpp-fcl) PKG_CONFIG_USE_DEPENDENCY(${TEST_NAME} hpp-fcl)
ENDIF(HPP_FCL_FOUND) ENDIF(HPP_FCL_FOUND)
TARGET_LINK_LIBRARIES(${TEST_NAME} PUBLIC ${PROJECT_NAME}) # IF(NOT WIN32)
TARGET_LINK_LIBRARIES(${TEST_NAME} PUBLIC ${PROJECT_NAME})
# ENDIF(NOT WIN32)
TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY}) TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE ${Boost_UNIT_TEST_FRAMEWORK_LIBRARY})
TARGET_LINK_LIBRARIES(${TEST_NAME} PRIVATE ${Boost_FILESYSTEM_LIBRARY})
ENDMACRO(ADD_PINOCCHIO_UNIT_TEST) ENDMACRO(ADD_PINOCCHIO_UNIT_TEST)
# --- RULES ------------------------------------------------------------------- # --- RULES -------------------------------------------------------------------
...@@ -120,7 +130,7 @@ ADD_PINOCCHIO_UNIT_TEST(version) ...@@ -120,7 +130,7 @@ ADD_PINOCCHIO_UNIT_TEST(version)
ADD_PINOCCHIO_UNIT_TEST(copy) ADD_PINOCCHIO_UNIT_TEST(copy)
MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/serialization-data") MAKE_DIRECTORY("${CMAKE_CURRENT_BINARY_DIR}/serialization-data")
ADD_PINOCCHIO_UNIT_TEST(serialization) ADD_PINOCCHIO_UNIT_TEST(serialization)
ADD_TEST_CFLAGS(serialization '-DTEST_SERIALIZATION_FOLDER=\\\"${CMAKE_CURRENT_BINARY_DIR}/serialization-data\\\"') ADD_TEST_CFLAGS(serialization "-DTEST_SERIALIZATION_FOLDER=\\\\\"${CMAKE_CURRENT_BINARY_DIR}/serialization-data\\\\\"")
# Derivatives algo # Derivatives algo
ADD_PINOCCHIO_UNIT_TEST(kinematics-derivatives) ADD_PINOCCHIO_UNIT_TEST(kinematics-derivatives)
......
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