You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmake_minimum_required(VERSION 3.18)
project(example_project LANGUAGES CXX)
add_executable(main main.cpp)
it defaults to putting the executables in the build directory.
% cd build && make
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable main
When I tried adding RAJA as a dependency with FetchContent
cmake_minimum_required(VERSION 3.18)
project(example_project LANGUAGES CXX)
include(FetchContent)
FetchContent_Declare(
raja
URL https://github.com/LLNL/RAJA/releases/download/v2024.07.0/RAJA-v2024.07.0.tar.gz
)
set(RAJA_ENABLE_TESTS OFF CACHE INTERNAL "")
set(RAJA_ENABLE_EXAMPLES OFF CACHE INTERNAL "")
set(RAJA_ENABLE_EXERCISES OFF CACHE INTERNAL "")
FetchContent_MakeAvailable(raja)
add_executable(main main.cpp)
RAJA built just fine, but I couldn't find my executables any more. When I looked more closely, I saw that they were being put in RAJA's output directory, which surprised me.
% cd build && make
[ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[100%] Linking CXX executable _deps/raja-build/bin/main
I haven't looked into it too closely, but it seems like the cause is not RAJA after all, but BLT unconditionally setting the value of CMAKE_RUNTIME_OUTPUT_DIRECTORY here
# Set the path where all the installed executables will go
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY
${PROJECT_BINARY_DIR}/bin
CACHEPATH
"Directory where executables will go in the build tree")
As a user, my expectation is that bringing in a child project through FetchContent shouldn't result in changing the global settings of the parent project.
The text was updated successfully, but these errors were encountered:
If I have a simple CMake project
it defaults to putting the executables in the build directory.
When I tried adding RAJA as a dependency with FetchContent
RAJA built just fine, but I couldn't find my executables any more. When I looked more closely, I saw that they were being put in RAJA's output directory, which surprised me.
I haven't looked into it too closely, but it seems like the cause is not RAJA after all, but BLT unconditionally setting the value of
CMAKE_RUNTIME_OUTPUT_DIRECTORY
hereblt/SetupBLT.cmake
Lines 158 to 162 in 5468efd
As a user, my expectation is that bringing in a child project through
FetchContent
shouldn't result in changing the global settings of the parent project.The text was updated successfully, but these errors were encountered: