Skip to content

Commit

Permalink
Merge pull request #23 from JonasVautherin/add-build-options
Browse files Browse the repository at this point in the history
make tests and examples optional
  • Loading branch information
gulrak authored Aug 13, 2019
2 parents e980ed0 + 57f3a14 commit b652667
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.7.2)
project(ghcfilesystem)

option(BUILD_TESTING "Enable tests" ON)
option(BUILD_EXAMPLES "Build examples" ON)

if(NOT DEFINED CMAKE_CXX_STANDARD)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
Expand Down Expand Up @@ -28,9 +31,15 @@ if(NOT hasParent)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(GhcHelper)
enable_testing()
add_subdirectory(test)
add_subdirectory(examples)

if(BUILD_TESTING)
enable_testing()
add_subdirectory(test)
endif()

if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
endif()

include(CMakePackageConfigHelpers)
Expand Down

0 comments on commit b652667

Please sign in to comment.