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)
16 get_filename_component(nanocoatIncludePath
17 "${CMAKE_SOURCE_DIR}/../../nanocoat/include" ABSOLUTE)
18 message(STATUS "NanoCoat include is: ${nanocoatIncludePath}")
20 # Use standard JNI search
21 find_package(JNI QUIET)
23 # If JNI was not found, use a local copy as a fallback
25 # Where are the headers?
27 "${nanocoatIncludePath}/3rdparty/jni")
34 add_library(libEmulatorBase SHARED
53 # Includes for the build
54 target_include_directories(libEmulatorBase PUBLIC
56 "${nanocoatIncludePath}"
59 # Libraries for the build
60 get_filename_component(nanocoatLibPath
61 "${CMAKE_SOURCE_DIR}/../emulator-base/build/cmake-libsNativeNanoCoat"
63 message(STATUS "NanoCoat lib is: ${nanocoatLibPath}")
64 target_link_directories(libEmulatorBase PUBLIC
66 target_link_libraries(libEmulatorBase PUBLIC
69 # It is easier to find this when it is in the build root
70 set_target_properties(libEmulatorBase PROPERTIES
71 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
72 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
73 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
75 foreach(outputConfig ${CMAKE_CONFIGURATION_TYPES})
76 string(TOUPPER "${outputConfig}" outputConfig)
78 set_target_properties(libEmulatorBase PROPERTIES
79 RUNTIME_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}"
80 LIBRARY_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}"
81 ARCHIVE_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}")
84 # Use a more basic name for the library
85 set_target_properties(libEmulatorBase PROPERTIES
93 # Always make this position independent
94 set_property(TARGET libEmulatorBase
95 PROPERTY POSITION_INDEPENDENT_CODE ON)