Commit 69ea516b authored by Martin Heistermann's avatar Martin Heistermann

cmake: only find_package(OVM) if the target does not exist

parent 2594cff1
......@@ -2,7 +2,9 @@ cmake_minimum_required(VERSION 3.12 FATAL_ERROR)
cmake_policy(VERSION 3.12.0)
project(OpenVolumeMeshExamples)
find_package(OpenVolumeMesh REQUIRED)
if (NOT TARGET OpenVolumeMesh::OpenVolumeMesh)
find_package(OpenVolumeMesh REQUIRED)
endif()
# Add target for first example
add_executable(simple_mesh simple_mesh/simple_mesh.cc)
......
......@@ -7,7 +7,9 @@ SET(SOURCE_FILES
unittests_iterators.cc
unittests_properties.cc)
find_package(OpenVolumeMesh REQUIRED)
if (NOT TARGET OpenVolumeMesh::OpenVolumeMesh)
find_package(OpenVolumeMesh REQUIRED)
endif()
set(TARGET_NAME "${OVM_TARGET_PREFIX}unittests")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment