Bugfix: ${OpenMP_CXX_FLAGS} was used unconditionally

Fix building lensfun with CMake-3.9
This commit is contained in:
dcoppa 2017-08-11 10:26:05 +00:00
parent 54a91bd853
commit 1c87c10896

View File

@ -0,0 +1,16 @@
$OpenBSD: patch-tests_CMakeLists_txt,v 1.1 2017/08/11 10:26:05 dcoppa Exp $
Index: tests/CMakeLists.txt
--- tests/CMakeLists.txt.orig
+++ tests/CMakeLists.txt
@@ -7,7 +7,9 @@ TARGET_LINK_LIBRARIES(test_modifier lensfun ${COMMON_L
ADD_TEST(Modifier test_modifier)
find_package(OpenMP)
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+if(OpenMP_CXX_FOUND)
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+endif()
ADD_EXECUTABLE(test_modifier_color test_modifier_color.cpp)
TARGET_LINK_LIBRARIES(test_modifier_color lensfun ${COMMON_LIBS})