|
From: <gb...@us...> - 2008-02-25 08:15:24
|
Revision: 80
http://gearbox.svn.sourceforge.net/gearbox/?rev=80&view=rev
Author: gbiggs
Date: 2008-02-25 00:15:29 -0800 (Mon, 25 Feb 2008)
Log Message:
-----------
Added code to force ENABLE_* variables to off in ccmake UI if dependencies aren't met.
Modified Paths:
--------------
gearbox/trunk/cmake/internal/DependencyUtils.cmake
Modified: gearbox/trunk/cmake/internal/DependencyUtils.cmake
===================================================================
--- gearbox/trunk/cmake/internal/DependencyUtils.cmake 2008-02-25 07:45:51 UTC (rev 79)
+++ gearbox/trunk/cmake/internal/DependencyUtils.cmake 2008-02-25 08:15:29 UTC (rev 80)
@@ -1,3 +1,23 @@
+MACRO( GBX_MAKE_OPTION_NAME option_name module_type module_name )
+
+ STRING ( COMPARE EQUAL ${module_type} "EXE" is_exe )
+ STRING ( COMPARE EQUAL ${module_type} "LIB" is_lib )
+ IF ( NOT is_exe AND NOT is_lib )
+ MESSAGE ( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
+ ENDIF ( NOT is_exe AND NOT is_lib )
+ IF ( is_exe AND is_lib )
+ MESSAGE ( FATAL_ERROR "In macro GBX_MAKE_OPTION_NAME, module_type must be either 'EXE' or 'LIB'" )
+ ENDIF ( is_exe AND is_lib )
+
+ STRING( TOUPPER ${module_name} module_name_upper )
+ IF ( is_exe )
+ SET( option_name "ENABLE_${module_name_upper}" )
+ ELSE ( is_exe )
+ SET( option_name "ENABLE_LIB_${module_name_upper}" )
+ ENDIF ( is_exe )
+
+ENDMACRO( GBX_MAKE_OPTION_NAME option_name module_name )
+
#
# GBX_REQUIRE_OPTION( cumulative_var [EXE | LIB] module_name default_option_value [option_name] [OPTION DESCRIPTION] )
#
@@ -77,10 +97,10 @@
STRING ( COMPARE EQUAL ${module_type} "EXE" is_exe )
STRING ( COMPARE EQUAL ${module_type} "LIB" is_lib )
IF ( NOT is_exe AND NOT is_lib )
- MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
+ MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
ENDIF ( NOT is_exe AND NOT is_lib )
IF ( is_exe AND is_lib )
- MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
+ MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_VAR, module_type must be either 'EXE' or 'LIB'" )
ENDIF ( is_exe AND is_lib )
# must dereference both var names once (!) and IF will evaluate their values
@@ -112,10 +132,10 @@
STRING ( COMPARE EQUAL ${module_type} "EXE" is_exe )
STRING ( COMPARE EQUAL ${module_type} "LIB" is_lib )
IF ( NOT is_exe AND NOT is_lib )
- MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
+ MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
ENDIF ( NOT is_exe AND NOT is_lib )
IF ( is_exe AND is_lib )
- MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_OPTION, module_type must be either 'EXE' or 'LIB'" )
+ MESSAGE ( FATAL_ERROR "In macro GBX_REQUIRE_TARGET, module_type must be either 'EXE' or 'LIB'" )
ENDIF ( is_exe AND is_lib )
IF ( ${ARGC} GREATER 5 )
@@ -129,10 +149,13 @@
# must dereference both var and option names once (!) and IF will evaluate their values
IF ( ${cumulative_var} AND NOT target_location )
SET( ${cumulative_var} FALSE )
+ GBX_MAKE_OPTION_NAME( option_name ${module_type} ${module_name} )
IF ( is_exe )
GBX_NOT_ADD_EXECUTABLE( ${module_name} ${reason} )
+ SET( ${option_name} OFF CACHE BOOL "Try to build ${module_name}" FORCE )
ELSE ( is_exe )
GBX_NOT_ADD_LIBRARY( ${module_name} ${reason} )
+ SET( ${option_name} OFF CACHE BOOL "Try to build lib${module_name} library" FORCE )
ENDIF ( is_exe )
ENDIF ( ${cumulative_var} AND NOT target_location )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|