Skip to content

Commit

Permalink
This fixes issue #128. Gtest should not be installed. the .bin folder…
Browse files Browse the repository at this point in the history
… is removed. version bump.
  • Loading branch information
aous72 committed Feb 13, 2024
1 parent 8f5924d commit 4d1dfe8
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 53 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ option(OJPH_ENABLE_TIFF_SUPPORT "Enables input and output support for TIFF files
option(OJPH_BUILD_TESTS "Enables building test code" OFF)
option(OJPH_BUILD_EXECUTABLES "Enables building command line executables" ON)

## specify output directories
set(OJPH_DESTINATION_BINARY ${CMAKE_BINARY_DIR}/../bin)
set(OJPH_DESTINATION_ARCHIVE ${CMAKE_BINARY_DIR}/../lib)

## specify the top directory for TIFF library (only for Micrsoft)
## specify the top directory for TIFF library (only for Microsoft Visual Studio)
if (MSVC)
set(TIFF_PATH "C:\\Program Files\\tiff")
endif()
Expand Down
2 changes: 0 additions & 2 deletions bin/.gitignore

This file was deleted.

10 changes: 0 additions & 10 deletions src/apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,3 @@ endif()
## Build executables
add_subdirectory(ojph_expand)
add_subdirectory(ojph_compress)

if (MSVC AND OJPH_ENABLE_TIFF_SUPPORT)
if (CMAKE_BUILD_TYPE MATCHES "Release")
file(COPY "${TIFF_PATH}\\bin\\tiff.dll" DESTINATION "${OJPH_DESTINATION_BINARY}")
file(COPY "${TIFF_PATH}\\bin\\tiffxx.dll" DESTINATION "${OJPH_DESTINATION_BINARY}")
elseif(CMAKE_BUILD_TYPE MATCHES "Debug")
file(COPY "${TIFF_PATH}\\bin\\tiffd.dll" DESTINATION "${OJPH_DESTINATION_BINARY}")
file(COPY "${TIFF_PATH}\\bin\\tiffxxd.dll" DESTINATION "${OJPH_DESTINATION_BINARY}")
endif()
endif()
6 changes: 0 additions & 6 deletions src/apps/ojph_compress/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,3 @@ else()

install(TARGETS ojph_compress DESTINATION bin)
endif()

## copy target files to the top bin folder
add_custom_command(TARGET ojph_compress POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${OJPH_DESTINATION_BINARY}
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:ojph_compress>" ${OJPH_DESTINATION_BINARY}
)
6 changes: 0 additions & 6 deletions src/apps/ojph_expand/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,3 @@ else()

install(TARGETS ojph_expand DESTINATION bin)
endif()

## copy target files to the top bin folder
add_custom_command(TARGET ojph_expand POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${OJPH_DESTINATION_BINARY}
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:ojph_expand>" ${OJPH_DESTINATION_BINARY}
)
18 changes: 0 additions & 18 deletions src/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,3 @@ else()
SOVERSION "${OPENJPH_VERSION_MAJOR}.${OPENJPH_VERSION_MINOR}"
VERSION "${OPENJPH_VERSION}")
endif()

## copy target files to the top bin folder
add_custom_command(TARGET openjph POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${OJPH_DESTINATION_BINARY}
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:openjph>" ${OJPH_DESTINATION_BINARY}
COMMAND ${CMAKE_COMMAND} -E make_directory ${OJPH_DESTINATION_ARCHIVE}
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_LINKER_FILE:openjph>" ${OJPH_DESTINATION_ARCHIVE}
)
if (MSVC)
add_custom_command(TARGET openjph POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_LINKER_FILE_DIR:openjph>/${OJPH_LIB_NAME_STRING}.exp" ${OJPH_DESTINATION_ARCHIVE}
)
endif()
if(EMSCRIPTEN)
add_custom_command(TARGET openjphsimd POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:openjphsimd>" ${OJPH_DESTINATION_BINARY}
)
endif()
2 changes: 1 addition & 1 deletion src/core/common/ojph_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@

#define OPENJPH_VERSION_MAJOR 0
#define OPENJPH_VERSION_MINOR 10
#define OPENJPH_VERSION_PATCH 4
#define OPENJPH_VERSION_PATCH 5
13 changes: 10 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ FetchContent_Declare(
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
set(BUILD_GMOCK OFF CACHE BOOL "" FORCE)
option(INSTALL_GTEST "Enable installation of googletest." OFF)
FetchContent_MakeAvailable(googletest)

# Fetch test files
Expand Down Expand Up @@ -66,9 +67,15 @@ if (MSVC)
file(COPY "${TIFF_PATH}\\bin\\tiffxxd.dll" DESTINATION "./")
endif()
endif()
elseif(MSYS)
else()
add_custom_command(TARGET test_executables POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "../bin/msys-gtest.dll" "./"
COMMAND ${CMAKE_COMMAND} -E copy "../bin/msys-gtest_main.dll" "./"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:ojph_expand>" "./"
COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:ojph_compress>" "./"
)
if(MSYS)
add_custom_command(TARGET test_executables POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "../bin/msys-gtest.dll" "./"
COMMAND ${CMAKE_COMMAND} -E copy "../bin/msys-gtest_main.dll" "./"
)
endif()
endif()
4 changes: 2 additions & 2 deletions tests/test_executables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ int execute(const std::string& cmd, std::string& result)
#define REF_FILE_DIR "./jp2k_test_codestreams/openjph/references/"
#define MSE_PAE_PATH "./mse_pae"
#define COMPARE_FILES_PATH "./compare_files"
#define EXPAND_EXECUTABLE "../../bin/ojph_expand"
#define COMPRESS_EXECUTABLE "../../bin/ojph_compress"
#define EXPAND_EXECUTABLE "./ojph_expand"
#define COMPRESS_EXECUTABLE "./ojph_compress"
#endif
#define TOL_DOUBLE 0.01
#define TOL_INTEGER 1
Expand Down

0 comments on commit 4d1dfe8

Please sign in to comment.