Skip to content

Commit

Permalink
CMake: Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniovazquezblanco committed Dec 9, 2024
1 parent 187045e commit 82af6ce
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
10 changes: 4 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required (VERSION 3.0)

project (fftw VERSION 3.3.10 LANGUAGES C)

if (NOT DEFINED CMAKE_BUILD_TYPE)
set (CMAKE_BUILD_TYPE Release CACHE STRING "Build type")
endif ()

project (fftw)

if (POLICY CMP0042)
cmake_policy (SET CMP0042 NEW)
endif ()
Expand Down Expand Up @@ -279,8 +279,6 @@ if (HAVE_AVX2)
list (APPEND SOURCEFILES ${fftw_dft_simd_avx2_SOURCE} ${fftw_rdft_simd_avx2_SOURCE})
endif ()

set (FFTW_VERSION 3.3.10)

set (PREC_SUFFIX)
if (ENABLE_FLOAT)
set (FFTW_SINGLE TRUE)
Expand Down Expand Up @@ -370,7 +368,7 @@ if (OPENMP_FOUND)
endif ()

foreach(subtarget ${subtargets})
set_target_properties (${subtarget} PROPERTIES SOVERSION 3.6.9 VERSION 3)
set_target_properties (${subtarget} PROPERTIES VERSION ${PROJECT_VERSION} SOVERSION ${PROJECT_VERSION_MAJOR})
install (TARGETS ${subtarget}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down Expand Up @@ -424,7 +422,7 @@ set (prefix ${CMAKE_INSTALL_PREFIX})
set (exec_prefix ${CMAKE_INSTALL_PREFIX})
set (libdir ${CMAKE_INSTALL_FULL_LIBDIR})
set (includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR})
set (VERSION ${FFTW_VERSION})
set (VERSION ${PROJECT_VERSION})
configure_file (fftw.pc.in fftw3${PREC_SUFFIX}.pc @ONLY)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/fftw3${PREC_SUFFIX}.pc
Expand Down
2 changes: 1 addition & 1 deletion FFTW3ConfigVersion.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

set (PACKAGE_VERSION "@FFTW_VERSION@")
set (PACKAGE_VERSION "@PROJECT_VERSION@")

# Check whether the requested PACKAGE_FIND_VERSION is compatible
if ("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
Expand Down
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ FFTW3@[email protected]: $(top_srcdir)/FFTW3Config.cmake.in
$(top_srcdir)/FFTW3Config.cmake.in > $@
FFTW3@[email protected]: $(top_srcdir)/FFTW3ConfigVersion.cmake.in
$(SED) \
-e 's|[@]FFTW_VERSION@|@PACKAGE_VERSION@|g' \
-e 's|[@]PROJECT_VERSION@|@PACKAGE_VERSION@|g' \
$(top_srcdir)/FFTW3ConfigVersion.cmake.in > $@
cmakedir = $(libdir)/cmake/fftw3
cmake_DATA = FFTW3@[email protected] FFTW3@[email protected]
Expand Down
6 changes: 3 additions & 3 deletions cmake.config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@
#define PACKAGE_NAME "fftw"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "fftw @FFTW_VERSION@"
#define PACKAGE_STRING "fftw @PROJECT_VERSION@"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "fftw"
Expand All @@ -303,7 +303,7 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "@FFTW_VERSION@"
#define PACKAGE_VERSION "@PROJECT_VERSION@"

/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
Expand Down Expand Up @@ -366,7 +366,7 @@
#cmakedefine USING_POSIX_THREADS 1

/* Version number of package */
#define VERSION "@FFTW_VERSION@"
#define VERSION "@PROJECT_VERSION@"

/* Use common Windows Fortran mangling styles for the Fortran interfaces. */
/* #undef WINDOWS_F77_MANGLING */
Expand Down

0 comments on commit 82af6ce

Please sign in to comment.