Why is this thing so complicated? Is there a good alternative?

Why is this thing so complicated? Is there a good alternative?

I just want to make a cross platform project.

Attached: cmake75.png (252x100, 14K)

just use make

>Is there a good alternative?
Yes, it's called "GNU Make"

>a more insanely complex option
T-thanks

>cross platform
hihihihihihihi

Attached: hehe_XD.png (360x594, 249K)

you haven't experience hell until you try and build a cmake project on windows and it STILL requires 3 fucking versions of visual studio to be installed

Qmake isn't the worst, but just use make

It's not that complicated and it pays off for larger projects, especially if you want to add other projects as dependencies. You can use Makefiles or Ninja or whatever it supports for compiling.

If your project is small just write a basic Makefile.

I use it along with conan. It's simple as fuck. I can bring glfw, freetype, assimp, and whatever I want for my shitty sepples games like so:
#CMakeLists.txt
project(ShitApp)
cmake_minimum_required(VERSION 3.11)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()

add_executable(app
src/shit.cpp
)

target_include_directories(app PUBLIC
inc)

target_compile_features(app PUBLIC cxx_std_17)

target_link_libraries(app ${CONAN_LIBS})


And my conanfile.txt dependencies look like so:
[requires]
glfw/3.2.1@bincrafters/stable
glad/0.1.24@bincrafters/stable
glm/0.9.8.5@g-truc/stable
zlib/1.2.11@conan/stable
Assimp/4.1.0@jacmoe/stable
freetype/2.8.1@bincrafters/stable

[options]
glad:profile=core
glad:api_type=gl
glad:api_version=4.3
glad:spec=gl
glad:no_loader=False
Assimp:shared=False
freetype:shared=False

[generators]
cmake


Easy as fuck, and I can build for whatever platfom I want without touching makefiles or vs projects.

gcc *.c works nicely

make is a lot cleaner, learn it and stick to it.
If you want to go full onions you can look into something like waf. But that is for literal faggots.

You know whats bad is when a project has a build target to build the actual visual studio project files. I've worked on a project that did that then shoped around using 3-4 different locations / environment variables desperately trying to find a file 10 directories deep in the visual studio installation which defined 10-20 additional environmental variables it needed to build. You try to read the shit it generates and its all Microsoft XML shit and you have no idea what the fuck is going on. All of this cmake and visual studio garbage was orchestrated by powershell scripts, where doing even the simplest things are insanely complicated with the various namespaces and excessive amount of arguments to every command.

do you have a github? also is that a does the [requires] list a package manager? I desparately need something like it for my C++ project, i've just been putting all my dependency source in the project itself.

just tell me everything i need to know pls

Premake is what you want. Easy to use, lua syntax (so it's an actual programming language instead of a pile of hacks), and generates Makefiles, Visual Studio projects, and XCode projects.

use *.bat files

no, building cross platform C++ isn't trivial, especially if you want to support a bunch of different compilers and make systems like cmake does

>make
>complex
you may want to actually learn to write some simple makefiles first before you complain about it

not the same user but putting dependency source in your project is valid, but it can be a pain for large projects or ones that you want to be closer with upstream, for that you have some options:

- cmake ExternalProject module (search for examples of this)
- use a git submodule and include the subdirectory (might require some setup)
- conan (what that other user was using, supports binary packages but comes with all the typical issues from that)

yeah, conan is a package manager for sepples. it's pretty neat in the sense that it is a mixed binary/source-based package manager: if it finds prebuilt packages for your target configuration and dependency version, it will download it and that's it. If it doesn't, it will download the sources and build them for you.
The simple use case of depending on other libraries is very easy, while the process of actually creating conan packages can be more difficult.
I don't have a public repo, but I think I'll create one, since the topic appears very often.

how is this cmake complex? if anything it is insanely easy to use for what it does.

Literally the only makefile you'll ever need for your pet "projects"
CC=
CFLAGS=-Wall -Werror -g
LIBS=
INC=
OUT=
OBJ_D=
#replace .c with .o you retard
OBJS= \
$(OBJ_D)/output.o \
$(OBJ_D)/output2.o

$(OBJ_D)/%.o: src/%.c
$(CC) $(CFLAGS) -I$(INC) -o $@ -c $<

$(OUT): $(OBJS)
$(CC) $^ -o $@ $(LIBS)

.PHONY: clean
clean:
rm -f $(OBJS)
rm -f $(OUT)

A good cross platform solution is to make a custom node.js script.

>I just want to make a cross platform project.
Use Go. Cross compilation is comfy.