diff options
author | patrick.roth <roth@stettbacher.ch> | 2019-11-28 17:03:54 +0100 |
---|---|---|
committer | patrick.roth <roth@stettbacher.ch> | 2019-11-28 17:03:54 +0100 |
commit | 69c213b82bc21c94c8dc71191d4f814e5c370003 (patch) | |
tree | 44db396bcb42841759a4fa21817752a68a5427ef | |
parent | Update README.md (diff) | |
download | o3000-driver-69c213b82bc21c94c8dc71191d4f814e5c370003.tar.gz o3000-driver-69c213b82bc21c94c8dc71191d4f814e5c370003.zip |
distinguish between 32 or 64 bit compiler version
Diffstat (limited to '')
-rw-r--r-- | CMakeLists.txt | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index f5913b6..f61faa9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,13 @@ project(O-3000-Driver) cmake_minimum_required(VERSION 3.0) + +if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CC_ARCH "64") +else(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CC_ARCH "32") +endif(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake) # library version definition @@ -45,15 +52,15 @@ target_link_libraries(${LIB_NAME} pthread ${LIBUSB_LIBRARIES}) install(TARGETS ${LIB_NAME} DESTINATION lib) install(FILES "o3000.h" "o3000_portable.h" "image_header.h" DESTINATION "include/o3000") -add_custom_target(release_mingw64 DEPENDS ${LIB_NAME}) +add_custom_target(release DEPENDS ${LIB_NAME}) add_custom_command( - TARGET release_mingw64 + TARGET release COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/include/o3000 - COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/MinGW64 + COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/MinGW${CC_ARCH} COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/o3000.h ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/include/o3000 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/o3000_portable.h ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/include/o3000 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/image_header.h ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/include/o3000 - COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_NAME:${LIB_NAME}>* ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/MinGW64 - COMMAND ${CMAKE_COMMAND} -E tar "cfv" "libo3000-${VERSION_STR}.zip" --format=zip libo3000-${VERSION_STR} + COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/$<TARGET_FILE_NAME:${LIB_NAME}>* ${CMAKE_CURRENT_BINARY_DIR}/libo3000-${VERSION_STR}/MinGW${CC_ARCH} + COMMAND ${CMAKE_COMMAND} -E tar "cfv" "libo3000-${VERSION_STR}-${CC_ARCH}bit.zip" --format=zip libo3000-${VERSION_STR} COMMAND ${CMAKE_COMMAND} -E remove_directory libo3000-${VERSION_STR} ) |