Am Fri, 23 Apr 2021 14:49:49 +0200
schrieb Kornel Benko <kornel.be...@berlin.de>:

> Am Fri, 23 Apr 2021 11:59:36 +0200
> schrieb "'Kay F. Jahnke' via hugin and other free panoramic software"
> <hugin-ptx@googlegroups.com>:
> 
> > @Kornel: Can't we include find_package statements in the CMakeLists.txt 
> > to make cmake find the required libraries automatically? I noticed there 
> > is only a find_package for libexiv2 so far. Maybe you have the code for 
> > the other libraries needed by lux in another project already?
> > 
> > Kay
> >   
> 
> Sure we can. And we do already (CmakeLists.txt:206) for
>       Vc vigraimpex sfml-window sfml-graphics sfml-system exiv2
> Have I missed something?
> 
>       Kornel

How about the attached?

        Kornel

-- 
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
--- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to hugin-ptx+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/hugin-ptx/20210423154446.40df9e37%40admin1-desktop.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2921f52..851ebc9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -201,11 +201,17 @@ add_executable(${_pv} ${pv_sources})
 # Check if needed libraries available. Vc is a build time dependency only,
 # it provides a library (libVc.a) which has to be linked in. The other libs
 # are both build-time and run-time dependencies.
 
 set(LibFound ON)
-foreach(_l Vc vigraimpex sfml-window sfml-graphics sfml-system exiv2)
+set(reguired_libraries Vc vigraimpex sfml-window sfml-graphics sfml-system exiv2)
+if (WIN32 OR MSYS)
+  list(APPEND reguired_libraries Ole32 Comdlg32)
+else()
+  list(APPEND reguired_libraries pthread)
+endif()
+foreach(_l ${reguired_libraries})
 	string(TOUPPER ${_l} _UpcaseLib)
 	string(REGEX REPLACE "-" "_" _UpcaseLib ${_UpcaseLib})
 	set(libname "${_UpcaseLib}_LIBRARY")
 	find_library(${libname} NAMES ${_l})
 	if(${${libname}} MATCHES "_LIBRARY-NOTFOUND")
@@ -218,16 +224,10 @@ endforeach()
 
 if (NOT LibFound)
 	message(FATAL_ERROR "Missing needed libraries ... aborting cmake configuration")
 endif()
 
-if (WIN32 OR MSYS)
-  target_link_libraries(${_pv} ${USE_LEAK_SANITIZER} Ole32 Comdlg32)
-else()
-  target_link_libraries(${_pv} ${USE_LEAK_SANITIZER} pthread)
-endif()
-
 if (APPLE)
         set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules )
         find_package(EXIV2 REQUIRED)
         include_directories(${EXIV2_INCLUDE_DIR})
 endif (APPLE)

Attachment: pgp3UYmjQkklu.pgp
Description: Digitale Signatur von OpenPGP

Reply via email to