forked from OpenCMISS-Dependencies/cellml
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
61 lines (49 loc) · 1.76 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
cmake_minimum_required(VERSION 2.6)
PROJECT(liboccellml Fortran CXX )
#ENABLE_TESTING()
#ENABLE_LANGUAGE(Fortran)
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${liboccellml_SOURCE_DIR})
FIND_PACKAGE(CellML REQUIRED)
FIND_PACKAGE(CCGS REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED QUIET)
# Probably better to not do this as it probably overrides and external value?
IF( MSVC )
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS -DWINVER=0x0600 )
ELSE ( MSVC )
# allow dynamic compilation
ADD_DEFINITIONS(-DDYNAMIC_COMPILE)
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror -fPIC ${LIBXML2_DEFINITIONS}")
ENDIF( MSVC )
INCLUDE_DIRECTORIES(
${CELLML_INCLUDE_DIR}
${CCGS_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIR}
)
SET(liboccellml_SRCS
src/CellMLModelDefinitionF.cpp
src/CellMLModelDefinition.cpp
src/ccgs_required_functions.cpp
)
# need to handle the fortran code specially?
ADD_LIBRARY(cellml_model_definition STATIC src/cellml_model_definition.f90)
ADD_LIBRARY(occellml STATIC ${liboccellml_SRCS})
# Testing executables
#ADD_EXECUTABLE(test_cellml_model_definition tests/src/test_cellml_model_definition.f90)
#SET_TARGET_PROPERTIES(test_cellml_model_definition PROPERTIES LINKER_LANGUAGE Fortran)
#TARGET_LINK_LIBRARIES(test_cellml_model_definition
# occellml
# cellml_model_definition
# ${CELLML_LIBRARIES}
# ${CCGS_LIBRARIES}
# ${LIBXML2_LIBRARIES}
# -ldl -lm
## -lstdc++
#)
#ADD_TEST(test_cellml_model_definition test_cellml_model_definition ${CMAKE_SOURCE_DIR}/tests/input/sin_approximations_import-OCD.xml)
#ADD_TEST(check_results diff ${CMAKE_SOURCE_DIR}/tests/input/test_cellml_model_definition_results results)
INSTALL(TARGETS occellml
ARCHIVE DESTINATION lib
)
INSTALL(FILES ${CMAKE_BINARY_DIR}/cellml_model_definition.mod
DESTINATION include
)