cmake_minimum_required (VERSION 2.8.6)

project(${MathName})
# add the solver default implementation library

add_library(${MathName}_static STATIC ArrayOperations.cpp Functions.cpp  FactoryExport.cpp)
add_library(${MathName} SHARED ArrayOperations.cpp Functions.cpp FactoryExport.cpp)

IF(UNIX)
	set_target_properties(${MathName}_static PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)

install (TARGETS ${MathName}_static DESTINATION ${LIBINSTALLEXT})

target_link_libraries (${MathName} ${Boost_LIBRARIES} ${UMFPACK_LIB} ${LAPACK_LIBRARIES})
set_target_properties(${MathName}_static PROPERTIES COMPILE_DEFINITIONS "RUNTIME_STATIC_LINKING")

IF(UNIX)
	set_target_properties(${MathName} PROPERTIES COMPILE_FLAGS -fPIC)
ENDIF(UNIX)

install (TARGETS ${MathName} DESTINATION ${LIBINSTALLEXT})
add_precompiled_header(${MathName} Include/Core/Modelica.h )

install (FILES ${CMAKE_SOURCE_DIR}/Include/Core/Math/Functions.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/ArrayOperations.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/Utility.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/Constants.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/SparseMatrix.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/ILapack.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/OMAPI.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/Array.h
	  ${CMAKE_SOURCE_DIR}/Include/Core/Math/ArraySlice.h
	 DESTINATION include/omc/cpp/Core/Math)
