@@ -13,10 +13,11 @@ project(Flibcpp VERSION 0.2.1 LANGUAGES CXX Fortran)
13
13
#---------------------------------------------------------------------------#
14
14
15
15
option (BUILD_SHARED_LIBS "Build shared libraries" ON )
16
+ option (BUILD_TESTING "Enable CTest" ${FLIBCPP_DEV} )
16
17
option (FLIBCPP_DEV "Default to using development-centered options" OFF )
17
18
option (FLIBCPP_BUILD_DOCS "Build documentation with Sphinx" ${FLIBCPP_DEV} )
18
19
option (FLIBCPP_BUILD_EXAMPLES "Build examples" ON )
19
- option (FLIBCPP_BUILD_TESTS "Build unit tests" ${FLIBCPP_DEV } )
20
+ option (FLIBCPP_BUILD_TESTS "Build Flibcpp tests" ${BUILD_TESTING } )
20
21
option (FLIBCPP_USE_SWIG "Regenerate source files using SWIG" ${FLIBCPP_DEV} )
21
22
22
23
#---------------------------------------------------------------------------#
@@ -37,7 +38,7 @@ set(FLIBCPP_FORTRAN_STD "f2003" CACHE STRING
37
38
"Fortran standard for compiling generated code" )
38
39
39
40
#---------------------------------------------------------------------------#
40
- # SWIG setup
41
+ # MODULES TO LOAD
41
42
#---------------------------------------------------------------------------#
42
43
43
44
if (FLIBCPP_USE_SWIG )
60
61
set (FLIBCPP_USE_SWIG FALSE )
61
62
endif ()
62
63
64
+ # Enable testing based on BUILD_TESTING flag
65
+ include (CTest )
66
+
63
67
#---------------------------------------------------------------------------#
64
68
# VERSIONING
65
69
#---------------------------------------------------------------------------#
@@ -249,10 +253,6 @@ install(FILES
249
253
# TESTING AND DOCS
250
254
#---------------------------------------------------------------------------#
251
255
252
- if (FLIBCPP_BUILD_TESTS OR FLIBCPP_BUILD_EXAMPLES )
253
- enable_testing ()
254
- endif ()
255
-
256
256
if (FLIBCPP_BUILD_TESTS )
257
257
add_subdirectory (test )
258
258
endif ()
0 commit comments