Verified Commit c7304d32 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

cmake: remove IF for Windows compilation

parent 92fece33
......@@ -3,10 +3,6 @@
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
#
# ----------------------------------------------------
# --- C++ --------------------------------------------
# ----------------------------------------------------
IF(BUILD_WITH_URDF_SUPPORT)
SET(${PROJECT_NAME}_SOURCES
parsers/urdf/model.cpp
......@@ -17,50 +13,48 @@ ENDIF()
# Extract the compile definitions of the project for export
GET_DIRECTORY_PROPERTY(CURRENT_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)
IF(UNIX OR "${CMAKE_GENERATOR_TOOLSET}" MATCHES "ClangCl")
# Create target libpinocchio.so
ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PUBLIC ${CURRENT_COMPILE_DEFINITIONS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
IF(BUILD_WITH_COMMIT_VERSION)
TAG_LIBRARY_VERSION(${PROJECT_NAME})
ENDIF(BUILD_WITH_COMMIT_VERSION)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC Eigen3::Eigen)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_SERIALIZATION_LIBRARY})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
# Special care of urdfdom version
IF(urdfdom_FOUND)
IF(${urdfdom_VERSION} VERSION_LESS "0.3.0")
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DPINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME)
ENDIF(${urdfdom_VERSION} VERSION_LESS "0.3.0")
# defines types from version 0.4.0
IF(NOT ${urdfdom_VERSION} VERSION_LESS "0.4.0")
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DPINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR)
ENDIF(NOT ${urdfdom_VERSION} VERSION_LESS "0.4.0")
# std::shared_ptr appears from version 1.0.0
IF(${urdfdom_VERSION} VERSION_GREATER "0.4.2")
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DPINOCCHIO_URDFDOM_USE_STD_SHARED_PTR)
ENDIF(${urdfdom_VERSION} VERSION_GREATER "0.4.2")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${urdfdom_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${urdfdom_INCLUDE_DIRS})
ENDIF(urdfdom_FOUND)
IF(hpp-fcl_FOUND)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC hpp-fcl::hpp-fcl)
ENDIF(hpp-fcl_FOUND)
ADD_HEADER_GROUP(HEADERS)
ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)
INSTALL(TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib)
ENDIF(UNIX OR "${CMAKE_GENERATOR_TOOLSET}" MATCHES "ClangCl")
# Create target libpinocchio.so
ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PUBLIC ${CURRENT_COMPILE_DEFINITIONS})
SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
IF(BUILD_WITH_COMMIT_VERSION)
TAG_LIBRARY_VERSION(${PROJECT_NAME})
ENDIF(BUILD_WITH_COMMIT_VERSION)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${EIGEN3_INCLUDE_DIRS})
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_SERIALIZATION_LIBRARY})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} PUBLIC $<INSTALL_INTERFACE:include>)
# Special care of urdfdom version
IF(urdfdom_FOUND)
IF(${urdfdom_VERSION} VERSION_LESS "0.3.0")
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DPINOCCHIO_URDFDOM_COLLISION_WITH_GROUP_NAME)
ENDIF(${urdfdom_VERSION} VERSION_LESS "0.3.0")
# defines types from version 0.4.0
IF(NOT ${urdfdom_VERSION} VERSION_LESS "0.4.0")
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DPINOCCHIO_URDFDOM_TYPEDEF_SHARED_PTR)
ENDIF(NOT ${urdfdom_VERSION} VERSION_LESS "0.4.0")
# std::shared_ptr appears from version 1.0.0
IF(${urdfdom_VERSION} VERSION_GREATER "0.4.2")
TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PRIVATE -DPINOCCHIO_URDFDOM_USE_STD_SHARED_PTR)
ENDIF(${urdfdom_VERSION} VERSION_GREATER "0.4.2")
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${urdfdom_LIBRARIES})
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} SYSTEM PUBLIC ${urdfdom_INCLUDE_DIRS})
ENDIF(urdfdom_FOUND)
IF(hpp-fcl_FOUND)
TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC hpp-fcl::hpp-fcl)
ENDIF(hpp-fcl_FOUND)
ADD_HEADER_GROUP(HEADERS)
ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)
INSTALL(TARGETS ${PROJECT_NAME}
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib)
Markdown is supported
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