@@ -15,26 +15,29 @@ include(CTest)
1515include (CMakePackageConfigHelpers )
1616include (GenerateExportHeader )
1717include (GNUInstallDirs )
18- set (INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR} /paraconf/cmake" CACHE STRING "installation path for cmake files" )
19- set (PARACONF_INSTALL_CMAKEDIR "${INSTALL_CMAKEDIR} " CACHE STRING "installation path for cmake files of Paraconf" ) # not provided by GNUInstallDirs
2018
2119
2220# Build options
23-
21+ if (DEFINED BUILD_EXAMPLE) # Use the non-namespaced BUILD_EXAMPLE as default if provided
22+ option (PARACONF_BUILD_EXAMPLE "Build Paraconf example" "${BUILD_EXAMPLE} " )
23+ endif ()
2424option (BUILD_SHARED_LIBS "Build shared libraries rather than static ones" ON )
25- option (BUILD_EXAMPLE "Build example" ON )
25+ option (BUILD_EXAMPLE "Build example" " ${BUILD_TESTING} " )
2626option (BUILD_FORTRAN "Enable Fortran support" ON )
27- option ( PARACONF_BUILD_EXAMPLE "Build Paraconf example" "${BUILD_EXAMPLE} " )
28- option (PARACONF_BUILD_FORTRAN "Enable Fortran support in Paraconf" "${BUILD_FORTRAN} " )
29- option (PARACONF_BUILD_TESTING "Enable Tests in Paraconf" "${BUILD_TESTING} " )
30-
31- if ( " ${PARACONF_BUILD_FORTRAN } " )
32- enable_language ( Fortran )
33- endif ()
27+ set ( INSTALL_CMAKEDIR "${CMAKE_INSTALL_DATADIR} /paraconf/cmake" CACHE STRING "installation path for cmake files " )
28+ option (PARACONF_BUILD_FORTRAN "Enable Fortran support in Paraconf" "${BUILD_FORTRAN} " )
29+ option (PARACONF_BUILD_TESTING "Enable Tests in Paraconf" "${BUILD_TESTING} " )
30+ # else(NOT DEFINED BUILD_EXAMPLE) fallback to PARACONF_BUILD_TESTING as default
31+ option ( PARACONF_BUILD_EXAMPLE "Build Paraconf example" " ${PARACONF_BUILD_TESTING } " )
32+ # endif( )
33+ set ( PARACONF_INSTALL_CMAKEDIR " ${INSTALL_CMAKEDIR} " CACHE STRING "installation path for cmake files of Paraconf" ) # not provided by GNUInstallDirs
3434
3535
3636# Dependencies
3737
38+ if ("${PARACONF_BUILD_FORTRAN} " )
39+ enable_language (Fortran )
40+ endif ()
3841find_package (Threads REQUIRED )
3942find_package (yaml REQUIRED )
4043
0 commit comments