Skip to content

Commit 18924da

Browse files
committed
Fix an issue where compiling the example would look for a C++ compiler
1 parent d8f0737 commit 18924da

File tree

4 files changed

+21
-17
lines changed

4 files changed

+21
-17
lines changed

CMakeLists.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,29 @@ include(CTest)
1515
include(CMakePackageConfigHelpers)
1616
include(GenerateExportHeader)
1717
include(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()
2424
option(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}")
2626
option(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()
3841
find_package(Threads REQUIRED)
3942
find_package(yaml REQUIRED)
4043

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@ Paraconf depends on:
2424
Paraconf Fortran support depends on:
2525
* a Fortran-2003 compiler
2626

27-
For example, you can get release 1.0.3, compile & install it with:
27+
For example, you can get release 1.0.4, compile & install it with:
2828
```bash
29-
wget https://github.com/pdidev/paraconf/archive/1.0.3.tar.gz
30-
tar -xzf 1.0.3.tar.gz
31-
cmake -DCMAKE_INSTALL_PREFIX=/usr/ -B paraconf-build -S paraconf-1.0.3
29+
wget https://github.com/pdidev/paraconf/archive/1.0.4.tar.gz
30+
tar -xzf 1.0.4.tar.gz
31+
cmake -DCMAKE_INSTALL_PREFIX=/usr/ -B paraconf-build -S paraconf-1.0.4
3232
cmake --build paraconf-build
3333
```
3434

35+
[!TIP]
3536
Change `-DCMAKE_INSTALL_PREFIX=/usr/` to something else if you want to install
3637
somewhere else than in `/usr/`.
3738

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.0.3
1+
1.0.4

example/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# SPDX-License-Identifier: MIT
55

66
cmake_minimum_required(VERSION 3.22...4.2)
7-
project(paraconf_examples LANGUAGES C CXX)
7+
project(paraconf_examples LANGUAGES C)
88

99
option(BUILD_FORTRAN "Enable Fortran support" ON)
1010
option(PARACONF_BUILD_FORTRAN "Enable Fortran support in Paraconf" "${BUILD_FORTRAN}")

0 commit comments

Comments
 (0)