-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
51 lines (39 loc) · 1.55 KB
/
CMakeLists.txt
File metadata and controls
51 lines (39 loc) · 1.55 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
47
48
49
cmake_minimum_required(VERSION 3.10)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
project( FEBioExplicit )
# Set a default build type if none was specified
set(default_build_type "Release")
add_compile_options(-fPIC)
# FEBIO
if(NOT EXISTS ${FEBIO_LIB_DIR}/libfecore.a)
message(SEND_ERROR "Could not find FEBio library (libfecore.a). Check FEBIO_LIB_DIR.")
return()
endif()
ADD_LIBRARY(fecore STATIC IMPORTED)
SET_TARGET_PROPERTIES(fecore PROPERTIES IMPORTED_LOCATION ${FEBIO_LIB_DIR}/libfecore.a)
# if(NOT EXISTS ${FEBIO_LIB_DIR}/libnumcore.a)
# message(SEND_ERROR "Could not find FEBio library (libnumcore.a). Check FEBIO_LIB_DIR.")
# return()
# endif()
# ADD_LIBRARY(numcore STATIC IMPORTED)
# SET_TARGET_PROPERTIES(numcore PROPERTIES IMPORTED_LOCATION ${FEBIO_LIB_DIR}/libnumcore.a)
if(NOT EXISTS ${FEBIO_LIB_DIR}/libfebiomech.a)
message(SEND_ERROR "Could not find FEBio library (libfebiomech.a). Check FEBIO_LIB_DIR.")
return()
endif()
ADD_LIBRARY(febiomech STATIC IMPORTED)
SET_TARGET_PROPERTIES(febiomech PROPERTIES IMPORTED_LOCATION ${FEBIO_LIB_DIR}/libfebiomech.a)
# OPENMP
find_package(OpenMP)
if ( NOT OPENMP_FOUND )
message(STATUS "This project requires OpenMP, and will not be compiled.")
return()
endif()
add_compile_options(-fopenmp)
# The plugin library
file(GLOB HDR_FEBioExplicit "src/*.h")
file(GLOB SRC_FEBioExplicit "src/*.cpp")
add_library(FEBioExplicit SHARED ${HDR_FEBioExplicit} ${SRC_FEBioExplicit})
target_link_libraries(FEBioExplicit febiomech fecore)
target_include_directories(FEBioExplicit PRIVATE ${FEBIO_ROOT})