Skip to content

Commit

Permalink
CMake: fix link dependencies with clang compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
jlblancoc committed Jan 17, 2014
1 parent f0dcea6 commit 9b39bbc
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions cmakemodules/DeclareMRPTLib.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,16 @@ macro(internal_define_mrpt_lib name headers_only)
# Include dir:
INCLUDE_DIRECTORIES("${MRPT_SOURCE_DIR}/libs/${DEP_MRPT_NAME}/include")

# Link "-lmrpt-name", only for GCC and if both THIS and the dependence are non-header-only:
IF(CMAKE_COMPILER_IS_GNUCXX AND NOT ${headers_only})
get_property(_LIB_HDRONLY GLOBAL PROPERTY "${DEP}_LIB_IS_HEADERS_ONLY")
IF(NOT _LIB_HDRONLY)
#MESSAGE(STATUS "adding link dep: mrpt-${name} -> ${DEP}")
LIST(APPEND AUX_EXTRA_LINK_LIBS ${DEP}${MRPT_LINKER_LIBS_POSTFIX})
ENDIF(NOT _LIB_HDRONLY)
ENDIF(CMAKE_COMPILER_IS_GNUCXX AND NOT ${headers_only})
# Link "-lmrpt-name", only for GCC/CLang and if both THIS and the dependence are non-header-only:
IF(NOT ${headers_only})
IF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
get_property(_LIB_HDRONLY GLOBAL PROPERTY "${DEP}_LIB_IS_HEADERS_ONLY")
IF(NOT _LIB_HDRONLY)
#MESSAGE(STATUS "adding link dep: mrpt-${name} -> ${DEP}")
LIST(APPEND AUX_EXTRA_LINK_LIBS ${DEP}${MRPT_LINKER_LIBS_POSTFIX})
ENDIF(NOT _LIB_HDRONLY)
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR CMAKE_COMPILER_IS_GNUCXX)
ENDIF(NOT ${headers_only})

# Append to list of mrpt-* lib dependences:
LIST(APPEND AUX_DEPS_LIST ${DEP})
Expand Down

0 comments on commit 9b39bbc

Please sign in to comment.