build_environment: zlib move harvesting to zlib.cmake
authorRay Molenkamp <github@lazydodo.com>
Sat, 11 Aug 2018 21:13:39 +0000 (15:13 -0600)
committerRay Molenkamp <github@lazydodo.com>
Sat, 11 Aug 2018 21:13:39 +0000 (15:13 -0600)
build_files/build_environment/cmake/harvest.cmake
build_files/build_environment/cmake/zlib.cmake

index 5adfb951215c71f2536e69b3dd5fdb2c56eb4317..860800f05b88c96c0fd04b4e93fab7a8908fbc8e 100644 (file)
@@ -28,11 +28,7 @@ message("HARVEST_TARGET = ${HARVEST_TARGET}")
 if(WIN32)
 if(BUILD_MODE STREQUAL Release)
        add_custom_target(Harvest_Release_Results
-                               # Zlib Rename the lib file and copy the include/bin folders
-               COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstatic.lib ${HARVEST_TARGET}/zlib/lib/libz_st.lib &&
-                               ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/include/ ${HARVEST_TARGET}/zlib/include/ &&
-                               ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/bin/ ${HARVEST_TARGET}/zlib/bin/ &&
-                               # jpeg rename libfile + copy include
+               COMMAND # jpeg rename libfile + copy include
                                ${CMAKE_COMMAND} -E copy ${LIBDIR}/jpg/lib/jpeg-static.lib ${HARVEST_TARGET}/jpeg/lib/libjpeg.lib &&
                                ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/jpg/include/ ${HARVEST_TARGET}/jpeg/include/ &&
                                # pthreads, rename include dir
index 3307cb1f167dd5fc9851614e7952ce17e8578a94..4c422d501eee68d9b559ff2a68f7c8c528cf4b9d 100644 (file)
@@ -25,9 +25,25 @@ ExternalProject_Add(external_zlib
        INSTALL_DIR ${LIBDIR}/zlib
 )
 
-if(BUILD_MODE STREQUAL Debug)
-       ExternalProject_Add_Step(external_zlib after_install
-               COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+if (WIN32)
+       if(BUILD_MODE STREQUAL Release)
+               ExternalProject_Add_Step(external_zlib after_install
+                       COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstatic${LIBEXT} ${HARVEST_TARGET}/zlib/lib/libz_st${LIBEXT}
+                       COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBDIR}/zlib/include/ ${HARVEST_TARGET}/zlib/include/
+                       DEPENDEES install
+               )
+       endif()
+       if(BUILD_MODE STREQUAL Debug)
+               ExternalProject_Add_Step(external_zlib after_install
+               COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${HARVEST_TARGET}/zlib/lib/libz_st_d${LIBEXT}
                DEPENDEES install
-       )
-endif()
+               )
+       endif()
+else()
+       if(BUILD_MODE STREQUAL Debug)
+               ExternalProject_Add_Step(external_zlib after_install
+                       COMMAND ${CMAKE_COMMAND} -E copy ${LIBDIR}/zlib/lib/zlibstaticd${LIBEXT} ${LIBDIR}/zlib/lib/${ZLIB_LIBRARY}
+                       DEPENDEES install
+               )
+       endif()
+endif()
\ No newline at end of file