Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build liquidfun on Ubuntu. #110

Open
AmigaBlitter opened this issue Dec 6, 2020 · 1 comment
Open

Can't build liquidfun on Ubuntu. #110

AmigaBlitter opened this issue Dec 6, 2020 · 1 comment

Comments

@AmigaBlitter
Copy link

Hello everyone,

following the procedure described in the https://google.github.io/liquidfun/Building/html/md__building_linux.html page,
cd liquidfun/Box2D
cmake -G'Unix Makefiles'
make

i get many errors, as follow:

This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:158 (set_target_properties):
set_target_properties Can not find target to add properties to: X11::X11

CMake Error at CMakeLists.txt:158 (set_target_properties):
set_target_properties Can not find target to add properties to: X11::ICE

CMake Error at CMakeLists.txt:158 (set_target_properties):
set_target_properties Can not find target to add properties to: X11::SM

CMake Error at CMakeLists.txt:158 (set_target_properties):
set_target_properties Can not find target to add properties to: X11::Xau

How can i fix and complete the build?

Thank you very much

@jhasse
Copy link

jhasse commented Jan 28, 2022

Try this:

diff --git a/liquidfun/Box2D/CMakeLists.txt b/liquidfun/Box2D/CMakeLists.txt
index 4f2461c5..2329bb92 100644
--- a/liquidfun/Box2D/CMakeLists.txt
+++ b/liquidfun/Box2D/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8)
+cmake_minimum_required(VERSION 3.7)
 
 project(Box2D)
 
@@ -99,23 +99,6 @@ if (BOX2D_CODE_COVERAGE AND
   set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${GCOV_FLAGS}")
 endif()
 
-# The XCode generator ignores CMAKE_C_FLAGS AND CMAKE_CXX_FLAGS so flags
-# need to be added with target properties.
-# The following functions track the list of targets so that it's possible to
-# add flags to all targets using target properties.
-set(ALL_TARGETS "" CACHE INTERNAL "")
-# Override add_library() and adding the target to the ALL_TARGETS variable.
-function(add_library name)
-  _add_library(${name} ${ARGN})
-  set(ALL_TARGETS "${ALL_TARGETS}" "${name}" CACHE INTERNAL "")
-endfunction(add_library)
-
-# Override add_executable() and adding the target to the ALL_TARGETS variable.
-function(add_executable name)
-  _add_executable(${name} ${ARGN})
-  set(ALL_TARGETS "${ALL_TARGETS}" "${name}" CACHE INTERNAL "")
-endfunction(add_executable)
-
 # The Box2D library.
 add_subdirectory(Box2D)
 
@@ -141,7 +127,7 @@ endif(BOX2D_INSTALL_DOC)
 
 # Set the warning flags for all targets when using the Xcode generator.
 if(CMAKE_COMPILER_IS_CLANGXX)
-  foreach(target ${ALL_TARGETS})
+  foreach(target ${BUILDSYSTEM_TARGETS})
     set_target_properties(${target} PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS
                           "${C_FLAGS_WARNINGS}")
   endforeach(target)
@@ -161,7 +147,7 @@ endif()
 # Override / reset the output directory for all targets.
 set(LIB_OUTPUT_DIR "${OUTPUT_SUBDIR}")
 set(EXE_OUTPUT_DIR "${OUTPUT_SUBDIR}")
-foreach(target ${ALL_TARGETS})
+foreach(target ${BUILDSYSTEM_TARGETS})
   set_target_properties(
     ${target} PROPERTIES
     ARCHIVE_OUTPUT_DIRECTORY "${LIB_OUTPUT_DIR}"

yesh0 added a commit to yesh0/liquidfun that referenced this issue Apr 7, 2022
FreeGLUT quick fix: See `freeglut/freeglut#76
Fixed CMake failure: See `google#110
Also `-Werror` is removed since I am not the one to maintain it
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants