CMakeLists.txt 1.44 KB
Newer Older
1
# 
Justin Carpentier's avatar
Justin Carpentier committed
2
# Copyright (c) 2015-2020 CNRS INRIA
3
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
4
5
# 

jcarpent's avatar
jcarpent committed
6
7
8
9
# ----------------------------------------------------
# --- C++ --------------------------------------------
# ----------------------------------------------------

10
11
12
13
SET(${PROJECT_NAME}_SOURCES
  ${${PROJECT_NAME}_PARSERS_SOURCES}
)

14
15
16
# Extract the compile definitions of the project for export
GET_DIRECTORY_PROPERTY(CURRENT_COMPILE_DEFINITIONS COMPILE_DEFINITIONS)

jcarpent's avatar
jcarpent committed
17
18
IF(UNIX)
    # Create target libpinocchio.so
19
20
    ADD_LIBRARY(${PROJECT_NAME} SHARED ${HEADERS} ${${PROJECT_NAME}_SOURCES})
    SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES LINKER_LANGUAGE CXX)
21
    TARGET_COMPILE_DEFINITIONS(${PROJECT_NAME} PUBLIC ${CURRENT_COMPILE_DEFINITIONS})
22
23
24
    IF(BUILD_WITH_COMMIT_VERSION)
      TAG_LIBRARY_VERSION(${PROJECT_NAME})
    ENDIF(BUILD_WITH_COMMIT_VERSION)
jcarpent's avatar
jcarpent committed
25
    PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} eigen3)
26
    TARGET_LINK_LIBRARIES(${PROJECT_NAME} PUBLIC ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY} ${Boost_SERIALIZATION_LIBRARY})
27

jcarpent's avatar
jcarpent committed
28
29
30
31
32
33
34
35
36
37
38
    IF(URDFDOM_FOUND)
      PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} urdfdom)
    ENDIF(URDFDOM_FOUND)

    IF(HPP_FCL_FOUND)
      PKG_CONFIG_USE_DEPENDENCY(${PROJECT_NAME} hpp-fcl)
    ENDIF(HPP_FCL_FOUND)

    ADD_HEADER_GROUP(HEADERS)
    ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)

39
40
41
    INSTALL(TARGETS ${PROJECT_NAME} 
            EXPORT ${TARGETS_EXPORT_NAME}
            DESTINATION lib)
jcarpent's avatar
jcarpent committed
42
ENDIF(UNIX)
jcarpent's avatar
jcarpent committed
43