mirror of https://github.com/aap/librw.git
Merge pull request #93 from madebr/cmake_tools_mainproject
cmake: build tools and install librw by default, only when main project
This commit is contained in:
commit
6b9c546ec1
|
@ -1,3 +1,8 @@
|
||||||
|
set(librw_MAINPROJECT ON)
|
||||||
|
if(DEFINED PROJECT_NAME)
|
||||||
|
set(librw_MAINPROJECT OFF)
|
||||||
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.8)
|
cmake_minimum_required(VERSION 3.8)
|
||||||
project(librw
|
project(librw
|
||||||
VERSION 0.0.1
|
VERSION 0.0.1
|
||||||
|
@ -54,8 +59,8 @@ endif()
|
||||||
|
|
||||||
include(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
option(LIBRW_TOOLS "Build librw tools" ON)
|
option(LIBRW_TOOLS "Build librw tools" ${librw_MAINPROJECT})
|
||||||
option(LIBRW_INSTALL "Install librw files" OFF)
|
option(LIBRW_INSTALL "Install librw files" ${librw_MAINPROJECT})
|
||||||
cmake_dependent_option(LIBRW_EXAMPLES "Build librw examples" ON "LIBRW_TOOLS;NOT LIBRW_PLATFORM_NULL" OFF)
|
cmake_dependent_option(LIBRW_EXAMPLES "Build librw examples" ON "LIBRW_TOOLS;NOT LIBRW_PLATFORM_NULL" OFF)
|
||||||
|
|
||||||
if(LIBRW_INSTALL)
|
if(LIBRW_INSTALL)
|
||||||
|
|
Loading…
Reference in New Issue