diff --git a/CMakeLists.txt b/CMakeLists.txt index befd911..0c3c4b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,30 +6,20 @@ cmake_minimum_required(VERSION 3.21) # so that it works well with tools like CPM or other # manual dependency management -# Define the root path -add_definitions(-DDTWC_ROOT_FOLDER="${CMAKE_SOURCE_DIR}") - -# Only set the cxx_standard if it is not set by someone else -if (NOT DEFINED CMAKE_CXX_STANDARD) - set(CMAKE_CXX_STANDARD 20) -endif() - -# strongly encouraged to enable this globally to avoid conflicts between -# -Wpedantic being enabled and -std=c++20 and -std=gnu++20 for example -# when compiling with PCH enabled -set(CMAKE_CXX_EXTENSIONS OFF) - project(DTWC++ VERSION "0.0.4" DESCRIPTION "A C++ library for fast Dynamic Time Wrapping Clustering" HOMEPAGE_URL https://battery-intelligence-lab.github.io/dtw-cpp/ LANGUAGES CXX C) +# Define the root path +add_definitions(-DDTWC_ROOT_FOLDER="${CMAKE_SOURCE_DIR}") +include(cmake/StandardProjectSettings.cmake) set(DTWC_ENABLE_GUROBI ON) include(cmake/Dependencies.cmake) # Include external projects include(cmake/FindGUROBI.cmake) # include(cmake/ProjectOptions.cmake) -include(cmake/StandardProjectSettings.cmake) + include(cmake/PreventInSourceBuilds.cmake) dtwc_setup_dependencies() diff --git a/cmake/StandardProjectSettings.cmake b/cmake/StandardProjectSettings.cmake index 2bc79b4..94d6edb 100644 --- a/cmake/StandardProjectSettings.cmake +++ b/cmake/StandardProjectSettings.cmake @@ -16,6 +16,15 @@ endif() # Generate compile_commands.json to make it easier to work with clang based tools set(CMAKE_EXPORT_COMPILE_COMMANDS ON) +# strongly encouraged to enable this globally to avoid conflicts between +# -Wpedantic being enabled and -std=c++20 and -std=gnu++20 for example +# when compiling with PCH enabled +set(CMAKE_CXX_EXTENSIONS OFF) +# Only set the cxx_standard if it is not set by someone else +if (NOT DEFINED CMAKE_CXX_STANDARD) + set(CMAKE_CXX_STANDARD 20) +endif() + # Enhance error reporting and compiler messages if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang")