set(FREEBEACON_VERSION_STRING "${FREEBEACON_VERSION}")
endif()
message(STATUS "freebeacon version: ${FREEBEACON_VERSION_STRING}")
-#configure_file(cmake/version.h.in version.h @ONLY)
+configure_file(cmake/version.h.in version.h @ONLY)
# Set default build type
if(NOT CMAKE_BUILD_TYPE)
# Set default build flags.
-set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -pie -Wl,-z,relro -Wl,-z,now")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pie -Wl,-z,relro -Wl,-z,now")
+
+# -fPIC is implied on MinGW...
+if(NOT WIN32)
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+endif()
#
# Setup cmake options
if(FREEBEACON_STATIC_DEPS)
add_dependencies(freebeacon ${FREEBEACON_STATIC_DEPS})
endif()
+
+install(TARGETS freebeacon RUNTIME DESTINATION bin)
--- /dev/null
+# If we're cross-compiling then we need to set the target host manually.
+if(MINGW AND CMAKE_CROSSCOMPILING)
+ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
+ set(HOST x86_64-w64-mingw32)
+ else()
+ set(HOST i686-w64-mingw32)
+ endif()
+endif()