cmake: libCuba now containing the right symbols for c++/c.

This commit is contained in:
2018-05-16 19:32:03 +02:00
parent 326f40ce04
commit 1d191acd60
6 changed files with 26 additions and 41 deletions

View File

@ -12,6 +12,7 @@ option(qt_based_tools "try to install Qt based tools (musredit, musrWiz, musrSte
option(try_OpenMP "try to use OpenMP if available" ON) option(try_OpenMP "try to use OpenMP if available" ON)
#--- perform some checks and generate the config.h ---------------------------- #--- perform some checks and generate the config.h ----------------------------
include(CheckTypeSize)
include(CheckIncludeFiles) include(CheckIncludeFiles)
include(CheckFunctionExists) include(CheckFunctionExists)
check_include_files(alloca.h HAVE_ALLOCA_H) check_include_files(alloca.h HAVE_ALLOCA_H)
@ -31,6 +32,12 @@ check_include_files(strings.h HAVE_STRINGS_H)
check_include_files(sys/stat.h HAVE_SYS_STAT_H) check_include_files(sys/stat.h HAVE_SYS_STAT_H)
check_include_files(sys/types.h HAVE_SYS_TYPES_H) check_include_files(sys/types.h HAVE_SYS_TYPES_H)
check_include_files(sys/unistd.h HAVE_UNISTD_H) check_include_files(sys/unistd.h HAVE_UNISTD_H)
check_type_size("long double" LONG_DOUBLE)
check_type_size("double" DOUBLE)
if (${LONG_DOUBLE} GREATER ${DOUBLE})
set(HAVE_LONG_DOUBLE 1)
set(HAVE_LONG_DOUBLE_WIDER 1)
endif (${LONG_DOUBLE} GREATER ${DOUBLE})
#--- check for all the needed packages ---------------------------------------- #--- check for all the needed packages ----------------------------------------

View File

@ -23,6 +23,12 @@
// Define to 1 if you have the <inttypes.h> header file. // Define to 1 if you have the <inttypes.h> header file.
#cmakedefine HAVE_INTTYPES_H 1 #cmakedefine HAVE_INTTYPES_H 1
// Define to 1 if the type `long double' works and has more range or precision than `double'.
#cmakedefine HAVE_LONG_DOUBLE 1
// Define to 1 if the type `long double' works and has more range or precision than `double'.
#cmakedefine HAVE_LONG_DOUBLE_WIDER 1
// Define to 1 if fftw3f_threads are available // Define to 1 if fftw3f_threads are available
#cmakedefine HAVE_LIBFFTW3F_THREADS 1 #cmakedefine HAVE_LIBFFTW3F_THREADS 1

View File

@ -1,29 +1,22 @@
#--- cuhre -------------------------------------------------------------------- #--- cuhre --------------------------------------------------------------------
#--- obj lib creation --------------------------------------------------------- #--- obj lib creation ---------------------------------------------------------
add_library(cuhre OBJECT add_library(cuhre OBJECT
Cuhre.c Cuhre.c
) )
#--- make sure that the include directory is found ---------------------------- #--- make sure that the include directory is found ----------------------------
target_include_directories( target_include_directories(
cuhre BEFORE PRIVATE cuhre BEFORE PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
) )
#--- check for pre compile flags ---------------------------------------------- #--- check for pre compile flags ----------------------------------------------
set(COMP_DEF "") set(COMP_DEF "-DHAVE_CONFIG_H")
if (HAVE_FORK) set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE")
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
endif (HAVE_FORK)
if (HAVE_ALLOCA_H)
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
endif (HAVE_ALLOCA_H)
if (HAVE_SHMGET)
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
endif (HAVE_SHMGET)
target_compile_definitions( target_compile_definitions(
cuhre PRIVATE ${COMP_DEF} cuhre PRIVATE ${COMP_DEF}

View File

@ -8,22 +8,15 @@ add_library(divonne OBJECT
#--- make sure that the include directory is found ---------------------------- #--- make sure that the include directory is found ----------------------------
target_include_directories( target_include_directories(
divonne BEFORE PRIVATE divonne BEFORE PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
) )
#--- check for pre compile flags ---------------------------------------------- #--- check for pre compile flags ----------------------------------------------
set(COMP_DEF "") set(COMP_DEF "-DHAVE_CONFIG_H")
if (HAVE_FORK) set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE")
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
endif (HAVE_FORK)
if (HAVE_ALLOCA_H)
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
endif (HAVE_ALLOCA_H)
if (HAVE_SHMGET)
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
endif (HAVE_SHMGET)
target_compile_definitions( target_compile_definitions(
divonne PRIVATE ${COMP_DEF} divonne PRIVATE ${COMP_DEF}

View File

@ -8,22 +8,15 @@ add_library(suave OBJECT
#--- make sure that the include directory is found ---------------------------- #--- make sure that the include directory is found ----------------------------
target_include_directories( target_include_directories(
suave BEFORE PRIVATE suave BEFORE PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
) )
#--- check for pre compile flags ---------------------------------------------- #--- check for pre compile flags ----------------------------------------------
set(COMP_DEF "") set(COMP_DEF "-DHAVE_CONFIG_H")
if (HAVE_FORK) set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE")
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
endif (HAVE_FORK)
if (HAVE_ALLOCA_H)
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
endif (HAVE_ALLOCA_H)
if (HAVE_SHMGET)
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
endif (HAVE_SHMGET)
target_compile_definitions( target_compile_definitions(
suave PRIVATE ${COMP_DEF} suave PRIVATE ${COMP_DEF}

View File

@ -8,22 +8,15 @@ add_library(vegas OBJECT
#--- make sure that the include directory is found ---------------------------- #--- make sure that the include directory is found ----------------------------
target_include_directories( target_include_directories(
vegas BEFORE PRIVATE vegas BEFORE PRIVATE
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../common>
) )
#--- check for pre compile flags ---------------------------------------------- #--- check for pre compile flags ----------------------------------------------
set(COMP_DEF "") set(COMP_DEF "-DHAVE_CONFIG_H")
if (HAVE_FORK) set(COMP_DEF ${COMP_DEF} "-DNOUNDERSCORE")
set(COMP_DEF ${COMP_DEF} "-DHAVE_FORK")
endif (HAVE_FORK)
if (HAVE_ALLOCA_H)
set(COMP_DEF ${COMP_DEF} "-DHAVE_ALLOCA_H")
endif (HAVE_ALLOCA_H)
if (HAVE_SHMGET)
set(COMP_DEF ${COMP_DEF} "-DHAVE_SHMGET")
endif (HAVE_SHMGET)
target_compile_definitions( target_compile_definitions(
vegas PRIVATE ${COMP_DEF} vegas PRIVATE ${COMP_DEF}