Last active
August 29, 2015 14:19
-
-
Save yuasatakayuki/26ff7e1199ef4fd83098 to your computer and use it in GitHub Desktop.
CMakeLists.txt for sfitsio
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#--------------------------------------------- | |
# CMakeLists.txt for sfitsio | |
#--------------------------------------------- | |
CMAKE_MINIMUM_REQUIRED(VERSION 2.4) | |
SET(CMAKE_C_FLAGS_RELEASE "-Wall -O3") | |
SET(CMAKE_C_FLAGS_DEBUG "-g") | |
SET(CMAKE_BUILD_TYPE Release) | |
PROJECT(sfitsion CXX) | |
SET(serial "1.4.2") | |
SET(soserial "3") | |
set(sfitsio_SOURCES | |
fits_header_record.cc fits_header.cc fits_hdu.cc | |
fits_table_col.cc fits_table.cc fits_image.cc fitscc.cc | |
fits_hdu.h | |
fits_header.h | |
fits_header_record.h | |
fits_table.h | |
fitscc.h | |
fits_image.h | |
fits.h | |
fits_table_col.h | |
) | |
set(sfitsio_HEADERS | |
fits_hdu.h | |
fits_header.h | |
fits_header_record.h | |
fits_table.h | |
fitscc.h | |
fits_image.h | |
fits.h | |
fits_table_col.h | |
) | |
if(APPLE) | |
set(sharedlib_SUFFIX "dyld") | |
message("-- Share library suffix = ${sharedlib_SUFFIX}") | |
else(APPLE) | |
set(sharedlib_SUFFIX "so") | |
message("-- Share library suffix = ${sharedlib_SUFFIX}") | |
endif(APPLE) | |
find_path(sllib_INC_DIR | |
NAMES sli/mdarray.h sli/slierr.h | |
PATHS /usr/local/include /usr/include $ENV{HOME}/.linuxbrew/include $ENV{HOME}/work/install/include ) | |
message("-- sllib include path: ${sllib_INC_DIR}") | |
find_path(sllib_LIB_DIR | |
NAMES libsllib.${sharedlib_SUFFIX} | |
PATHS /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 $ENV{HOME}/.linuxbrew/lib $ENV{HOME}/.linuxbrew/lib64 $ENV{HOME}/work/install/lib $ENV{HOME}/work/install/lib64 ) | |
message("-- sllib lib path: ${sllib_LIB_DIR}") | |
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}) | |
INCLUDE_DIRECTORIES(${sllib_INC_DIR}/) | |
LINK_DIRECTORIES(${sllib_LIB_DIR}) | |
LINK_LIBRARIES(sllib) | |
ADD_LIBRARY(sfitsio SHARED ${sfitsio_SOURCES}) | |
SET_TARGET_PROPERTIES(sfitsio PROPERTIES VERSION ${serial} SOVERSION ${soserial}) | |
INSTALL(TARGETS sfitsio LIBRARY DESTINATION lib) | |
INSTALL(FILES ${sfitsio_HEADERS} DESTINATION include/sli) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment