Skip to content

Commit 01cdf97

Browse files
committed
QPR-13660: optional_components instead of conditional
1 parent d5ff8f8 commit 01cdf97

5 files changed

Lines changed: 11 additions & 27 deletions

File tree

ORE-SWIG/CMakeLists.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,19 +32,16 @@ get_library_name("QuantExt" QLE_LIB_NAME)
3232
set_ql_library_name()
3333

3434
# To build the module, we moreover need Boost, Swig, Python
35-
if(${Boost_VERSION_MINOR} LESS 89)
36-
set(BOOST_COMPONENT_LIST serialization date_time filesystem system timer thread log)
37-
else()
38-
set(BOOST_COMPONENT_LIST serialization date_time filesystem timer thread log)
39-
endif()
35+
set(BOOST_COMPONENT_LIST serialization date_time filesystem timer thread log)
36+
4037

4138
if(ORE_USE_ZLIB)
4239
list(APPEND BOOST_COMPONENT_LIST iostreams)
4340
if(MSVC)
4441
list(APPEND BOOST_COMPONENT_LIST zlib)
4542
endif()
4643
endif()
47-
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENT_LIST})
44+
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENT_LIST} OPTIONAL_COMPONENTS system)
4845
find_package(SWIG REQUIRED)
4946
find_package(Python REQUIRED COMPONENTS Development)
5047
if(ORE_USE_ZLIB)

ORE-SWIG/OREAnalytics-SWIG/Java/CMakeLists.txt

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,7 @@ include_directories(${PROJECT_SOURCE_DIR}/../../QuantExt-SWIG/SWIG)
5151
include_directories(${PROJECT_SOURCE_DIR}/../../OREData-SWIG/SWIG)
5252
include_directories(${PROJECT_SOURCE_DIR}/../../OREAnalytics-SWIG/SWIG)
5353

54-
if(${Boost_VERSION_MINOR} LESS 89)
55-
find_package (Boost COMPONENTS serialization date_time system filesystem REQUIRED)
56-
else()
57-
find_package (Boost COMPONENTS serialization date_time filesystem REQUIRED)
58-
endif()
54+
find_package (Boost REQUIRED COMPONENTS serialization date_time filesystem OPTIONAL_COMPONENTS system)
5955
include_directories(${Boost_INCLUDE_DIRS})
6056

6157
# specify library search path (update this when we build ORE with cmake)

ORE-SWIG/OREData-SWIG/Java/CmakeLists.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,8 @@ include_directories(${PROJECT_SOURCE_DIR}/../../QuantLib-SWIG/SWIG)
4848
include_directories(${PROJECT_SOURCE_DIR}/../../QuantExt-SWIG/SWIG)
4949
include_directories(${PROJECT_SOURCE_DIR}/../../OREData-SWIG/SWIG)
5050

51-
if(${Boost_VERSION_MINOR} LESS 89)
52-
find_package (Boost COMPONENTS serialization date_time regex filesystem system REQUIRED)
53-
else()
54-
find_package (Boost COMPONENTS serialization date_time regex filesystem REQUIRED)
55-
endif()
51+
find_package (Boost REQUIRED COMPONENTS serialization date_time regex filesystem OPTIONAL_COMPONENTS system)
52+
5653
include_directories(${Boost_INCLUDE_DIRS})
5754

5855
# specify library search path (update this when we build ORE with cmake)

OREAnalytics/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,15 @@ if(ORE_USE_ZLIB)
1717
find_package(ZLIB REQUIRED)
1818
endif()
1919

20-
if(${Boost_VERSION_MINOR} LESS 89)
21-
SET(COMPONENT_LIST date_time filesystem iostreams serialization system timer thread)
22-
else()
23-
SET(COMPONENT_LIST date_time filesystem iostreams serialization timer thread)
24-
endif()
20+
SET(COMPONENT_LIST date_time filesystem iostreams serialization timer thread)
2521

2622
if (ORE_BUILD_TESTS)
2723
LIST(APPEND COMPONENT_LIST unit_test_framework)
2824
endif()
2925
if(MSVC AND ORE_USE_ZLIB)
3026
LIST(APPEND COMPONENT_LIST zlib)
3127
endif()
32-
find_package (Boost REQUIRED COMPONENTS ${COMPONENT_LIST} OPTIONAL_COMPONENTS chrono)
28+
find_package (Boost REQUIRED COMPONENTS ${COMPONENT_LIST} OPTIONAL_COMPONENTS system chrono)
3329
if (ORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER AND UNIX AND NOT APPLE)
3430
find_library(RT_LIBRARY rt REQUIRED)
3531
endif()

QuantExt/CMakeLists.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@ else()
1313
SET(COMPONENTS_CONDITIONAL "")
1414
endif()
1515

16-
if(${Boost_VERSION_MINOR} LESS 89)
17-
find_package (Boost REQUIRED COMPONENTS ${COMPONENTS_CONDITIONAL} date_time thread serialization system timer log filesystem OPTIONAL_COMPONENTS chrono)
18-
else()
19-
find_package (Boost REQUIRED COMPONENTS ${COMPONENTS_CONDITIONAL} date_time thread serialization timer log filesystem OPTIONAL_COMPONENTS chrono)
20-
endif()
16+
17+
find_package (Boost REQUIRED COMPONENTS ${COMPONENTS_CONDITIONAL} date_time thread serialization timer log filesystem OPTIONAL_COMPONENTS system chrono)
18+
2119

2220
if (ORE_ENABLE_PARALLEL_UNIT_TEST_RUNNER AND UNIX AND NOT APPLE)
2321
find_library(RT_LIBRARY rt REQUIRED)

0 commit comments

Comments
 (0)