|
1 | 1 | cmake_minimum_required( VERSION 2.8 ) |
2 | 2 | project( ACIS_Py3Module CXX ) |
3 | 3 |
|
| 4 | +# |
| 5 | +# Application Configuration |
| 6 | +# |
| 7 | + |
| 8 | +# Set Python version |
| 9 | +set( APP_PYTHON_VERSION 3.5 ) |
| 10 | + |
4 | 11 | # |
5 | 12 | # CMake setup and quick fixes |
6 | 13 | # |
@@ -80,7 +87,7 @@ endif() |
80 | 87 | # |
81 | 88 |
|
82 | 89 | # Find Python libs |
83 | | -find_package( PythonLibs 3.5 REQUIRED ) |
| 90 | +find_package( PythonLibs ${APP_PYTHON_VERSION} REQUIRED ) |
84 | 91 | if( PythonLibs_FOUND ) |
85 | 92 | include_directories( ${PYTHON_INCLUDE_DIRS} ) |
86 | 93 | else() |
@@ -159,7 +166,7 @@ generate_export_header( Entity |
159 | 166 | ) |
160 | 167 |
|
161 | 168 | # Set link targets |
162 | | -target_link_libraries( Entity ${ACIS_LINK_LIBRARIES} ${PYTHON_LIBRARIES} ) |
| 169 | +target_link_libraries( Entity ${ACIS_LINK_LIBRARIES} ${PYTHON_LIBRARIES} GeometricAtoms ) |
163 | 170 |
|
164 | 171 | # Add the build location to the include directories |
165 | 172 | target_include_directories( Entity PUBLIC ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} ) |
@@ -358,6 +365,51 @@ endif() |
358 | 365 | set_target_properties( Sweeping PROPERTIES PREFIX "" ) |
359 | 366 |
|
360 | 367 |
|
| 368 | +# |
| 369 | +# ACIS Python Module - Booleans API |
| 370 | +# |
| 371 | + |
| 372 | +# Set source files |
| 373 | +set( ACIS_SOURCES_Booleans |
| 374 | + src/acis_booleans.h |
| 375 | + src/acis_booleans.cpp |
| 376 | + src/utilities.cpp |
| 377 | + src/utilities.h |
| 378 | + ${PROJECT_BINARY_DIR}/acis_booleans_export.h |
| 379 | + ) |
| 380 | + |
| 381 | +# Generate Python module |
| 382 | +add_library( Booleans SHARED ${ACIS_SOURCES_Booleans} ) |
| 383 | + |
| 384 | +# Generate export header file |
| 385 | +generate_export_header( Booleans |
| 386 | + BASE_NAME acis_booleans |
| 387 | + ) |
| 388 | + |
| 389 | +# Set link targets |
| 390 | +target_link_libraries( Booleans ${ACIS_LINK_LIBRARIES} ${PYTHON_LIBRARIES} Entity ) |
| 391 | + |
| 392 | +# Add the build location to the include directories |
| 393 | +target_include_directories( Booleans PUBLIC ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} ) |
| 394 | + |
| 395 | +# Set required C++ standard |
| 396 | +set_property( TARGET Booleans PROPERTY CXX_STANDARD 11 ) |
| 397 | +set_property( TARGET Booleans PROPERTY CXX_STANDARD_REQUIRED ON ) |
| 398 | + |
| 399 | +# Add suffix to debug builds |
| 400 | +if( WIN32 ) |
| 401 | + set_target_properties( Booleans PROPERTIES DEBUG_POSTFIX "_d" ) |
| 402 | +endif() |
| 403 | + |
| 404 | +# On Windows, Python modules have .pyd filename extension |
| 405 | +if( WIN32 AND NOT CYGWIN ) |
| 406 | + set_target_properties( Booleans PROPERTIES SUFFIX ".pyd" ) |
| 407 | +endif() |
| 408 | + |
| 409 | +# This is only needed for the python case where a modulename.so is generated |
| 410 | +set_target_properties( Booleans PROPERTIES PREFIX "" ) |
| 411 | + |
| 412 | + |
361 | 413 | # |
362 | 414 | # ACIS Python Module - Query API |
363 | 415 | # |
@@ -448,7 +500,13 @@ set_target_properties( Modeler PROPERTIES PREFIX "" ) |
448 | 500 |
|
449 | 501 | # Install Python modules to APP_INSTALL_DIR |
450 | 502 | install( |
451 | | - TARGETS Modeler Licensing Entity Lists SaveRestore GeometricAtoms Sweeping Query |
| 503 | + TARGETS Modeler Licensing Entity Lists SaveRestore GeometricAtoms Sweeping Query Booleans |
| 504 | + DESTINATION ${APP_INSTALL_DIR}/${APP_MODULE_NAME} |
| 505 | +) |
| 506 | + |
| 507 | +# Install helper modules |
| 508 | +install( |
| 509 | + DIRECTORY python/ |
452 | 510 | DESTINATION ${APP_INSTALL_DIR}/${APP_MODULE_NAME} |
453 | 511 | ) |
454 | 512 |
|
|
0 commit comments