diff --git a/.gitignore b/.gitignore index 45beb3a..27db649 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,7 @@ build/ cmake-modules/ venv +cmake-build-debug # IDE .vscode/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 03c5f1b..9d585f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,6 +10,9 @@ project(Graaf set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) +# The target name of the Library, what name you give to the Interface +set(GRAAF_LIB_TARGET_NAME ${PROJECT_NAME}) + # Example usages of the library option(SKIP_EXAMPLES "Skip building the examples" OFF) if(NOT SKIP_EXAMPLES) @@ -29,3 +32,8 @@ if(NOT SKIP_BENCHMARKS) add_subdirectory(perf) endif() +#Adding Interface to enable use of FetchContent +add_library(${GRAAF_LIB_TARGET_NAME} INTERFACE) +add_library(${PROJECT_NAME}::${GRAAF_LIB_TARGET_NAME} ALIAS ${PROJECT_NAME}) + +target_include_directories(${GRAAF_LIB_TARGET_NAME} INTERFACE "${PROJECT_BINARY_DIR}" "${PROJECT_SOURCE_DIR}/include/") \ No newline at end of file