Skip to content

Commit

Permalink
Merge pull request #93 from madebr/cmake_tools_mainproject
Browse files Browse the repository at this point in the history
cmake: build tools and install librw by default, only when main project
  • Loading branch information
aap committed Aug 19, 2021
2 parents 5755996 + 7740b07 commit 6b9c546
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
set(librw_MAINPROJECT ON)
if(DEFINED PROJECT_NAME)
set(librw_MAINPROJECT OFF)
endif()

cmake_minimum_required(VERSION 3.8)
project(librw
VERSION 0.0.1
Expand Down Expand Up @@ -54,8 +59,8 @@ endif()

include(CMakeDependentOption)

option(LIBRW_TOOLS "Build librw tools" ON)
option(LIBRW_INSTALL "Install librw files" OFF)
option(LIBRW_TOOLS "Build librw tools" ${librw_MAINPROJECT})
option(LIBRW_INSTALL "Install librw files" ${librw_MAINPROJECT})
cmake_dependent_option(LIBRW_EXAMPLES "Build librw examples" ON "LIBRW_TOOLS;NOT LIBRW_PLATFORM_NULL" OFF)

if(LIBRW_INSTALL)
Expand Down

0 comments on commit 6b9c546

Please sign in to comment.