Skip to content

Commit fb97b52

Browse files
committed
Use CMAKE_MODULE_PATH
Specifying a search path for CMake modules to be loaded by the include() or find_package() is more robust for cmake three changes. It is intended to be set by the project.
1 parent 7ef7b3f commit fb97b52

File tree

5 files changed

+13
-9
lines changed

5 files changed

+13
-9
lines changed

App/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15)
22

33
project(App CXX)
44

5-
include("../cmake/commonSettings.cmake")
5+
include(commonSettings)
66

77
get_library_name("OREPlusBase" OREPBASE_LIB_NAME)
88
get_library_name("OREAnalytics" OREA_LIB_NAME)

CMakeLists.txt

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ option(ORE_USE_ZLIB "Use compression for boost::iostreams" OFF)
1414

1515
include(CTest)
1616

17-
include("cmake/commonSettings.cmake")
17+
# Path for local cmake modules
18+
if(NOT "${CMAKE_CURRENT_LIST_DIR}/cmake" IN_LIST CMAKE_MODULE_PATH)
19+
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake")
20+
endif()
21+
include(commonSettings)
1822

1923
set(USE_GLOBAL_ORE_BUILD ON)
2024

OREAnalytics/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ project(OREAnalytics CXX)
44

55
enable_testing()
66

7-
include("../cmake/writeAll.cmake")
8-
include("../cmake/commonSettings.cmake")
7+
include(writeAll)
8+
include(commonSettings)
99

1010
get_library_name("OREAnalytics" OREA_LIB_NAME)
1111
get_library_name("OREData" ORED_LIB_NAME)

OREData/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ project(OREData CXX)
44

55
enable_testing()
66

7-
include("../cmake/writeAll.cmake")
8-
include("../cmake/commonSettings.cmake")
7+
include(writeAll)
8+
include(commonSettings)
99

1010
get_library_name("OREData" ORED_LIB_NAME)
1111
get_library_name("QuantExt" QLE_LIB_NAME)

QuantExt/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ project(QuantExt CXX)
44

55
enable_testing()
66

7-
include("../cmake/writeAll.cmake")
8-
include("../cmake/writeTestSuiteMain.cmake")
9-
include("../cmake/commonSettings.cmake")
7+
include(writeAll)
8+
include(writeTestSuiteMain)
9+
include(commonSettings)
1010

1111
get_library_name("QuantExt" QLE_LIB_NAME)
1212
set_ql_library_name()

0 commit comments

Comments
 (0)