Compare commits

..

2 Commits

Author SHA1 Message Date
Ben V. Brown
89488b3bb5
Merge pull request #39 from bdd/cmake-install
Add CMake installation support
2023-05-09 08:41:50 +10:00
Berk D. Demir
2ad3ae7b50 Add CMake installation support
Allows installation with:
  `cmake --install . [--prefix /dir]`
2023-04-22 18:08:39 -07:00
2 changed files with 13 additions and 3 deletions

View File

@ -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"
@ -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()

View File

@ -18,3 +18,5 @@ if (WIN32)
elseif (APPLE)
target_link_libraries(blisp PRIVATE "-framework IOKit" "-framework CoreFoundation")
endif ()
install(TARGETS blisp DESTINATION bin)