[opensuse-factory] Cmake macros implementation
Hello guys, I got quite bored by fixing issues one by one adjusting spec files wrt cmake usage. Thus I went out and wrote cmake.macros for our beloved cmake and put it into my home project [1]. Basically now you just call %cmake -Dmydef=on -Dsomethingelselocal=/var/ instead of having to fiddle with all the variables yourself. And just for trivial and easy life i put there %cmake_install which wraps %make_install to reduce the commands for install phase. The implementation approach should probably be following: 1) this implementation should be submitted to factory 2) cmake should be linked to devel projects using cmake commands 3) %cmake_kde macro should be adjusted to just wrap the %cmake macro. 4) all specs should be tweaked to use the macro, some stuff might start fail becuase this added some enforcing on cflags (but it should be even less failures than we had now with update to 2.8.11.2) OPTIONAL) we could open maint. requests to put the macros to all supported product. Am I missing something or is this possible to do? Cheers Tom [1] https://build.opensuse.org/package/view_file/home:scarabeus_iv/cmake/cmake.m...
On Sunday 2013-08-11 14:27, Tomáš Chvátal wrote:
I got quite bored by fixing issues one by one adjusting spec files wrt cmake usage. Thus I went out and wrote cmake.macros for our beloved cmake and put it into my home project [1].
Basically now you just call %cmake -Dmydef=on -Dsomethingelselocal=/var/ instead of having to fiddle with all the variables yourself.
Have you attempted using -DCMAKE_C_FLAGS_RELEASE:STRING="%optflags"? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Dne Ne 11. srpna 2013 15:47:18, Jan Engelhardt napsal(a):
On Sunday 2013-08-11 14:27, Tomáš Chvátal wrote:
I got quite bored by fixing issues one by one adjusting spec files wrt cmake usage. Thus I went out and wrote cmake.macros for our beloved cmake and put it into my home project [1].
Basically now you just call %cmake -Dmydef=on -Dsomethingelselocal=/var/ instead of having to fiddle with all the variables yourself.
Have you attempted using -DCMAKE_C_FLAGS_RELEASE:STRING="%optflags"?
That might in theory work, but the best we thought up for gentoo was to create own target because this always caused some issues. Basically you put there something like -DCMAKE_USER_MAKE_RULES_OVERRIDE="/path/opensuse.cmake" And then override whole set. What I wrote in Gentoo: local build_rules=${BUILD_DIR}/gentoo_rules.cmake cat > "${build_rules}" <<- _EOF_ SET (CMAKE_AR $(type -P $(tc-getAR)) CACHE FILEPATH "Archive manager" FORCE) SET (CMAKE_ASM_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "ASM compile command" FORCE) SET (CMAKE_C_COMPILER $(type -P $(tc-getCC)) CACHE FILEPATH "C compiler" FORCE) SET (CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C compile command" FORCE) SET (CMAKE_CXX_COMPILER $(type -P $(tc-getCXX)) CACHE FILEPATH "C++ compiler" FORCE) SET (CMAKE_CXX_COMPILE_OBJECT "<CMAKE_CXX_COMPILER> <DEFINES> ${CPPFLAGS} <FLAGS> -o <OBJECT> -c <SOURCE>" CACHE STRING "C++ compile command" FORCE) SET (CMAKE_RANLIB $(type -P $(tc-getRANLIB)) CACHE FILEPATH "Archive index generator" FORCE) SET (PKG_CONFIG_EXECUTABLE $(type -P $(tc-getPKG_CONFIG)) CACHE FILEPATH "pkg-config executable" FORCE) _EOF_ Basically we could install this rule file with cmake too and then just make sure its used.
Dne Ne 11. srpna 2013 15:47:18, Jan Engelhardt napsal(a):
On Sunday 2013-08-11 14:27, Tomáš Chvátal wrote:
I got quite bored by fixing issues one by one adjusting spec files wrt cmake usage. Thus I went out and wrote cmake.macros for our beloved cmake and put it into my home project [1].
Ok updated the macros and rules bit more, could anyone else verify it does what it should on some packages. I tested hugin and few games and everything went fine.
Tom
participants (2)
-
Jan Engelhardt
-
Tomáš Chvátal