Commit 2a1849f9 authored by Praetorius, Simon's avatar Praetorius, Simon

MS Windows compatibility

parent 2e10969e
......@@ -41,11 +41,17 @@ unset(_AMDIS_H CACHE)
set(MTL_DIR ${AMDIS_INCLUDE_DIR}/mtl4 CACHE PATH "the mtl directory")
list(APPEND AMDIS_INCLUDE_DIRS ${MTL_DIR})
if(WIN32)
set(LIBEXT lib)
else
set(LIBEXT so)
endif()
find_library(_AMDIS_LIB amdis PATHS ${AMDIS_LIBRARY_DIR} ${AMDIS_DIR}/../../lib/amdis/ /usr/include/amdis)
if(_AMDIS_LIB)
get_filename_component(AMDIS_LIBRARY_DIR ${_AMDIS_LIB} PATH CACHE)
set(AMDIS_LIBRARY_DIRS ${AMDIS_LIBRARY_DIR})
set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libmuparser.so" CACHE STRING "amdis libraries")
set(AMDIS_LIBRARIES "${_AMDIS_LIB};${AMDIS_LIBRARY_DIR}/libmuparser.${LIBEXT}" CACHE STRING "amdis libraries")
else()
message(ERROR "could not detect the AMDiS library directory. Please set the variable AMDIS_LIBRARY_DIR to the directory containg the AMDiS library")
endif()
......@@ -183,12 +189,12 @@ if(AMDIS_NEED_EXTENSIONS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/time)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/nanoflann)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/extensions/pugixml)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libextensions.so)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libextensions.${LIBEXT})
endif(AMDIS_NEED_EXTENSIONS)
if(AMDIS_NEED_BASE_PROBLEMS)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/base_problems)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libbase_problems.so)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libbase_problems.${LIBEXT})
endif(AMDIS_NEED_BASE_PROBLEMS)
#add directories for reinit
......@@ -196,8 +202,8 @@ list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/reinit)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/compositeFEM)
list(APPEND AMDIS_INCLUDE_DIRS ${AMDIS_INCLUDE_DIR}/muparser)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libcompositeFEM.so)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libreinit.so)
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libcompositeFEM.${LIBEXT})
list(APPEND AMDIS_LIBRARIES ${AMDIS_LIBRARY_DIR}/libreinit.${LIBEXT})
if(${AMDIS_FIND_COMPONENTS} MATCHES umfpack )
if(NOT AMDIS_NEED_UMFPACK)
......
......@@ -378,7 +378,7 @@ if(ENABLE_EXTENSIONS)
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/time)
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/nanoflann)
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/pugixml/src)
add_library(extensions SHARED ${EXTENSIONS_SRC})
add_library(extensions STATIC ${EXTENSIONS_SRC})
list(APPEND AMDIS_LIBS extensions)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/*.h")
......@@ -412,7 +412,7 @@ if(ENABLE_EXTENSIONS)
list(APPEND deb_add_dirs "include/amdis/extensions/pugixml")
install(TARGETS extensions
LIBRARY DESTINATION lib/amdis/ )
DESTINATION lib/amdis/ )
# === baseProblems ====================================================================
......@@ -437,7 +437,7 @@ if(ENABLE_EXTENSIONS)
${EXTENSIONS_DIR}/base_problems/PhaseFieldCrystal_RB.cc)
list(APPEND COMPILEFLAGS "-DHAVE_BASE_PROBLEMS=1")
list(APPEND AMDIS_INCLUDE_DIRS ${EXTENSIONS_DIR}/base_problems)
add_library(base_problems SHARED ${BASE_PROBLEMS_SRC})
add_library(base_problems STATIC ${BASE_PROBLEMS_SRC})
list(APPEND AMDIS_LIBS base_problems)
FILE(GLOB HEADERS "${EXTENSIONS_DIR}/base_problems/*.h")
......@@ -450,7 +450,7 @@ if(ENABLE_EXTENSIONS)
list(APPEND deb_add_dirs "include/amdis/base_problems")
install(TARGETS base_problems
LIBRARY DESTINATION lib/amdis/ )
DESTINATION lib/amdis/ )
endif(ENABLE_BASE_PROBLEMS)
endif()
......@@ -495,10 +495,10 @@ list(APPEND AMDIS_INCLUDE_DIRS ${SOURCE_DIR})
#include_directories(${SOURCE_DIR})
include_directories(${AMDIS_INCLUDE_DIRS})
add_library(amdis SHARED ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
add_library(compositeFEM SHARED ${COMPOSITE_FEM_SRC})
add_library(reinit SHARED ${REINIT_SRC})
add_library(muparser SHARED ${MUPARSER_SRC})
add_library(amdis STATIC ${AMDIS_SRC} ${PARALLEL_DOMAIN_AMDIS_SRC})
add_library(compositeFEM STATIC ${COMPOSITE_FEM_SRC})
add_library(reinit STATIC ${REINIT_SRC})
add_library(muparser STATIC ${MUPARSER_SRC})
#target_link_libraries(compositeFEM amdis)
#target_link_libraries(reinit amdis)
......@@ -577,7 +577,7 @@ list(APPEND deb_add_dirs "include/amdis/muparser")
list(APPEND deb_add_dirs "lib/amdis")
install(TARGETS amdis compositeFEM reinit muparser
LIBRARY DESTINATION lib/amdis/ )
DESTINATION lib/amdis/ )
configure_file(${AMDIS_SOURCE_DIR}/AMDISConfig.cmake.in
${AMDIS_BINARY_DIR}/AMDISConfig.cmake
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment