2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 12:24:56 +00:00

UWP fixes

This commit is contained in:
Jack Andersen
2017-12-06 18:09:27 -10:00
parent 559096feeb
commit 79f0336588
8 changed files with 83 additions and 3 deletions

View File

@@ -1,3 +1,4 @@
if(NOT CMAKE_CROSSCOMPILING)
add_executable(bintoc bintoc.c)
macro(bintoc out in sym)
if(IS_ABSOLUTE ${out})
@@ -14,3 +15,27 @@ macro(bintoc out in sym)
COMMAND $<TARGET_FILE:bintoc> ARGS ${theIn} ${theOut} ${sym}
DEPENDS ${theIn})
endmacro()
##################
# Package Export #
##################
# Add all targets to the build-tree export set
export(TARGETS bintoc FILE "${CMAKE_CURRENT_BINARY_DIR}/hecl-bintocTargets.cmake")
# Export the package for use from the build-tree
# (this registers the build-tree with a global CMake-registry)
export(PACKAGE hecl-bintoc)
# Create the atdnaConfig.cmake
# ... for the build tree
configure_file(hecl-bintocConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/hecl-bintocConfig.cmake" @ONLY)
# ... for the install tree
configure_file(hecl-bintocConfig.cmake.in "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/hecl-bintocConfig.cmake" @ONLY)
# ... for both
configure_file(hecl-bintocConfigVersion.cmake.in "${CMAKE_CURRENT_BINARY_DIR}/hecl-bintocConfigVersion.cmake" @ONLY)
else()
# Use native if cross compiling
find_package(hecl-bintoc REQUIRED)
endif()

View File

@@ -0,0 +1,25 @@
# - Config file for the bintoc package
# Compute paths
get_filename_component(BINTOC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
# Our library dependencies (contains definitions for IMPORTED targets)
if(NOT TARGET bintoc AND NOT bintoc_BINARY_DIR)
include("${BINTOC_CMAKE_DIR}/hecl-bintocTargets.cmake")
endif()
macro(bintoc out in sym)
if(IS_ABSOLUTE ${out})
set(theOut ${out})
else()
set(theOut ${CMAKE_CURRENT_BINARY_DIR}/${out})
endif()
if(IS_ABSOLUTE ${in})
set(theIn ${in})
else()
set(theIn ${CMAKE_CURRENT_SOURCE_DIR}/${in})
endif()
add_custom_command(OUTPUT ${theOut}
COMMAND $<TARGET_FILE:bintoc> ARGS ${theIn} ${theOut} ${sym}
DEPENDS ${theIn})
endmacro()

View File

@@ -0,0 +1,12 @@
set(PACKAGE_VERSION "@BINTOC_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()