From 8cecfc8931751350556e158ac88bd387fe5cbdae Mon Sep 17 00:00:00 2001 From: Soeren Peters <peters@irmb.tu-bs.de> Date: Thu, 13 Aug 2020 09:47:29 +0200 Subject: [PATCH] Clean up the starting cmake file --- CMake/VirtualFluidsMacros.cmake | 3 +++ CMakeLists.txt | 35 +++++++++++++++++++++++++-------- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/CMake/VirtualFluidsMacros.cmake b/CMake/VirtualFluidsMacros.cmake index 8ce300eb6..3d780000e 100644 --- a/CMake/VirtualFluidsMacros.cmake +++ b/CMake/VirtualFluidsMacros.cmake @@ -180,6 +180,9 @@ function(vf_add_library) endfunction(vf_add_library) function(vf_add_tests) + if (NOT BUILD_VF_UNIT_TESTS) + return() + endif() vf_get_library_name (folder_name) set (targetName ${folder_name}Tests) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c3a3d33f..0c09bd74e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,14 @@ +################################################################################# +# _ ___ __ __________ _ __ +# | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____ +# | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/ +# | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ ) +# |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/ +# +################################################################################# +# required cmake versions +# CMAKE 3.9: CUDA support +################################################################################# cmake_minimum_required(VERSION 3.9..3.17 FATAL_ERROR) if(${CMAKE_VERSION} VERSION_LESS 3.12) @@ -6,25 +17,33 @@ endif() project(VirtualFluids CXX) -set (CMAKE_PATH "${CMAKE_SOURCE_DIR}/CMake") - +################################################################################# +# OPTIONS +################################################################################# option(BUILD_VF_CPU "Build VirtualFluids cpu variant" OFF) option(BUILD_VF_GPU "Build VirtualFluids gpu variant" ON) +option(BUILD_VF_UNIT_TESTS "Build VirtualFluids unit tests" ON) - +################################################################################# +# MACROS +################################################################################# +set (CMAKE_PATH "${CMAKE_SOURCE_DIR}/CMake") include("${CMAKE_PATH}/CMakeCABMacros.cmake") include("${CMAKE_PATH}/FileUtilities.cmake") include("${CMAKE_PATH}/VirtualFluidsMacros.cmake") - - - +################################################################################# +# COMMON LIBRARIES +################################################################################# add_subdirectory(src/basics) +################################################################################# +# VIRTUAL FLUIDS CPU / GPU +################################################################################# #if (BUILD_VF_CPU) -#include (cpu.cmake) +include (cpu.cmake) #endif() #if(BUILD_VF_GPU) -include (gpu.cmake) +#include (gpu.cmake) #endif() -- GitLab