Skip to content

Commit

Permalink
Merge pull request #79 from Magisus/more-boost
Browse files Browse the repository at this point in the history
(maint) Fix linking errors on AIX, Solaris, Cisco, and Windows
  • Loading branch information
MikaelSmith authored Sep 23, 2016
2 parents 7b000ec + 846e4d6 commit 89d0e69
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
16 changes: 14 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,24 @@ include(options)
include(cflags)
set(${PROJECT_NAME_UPPER}_CXX_FLAGS "${LEATHERMAN_CXX_FLAGS}")
add_definitions(${LEATHERMAN_DEFINITIONS})
add_definitions(-DLEATHERMAN_I18N)

if(LEATHERMAN_USE_LOCALES)
add_definitions(-DLEATHERMAN_I18N)
endif()

## Pull in helper macros for working with leatherman libraries
include(leatherman)

if(LEATHERMAN_USE_LOCALES)
set(BOOST_COMPONENTS locale)
else()
set(BOOST_COMPONENTS regex)
endif()

list(APPEND BOOST_COMPONENTS thread date_time chrono system program_options)

# Add other dependencies
find_package(Boost 1.54 REQUIRED COMPONENTS locale thread date_time chrono system program_options)
find_package(Boost 1.54 REQUIRED COMPONENTS ${BOOST_COMPONENTS})

# pthreads if you require the Boost.Thread component.
find_package(Threads)
Expand Down
2 changes: 1 addition & 1 deletion lib/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ target_link_libraries(lib${PROJECT_NAME}_test
${CMAKE_THREAD_LIBS_INIT}
)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND BOOST_STATIC)
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND BOOST_STATIC AND LEATHERMAN_USE_LOCALES)
target_link_libraries(lib${PROJECT_NAME}_test iconv)
endif()

Expand Down

0 comments on commit 89d0e69

Please sign in to comment.