poafloc

poafloc - Parser Of Arguments For Lines Of Commands
git clone git://git.dimitrijedobrota.com/poafloc.git
Log | Files | Refs | README | LICENSE

variables.cmake (1392B)


      1 # ---- Developer mode ----
      2 
      3 # Developer mode enables targets and code paths in the CMake scripts that are
      4 # only relevant for the developer(s) of poafloc
      5 # Targets necessary to build the project must be provided unconditionally, so
      6 # consumers can trivially build and package the project
      7 if(PROJECT_IS_TOP_LEVEL)
      8   option(poafloc_DEVELOPER_MODE "Enable developer mode" OFF)
      9   option(BUILD_SHARED_LIBS "Build shared libs." OFF)
     10 endif()
     11 
     12 # ---- Suppress C4251 on Windows ----
     13 
     14 # Please see include/poafloc/poafloc.hpp for more details
     15 set(pragma_suppress_c4251 "
     16 /* This needs to suppress only for MSVC */
     17 #if defined(_MSC_VER) && !defined(__ICL)
     18 #  define POAFLOC_SUPPRESS_C4251 _Pragma(\"warning(suppress:4251)\")
     19 #else
     20 #  define POAFLOC_SUPPRESS_C4251
     21 #endif
     22 ")
     23 
     24 # ---- Warning guard ----
     25 
     26 # target_include_directories with the SYSTEM modifier will request the compiler
     27 # to omit warnings from the provided paths, if the compiler supports that
     28 # This is to provide a user experience similar to find_package when
     29 # add_subdirectory or FetchContent is used to consume this project
     30 set(warning_guard "")
     31 if(NOT PROJECT_IS_TOP_LEVEL)
     32   option(
     33       poafloc_INCLUDES_WITH_SYSTEM
     34       "Use SYSTEM modifier for poafloc's includes, disabling warnings"
     35       ON
     36   )
     37   mark_as_advanced(poafloc_INCLUDES_WITH_SYSTEM)
     38   if(poafloc_INCLUDES_WITH_SYSTEM)
     39     set(warning_guard SYSTEM)
     40   endif()
     41 endif()