Skip to content

Commit

Permalink
Merge pull request dropbox#53 from njwhite/master
Browse files Browse the repository at this point in the history
Generate pkg-config File & Add Install Target
  • Loading branch information
artwyman committed Apr 19, 2016
2 parents 3ae1800 + 8076ba7 commit eefbd63
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,12 @@
# generated files
test
libjson11.a
json11.pc

# Cmake
CMakeCache.txt
CTestTestfile.cmake
CMakeFiles
CMakeScripts
cmake_install.cmake
install_manifest.txt
8 changes: 6 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
project(json11 CXX)

cmake_minimum_required(VERSION 3.2)
project(json11 VERSION 1.0.0 LANGUAGES CXX)

enable_testing()

Expand All @@ -9,6 +8,11 @@ target_include_directories(json11 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_compile_options(json11
PUBLIC -std=c++11
PRIVATE -fno-rtti -fno-exceptions -Wall -Wextra -Werror)
configure_file("json11.pc.in" "json11.pc" @ONLY)

add_executable(json11_test test.cpp)
target_link_libraries(json11_test json11)

install(TARGETS json11 DESTINATION lib)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/json11.hpp" DESTINATION include)
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/json11.pc" DESTINATION lib/pkgconfig)
9 changes: 9 additions & 0 deletions json11.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
prefix=@CMAKE_INSTALL_PREFIX@
libdir=${prefix}/lib
includedir=${prefix}/include

Name: @PROJECT_NAME@
Description: json11 is a tiny JSON library for C++11, providing JSON parsing and serialization.
Version: @PROJECT_VERSION@
Libs: -L${libdir} -ljson11
Cflags: -I${includedir}

0 comments on commit eefbd63

Please sign in to comment.