tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cmake try_compile error



Dear Thomas,

On 2015-03-24, Thomas Klausner wrote:
> Hi!
> 
> I've tried packaging innoextract. It builds fine (on
> NetBSD-7.99.5/amd64/gcc 4.8.4) when I extract it and run 'cmake'
> manually, but inside pkgsrc it fails with (see wip/innoextract):
> 
> -- Checking compiler flag: -std=c++11
> CMake Error at cmake/CompileCheck.cmake:72 (try_compile):
>   Attempt at a recursive or nested TRY_COMPILE in directory
> 
>     /scratch/nih/innoextract/work/innoextract-1.4
> 
> Call Stack (most recent call first):
>   cmake/CXX11Check.cmake:41 (check_compile)
>   CMakeLists.txt:150 (check_cxx11)
> 
> 
> CMake Error at cmake/CompileCheck.cmake:72 (try_compile):
>   Attempt at a recursive or nested TRY_COMPILE in directory
> 
>     /scratch/nih/innoextract/work/innoextract-1.4
> 
> Call Stack (most recent call first):
>   cmake/CXX11Check.cmake:41 (check_compile)
>   CMakeLists.txt:154 (check_cxx11)
>   
> Does anyone have an idea what the problem is and how to fix it?

Do the attached patches fix the problem?

-- 
Kind regards,

Yorick Hardy
$NetBSD$

Fix use of CMAKE_MODULE_PATH

--- CMakeLists.txt.orig	2013-05-22 21:50:31.000000000 +0200
+++ CMakeLists.txt	2013-05-22 21:52:02.000000000 +0200
@@ -45,7 +45,9 @@
 
 include(CheckSymbolExists)
 
-set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") # For custom cmake modules
+# For custom cmake modules
+set(CMAKE_CUSTOM_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
+set(CMAKE_MODULE_PATH "${CMAKE_CUSTOM_MODULE_PATH}")
 include(BuildType)
 include(CompileCheck)
 include(CXX11Check)
$NetBSD$

Fix use of CMAKE_MODULE_PATH

--- cmake/VersionString.cmake.orig	2013-05-22 21:52:30.000000000 +0200
+++ cmake/VersionString.cmake	2013-05-22 21:53:26.000000000 +0200
@@ -47,7 +47,7 @@
 	set(mode "variable")
 	
 	set(args)
-	set(dependencies "${CMAKE_MODULE_PATH}/VersionScript.cmake")
+	set(dependencies "${CMAKE_CUSTOM_MODULE_PATH}/VersionScript.cmake")
 	
 	foreach(arg IN LISTS VERSION_SOURCES)
 		
@@ -90,7 +90,7 @@
 			"-DVERSION_SOURCES=${args}"
 			"-DGIT_DIR=${abs_git_dir}"
 			${defines}
-			-P "${CMAKE_MODULE_PATH}/VersionScript.cmake"
+			-P "${CMAKE_CUSTOM_MODULE_PATH}/VersionScript.cmake"
 		MAIN_DEPENDENCY
 			"${abs_src}"
 		DEPENDS


Home | Main Index | Thread Index | Old Index