-
Notifications
You must be signed in to change notification settings - Fork 65
/
Copy pathCMakeLists.txt
60 lines (44 loc) · 1.38 KB
/
CMakeLists.txt
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
project(DAGMC)
cmake_minimum_required(VERSION 3.18)
enable_language(CXX)
# Set DAGMC version
set(DAGMC_MAJOR_VERSION 3)
set(DAGMC_MINOR_VERSION 2)
set(DAGMC_PATCH_VERSION 4)
set(DAGMC_VERSION ${DAGMC_MAJOR_VERSION}.${DAGMC_MINOR_VERSION}.${DAGMC_PATCH_VERSION})
if(MSVC)
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
add_definitions( -DH5_BUILT_AS_DYNAMIC_LIB )
endif()
# Set DAGMC Git SHA
# Set git SHA1 hash as a compile definition
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
execute_process(COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE DAGMC_GIT_SHA_SUCCESS
OUTPUT_VARIABLE DAGMC_GIT_SHA
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT DAGMC_GIT_SHA_SUCCESS EQUAL "0")
message(WARNING "Could not determine the commit SHA for DAGMC.")
set(DAGMC_GIT_SHA "")
endif()
option(GIT_SUBMODULE "Check submodules during build" ON)
endif()
# Make the scripts in the "cmake" directory available to CMake
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake)
include(DAGMC_macros)
dagmc_setup_build()
dagmc_setup_options()
if(BUILD_MCNP5 OR BUILD_MCNP6)
enable_language(Fortran)
endif()
find_package(MOAB REQUIRED)
find_package(OpenMP)
dagmc_setup_flags()
if (BUILD_TESTS)
enable_testing()
endif ()
add_subdirectory(src)
dagmc_make_configure_files()
message("")