From 9ccb1fd43fbd5a6d84d5c45445d9abf8ca90a27f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffan=20S=C3=B8lvsten?= Date: Wed, 17 Jan 2024 15:38:58 +0100 Subject: [PATCH] Fix Sylvan cannot be compiled as a submodule --- CMakeLists.txt | 2 +- src/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9cdccb09..9c7e3095 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,7 @@ FetchContent_MakeAvailable(lace) # Add the Sylvan library target add_subdirectory(src) -if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) +if(PROJECT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR) # If we are in the root, add some options to build examples/tests option(SYLVAN_BUILD_EXAMPLES "Build example tools" ON) option(SYLVAN_BUILD_DOCS "Build documentation" OFF) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ef49fc8b..6173b7d7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -118,7 +118,7 @@ install(EXPORT sylvan-targets include(CMakePackageConfigHelpers) configure_package_config_file( - ${CMAKE_SOURCE_DIR}/cmake/sylvan-config.cmake.in + ${PROJECT_SOURCE_DIR}/cmake/sylvan-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/cmake/sylvan-config.cmake INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/sylvan )