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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ endif ( RTA_INSTALL_DATABASE )
set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/include/
CACHE PATH "Location of header files" )

export( EXPORT RAWTOACESTargets )

install( EXPORT RAWTOACESTargets
FILE RAWTOACESTargets.cmake
DESTINATION lib/cmake/RAWTOACES
Expand Down
15 changes: 10 additions & 5 deletions config/RAWTOACESConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ set(rawtoaces_VERSION "@RAWTOACES_VERSION@")
include(${CMAKE_CURRENT_LIST_DIR}/RAWTOACESTargets.cmake)

include(CMakeFindDependencyMacro)

if ( @RTA_ENABLE_EIGEN@ )
find_dependency ( Eigen3 )
endif ()
find_dependency ( Ceres )

find_dependency ( OpenImageIO )

if ( NOT @ENABLE_SHARED@ )
find_dependency ( nlohmann_json )

if ( @RTA_ENABLE_EIGEN@ )
find_dependency ( Eigen3 )
endif ()

find_dependency ( Ceres )
endif ( NOT @ENABLE_SHARED@ )

check_required_components(rawtoaces)
3 changes: 0 additions & 3 deletions src/bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,5 @@ set_target_properties( rawtoaces_bindings PROPERTIES

install(
TARGETS rawtoaces_bindings
EXPORT RAWTOACESTargets
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
PUBLIC_HEADER DESTINATION include/rawtoaces
)
2 changes: 1 addition & 1 deletion src/rawtoaces/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void update_error_message( std::string &error_message )
int main( int argc, const char *argv[] )
{
#ifndef WIN32
putenv( (char *)"TZ=UTC" );
setenv( "TZ", "UTC", 1 );
#else
_putenv( (char *)"TZ=UTC" );
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/rawtoaces_core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ target_link_libraries(
)

if ( RTA_ENABLE_EIGEN )
target_link_libraries( ${RAWTOACES_CORE_LIB} PUBLIC Eigen3::Eigen )
target_link_libraries( ${RAWTOACES_CORE_LIB} PRIVATE Eigen3::Eigen )
target_compile_definitions(${RAWTOACES_CORE_LIB} PRIVATE RTA_ENABLE_EIGEN=1 )
endif ( RTA_ENABLE_EIGEN )

if ( ${Ceres_VERSION_MAJOR} GREATER 1 )
target_link_libraries( ${RAWTOACES_CORE_LIB} PUBLIC Ceres::ceres )
target_link_libraries( ${RAWTOACES_CORE_LIB} PRIVATE Ceres::ceres )
else ()
target_include_directories(${RAWTOACES_CORE_LIB} PUBLIC ${CERES_INCLUDE_DIRS})
target_link_libraries(${RAWTOACES_CORE_LIB} PUBLIC ${CERES_LIBRARIES})
target_include_directories(${RAWTOACES_CORE_LIB} PRIVATE ${CERES_INCLUDE_DIRS})
target_link_libraries(${RAWTOACES_CORE_LIB} PRIVATE ${CERES_LIBRARIES})
endif ()

target_include_directories( ${RAWTOACES_CORE_LIB} PUBLIC
Expand Down
2 changes: 1 addition & 1 deletion src/rawtoaces_core/rawtoaces_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void calculate_daylight_SPD( const int &cct_input, Spectrum &spectrum )
constexpr size_t count = sizeof( s_series ) / sizeof( s_series[0] );
assert( count == 54 );
assert(
( s_series[1].wl - s_series[0].wl ) * ( count - 1 ) ==
( s_series[1].wl - s_series[0].wl ) * (int)( count - 1 ) ==
( s_series[53].wl - s_series[0].wl ) );

double cct;
Expand Down
14 changes: 1 addition & 13 deletions tests/config_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,25 +11,13 @@
cmake_minimum_required(VERSION 3.10)
project( rawtoaces_config_test )


# Until we get some of these modules into the upstream packages, put them here
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/../../cmake/modules/")
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_INSTALL_PREFIX}/share/CMake")

if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_compile_options ( /W0 )
add_compile_options ( /utf-8 )
add_compile_definitions( NOMINMAX )
endif()

# the Ceres::ceres alias in not getting defined on the config side
find_package ( Ceres CONFIG REQUIRED )
find_package ( OpenImageIO CONFIG REQUIRED )

# Windows build seems to expose nlohmann_json as dependency?
find_package ( nlohmann_json CONFIG REQUIRED )

find_package ( RAWTOACES CONFIG REQUIRED )
find_package ( RAWTOACES CONFIG REQUIRED )

enable_testing()
add_subdirectory(core)
Expand Down
4 changes: 2 additions & 2 deletions tests/config_tests/util/test_installed_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#endif

#include <filesystem>
#include <OpenImageIO/unittest.h>

#include <rawtoaces/image_converter.h>

#include <OpenImageIO/unittest.h>

void test_AcesRender()
{
const char *argv[] = {
Expand Down
Loading