From 1b644132f079e8c927a62d4b7e3ac6f92c823f46 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 18 Jan 2017 21:46:25 +1100 Subject: [PATCH] cmake: bump for caching of values --- CMakeLists.txt | 31 +++++++++++-------------------- cmake | 2 +- 2 files changed, 12 insertions(+), 21 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index db2f2c65..f351d140 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,5 @@ cmake_minimum_required(VERSION 3.7.1) project(util-cruft) -add_definitions(-DPACKAGE="libcruft-util") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} @@ -10,18 +9,10 @@ set(CMAKE_MODULE_PATH include(CheckFunctionExists) include(CheckCXXCompilerFlag) -include (nc_cxx) -include (nc_platform) -include (nc_optimisation) -include (nc_warnings) +include (nc) -include (compile_flag) -include (link_flag) include (search_libs) -#append_compile_flag(-std=c++1z) -#set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z") - find_package(RAGEL 6.9 REQUIRED) @@ -92,6 +83,8 @@ search_libs (DL_LIBS dlopen dl) search_libs (CLOCK_LIB clock_gettime rt c) search_libs (MATH_LIB cos m) +list (APPEND LIBS ${DL_LIBS} ${CLOCK_LIB} ${MATH_LIB}) + ############################################################################### # platform wrappers @@ -151,6 +144,7 @@ endif () # Common files list ( APPEND UTIL_FILES + hash/md2.cpp adapter.hpp adapter.cpp alloc/fwd.hpp @@ -421,15 +415,6 @@ list ( add_library(cruft-util ${UTIL_FILES}) -##----------------------------------------------------------------------------- -option(INLINE "build pkg-config for immediate local usage") -if (INLINE) - configure_file(libcruft-util-inline.pc.in libcruft-util.pc) -else () - configure_file(libcruft-util-system.pc.in libcruft-util.pc) -endif () - - ############################################################################### add_executable(hash tools/hash.cpp) add_executable(json-clean tools/json-clean.cpp) @@ -439,6 +424,7 @@ add_executable(scratch tools/scratch.cpp) ############################################################################### +configure_file(libcruft-util-system.pc.in libcruft-util.pc) configure_file(Doxyfile.in Doxyfile) @@ -449,7 +435,12 @@ add_subdirectory(test) ############################################################################### -list (APPEND LIBS cruft-util stdc++fs) +list (APPEND LIBS cruft-util) + +get_directory_property(HAS_PARENT PARENT_DIRECTORY) +if (HAS_PARENT) + set (CRUFT_UTIL_LIBS ${LIBS} PARENT_SCOPE) +endif () target_link_libraries(hash ${LIBS}) target_link_libraries(json-clean ${LIBS}) diff --git a/cmake b/cmake index 566b98e5..c640c551 160000 --- a/cmake +++ b/cmake @@ -1 +1 @@ -Subproject commit 566b98e5cb94a584c2f25f26ce59e39c0d71b20c +Subproject commit c640c55181ec55002c4a3e3101b1a6f8226a21bb