File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -17,19 +17,26 @@ project(Flibcpp VERSION "${Flibcpp_VERSION}" LANGUAGES CXX Fortran)
17
17
#---------------------------------------------------------------------------#
18
18
# OPTIONS
19
19
#---------------------------------------------------------------------------#
20
-
21
- if (FLIBCPP_DEV OR FLIBCPP_BUILD_EXAMPLES OR FLIBCPP_BUILD_TESTS )
22
- set (_DEFAULT_BUILD_TESTING ON )
23
- endif ()
24
-
25
20
option (BUILD_SHARED_LIBS "Build shared libraries" ON )
26
- option (BUILD_TESTING "Enable CTest" ${_DEFAULT_BUILD_TESTING} )
27
21
option (FLIBCPP_DEV "Default to using development-centered options" OFF )
28
22
option (FLIBCPP_BUILD_DOCS "Build documentation with Sphinx" ${FLIBCPP_DEV} )
29
- option (FLIBCPP_BUILD_EXAMPLES "Build examples" ON )
30
- option (FLIBCPP_BUILD_TESTS "Build Flibcpp tests" ${BUILD_TESTING} )
31
23
option (FLIBCPP_USE_SWIG "Regenerate source files using SWIG" ${FLIBCPP_DEV} )
32
24
25
+ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME )
26
+ set (_DEFAULT_BUILD_EXAMPLES ON )
27
+ endif ()
28
+ option (FLIBCPP_BUILD_EXAMPLES "Build examples" ${_DEFAULT_BUILD_EXAMPLES} )
29
+
30
+ if (FLIBCPP_DEV )
31
+ set (_DEFAULT_BUILD_TESTS ON )
32
+ endif ()
33
+ option (FLIBCPP_BUILD_TESTS "Build Flibcpp tests" ${_DEFAULT_BUILD_TESTS} )
34
+
35
+ if (FLIBCPP_BUILD_TESTS OR FLIBCPP_BUILD_EXAMPLES )
36
+ set (_DEFAULT_BUILD_TESTING ON )
37
+ endif ()
38
+ option (BUILD_TESTING "Enable CTest" ${_DEFAULT_BUILD_TESTING} )
39
+
33
40
#---------------------------------------------------------------------------#
34
41
# FLAGS
35
42
#---------------------------------------------------------------------------#
You can’t perform that action at this time.
0 commit comments