1 # ---------------------------------------------------------------------------
3 # Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
4 # ---------------------------------------------------------------------------
5 # SquirrelJME is under the Mozilla Public License Version 2.0.
6 # See license.mkd for licensing and copyright information.
7 # ---------------------------------------------------------------------------
8 # DESCRIPTION: CMake Helper for project
10 cmake_minimum_required(VERSION 3.5)
13 project(libEmulatorBase)
15 # Use standard JNI search
16 find_package(JNI QUIET)
18 # If JNI was not found, use a local copy as a fallback
20 # Where are the headers?
29 add_library(libEmulatorBase SHARED
47 # Includes for the build
48 target_include_directories(libEmulatorBase PUBLIC
50 "${CMAKE_SOURCE_DIR}/../../nanocoat/include"
53 # It is easier to find this when it is in the build root
54 set_target_properties(libEmulatorBase PROPERTIES
55 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
56 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
57 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
59 foreach(outputConfig ${CMAKE_CONFIGURATION_TYPES})
60 string(TOUPPER "${outputConfig}" outputConfig)
62 set_target_properties(libEmulatorBase PROPERTIES
63 RUNTIME_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}"
64 LIBRARY_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}"
65 ARCHIVE_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}")
68 # Use a more basic name for the library
69 set_target_properties(libEmulatorBase PROPERTIES
77 # Always make this position independent
78 set_property(TARGET libEmulatorBase
79 PROPERTY POSITION_INDEPENDENT_CODE ON)