stamen

Stamen - static menu generator
git clone git://git.dimitrijedobrota.com/stamen.git
Log | Files | Refs | README | LICENSE

variables.cmake (1382B)


      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 stamen
      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(stamen_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/stamen/stamen.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 STAMEN_SUPPRESS_C4251 _Pragma(\"warning(suppress:4251)\")
     19 #else
     20 #  define STAMEN_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       stamen_INCLUDES_WITH_SYSTEM
     34       "Use SYSTEM modifier for stamen's includes, disabling warnings"
     35       ON
     36   )
     37   mark_as_advanced(stamen_INCLUDES_WITH_SYSTEM)
     38   if(stamen_INCLUDES_WITH_SYSTEM)
     39     set(warning_guard SYSTEM)
     40   endif()
     41 endif()