OVMS3-idf/tools/windows/idf_exe/CMakeLists.txt

26 lines
749 B
CMake
Raw Normal View History

2019-05-09 06:14:47 +00:00
cmake_minimum_required(VERSION 3.5)
project(idfexe)
set(VERSION 1.0)
set(ARCHIVE_NAME idf-exe-v${VERSION}.zip)
add_executable(idf idf_main.c)
set_target_properties(idf PROPERTIES C_STANDARD 99)
target_link_libraries(idf "-lshlwapi")
if(CMAKE_BUILD_TYPE STREQUAL Release)
add_custom_command(TARGET idf
POST_BUILD
COMMAND ${CMAKE_STRIP} idf.exe)
endif()
add_custom_target(dist ALL DEPENDS idf)
add_custom_command(
TARGET dist
POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E copy "${CMAKE_CURRENT_BINARY_DIR}/idf.exe" "${CMAKE_CURRENT_BINARY_DIR}/idf.py.exe"
COMMAND ${CMAKE_COMMAND} ARGS -E tar cfv ${ARCHIVE_NAME} --format=zip
"${CMAKE_CURRENT_BINARY_DIR}/idf.py.exe"
)