2017-12-07 04:09:27 +00:00
|
|
|
# - Config file for the bintoc package
|
2020-03-02 06:59:31 +00:00
|
|
|
|
2017-12-07 04:09:27 +00:00
|
|
|
# Compute paths
|
|
|
|
get_filename_component(BINTOC_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
|
2020-03-02 06:59:31 +00:00
|
|
|
|
2017-12-07 04:09:27 +00:00
|
|
|
# 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()
|
|
|
|
|
2018-10-07 02:53:57 +00:00
|
|
|
function(bintoc out in sym)
|
2017-12-07 04:09:27 +00: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 21:34:37 +00:00
|
|
|
get_filename_component(outDir ${theOut} DIRECTORY)
|
|
|
|
file(MAKE_DIRECTORY ${outDir})
|
2017-12-07 04:09:27 +00:00
|
|
|
add_custom_command(OUTPUT ${theOut}
|
|
|
|
COMMAND $<TARGET_FILE:bintoc> ARGS ${theIn} ${theOut} ${sym}
|
|
|
|
DEPENDS ${theIn})
|
2018-10-07 02:53:57 +00:00
|
|
|
endfunction()
|
2020-03-02 06:59:31 +00: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})
|
|
|
|
add_custom_command(OUTPUT ${theOut}
|
|
|
|
COMMAND $<TARGET_FILE:bintoc> ARGS --compress ${theIn} ${theOut} ${sym}
|
|
|
|
DEPENDS ${theIn})
|
|
|
|
endfunction()
|