OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: problem with combination of cmake and clang module

From: Sebastian Reitenbach (sebastial00-bugdead-prods.de)
Date: Wed May 01 2013 - 14:48:22 CDT


Hi,

the patch to llvm make the upcoming libobjc2 cmake configure stage happy for me.
Don't know if this is the right approach, there might be a different problem which
I'm just hiding? Someone with better cmake knowledge has any suggestion?

in case I might not be too wrong, OK?

Sebastian

Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/llvm/Makefile,v
retrieving revision 1.61
diff -u -r1.61 Makefile
--- Makefile 30 Mar 2013 12:10:40 -0000 1.61
+++ Makefile 1 May 2013 19:42:38 -0000
-10,7 +10,7
 LLVM_V = 3.2
 DISTNAME = llvm-${LLVM_V}.src
 PKGNAME = llvm-${LLVM_V}
-REVISION = 2
+REVISION = 3
 CATEGORIES = devel
 MASTER_SITES = http://llvm.org/releases/${LLVM_V}/
 
Index: patches/patch-cmake_modules_LLVMConfig_cmake_in
===================================================================
RCS file: patches/patch-cmake_modules_LLVMConfig_cmake_in
diff -N patches/patch-cmake_modules_LLVMConfig_cmake_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-cmake_modules_LLVMConfig_cmake_in 1 May 2013 19:42:38 -0000
-0,0 +1,14
+$OpenBSD$
+
+make it find include file in /usr/local/share/llvm/cmake
+
+--- cmake/modules/LLVMConfig.cmake.in.orig Wed May 1 17:46:37 2013
++++ cmake/modules/LLVMConfig.cmake.in Wed May 1 17:47:07 2013
+ -46,6 +46,7 if( NOT LLVMCONFIG_INCLUDED )
+ set(CMAKE_MODULE_PATH
+ ${CMAKE_MODULE_PATH}
+ "LLVM_SOURCE_DIR/cmake/modules")
++ list(APPEND CMAKE_MODULE_PATH "${LLVM_ROOT}/share/llvm/cmake")
+ include( LLVM-Config )
+ endif()
+

On Sunday, January 13, 2013 19:01 CET, "Sebastian Reitenbach" <sebastial00-bugdead-prods.de> wrote:
 
>
> On Sunday, January 13, 2013 17:39 CET, "Sebastian Reitenbach" <sebastial00-bugdead-prods.de> wrote:
>
> > Hi,
> >
> > I'm testing x11/gnustep/libobjc2 from svn. Upstream changed the build environment to use cmake.
> > Since the recommended compiler is clang, I thought about trying that too, but that made me run into trouble:
> >
> > so I have this in the Makefile:
> >
> > MODULES = devel/cmake lang/clang
> > MODCLANG_ARCHS = ${LLVM_ARCHS}
> > MODCLANG_LANGS = c++
> >
> > make configure now looks like this:
> >
> > ===> Configuring for gnustep-libobjc2-1.7
> > -- The C compiler identification is Clang 3.2.0
> > -- The CXX compiler identification is Clang 3.2.0
> > -- Check for working C compiler: /home/ports/pobj/gnustep-libobjc2-1.7/bin/cc
> > -- Check for working C compiler: /home/ports/pobj/gnustep-libobjc2-1.7/bin/cc -- works
> > -- Detecting C compiler ABI info
> > -- Detecting C compiler ABI info - done
> > -- Check for working CXX compiler: /home/ports/pobj/gnustep-libobjc2-1.7/bin/c++
> > -- Check for working CXX compiler: /home/ports/pobj/gnustep-libobjc2-1.7/bin/c++ -- works
> > -- Detecting CXX compiler ABI info
> > -- Detecting CXX compiler ABI info - done
> > -- The ASM compiler identification is Clang
> > -- Found assembler: /home/ports/pobj/gnustep-libobjc2-1.7/bin/cc
> > CMake Error at /usr/local/share/llvm/cmake/LLVMConfig.cmake:137 (include):
> > include could not find load file:
> >
> > LLVM-Config
> > Call Stack (most recent call first):
> > CMakeLists.txt:123 (find_package)
> >
> >
> > CMake Error at /usr/local/share/llvm/cmake/LLVMConfig.cmake:137 (include):
> > include could not find load file:
> >
> > LLVM-Config
> > Call Stack (most recent call first):
> > opts/CMakeLists.txt:3 (find_package)
> >
> >
> > CMake Error at opts/CMakeLists.txt:4 (include):
> > include could not find load file:
> >
> > AddLLVM
> >
> >
> > CMake Error at opts/CMakeLists.txt:11 (add_llvm_loadable_module):
> > Unknown CMake command "add_llvm_loadable_module".
> >
> >
> > -- Configuring incomplete, errors occurred!
> > *** Error 1 in . (/home/ports/infrastructure/mk/bsd.port.mk:2567 '/home/ports/pobj/gnustep-libobjc2-1.7/build-i386/.configure_done')
> > *** Error 1 in /home/ports/x11/gnustep/libobjc2 (/home/ports/infrastructure/mk/bsd.port.mk:2323 'configure')
> >
> > the opts/CMakeLists.txt file contains on line 3 and 4:
> > find_package(LLVM)
> > include(AddLLVM)
> >
> > Am I missing something? Any pointer appreciated.
>
> I found that when fiddling around with
> /usr/local/share/llvm/cmake/LLVMConfig.cmake
> and at the very end of that file, changing the MODULE_PATH
> to point to /usr/local/share/llvm/cmake
> instead of /usr/obj/...
>
>
> from the LLVMConfig.cmake
> ...
> # We try to include using the current setting of CMAKE_MODULE_PATH,
> # which suppossedly was filled by the user with the directory where
> # this file was installed:
> include( LLVM-Config OPTIONAL RESULT_VARIABLE LLVMCONFIG_INCLUDED )
>
> # If failed, we assume that this is an un-installed build:
> if( NOT LLVMCONFIG_INCLUDED )
> set(CMAKE_MODULE_PATH
> ${CMAKE_MODULE_PATH}
> "/usr/local/share/llvm/cmake")
> include( LLVM-Config )
> endif()
>
>
> but still, I don't know whether I'm missing something, or whether the file
> should set that path correctly at that point?
>
>
> Sebastian
>
>
>
> >
> > cheers,
> > Sebastian
> >
> >
>
>
>
>
>