0

I have been trying to build Box2d with Cmake on Windows. This is the first time I attempt something like this, so I followed a tutorial. However, when I clicked on 'configure' it started working until it showed me this error message:

"You have called ADD_LIBRARY for library glfw without any source files. This typically indicates a problem with your CMakeLists.txt file".

I searched about this error on google, but I didn't find anyone with the same problem. Does anyone know how I can fix this?

EDIT: The versions are:

Cmake: 3.5.2
Box2d: It doesn't say. How can I tell?

1 Answers1

0

This issue comes up because the SOURCES haven't been set properly, Add the "else" condition as i did below will fix this.

if (_GLFW_COCOA)
set(glfw_HEADERS ${common_HEADERS} cocoa_platform.h iokit_joystick.h
                 posix_tls.h)
set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_monitor.m
                 cocoa_window.m iokit_joystick.m mach_time.c posix_tls.c)
elseif (_GLFW_WIN32)
set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_tls.h
                 winmm_joystick.h)
set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_monitor.c win32_time.c
                 win32_tls.c win32_window.c winmm_joystick.c)
elseif (_GLFW_X11)
set(glfw_HEADERS ${common_HEADERS} x11_platform.h xkb_unicode.h
                 linux_joystick.h posix_time.h posix_tls.h)
set(glfw_SOURCES ${common_SOURCES} x11_init.c x11_monitor.c x11_window.c
                 xkb_unicode.c linux_joystick.c posix_time.c posix_tls.c)
elseif (_GLFW_WAYLAND)
set(glfw_HEADERS ${common_HEADERS} wl_platform.h linux_joystick.h
                 posix_time.h posix_tls.h xkb_unicode.h)
set(glfw_SOURCES ${common_SOURCES} wl_init.c wl_monitor.c wl_window.c
                 linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c)
elseif (_GLFW_MIR)
set(glfw_HEADERS ${common_HEADERS} mir_platform.h linux_joystick.h
                 posix_time.h posix_tls.h xkb_unicode.h)
set(glfw_SOURCES ${common_SOURCES} mir_init.c mir_monitor.c mir_window.c
                 linux_joystick.c posix_time.c posix_tls.c xkb_unicode.c)
else()
set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_tls.h
                     winmm_joystick.h)
set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_monitor.c win32_time.c
                     win32_tls.c win32_window.c winmm_joystick.c)            
endif()
GangNanTed
  • 43
  • 1
  • 8
  • Thanks! I pasted the block of code you gave me and configured again. The error message was gone. However, when I tried to generate the files, I got other error messages. It said: "Error in generation process, project files may be invalid". – kourkoubini Jul 07 '16 at 15:31