fix(ricepp): don't install when building as subproject (fixes gh #195)

This commit is contained in:
Marcus Holland-Moritz 2024-02-12 13:29:16 +01:00
parent f1f55dd48c
commit 5ede1fb84d

View File

@ -87,6 +87,9 @@ target_include_directories(ricepp PUBLIC
target_compile_features(ricepp PUBLIC cxx_std_20) target_compile_features(ricepp PUBLIC cxx_std_20)
target_compile_definitions(ricepp PRIVATE ${RICEPP_CPU_SUPPORT}) target_compile_definitions(ricepp PRIVATE ${RICEPP_CPU_SUPPORT})
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
message(STATUS "[ricepp] building standalone")
include(GNUInstallDirs) include(GNUInstallDirs)
include(CMakePackageConfigHelpers) include(CMakePackageConfigHelpers)
@ -134,6 +137,9 @@ install(
NAMESPACE ricepp:: NAMESPACE ricepp::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ricepp DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/ricepp
) )
else()
message(STATUS "[ricepp] building as subproject")
endif()
# # TODO: remove/rework # # TODO: remove/rework
# add_executable(ricepp_demo ricepp_demo.cpp) # add_executable(ricepp_demo ricepp_demo.cpp)