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.
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)
# 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})
# 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(
set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
# 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.