source: trunk/RuntimeLibrary/src/fmi2/CMakeLists.txt @ 6737

Last change on this file since 6737 was 6737, checked in by Tove Bergdahl, 5 years ago

#3830: Merging dev-TDM-MinGW-gcc4.8.1 branch to trunk.

File size: 2.2 KB
Line 
1#    Copyright (C) 2014 Modelon AB
2
3#    This program is free software: you can redistribute it and/or modify
4#    it under the terms of the GNU General Public License version 3 as published
5#    by the Free Software Foundation, or optionally, under the terms of the
6#    Common Public License version 1.0 as published by IBM.
7
8#    This program is distributed in the hope that it will be useful,
9#    but WITHOUT ANY WARRANTY; without even the implied warranty of
10#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11#    GNU General Public License, or the Common Public License, for more details.
12
13#    You should have received copies of the GNU General Public License
14#    and the Common Public License along with this program.  If not,
15#    see <http://www.gnu.org/licenses/> or
16#    <http://www.ibm.com/developerworks/library/os-cpl.html/> respectively.
17
18# NOTE: CMake 2.8.6 is required since this is the version used in development.
19# The script is KNOWN NOT TO WORK WITH 2.8.3 and below (ExternalProject
20# interface changes). CMake 2.8.4 and 2.8.5 are not tested.
21cmake_minimum_required (VERSION 2.8.6 FATAL_ERROR)
22
23if(NOT TOP_SRC)   
24    set(TOP_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../../)
25    message(STATUS "TOP_SRC was not defined, using ${TOP_SRC}")
26endif()
27
28set(STANDARD_HEADER_SRC ${TOP_SRC}/ThirdParty/FMI/2.0)
29message(STATUS STANDARD_HEADER_SRC=${STANDARD_HEADER_SRC})
30
31set(FMISources
32   
33    ${STANDARD_HEADER_SRC}/fmi2FunctionTypes.h
34    ${STANDARD_HEADER_SRC}/fmi2TypesPlatform.h
35    ${STANDARD_HEADER_SRC}/fmi2Functions.h
36   
37    fmi2_me.h
38    fmi2_cs.h
39   
40        fmi2_me.c
41    fmi2_cs.c
42)
43#Build fmi2 library
44include_directories(${STANDARD_HEADER_SRC})
45add_library(fmi2 STATIC ${FMISources})
46if(NOT MSVC)
47    set_target_properties(fmi2 PROPERTIES COMPILE_FLAGS "-Wall -g -std=c89 -pedantic -Werror -O2")
48endif()
49
50#Install the libraries
51install(TARGETS fmi2 DESTINATION "${RTLIB_LIB_DIR}")
52
53#Install header files
54install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/"
55    DESTINATION "${RTLIB_INCLUDE_DIR}"
56    FILES_MATCHING PATTERN "*.h")
57   
58install(DIRECTORY "${STANDARD_HEADER_SRC}"
59    DESTINATION "${JMODELICA_INSTALL_DIR}/ThirdParty/FMI"
60    FILES_MATCHING PATTERN "*.h")
Note: See TracBrowser for help on using the repository browser.