@@ -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
8084endif ()
8185
8286if ( MSVC_IDE )
83- set ( BUILD64 ${CMAKE_CL_64} )
8487 set_property ( GLOBAL PROPERTY USE_FOLDERS TRUE )
88+
89+ set ( BUILD64 ${CMAKE_CL_64} )
8590else ()
8691 option ( BUILD64 "Build a 64-bit product" ON )
8792
@@ -93,15 +98,25 @@ else()
9398 endif ()
9499endif ()
95100
101+ # These variables are meant to contain string which should be appended to the installation paths
102+ # of library and executable binaries, respectively. They are meant to be user configurable/overridable.
103+ set ( SUFFIX_LIB_DEFAULT "" )
104+ set ( SUFFIX_BIN_DEFAULT "" )
105+
96106# Modify the global find property to help us find libraries like Boost in the correct paths for 64-bit
97107# Essentially, find_library calls will look for /lib64 instead of /lib; works for windows and linux
98108if ( BUILD64 )
99109 set_property ( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE )
100110 message ( STATUS "64bit build - FIND_LIBRARY_USE_LIB64_PATHS TRUE" )
101- else ()
111+
112+ set ( SUFFIX_LIB_DEFAULT "64" )
113+ else ( )
102114 set_property ( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE )
103115 message ( STATUS "32bit build - FIND_LIBRARY_USE_LIB64_PATHS FALSE" )
104- endif ()
116+ endif ( )
117+
118+ set ( SUFFIX_LIB ${SUFFIX_LIB_DEFAULT} CACHE STRING "String to append to 'lib' install path" )
119+ set ( SUFFIX_BIN ${SUFFIX_BIN_DEFAULT} CACHE STRING "String to append to 'bin' install path" )
105120
106121# Client is built only if boost is found; on windows, we need vs10 or higher
107122# Find Boost on the system, and configure the type of boost build we want
@@ -162,19 +177,11 @@ get_filename_component( C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE )
162177if ( C_COMPILER_NAME STREQUAL "cl" )
163178 # Following options for nMake
164179 message ( STATUS "Detected MSVS Ver: " ${MSVC_VERSION} )
165- if ( NOT MSVC_IDE )
166- message ( STATUS "Using an nMake environment to build" )
167-
168- # I can't get nmake to work because of faulty /machine:, not sure that this isn't a cmake bug
169- # if( BUILD64 )
170- # set( CMAKE_EXE_LINKER_FLAGS "/machine:amd64 ${CMAKE_EXE_LINKER_FLAGS}" )
171- # set( CMAKE_SHARED_LINKER_FLAGS "/machine:amd64 ${CMAKE_SHARED_LINKER_FLAGS}" )
172- # set( CMAKE_MODULE_LINKER_FLAGS "/machine:amd64 ${CMAKE_MODULE_LINKER_FLAGS }" )
173- # else( )
174- # set( CMAKE_EXE_LINKER_FLAGS "/machine:i386 ${CMAKE_EXE_LINKER_FLAGS}" )
175- # endif( )
176180
177- 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} " )
178185
179186elseif ( C_COMPILER_NAME STREQUAL "gcc" )
180187 message ( STATUS "Detected GNU fortran compiler." )
0 commit comments