Skip to content

Commit

Permalink
Merge pull request #17 from jhu-lcsr-forks/remove_duplicates_from_use…
Browse files Browse the repository at this point in the history
…_orocos_variables-updated

Removing duplicates, with merged conflicts
  • Loading branch information
jbohren committed Oct 9, 2013
2 parents 4b9051e + 9b81f94 commit 7e6c152
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions UseOROCOS-RTT-helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ macro( orocos_find_package PACKAGE )
endif()
endif()
endif()
endif()
endif()
endmacro( orocos_find_package PACKAGE )

#
Expand Down Expand Up @@ -293,24 +293,34 @@ macro( orocos_use_package PACKAGE )
# Set a flag so we don't over-link (Don't cache this, it should remain per project)
set(${PACKAGE}_${OROCOS_TARGET}_USED true)

# Add compiler and linker flags to the USE_OROCOS_XXX_FLAGS variables used in the orocos_add_x macros
list(APPEND USE_OROCOS_COMPILE_FLAGS ${${PACKAGE}_CFLAGS_OTHER})
list(APPEND USE_OROCOS_LINK_FLAGS ${${PACKAGE}_LDFLAGS_OTHER})
# This probably does not work since lists are ';' separated and not ' ' separated:
list(REMOVE_DUPLICATES USE_OROCOS_COMPILE_FLAGS)
list(REMOVE_DUPLICATES USE_OROCOS_LINK_FLAGS)

# Store aggregated variables
list(APPEND USE_OROCOS_INCLUDE_DIRS "${${PACKAGE}_INCLUDE_DIRS}")
list(APPEND USE_OROCOS_LIBRARIES "${${PACKAGE}_LIBRARIES}")
list(APPEND USE_OROCOS_LIBRARY_DIRS "${${PACKAGE}_LIBRARY_DIRS}")
list(APPEND USE_OROCOS_CFLAGS_OTHER "${${PACKAGE}_CFLAGS_OTHER}")
list(APPEND USE_OROCOS_LDFLAGS_OTHER "${${PACKAGE}_LDFLAGS_OTHER}")

# Remove duplicates
list(REMOVE_DUPLICATES USE_OROCOS_INCLUDE_DIRS)
list(REMOVE_DUPLICATES USE_OROCOS_LIBRARIES)
list(REMOVE_DUPLICATES USE_OROCOS_LIBRARY_DIRS)
# Remove duplicates from aggregated variables
if(DEFINED USE_OROCOS_INCLUDE_DIRS)
list(REMOVE_DUPLICATES USE_OROCOS_INCLUDE_DIRS)
endif()
if(DEFINED USE_OROCOS_LIBRARIES)
list(REMOVE_DUPLICATES USE_OROCOS_LIBRARIES)
endif()
if(DEFINED USE_OROCOS_LIBRARY_DIRS)
list(REMOVE_DUPLICATES USE_OROCOS_LIBRARY_DIRS)
endif()
if(DEFINED USE_OROCOS_CFLAGS_OTHER)
list(REMOVE_DUPLICATES USE_OROCOS_CFLAGS_OTHER)
endif()
if(DEFINED USE_OROCOS_LDFLAGS_OTHER)
list(REMOVE_DUPLICATES USE_OROCOS_LDFLAGS_OTHER)
endif()

# Backwards compatibility
# Add compiler and linker flags to the USE_OROCOS_XXX_FLAGS variables used in the orocos_add_x macros
set(USE_OROCOS_COMPILE_FLAGS ${USE_OROCOS_CFLAGS_OTHER})
set(USE_OROCOS_LINK_FLAGS ${USE_OROCOS_LDFLAGS_OTHER})
endif()
else()
if(ENV{VERBOSE})
Expand Down

0 comments on commit 7e6c152

Please sign in to comment.