From 9fe857d827b1fdb585e12d8387c3cb5fb5392c61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 27 Jun 2016 19:54:25 +0200 Subject: Export the targets on installation This allows using them in other cmake projects. --- CMakeLists.txt | 3 +++ src/CMakeLists.txt | 1 + 2 files changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ab6a72..52f8b4b 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,3 +29,6 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Profile Release Asan Ubsan." FORCE) endif(NOT CMAKE_BUILD_TYPE) + +# export targets +install(EXPORT cmark DESTINATION lib/cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2de501a..eb646ac 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -126,6 +126,7 @@ endif(MSVC) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) include (InstallRequiredSystemLibraries) install(TARGETS ${PROGRAM} ${LIBRARY} ${STATICLIBRARY} + EXPORT cmark RUNTIME DESTINATION bin LIBRARY DESTINATION ${LIB_INSTALL_DIR} ARCHIVE DESTINATION ${LIB_INSTALL_DIR} -- cgit v1.2.3 From cea0af4aad3208c190d006a7ba3497f4a3364b0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 27 Jun 2016 20:36:00 +0200 Subject: Fix cmake warning about CMP0048 --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 52f8b4b..8a50f9e 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,13 @@ cmake_minimum_required(VERSION 2.8.9) + +# prevent ugly developer warnings because version is set directly, not through project() +# it should be redone properly by using VERSION in project() if on CMake 3.x +if(CMAKE_MAJOR_VERSION GREATER 2) + cmake_policy(SET CMP0048 OLD) +endif() + project(cmark) + include("FindAsan.cmake") if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") -- cgit v1.2.3 From bf8bd830fc71ccb85e8fa1d51c71199c01f9db67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 27 Jun 2016 21:59:39 +0200 Subject: Change export install location --- CMakeLists.txt | 3 --- src/CMakeLists.txt | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8a50f9e..92b5450 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,3 @@ if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build, options are: Debug Profile Release Asan Ubsan." FORCE) endif(NOT CMAKE_BUILD_TYPE) - -# export targets -install(EXPORT cmark DESTINATION lib/cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index eb646ac..ea55800 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -139,6 +139,8 @@ install(FILES DESTINATION include ) +install(EXPORT cmark DESTINATION ${LIB_INSTALL_DIR}/cmake) + # Feature tests include(CheckIncludeFile) include(CheckCSourceCompiles) -- cgit v1.2.3