Skip to content
Snippets Groups Projects
Commit 6cb0079b authored by Oliver Charles Schubert's avatar Oliver Charles Schubert
Browse files

Adds the CMake files for compilation.

parent ad0674f8
No related branches found
No related tags found
1 merge request!15Add a simplified design_evaluator version to utilities
# Set a recent minimum version
cmake_minimum_required(VERSION 3.29)
# Start the project
project(utilities
VERSION 2.1.0
DESCRIPTION "Additional software which is needed to execute the UNICADO workflow."
LANGUAGES CXX
)
# set the C++ standard
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# When GCC is used, check if the version is 10.2.0 or higher
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# Check GCC to have filesystem support
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 10.2.0)
message(FATAL_ERROR "[${PROJECT_NAME}] -> GCC version 10.2.0 or higher is required!")
endif()
endif()
# Disable the min and max macros when building with MSVC
if(MSVC)
add_compile_definitions(NOMINMAX)
endif()
# Add all modules
add_subdirectory(DesignEvaluator)
\ No newline at end of file
{
"version": 6,
"configurePresets": [
{
"name": "unix-common",
"description": "Common settings for Unix compilers",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-fexceptions -fno-builtin"
}
},
{
"name": "unix-debug",
"description": "Base settings for building debug configuration with Unix compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "-Wextra -Wsign-conversion -Wfloat-equal -g"
}
},
{
"name": "unix-release",
"description": "Base settings for building release configuration with Unix compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "-O2 -s"
}
},
{
"name": "windows-common",
"description": "Common settings for Windows compilers",
"hidden": true,
"binaryDir": "${sourceDir}/build",
"generator": "Visual Studio 17 2022",
"toolset": "ClangCL",
"toolchainFile": "C:/dev/vcpkg/scripts/buildsystems/vcpkg.cmake",
"cacheVariables": {
"Python_EXECUTABLE": {"type": "FILEPATH", "value": "$env{HOMEPATH}/AppData/Local/Programs/Python/Python311/python.exe"},
"CMAKE_CXX_FLAGS": "/permissive- /EHsc"
}
},
{
"name": "windows-debug",
"description": "Base settings for building debug configuration with Windows compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS_DEBUG": "/W4"
}
},
{
"name": "windows-release",
"description": "Base settings for building release configuration with Windows compilers.",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Release",
"CMAKE_CXX_FLAGS_RELEASE": "/O2"
}
},
{
"name": "x64-linux-debug",
"description": "Default debug configuration for building on Linux",
"generator": "Unix Makefiles",
"inherits": ["unix-common", "unix-debug"]
},
{
"name": "x64-linux-release",
"description": "Default release configuration for building on Linux",
"generator": "Unix Makefiles",
"inherits": ["unix-common", "unix-release"]
},
{
"name": "x64-mingw-debug",
"description": "Default debug configuration for building with MSYS2/MinGW on Windows",
"generator": "MinGW Makefiles",
"inherits": ["unix-common", "unix-debug"]
},
{
"name": "x64-mingw-release",
"description": "Default release configuration for building with MSYS2/MinGW on Windows",
"generator": "MinGW Makefiles",
"inherits": ["unix-common", "unix-release"]
},
{
"name": "x64-windows-debug",
"description": "Default debug configuration for building on Windows",
"architecture": "x64",
"inherits": ["windows-common", "windows-debug"]
},
{
"name": "x64-windows-release",
"description": "Default release configuration for building on Windows",
"architecture": "x64",
"inherits": ["windows-common", "windows-release"]
}
],
"buildPresets": [
{
"name": "x64-linux-debug",
"description": "Sets the build type to Debug for the Linux build system.",
"configurePreset": "x64-linux-debug"
},
{
"name": "x64-linux-release",
"description": "Sets the build type to Release for the Linux build system.",
"configurePreset": "x64-linux-release"
},
{
"name": "x64-windows-debug",
"description": "Sets the build type to Debug for the Windows build system.",
"configurePreset": "x64-windows-debug",
"configuration": "Debug"
},
{
"name": "x64-windows-release",
"description": "Sets the build type to Release for the Windows build system.",
"configurePreset": "x64-windows-release",
"configuration": "Release"
}
]
}
# # Set name of executable
# set(MODULE_NAME designEvaluator)
#
# # ==============================================
# # Add the module executable
# #
# # *** IMPORTANT ***
# # -> Change *.cpp files according to the module
# # -> Add main.cpp later since this list is also
# # used for the tests
# # ==============================================
# set(MODULE_SOURCES
# src/aircraft.cpp
# src/${MODULE_NAME}Output.cpp
# src/${MODULE_NAME}Settings.cpp
# )
# add_executable(${MODULE_NAME}
# ${MODULE_SOURCES}
# src/main.cpp
# src/resources.rc
# )
#
# # Link the runtime libraries -> Use the actual needed libraries
# target_link_libraries(${MODULE_NAME}
# PRIVATE
# UnicadoLibs::aixml
# UnicadoLibs::runtimeInfo
# UnicadoLibs::standardFiles
# )
#
# # Add the USE_GNUPLOT definition
# target_compile_definitions(${MODULE_NAME} PRIVATE USE_GNUPLOT)
#
# # Set the location where the executable will be placed to the current source directory
# set_target_properties(${MODULE_NAME} PROPERTIES
# RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# )
set(MODULE_NAME designEvaluator)
find_package(Boost REQUIRED COMPONENTS
property_tree
)
add_executable(${MODULE_NAME}
src/main.cpp
)
target_link_libraries(${MODULE_NAME} PRIVATE
Boost::property_tree
)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment