Skip to content

Commit 9170c3b

Browse files
committed
Merge branch 'main' into feature/add_test
2 parents 1ef80b1 + 9550c0e commit 9170c3b

File tree

19 files changed

+99
-88
lines changed

19 files changed

+99
-88
lines changed

src/Common.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include_guard()
22

3+
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")
4+
35
# This function sets ProjectOptions_SRC_DIR using the current lists path
46
macro(set_project_options_src_dir)
57
get_directory_property(LISTFILE_STACK LISTFILE_STACK)

src/CrossCompiler.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include_guard()
22

3+
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")
4+
35
#[[.rst:
46
57
``enable_cross_compiler``

src/DetectCompiler.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include_guard()
22

3+
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")
4+
35
# includes a separate CMakeLists.txt file to detect the CXX/C compilers before project is called
46
# Using a separate file ensures that the current scope is not contaminated by the variable
57
macro(detect_compiler)

src/Doxygen.cmake

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,11 @@ function(enable_doxygen DOXYGEN_THEME)
8080

8181
# find doxygen and dot if available
8282
find_package(Doxygen OPTIONAL_COMPONENTS dot)
83-
if (NOT Doxygen_FOUND)
84-
message(WARNING "Doxygen not found, install doxygen and try again. Documentation will not be generated.")
83+
if(NOT Doxygen_FOUND)
84+
message(
85+
WARNING
86+
"Doxygen not found, install doxygen and try again. Documentation will not be generated."
87+
)
8588
return()
8689
endif()
8790

src/Index.cmake

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,29 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0")
1010
endif()
1111

1212
# only useable here
13-
set(ProjectOptions_SRC_DIR ${CMAKE_CURRENT_LIST_DIR})
13+
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")
1414

1515
# include the files to allow calling individual functions (including the files does not run any code.)
16-
include("${CMAKE_CURRENT_LIST_DIR}/Common.cmake")
17-
include("${CMAKE_CURRENT_LIST_DIR}/Utilities.cmake")
18-
include("${CMAKE_CURRENT_LIST_DIR}/Git.cmake")
19-
include("${CMAKE_CURRENT_LIST_DIR}/SystemLink.cmake")
20-
include("${CMAKE_CURRENT_LIST_DIR}/Cuda.cmake")
21-
include("${CMAKE_CURRENT_LIST_DIR}/PackageProject.cmake")
22-
include("${CMAKE_CURRENT_LIST_DIR}/Optimization.cmake")
23-
include("${CMAKE_CURRENT_LIST_DIR}/Cache.cmake")
24-
include("${CMAKE_CURRENT_LIST_DIR}/Linker.cmake")
25-
include("${CMAKE_CURRENT_LIST_DIR}/CompilerWarnings.cmake")
26-
include("${CMAKE_CURRENT_LIST_DIR}/Tests.cmake")
27-
include("${CMAKE_CURRENT_LIST_DIR}/Sanitizers.cmake")
28-
include("${CMAKE_CURRENT_LIST_DIR}/Doxygen.cmake")
29-
include("${CMAKE_CURRENT_LIST_DIR}/StaticAnalyzers.cmake")
30-
include("${CMAKE_CURRENT_LIST_DIR}/VCEnvironment.cmake")
31-
include("${CMAKE_CURRENT_LIST_DIR}/MinGW.cmake")
32-
include("${CMAKE_CURRENT_LIST_DIR}/DetectCompiler.cmake")
33-
include("${CMAKE_CURRENT_LIST_DIR}/CrossCompiler.cmake")
34-
include("${CMAKE_CURRENT_LIST_DIR}/DynamicProjectOptions.cmake")
35-
include("${CMAKE_CURRENT_LIST_DIR}/Hardening.cmake")
16+
include("${ProjectOptions_SRC_DIR}/Common.cmake")
17+
include("${ProjectOptions_SRC_DIR}/Utilities.cmake")
18+
include("${ProjectOptions_SRC_DIR}/Git.cmake")
19+
include("${ProjectOptions_SRC_DIR}/SystemLink.cmake")
20+
include("${ProjectOptions_SRC_DIR}/Cuda.cmake")
21+
include("${ProjectOptions_SRC_DIR}/PackageProject.cmake")
22+
include("${ProjectOptions_SRC_DIR}/Optimization.cmake")
23+
include("${ProjectOptions_SRC_DIR}/Cache.cmake")
24+
include("${ProjectOptions_SRC_DIR}/Linker.cmake")
25+
include("${ProjectOptions_SRC_DIR}/CompilerWarnings.cmake")
26+
include("${ProjectOptions_SRC_DIR}/Tests.cmake")
27+
include("${ProjectOptions_SRC_DIR}/Sanitizers.cmake")
28+
include("${ProjectOptions_SRC_DIR}/Doxygen.cmake")
29+
include("${ProjectOptions_SRC_DIR}/StaticAnalyzers.cmake")
30+
include("${ProjectOptions_SRC_DIR}/VCEnvironment.cmake")
31+
include("${ProjectOptions_SRC_DIR}/MinGW.cmake")
32+
include("${ProjectOptions_SRC_DIR}/DetectCompiler.cmake")
33+
include("${ProjectOptions_SRC_DIR}/CrossCompiler.cmake")
34+
include("${ProjectOptions_SRC_DIR}/DynamicProjectOptions.cmake")
35+
include("${ProjectOptions_SRC_DIR}/Hardening.cmake")
3636

3737
# Include msvc toolchain on windows if the generator is not visual studio. Should be called before run_vcpkg and run_conan to be effective
3838
if("${CMAKE_TOOLCHAIN_FILE}" STREQUAL "")
@@ -41,8 +41,8 @@ else()
4141
message(STATUS "project_options: skipping msvc_toolchain as CMAKE_TOOLCHAIN_FILE is set")
4242
endif()
4343

44-
include("${CMAKE_CURRENT_LIST_DIR}/Conan.cmake")
45-
include("${CMAKE_CURRENT_LIST_DIR}/Vcpkg.cmake")
44+
include("${ProjectOptions_SRC_DIR}/Conan.cmake")
45+
include("${ProjectOptions_SRC_DIR}/Vcpkg.cmake")
4646

4747
#[[.rst:
4848

src/MinGW.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
include_guard()
22

3+
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")
4+
35
# detect mingw
46
function(is_mingw value)
57
if(USE_CROSSCOMPILER_MINGW)

src/VCEnvironment.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
include_guard()
22

3-
include("${CMAKE_CURRENT_LIST_DIR}/Utilities.cmake")
3+
set(ProjectOptions_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}")
4+
include("${ProjectOptions_SRC_DIR}/Utilities.cmake")
45

56
# detect if the compiler is msvc
67
function(is_msvc value)
@@ -58,8 +59,7 @@ macro(msvc_toolchain)
5859
message(STATUS "Using Windows Windows toolchain")
5960
include(FetchContent)
6061
FetchContent_Declare(
61-
_msvc_toolchain
62-
GIT_REPOSITORY "https://github.com/MarkSchofield/WindowsToolchain.git"
62+
_msvc_toolchain GIT_REPOSITORY "https://github.com/MarkSchofield/WindowsToolchain.git"
6363
GIT_TAG "17c6d4ff6531ee268b9a22a8bcfbb3809e970e4e"
6464
)
6565
FetchContent_MakeAvailable(_msvc_toolchain)

tests/emscripten/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
#endif
1414

1515
int main() {
16-
printf("hello, world!\n");
17-
return 0;
16+
printf("hello, world!\n");
17+
return 0;
1818
}

tests/install/src/another_main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
#include <mylib2/lib.hpp>
33

44
int main() {
5-
some_fun2();
6-
return some_fun2();
5+
some_fun2();
6+
return some_fun2();
77
}

tests/minimal/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <fmt/core.h>
22

33
int main() {
4-
fmt::print("Hello World!");
5-
return 0;
4+
fmt::print("Hello World!");
5+
return 0;
66
}

0 commit comments

Comments
 (0)