Skip to content
Snippets Groups Projects
Commit b2deb7b7 authored by Martin Gels's avatar Martin Gels
Browse files

bug 1005: Updated cmake file(s).

parent 9052d625
Branches
Tags
No related merge requests found
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Project characteristics ## Project characteristics
project (LCS) project (LCS)
cmake_minimum_required (VERSION 2.5) cmake_minimum_required (VERSION 2.6)
##------------------------------------------------------------------------------- ##-------------------------------------------------------------------------------
## Options ## Options
...@@ -14,8 +13,8 @@ option (LCS_BUILD_TESTS "Build test programs?" FALSE) ...@@ -14,8 +13,8 @@ option (LCS_BUILD_TESTS "Build test programs?" FALSE)
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Set CMAKE_MODULE_PATH to load custom CMake modules ## Set CMAKE_MODULE_PATH to load custom CMake modules
if (NOT USG_ROOT) if (NOT LOFAR_ROOT)
find_path (USG_ROOT cmake/CMakeSettings.cmake find_path (LOFAR_ROOT cmake/modules/CMakeSettings.cmake
PATHS PATHS
${LCS_SOURCE_DIR} ${LCS_SOURCE_DIR}
${LCS_SOURCE_DIR}/.. ${LCS_SOURCE_DIR}/..
...@@ -24,21 +23,12 @@ find_path (USG_ROOT cmake/CMakeSettings.cmake ...@@ -24,21 +23,12 @@ find_path (USG_ROOT cmake/CMakeSettings.cmake
$ENV{LOFARSOFT} $ENV{LOFARSOFT}
) )
if (USG_ROOT) if (LOFAR_ROOT)
include (${USG_ROOT}/cmake/CMakeSettings.cmake) include (${LOFAR_ROOT}/cmake/CMakeSettings.cmake)
else (USG_ROOT) else (LOFAR_ROOT)
message (FATAL_ERROR "Unable to locate additional CMake scripts!") message (FATAL_ERROR "Unable to locate additional CMake scripts!")
endif (USG_ROOT) endif (LOFAR_ROOT)
endif (NOT USG_ROOT) endif (NOT LOFAR_ROOT)
## ------------------------------------------------------------------------------
## Commonly used configuration files
set (LCS_config ${LCS_BINARY_DIR}/lofar_config.h)
file (WRITE ${LCS_config} "/* lofar_config.h -- Generated by CMake. */\n\n")
include_directories (${LCS_BINARY_DIR})
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Additional CMake modules ## Additional CMake modules
...@@ -56,88 +46,80 @@ enable_testing() ...@@ -56,88 +46,80 @@ enable_testing()
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Check system libraries ## Check system libraries
check_include_files (sys/socket.h HAVE_SYS_SOCKET_H )
check_include_files (sys/types.h HAVE_SYS_TYPES_H )
check_include_files (unistd.h HAVE_UNISTD_H )
check_include_files (stdarg.h HAVE_STDARG_H )
check_include_files (time.h HAVE_TIME_H )
check_include_files (stdio.h HAVE_STDIO_H )
check_include_files (netinet/in.h HAVE_NETINET_IN_H )
if (HAVE_SYS_TYPES_H)
check_type_size ("uint" HAVE_UINT)
if (HAVE_UINT)
add_definitions (-DHAVE_UINT)
endif (HAVE_UINT)
##
check_type_size ("long" HAVE_LONG)
if (HAVE_LONG)
add_definitions (-DHAVE_LONG)
endif (HAVE_LONG)
##
check_type_size ("long long" HAVE_LONGLONG)
if (HAVE_LONGLONG)
add_definitions (-DHAVE_LONGLONG)
endif (HAVE_LONGLONG)
##
check_type_size ("ushort" HAVE_USHORT)
if (HAVE_USHORT)
add_definitions (-DHAVE_USHORT)
endif (HAVE_USHORT)
else (HAVE_SYS_TYPES_H)
message (STATUS "Unable to find sys/types.h")
endif (HAVE_SYS_TYPES_H)
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Search for external libraries ## Search for external libraries
## Boost++
include (${USG_ROOT}/cmake/FindBoost.cmake)
if (BOOST_INCLUDES)
include_directories (${BOOST_INCLUDES})
add_definitions (-DHAVE_BOOST)
endif (BOOST_INCLUDES)
## casacore
include (${USG_ROOT}/cmake/FindCASACORE.cmake)
if (CASACORE_INCLUDES)
include_directories (${CASACORE_INCLUDES})
add_definitions (-DHAVE_AIPSPP)
endif (CASACORE_INCLUDES)
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Check for required tools ## Check for required tools
find_program ( bison_bin bison )
find_program ( flex_bin flex )
find_program ( yacc_bin yacc )
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Module header files ## Module header files
include_directories (
${LCS_SOURCE_DIR}/Blob/include
${LCS_SOURCE_DIR}/Common/include
${LCS_SOURCE_DIR}/ACC/ALC/include
${LCS_SOURCE_DIR}/ACC/APS/include
${LCS_SOURCE_DIR}/ACC/PLC/include
${LCS_SOURCE_DIR}/AMC/AMCBase/include
${LCS_SOURCE_DIR}/AMC/AMCImpl/include
${LCS_SOURCE_DIR}/Transport/include
)
## ------------------------------------------------------------------------------ ## ------------------------------------------------------------------------------
## Directories to be included in the build ## Directories to be included in the build
## --- Tools ----------------------------------------
find_path (HAVE_TOOLS CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/Tools)
if (HAVE_TOOLS)
set (HAVE_TOOLS TRUE CACHE BOOL "Have package Tools?" FORCE)
add_subdirectory (Tools)
endif (HAVE_TOOLS)
## --- Common ---------------------------------------
find_path (HAVE_COMMON CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/Common)
if (HAVE_COMMON)
set (HAVE_COMMON TRUE CACHE BOOL "Have package Common?" FORCE)
add_subdirectory (Common)
endif (HAVE_COMMON)
## --- ACC ------------------------------------------
find_path (HAVE_ACC CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/ACC)
if (HAVE_ACC)
set (HAVE_ACC TRUE CACHE BOOL "Have package ACC?" FORCE)
add_subdirectory (ACC) add_subdirectory (ACC)
endif (HAVE_ACC)
## --- AMC ------------------------------------------
find_path (HAVE_AMC CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/AMC)
if (HAVE_AMC)
set (HAVE_AMC TRUE CACHE BOOL "Have package AMC?" FORCE)
add_subdirectory (AMC) add_subdirectory (AMC)
endif (HAVE_AMC)
## --- BLOB -----------------------------------------
find_path (HAVE_BLOB CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/Blob)
if (HAVE_BLOB)
set (HAVE_BLOB TRUE CACHE BOOL "Have package Blob?" FORCE)
add_subdirectory (Blob) add_subdirectory (Blob)
add_subdirectory (Common) endif (HAVE_BLOB)
#add_subdirectory (LACE)
#add_subdirectory (Math) ## --- TRANSPORT ------------------------------------
add_subdirectory (Tools)
find_path (HAVE_TRANSPORT CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/Transport)
if (HAVE_TRANSPORT)
set (HAVE_TRANSPORT TRUE CACHE BOOL "Have package Transport?" FORCE)
add_subdirectory (Transport) add_subdirectory (Transport)
endif (HAVE_TRANSPORT)
## --- STREAM ---------------------------------------
find_path (HAVE_STREAM CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/Stream)
if (HAVE_STREAM)
set (HAVE_STREAM TRUE CACHE BOOL "Have package Stream?" FORCE)
add_subdirectory (Stream)
endif (HAVE_STREAM)
## --- APPLCOMMON -----------------------------------
find_path (HAVE_APPLCOMMON CMakeLists.txt ${LOFAR_SOURCE_DIR}/LCS/ApplCommon)
if (HAVE_APPLCOMMON)
set (HAVE_APPLCOMMON TRUE CACHE BOOL "Have package ApplCommon?" FORCE)
add_subdirectory (ApplCommon)
endif (HAVE_APPLCOMMON)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment