4646 option (PARTIO_BUILD_SHARED_LIBS "Enable shared libraries" ON )
4747endif ()
4848option (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
5153if (DEFINED ENV{CXXFLAGS_STD})
@@ -120,10 +122,6 @@ set(OpenGL_GL_PREFERENCE GLVND)
120122
121123## Search for useful libraries
122124find_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
128126set (PARTIO_LIBRARIES partio)
129127find_package (ZLIB)
@@ -135,11 +133,19 @@ endif()
135133## Traverse subdirectories
136134add_subdirectory (src/lib)
137135if (PARTIO_BUILD_TOOLS)
136+ find_package (GLUT REQUIRED)
137+ find_package (OpenGL REQUIRED)
138138 add_subdirectory (src/tools)
139139endif ()
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
143148if (GTest_FOUND AND PARTIO_ENABLE_TESTING)
149+ find_package (GTest)
144150 add_subdirectory (src/tests)
145151endif ()
0 commit comments