Commits

a4z committed bffb82f

added former subrepo files

Comments (0)

Files changed (4)

a4cmk/myBoostSetup.cmake

+
+
+if (NOT have_myBoostSetup)
+
+    #generel to find boost 
+    if ( NOT BOOSTROOT AND NOT BOOST_ROOT)
+        set( BOOSTROOT  $ENV{BOOSTROOT} )
+        if (NOT BOOSTROOT)
+            set( BOOSTROOT  $ENV{BOOST_ROOT} )
+        endif()
+    endif()
+    
+    if(WIN32 AND MSVC)
+    
+        if (NOT BOOSTROOT)
+        #TODO , check "C:/Program Files/boost" and C:/Boost ...
+            message( STATUS "use some default value for Boost installation root" )
+            set(BOOSTROOT "C:/Program Files/boost")
+        endif(NOT BOOSTROOT)
+    
+    endif(WIN32 AND MSVC)
+
+    
+    SET(BOOSTROOT ${BOOSTROOT} CACHE PATH "where to find boost" )   
+    
+    #set(Boost_ADDITIONAL_VERSIONS "1.46.1" CACHE STRING "additional boost versions")
+    option (Boost_NO_SYSTEM_PATHS "prevent searching system path for boost" OFF)
+    option(Boost_USE_STATIC_LIBS "Can be set to ON to force the use of the static boost libraries" OFF)
+    option(Boost_USE_MULTITHREAD "set to OFF to use the non-multithreaded boost libs" ON)
+    
+
+    find_package( Boost )
+    include_directories( BEFORE SYSTEM ${Boost_INCLUDE_DIR} )
+    #link_directories ( ${Boost_LIBRARY_DIRS} ) 
+    
+    set( have_myBoostSetup ON BOOL)
+
+endif (NOT have_myBoostSetup)

a4cmk/myDocSetup.cmake

+
+
+if (NOT have_myDocSetup)
+
+    option(BUILD_DOCUMENTATION "make Doxygen documentation" ON)
+#das sollt da raus weil ja nur die option gefragt, die action jedoch includiert sein soll    
+    if(BUILD_DOCUMENTATION)
+    
+        find_package( Doxygen )
+        
+        if(DOXYGEN_FOUND)
+        
+            if(DOT)
+                set(HAVE_DOT YES)
+            else(DOT)
+                set(HAVE_DOT NO)
+            endif(DOT)
+        
+            configure_file(${PROJECT_SOURCE_DIR}/doc/doxyfile.cmake
+                ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}.doxyfile
+            )
+        
+            #todo, naming, would like to have doxydoc in all projects
+            add_custom_target(doc${PROJECT_NAME} ${DOXYGEN}
+                ${PROJECT_BINARY_DIR}/doc/${PROJECT_NAME}.doxyfile
+            )
+    
+        endif(DOXYGEN_FOUND)
+        
+    endif(BUILD_DOCUMENTATION)
+    
+    
+    set(have_myDocSetup ON BOOL)    
+
+endif (NOT have_myDocSetup)

a4cmk/myMacros.cmake

+
+
+if (NOT have_myMacros)
+
+    
+    #haengt ueberall das praefix davor
+    MACRO(PREFIX_WITH pre what)
+        #message(STATUS ${what})
+        SET(tmp "")
+        FOREACH(element ${${what}})
+        	SET(tmp ${pre}${element} ${tmp})
+        ENDFOREACH(element)
+        SET(${what} ${tmp})
+    ENDMACRO(PREFIX_WITH)
+    
+    
+    MACRO(PREFIX_COMPILER_DEFINES deflist)
+            #message(STATUS ${${deflist}})
+            if ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
+                set(perfixd "-D")
+            elseif( MSVC )
+                set(perfixd "/D")        
+            else ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )
+                message(WARNING "unhandled compiler, can not set define prefix")
+            endif ( CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX )    
+        
+            PREFIX_WITH(${perfixd} ${deflist})  
+        
+    ENDMACRO(PREFIX_COMPILER_DEFINES)
+
+
+
+    set( have_myMacros ON )
+
+endif (NOT have_myMacros)
+
+
+
+

a4cmk/myTestSetup.cmake

+
+
+#requires a tests subdir, creates ${PROJECT_NAME}_BUILD_TESTS and sets a4_TEST_DEFINES   
+if(NOT ALL_A4_TESTING_DISABLED)
+    
+    option(${PROJECT_NAME}_BUILD_TESTS "build tests" ON)
+    
+    if (${PROJECT_NAME}_BUILD_TESTS)
+    
+        ENABLE_TESTING()
+        
+        if(NOT HAVE_USE_BOOSTTESTING_DYNLINK_OPTION )
+            option( USE_BOOSTTESTING_DYNLINK "link against libboost_testing library(ON), use header only(OFF)" OFF)    
+        endif(NOT HAVE_USE_BOOSTTESTING_DYNLINK_OPTION )
+        
+        if(NOT USE_BOOSTTESTING_DYNLINK)
+            set (a4_TEST_DEFINES BOOST_UNIT_TEST_FRAMEWORK_NO_LIB BOOST_TEST_NO_LIB)
+        endif(NOT USE_BOOSTTESTING_DYNLINK)
+        
+        # check if comes as bundle/subproject, if use subdir for test output
+        if(${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR})
+            set(${PROJECT_NAME}_TEST_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/tests)
+
+        else(${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR})
+            set(${PROJECT_NAME}_TEST_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}_tests)
+
+        endif(${CMAKE_BINARY_DIR} STREQUAL ${PROJECT_BINARY_DIR})
+
+        message (STATUS "** set "${PROJECT_NAME}_TEST_BINARY_DIR" to "${${PROJECT_NAME}_TEST_BINARY_DIR} )
+             
+        
+        add_subdirectory(tests)        
+        
+    endif (${PROJECT_NAME}_BUILD_TESTS)
+endif(NOT ALL_A4_TESTING_DISABLED)