fftw library in cmake

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

fftw library in cmake

aishwarya selvaraj
Hi all ,
Below is my CMakelist.txt. I'm getting an error as mentioned below .
I'm not to rectify it .
Could anyone help me out here please ?

​CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
PROJECT(PROSE)

ExternalProject_Add(project_fftw
  #GIT_REPOSITORY  https://github.com/FFTW/fftw3
  URL "http://www.fftw.org/fftw-3.3.2.tar.gz"   
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/fftw
  CONFIGURE_COMMAND ""
    #--Build step-----------------
  BUILD_COMMAND ""
    #--Install step---------------
  UPDATE_COMMAND "" # Skip annoying updates for every build
  INSTALL_COMMAND ""
 )

​include_directories(${CMAKE_CURRENT_BINARY_DIR}/fftw/src/project_fftw/api)
ExternalProject_Get_Property(project_fftw install_dir)
add_library(fftw STATIC IMPORTED)
add_dependencies(fftw project_fftw)

​ADD_EXECUTABLE(prose ${PROJECT_SOURCE_DIR}/src/prose.cpp)
TARGET_LINK_LIBRARIES(prose fftw  )

ERROR:
Scanning dependencies of target prose
[100%] Building CXX object CMakeFiles/prose.dir/src/prose.cpp.o
make[2]: *** No rule to make target `fftw-NOTFOUND', needed by `prose'.  Stop.
make[1]: *** [CMakeFiles/prose.dir/all] Error 2
make: *** [all] Error 2

Where Am I going wrong ?



--
Regards,
Aishwarya Selvaraj

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: fftw library in cmake

Nils Gladitz-2

On 04/21/2017 03:40 PM, aishwarya selvaraj wrote:

add_library(fftw STATIC IMPORTED)
[...]
TARGET_LINK_LIBRARIES(prose fftw  )
[...]
make[2]: *** No rule to make target `fftw-NOTFOUND', needed by `prose'.  Stop.

You are creating an IMPORTED target "fftw" but you aren't populating its IMPORTED_LOCATION [1] (or IMPORTED_LOCATION_<CONFIG> [2]) target property.
Without it CMake does not know what on disk library file to link to.

You can set target properties with set_property() or set_target_properties().

Nils

[1] https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION.html
[2] https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION_CONFIG.html

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: fftw library in cmake

aishwarya selvaraj
Thanks Nils for the input .

On Fri, Apr 21, 2017 at 7:19 PM, Nils Gladitz <[hidden email]> wrote:

On 04/21/2017 03:40 PM, aishwarya selvaraj wrote:

add_library(fftw STATIC IMPORTED)
[...]
TARGET_LINK_LIBRARIES(prose fftw  )
[...]
make[2]: *** No rule to make target `fftw-NOTFOUND', needed by `prose'.  Stop.

You are creating an IMPORTED target "fftw" but you aren't populating its IMPORTED_LOCATION [1] (or IMPORTED_LOCATION_<CONFIG> [2]) target property.
Without it CMake does not know what on disk library file to link to.

You can set target properties with set_property() or set_target_properties().

Nils

[1] https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION.html
[2] https://cmake.org/cmake/help/latest/prop_tgt/IMPORTED_LOCATION_CONFIG.html



--
Regards,
Aishwarya Selvaraj

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake