Newer
Older
#################################################################################
# _ ___ __ __________ _ __
# | | / (_)____/ /___ ______ _/ / ____/ /_ __(_)___/ /____
# | | / / / ___/ __/ / / / __ `/ / /_ / / / / / / __ / ___/
# | |/ / / / / /_/ /_/ / /_/ / / __/ / / /_/ / / /_/ (__ )
# |___/_/_/ \__/\__,_/\__,_/_/_/ /_/\__,_/_/\__,_/____/
#
#################################################################################
# required cmake versions
# CMAKE 3.9: CUDA support
#################################################################################

Soeren Peters
committed
cmake_minimum_required(VERSION 3.13..3.17 FATAL_ERROR)

Soeren Peters
committed
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER ".cmake")
set(libraryFolder "libs")
set(testFolder "tests")
set(appFolder "apps")
#################################################################################
# OPTIONS
#################################################################################

Soeren Peters
committed
option(BUILD_VF_CPU "Build VirtualFluids cpu variant" ON)
option(BUILD_VF_GPU "Build VirtualFluids gpu variant" OFF)

Soeren Peters
committed
option(BUILD_VF_UNIT_TESTS "Build VirtualFluids unit tests" OFF)

Soeren Peters
committed
#################################################################################
# MACROS
#################################################################################
include(CMakePrintHelpers)
set (CMAKE_PATH "${CMAKE_SOURCE_DIR}/CMake")
include("${CMAKE_PATH}/CMakeCABMacros.cmake")
include("${CMAKE_PATH}/FileUtilities.cmake")
include("${CMAKE_PATH}/VirtualFluidsMacros.cmake")
#################################################################################
# COMMON LIBRARIES
#################################################################################
if(MSVC)
ADD_DEFINITIONS ( "-DNOMINMAX" ) # Disable Min/Max-Macros
endif()
add_subdirectory(src/basics)
#################################################################################
# VIRTUAL FLUIDS CPU / GPU
#################################################################################
include (cpu.cmake)
endif()
if(BUILD_VF_GPU)
include (gpu.cmake)
#################################################################################
# 3rd Party Libraries
#################################################################################
if(BUILD_VF_UNIT_TESTS)
add_subdirectory(${CMAKE_SOURCE_DIR}/3rdParty/googletest)
endif()