Commit aaa987c7 authored by Santiago Ospina's avatar Santiago Ospina

[!4] minor fixes to get it to compile on windows

Merge branch 'cmake_fix' into 'master'

ref:copasi/dune-copasi

-   fix "INTERACE" typo in Findmuparser cmake module
    -   for static muparser library, need to define "MUPARSER_STATIC" (on
        windows)
        -   changed Findmuparser to do so if DUNE_USE_ONLY_STATIC_LIBS is
            defined
        -   otherwise behaviour is unchanged
    -   on windows mkdir() only takes one argument

See merge request [!4]

  [!4]: gitlab.dune-project.org/copasi/dune-copasi/merge_requests/4
parents b192e18e d077e945
Pipeline #21248 canceled with stages
in 0 seconds
......@@ -39,9 +39,18 @@ if (muparser_FOUND)
set(muparser_INCLUDES ${muparser_INCLUDE_DIR} )
# add the target
add_library(muparser::muparser SHARED IMPORTED)
set_target_properties(muparser::muparser
PROPERTIES IMPORTED_LOCATION ${muparser_LIBRARIES}
INTERACE_INCLUDE_DIRECTORIES ${muparser_INCLUDES}
if (DUNE_USE_ONLY_STATIC_LIBS)
add_library(muparser::muparser STATIC IMPORTED)
set_target_properties(muparser::muparser
PROPERTIES IMPORTED_LOCATION ${muparser_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${muparser_INCLUDES}
INTERFACE_COMPILE_DEFINITIONS "MUPARSER_STATIC"
)
else()
add_library(muparser::muparser SHARED IMPORTED)
set_target_properties(muparser::muparser
PROPERTIES IMPORTED_LOCATION ${muparser_LIBRARIES}
INTERFACE_INCLUDE_DIRECTORIES ${muparser_INCLUDES}
)
endif()
endif()
add_library(dune_copasi_lib STATIC model_base.cc)
target_link_libraries(dune_copasi_lib PUBLIC ${DUNE_LIBS})
target_link_libraries(dune_copasi_lib PUBLIC ${DUNE_LIBS} muparser::muparser)
#install headers
install(FILES copasi.hh DESTINATION
......
......@@ -355,7 +355,11 @@ ModelDiffusionReaction<Grid, GridView, FEMorder, OrderingTag>::
if (stat(path.c_str(), &st) != 0) {
int stat = 0;
#if defined(_WIN32)
stat = mkdir(path.c_str());
#else
stat = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
#endif
if (stat != 0 && stat != -1)
std::cout << "Error: Cannot create directory " << path << std::endl;
}
......
......@@ -310,7 +310,11 @@ ModelMultiDomainDiffusionReaction<Grid, FEMorder, OrderingTag>::
if (stat(path.c_str(), &st) != 0) {
int stat = 0;
#if defined(_WIN32)
stat = mkdir(path.c_str());
#else
stat = mkdir(path.c_str(), S_IRWXU | S_IRWXG | S_IRWXO);
#endif
if (stat != 0 && stat != -1)
std::cout << "Error: Cannot create directory " << path << std::endl;
}
......
add_executable(dune_copasi dune-copasi.cc)
target_link_libraries(dune_copasi PRIVATE muparser::muparser dune_copasi_lib)
target_link_libraries(dune_copasi PRIVATE dune_copasi_lib)
# target_link_libraries(dune_copasi_exec PRIVATE )
# dune_target_link_libraries("dune-copasi-exec" ${DUNE_LIBS})
......
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