cmake-sfml-project
cmake-sfml-project copied to clipboard
The install target includes all SFML options, including pkg-config and cmake configuration
The default installation includes all of the SFML development information. I'm
git clone https://github.com/SFML/cmake-sfml-project.git
cd cmake-sfml-project/
mkdir build && cd build
cmake ..
make -j
make install
On ubuntu this gives me
[100%] Built target sfml-audio
Install the project...
-- Install configuration: ""
CMake Error at _deps/sfml-build/cmake_install.cmake:54 (file):
file cannot create directory: /usr/local/lib/pkgconfig. Maybe need
administrative privileges.
Call Stack (most recent call first):
cmake_install.cmake:47 (include)
make: *** [Makefile:120: install] Error 1
Which, yes, with admin privileges would work. But also that would be installing SFML and not the binary. You can make this go away by specifying an install prefix cmake -DCMAKE_INSTALL_PREFIX=install ..
but then you're still installing the SFML stuff.
Is that expected? If not, how can I prevent that from happening?
Seems like populating sfml by hand would all EXCLUDE_FROM_ALL
to be added to the add_subdirectory
call, but for some reason I can't get it work.
# FetchContent_MakeAvailable(SFML)
FetchContent_GetProperties(SFML)
message(STATUS "SFML source dir: ${SFML_SOURCE_DIR}")
message(STATUS "SFML binary dir: ${SFML_BINARY_DIR}")
for me this produces empty values for the source and binary directory so I can't add the subdirectories
See also #28
@K20shores Give this another shot now that #28 is merged.