|
[Sponsors] |
share something about dev of openfoam using cmake rather than wmake |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 13, 2018, 03:40 |
share something about dev of openfoam using cmake rather than wmake
|
#1 |
Member
Di Cheng
Join Date: May 2010
Location: Beijing, China
Posts: 47
Rep Power: 16 |
The purpose is take advantage of modern IDEs (VSC, CLion, QT Creator, even Visual Studio with Linux Development Workload) which integrate with cmake better.
wmake is used to do two things: 1. compile OpenFOAM libs: from `src` to `lib*.so` 2. compile applications using OpenFOAM libs: from `xxFoam.C` to `xxFoam` I only intended to do the second task. for example: basic/laplacianFoam add CMakeLists.txt Code:
cmake_minimum_required (VERSION 3.8) # cxx11 set( CMAKE_CXX_STANDARD 11 ) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Xlinker --no-as-needed -Xlinker --add-needed") link_directories($ENV{FOAM_LIBBIN}) add_definitions(-Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -DNoRepository -m64 -fPIC ) # Make/files # Add source to this project's executable. add_executable (laplacianFoam "laplacianFoam.C") # Make/options include_directories( $ENV{FOAM_SRC}/finiteVolume/lnInclude ) include_directories( $ENV{FOAM_SRC}/meshTools/lnInclude ) include_directories( $ENV{FOAM_SRC}/OpenFOAM/lnInclude ) include_directories( $ENV{FOAM_SRC}/OSspecific/POSIX/lnInclude ) set(EXTRA_LIBS dl m) set(LIBS finiteVolume fvOptions meshTools OpenFOAM ${EXTRA_LIBS}) target_link_libraries(laplacianFoam ${LIBS}) |
|
February 8, 2021, 10:53 |
|
#2 |
Member
Join Date: Feb 2016
Posts: 41
Rep Power: 10 |
any chance you would share the cmake files?
|
|
February 9, 2021, 09:46 |
|
#3 |
Member
Join Date: Feb 2016
Posts: 41
Rep Power: 10 |
Now I see your cmake files. Nm.
|
|
Tags |
cmake, openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Frequently Asked Questions about Installing OpenFOAM | wyldckat | OpenFOAM Installation | 3 | November 14, 2023 12:58 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 14:36 |
New OpenFOAM Forum Structure | jola | OpenFOAM | 2 | October 19, 2011 07:55 |
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 | flakid | OpenFOAM Installation | 16 | December 28, 2010 09:48 |
Can anybody help me to solve the list errors while compiling Openfoam 15 on Opensuse 103 32bit | coompressor | OpenFOAM Installation | 0 | November 12, 2008 20:53 |