Skip to content

Commit

Permalink
build: put conan-generated Find<lib>.cmake files in a separate direct…
Browse files Browse the repository at this point in the history
…ory from build/

This follows the convention of putting helper .cmake files in to a separate directory as in:
https://cmake.org/cmake/help/latest/variable/CMAKE_MODULE_PATH.html.

This additionally helps with developer setupt. There is now a separate folder (build/) to deleting all generated
of the build system (cmake), and a folder (cmake/) of configuration files generated by the package manager (conan)
  • Loading branch information
Taepper committed Oct 23, 2024
1 parent 81af5d9 commit 1dc775b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
# Conan
conanprofile

# Cmake Build folders
# Conan-generated cmake FindPackage scripts
/cmake/Find*.cmake

# CMake Build folders
/release
/Release
/RelWithDebInfo
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif ()

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/build/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

# ---------------------------------------------------------------------------
# Logging
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
mv conanprofile.docker conanprofile; \
fi

RUN conan install . --build=missing --profile ./conanprofile --profile:build ./conanprofile --output-folder=build
RUN conan install . --build=missing --profile ./conanprofile --profile:build ./conanprofile --output-folder=cmake
2 changes: 1 addition & 1 deletion Dockerfile_linter_dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
mv conanprofile.docker conanprofile; \
fi

RUN conan install . --build=missing --profile ./conanprofile --profile:build ./conanprofile --output-folder=build -s build_type=Debug
RUN conan install . --build=missing --profile ./conanprofile --profile:build ./conanprofile --output-folder=cmake -s build_type=Debug
2 changes: 1 addition & 1 deletion build_with_conan.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def main(args):
conan_options.append("-s build_type=Debug")

run_cmd("Conan install",
"conan install . --build=missing --profile ./conanprofile --profile:build ./conanprofile --output-folder=build " + " ".join(
"conan install . --build=missing --profile ./conanprofile --profile:build ./conanprofile --output-folder=cmake " + " ".join(
conan_options))

run_cmd("CMake", "cmake " + " ".join(cmake_options) + " -B build")
Expand Down

0 comments on commit 1dc775b

Please sign in to comment.