#[[++

Copyright (C) 2019 3MF Consortium (Original Author)

All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

This file has been generated by the Automatic Component Toolkit (ACT) version 1.5.0-develop3.

Abstract: This is an autogenerated CMake Project that demonstrates the
 usage of the Dynamic C++ bindings of the 3MF Library

Interface version: 2.2.0


]]

cmake_minimum_required(VERSION 3.5)

project(Example_ExtractInfo)
set(CMAKE_CXX_STANDARD 11)

# Determine the platform and set lib3mf_DIR accordingly
if(WIN32)
	# Path for Windows
	set(lib3mf_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib3mf-$ENV{LIB3MF_VERSION}-Windows/lib/cmake/lib3mf")
	find_package(lib3mf REQUIRED COMPONENTS CppDynamic)
elseif(APPLE)
	# Path for macOS (Darwin)
	set(lib3mf_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib3mf-$ENV{LIB3MF_VERSION}-Darwin/lib/cmake/lib3mf")
	find_package(lib3mf REQUIRED COMPONENTS CppDynamic)
else()
	# Path for Linux (Here we check twice to test for Debian / RPM packages properly)
	find_package(lib3mf QUIET COMPONENTS CppDynamic)
	# Check if the package was not found
	if(NOT lib3mf_FOUND)
		# lib3mf not found, so set lib3mf_DIR to the fallback directory
		set(lib3mf_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../lib3mf-$ENV{LIB3MF_VERSION}-Linux/lib/cmake/lib3mf")
		# Find package (lib3mf)
		find_package(lib3mf REQUIRED COMPONENTS CppDynamic)
	endif()
endif()

add_executable(Example_ExtractInfo "${CMAKE_CURRENT_SOURCE_DIR}/Source/ExtractInfo.cpp")

# In case of CDynamic and CppDynamic, the lib3mf::lib3mf is simply an alias to an interface
target_link_libraries(Example_ExtractInfo lib3mf::lib3mf ${CMAKE_DL_LIBS})

if (${MSVC})
	IF(${CMAKE_VERSION} VERSION_LESS 3.6.3)
		MESSAGE ("Note: You need to manually select a StartUp-project in Visual Studio.")
	ELSE()
		set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Example_ExtractInfo)
	ENDIF()
endif()

