forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[matplotplusplus] Fix find and use dependencies (microsoft#17552)
* [matplotplusplus] Fix find and use dependencies * update version record
- Loading branch information
Showing
5 changed files
with
156 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
diff --git a/source/3rd_party/CMakeLists.txt b/source/3rd_party/CMakeLists.txt | ||
index ab58bbd..f9fed7e 100644 | ||
--- a/source/3rd_party/CMakeLists.txt | ||
+++ b/source/3rd_party/CMakeLists.txt | ||
@@ -67,57 +67,69 @@ find_package(PkgConfig) | ||
# Lots of optional packages are not a good idea in general. | ||
# It makes the library much less "packagable" (https://youtu.be/sBP17HQAQjk) | ||
# and much more difficult to make sure it works on multiple OSs | ||
-find_package(JPEG) | ||
-if(JPEG_FOUND) | ||
+ | ||
+if (WITH_JPEG) | ||
+find_package(JPEG REQUIRED) | ||
+if(1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_jpeg) | ||
target_link_libraries(cimg INTERFACE ${JPEG_LIBRARIES}) | ||
target_include_directories(cimg INTERFACE ${JPEG_INCLUDE_DIRS}) | ||
endif() | ||
+endif() | ||
|
||
-find_package(TIFF) | ||
-if(TIFF_FOUND) | ||
+if (WITH_TIFF) | ||
+find_package(TIFF REQUIRED) | ||
+if(1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_tiff) | ||
target_link_libraries(cimg INTERFACE ${TIFF_LIBRARIES}) | ||
target_include_directories(cimg INTERFACE ${TIFF_INCLUDE_DIRS}) | ||
endif() | ||
+endif() | ||
|
||
-find_package(ZLIB) | ||
-if(ZLIB_FOUND) | ||
- find_package(PNG) | ||
- if (PNG_FOUND) | ||
+if (WITH_ZLIB) | ||
+find_package(ZLIB REQUIRED) | ||
+if(1) | ||
+ find_package(libpng CONFIG REQUIRED) | ||
+ if (1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_zlib cimg_use_png) | ||
- target_include_directories(cimg INTERFACE ${ZLIB_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS}) | ||
- target_link_libraries(cimg INTERFACE ${ZLIB_LIBRARIES} ${PNG_LIBRARIES}) | ||
+ target_link_libraries(cimg INTERFACE ZLIB::ZLIB png) | ||
endif () | ||
endif() | ||
+endif() | ||
|
||
-find_package(LAPACK) | ||
-if(LAPACK_FOUND) | ||
+if (WITH_LAPACK) | ||
+find_package(LAPACK REQUIRED) | ||
+if(1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_lapack) | ||
target_link_libraries(cimg INTERFACE ${LAPACK_LIBRARIES}) | ||
target_include_directories(cimg INTERFACE ${LAPACK_INCLUDE_DIRS}) | ||
endif() | ||
+endif() | ||
|
||
-find_package(BLAS) | ||
-if(BLAS_FOUND) | ||
+if (WITH_BLAS) | ||
+find_package(BLAS REQUIRED) | ||
+if(1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_blas) | ||
target_link_libraries(cimg INTERFACE ${BLAS_LIBRARIES}) | ||
target_include_directories(cimg INTERFACE ${BLAS_INCLUDE_DIRS}) | ||
endif() | ||
+endif() | ||
|
||
-find_package(FFTW) | ||
-if(FFTW_FOUND) | ||
+if (WITH_FFTW3) | ||
+find_package(FFTW3 CONFIG REQUIRED) | ||
+if(1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_fftw3) | ||
- target_link_libraries(cimg INTERFACE ${FFTW_LIBRARIES}) | ||
- target_include_directories(cimg INTERFACE ${FFTW_INCLUDE_DIRS}) | ||
+ target_link_libraries(cimg INTERFACE FFTW3::fftw3) | ||
+endif() | ||
endif() | ||
|
||
if (CMAKE_MODULE_PATH) | ||
- find_package(OpenCV QUIET) | ||
- if (OpenCV_FOUND) | ||
+ if (WITH_OPENCV) | ||
+ find_package(OpenCV CONFIG REQUIRED) | ||
+ if (1) | ||
target_compile_definitions(cimg INTERFACE cimg_use_opencv) | ||
- target_link_libraries(cimg INTERFACE ${OpenCV_LIBRARIES}) | ||
- target_include_directories(cimg INTERFACE ${OpenCV_INCLUDE_DIRS}) | ||
+ target_link_libraries(cimg INTERFACE opencv_core) | ||
+ endif() | ||
endif() | ||
else() | ||
message("No CMAKE_MODULE_PATH path for OpenCV configured") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters