11cmake_minimum_required (VERSION 3.15 )
22
3- project (differintC VERSION 0.0.2.1 LANGUAGES CXX )
3+ project (differintC VERSION 0.0.2.3 LANGUAGES CXX )
44
55# Set compiler optimization flags
66if (MSVC )
@@ -13,28 +13,44 @@ set(CMAKE_CXX_STANDARD 17)
1313set (CMAKE_CXX_STANDARD_REQUIRED ON )
1414
1515# Robust FFTW setup
16- set (FFTW_ROOT "${CMAKE_CURRENT_SOURCE_DIR } /thirdparty/fftw" )
16+ # set(FFTW_ROOT "${CMAKE_CURRENT_SOURCE_DIR}/thirdparty/fftw")
17+ # set(FFTW_INCLUDE_DIRS "${FFTW_ROOT}/include")
18+ #
19+ # # Check if we're in a temporary build directory
20+ # if(NOT EXISTS "${FFTW_ROOT}/lib/libfftw3-3.lib")
21+ # # Try to find FFTW in the source directory
22+ # set(FFTW_ROOT_SOURCE "${CMAKE_SOURCE_DIR}/thirdparty/fftw")
23+ # if(EXISTS "${FFTW_ROOT_SOURCE}/lib/libfftw3-3.lib")
24+ # set(FFTW_ROOT "${FFTW_ROOT_SOURCE}")
25+ # set(FFTW_INCLUDE_DIRS "${FFTW_ROOT}/include")
26+ # message(STATUS "Using source FFTW directory: ${FFTW_ROOT}")
27+ # else()
28+ # # Fallback to system FFTW
29+ # find_package(FFTW)
30+ # if(FFTW_FOUND)
31+ # message(STATUS "Using system FFTW")
32+ # set(FFTW_LIBRARIES ${FFTW_LIBRARIES})
33+ # else()
34+ # message(FATAL_ERROR "FFTW not found! Please install FFTW or check the thirdparty directory.")
35+ # endif()
36+ # endif()
37+ # endif()
38+
39+ # Use bundled FFTW from thirdparty
40+ set (FFTW_ROOT "${CMAKE_SOURCE_DIR } /thirdparty/fftw" )
1741set (FFTW_INCLUDE_DIRS "${FFTW_ROOT} /include" )
1842
19- # Check if we're in a temporary build directory
20- if (NOT EXISTS "${FFTW_ROOT} /lib/libfftw3-3.lib" )
21- # Try to find FFTW in the source directory
22- set (FFTW_ROOT_SOURCE "${CMAKE_SOURCE_DIR } /thirdparty/fftw" )
23- if (EXISTS "${FFTW_ROOT_SOURCE} /lib/libfftw3-3.lib" )
24- set (FFTW_ROOT "${FFTW_ROOT_SOURCE} " )
25- set (FFTW_INCLUDE_DIRS "${FFTW_ROOT} /include" )
26- message (STATUS "Using source FFTW directory: ${FFTW_ROOT} " )
27- else ()
28- # Fallback to system FFTW
29- find_package (FFTW )
30- if (FFTW_FOUND)
31- message (STATUS "Using system FFTW" )
32- set (FFTW_LIBRARIES ${FFTW_LIBRARIES} )
33- else ()
34- message (FATAL_ERROR "FFTW not found! Please install FFTW or check the thirdparty directory." )
35- endif ()
36- endif ()
43+ if (WIN32 )
44+ set (FFTW_LIBRARIES "${FFTW_ROOT} /lib/libfftw3-3.lib" )
45+ else ()
46+ set (FFTW_LIBRARIES "${FFTW_ROOT} /lib/libfftw3.so" )
47+ endif ()
48+
49+ # Optional sanity check
50+ if (NOT EXISTS "${FFTW_LIBRARIES} " )
51+ message (FATAL_ERROR "Missing FFTW library at: ${FFTW_LIBRARIES} " )
3752endif ()
53+ ##########################################
3854
3955
4056if (WIN32 )
0 commit comments