Skip to content
Snippets Groups Projects
Commit 740674b9 authored by Santiago Ospina De Los Ríos's avatar Santiago Ospina De Los Ríos
Browse files

Install targets according to the the CMake components

parent 9f2cb030
No related branches found
No related tags found
1 merge request!49Resolve "Finish installation and usage instruction on the documentation"
Pipeline #32783 failed
......@@ -32,6 +32,20 @@ if(USE_FALLBACK_FILESYSTEM)
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/ghc")
endif()
# Single domain target
set(DUNE_COPASI_SD_EXECUTABLE OFF
CACHE BOOL "Build singledomain executable by default"
)
# Multiple domain target
set(DUNE_COPASI_MD_EXECUTABLE ON
CACHE BOOL "Build multidomain executable by default"
)
# main dune-copasi target
add_custom_target(dune_copasi ALL)
add_subdirectory(src)
add_subdirectory(dune)
add_subdirectory(lib)
......
......@@ -35,7 +35,7 @@ docker pull registry.dune-project.org/copasi/dune-copasi/dune-copasi:latest
### Run `DuneCopasi`
Finally, run the `dune_copasi_md` executable from the container
```bash
# TODO
dune_copasi_md config.ini
```
## Manual Installation
......@@ -156,7 +156,7 @@ file. Otherwise, the executable will be under `bin/` folder on the installed
directory.
```bash
# TODO
dune_copasi_md config.ini
```
To find out the appropiated contents on the configuration file, check out
......
option(BUILD_SHARED_LIBS "Global flag to cause add_library() to create shared libraries if on" OFF)
option(BUILD_SHARED_LIBS "Global flag to cause add_library() to create shared libraries if ON" OFF)
option(DUNE_COPASI_COMPILE_3D "Compile 3D cases in libraries and executables" OFF)
# Common library
add_library(dune_copasi_lib STATIC ../dune/copasi/model/base.cc)
target_link_libraries(dune_copasi_lib PUBLIC ${DUNE_LIBS} TIFF::TIFF muparser::muparser)
......@@ -20,6 +22,12 @@ elseif(Filesystem_FOUND)
target_link_libraries(dune_copasi_lib PUBLIC std::filesystem)
endif()
if(BUILD_SHARED_LIBS)
install(TARGETS dune_copasi_lib)
endif()
# MultiDomain library
add_library(dune_copasi_md_lib_fv EXCLUDE_FROM_ALL dune_copasi_md_fv.cc)
target_link_libraries(dune_copasi_md_lib_fv PUBLIC dune_copasi_lib)
......@@ -36,6 +44,17 @@ target_link_libraries(dune_copasi_md_lib INTERFACE
dune_copasi_md_lib_fv_cg
)
if(DUNE_COPASI_MD_EXECUTABLE AND BUILD_SHARED_LIBS)
install(TARGETS
dune_copasi_md_lib_fv
dune_copasi_md_lib_cg
dune_copasi_md_lib_fv_cg
COMPONENT MultiDomain
)
endif()
# SingleDomain library
add_library(dune_copasi_sd_lib_fv EXCLUDE_FROM_ALL dune_copasi_sd_fv.cc)
target_link_libraries(dune_copasi_sd_lib_fv PUBLIC dune_copasi_lib)
......@@ -52,13 +71,12 @@ target_link_libraries(dune_copasi_sd_lib INTERFACE
dune_copasi_sd_lib_fv_cg
)
install(TARGETS dune_copasi_lib
dune_copasi_md_lib_fv
dune_copasi_md_lib_cg
dune_copasi_md_lib_fv_cg
dune_copasi_sd_lib_fv
dune_copasi_sd_lib_cg
dune_copasi_sd_lib_fv_cg
COMPONENT Development
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
if(DUNE_COPASI_SD_EXECUTABLE AND BUILD_SHARED_LIBS)
install(TARGETS
dune_copasi_sd_lib_fv
dune_copasi_sd_lib_cg
dune_copasi_sd_lib_fv_cg
COMPONENT SigleDomain
)
endif()
# dune-copasi target
add_custom_target(dune_copasi ALL)
# Single domain target
set(DUNE_COPASI_SD_EXECUTABLE OFF
CACHE BOOL "Build singledomain executable by default"
)
# SingleDomain executable
add_executable(dune_copasi_sd EXCLUDE_FROM_ALL dune_copasi_sd.cc)
target_link_libraries(dune_copasi_sd PRIVATE dune_copasi_sd_lib)
if(DUNE_COPASI_SD_EXECUTABLE)
add_dependencies(dune_copasi dune_copasi_sd)
install(TARGETS dune_copasi_sd COMPONENT SigleDomain)
endif()
# Multiple domain target
set(DUNE_COPASI_MD_EXECUTABLE ON
CACHE BOOL "Build multidomain executable by default"
)
# MultiDomain executable
add_executable(dune_copasi_md EXCLUDE_FROM_ALL dune_copasi_md.cc)
target_link_libraries(dune_copasi_md PRIVATE dune_copasi_md_lib)
if(DUNE_COPASI_MD_EXECUTABLE)
add_dependencies(dune_copasi dune_copasi_md)
endif()
\ No newline at end of file
install(TARGETS dune_copasi_md COMPONENT MultiDomain)
endif()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment