38 lines
1.3 KiB
CMake
38 lines
1.3 KiB
CMake
cmake_minimum_required(VERSION 3.0)
|
|
project(status-go)
|
|
|
|
SET(LIB_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/libstatus.a)
|
|
SET(LIB_SHARED_FILE ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/libstatus${CMAKE_SHARED_LIBRARY_SUFFIX})
|
|
SET(LIB_HEADER_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/)
|
|
|
|
add_custom_command(OUTPUT ${LIB_SHARED_FILE}
|
|
COMMAND make FORCE_ARCH=${STATUSGO_FORCE_ARCH} statusgo-shared-library
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_custom_target(statusgo_shared_target DEPENDS ${LIB_SHARED_FILE} ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_library(statusgo_shared SHARED IMPORTED GLOBAL)
|
|
|
|
add_dependencies(statusgo_shared statusgo_shared_target)
|
|
|
|
set_target_properties(statusgo_shared
|
|
PROPERTIES
|
|
IMPORTED_LOCATION ${LIB_SHARED_FILE}
|
|
INTERFACE_INCLUDE_DIRECTORIES ${LIB_HEADER_FOLDER})
|
|
|
|
|
|
add_custom_command(OUTPUT ${LIB_FILE}
|
|
COMMAND make statusgo-library
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
|
|
|
add_custom_target(statusgo_target DEPENDS ${LIB_FILE})
|
|
|
|
add_library(statusgo STATIC IMPORTED GLOBAL)
|
|
|
|
add_dependencies(statusgo statusgo_target)
|
|
|
|
set_target_properties(statusgo
|
|
PROPERTIES
|
|
IMPORTED_LOCATION ${LIB_FILE}
|
|
INTERFACE_INCLUDE_DIRECTORIES ${LIB_HEADER_FOLDER})
|