Skip to content

Commit

Permalink
Merge pull request #39 from bdd/cmake-install
Browse files Browse the repository at this point in the history
Add CMake installation support
  • Loading branch information
Ralim authored May 8, 2023
2 parents de4a9cd + 2ad3ae7 commit 89488b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 10 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,22 @@ set_property(TARGET libblisp_obj PROPERTY POSITION_INDEPENDENT_CODE 1)
add_library(libblisp SHARED $<TARGET_OBJECTS:libblisp_obj>)
add_library(libblisp_static STATIC $<TARGET_OBJECTS:libblisp_obj>)

set(BLISP_PUBLIC_HEADERS
include/blisp.h
include/blisp_easy.h
include/blisp_chip.h
include/blisp_struct.h
include/blisp_util.h)

set_target_properties(libblisp PROPERTIES
PUBLIC_HEADER "include/blisp.h"
PUBLIC_HEADER "${BLISP_PUBLIC_HEADERS}"
VERSION 0.0.3
SOVERSION 1
LIBRARY_OUTPUT_DIRECTORY "shared"
OUTPUT_NAME "blisp")

set_target_properties(libblisp_static PROPERTIES
PUBLIC_HEADER "include/blisp.h"
PUBLIC_HEADER "${BLISP_PUBLIC_HEADERS}"
VERSION 0.0.3
SOVERSION 1
ARCHIVE_OUTPUT_DIRECTORY "static"
Expand Down Expand Up @@ -74,6 +80,8 @@ elseif(APPLE)
write_file(${CMAKE_SOURCE_DIR}/vendor/libserialport/config.h "// bypass errors.")
endif()

install(TARGETS libblisp libblisp_static DESTINATION lib)

if(BLISP_BUILD_CLI)
add_subdirectory(tools/blisp)
endif()
4 changes: 3 additions & 1 deletion tools/blisp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ if (WIN32)
target_link_libraries(blisp PRIVATE Setupapi.lib)
elseif (APPLE)
target_link_libraries(blisp PRIVATE "-framework IOKit" "-framework CoreFoundation")
endif ()
endif ()

install(TARGETS blisp DESTINATION bin)

0 comments on commit 89488b3

Please sign in to comment.