[brlcad-commits] SF.net SVN: brlcad:[47650] brlcad/trunk
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <sta...@us...> - 2011-11-24 02:49:52
|
Revision: 47650 http://brlcad.svn.sourceforge.net/brlcad/?rev=47650&view=rev Author: starseeker Date: 2011-11-24 02:49:44 +0000 (Thu, 24 Nov 2011) Log Message: ----------- rename, add a utility macro for easer testing/assignment of defines without lists... Modified Paths: -------------- brlcad/trunk/misc/CMake/BRLCAD_Util.cmake brlcad/trunk/src/gtools/CMakeLists.txt brlcad/trunk/src/libpkg/example/CMakeLists.txt Modified: brlcad/trunk/misc/CMake/BRLCAD_Util.cmake =================================================================== --- brlcad/trunk/misc/CMake/BRLCAD_Util.cmake 2011-11-24 02:38:02 UTC (rev 47649) +++ brlcad/trunk/misc/CMake/BRLCAD_Util.cmake 2011-11-24 02:49:44 UTC (rev 47650) @@ -240,7 +240,7 @@ # levels - the latter is not needed for BRLCAD_* targets under normal # circumstances and is intended for cases where basic non-installed # add_executable calls are made. -MACRO(BRLCAD_ADD_DEFS) +MACRO(BRLCAD_ADD_DEF_LISTS) FOREACH(deflist ${ARGN}) SET(target_def_list ${target_def_list} ${${deflist}}) ENDFOREACH(deflist ${ARGN}) @@ -250,10 +250,23 @@ FOREACH(defitem ${${deflist}}) add_definitions(${defitem}) ENDFOREACH(defitem ${${deflist}}) -ENDMACRO(BRLCAD_ADD_DEFS) +ENDMACRO(BRLCAD_ADD_DEF_LISTS) MACRO(BRLCAD_TARGET_ADD_DEFS target) GET_TARGET_PROPERTY(TARGET_EXISTING_DEFS ${target} COMPILE_DEFINITIONS) + FOREACH(defitem ${ARGN}) + SET(DEF_EXISTS "-1") + IF(TARGET_EXISTING_DEFS) + LIST(FIND TARGET_EXISTING_DEFS ${defitem} DEF_EXISTS) + ENDIF(TARGET_EXISTING_DEFS) + IF("${DEF_EXISTS}" STREQUAL "-1") + SET_PROPERTY(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS "${defitem}") + ENDIF("${DEF_EXISTS}" STREQUAL "-1") + ENDFOREACH(defitem ${ARGN}) +ENDMACRO(BRLCAD_TARGET_ADD_DEFS) + +MACRO(BRLCAD_TARGET_ADD_DEF_LISTS target) + GET_TARGET_PROPERTY(TARGET_EXISTING_DEFS ${target} COMPILE_DEFINITIONS) FOREACH(deflist ${ARGN}) SET(target_def_list ${target_def_list} ${${deflist}}) ENDFOREACH(deflist ${ARGN}) @@ -269,7 +282,7 @@ SET_PROPERTY(TARGET ${target} APPEND PROPERTY COMPILE_DEFINITIONS "${defitem}") ENDIF("${DEF_EXISTS}" STREQUAL "-1") ENDFOREACH(defitem ${${deflist}}) -ENDMACRO(BRLCAD_TARGET_ADD_DEFS) +ENDMACRO(BRLCAD_TARGET_ADD_DEF_LISTS) #----------------------------------------------------------------------------- # Core routines for adding executables and libraries to the build and Modified: brlcad/trunk/src/gtools/CMakeLists.txt =================================================================== --- brlcad/trunk/src/gtools/CMakeLists.txt 2011-11-24 02:38:02 UTC (rev 47649) +++ brlcad/trunk/src/gtools/CMakeLists.txt 2011-11-24 02:49:44 UTC (rev 47650) @@ -18,7 +18,7 @@ add_executable(beset ${beset_SRCS}) target_link_libraries(beset libbu librt libwdb) -BRLCAD_TARGET_ADD_DEFS(beset BU_DEFINES RT_DEFINES WDB_DEFINES) +BRLCAD_TARGET_ADD_DEF_LISTS(beset BU_DEFINES RT_DEFINES WDB_DEFINES) BRLCAD_ADDEXEC(g_diff g_diff.c "libtclcad libged librt") BRLCAD_ADDEXEC(g_lint g_lint.c "librt ${M_LIBRARY}") @@ -27,7 +27,7 @@ add_executable(g_transfer g_transfer.c) target_link_libraries(g_transfer librt libpkg) -BRLCAD_TARGET_ADD_DEFS(g_transfer BU_DEFINES RT_DEFINES WDB_DEFINES) +BRLCAD_TARGET_ADD_DEF_LISTS(g_transfer BU_DEFINES RT_DEFINES WDB_DEFINES) SET_TARGET_PROPERTIES(g_transfer PROPERTIES COMPILE_FLAGS "-DBRLCAD_DLL") BRLCAD_ADDFILE(g_transfer.c sample_applications) Modified: brlcad/trunk/src/libpkg/example/CMakeLists.txt =================================================================== --- brlcad/trunk/src/libpkg/example/CMakeLists.txt 2011-11-24 02:38:02 UTC (rev 47649) +++ brlcad/trunk/src/libpkg/example/CMakeLists.txt 2011-11-24 02:49:44 UTC (rev 47650) @@ -9,7 +9,7 @@ # Local includes include_directories(${CMAKE_CURRENT_SOURCE_DIR}) -BRLCAD_ADD_DEFS(BU_DEFINES PKG_DEFINES) +BRLCAD_ADD_DEF_LISTS(BU_DEFINES PKG_DEFINES) add_executable(pkg_test_server server.c) target_link_libraries(pkg_test_server libpkg libbu) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |