Skip to content

Commit

Permalink
Merge pull request #618 from guparan/fix_findboost_install
Browse files Browse the repository at this point in the history
[SofaFramework] FIX Boost::program_options finding in install
  • Loading branch information
hugtalbot authored and guparan committed Apr 5, 2018
1 parent 9776405 commit 81523e5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
20 changes: 13 additions & 7 deletions SofaKernel/SofaFramework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,17 @@ set(SOFA_HAVE_ZLIB ${ZLIB_FOUND})

## Boost
# required boost libraries
find_package(Boost REQUIRED system filesystem locale program_options
OPTIONAL_COMPONENTS thread date_time )
find_package(Boost
REQUIRED system filesystem locale program_options
OPTIONAL_COMPONENTS thread date_time
)

set(SOFA_HAVE_BOOST_DATE_TIME ${Boost_DATE_TIME_FOUND})
set(SOFA_HAVE_BOOST_SYSTEM ${Boost_SYSTEM_FOUND})
set(SOFA_HAVE_BOOST_LOCALE ${Boost_LOCALE_FOUND})
set(SOFA_HAVE_BOOST_FILESYSTEM ${Boost_FILESYSTEM_FOUND})
set(SOFA_HAVE_BOOST_LOCALE ${Boost_LOCALE_FOUND})
set(SOFA_HAVE_BOOST_PROGRAM_OPTIONS ${Boost_PROGRAM_OPTIONS})
set(SOFA_HAVE_BOOST_THREAD ${Boost_THREAD_FOUND})
set(SOFA_HAVE_BOOST_DATE_TIME ${Boost_DATE_TIME_FOUND})

list(APPEND Boost_INCLUDE_DIRS ${Boost_INCLUDE_DIR})

Expand All @@ -141,16 +144,19 @@ if(SOFA_HAVE_BOOST_SYSTEM
set(SOFA_HAVE_BOOST 1)

sofa_create_target(BoostSystem SofaFramework "${Boost_SYSTEM_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostLocale SofaFramework "${Boost_LOCALE_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostFileSystem SofaFramework "${Boost_FILESYSTEM_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostLocale SofaFramework "${Boost_LOCALE_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostProgramOptions SofaFramework "${Boost_PROGRAM_OPTIONS_LIBRARY}" "${Boost_INCLUDE_DIRS}")

list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${BoostSystem_Target})
list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${BoostLocale_Target})
list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${BoostSystem_Target})
list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${BoostFileSystem_Target})
list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${BoostLocale_Target})
list(APPEND SOFAFRAMEWORK_DEPENDENCY_LINK ${BoostProgramOptions_Target})

sofa_install_get_libraries(${Boost_SYSTEM_LIBRARY})
sofa_install_get_libraries(${Boost_LOCALE_LIBRARY})
sofa_install_get_libraries(${Boost_FILESYSTEM_LIBRARY})
sofa_install_get_libraries(${Boost_PROGRAM_OPTIONS_LIBRARY})

if(SOFA_HAVE_BOOST_DATE_TIME)
sofa_create_target(BoostDateTime SofaFramework "${Boost_DATE_TIME_LIBRARY}" "${Boost_INCLUDE_DIRS}")
Expand Down
7 changes: 4 additions & 3 deletions SofaKernel/SofaFramework/SofaFrameworkConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@ if(SOFA_HAVE_GLUT)
endif()

if(SOFA_HAVE_BOOST)
find_package(Boost QUIET REQUIRED COMPONENTS system filesystem locale OPTIONAL_COMPONENTS date_time thread)
find_package(Boost QUIET REQUIRED COMPONENTS system filesystem locale program_options OPTIONAL_COMPONENTS date_time thread)

if(Boost_SYSTEM_FOUND AND Boost_FILESYSTEM_FOUND AND Boost_LOCALE_FOUND)
if(Boost_SYSTEM_FOUND AND Boost_FILESYSTEM_FOUND AND Boost_LOCALE_FOUND AND Boost_PROGRAM_OPTIONS_FOUND)
sofa_create_target(BoostSystem SofaFramework "${Boost_SYSTEM_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostLocale SofaFramework "${Boost_LOCALE_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostFileSystem SofaFramework "${Boost_FILESYSTEM_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostLocale SofaFramework "${Boost_LOCALE_LIBRARY}" "${Boost_INCLUDE_DIRS}")
sofa_create_target(BoostProgramOptions SofaFramework "${Boost_PROGRAM_OPTIONS_LIBRARY}" "${Boost_INCLUDE_DIRS}")
endif()

if(Boost_DATE_TIME_FOUND)
Expand Down

0 comments on commit 81523e5

Please sign in to comment.