MantisBT - CMake
View Issue Details
0013728CMakeCMakepublic2012-11-23 04:132012-11-23 04:44
JussiP 
Peter Kuemmel 
normalminoralways
closedno change required 
LinuxLinuxLinux
CMake 2.8.9 
CMake 2.8.11 
0013728: Ninja file generated by CMake is invalid
When generating a Ninja build system for Scribus, the resulting build.ninja is invalid. The following error is printed when running Ninja:

ninja: error: build.ninja:6397: bad $-escape (literal $ must be written as $$)
  FLAGS = $(CMAKE_CXX_FLAGS) -fPIC -O2 -Wall -fPIC -Iscribus/third_party...
          ^ near here

Check out Scribus from git:

git clone git://git.scribus.net/scribus.git [^]

Run CMake with the ninja backend. Run Ninja.
The error is caused by the parentheses surrounding the word CMAKE_CXX_FLAGS. Manually editing the Ninja file and removing the parentheses in all locations they appear fixes the issue and running Ninja will work correctly.
No tags attached.
Issue History
2012-11-23 04:13JussiPNew Issue
2012-11-23 04:44Peter KuemmelNote Added: 0031680
2012-11-23 04:44Peter KuemmelStatusnew => closed
2012-11-23 04:44Peter KuemmelAssigned To => Peter Kuemmel
2012-11-23 04:44Peter KuemmelResolutionopen => no change required
2012-11-23 04:44Peter KuemmelFixed in Version => CMake 2.8.11
2012-11-26 10:20Bill HoffmanNote Edited: 0031680bug_revision_view_page.php?bugnote_id=31680#r943

Notes
(0031680)
Peter Kuemmel   
2012-11-23 04:44   
(edited on: 2012-11-26 10:20)
Your cmake file is buggy:
  SET(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) -fPIC")
should be
  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")

(found in 3 files)

scribus/third_party/cairo/CMakeLists.txt: SET(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) -fPIC")
scribus/third_party/lib2geom/CMakeLists.txt: SET(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) -fPIC")
scribus/third_party/wpg/CMakeLists.txt: SET(CMAKE_CXX_FLAGS "$(CMAKE_CXX_FLAGS) -fPIC")