Skip to content

Commit 160f2d5

Browse files
authored
Fix CMake build for MacOS (OpenModelica#13895)
1 parent 797f380 commit 160f2d5

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

OMCompiler/SimulationRuntime/ParModelica/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

2-
if(CMAKE_VERSION VERSION_LESS "3.30")
2+
if(APPLE)
3+
# MacPorts installs the Boost configuration file in a non-standard location,
4+
# keep using the old FindBoost module for now.
5+
find_package(Boost COMPONENTS graph chrono REQUIRED)
6+
elseif(CMAKE_VERSION VERSION_LESS "3.30")
37
find_package(Boost COMPONENTS graph chrono REQUIRED)
48
else()
59
find_package(Boost CONFIG COMPONENTS graph chrono REQUIRED)

OMCompiler/SimulationRuntime/ParModelica/auto/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
set(CMAKE_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/ParModelica/auto)
22

3-
if(CMAKE_VERSION VERSION_LESS "3.30")
3+
if(APPLE)
4+
# MacPorts installs the Boost configuration file in a non-standard location,
5+
# keep using the old FindBoost module for now.
6+
find_package(Boost COMPONENTS graph chrono REQUIRED)
7+
elseif(CMAKE_VERSION VERSION_LESS "3.30")
48
find_package(Boost COMPONENTS graph chrono REQUIRED)
59
else()
610
find_package(Boost CONFIG COMPONENTS graph chrono REQUIRED)

OMCompiler/SimulationRuntime/cpp/cmake_3.14.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME simrtcpp)
1414

1515

1616
# Boost and a threading library are required for the CPP-runtime.
17-
if(CMAKE_VERSION VERSION_LESS "3.30")
18-
find_package(Boost COMPONENTS program_options filesystem REQUIRED)
17+
if(APPLE)
18+
# MacPorts installs the Boost configuration file in a non-standard location,
19+
# keep using the old FindBoost module for now.
20+
find_package(Boost COMPONENTS program_options filesystem REQUIRED)
21+
elseif(CMAKE_VERSION VERSION_LESS "3.30")
22+
find_package(Boost COMPONENTS program_options filesystem REQUIRED)
1923
else()
2024
find_package(Boost CONFIG COMPONENTS program_options filesystem REQUIRED)
2125
endif()

0 commit comments

Comments
 (0)