Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add parmodauto to OMCompiler's CMake compilation.
- Loading branch information
Showing
2 changed files
with
17 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 16 additions & 39 deletions
55
OMCompiler/SimulationRuntime/ParModelica/auto/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,24 @@ | ||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8) | ||
cmake_minimum_required(VERSION 3.14) | ||
|
||
PROJECT(ParModelicaAuto) | ||
project(ParModelicaAuto) | ||
|
||
SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}") | ||
find_package(Boost REQUIRED COMPONENTS graph chrono) | ||
|
||
if( CMAKE_SIZEOF_VOID_P EQUAL 8 ) | ||
SET(TBB_ARCHITECTURE intel64) | ||
elseif( CMAKE_SIZEOF_VOID_P EQUAL 4 ) | ||
SET(TBB_ARCHITECTURE ia32) | ||
set(PARMODAUTO_SOURCES om_pm_equation.cpp om_pm_interface.cpp om_pm_model.cpp pm_utility.cpp) | ||
|
||
add_library(ParModelicaAuto STATIC) | ||
target_sources(ParModelicaAuto PRIVATE ${PARMODAUTO_SOURCES}) | ||
if(WIN32) | ||
target_sources(ParModelicaAuto PRIVATE pm_win_timer.cpp) | ||
else() | ||
MESSAGE(FATAL "Unknown Compiler Architecture") | ||
target_sources(ParModelicaAuto PRIVATE pm_posix_timer.cpp) | ||
endif() | ||
|
||
FIND_PACKAGE(TBB REQUIRED) | ||
FIND_PACKAGE(PugiXML REQUIRED) | ||
FIND_PACKAGE(Boost REQUIRED COMPONENTS system) | ||
|
||
SET(PARMODELICA_SRC om_pm_equation.cpp | ||
om_pm_interface.cpp | ||
om_pm_model.cpp | ||
pm_utility.cpp) | ||
|
||
SET(PARMODELICA_TEST_SRC test_task_graph.cpp) | ||
|
||
IF(UNIX) | ||
SET(PARMODELICA_SRC ${PARMODELICA_SRC} pm_posix_timer.cpp) | ||
ELSE(UNIX) | ||
SET(PARMODELICA_SRC ${PARMODELICA_SRC} pm_win_timer.cpp) | ||
ENDIF(UNIX) | ||
|
||
IF(MSVC) | ||
ADD_DEFINITIONS("/DNOMINMAX") | ||
ENDIF() | ||
|
||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) | ||
INCLUDE_DIRECTORIES(${TBB_INCLUDE_DIR}) | ||
INCLUDE_DIRECTORIES(${PUGIXML_INCLUDE_DIR}) | ||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) | ||
INCLUDE_DIRECTORIES(../../c) | ||
|
||
ADD_LIBRARY(ParModelicaAuto ${PARMODELICA_SRC}) | ||
|
||
ADD_EXECUTABLE(ParModelicaAutoTest ${PARMODELICA_TEST_SRC}) | ||
|
||
TARGET_LINK_LIBRARIES(ParModelicaAutoTest ParModelicaAuto ${TBB_LIBRARY} ${PUGIXML_LIBRARY} ${Boost_SYSTEM_LIBRARY}) | ||
target_link_libraries(ParModelicaAuto PUBLIC omc::simrt::runtime) | ||
target_link_libraries(ParModelicaAuto PUBLIC omc::3rd::tbb) | ||
target_compile_definitions(ParModelicaAuto PRIVATE USE_FLOW_SCHEDULER) | ||
|
||
add_executable(ParModelicaAutoTest) | ||
target_sources(ParModelicaAutoTest PRIVATE test_task_graph.cpp) | ||
target_link_libraries(ParModelicaAutoTest ParModelicaAuto ParModelicaAuto) |