diff --git a/CMakeLists.txt b/CMakeLists.txt index def3bd3d..ae7ee1b3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -593,6 +593,9 @@ if(WITH_TURBOJPEG) add_executable(tjunittest tjunittest.c tjutil.c md5/md5.c md5/md5hl.c) target_link_libraries(tjunittest turbojpeg) + if(UNIX) + target_link_libraries(tjunittest m) + endif() add_executable(tjbench tjbench.c tjutil.c) target_link_libraries(tjbench turbojpeg) @@ -602,6 +605,9 @@ if(WITH_TURBOJPEG) add_executable(tjexample tjexample.c) target_link_libraries(tjexample turbojpeg) + if(UNIX) + target_link_libraries(tjexample m) + endif() endif() if(ENABLE_STATIC) @@ -617,6 +623,9 @@ if(WITH_TURBOJPEG) add_executable(tjunittest-static tjunittest.c tjutil.c md5/md5.c md5/md5hl.c) target_link_libraries(tjunittest-static turbojpeg-static) + if(UNIX) + target_link_libraries(tjunittest-static m) + endif() add_executable(tjbench-static tjbench.c tjutil.c) target_link_libraries(tjbench-static turbojpeg-static) @@ -647,6 +656,9 @@ if(ENABLE_STATIC) ${CJPEG_BMP_SOURCES}) set_property(TARGET cjpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS}) target_link_libraries(cjpeg-static jpeg-static) + if(UNIX) + target_link_libraries(cjpeg-static m) + endif() if(PNG_SUPPORTED) set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) @@ -660,9 +672,16 @@ if(ENABLE_STATIC) wrppm.c ${DJPEG_BMP_SOURCES}) set_property(TARGET djpeg-static PROPERTY COMPILE_FLAGS ${COMPILE_FLAGS}) target_link_libraries(djpeg-static jpeg-static) + if(UNIX) + target_link_libraries(djpeg-static m) + endif() add_executable(jpegtran-static jpegtran.c cdjpeg.c rdswitch.c transupp.c) target_link_libraries(jpegtran-static jpeg-static) + if(UNIX) + target_link_libraries(jpegtran-static m) + endif() + set_property(TARGET jpegtran-static PROPERTY COMPILE_FLAGS "${USE_SETMODE}") endif() diff --git a/sharedlib/CMakeLists.txt b/sharedlib/CMakeLists.txt index 2f52c637..5a8ae7b4 100755 --- a/sharedlib/CMakeLists.txt +++ b/sharedlib/CMakeLists.txt @@ -37,6 +37,9 @@ else() endif() add_library(jpeg SHARED ${JPEG_SRCS} ${DEFFILE} $ ${SIMD_OBJS}) +if(UNIX) + target_link_libraries(jpeg m) +endif() set_target_properties(jpeg PROPERTIES SOVERSION ${SO_MAJOR_VERSION} VERSION ${SO_MAJOR_VERSION}.${SO_AGE}.${SO_MINOR_VERSION})