Commit ef402aba authored by Laurent Claustre's avatar Laurent Claustre Committed by Sebastien Petitdemange

back for windows, need some fix for linux.

parent 93ed3fe9
......@@ -212,7 +212,8 @@ set(ct_srcs control/software_operation/src/SoftOpInternalMgr.cpp control/softwar
#--------------------------------------------------------------------------------
# Option for libconfig++ support
#--------------------------------------------------------------------------------
set(extra_libs)
set(extra_libs)
set(extra_includes)
if(LIMA_ENABLE_CONFIG)
if(WIN32)
if (${CMAKE_GENERATOR} MATCHES "(2008|2010|2013)")
......@@ -232,8 +233,6 @@ if(LIMA_ENABLE_CONFIG)
endif()
set(LIB_CONFIG_INCLUDE_DIR "C:/Program Files/LIBCONFIG-windows/${CONFIG_VERSION}/include" CACHE PATH "Path to LIBCONFIG++ includes")
set(LIB_CONFIG_DIR "C:/Program Files/LIBCONFIG-windows/${CONFIG_VERSION}/lib" CACHE PATH "Path to GSL lib folder")
include_directories(${LIB_CONFIG_INCLUDE_DIR})
link_directories(${LIB_CONFIG_DIR})
find_library(LIB_CONFIG libconfig++ ${LIB_CONFIG_DIR})
else()
find_library(LIB_CONFIG config++)
......@@ -247,6 +246,8 @@ if(LIMA_ENABLE_CONFIG)
set(extra_libs ${extra_libs} ${LIB_CONFIG})
set(common_srcs ${common_srcs} common/src/ConfigUtils.cpp)
set(control_srcs ${control_srcs} control/src/CtConfig.cpp)
link_directories(${LIB_CONFIG_DIR})
set(extra_includes ${extra_includes} ${LIB_CONFIG_INCLUDE_DIR})
else()
message(FATAL_ERROR "libconfig++ not found, set LIB_CONFIG path or disable LIMA_ENABLE_CONFIG")
endif()
......@@ -281,7 +282,6 @@ if(LIMA_ENABLE_EDFGZ)
endif()
set(LIB_ZLIB_INCLUDE_DIR "C:/Program Files/zlib-windows/${ZLIB_ARCH}/include" CACHE PATH "Path to zlib includes")
set(LIB_ZLIB_DIR "C:/Program Files/zlib-windows/${ZLIB_ARCH}/lib" CACHE PATH "Path to zlib libs")
include_directories(${LIB_ZLIB_INCLUDE_DIR})
link_directories(${LIB_ZLIB_DIR})
find_library(LIB_ZLIB zlibstatic ${LIB_ZLIB_DIR})
add_definitions(-DZLIB_WINAPI)
......@@ -294,6 +294,7 @@ if(LIMA_ENABLE_EDFGZ)
if(${ZLIB_FOUND})
add_definitions(-DWITH_EDFGZ_SAVING)
set(saving_libs ${saving_libs} ${LIB_ZLIB})
set(saving_includes ${saving_includes} ${LIB_ZLIB_INCLUDE_DIR})
else()
message(FATAL_ERROR "ZLIB library not found, please install or disable LIMA_ENABLE_EDFGZ")
endif()
......@@ -308,6 +309,7 @@ if(LIMA_ENABLE_EDFLZ4)
if (LZ4_FOUND)
add_definitions(-DWITH_EDFLZ4_SAVING)
set(saving_libs ${saving_libs} ${LIB_LZ4})
set(saving_includes ${saving_includes} ${LIB_LZ4_INCLUDE_DIR})
else()
message(FATAL_ERROR "LZ4 library: required version = 1.7.x, please update or switch off LIMA_ENABLE_EDFLZ4")
endif()
......@@ -323,21 +325,23 @@ if(LIMA_ENABLE_CBF)
add_definitions(-DPROTOTYPES)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Cbf.cpp)
set(saving_libs ${saving_libs} ${LIB_CBF} crypto)
set(saving_includes ${saving_includes} ${LIB_CBF_INCLUDE_DIR})
else()
message(FATAL_ERROR "CBF library not found, please install or disable LIMA_ENABLE_CBF")
endif()
endif()
if(LIMA_ENABLE_FITS)
find_path(LIB_FITS_INCLUDE_DIR CCfits/CCfits.h)
find_path(LIB_FITS_INCLUDE_DIR CCfits/CCfits.h)
find_library(LIB_CFITSIO cfitsio)
find_library(LIB_CCFITS CCfits)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(FITS DEFAULT_MSG LIB_CCFITS LIB_CCFITS_INCLUDE_DIR)
find_package_handle_standard_args(FITS DEFAULT_MSG LIB_CCFITS LIB_FITS_INCLUDE_DIR)
if(${FITS_FOUND})
add_definitions(-DWITH_FITS_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Fits.cpp)
set(saving_libs ${saving_libs} ${LIB_CFITSIO} ${LIB_CCFITS})
set(saving_includes ${saving_includes} ${LIB_FITS_INCLUDE_DIR})
else()
message(FATAL_ERROR "CFITSIO and/or CCFITS library not found, please install or disable LIMA_ENABLE_FITS")
endif()
......@@ -354,47 +358,47 @@ if(LIMA_ENABLE_HDF5)
endif()
set(LIB_HDF5_INCLUDE_DIR "C:/Program Files/HDF_Group/HDF5/${HDF5_VERSION}/include" CACHE PATH "Path to HDF5 includes")
set(LIB_HDF5_DIR "C:/Program Files/HDF_Group/HDF5/${HDF5_VERSION}/lib" CACHE PATH "Path to HDF5 libs")
include_directories(${LIB_HDF5_INCLUDE_DIR})
link_directories(${LIB_HDF5_DIR})
# we use static libs libhdf5.lib and libhdf5_cpp.lib
find_library(LIB_HDF5_CPP libhdf5_cpp ${LIB_HDF5_DIR})
find_library(LIB_HDF5 libhdf5 ${LIB_HDF5_DIR})
find_library(LIB_ZLIB libzlib ${LIB_HDF5_DIR})
find_library(LIB_SZIP libszip ${LIB_HDF5_DIR})
else()
else()
set(LIB_HDF5_INCLUDE_DIR "/usr/include/hdf5/serial")
find_library(LIB_HDF5_CPP hdf5_cpp)
find_library(LIB_HDF5 hdf5_serial)
find_path(LIB_HDF5_INCLUDE_DIR H5Cpp.h)
endif()
find_path(LIB_HDF5_INCLUDE_DIR H5cpp.h)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HDF5 DEFAULT_MSG LIB_HDF5 LIB_HDF5_INCLUDE_DIR)
if(${HDF5_FOUND})
if(${HDF5_FOUND})
add_definitions(-DWITH_HDF5_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Hdf5.cpp)
set(saving_libs ${saving_libs} ${LIB_HDF5} ${LIB_HDF5_CPP} ${LIB_SZIP} ${LIB_ZLIB})
if (UNIX)
set(saving_includes ${saving_includes} "/usr/include/hdf5/serial")
endif()
else()
set(saving_includes ${saving_includes} ${LIB_HDF5_INCLUDE_DIR})
else()
message(FATAL_ERROR "hdf5_cpp library not found, please install or disable LIMA_ENABLE_HDF5")
endif()
endif()
endif()
if(LIMA_ENABLE_NXS)
find_path(LIB_NXS_INCLUDE_DIR nexuscpp/nexuscpp.h)
find_library(LIB_NXS nexuscpp)
find_path(LIB_NXS_INCLUDE_DIR nexuscpp/nexuscpp.h)
find_library(LIB_NXS nexuscpp)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(NXS DEFAULT_MSG LIB_NXS LIB_NXS_INCLUDE_DIR)
if(${NXS_FOUND})
add_definitions(-DWITH_NXS_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_NXS.cpp)
set(saving_includes ${saving_includes} ${LIB_NXS_INCLUDE_DIR})
else()
message(FATAL_ERROR "NEXUS cpp library not installed, please install or disable LIMA_ENABLE_NXS")
endif()
endif()
if(LIMA_ENABLE_TIFF)
find_path(LIB_TIFF_INCLUDE_DIR tiffio.h)
find_path(LIB_TIFF_INCLUDE_DIR tiffio.h)
find_library(LIB_TIFF tiff)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(TIFF DEFAULT_MSG LIB_TIFF LIB_TIFF_INCLUDE_DIR)
......@@ -402,6 +406,7 @@ if(LIMA_ENABLE_TIFF)
add_definitions(-DWITH_TIFF_SAVING)
set(ct_srcs ${ct_srcs} control/src/CtSaving_Tiff.cpp)
set(saving_libs ${saving_libs} tiff)
set(saving_includes ${saving_includes} ${LIB_TIFF_INCLUDE_DIR})
else()
message(FATAL_ERROR "TIFF library not found, please install or disable LIMA_ENABLE_TIFF")
endif()
......@@ -430,7 +435,9 @@ target_include_directories(limacore PUBLIC
if(LIMA_ENABLE_SPS_IMAGE)
target_include_directories(limacore PRIVATE "${CMAKE_SOURCE_DIR}/third-party/Sps/Include")
endif()
target_include_directories(limacore PRIVATE ${saving_includes})
# add all include paths coming from saving format options
target_include_directories(limacore PRIVATE ${extra_includes} ${saving_includes})
if(THREADS_HAVE_PTHREAD_ARG)
target_compile_options(PUBLIC limacore "-pthread")
......
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