if (BOOST_INCLUDES)
  include_directories (${BOOST_INCLUDES})
endif (BOOST_INCLUDES)

if (PYTHON_INCLUDES)
  include_directories (${PYTHON_INCLUDES})
endif (PYTHON_INCLUDES)

if (WCSLIB_INCLUDES)
  include_directories (
    ${WCSLIB_INCLUDES}
    )
endif (WCSLIB_INCLUDES)

add_library (wcslib SHARED wcslib.cpp)

target_link_libraries (wcslib ${WCSLIB_LIBRARIES} ${Boost_PYTHON_LIBRARY})
set_target_properties(wcslib
  PROPERTIES
  PREFIX ""
#  LINK_FLAGS "-undefined dynamic_lookup"
  )

## Linker instructions

if (APPLE)
  set_target_properties (wcslib
    PROPERTIES
    LINK_FLAGS "-fPIC -bundle -headerpad_max_install_names -undefined dynamic_lookup"
    )
else (APPLE)
  set_target_properties (wcslib
    PROPERTIES
    LINK_FLAGS "-shared"
    )
endif (APPLE)


install (TARGETS wcslib
	 DESTINATION ${PYTHON_LOCAL_PACKAGE_DIR})

if (BOOST_INCLUDES)
  include_directories (${BOOST_INCLUDES})
endif (BOOST_INCLUDES)

if (PYTHON_INCLUDES)
  include_directories (${PYTHON_INCLUDES})
endif (PYTHON_INCLUDES)

if (WCSLIB_INCLUDES)
  include_directories (
    ${WCSLIB_INCLUDES}
    )
endif (WCSLIB_INCLUDES)

add_library (wcslib MODULE wcslib.cpp)

target_link_libraries (wcslib ${WCSLIB_LIBRARIES} ${Boost_PYTHON_LIBRARY})
set_target_properties(wcslib
  PROPERTIES
  PREFIX ""
#  LINK_FLAGS "-undefined dynamic_lookup"
  )

## Linker instructions

if (APPLE)
  set_target_properties (wcslib
    PROPERTIES
    LINK_FLAGS "-undefined dynamic_lookup"
    )
else (APPLE)
  set_target_properties (wcslib
    PROPERTIES
    LINK_FLAGS "-shared"
    )
endif (APPLE)


install (TARGETS wcslib
	 DESTINATION ${PYTHON_LOCAL_PACKAGE_DIR})

Fix build of wcslib module on OSX
Fix build of wcslib module on OSX

git-svn-id: 71bcaaf8fac6301ed959c5094abb905057e55e2d@2120 2b73c8c1-3922-0410-90dd-bc0a5c6f2ac6
