@@ -22,6 +22,15 @@ else( )
2222 cmake_minimum_required ( VERSION 2.6 )
2323endif ( )
2424
25+ if ( CMAKE_GENERATOR MATCHES "NMake" )
26+ option ( NMAKE_COMPILE_VERBOSE "Print compile and link strings to the console" OFF )
27+ if ( NMAKE_COMPILE_VERBOSE )
28+ set ( CMAKE_START_TEMP_FILE "" )
29+ set ( CMAKE_END_TEMP_FILE "" )
30+ set ( CMAKE_VERBOSE_MAKEFILE 1 )
31+ endif ( )
32+ endif ( )
33+
2534# This becomes the name of the solution file
2635project ( clFFT )
2736
@@ -30,11 +39,6 @@ set( CLFFT_VERSION_MAJOR 2 )
3039set ( CLFFT_VERSION_MINOR 1 )
3140set ( CLFFT_VERSION_PATCH 0 )
3241set ( CLFFT_VERSION "${CLFFT_VERSION_MAJOR} .${CLFFT_VERSION_MINOR} .${CLFFT_VERSION_PATCH} " )
33-
34- # uncomment these to debug nmake and borland makefiles
35- #SET(CMAKE_START_TEMP_FILE "")
36- #SET(CMAKE_END_TEMP_FILE "")
37- #SET(CMAKE_VERBOSE_MAKEFILE 1)
3842
3943set ( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR} )
4044
@@ -173,19 +177,11 @@ get_filename_component( C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE )
173177if ( C_COMPILER_NAME STREQUAL "cl" )
174178 # Following options for nMake
175179 message ( STATUS "Detected MSVS Ver: " ${MSVC_VERSION} )
176- if ( NOT MSVC_IDE )
177- message ( STATUS "Using an nMake environment to build" )
178-
179- # I can't get nmake to work because of faulty /machine:, not sure that this isn't a cmake bug
180- # if( BUILD64 )
181- # set( CMAKE_EXE_LINKER_FLAGS "/machine:amd64 ${CMAKE_EXE_LINKER_FLAGS}" )
182- # set( CMAKE_SHARED_LINKER_FLAGS "/machine:amd64 ${CMAKE_SHARED_LINKER_FLAGS}" )
183- # set( CMAKE_MODULE_LINKER_FLAGS "/machine:amd64 ${CMAKE_MODULE_LINKER_FLAGS }" )
184- # else( )
185- # set( CMAKE_EXE_LINKER_FLAGS "/machine:i386 ${CMAKE_EXE_LINKER_FLAGS}" )
186- # endif( )
187180
188- endif ( )
181+ # CMake sets huge stack frames for windows, for whatever reason. We go with compiler default.
182+ string ( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} " )
183+ string ( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} " )
184+ string ( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} " )
189185
190186elseif ( C_COMPILER_NAME STREQUAL "gcc" )
191187 message ( STATUS "Detected GNU fortran compiler." )
0 commit comments