@@ -20,7 +20,6 @@ option( SpecUtils_BUILD_UNIT_TESTS "Builds unit tests" OFF )
20
20
option ( SpecUtils_BUILD_FUZZING_TESTS "Builds fuzzing tests, requires clang" OFF )
21
21
option ( SpecUtils_BUILD_REGRESSION_TEST "Creates executable to perform interactive regression test" OFF )
22
22
option ( SpecUtils_BUILD_EXAMPLE "Builds example SpecUtil applications" OFF )
23
- option ( SpecUtils_PYTHON_BINDINGS "Creates python bindings to the c++ code" OFF )
24
23
option ( SpecUtils_JAVA_SWIG "Creates swig/java bindings to the c++ code" OFF )
25
24
option ( SpecUtils_FORTRAN_SWIG "Enables build/test of swig/FORTRAN bindings" OFF )
26
25
option ( SpecUtils_FORTRAN_SWIG_GEN "When this is on, cmake will attemp to generate swig fortran bindings.
@@ -30,15 +29,7 @@ option( SpecUtils_INJA_TEMPLATES "Creates inja template interface" OFF )
30
29
option ( SpecUtils_USE_SIMD "Use SIMD operations; i386/x64 only right now, and very alpha, and extremely minimally used" OFF )
31
30
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
32
31
option ( PERFORM_DEVELOPER_CHECKS "Performs additional computationally expensive tests during execution (requires linking to boost)" OFF )
33
-
34
-
35
- if ( SpecUtils_PYTHON_BINDINGS )
36
- option ( SpecUtils_SHARED_LIB "Whether to compile a shared, or static library" ON )
37
- list ( APPEND sources bindings/python/SpecFile_py.cpp )
38
- else ()
39
- #default to building a static lib
40
- option ( SpecUtils_SHARED_LIB "Whether to compile a shared, or static library" OFF )
41
- endif ()
32
+ option ( SpecUtils_SHARED_LIB "Whether to compile a shared, or static library" OFF )
42
33
43
34
44
35
set ( SpecUtils_FLT_PARSE_METHOD "default_value" CACHE STRING [[How to parse lists of numbers.
@@ -86,7 +77,7 @@ endif()
86
77
87
78
88
79
# If we are building this on Windows, not as a sub-project, lets enable selecting C++ runtime
89
- if ( MSVC )
80
+ if ( MSVC AND SpecUtils_BUILD_UNIT_TESTS )
90
81
get_directory_property (hasParent PARENT_DIRECTORY )
91
82
if (NOT hasParent)
92
83
option (${PROJECT_NAME} _USE_MSVC_MultiThreadDLL "Use dynamically-link runtime library." OFF )
@@ -100,7 +91,7 @@ if( MSVC )
100
91
endif ()
101
92
message (STATUS "Using CMAKE_MSVC_RUNTIME_LIBRARY ${CMAKE_MSVC_RUNTIME_LIBRARY} " )
102
93
endif (NOT hasParent)
103
- endif ( MSVC )
94
+ endif ( MSVC AND SpecUtils_BUILD_UNIT_TESTS )
104
95
105
96
106
97
if ( SpecUtils_BUILD_EXAMPLE )
@@ -125,14 +116,6 @@ endif( SpecUtils_JAVA_SWIG )
125
116
126
117
set ( THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR} /3rdparty" )
127
118
128
- if ( SpecUtils_PYTHON_BINDINGS )
129
- FIND_PACKAGE (Python3 COMPONENTS Development )
130
- IF (NOT Python3_FOUND)
131
- MESSAGE (FATAL_ERROR "Unable to find PythonLibs." )
132
- ENDIF ()
133
- message ( "Python include dirs: ${Python3_INCLUDE_DIRS} " )
134
- endif ()
135
-
136
119
set ( sources
137
120
src/SpecFile.cpp
138
121
src/SpecFile_pcf.cpp
@@ -259,10 +242,6 @@ if( SpecUtils_ENABLE_URI_SPECTRA )
259
242
find_package ( ZLIB REQUIRED )
260
243
endif ( SpecUtils_ENABLE_URI_SPECTRA )
261
244
262
- if ( SpecUtils_PYTHON_BINDINGS )
263
- list ( APPEND sources bindings/python/SpecFile_py.cpp )
264
- endif ( SpecUtils_PYTHON_BINDINGS )
265
-
266
245
if ( SpecUtils_JAVA_SWIG )
267
246
list ( APPEND sources bindings/swig/SpecUtils.i )
268
247
endif ( SpecUtils_JAVA_SWIG )
@@ -351,28 +330,22 @@ if( SpecUtils_USE_FAST_FLOAT )
351
330
endif ( NOT FAST_FLOAT_FILE_PATH )
352
331
endif ( SpecUtils_USE_FAST_FLOAT )
353
332
354
- # We only need boost libraries if we are using boost to parse floats, if we are performing developer
355
- # checks, or we are creating Python bindings
356
- if ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS OR SpecUtils_PYTHON_BINDINGS )
333
+ # We only need boost libraries if we are using boost to parse floats, if we are performing developer checks
334
+ if ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS )
357
335
358
336
if ( DEFINED boost_SOURCE_DIR )
359
337
# We used CMake Fetch to get boost (e.g., in InterSpec)
360
338
target_link_libraries ( SpecUtils PUBLIC Boost::system Boost::spirit Boost::fusion Boost::algorithm Boost::functional Boost::crc )
361
339
362
340
else ( DEFINED boost_SOURCE_DIR )
363
-
364
- if ( SpecUtils_PYTHON_BINDINGS )
365
- list ( APPEND boost_libs_required python )
366
- endif ( SpecUtils_PYTHON_BINDINGS )
367
-
368
341
find_package ( Boost REQUIRED COMPONENTS system ${boost_libs_required} )
369
342
if ( NOT Boost_FOUND )
370
343
message (FATAL_ERROR "Couldnt Find Boost" )
371
344
endif ( NOT Boost_FOUND )
372
345
373
346
target_link_libraries ( SpecUtils PUBLIC Boost::system )
374
347
endif ( DEFINED boost_SOURCE_DIR )
375
- endif ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS OR SpecUtils_PYTHON_BINDINGS )
348
+ endif ( SpecUtils_USE_BOOST_SPIRIT OR PERFORM_DEVELOPER_CHECKS )
376
349
377
350
if ( SpecUtils_USE_FROM_CHARS )
378
351
if ( NOT (MSVC AND (MSVC_VERSION GREATER_EQUAL 1920)) )
@@ -418,17 +391,11 @@ elseif( NOT SpecUtils_USING_NO_THREADING )
418
391
endif ( SpecUtils_USE_WT_THREADPOOL )
419
392
420
393
421
-
422
394
if ( SpecUtils_ENABLE_URI_SPECTRA )
423
395
target_link_libraries ( SpecUtils PUBLIC ZLIB::ZLIB )
424
396
endif ( SpecUtils_ENABLE_URI_SPECTRA )
425
397
426
398
427
- if ( SpecUtils_PYTHON_BINDINGS )
428
- target_link_libraries ( SpecUtils PUBLIC Boost::python ${Boost_PYTHON_LIBRARY} ${Python3_LIBRARIES} )
429
- endif ( SpecUtils_PYTHON_BINDINGS )
430
-
431
-
432
399
if ( SpecUtils_JAVA_SWIG )
433
400
target_link_libraries ( SpecUtils PUBLIC ${JAVA_LIBRARIES} )
434
401
endif ( SpecUtils_JAVA_SWIG )
0 commit comments