cmake problem

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

cmake problem

Post by kcleung »

Currently I am at the assembly head:

commit 7b07c4280630985d2bd783159c84626a1160f7cd
Author: jriegel <freecad@juergen-riegel.net>
Date: Thu Sep 24 18:15:53 2015 +0200

some fixes to get it compile again


when I ran cmake, this error occurs:

The target name "Mod/PartDesign" is unknown in this context.
Call Stack (most recent call first):
src/Mod/PartDesign/CMakeLists.txt:100 (fc_copy_sources)
This warning is for project developers. Use -Wno-dev to suppress it.


Could you please have a look?

Thx!
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: cmake problem

Post by jriegel »

Mhh,
I have no trouble so far,
check out the latest commits in try again. Maybe a not committed file, but this commits were just a merge and a fix, so no new files....

If it still not go through cMake, try to find out what file and let me know...
Stop whining - start coding!
kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

Re: cmake problem

Post by kcleung »

The same problem still persists, despite I have just pulled the newest head:

commit 7dcd0ab4372f4fec73fc8dbf383a1d502b5fa408
Author: jriegel <freecad@juergen-riegel.net>
Date: Fri Oct 2 14:40:48 2015 +0200

Fixes in getDependencyList and additional test methodes

and I am running Lubuntu 15.10 with gcc 5.2 and CMake 3.2.2


-- /mnt/hgfs/git/dev/freecad-bin/src/Mod/PartDesign/App/BodyPy.cpp
CMake Warning (dev) at cMake/FreeCadMacros.cmake:57 (ADD_CUSTOM_COMMAND):
Policy CMP0040 is not set: The target in the TARGET signature of
add_custom_command() must exist. Run "cmake --help-policy CMP0040" for
policy details. Use the cmake_policy command to set the policy and
suppress this warning.

The target name "Mod/PartDesign" is unknown in this context.
Call Stack (most recent call first):
src/Mod/PartDesign/CMakeLists.txt:100 (fc_copy_sources)
This warning is for project developers. Use -Wno-dev to suppress it.
kcleung
Posts: 162
Joined: Sun Apr 24, 2011 11:56 am

Re: cmake problem

Post by kcleung »

I have just found out what has gone wrong:

In line 100 of src/Mod/PartDesign/CMakeLists.txt,

fc_copy_sources(Mod/PartDesign "${CMAKE_BINARY_DIR}/Mod/PartDesign" ${all_files})

there are a few lines around it:


SET(FeatureHole_SRCS
FeatureHole/__init__.py
FeatureHole/HoleGui.py
FeatureHole/FeatureHole.py
FeatureHole/TaskHole.py
FeatureHole/ViewProviderHole.py
FeatureHole/Standards.py
FeatureHole/PartDesign_Hole.svg
)
SOURCE_GROUP("featurehole" FILES ${FeatureHole_SRCS})

SET(FeatureHole_UI
FeatureHole/TaskHole.ui
)

SET(all_featurehole_files ${FeatureHole_SRCS} ${FeatureHole_UI})

#ADD_CUSTOM_TARGET(FeatureHole ALL
# SOURCES ${all_featurehole_files}
#)

#SET(all_files ${all_featurehole_files})

fc_copy_sources(Mod/PartDesign "${CMAKE_BINARY_DIR}/Mod/PartDesign" ${all_files})

#INSTALL(
# FILES
# ${FeatureHole_SRCS}
# DESTINATION
# Mod/PartDesign/FeatureHole
#)


Here we have commented out lines that install the featurehole files, but we have forgotten to comment out the fc_copy_source line too!

Therefore the all_files variable remained undefined, so when we call fc_copy_sources, no wonder why CMake throws an error!


Also, should line 100:

fc_copy_sources(Mod/PartDesign "${CMAKE_BINARY_DIR}/Mod/PartDesign" ${all_files})

have been:

fc_copy_sources(FeatureHole "${CMAKE_BINARY_DIR}/Mod/PartDesign" ${all_files})
Post Reply