Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion camerad/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,20 @@ else()
endif()
endif()

# ----------------------------------------------------------------------------
# Separate the registration TU from the instrument implementation so that
# the registration is compiled into the final target.
# ----------------------------------------------------------------------------
set (INSTRUMENT_REGISTRATION ${INSTRUMENT_SOURCES})
list (FILTER INSTRUMENT_REGISTRATION INCLUDE REGEX "_interface_factory\\.cpp$")
list (FILTER INSTRUMENT_SOURCES EXCLUDE REGEX "_interface_factory\\.cpp$")

# ----------------------------------------------------------------------------
# Camera Interface Base
# ----------------------------------------------------------------------------
list (APPEND INTERFACE_SOURCES
${CAMERAD_DIR}/camera_interface.cpp
${CAMERAD_DIR}/image_process.cpp
${INSTRUMENT_SOURCES}
)
add_library(${INTERFACE_TARGET} ${INTERFACE_SOURCES})
target_link_libraries(${INTERFACE_TARGET}
Expand All @@ -132,6 +139,18 @@ target_link_libraries(${INTERFACE_TARGET}
)
target_include_directories(${INTERFACE_TARGET} PUBLIC ${INTERFACE_INCLUDES})

# ----------------------------------------------------------------------------
# instrument implementation, if any.
# objects shared by the final targets, not depended on as a library
# ----------------------------------------------------------------------------
if (INSTRUMENT_SOURCES)
add_library(instrument_obj OBJECT ${INSTRUMENT_SOURCES})
target_link_libraries(instrument_obj ${INTERFACE_TARGET})
set (INSTRUMENT_OBJECTS $<TARGET_OBJECTS:instrument_obj>)
else()
set (INSTRUMENT_OBJECTS "")
endif()

# ----------------------------------------------------------------------------
# External libraries, such as FITS, etc.
# ----------------------------------------------------------------------------
Expand Down Expand Up @@ -164,6 +183,8 @@ find_package(Threads)
add_executable(camerad
${CAMERAD_DIR}/camerad.cpp
${CAMERAD_DIR}/camera_server.cpp
${INSTRUMENT_REGISTRATION}
${INSTRUMENT_OBJECTS}
)

# ----------------------------------------------------------------------------
Expand Down
2 changes: 2 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ find_package(pybind11 CONFIG REQUIRED)

pybind11_add_module(camera_interface
${PROJECT_BASE_DIR}/python/camera_interface_module.cpp
${INSTRUMENT_REGISTRATION}
${INSTRUMENT_OBJECTS}
)

target_include_directories(camera_interface PRIVATE
Expand Down
Loading