Add separate option for building the samples

This commit is contained in:
Patrick Kappl
2024-01-11 16:02:42 +01:00
parent 4ed2ee63a2
commit 94bd40cd32
2 changed files with 10 additions and 9 deletions
+2 -9
View File
@@ -4,12 +4,7 @@ project(livox_sdk)
message(STATUS "main project dir: " ${PROJECT_SOURCE_DIR})
# This variable is set by project() in CMake 3.21+
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}" PROJECT_IS_TOP_LEVEL)
if(PROJECT_IS_TOP_LEVEL)
option(shared_DEVELOPER_MODE "Enable developer mode" OFF)
endif()
include(cmake/variables-and-options.cmake)
set(CMAKE_CXX_STANDARD 11)
@@ -27,10 +22,8 @@ if(WIN32)
add_compile_definitions("WIN32")
endif(WIN32)
# Always build the core SDK library
add_subdirectory(sdk_core sdk_core)
# Only build the samples if this is the top-level project
if(PROJECT_IS_TOP_LEVEL)
if(BUILD_SAMPLES)
add_subdirectory(sample/hub)
add_subdirectory(sample/lidar)
add_subdirectory(sample/hub_lvx_file)
+8
View File
@@ -0,0 +1,8 @@
# This variable is set by project() in CMake 3.21+
string(COMPARE EQUAL "${CMAKE_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}" PROJECT_IS_TOP_LEVEL)
if(PROJECT_IS_TOP_LEVEL)
option(shared_DEVELOPER_MODE "Enable developer mode" OFF)
endif()
option(BUILD_SAMPLES "Build the samples" OFF)