forked from gemini3d/mat_gemini
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
46 lines (35 loc) · 1.41 KB
/
Copy pathCMakeLists.txt
File metadata and controls
46 lines (35 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.15)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "use cmake -B build or similar to avoid building in-source, which is messy")
endif()
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "Build type selections" FORCE)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "default build type")
endif()
project(MSIS LANGUAGES Fortran)
include(CTest)
if(NOT DEFINED ${PROJECT_NAME}_BUILD_TESTING)
set(${PROJECT_NAME}_BUILD_TESTING ${BUILD_TESTING})
endif()
set(gemini_url "https://github.com/gemini3d/gemini3d.git")
set(gemini_tag "master")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules)
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/git.cmake)
if(NOT gemini_root)
if(DEFINED ENV{GEMINI_ROOT})
set(gemini_root $ENV{GEMINI_ROOT})
else()
set(gemini_root ${CMAKE_CURRENT_SOURCE_DIR}/../gemini3d/)
endif()
endif()
set(msis_path ${gemini_root}/src/vendor/msis00)
if(NOT IS_DIRECTORY ${msis_path})
# we put inside if() to allow working with existing development code
git_download(${gemini_root} ${gemini_url} ${gemini_tag})
endif()
# build msis_setup executable
add_subdirectory(${msis_path} ${PROJECT_BINARY_DIR}/msis)
if(${PROJECT_NAME}_BUILD_TESTING)
# don't run matlab.cmake from Matlab itself or it can infinite loop CMake on MSIS build
include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/matlab.cmake)
endif()