Skip to content

Commit 504f335

Browse files
committed
cmake: add options to disable building of Python and documentation
Closes: #94
1 parent 43885be commit 504f335

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

CMakeLists.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ else()
4646
option(PARTIO_BUILD_SHARED_LIBS "Enable shared libraries" ON)
4747
endif()
4848
option(PARTIO_BUILD_TOOLS "Enable partio's CLI tools" ON)
49+
option(PARTIO_BUILD_PYTHON "Enable partio's Python bindings" ON)
50+
option(PARTIO_BUILD_DOCS "Enable partio's documentation" ON)
4951

5052
# Enable C++11
5153
if (DEFINED ENV{CXXFLAGS_STD})
@@ -120,10 +122,6 @@ set(OpenGL_GL_PREFERENCE GLVND)
120122

121123
## Search for useful libraries
122124
find_package(Threads REQUIRED)
123-
find_package(GLUT REQUIRED)
124-
find_package(GTest)
125-
find_package(OpenGL REQUIRED)
126-
find_package(Python REQUIRED COMPONENTS Interpreter Development)
127125

128126
set(PARTIO_LIBRARIES partio)
129127
find_package(ZLIB)
@@ -135,11 +133,19 @@ endif()
135133
## Traverse subdirectories
136134
add_subdirectory(src/lib)
137135
if (PARTIO_BUILD_TOOLS)
136+
find_package(GLUT REQUIRED)
137+
find_package(OpenGL REQUIRED)
138138
add_subdirectory(src/tools)
139139
endif()
140-
add_subdirectory(src/py)
141-
add_subdirectory(src/doc)
140+
if (PARTIO_BUILD_PYTHON)
141+
find_package(Python REQUIRED COMPONENTS Interpreter Development)
142+
add_subdirectory(src/py)
143+
endif()
144+
if (PARTIO_BUILD_DOCS)
145+
add_subdirectory(src/doc)
146+
endif()
142147

143148
if (GTest_FOUND AND PARTIO_ENABLE_TESTING)
149+
find_package(GTest)
144150
add_subdirectory(src/tests)
145151
endif()

0 commit comments

Comments
 (0)