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
17 include("${CMAKE_SOURCE_DIR}/../../nanocoat/cmake/pre-fixes.cmake"
19 include("${CMAKE_SOURCE_DIR}/../../nanocoat/cmake/utils.cmake"
21 include("${CMAKE_SOURCE_DIR}/../../nanocoat/cmake/fixes.cmake"
23 include("${CMAKE_SOURCE_DIR}/../../nanocoat/cmake/jni.cmake"
25 include("${CMAKE_SOURCE_DIR}/../../nanocoat/cmake/threads.cmake"
29 get_filename_component(nanocoatIncludePath
30 "${CMAKE_SOURCE_DIR}/../../nanocoat/include" ABSOLUTE)
31 message(STATUS "NanoCoat include is: ${nanocoatIncludePath}")
34 add_library(libEmulatorBase SHARED
47 c/mle_scritchuibaseobject.c
48 c/mle_scritchuidylib.c
56 # Includes for the build
57 target_include_directories(libEmulatorBase PUBLIC
59 "${nanocoatIncludePath}"
62 ${JAVA_INCLUDE_PATH2})
64 # Libraries for the build
65 get_filename_component(nanocoatLibPath
66 "${CMAKE_SOURCE_DIR}/../emulator-base/build/cmake-libsNativeNanoCoat"
68 message(STATUS "NanoCoat lib is: ${nanocoatLibPath}")
69 target_link_directories(libEmulatorBase PUBLIC
71 target_link_libraries(libEmulatorBase PUBLIC
72 "BaseStatic" "${JAVA_JVM_LIBRARY}")
74 # It is easier to find this when it is in the build root
75 set_target_properties(libEmulatorBase PROPERTIES
76 RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
77 LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
78 ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
80 foreach(outputConfig ${CMAKE_CONFIGURATION_TYPES})
81 string(TOUPPER "${outputConfig}" outputConfig)
83 set_target_properties(libEmulatorBase PROPERTIES
84 RUNTIME_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}"
85 LIBRARY_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}"
86 ARCHIVE_OUTPUT_DIRECTORY_${outputConfig} "${CMAKE_BINARY_DIR}")
89 # Use a more basic name for the library
90 set_target_properties(libEmulatorBase PROPERTIES
98 # Always make this position independent
99 set_property(TARGET libEmulatorBase
100 PROPERTY POSITION_INDEPENDENT_CODE ON)