2017-12-07 04:09:27 +00:00
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
2015-08-04 21:37:12 +00:00
|
|
|
add_executable(bintoc bintoc.c)
|
|
|
|
macro(bintoc out in sym)
|
2015-09-02 02:31:33 +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()
|
|
|
|
add_custom_command(OUTPUT ${theOut}
|
|
|
|
COMMAND $<TARGET_FILE:bintoc> ARGS ${theIn} ${theOut} ${sym}
|
2017-12-29 07:56:31 +00:00
|
|
|
DEPENDS ${theIn} bintoc)
|
2015-08-04 21:37:12 +00:00
|
|
|
endmacro()
|
2017-12-07 04:09:27 +00:00
|
|
|
|
|
|
|
##################
|
|
|
|
# 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()
|