@@ -20,7 +20,6 @@ option( SpecUtils_BUILD_UNIT_TESTS "Builds unit tests" OFF )
2020option ( SpecUtils_BUILD_FUZZING_TESTS "Builds fuzzing tests, requires clang"  OFF  )
2121option ( SpecUtils_BUILD_REGRESSION_TEST "Creates executable to perform interactive regression test"  OFF  )
2222option ( SpecUtils_BUILD_EXAMPLE "Builds example SpecUtil applications"  OFF  )
23- option ( SpecUtils_PYTHON_BINDINGS "Creates python bindings to the c++ code"  OFF  )
2423option ( SpecUtils_JAVA_SWIG "Creates swig/java bindings to the c++ code"  OFF  )
2524option ( SpecUtils_FORTRAN_SWIG "Enables build/test of swig/FORTRAN bindings"  OFF  )
2625option ( 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 )
3029option ( SpecUtils_USE_SIMD "Use SIMD operations; i386/x64 only right now, and very alpha, and extremely minimally used"  OFF  )
3130option ( 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 
3231option ( 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  )
4233
4334
4435set ( SpecUtils_FLT_PARSE_METHOD "default_value"  CACHE  STRING  [[How to parse lists of numbers.
@@ -86,7 +77,7 @@ endif()
8677
8778
8879# 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  )
9081  get_directory_property (hasParent PARENT_DIRECTORY )
9182  if (NOT  hasParent)
9283    option (${PROJECT_NAME} _USE_MSVC_MultiThreadDLL "Use dynamically-link runtime library."  OFF )
@@ -100,7 +91,7 @@ if( MSVC )
10091    endif ()
10192    message (STATUS  "Using CMAKE_MSVC_RUNTIME_LIBRARY ${CMAKE_MSVC_RUNTIME_LIBRARY} " )
10293  endif (NOT  hasParent)
103- endif ( MSVC  )
94+ endif ( MSVC  AND  SpecUtils_BUILD_UNIT_TESTS  )
10495
10596
10697if ( SpecUtils_BUILD_EXAMPLE )
@@ -125,14 +116,6 @@ endif( SpecUtils_JAVA_SWIG )
125116
126117set ( THIRD_PARTY_DIR "${CMAKE_CURRENT_SOURCE_DIR} /3rdparty"  )
127118
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- 
136119set ( sources 
137120     src/SpecFile.cpp
138121     src/SpecFile_pcf.cpp
@@ -259,10 +242,6 @@ if( SpecUtils_ENABLE_URI_SPECTRA )
259242  find_package ( ZLIB REQUIRED )
260243endif ( SpecUtils_ENABLE_URI_SPECTRA )
261244
262- if ( SpecUtils_PYTHON_BINDINGS )
263-   list ( APPEND  sources  bindings/python/SpecFile_py.cpp )
264- endif ( SpecUtils_PYTHON_BINDINGS )
265- 
266245if ( SpecUtils_JAVA_SWIG )
267246  list ( APPEND  sources  bindings/swig/SpecUtils.i )
268247endif ( SpecUtils_JAVA_SWIG )
@@ -351,28 +330,22 @@ if( SpecUtils_USE_FAST_FLOAT )
351330  endif ( NOT  FAST_FLOAT_FILE_PATH )
352331endif ( SpecUtils_USE_FAST_FLOAT )
353332
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 )
357335
358336  if ( DEFINED  boost_SOURCE_DIR )
359337    # We used CMake Fetch to get boost (e.g., in InterSpec) 
360338    target_link_libraries ( SpecUtils PUBLIC  Boost::system  Boost::spirit Boost::fusion Boost::algorithm Boost::functional Boost::crc )
361339
362340  else ( DEFINED  boost_SOURCE_DIR )
363-   
364-     if ( SpecUtils_PYTHON_BINDINGS )
365-       list ( APPEND  boost_libs_required python )
366-     endif ( SpecUtils_PYTHON_BINDINGS )
367-   
368341    find_package ( Boost REQUIRED COMPONENTS system  ${boost_libs_required}  )
369342    if ( NOT  Boost_FOUND )
370343      message (FATAL_ERROR "Couldnt Find Boost" )
371344    endif ( NOT  Boost_FOUND )
372345
373346    target_link_libraries ( SpecUtils PUBLIC  Boost::system  )
374347  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 )
376349
377350if ( SpecUtils_USE_FROM_CHARS )
378351  if ( NOT  (MSVC  AND  (MSVC_VERSION  GREATER_EQUAL  1920)) )
@@ -418,17 +391,11 @@ elseif( NOT SpecUtils_USING_NO_THREADING )
418391endif ( SpecUtils_USE_WT_THREADPOOL )
419392
420393
421- 
422394if ( SpecUtils_ENABLE_URI_SPECTRA )
423395  target_link_libraries ( SpecUtils PUBLIC  ZLIB::ZLIB )
424396endif ( SpecUtils_ENABLE_URI_SPECTRA )
425397
426398
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- 
432399if ( SpecUtils_JAVA_SWIG )
433400  target_link_libraries ( SpecUtils PUBLIC  ${JAVA_LIBRARIES}  )
434401endif ( SpecUtils_JAVA_SWIG )
0 commit comments