Skip to content

Commit

Permalink
Update Modelica generic CMake scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
tbeu committed Aug 17, 2024
1 parent b56dddf commit 15a46ff
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@ function(get_modelica_platform_name var)
endif()
if(APPLE)
list(LENGTH CMAKE_OSX_ARCHITECTURES NUMBER_OF_OSX_ARCHITECTURES)
if (NUMBER_OF_OSX_ARCHITECTURES EQUAL 0)
if (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(NUMBER_OF_OSX_ARCHITECTURES EQUAL 0)
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
set(PLATFORM_PATH_SUFFIX "darwin64")
elseif (CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
set(PLATFORM_PATH_SUFFIX "aarch64-darwin")
else()
message(FATAL_ERROR "Unknown macOS architecture CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}.")
message(FATAL_ERROR
"Unknown macOS architecture CMAKE_HOST_SYSTEM_PROCESSOR=${CMAKE_HOST_SYSTEM_PROCESSOR}."
)
endif()
elseif(NUMBER_OF_OSX_ARCHITECTURES EQUAL 1)
if (CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
if(CMAKE_OSX_ARCHITECTURES STREQUAL "x86_64")
set(PLATFORM_PATH_SUFFIX "darwin64")
elseif (CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
elseif(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
set(PLATFORM_PATH_SUFFIX "aarch64-darwin")
else()
message(FATAL_ERROR "Unknown macOS architecture CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}.")
message(FATAL_ERROR
"Unknown macOS architecture CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}."
)
endif()
else()
message(FATAL_ERROR "Universal builds not supported CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}.")
message(FATAL_ERROR
"Universal builds not supported CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}."
)
endif()
elseif(UNIX)
if(IS_64BIT_BUILD)
Expand Down Expand Up @@ -68,7 +74,7 @@ function(get_modelica_platform_name_with_compiler_version var)
set(PLATFORM_PATH_SUFFIX "${PLATFORM_PATH_SUFFIX}/vs2017")
elseif(MSVC_VERSION GREATER_EQUAL 1920 AND MSVC_VERSION LESS 1930)
set(PLATFORM_PATH_SUFFIX "${PLATFORM_PATH_SUFFIX}/vs2019")
elseif(MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1940)
elseif(MSVC_VERSION GREATER_EQUAL 1930 AND MSVC_VERSION LESS 1950)
set(PLATFORM_PATH_SUFFIX "${PLATFORM_PATH_SUFFIX}/vs2022")
endif()
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ if(DEFINED MODELICA_UTILITIES_INCLUDE_DIR)
message(FATAL_ERROR "MODELICA_UTILITIES_INCLUDE_DIR is an empty string.")
endif()
else()
set(MODELICA_UTILITIES_INCLUDE_DIR "" CACHE PATH "Include directory of the (tool-vendor specific) ModelicaUtilities.h header file")
set(
MODELICA_UTILITIES_INCLUDE_DIR ""
CACHE PATH
"Include directory of the (tool-vendor specific) ModelicaUtilities.h header file"
)
if(NOT MODELICA_UTILITIES_INCLUDE_DIR STREQUAL "")
file(TO_CMAKE_PATH ${MODELICA_UTILITIES_INCLUDE_DIR} MODELICA_UTILITIES_INCLUDE_DIR)
include_directories(${MODELICA_UTILITIES_INCLUDE_DIR})
Expand Down

0 comments on commit 15a46ff

Please sign in to comment.