This repository has been archived by the owner on May 15, 2024. It is now read-only.
generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
86 lines (73 loc) · 3.25 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# SPDX-FileCopyrightText: 2023 SAP SE
#
# SPDX-License-Identifier: Apache-2.0
#
# This file is part of FEDEM - https://openfedem.org
################################################################################
# This is the top-level cmake project file for the Fedem GUI sources.
################################################################################
cmake_minimum_required ( VERSION 2.8...3.5 )
# Project setup
set ( APPLICATION_ID fedemGui )
set ( DOMAIN_ID FEDEM )
set ( PACKAGE_ID GUI )
option ( USE_SOLVERS "Build Fedem GUI with solver support" ON )
option ( USE_WINDPOW "Build Fedem GUI with Windpower support" OFF )
option ( USE_FORTRAN "Build Fedem GUI with Fortran libraries" OFF )
option ( USE_CHSHAPE "Use ChainShape library for mooring line calculation" OFF )
option ( USE_MEMPOOL "Use memory pool for heap allocation in FE library" ON )
option ( USE_PROFILER "Use CPU and Memory profiler" OFF )
mark_as_advanced ( USE_FORTRAN USE_CHSHAPE USE_MEMPOOL USE_PROFILER )
if ( USE_FORTRAN )
project ( ${APPLICATION_ID} CXX C Fortran )
else ( USE_FORTRAN )
project ( ${APPLICATION_ID} CXX C )
endif ( USE_FORTRAN )
message ( STATUS "Generating build project for ${PROJECT_SOURCE_DIR}" )
set ( MDB_DIR ${PROJECT_SOURCE_DIR}/fedem-mdb )
find_path ( _MODULES FedemConfig.cmake
PATHS $ENV{CMAKE_MODULES}
"${MDB_DIR}/fedem-foundation/cmake/Modules/"
)
if ( _MODULES )
message ( STATUS "NOTE : Using ${_MODULES}" )
list ( APPEND CMAKE_MODULE_PATH ${_MODULES} )
else ( _MODULES )
message ( STATUS "ERROR : Missing path to FedemConfig.cmake" )
message ( FATAL_ERROR "Set environment variable CMAKE_MODULES and try again" )
endif ( _MODULES )
set ( _MODULES "${PROJECT_SOURCE_DIR}/cmake/Modules" )
if ( WIN32 AND IS_DIRECTORY ${_MODULES} )
message ( STATUS "NOTE : Using ${_MODULES}" )
list ( APPEND CMAKE_MODULE_PATH ${_MODULES} )
endif ( WIN32 AND IS_DIRECTORY ${_MODULES} )
unset ( _MODULES CACHE )
include ( FedemConfig )
add_subdirectory ( src )
# Install some resource files
file ( GLOB RESOURCES resources/*.* )
if ( FTENV_VERBOSE )
message ( STATUS "Installing ${RESOURCES} to ${CMAKE_INSTALL_PREFIX}" )
endif ( FTENV_VERBOSE )
set ( BINARY_DIR "${CMAKE_INSTALL_PREFIX}/bin" )
set ( PROPERTY_DIR "${BINARY_DIR}/Properties" )
install ( FILES ${RESOURCES} DESTINATION "${BINARY_DIR}/resources" )
install ( DIRECTORY Addons DESTINATION "${BINARY_DIR}" )
install ( DIRECTORY Plugin DESTINATION "${BINARY_DIR}" )
install ( DIRECTORY Templates DESTINATION "${BINARY_DIR}" )
install ( DIRECTORY Properties/CrossSections DESTINATION "${PROPERTY_DIR}" )
install ( FILES Properties/README.md DESTINATION "${PROPERTY_DIR}" )
if ( USE_WINDPOW )
# Install the Fedem Windpower property files
if ( FTENV_VERBOSE )
message ( STATUS "Installing Windpower properties to ${PROPERTY_DIR}" )
endif ( FTENV_VERBOSE )
file ( GLOB SAMPLES Properties/*.fmm )
file ( GLOB AERODAT Properties/AeroData/*.* )
install ( FILES ${SAMPLES} DESTINATION "${PROPERTY_DIR}" )
install ( FILES ${AERODAT} DESTINATION "${PROPERTY_DIR}/AeroData" )
foreach ( FILE ${SAMPLES} )
get_filename_component ( MODEL ${FILE} NAME_WLE )
install ( FILES ${AERODAT} DESTINATION "${PROPERTY_DIR}/${MODEL}_airfoils" )
endforeach ( FILE ${SAMPLES} )
endif ( USE_WINDPOW )