diff --git a/CMakeLists.txt b/CMakeLists.txt index 423f62b..bc4724d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,12 @@ google_combined_library(cartographer SRCS "${ALL_LIBRARIES}" ) +# TODO(hrapp): Replacing this get_property with a generator expression is not +# very easy: it needs to be expanded into a variable which is then used for +# CONFIGURE_PACKAGE_CONFIG_FILE - I did not find an easy way to do it. A +# complicated way is to file(READ the cartographer-config.cmake.in and +# string(CONFIGURE it, then file(GENERATE the output file. I do not have the +# stomach to attempt this right now. get_property(CARTOGRAPHER_LIBRARY_FILE TARGET cartographer PROPERTY LOCATION) get_filename_component(CARTOGRAPHER_LIBRARY_FILE_BASENAME ${CARTOGRAPHER_LIBRARY_FILE} NAME) diff --git a/cmake/functions.cmake b/cmake/functions.cmake index 6aa807c..a7fe0cb 100644 --- a/cmake/functions.cmake +++ b/cmake/functions.cmake @@ -21,7 +21,6 @@ macro(_parse_arguments ARGS) USES_EIGEN USES_GFLAGS USES_GLOG - USES_GLOG USES_LUA USES_WEBP USES_CAIRO @@ -179,25 +178,22 @@ function(google_combined_library NAME) DEPENDS ${ARG_SRCS} ) - get_property(OUTPUT_FILE TARGET ${NAME} PROPERTY LOCATION) - # We will delete the static lib generated by the last call to # 'google_library' and recreate it using a GNU ar script that combines the # SRCS into the NAME. # TODO(hrapp): this is probably not very portable, but should work fine on # Linux. set(AR_SCRIPT "") - set(AR_SCRIPT "CREATE ${OUTPUT_FILE}\n") + set(AR_SCRIPT "CREATE $\n") foreach(SRC ${ARG_SRCS}) - get_property(STATIC_LIBRARY_FILE TARGET ${SRC} PROPERTY LOCATION) - set(AR_SCRIPT "${AR_SCRIPT}ADDLIB ${STATIC_LIBRARY_FILE}\n") + set(AR_SCRIPT "${AR_SCRIPT}ADDLIB $\n") endforeach() set(AR_SCRIPT "${AR_SCRIPT}SAVE\nEND\n") set(AR_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/${NAME}_ar.script") - file(WRITE ${AR_SCRIPT_FILE} ${AR_SCRIPT}) + file(GENERATE OUTPUT ${AR_SCRIPT_FILE} CONTENT ${AR_SCRIPT}) add_custom_command(TARGET ${NAME} POST_BUILD - COMMAND rm ${OUTPUT_FILE} + COMMAND rm $ COMMAND ${CMAKE_AR} ARGS -M < ${AR_SCRIPT_FILE} COMMENT "Recombining static libraries into ${NAME}." diff --git a/package.xml b/package.xml index 6c7118a..fc451b5 100644 --- a/package.xml +++ b/package.xml @@ -39,6 +39,7 @@ boost ceres_solver eigen + libcairo2-dev libgflags-dev libgoogle-glog-dev libwebp-dev