From a1ca1c4e0a05f5c4381d28766bbeafc8f5664872 Mon Sep 17 00:00:00 2001 From: hobbes1069 Date: Fri, 15 Aug 2014 18:02:57 +0000 Subject: [PATCH] Tweaks for win32/mingw building. Need to compare to codec2-dev and propagate changes there. git-svn-id: https://svn.code.sf.net/p/freetel/code@1804 01035d8c-6547-0410-b346-abe4f91aad63 --- codec2/CMakeLists.txt | 13 +++++++++---- codec2/src/CMakeLists.txt | 9 ++++----- fdmdv2/CMakeLists.txt | 3 ++- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/codec2/CMakeLists.txt b/codec2/CMakeLists.txt index 396239b3..0969437b 100644 --- a/codec2/CMakeLists.txt +++ b/codec2/CMakeLists.txt @@ -44,7 +44,8 @@ message(STATUS "codec2 version: ${CODEC2_VERSION}") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") endif(NOT CMAKE_BUILD_TYPE) -message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}") +message(STATUS "Build type is: " ${CMAKE_BUILD_TYPE}) +message(STATUS "Compiler Flags: " ${CMAKE_CXX_FLAGS}) # # Setup Windows/MinGW specifics here. @@ -52,12 +53,16 @@ message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}") if(MINGW) message(STATUS "System is MinGW.") foreach(RUNTIME - libgcc_s_sjlj-1.dll - libstdc++-6.dll) + gcc_s_sjlj-1 + gcc_s_dw2-1 + stdc++-6 + ) message(STATUS "Checking for ${RUNTIME}") find_library(${RUNTIME}_LIB ${RUNTIME}) message(STATUS "runtime found: ${${RUNTIME}_LIB}") - list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB}) + if(${${RUNTIME}_LIB}_FOUND) + list(APPEND CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS ${${RUNTIME}_LIB}) + endif() endforeach() endif(MINGW) diff --git a/codec2/src/CMakeLists.txt b/codec2/src/CMakeLists.txt index 97487369..1e956f25 100644 --- a/codec2/src/CMakeLists.txt +++ b/codec2/src/CMakeLists.txt @@ -82,12 +82,10 @@ set(CODEBOOKSGE ${D}/gecb.txt) # when crosscompiling import the executable targets from a file if(CMAKE_CROSSCOMPILING) - SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Point it to the export file from a native build") + SET(IMPORT_EXECUTABLES "IMPORTFILE-NOTFOUND" CACHE FILEPATH "Point to the export file from a native build") INCLUDE(${IMPORT_EXECUTABLES}) -endif(CMAKE_CROSSCOMPILING) - +else(CMAKE_CROSSCOMPILING) # Build code generator binaries. These do not get installed. -if(NOT CMAKE_CROSSCOMPILING) # generate_codebook add_executable(generate_codebook generate_codebook.c) target_link_libraries(generate_codebook ${CMAKE_REQUIRED_LIBRARIES}) @@ -97,7 +95,8 @@ if(NOT CMAKE_CROSSCOMPILING) # Make native builds available for cross-compiling. export(TARGETS generate_codebook genlspdtcb FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake) -endif(NOT CMAKE_CROSSCOMPILING) +endif(CMAKE_CROSSCOMPILING) + # codebook.c add_custom_command( diff --git a/fdmdv2/CMakeLists.txt b/fdmdv2/CMakeLists.txt index 2ef59fdb..b83697d3 100644 --- a/fdmdv2/CMakeLists.txt +++ b/fdmdv2/CMakeLists.txt @@ -137,7 +137,8 @@ if(MINGW) set(CMAKE_RC_COMPILE_OBJECT " -O coff -i -o ") # Even using msys, cmake doesn't know it can use unix style paths... - set(CMAKE_LIBRARY_PATH C:/MinGW/lib;C:/MinGW/msys/1.0/lib;C:/MinGW/msys/1.0/local/lib) + set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH};C:/MinGW/lib;C:/MinGW/msys/1.0/lib;C:/MinGW/msys/1.0/local/lib) + message("Library path: ${CMAKE_LIBRARY_PATH}") # Try to build in libgcc and libstdc++ but it doesn't appear to work. #add_definitions(-static-libgcc -static-libstdc++) # Try to grab all the runtime dlls for the windows installer. -- 2.25.1