1- cmake_minimum_required (VERSION 3.1...3. 20 FATAL_ERROR)
1+ cmake_minimum_required (VERSION 3.20 FATAL_ERROR)
22
33project (InterSpec VERSION 1.0.14)
44
@@ -139,14 +139,15 @@ if(BUILD_FOR_WEB_DEPLOYMENT)
139139 set (PERFORM_DEVELOPER_CHECKS OFF CACHE INTERNAL "" )
140140 set (SpecUtils_ENABLE_EQUALITY_CHECKS OFF CACHE INTERNAL "" )
141141 set (USE_SPECRUM_FILE_QUERY_WIDGET OFF )
142- set (USE_BATCH_TOOLS OFF )
143142endif (BUILD_FOR_WEB_DEPLOYMENT)
144143
145144
146145if ( IOS OR ANDROID OR BUILD_FOR_WEB_DEPLOYMENT )
147- set ( USE_BATCH_TOOLS OFF CACHE INTERNAL "" )
148- else ( )
149- option ( USE_BATCH_TOOLS "Enables (command line for now) batch processing." ON )
146+ set (USE_BATCH_CLI_TOOLS OFF CACHE INTERNAL "" )
147+ set (USE_BATCH_GUI_TOOLS OFF CACHE INTERNAL "" )
148+ else ()
149+ option ( USE_BATCH_CLI_TOOLS "Enables command line batch processing." ON )
150+ option ( USE_BATCH_GUI_TOOLS "Enables GUI batch processing." ON )
150151endif ()
151152
152153if (MSVC )
@@ -171,11 +172,13 @@ set(MAX_SPECTRUM_MEMMORY_SIZE_MB 256
171172# If we are creating the normal InterSpec executable, and the InterSpec_batch executable,
172173# we will compile LibInterSpec as a shared library, so both exes can use it; otherwise
173174# we will create a static library, and statically link it into our final executable.
174- # (Electron doesnt need a separate exe for batch)
175- if ( ((USE_BATCH_TOOLS AND NOT BUILD_AS_ELECTRON_APP) OR BUILD_AS_OSX_APP) AND NOT BUILD_AS_UNIT_TEST_SUITE )
175+ # (Electron doesnt need a separate exe for batch, and we dont care abour disk space for unit tests )
176+ if ( USE_BATCH_CLI_TOOLS AND NOT BUILD_AS_ELECTRON_APP AND NOT BUILD_AS_UNIT_TEST_SUITE )
176177 set ( INTERSPEC_LIB_TYPE SHARED )
178+ set ( BUILD_LibInterSpec_SHARED ON )
177179else ()
178180 set ( INTERSPEC_LIB_TYPE STATIC )
181+ set ( BUILD_LibInterSpec_SHARED OFF )
179182endif ()
180183
181184
@@ -590,21 +593,25 @@ if( USE_REL_ACT_TOOL )
590593endif ( USE_REL_ACT_TOOL )
591594
592595
593- if ( USE_BATCH_TOOLS )
596+ if ( USE_BATCH_CLI_TOOLS )
597+ list ( APPEND sources src/BatchCommandLine.cpp )
598+ list ( APPEND headers InterSpec/BatchCommandLine.h )
599+ endif ( USE_BATCH_CLI_TOOLS )
600+
601+
602+ if ( USE_BATCH_GUI_TOOLS )
594603 list ( APPEND sources
595- src/BatchCommandLine.cpp
596604 src/BatchGuiWidget.cpp
597605 src/BatchGuiAnaWidget.cpp
598606 src/BatchGuiInputFile.cpp
599607 )
600608
601609 list ( APPEND headers
602- InterSpec/BatchCommandLine.h
603610 InterSpec/BatchGuiWidget.h
604611 InterSpec/BatchGuiAnaWidget.h
605612 InterSpec/BatchGuiInputFile.h
606613 )
607- endif ( USE_BATCH_TOOLS )
614+ endif ( USE_BATCH_GUI_TOOLS )
608615
609616if ( (NOT IOS) AND (NOT ANDROID) AND (NOT BUILD_FOR_WEB_DEPLOYMENT) )
610617 list ( APPEND sources src/DirectorySelector.cpp )
@@ -736,13 +743,13 @@ if(WIN32)
736743 target_compile_definitions ( InterSpecLib PRIVATE InterSpec_EXPORTS )
737744 add_definitions ( /bigobj )
738745
739- if ( USE_BATCH_TOOLS )
746+ if ( INTERSPEC_LIB_TYPE STREQUAL "SHARED" )
740747 # We get error compiling multi-processor debug build of shared LibInterSpec, presumably due to some
741748 # file locking issues, so only enable parallel builds for release, if we are building shared LibInterSpec
742749 target_compile_options ( InterSpecLib PUBLIC $<$<CONFIG:Release>:/MP> )
743- else ( USE_BATCH_TOOLS )
750+ else ()
744751 add_definitions ( /MP )
745- endif ( USE_BATCH_TOOLS )
752+ endif ()
746753endif (WIN32 )
747754
748755target_link_libraries (
@@ -856,7 +863,7 @@ if( BUILD_AS_OSX_APP )
856863 ${FOUNDATION_LIBRARY}
857864 )
858865
859- if ( USE_BATCH_TOOLS )
866+ if ( INTERSPEC_LIB_TYPE STREQUAL "SHARED" )
860867 set_target_properties ( InterSpecLib PROPERTIES
861868 FRAMEWORK TRUE
862869 FRAMEWORK_VERSION A
@@ -875,7 +882,7 @@ if( BUILD_AS_OSX_APP )
875882 set_target_properties ( InterSpecLib PROPERTIES
876883 PUBLIC_HEADER "InterSpec_config.h"
877884 )
878- endif ( USE_BATCH_TOOLS )
885+ endif ( INTERSPEC_LIB_TYPE STREQUAL "SHARED" )
879886endif ( BUILD_AS_OSX_APP )
880887
881888
0 commit comments