|
1 | 1 |
|
2 | | -macro(target_public_headers TARGET) |
3 | | - set_target_properties(${TARGET} PROPERTIES PUBLIC_HEADER "${ARGN}") |
4 | | -endmacro() |
5 | 2 |
|
| 3 | +##################################################################################################### |
| 4 | +# Configure and generate the files 'ModelicaLibraryConfig_gcc.inc' and 'ModelicaConfig_gcc.inc' |
| 5 | +# These files tell the CPP code generator what name to use and where to find the necessary |
| 6 | +# libraries for the generated simulation code. This does not cover all variables that are used |
| 7 | +# or set by the old CPP-runtime build system. However, these seem to be enough to build things |
| 8 | +# on Linux and Windows with OMDev. |
| 9 | + |
| 10 | +# SCOREP_INCLUDE_ is added to the compilation command-line of the generated code (in the Makefiles). |
| 11 | +# It is not clear why this one is chosen among the many others to be explicitly added to the generated |
| 12 | +# compilation code. It needs to be set to a valid directory resembling path. |
6 | 13 | set(SCOREP_INCLUDE_ ".") |
| 14 | + |
| 15 | +# The boost libraries and headers are expected to be in the system directories. |
| 16 | +# For MSVC this needs to be adjusted. However, it is not clear which approach we are |
| 17 | +# taking for MSVC yet. So leave it like this until we decide. |
7 | 18 | set(Boost_INCLUDE_ ".") |
| 19 | +# This is supposwed to signify the directory where the boost libraries can be found (for -L ...) |
8 | 20 | set(Boost_LIBS_ ".") |
| 21 | +# The actual boost libraries needed to be linked. |
| 22 | +set(Boost_LIBRARIES_ "-lboost_program_options -lboost_filesystem") |
| 23 | + |
| 24 | +# Lapack libs are also expected to be in the system directories. |
9 | 25 | set(LAPACK_LIBS_ ".") |
10 | | -set(SYSTEM_CFLAGS ${SYSTEM_CFLAGS} "-DOMC_BUILD -fPIC -DUSE_THREAD") |
11 | 26 | if(UNIX) |
12 | 27 | set(LAPACK_LIBRARIES_ "-llapack -lblas") |
13 | | -else() |
14 | | - set(LAPACK_LIBRARIES_ "") |
| 28 | + set(LINUX_LIB_DL "-ldl") |
15 | 29 | endif() |
16 | 30 |
|
| 31 | +# The thread library flag (can be something like -lpthreads for example). Let CMake decide the value. |
| 32 | +set(CPPTHREADS_LIBRARY_FLAG ${CMAKE_THREAD_LIBS_INIT}) |
| 33 | + |
| 34 | +# Some common flags for the generated simulation code. It is not clear why OMC_BUILD is defined |
| 35 | +# by the old system. It is always defined for some reason. USE_THREAD means use the C++ standard |
| 36 | +# library's thread library (instead of something like boost threads). |
| 37 | +set(SYSTEM_CFLAGS ${SYSTEM_CFLAGS} "-DOMC_BUILD -DUSE_THREAD -fPIC") |
| 38 | + |
| 39 | +# Configure the files. |
17 | 40 | configure_file(Modelica/ModelicaLibraryConfig_gcc.inc.in ${CMAKE_CURRENT_BINARY_DIR}/ModelicaLibraryConfig_gcc.inc) |
18 | 41 | configure_file(Modelica/ModelicaConfig_gcc.inc.in ${CMAKE_CURRENT_BINARY_DIR}/ModelicaConfig_gcc.inc) |
19 | 42 |
|
| 43 | +# Install them during installtion. They end up in the appropriate include directory. Right now that is 'include/cpp'. |
20 | 44 | install (FILES ${CMAKE_CURRENT_BINARY_DIR}/ModelicaLibraryConfig_gcc.inc |
21 | 45 | ${CMAKE_CURRENT_BINARY_DIR}/ModelicaConfig_gcc.inc |
22 | 46 | TYPE INCLUDE) |
23 | 47 |
|
24 | 48 |
|
25 | 49 |
|
26 | | - |
27 | 50 | ##################################################################################################### |
28 | 51 | # OMCppDataExchange |
29 | 52 | set(OMC_SIMRT_CPP_CORE_DATAEXCHANGE_SOURCES DataExchange/SimData.cpp |
|
0 commit comments