Skip to content
Snippets Groups Projects
Commit 72b56a6b authored by Franck Pérignon's avatar Franck Pérignon
Browse files

Allow comp/link without fftw and/or scales - fix bug

parent b1c1eee9
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@
# --- Set a version number for the package ---
set(${PARMES_LIBRARY_NAME}_version 1.0.0)
# --- The name of the exe to be created (test purpose)
# This exe will be linked with libPARMES_LIBRARY_NAME
set(EXE_NAME ${PARMES_LIBRARY_NAME}Run)
......@@ -15,8 +15,14 @@ set(EXE_NAME ${PARMES_LIBRARY_NAME}Run)
# Any file in those dirs will be used to create libparmes
set(${PARMES_LIBRARY_NAME}_SRCDIRS
.
fftw
)
if(WITH_FFTW)
set(${PARMES_LIBRARY_NAME}_SRCDIRS
${${PARMES_LIBRARY_NAME}_SRCDIRS} fftw
)
endif()
# --- scales ---
if(WITH_SCALES)
set(${PARMES_LIBRARY_NAME}_SRCDIRS
......@@ -74,15 +80,14 @@ append_Fortran_FLAGS("-Wall -fPIC")
if(WITH_PPM)
add_subdirectory(ppmInterface)
endif()
if(WITH_FFTW)
find_package(FFTW REQUIRED)
include_directories(${FFTW_INCLUDE_DIRS})
set(LIBS ${LIBS} ${FFTW_LIBRARIES})
endif()
# for python setup.py
set(FFTWLIB ${FFTW_LIBRARY} PARENT_SCOPE)
# for python setup.py
set(FFTWLIB ${FFTW_LIBRARY} PARENT_SCOPE)
endif()
# ============= Generates ParmesConfig.hpp =============
# The file PARMES_LIBRARY_NAME_defines.hpp will be generated from config.hpp.cmake;
if(EXISTS ${CMAKE_SOURCE_DIR}/config.hpp.cmake)
......@@ -159,12 +164,14 @@ target_link_libraries(${PARMES_LIBRARY_NAME} ${LIBS})
### set(PARMES_LINKED_LIBRARIES ${LIBS} ${PARMES_LIBRARY_NAME} PARENT_SCOPE)
# ============= Creates the executable =============
add_executable(${EXE_NAME} ${${EXE_NAME}_SRC})
add_dependencies(${EXE_NAME} ${PARMES_LIBRARY_NAME})
# libs to link with EXE_NAME
target_link_libraries(${EXE_NAME} ${PARMES_LIBRARY_NAME})
target_link_libraries(${EXE_NAME} ${LIBS})
if(WITH_FFTW)
add_executable(${EXE_NAME} ${${EXE_NAME}_SRC})
add_dependencies(${EXE_NAME} ${PARMES_LIBRARY_NAME})
# libs to link with EXE_NAME
target_link_libraries(${EXE_NAME} ${PARMES_LIBRARY_NAME})
target_link_libraries(${EXE_NAME} ${LIBS})
endif()
# ============== Add tests ==============
if(WITH_TESTS)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment