Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 27 additions & 20 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ else( )
cmake_minimum_required( VERSION 2.6 )
endif( )

if( CMAKE_GENERATOR MATCHES "NMake" )
option( NMAKE_COMPILE_VERBOSE "Print compile and link strings to the console" OFF )
if( NMAKE_COMPILE_VERBOSE )
set( CMAKE_START_TEMP_FILE "" )
set( CMAKE_END_TEMP_FILE "" )
set( CMAKE_VERBOSE_MAKEFILE 1 )
endif( )
endif( )

# This becomes the name of the solution file
project( clFFT )

Expand All @@ -30,11 +39,6 @@ set( CLFFT_VERSION_MAJOR 2 )
set( CLFFT_VERSION_MINOR 1 )
set( CLFFT_VERSION_PATCH 0 )
set( CLFFT_VERSION "${CLFFT_VERSION_MAJOR}.${CLFFT_VERSION_MINOR}.${CLFFT_VERSION_PATCH}")

# uncomment these to debug nmake and borland makefiles
#SET(CMAKE_START_TEMP_FILE "")
#SET(CMAKE_END_TEMP_FILE "")
#SET(CMAKE_VERBOSE_MAKEFILE 1)

set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR} )

Expand Down Expand Up @@ -80,8 +84,9 @@ else()
endif()

if( MSVC_IDE )
set( BUILD64 ${CMAKE_CL_64} )
set_property( GLOBAL PROPERTY USE_FOLDERS TRUE )

set( BUILD64 ${CMAKE_CL_64} )
else()
option( BUILD64 "Build a 64-bit product" ON )

Expand All @@ -93,15 +98,25 @@ else()
endif()
endif()

# These variables are meant to contain string which should be appended to the installation paths
# of library and executable binaries, respectively. They are meant to be user configurable/overridable.
set( SUFFIX_LIB_DEFAULT "" )
set( SUFFIX_BIN_DEFAULT "" )

# Modify the global find property to help us find libraries like Boost in the correct paths for 64-bit
# Essentially, find_library calls will look for /lib64 instead of /lib; works for windows and linux
if( BUILD64 )
set_property( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE )
message( STATUS "64bit build - FIND_LIBRARY_USE_LIB64_PATHS TRUE" )
else()

set( SUFFIX_LIB_DEFAULT "64" )
else( )
set_property( GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS FALSE )
message( STATUS "32bit build - FIND_LIBRARY_USE_LIB64_PATHS FALSE" )
endif()
endif( )

set( SUFFIX_LIB ${SUFFIX_LIB_DEFAULT} CACHE STRING "String to append to 'lib' install path" )
set( SUFFIX_BIN ${SUFFIX_BIN_DEFAULT} CACHE STRING "String to append to 'bin' install path" )

# Client is built only if boost is found; on windows, we need vs10 or higher
# Find Boost on the system, and configure the type of boost build we want
Expand Down Expand Up @@ -162,19 +177,11 @@ get_filename_component( C_COMPILER_NAME ${CMAKE_C_COMPILER} NAME_WE )
if( C_COMPILER_NAME STREQUAL "cl" )
# Following options for nMake
message( STATUS "Detected MSVS Ver: " ${MSVC_VERSION} )
if( NOT MSVC_IDE )
message( STATUS "Using an nMake environment to build" )

# I can't get nmake to work because of faulty /machine:, not sure that this isn't a cmake bug
# if( BUILD64 )
# set( CMAKE_EXE_LINKER_FLAGS "/machine:amd64 ${CMAKE_EXE_LINKER_FLAGS}" )
# set( CMAKE_SHARED_LINKER_FLAGS "/machine:amd64 ${CMAKE_SHARED_LINKER_FLAGS}" )
# set( CMAKE_MODULE_LINKER_FLAGS "/machine:amd64 ${CMAKE_MODULE_LINKER_FLAGS }" )
# else( )
# set( CMAKE_EXE_LINKER_FLAGS "/machine:i386 ${CMAKE_EXE_LINKER_FLAGS}" )
# endif( )

endif( )
# CMake sets huge stack frames for windows, for whatever reason. We go with compiler default.
string( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}" )
string( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}" )
string( REGEX REPLACE "/STACK:[0-9]+" "" CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS}" )

elseif( C_COMPILER_NAME STREQUAL "gcc" )
message( STATUS "Detected GNU fortran compiler." )
Expand Down
25 changes: 6 additions & 19 deletions src/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,22 +48,9 @@ target_link_libraries( Client clFFT ${Boost_LIBRARIES} ${OPENCL_LIBRARIES} ${DL_
set_target_properties( Client PROPERTIES VERSION ${CLFFT_VERSION} )
set_target_properties( Client PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/staging" )

if( BUILD64 )
# CPack configuration; include the executable into the package
install( TARGETS Client
RUNTIME DESTINATION bin64
LIBRARY DESTINATION lib64
ARCHIVE DESTINATION lib64/import
)

else()
# CPack configuration; include the executable into the package
install( TARGETS Client
RUNTIME DESTINATION bin32
LIBRARY DESTINATION lib32
ARCHIVE DESTINATION lib32/import
)
endif()

# configure_file( "${PROJECT_SOURCE_DIR}/client/CMakeLists.pack"
# "${PROJECT_BINARY_DIR}/samples/CMakeLists.txt" COPYONLY )
# CPack configuration; include the executable into the package
install( TARGETS Client
RUNTIME DESTINATION bin${SUFFIX_BIN}
LIBRARY DESTINATION lib${SUFFIX_LIB}
ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
)
21 changes: 6 additions & 15 deletions src/library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,9 @@ if( UNIX )
# set_target_properties( clFFT PROPERTIES COMPILE_FLAGS "-frtti" )
endif( )

if( BUILD64 )
# CPack configuration; include the executable into the package
install( TARGETS clFFT
RUNTIME DESTINATION bin64
LIBRARY DESTINATION lib64
ARCHIVE DESTINATION lib64/import
)
else()
# CPack configuration; include the executable into the package
install( TARGETS clFFT
RUNTIME DESTINATION bin32
LIBRARY DESTINATION lib32
ARCHIVE DESTINATION lib32/import
)
endif()
# CPack configuration; include the executable into the package
install( TARGETS clFFT
RUNTIME DESTINATION bin${SUFFIX_BIN}
LIBRARY DESTINATION lib${SUFFIX_LIB}
ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
)
8 changes: 1 addition & 7 deletions src/scripts/perf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,4 @@ set(GRAPHING_SCRIPTS measurePerformance.py
performanceUtility.py
)

if( BUILD64 )
set( BIN_DIR bin64 )
else()
set( BIN_DIR bin32 )
endif()

install( FILES ${GRAPHING_SCRIPTS} DESTINATION ${BIN_DIR} )
install( FILES ${GRAPHING_SCRIPTS} DESTINATION bin${SUFFIX_BIN} )
21 changes: 6 additions & 15 deletions src/statTimer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,9 @@ if( UNIX )
target_link_libraries( StatTimer -lrt )
endif( )

if( BUILD64 )
# CPack configuration; include the executable into the package
install( TARGETS StatTimer
RUNTIME DESTINATION bin64
LIBRARY DESTINATION lib64
ARCHIVE DESTINATION lib64/import
)
else()
# CPack configuration; include the executable into the package
install( TARGETS StatTimer
RUNTIME DESTINATION bin32
LIBRARY DESTINATION lib32
ARCHIVE DESTINATION lib32/import
)
endif()
# CPack configuration; include the executable into the package
install( TARGETS StatTimer
RUNTIME DESTINATION bin${SUFFIX_BIN}
LIBRARY DESTINATION lib${SUFFIX_LIB}
ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
)
18 changes: 4 additions & 14 deletions src/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,6 @@ set( clFFT.Test.Headers

set( clFFT.Test.Files ${clFFT.Test.Source} ${clFFT.Test.Headers} )



if( BUILD64 )
set( BIN_DIR bin64 )
set( LIB_DIR lib64 )
else()
set( BIN_DIR bin32 )
set( LIB_DIR lib32 )
endif()

set( LD_PTHREAD "" )
if( CMAKE_COMPILER_IS_GNUCXX )
set( CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}" )
Expand Down Expand Up @@ -103,7 +93,7 @@ set_target_properties( Test PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINAR

# CPack configuration; include the executable into the package
install( TARGETS Test
RUNTIME DESTINATION ${BIN_DIR}
LIBRARY DESTINATION ${LIB_DIR}
ARCHIVE DESTINATION ${LIB_DIR}/import
)
RUNTIME DESTINATION bin${SUFFIX_BIN}
LIBRARY DESTINATION lib${SUFFIX_LIB}
ARCHIVE DESTINATION lib${SUFFIX_LIB}/import
)