-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
277 additions
and
218 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Add tiff library | ||
############################################################ | ||
if( OJPH_ENABLE_TIFF_SUPPORT ) | ||
|
||
if( WIN32 ) | ||
|
||
set(TIFF_INCLUDE_DIR "C:\\Program Files\\tiff\\include" CACHE PATH "the directory containing the TIFF headers") | ||
set(TIFF_LIBRARY_DEBUG "C:\\Program Files\\tiff\\lib\\tiffd.lib" CACHE FILEPATH "the path to the TIFF library for debug configurations") | ||
set(TIFF_LIBRARY_RELEASE "C:\\Program Files\\tiff\\lib\\tiff.lib" CACHE FILEPATH "the path to the TIFF library for release configurations") | ||
set(TIFFXX_LIBRARY_DEBUG "C:\\Program Files\\tiff\\lib\\tiffxxd.lib" CACHE FILEPATH "the path to the TIFFXX library for debug configurations") | ||
set(TIFFXX_LIBRARY_RELEASE "C:\\Program Files\\tiff\\lib\\tiffxx.lib" CACHE FILEPATH "the path to the TIFFXX library for release configurations") | ||
|
||
message( STATUS "WIN32 detected: Setting CMakeCache TIFF values as follows, use CMake-gui Advanced to modify them" ) | ||
message( STATUS " TIFF_INCLUDE_DIR : \"${TIFF_INCLUDE_DIR}\" " ) | ||
message( STATUS " TIFF_LIBRARY_DEBUG : \"${TIFF_LIBRARY_DEBUG}\" " ) | ||
message( STATUS " TIFF_LIBRARY_RELEASE : \"${TIFF_LIBRARY_RELEASE}\" " ) | ||
message( STATUS " TIFFXX_LIBRARY_DEBUG : \"${TIFFXX_LIBRARY_DEBUG}\" " ) | ||
message( STATUS " TIFFXX_LIBRARY_RELEASE : \"${TIFFXX_LIBRARY_RELEASE}\" " ) | ||
|
||
endif( WIN32 ) | ||
|
||
FIND_PACKAGE( TIFF ) | ||
|
||
if( TIFF_FOUND ) | ||
set(USE_TIFF TRUE CACHE BOOL "Add TIFF support") | ||
include_directories( ${TIFF_INCLUDE_DIR} ) | ||
if (MSVC) | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /D \"OJPH_ENABLE_TIFF_SUPPORT\"") | ||
else() | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOJPH_ENABLE_TIFF_SUPPORT") | ||
endif() | ||
#include_directories(${CMAKE_BINARY_DIR}/libtiff) # for tiffconf.h on windows | ||
endif( TIFF_FOUND ) | ||
|
||
endif() | ||
############################################################ | ||
|
||
## Change folders | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../bin) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/../lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../bin) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../bin) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/../lib) | ||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../bin) | ||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../bin) | ||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/../lib) | ||
|
||
## Build executables | ||
add_subdirectory(ojph_expand) | ||
add_subdirectory(ojph_compress) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
## building ojph_compress | ||
######################### | ||
|
||
include_directories(../common) | ||
|
||
file(GLOB OJPH_COMPRESS "ojph_compress.cpp") | ||
file(GLOB OJPH_IMG_IO "../others/ojph_img_io*.cpp") | ||
file(GLOB OJPH_IMG_IO_H "../common/ojph_img_io.h") | ||
|
||
if(NOT OJPH_DISABLE_INTEL_SIMD) | ||
list(REMOVE_ITEM OJPH_IMG_IO ${OJPH_IMG_IO_SSE41}) | ||
list(REMOVE_ITEM OJPH_IMG_IO ${OJPH_IMG_IO_AVX2}) | ||
endif() | ||
|
||
source_group("main" FILES ${OJPH_COMPRESS}) | ||
source_group("others" FILES ${OJPH_IMG_IO}) | ||
source_group("common" FILES ${OJPH_IMG_IO_H}) | ||
|
||
if(OJPH_BUILD_EXECUTABLES) | ||
add_executable(ojph_compress ${OJPH_COMPRESS} ${OJPH_IMG_IO} ${OJPH_IMG_IO_H}) | ||
endif() | ||
|
||
if (MSVC) | ||
set_source_files_properties(../others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS "/arch:AVX2") | ||
else() | ||
set_source_files_properties(../others/ojph_img_io_sse41.cpp PROPERTIES COMPILE_FLAGS -msse4.1) | ||
set_source_files_properties(../others/ojph_img_io_avx2.cpp PROPERTIES COMPILE_FLAGS -mavx2) | ||
endif() | ||
|
||
if(OJPH_BUILD_EXECUTABLES) | ||
if( USE_TIFF ) | ||
target_link_libraries(ojph_compress PUBLIC openjph ${TIFF_LIBRARIES}) | ||
else() | ||
target_link_libraries(ojph_compress PUBLIC openjph) | ||
endif() | ||
endif() | ||
|
||
install(TARGETS ojph_compress DESTINATION bin) |
Oops, something went wrong.