Skip to content

Commit

Permalink
* Accounting for spaces in library paths
Browse files Browse the repository at this point in the history
* Ignore debug and optimized CMake hints.

Signed-off-by: Guybrush <[email protected]>
  • Loading branch information
MiguelBarro committed Mar 18, 2024
1 parent 7e0630a commit ab045f0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,17 @@ endif(WIN32)

foreach(_lib ${Boost_LIBRARIES})
get_filename_component(_LIBPATH ${_lib} PATH)
if (NOT _LIBPATH STREQUAL _LASTLIBPATH)
set(libs_private "${libs_private} -L${_LIBPATH}")
if (NOT _LIBPATH STREQUAL _LASTLIBPATH AND NOT _LIBPATH STREQUAL "")
set(libs_private "${libs_private} -L\"${_LIBPATH}\"")
set(_LASTLIBPATH ${_LIBPATH})
endif()

get_filename_component(_LIBNAME ${_lib} NAME_WE)
string(REGEX REPLACE "^lib" "" _LIBNAME ${_LIBNAME})
set(_LIBNAME "-l${_LIBNAME}")
set(libs_private "${libs_private} ${_LIBNAME}")
if (NOT _LIBNAME STREQUAL "debug" AND NOT _LIBNAME STREQUAL "optimized")
string(REGEX REPLACE "^lib" "" _LIBNAME ${_LIBNAME})
set(_LIBNAME "-l${_LIBNAME}")
set(libs_private "${libs_private} ${_LIBNAME}")
endif()
endforeach()

configure_file(libSimpleAmqpClient.pc.in ${CMAKE_CURRENT_BINARY_DIR}/libSimpleAmqpClient.pc @ONLY)
Expand Down

0 comments on commit ab045f0

Please sign in to comment.