Buongiorno,
ho creato un progetto Fortran avente la seguente struttura:
Per la sua gestione ho pensato di utilizzare CMake. Il file CMakeLists.txt nella directory radice del progetto è il seguente:
cmake_minimum_required(VERSION 3.27 FATAL_ERROR)
project(mixdyn
VERSION 0.1
DESCRIPTION "Implicit-Explicit transient dynamic analysis"
HOMEPAGE_URL https://github.com/PaoloBertin/mixdyn
LANGUAGES Fortran
)
if(CMAKE_Fortran_COMPILER_ID MATCHES "GNU")
set(dialect "-ffree-form -std=f95 -fimplicit-none")
set(bounds "-fbounds-check")
endif()
add_subdirectory(src)
Nella directory src ho inserito i file sorgente, oltre ad un altro file CMakeLists.txt:
add_executable(Mixdyn
mixdyn.f90
contol.f90
inputd.f90
nodxyr.f90
gaussq.f90
intime.f90
prevos.f90
loadpl.f90
lumass.f90
sfr2.f90
jacob2.f90
modps.f90
linkin.f90
colmht.f90
address.f90
addban.f90
gstiff.f90
jacobd.f90
resepl.f90
blarge.f90
impexp.f90
functs.f90
functa.f90
itrate.f90
outdyn.f90
invar.f90
yieldf.f90
flowpl.f90
dintob.f90
geomst.f90
lingnl.f90
multpy.f90
decomp.f90
redbak.f90
model.f90
)
Se eseguo la build l'eseguibile Mixdyn generato è salvato in build/src.
E qui arriva la mia domanda: come modificare il/i file CMakeLists.txt affinché l'eseguibile sia inviato nelle cartelle build-debug o build-release (ovviamente da costruire) a seconda che la build sia impostata Debug o Release?