Skip to content

Commit

Permalink
Merge pull request #55 from Flamefire/disable_tests_for_subproject
Browse files Browse the repository at this point in the history
Enable tests, docu, install only when building as root project
  • Loading branch information
nemtrif authored Mar 15, 2020
2 parents dc2442c + bee3b13 commit 944ef05
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
cmake_minimum_required (VERSION 3.0.2)
project (utf8cpp VERSION 3.1 LANGUAGES CXX)

option(UTF8_TESTS "Enable tests for UTF8-CPP" On)
option(UTF8_INSTALL "Enable installation for UTF8-CPP" On)
option(UTF8_SAMPLES "Enable building samples for UTF8-CPP" On)
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set(IS_ROOT_PROJECT ON)
else()
set(IS_ROOT_PROJECT OFF)
endif()

option(UTF8_TESTS "Enable tests for UTF8-CPP" ${IS_ROOT_PROJECT})
option(UTF8_INSTALL "Enable installation for UTF8-CPP" ${IS_ROOT_PROJECT})
option(UTF8_SAMPLES "Enable building samples for UTF8-CPP" ${IS_ROOT_PROJECT})

add_library(utf8cpp INTERFACE)
target_include_directories(utf8cpp INTERFACE
Expand Down

0 comments on commit 944ef05

Please sign in to comment.