CMakeNMakeWindowsSystemConfig.cmake 6.3 KB

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