Skip to content

Commit

Permalink
Fix some CMake issues (#901)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: flashlight/wav2letter#901

Pull Request resolved: #281

- Make sure the name of the exported target is `imgclass`, not `imclass`
- Export some variables denoting flashlight backend
- Enable CUDA in example (and wav2letter) builds if fl is built with CUDA
- Bump minimum CMake version in wav2letter
- Bump w2l to C++14

Reviewed By: tlikhomanenko

Differential Revision: D25163993

fbshipit-source-id: 1af02fd50f0c7570f8811035f7217881052668d5
  • Loading branch information
jacobkahn authored and facebook-github-bot committed Nov 24, 2020
1 parent acf04d4 commit cd0aa18
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
9 changes: 7 additions & 2 deletions cmake/flashlightConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,22 @@ if(NOT TARGET flashlight::fl-libraries)
endif()
endif()

# Flashlight backend
set(FL_USE_CPU @FL_USE_CPU@)
set(FL_USE_CUDA @FL_USE_CUDA@)
set(FL_USE_OPENCL @FL_USE_OPENCL@)

# For legacy configurations
# Libraries
set(flashlight_LIBRARIES flashlight::fl-libraries flashlight::fl-libraries-cuda)
set(flashlight_LIBRARIES flashlight::fl-libraries)
if (@FL_BUILD_CORE@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight)
endif()
if (@FL_BUILD_APP_ASR@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-asr)
endif()
if (@FL_BUILD_APP_IMG_CLASS@)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-imclass)
set(flashlight_LIBRARIES ${flashlight_LIBRARIES} flashlight::flashlight-app-imgclass)
endif()
# Include dirs
if (EXISTS @PACKAGE_INCLUDE_DIRS@)
Expand Down
7 changes: 5 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,11 @@ We can link flashlight with the following CMake configuration:
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package(flashlight REQUIRED)
find_package(ArrayFire REQUIRED)
find_package(flashlight CONFIG REQUIRED)
if (FL_USE_CUDA)
enable_language(CUDA)
endif()
# ...
add_executable(myProject project.cpp)
Expand Down

0 comments on commit cd0aa18

Please sign in to comment.