metaforce/bintoc/bintocHelpers.cmake

38 lines
1.2 KiB
CMake
Raw Permalink Normal View History

2018-10-06 19:53:57 -07:00
function(bintoc out in sym)
2017-12-06 20:09:27 -08:00
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()
2018-09-08 14:34:37 -07:00
get_filename_component(outDir ${theOut} DIRECTORY)
file(MAKE_DIRECTORY ${outDir})
ExternalProject_Get_Property(bintoc INSTALL_DIR)
2017-12-06 20:09:27 -08:00
add_custom_command(OUTPUT ${theOut}
COMMAND "${INSTALL_DIR}/bin/bintoc" ARGS ${theIn} ${theOut} ${sym}
DEPENDS ${theIn} bintoc)
2018-10-06 19:53:57 -07:00
endfunction()
2020-03-01 22:59:31 -08:00
function(bintoc_compress 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()
get_filename_component(outDir ${theOut} DIRECTORY)
file(MAKE_DIRECTORY ${outDir})
ExternalProject_Get_Property(bintoc INSTALL_DIR)
2020-03-01 22:59:31 -08:00
add_custom_command(OUTPUT ${theOut}
COMMAND "${INSTALL_DIR}/bin/bintoc" ARGS --compress ${theIn} ${theOut} ${sym}
DEPENDS ${theIn} bintoc)
2020-03-01 22:59:31 -08:00
endfunction()