Commit 14ae5d81 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[FIX] - fixed fixture copy to core directory. Now, the build dir contains a...

[FIX] - fixed fixture copy to core directory. Now, the build dir contains a subdirectory called fixtures
parent d3d58c3a
......@@ -29,7 +29,35 @@ SET( OW_LIB_OPENWALNUT "openwalnut" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# External Building Support
# This is executed on inclusion. It sets up everything needed. Beginning with compiler and OpenWalnut options and the third-party dependencies.
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# guard against in-source builds
IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
MESSAGE( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. (you may need to remove CMakeCache.txt" )
ENDIF()
# the build types
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo"
FORCE
)
ENDIF( NOT CMAKE_BUILD_TYPE )
# guard against typos in build-type strings
STRING( TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
IF( NOT cmake_build_type_tolower STREQUAL "debug" AND
NOT cmake_build_type_tolower STREQUAL "release" AND
NOT cmake_build_type_tolower STREQUAL "relwithdebinfo" AND
NOT cmake_build_type_tolower STREQUAL "")
MESSAGE( SEND_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo and \"\" (case-insensitive).")
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# External Building Support (find OpenWalnut if needed)
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -41,10 +69,25 @@ IF( NOT ${OW_EXTERNAL_MODULE} )
ELSE()
MESSAGE( STATUS "This is OpenWalnut Build System configured for external use." )
FIND_PATH( OPENWALNUT_INCLUDE_DIR core/kernel/WKernel.h $ENV{OPENWALNUT_INCLUDEDIR} /usr/include/openwalnut /usr/local/include/openwalnut )
FIND_LIBRARY( OPENWALNUT_LIBRARIES NAMES ${OW_LIB_OPENWALNUT} lib${OW_LIB_OPENWALNUT} HINTS $ENV{OPENWALNUT_LIBDIR} /usr/lib /usr/local/lib )
FIND_PATH( OPENWALNUT_INCLUDE_DIR core/kernel/WKernel.h ${OPENWALNUT_INCLUDEDIR} $ENV{OPENWALNUT_INCLUDEDIR} /usr/include/openwalnut /usr/local/include/openwalnut )
FIND_LIBRARY( OPENWALNUT_LIBRARIES NAMES ${OW_LIB_OPENWALNUT} lib${OW_LIB_OPENWALNUT} HINTS
${OPENWALNUT_LIBDIR}
$ENV{OPENWALNUT_LIBDIR}
/usr/lib
/usr/local/lib
/usr
/usr/local
/usr/local/openwalnut
/usr/local/OpenWalnut
$ENV{PROGRAMFILES}/OpenWalnut )
SET( OPENWALNUT_FOUND FALSE )
# do not confuse the user with this
MARK_AS_ADVANCED( FORCE OPENWALNUT_INCLUDE_DIR )
MARK_AS_ADVANCED( FORCE OPENWALNUT_LIBRARIES )
MARK_AS_ADVANCED( FORCE OPENWALNUT_FOUND )
# provide some output
IF( OPENWALNUT_INCLUDE_DIR )
MESSAGE( STATUS "Found OpenWalnut include files in ${OPENWALNUT_INCLUDE_DIR}." )
......@@ -124,34 +167,6 @@ FUNCTION( BUILD_SYSTEM_COMPILER )
SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g -DDEBUG -O2" CACHE STRING "" FORCE )
ENDFUNCTION( BUILD_SYSTEM_COMPILER )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# This is executed on inclusion. It sets up everything needed. Beginning with compiler and OpenWalnut options and the third-party dependencies.
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# guard against in-source builds
IF( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
MESSAGE( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. (you may need to remove CMakeCache.txt" )
ENDIF()
# the build types
IF( NOT CMAKE_BUILD_TYPE )
SET( CMAKE_BUILD_TYPE Release
CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo"
FORCE
)
ENDIF( NOT CMAKE_BUILD_TYPE )
# guard against typos in build-type strings
STRING( TOLOWER "${CMAKE_BUILD_TYPE}" cmake_build_type_tolower)
IF( NOT cmake_build_type_tolower STREQUAL "debug" AND
NOT cmake_build_type_tolower STREQUAL "release" AND
NOT cmake_build_type_tolower STREQUAL "relwithdebinfo" AND
NOT cmake_build_type_tolower STREQUAL "")
MESSAGE( SEND_ERROR "Unknown build type \"${CMAKE_BUILD_TYPE}\". Allowed values are Debug, Release, RelWithDebInfo and \"\" (case-insensitive).")
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Compiler setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -343,11 +358,11 @@ IF( EXISTS ${OW_DOXYGEN_DIR}/doxygenConfig )
COMMENT "Build doxygen documentation"
VERBATIM
)
ENDIF()
# On Windows, we want the common doc (README, AUTHORS and COPYING) to be in the root install dir too:
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
SETUP_COMMON_DOC( "." "COMMON_DOC_ON_WINDOWS" )
ENDIF()
# On Windows, we want the common doc (README, AUTHORS and COPYING) to be in the root install dir too:
IF( CMAKE_HOST_SYSTEM MATCHES "Windows" )
SETUP_COMMON_DOC( "." "COMMON_DOC_ON_WINDOWS" )
ENDIF()
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......
......@@ -123,7 +123,7 @@ FUNCTION( SETUP_TESTS _TEST_FILES _TEST_TARGET )
SET( _DEPENDENCIES ${ARGV2} )
# target directory for fixtures
SET( FixtureTargetDirectory "${CMAKE_BINARY_DIR}/core/fixtures/" )
SET( FixtureTargetDirectory "${CMAKE_BINARY_DIR}/fixtures/${_TEST_TARGET}" )
# -------------------------------------------------------------------------------------------------------------------------------------------
# Setup CXX test
......@@ -275,13 +275,22 @@ ENDFUNCTION( SETUP_STYLECHECKER )
# This function handles local and global resources needed for program execution. This is a generic function which allows any resource in a source directory
# to be copied to a target directory in build and install directory. Use this for module resources or the OpenWalnut resources.
# _source_path path to a directory whose CONTENTS get copied/installed
#
# For convenience, this function first checks in _source_path, and if nothing was found there, in ${CMAKE_CURRENT_SOURCE_DIR}/${_source_path}]
# _source_path path to a directory whose CONTENTS get copied/installed.
# _destination_path where to put the resources. This MUST be relative to the install/build dir (${PROJECT_BINARY_DIR})
# _component the component to which this is related. This must be unique for every call.
# _installcomponent to which installation component does this resource belong? (i.e. MODULES ...)
FUNCTION( SETUP_RESOURCES_GENERIC _source_path _destination_path _component _installcomponent )
# as all the resources with the correct directory structure reside in ../resources, this target is very easy to handle
SET( ResourcesPath "${_source_path}" )
# if the given dir does not exists here, it might be relative? lets try to check this against the current source directory
IF( NOT IS_DIRECTORY "${ResourcesPath}" )
SET( ResourcesPath ${CMAKE_CURRENT_SOURCE_DIR}/${ResourcesPath} )
MESSAGE( STATUS "OW Hint: assuming resource in current source path for ${_component}." )
ENDIF()
# remove trailing slashes if any
STRING( REGEX REPLACE "/$" "" ResourcesPath "${ResourcesPath}" )
# this ensures we definitely have one slash at the and
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment