@@ -19,22 +19,13 @@ option( SpecUtils_BUILD_UNIT_TESTS "Builds unit tests" OFF )
19
19
option ( SpecUtils_BUILD_FUZZING_TESTS "Builds fuzzing tests, requires clang" OFF )
20
20
option ( SpecUtils_BUILD_REGRESSION_TEST "Creates executable to perform interactive regression test" OFF )
21
21
option ( SpecUtils_BUILD_EXAMPLE "Builds example SpecUtil applications" OFF )
22
- option ( SpecUtils_PYTHON_BINDINGS "Creates python bindings to the c++ code" OFF )
23
22
option ( SpecUtils_JAVA_SWIG "Creates swig/java bindings to the c++ code" OFF )
24
23
option ( SpecUtils_C_BINDINGS "Creates C bindings to the c++ code" OFF )
25
24
option ( SpecUtils_INJA_TEMPLATES "Creates inja template interface" OFF )
26
25
option ( SpecUtils_USE_SIMD "Use SIMD operations; i386/x64 only right now, and very alpha, and extremely minimally used" OFF )
27
26
option ( SpecUtils_ENABLE_EQUALITY_CHECKS "Enables the equal_enough(...) functions for comparing two spectrum files." OFF ) #code size is only reason to default to off, I think
28
27
option ( PERFORM_DEVELOPER_CHECKS "Performs additional computationally expensive tests during execution (requires linking to boost)" OFF )
29
-
30
-
31
- if ( SpecUtils_PYTHON_BINDINGS )
32
- option ( SpecUtils_SHARED_LIB "Whether to compile a shared, or static library" ON )
33
- list ( APPEND sources bindings/python/SpecFile_py.cpp )
34
- else ()
35
- #default to building a static lib
36
- option ( SpecUtils_SHARED_LIB "Whether to compile a shared, or static library" OFF )
37
- endif ()
28
+ option ( SpecUtils_SHARED_LIB "Whether to compile a shared, or static library" OFF )
38
29
39
30
40
31
set ( SpecUtils_FLT_PARSE_METHOD "default_value" CACHE STRING [[How to parse lists of numbers.
@@ -82,7 +73,7 @@ endif()
82
73
83
74
84
75
# If we are building this on Windows, not as a sub-project, lets enable selecting C++ runtime
85
- if ( MSVC AND (SpecUtils_PYTHON_BINDINGS OR SpecUtils_BUILD_UNIT_TESTS) )
76
+ if ( MSVC AND SpecUtils_BUILD_UNIT_TESTS )
86
77
get_directory_property (hasParent PARENT_DIRECTORY )
87
78
if (NOT hasParent)
88
79
option (${PROJECT_NAME} _USE_MSVC_MultiThreadDLL "Use dynamically-link runtime library." OFF )
@@ -96,7 +87,7 @@ if( MSVC AND (SpecUtils_PYTHON_BINDINGS OR SpecUtils_BUILD_UNIT_TESTS) )
96
87
endif ()
97
88
message (STATUS "Using CMAKE_MSVC_RUNTIME_LIBRARY ${CMAKE_MSVC_RUNTIME_LIBRARY} " )
98
89
endif (NOT hasParent)
99
- endif ( MSVC AND (SpecUtils_PYTHON_BINDINGS OR SpecUtils_BUILD_UNIT_TESTS) )
90
+ endif ( MSVC AND SpecUtils_BUILD_UNIT_TESTS )
100
91
101
92
102
93
if ( SpecUtils_BUILD_EXAMPLE )
@@ -121,14 +112,6 @@ endif( SpecUtils_JAVA_SWIG )
121
112
122
113
set ( THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR} /3rdparty" )
123
114
124
- if ( SpecUtils_PYTHON_BINDINGS )
125
- FIND_PACKAGE (Python3 COMPONENTS Development )
126
- IF (NOT Python3_FOUND)
127
- MESSAGE (FATAL_ERROR "Unable to find PythonLibs." )
128
- ENDIF ()
129
- message ( "Python include dirs: ${Python3_INCLUDE_DIRS} " )
130
- endif ()
131
-
132
115
set ( sources
133
116
src/SpecFile.cpp
134
117
src/SpecFile_pcf.cpp
@@ -255,10 +238,6 @@ if( SpecUtils_ENABLE_URI_SPECTRA )
255
238
find_package ( ZLIB REQUIRED )
256
239
endif ( SpecUtils_ENABLE_URI_SPECTRA )
257
240
258
- if ( SpecUtils_PYTHON_BINDINGS )
259
- list ( APPEND sources bindings/python/SpecFile_py.cpp )
260
- endif ( SpecUtils_PYTHON_BINDINGS )
261
-
262
241
if ( SpecUtils_JAVA_SWIG )
263
242
list ( APPEND sources bindings/swig/SpecUtils.i )
264
243
endif ( SpecUtils_JAVA_SWIG )
@@ -277,7 +256,6 @@ endif( SpecUtils_SHARED_LIB )
277
256
add_library ( SpecUtils ${SpecUtils_LIB_TYPE} ${sources} ${headers} ${OTHER_SUPPORT_FILES} )
278
257
set_target_properties ( SpecUtils PROPERTIES PREFIX "lib" OUTPUT_NAME "SpecUtils" )
279
258
280
-
281
259
set ( SpecUtils_USE_FAST_FLOAT OFF ) # Uses https://github.com/fastfloat/fast_float . If fast_float.h isnt found, will be fetched
282
260
set ( SpecUtils_USE_FROM_CHARS OFF ) # Supported by MSVC >= 2019, and gcc >= 12. Not supported by Apple clang. In MSVC, about 50% slower than boost::spirit
283
261
set ( SpecUtils_USE_BOOST_SPIRIT OFF ) # Uses boost::spirit, and fasted method (maybe a hair faster than fastfloat)
@@ -335,28 +313,22 @@ if( SpecUtils_USE_FAST_FLOAT )
335
313
endif ( NOT FAST_FLOAT_FILE_PATH )
336
314
endif ( SpecUtils_USE_FAST_FLOAT )
337
315
338
- # We only need boost libraries if we are using boost to parse floats, if we are performing developer
339
- # checks, or we are creating Python bindings
340
- if ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS OR SpecUtils_PYTHON_BINDINGS )
316
+ # We only need boost libraries if we are using boost to parse floats, if we are performing developer checks
317
+ if ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS )
341
318
342
319
if ( DEFINED boost_SOURCE_DIR )
343
320
# We used CMake Fetch to get boost (e.g., in InterSpec)
344
321
target_link_libraries ( SpecUtils PUBLIC Boost::system Boost::spirit Boost::fusion Boost::algorithm Boost::functional Boost::crc )
345
322
346
323
else ( DEFINED boost_SOURCE_DIR )
347
-
348
- if ( SpecUtils_PYTHON_BINDINGS )
349
- list ( APPEND boost_libs_required python )
350
- endif ( SpecUtils_PYTHON_BINDINGS )
351
-
352
324
find_package ( Boost REQUIRED COMPONENTS system ${boost_libs_required} )
353
325
if ( NOT Boost_FOUND )
354
326
message (FATAL_ERROR "Couldnt Find Boost" )
355
327
endif ( NOT Boost_FOUND )
356
328
357
329
target_link_libraries ( SpecUtils PUBLIC Boost::system )
358
330
endif ( DEFINED boost_SOURCE_DIR )
359
- endif ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS OR SpecUtils_PYTHON_BINDINGS )
331
+ endif ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS )
360
332
361
333
if ( SpecUtils_USE_FROM_CHARS )
362
334
if ( NOT (MSVC AND (MSVC_VERSION GREATER_EQUAL 1920)) )
@@ -402,17 +374,11 @@ elseif( NOT SpecUtils_USING_NO_THREADING )
402
374
endif ( SpecUtils_USE_WT_THREADPOOL )
403
375
404
376
405
-
406
377
if ( SpecUtils_ENABLE_URI_SPECTRA )
407
378
target_link_libraries ( SpecUtils PUBLIC ZLIB::ZLIB )
408
379
endif ( SpecUtils_ENABLE_URI_SPECTRA )
409
380
410
381
411
- if ( SpecUtils_PYTHON_BINDINGS )
412
- target_link_libraries ( SpecUtils PUBLIC Boost::python ${Boost_PYTHON_LIBRARY} ${Python3_LIBRARIES} )
413
- endif ( SpecUtils_PYTHON_BINDINGS )
414
-
415
-
416
382
if ( SpecUtils_JAVA_SWIG )
417
383
target_link_libraries ( SpecUtils PUBLIC ${JAVA_LIBRARIES} )
418
384
endif ( SpecUtils_JAVA_SWIG )
@@ -428,7 +394,7 @@ elseif( WIN32 )
428
394
endif ( MINGW )
429
395
430
396
target_include_directories ( SpecUtils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}
431
- PRIVATE ${THIRD_PARTY_DIR} ${Python3_INCLUDE_DIRS} )
397
+ PRIVATE ${THIRD_PARTY_DIR} )
432
398
433
399
if ( SpecUtils_BUILD_REGRESSION_TEST )
434
400
if ( NOT SpecUtils_ENABLE_EQUALITY_CHECKS )
0 commit comments