CMakeNMakeWindowsSystemConfig.cmake 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. # Microsoft specific config file
  2. # NOTE: all entries in here MUST be CACHE values, regular SET will NOT WORK!
  3. # Suffixes
  4. SET (CMAKE_EXECUTABLE_SUFFIX ".exe" CACHE STRING
  5. "Executable suffix.")
  6. SET (CMAKE_MODULE_SUFFIX ".dll" CACHE STRING
  7. "Module library suffix.")
  8. SET (CMAKE_OBJECT_FILE_SUFFIX ".obj" CACHE STRING
  9. "Object file suffix.")
  10. SET (CMAKE_SHLIB_SUFFIX ".dll" CACHE STRING
  11. "Shared library suffix.")
  12. SET (CMAKE_STATICLIB_SUFFIX ".lib" CACHE STRING
  13. "Static library suffix.")
  14. # ANSI
  15. SET (CMAKE_ANSI_CFLAGS "" CACHE INTERNAL
  16. "What flags are required by the c++ compiler to make it ansi.")
  17. # We will hardcode them for now. Make sure to fix that in the future
  18. SET (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
  19. SET (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
  20. SET (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
  21. SET (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
  22. SET (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
  23. SET (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
  24. SET (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
  25. # Build type
  26. SET (CMAKE_BUILD_TYPE Debug CACHE STRING
  27. "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel.")
  28. # C++
  29. SET (CMAKE_CXX_COMPILER cl CACHE FILEPATH
  30. "Name of C++ compiler used.")
  31. SET (CMAKE_CXX_FLAGS "/W3 /Zm1000 /GX /GR" CACHE STRING
  32. "Flags used by the compiler during all build types, /GX /GR are for exceptions and rtti in VC++, /Zm1000 increases the compiler's memory allocation to support ANSI C++/stdlib.")
  33. SET (CMAKE_CXX_FLAGS_DEBUG "/MDd /Zi /Od /GZ" CACHE STRING
  34. "Flags used by the compiler during debug builds.")
  35. SET (CMAKE_CXX_FLAGS_MINSIZEREL "/MD /O1" CACHE STRING
  36. "Flags used by the compiler during release minsize builds.")
  37. SET (CMAKE_CXX_FLAGS_RELEASE "/MD /O2" CACHE STRING
  38. "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
  39. SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /Zi /O2" CACHE STRING
  40. "Flags used by the compiler during Release with Debug Info builds.")
  41. # C
  42. SET (CMAKE_C_COMPILER cl CACHE FILEPATH
  43. "Name of C compiler used.")
  44. SET (CMAKE_C_FLAGS "/W3 /Zm1000" CACHE STRING
  45. "Flags for C compiler.")
  46. SET (CMAKE_C_LIBPATH_FLAG "-LIBPATH:" CACHE STRING
  47. "Flags used to specify a link path. No space will be appended (use single quotes around value to insert trailing space).")
  48. SET (CMAKE_C_LINK_EXECUTABLE_FLAG "/link" CACHE STRING
  49. "Flags used to create an executable.")
  50. SET (CMAKE_C_OUTPUT_EXECUTABLE_FILE_FLAG "/Fe" CACHE STRING
  51. "Flags used to specify executable filename. No space will be appended (use single quotes around value to insert trailing space).")
  52. SET (CMAKE_C_OUTPUT_OBJECT_FILE_FLAG "/Fo" CACHE STRING
  53. "Flags used to specify output filename. No space will be appended (use single quotes around value to insert trailing space).")
  54. # Library manager
  55. SET (CMAKE_LIBRARY_MANAGER lib CACHE FILEPATH
  56. "Name of the library manager used (static lib).")
  57. SET (CMAKE_LIBRARY_MANAGER_FLAGS "/nologo" CACHE STRING
  58. "Flags used by the library manager.")
  59. SET (CMAKE_LIBRARY_MANAGER_OUTPUT_FILE_FLAG "/out:" CACHE STRING
  60. "Flags used to specify output filename by the library manager. No space will be appended (use single quotes around value to insert trailing space).")
  61. # Linker (DLL/exe)
  62. SET (CMAKE_LINKER link CACHE FILEPATH
  63. "Name of linker used.")
  64. SET (CMAKE_LINKER_FLAGS "/nologo /STACK:10000000 /machine:I386" CACHE STRING
  65. "Flags used by the linker.")
  66. SET (CMAKE_LINKER_FLAGS_DEBUG "/debug /pdbtype:sept" CACHE STRING
  67. "Flags used by the linker during debug builds.")
  68. SET (CMAKE_LINKER_FLAGS_MINSIZEREL "" CACHE STRING
  69. "Flags used by the linker during release minsize builds.")
  70. SET (CMAKE_LINKER_FLAGS_RELEASE "" CACHE STRING
  71. "Flags used by the linker during release builds.")
  72. SET (CMAKE_LINKER_FLAGS_RELWITHDEBINFO "/debug /pdbtype:sept" CACHE STRING
  73. "Flags used by the linker during Release with Debug Info builds.")
  74. SET (CMAKE_LINKER_HIDE_PARAMETERS 1 CACHE BOOL
  75. "Hide linker parameters when it is run.")
  76. SET (CMAKE_LINKER_OUTPUT_FILE_FLAG "/out:" CACHE STRING
  77. "Flags used to specify output filename by the linker. No space will be appended (use single quotes around value to insert trailing space).")
  78. SET (CMAKE_LINKER_SHARED_LIBRARY_FLAG "/dll" CACHE STRING
  79. "Flags used to create a shared library.")
  80. # Standard lib
  81. SET (CMAKE_STANDARD_WINDOWS_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING
  82. "Libraries linked by defalut with all applications.")
  83. # Make
  84. SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
  85. "Program used to build from makefiles.")
  86. # Threads
  87. SET (CMAKE_USE_WIN32_THREADS 1 CACHE BOOL
  88. "Use the win32 thread library.")
  89. # The following variables are advanced
  90. MARK_AS_ADVANCED(
  91. WORDS_BIGENDIAN
  92. HAVE_LIMITS_H
  93. HAVE_UNISTD_H
  94. CMAKE_EXECUTABLE_SUFFIX
  95. CMAKE_MODULE_SUFFIX
  96. CMAKE_OBJECT_FILE_SUFFIX
  97. CMAKE_SHLIB_SUFFIX
  98. CMAKE_STATICLIB_SUFFIX
  99. CMAKE_ANSI_CFLAGS
  100. CMAKE_BUILD_TYPE
  101. CMAKE_CXX_COMPILER
  102. CMAKE_CXX_FLAGS
  103. CMAKE_CXX_FLAGS_DEBUG
  104. CMAKE_CXX_FLAGS_MINSIZEREL
  105. CMAKE_CXX_FLAGS_RELEASE
  106. CMAKE_CXX_FLAGS_RELWITHDEBINFO
  107. CMAKE_C_COMPILER
  108. CMAKE_C_FLAGS
  109. CMAKE_C_LIBPATH_FLAG
  110. CMAKE_C_LINK_EXECUTABLE_FLAG
  111. CMAKE_C_OUTPUT_EXECUTABLE_FILE_FLAG
  112. CMAKE_C_OUTPUT_OBJECT_FILE_FLAG
  113. CMAKE_LIBRARY_MANAGER
  114. CMAKE_LIBRARY_MANAGER_FLAGS
  115. CMAKE_LIBRARY_MANAGER_OUTPUT_FILE_FLAG
  116. CMAKE_LINKER
  117. CMAKE_LINKER_FLAGS
  118. CMAKE_LINKER_FLAGS_DEBUG
  119. CMAKE_LINKER_FLAGS_MINSIZEREL
  120. CMAKE_LINKER_FLAGS_RELEASE
  121. CMAKE_LINKER_FLAGS_RELWITHDEBINFO
  122. CMAKE_LINKER_HIDE_PARAMETERS
  123. CMAKE_LINKER_OUTPUT_FILE_FLAG
  124. CMAKE_LINKER_SHARED_LIBRARY_FLAG
  125. CMAKE_MAKE_PROGRAM
  126. CMAKE_STANDARD_WINDOWS_LIBRARIES
  127. CMAKE_USE_WIN32_THREADS
  128. )