From 6d817fdb801ab74a53d96f0fefb02b258c820aab Mon Sep 17 00:00:00 2001 From: David Morgan Date: Tue, 8 Nov 2016 22:53:10 +0000 Subject: [PATCH] add option for enabling/disabling install() additions --- CMakeLists.txt | 3 +++ src/CMakeLists.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12cce5a..db34ee7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.1.0) project(taihen-parser) option(TEST "build and perform tests" OFF) +option(INSTALL_ENABLED "if enabled add files to cmake's install()" ON) option(USE_INBUILT_CTYPE "use internal ctype over system" OFF) option(USE_INBUILT_STRING "use internal string over system" OFF) @@ -17,6 +18,8 @@ if (${TEST}) add_test(NAME LexerTest COMMAND test-lexer) endif() +if (${INSTALL_ENABLED}) install(DIRECTORY include/taihen/ DESTINATION include/taihen FILES_MATCHING PATTERN "*.h") +endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 848cf7d..c9b1fd0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,7 +19,9 @@ add_definitions(-Os -ffunction-sections -fdata-sections) add_library(taihenparser lexer.c parser.c) +if (${INSTALL_ENABLED}) install(TARGETS taihenparser RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) +endif() -- 2.39.5