Skip to content

Commit

Permalink
Added api-only preset. Fixed CWIPC_WITH_ variables to be overridable …
Browse files Browse the repository at this point in the history
…on the prefix or command line, and not use boolean expressions (which don't work).
  • Loading branch information
jackjansen committed Oct 9, 2024
1 parent 8290dc3 commit 75d1192
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 10 deletions.
33 changes: 23 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,29 @@ cmake_policy(SET CMP0072 NEW)
#cmake_policy(SET CMP0135 NEW)


set(CWIPC_API_ONLY NO)
set(CWIPC_WITH_APPS NOT CWIPC_API_ONLY)
set(CWIPC_WITH_PYTHON NOT CWIPC_API_ONLY)
set(CWIPC_WITH_GUI NOT CWIPC_API_ONLY)
set(CWIPC_WITH_TESTS NOT CWIPC_API_ONLY)
set(CWIPC_WITH_DATA NOT CWIPC_API_ONLY)
set(CWIPC_WITH_CAPTURERS YES)
set(CWIPC_WITH_KINECT ${CWIPC_WITH_CAPTURERS})
set(CWIPC_WITH_REALSENSE ${CWIPC_WITH_CAPTURERS})
set(CWIPC_WITH_INSTALLER YES)
set(VAR CWIPC_API_ONLY NO CACHE BOOL "Only build libraries")
if(CWIPC_API_ONLY)
set(VAR CWIPC_WITH_APPS NO CACHE BOOL "Build command line apps")
set(VAR CWIPC_WITH_PYTHON NO CACHE BOOL "Build Python support and tests")
set(VAR CWIPC_WITH_GUI NO CACHE BOOL "Include cwipc_window() and other gui")
set(VAR CWIPC_WITH_TESTS NO CACHE BOOL "Include tests")
set(VAR CWIPC_WITH_DATA NO CACHE BOOL "Include data")
else()
set(VAR CWIPC_WITH_APPS YES CACHE BOOL)
set(VAR CWIPC_WITH_PYTHON YES CACHE BOOL)
set(VAR CWIPC_WITH_GUI YES CACHE BOOL)
set(VAR CWIPC_WITH_TESTS YES CACHE BOOL)
set(VAR CWIPC_WITH_DATA YES CACHE BOOL)
endif()
set(VAR CWIPC_WITH_CAPTURERS YES CACHE BOOL "Include camera capturers")
if(CWIPC_WITH_CAPTURERS)
set(VAR CWIPC_WITH_KINECT NO CACHE BOOL)
set(VAR CWIPC_WITH_REALSENSE NO CACHE BOOL)
else()
set(VAR CWIPC_WITH_KINECT YES CACHE BOOL "Include Azure Kinect support (if available)")
set(VAR CWIPC_WITH_REALSENSE YES CACHE BOOL "Include Realsense2 support (if available)")
endif()
set(VAR CWIPC_WITH_INSTALLER YES)

# Add extension directories (for things like Find<package>)
set(CMAKE_MODULE_PATH
Expand Down
10 changes: 10 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,16 @@
},
"hidden": true
},
{
"name" : "api-only",
"description" : "Build only native API libraries",
"generator" : "Unix Makefiles",
"inherits" : "non-vcpkg",
"cacheVariables" : {
"CMAKE_BUILD_TYPE" : "Release",
"CWIPC_API_ONLY" : "YES"
}
},
{
"name" : "windows",
"description" : "Build for production on Windows",
Expand Down

0 comments on commit 75d1192

Please sign in to comment.