From b4f46f8f9df8d75b0c92f9a03862a458bfb10186 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 15 Sep 2021 15:38:00 -0400 Subject: [PATCH] feat: add cmakelist to status-go for c/c++ projects --- CMakeLists.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..deefe4ac2 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,37 @@ +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.so) +SET(LIB_HEADER_FOLDER ${CMAKE_CURRENT_SOURCE_DIR}/build/bin/libstatus.h) + +add_custom_command(OUTPUT ${LIB_SHARED_FILE} + COMMAND make statusgo-shared-library + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + +add_custom_target(statusgo_shared_target DEPENDS ${LIB_SHARED_FILE}) + +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})