Skip to content

Commit

Permalink
Merge pull request #256 from davidchisnall/master
Browse files Browse the repository at this point in the history
Modernise the CMake build system slightly.
  • Loading branch information
vstakhov committed Aug 22, 2021
2 parents e3d6be3 + 16e3609 commit be59572
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
PROJECT(libucl C)
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0 FATAL_ERROR)
CMAKE_MINIMUM_REQUIRED(VERSION 3.1.0 FATAL_ERROR)

SET(LIBUCL_VERSION_MAJOR 0)
SET(LIBUCL_VERSION_MINOR 5)
SET(LIBUCL_VERSION_PATCH 0)
SET(LIBUCL_VERSION_MINOR 8)
SET(LIBUCL_VERSION_PATCH 1)

SET(LIBUCL_VERSION
"${LIBUCL_VERSION_MAJOR}.${LIBUCL_VERSION_MINOR}.${LIBUCL_VERSION_PATCH}")
Expand Down Expand Up @@ -237,9 +237,8 @@ ADD_LIBRARY(ucl ${LIB_TYPE} ${UCLSRC})
ADD_LIBRARY(ucl::ucl ALIAS ucl)
SET_TARGET_PROPERTIES(ucl PROPERTIES VERSION ${LIBUCL_VERSION} SOVERSION ${LIBUCL_VERSION_MAJOR})
TARGET_INCLUDE_DIRECTORIES(ucl
PUBLIC
include
PRIVATE
include
src
uthash
klib)
Expand Down Expand Up @@ -305,10 +304,16 @@ ENDIF(UNIX)
SET_TARGET_PROPERTIES(ucl PROPERTIES
PUBLIC_HEADER "${UCLHDR}")

INSTALL(TARGETS ucl DESTINATION ${CMAKE_INSTALL_LIBDIR}
INSTALL(TARGETS ucl EXPORT uclConfig DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

IF(ENABLE_UTILS MATCHES "ON")
ADD_SUBDIRECTORY(utils)
ENDIF()

install(EXPORT uclConfig
FILE ucl-config.cmake
NAMESPACE ucl::
DESTINATION "share/ucl"
)

0 comments on commit be59572

Please sign in to comment.