Commit 9e2d21a0 authored by David Košenina's avatar David Košenina

sfScope executable visual studio build

parent 7e940737
......@@ -45,6 +45,10 @@ if (${CMAKE_BUILD_TYPE} MATCHES "^[Dd]ebug")
endif()
endif()
# visual studio ?
set(SCOPEFUN_VISUALSTUDIO_X64 FALSE CACHE BOOL "visual studio build 64bit")
set(SCOPEFUN_VISUALSTUDIO_X86 FALSE CACHE BOOL "visual studio build 32bit")
# platform
if (WIN32)
set(SCOPEFUN_WINDOWS TRUE CACHE BOOL "os type")
......
cmake_minimum_required (VERSION 2.8)
# libusb
if(SCOPEFUN_MACOSX)
set(LIBUSBPLATFORM --disable-shared --enable-shared=no )
endif()
if(SCOPEFUN_LINUX)
set(LIBUSBPLATFORM --disable-shared --with-pic --enable-static --enable-shared=no )
endif()
if(SCOPEFUN_WINDOWS)
set(LIBUSBPLATFORM --disable-shared --enable-shared=no )
if(SCOPEFUN_VISUALSTUDIO_X64 OR SCOPEFUN_VISUALSTUDIO_X86)
# currently do custom build of libUSB
# include_external_msproject(libUsb123 ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/msvc/libusb_static_2017.vcxproj )
else()
if(SCOPEFUN_MACOSX)
set(LIBUSBPLATFORM --disable-shared --enable-shared=no )
endif()
if(SCOPEFUN_LINUX)
set(LIBUSBPLATFORM --disable-shared --with-pic --enable-static --enable-shared=no )
endif()
if(SCOPEFUN_WINDOWS)
set(LIBUSBPLATFORM --disable-shared --enable-shared=no )
endif()
include(ExternalProject)
externalproject_add(libUsb1022
PREFIX ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22
BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/sfBuild${SCOPEFUN_TYPE}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22
CONFIGURE_COMMAND sh ../configure ${LIBUSBPLATFORM}
BUILD_COMMAND make
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
if(SCOPEFUN_32BIT)
set_target_properties(libUsb1022 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif ()
endif()
include(ExternalProject)
externalproject_add(libUsb1022
PREFIX ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22
BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/sfBuild${SCOPEFUN_TYPE}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22
CONFIGURE_COMMAND sh ../configure ${LIBUSBPLATFORM}
BUILD_COMMAND make
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
if(SCOPEFUN_32BIT)
set_target_properties(libUsb1022 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif ()
# SDL2204
include(ExternalProject)
if(SCOPEFUN_MACOSX)
set(SDL2PLATFORM --disable-shared --with-pic --disable-joystick --with-macosx-version-min=10.9)
endif()
if(SCOPEFUN_LINUX)
set(SDL2PLATFORM --disable-shared --with-pic --disable-joystick )
endif()
if(SCOPEFUN_WINDOWS)
set(SDL2PLATFORM --disable-shared --disable-joystick --disable-directx )
if(SCOPEFUN_VISUALSTUDIO_X64 OR SCOPEFUN_VISUALSTUDIO_X86)
# currently do custom build of SDL2
# include_external_msproject(SDL2 ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/VisualC/SDL/SDL.vcxproj )
else()
if(SCOPEFUN_MACOSX)
set(SDL2PLATFORM --disable-shared --with-pic --disable-joystick --with-macosx-version-min=10.9)
endif()
if(SCOPEFUN_LINUX)
set(SDL2PLATFORM --disable-shared --with-pic --disable-joystick )
endif()
if(SCOPEFUN_WINDOWS)
set(SDL2PLATFORM --disable-shared --disable-joystick --disable-directx )
endif()
include(ExternalProject)
externalproject_add(SDL2209
PREFIX ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9
BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/sfBuild${SCOPEFUN_TYPE}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9
CONFIGURE_COMMAND sh ../configure ${SDL2PLATFORM}
BUILD_COMMAND make
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
if(SCOPEFUN_32BIT)
set_target_properties(SDL2209 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif ()
endif()
externalproject_add(SDL2209
PREFIX ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9
BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/sfBuild${SCOPEFUN_TYPE}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9
CONFIGURE_COMMAND sh ../configure ${SDL2PLATFORM}
BUILD_COMMAND make
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
if(SCOPEFUN_32BIT)
set_target_properties(SDL2209 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif ()
# wxWidgets
include(ExternalProject)
if(SCOPEFUN_MACOSX)
set(WXPLATFORM --disable-shared --with-macosx-version-min=10.9)
if(SCOPEFUN_VISUALSTUDIO_X64 OR SCOPEFUN_VISUALSTUDIO_X86)
# currently you must download windows sources for wxWidgets-3.0.4 and compile them using nmake
else()
set(WXPLATFORM --disable-shared)
if(SCOPEFUN_MACOSX)
set(WXPLATFORM --disable-shared --with-macosx-version-min=10.9)
else()
set(WXPLATFORM --disable-shared)
endif()
include(ExternalProject)
externalproject_add(wxWidgets304
PREFIX ${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4
BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4
CONFIGURE_COMMAND sh ../configure ${WXPLATFORM}
BUILD_COMMAND make
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
if(SCOPEFUN_32BIT)
set_target_properties(wxWidgets304 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif()
endif()
externalproject_add(wxWidgets304
PREFIX ${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4
BINARY_DIR ${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}
SOURCE_DIR ${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4
CONFIGURE_COMMAND sh ../configure ${WXPLATFORM}
BUILD_COMMAND make
UPDATE_COMMAND ""
INSTALL_COMMAND ""
)
if(SCOPEFUN_32BIT)
set_target_properties(wxWidgets304 PROPERTIES COMPILE_FLAGS "-m32" LINK_FLAGS "-m32")
endif()
# Python
if(SCOPEFUN_MACOSX OR SCOPEFUN_LINUX)
......
......@@ -67,6 +67,21 @@ endif()
# WINDOWS
if(SCOPEFUN_WINDOWS)
if( SCOPEFUN_VISUALSTUDIO_X86 )
add_definitions(-DWIN32)
add_definitions(-D__WIN32__)
add_definitions(-DMS_WIN32)
add_definitions(-DPLATFORM_WIN)
add_definitions(-DCODEBLOCKS)
add_definitions(-D_WINDOWS)
elseif(SCOPEFUN_VISUALSTUDIO_X64)
add_definitions(-DWIN64)
add_definitions(-D__WIN64__)
add_definitions(-DMS_WIN64)
add_definitions(-DPLATFORM_WIN)
add_definitions(-DCODEBLOCKS)
add_definitions(-D_WINDOWS)
else()
if(SCOPEFUN_32BIT)
add_definitions(-DWIN32)
add_definitions(-D__WIN32__)
......@@ -77,10 +92,11 @@ if(SCOPEFUN_WINDOWS)
add_definitions(-D__WIN64__)
add_definitions(-D__MINGW64__)
add_definitions(-DMS_WIN64)
endif ()
endif()
add_definitions(-DPLATFORM_MINGW)
add_definitions(-DCODEBLOCKS)
add_definitions(-D_WINDOWS)
endif()
endif(SCOPEFUN_WINDOWS)
# macos
......
......@@ -1026,7 +1026,7 @@ SCOPEFUN_DELETE(SActiveClients)
#define SCOPEFUN_API _declspec(dllexport)
#endif
#else
#if defined(PLATFORM_LINUX ) || defined(PLATFORM_MINGW) || defined(PLATFORM_MAC)
#if defined(PLATFORM_LINUX ) || defined(PLATFORM_MINGW) || defined(PLATFORM_MAC) || defined(PLATFORM_WIN)
#define SCOPEFUN_API
#else
#define SCOPEFUN_API _declspec(dllimport)
......
......@@ -10,24 +10,44 @@ set(SCOPEFUN_LIB_INCLUDE_CJSON "${CMAKE_SOURCE_DIR}/lib/cJSON"
set(SCOPEFUN_LIB_INCLUDE_KISSFFT "${CMAKE_SOURCE_DIR}/lib/kissfft130" CACHE PATH "include folder for kissfft" FORCE)
set(SCOPEFUN_LIB_INCLUDE_GLEW "${CMAKE_SOURCE_DIR}/lib/glew-1.13.0/include" CACHE PATH "include folder for glew" FORCE)
# include platform specifix folders
if(SCOPEFUN_WINDOWS)
set(SCOPEFUN_LIB_INCLUDE_PYTHON_PC "${CMAKE_SOURCE_DIR}/lib/Python-2.7.16/PC" CACHE PATH "include folder for python on windows" FORCE)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib/wx/include/msw-unicode-static-3.0" CACHE PATH "include folder for wx/setup.h" FORCE )
# visual studio x64
if(SCOPEFUN_VISUALSTUDIO_X64)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/lib/vc_x64_lib/mswud" CACHE PATH "include folder for wx/setup.h" FORCE )
set(SCOPEFUN_LIB_LINK_USB "${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/x64/Debug/lib" CACHE FILEPATH "link folder for libUsb" FORCE)
set(SCOPEFUN_LIB_LINK_SDL2 "${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/VisualC/x64/Debug" CACHE FILEPATH "link folder for SDL2" FORCE)
set(SCOPEFUN_LIB_LINK_WX "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/lib/vc_x64_lib" CACHE FILEPATH "link folder for wxWidgets" FORCE)
endif()
if(SCOPEFUN_MACOSX)
set(SCOPEFUN_LIB_INCLUDE_PYTHON_PC "${CMAKE_SOURCE_DIR}/lib/Python-2.7.16/sfBuild${SCOPEFUN_TYPE}" CACHE PATH "include folder for python on mac and linux" FORCE)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib/wx/include/osx_cocoa-unicode-static-3.0" CACHE PATH "include folder for wx/setup.h" FORCE )
# visual studio x86
if(SCOPEFUN_VISUALSTUDIO_X86)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/lib/vc_lib/mswud" CACHE PATH "include folder for wx/setup.h" FORCE )
set(SCOPEFUN_LIB_LINK_USB "${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/Win32/Debug/lib" CACHE FILEPATH "link folder for libUsb" FORCE)
set(SCOPEFUN_LIB_LINK_SDL2 "${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/VisualC/Win32/Debug" CACHE FILEPATH "link folder for SDL2" FORCE)
set(SCOPEFUN_LIB_LINK_WX "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/lib/vc_lib" CACHE FILEPATH "link folder for wxWidgets" FORCE)
endif()
if(SCOPEFUN_LINUX)
set(SCOPEFUN_LIB_INCLUDE_PYTHON_PC "${CMAKE_SOURCE_DIR}/lib/Python-2.7.16/sfBuild${SCOPEFUN_TYPE}" CACHE PATH "include folder for python on mac and linux" FORCE)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib/wx/include/gtk3-unicode-static-3.0" CACHE PATH "include folder for wx/setup.h" FORCE )
# include platform specifix folders
if( NOT (SCOPEFUN_VISUALSTUDIO_X64 OR SCOPEFUN_VISUALSTUDIO_X86) )
if(SCOPEFUN_WINDOWS)
set(SCOPEFUN_LIB_INCLUDE_PYTHON_PC "${CMAKE_SOURCE_DIR}/lib/Python-2.7.16/PC" CACHE PATH "include folder for python on windows" FORCE)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib/wx/include/msw-unicode-static-3.0" CACHE PATH "include folder for wx/setup.h" FORCE )
endif()
if(SCOPEFUN_MACOSX)
set(SCOPEFUN_LIB_INCLUDE_PYTHON_PC "${CMAKE_SOURCE_DIR}/lib/Python-2.7.16/sfBuild${SCOPEFUN_TYPE}" CACHE PATH "include folder for python on mac and linux" FORCE)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib/wx/include/osx_cocoa-unicode-static-3.0" CACHE PATH "include folder for wx/setup.h" FORCE )
endif()
if(SCOPEFUN_LINUX)
set(SCOPEFUN_LIB_INCLUDE_PYTHON_PC "${CMAKE_SOURCE_DIR}/lib/Python-2.7.16/sfBuild${SCOPEFUN_TYPE}" CACHE PATH "include folder for python on mac and linux" FORCE)
set(SCOPEFUN_LIB_INCLUDE_WX_SETUP "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib/wx/include/gtk3-unicode-static-3.0" CACHE PATH "include folder for wx/setup.h" FORCE )
endif()
endif()
# link folders
set(SCOPEFUN_LIB_LINK_USB "${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/sfBuild${SCOPEFUN_TYPE}/libusb/.libs" CACHE FILEPATH "link folder for libUsb" FORCE)
set(SCOPEFUN_LIB_LINK_SDL2 "${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/sfBuild${SCOPEFUN_TYPE}/build/.libs" CACHE FILEPATH "link folder for SDL2" FORCE)
set(SCOPEFUN_LIB_LINK_WX "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib" CACHE FILEPATH "link folder for wxWidgets" FORCE)
if( NOT (SCOPEFUN_VISUALSTUDIO_X64 OR SCOPEFUN_VISUALSTUDIO_X86) )
set(SCOPEFUN_LIB_LINK_USB "${CMAKE_SOURCE_DIR}/lib/libusb-1.0.22/sfBuild${SCOPEFUN_TYPE}/libusb/.libs" CACHE FILEPATH "link folder for libUsb" FORCE)
set(SCOPEFUN_LIB_LINK_SDL2 "${CMAKE_SOURCE_DIR}/lib/SDL2-2.0.9/sfBuild${SCOPEFUN_TYPE}/build/.libs" CACHE FILEPATH "link folder for SDL2" FORCE)
set(SCOPEFUN_LIB_LINK_WX "${CMAKE_SOURCE_DIR}/lib/wxWidgets-3.0.4/sfBuild${SCOPEFUN_TYPE}/lib" CACHE FILEPATH "link folder for wxWidgets" FORCE)
endif()
# link folders platform specific
if(SCOPEFUN_WINDOWS)
......@@ -39,6 +59,52 @@ endif()
# libraries
if(SCOPEFUN_WINDOWS)
if( SCOPEFUN_VISUALSTUDIO_X64 OR SCOPEFUN_VISUALSTUDIO_X86 )
set(SCOPEFUN_LIBS
"${SCOPEFUN_LIB_LINK_USB}/libusb-1.0.lib"
"${SCOPEFUN_LIB_LINK_SDL2}/SDL2.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxbase30ud.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxbase30ud_net.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxbase30ud_xml.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxexpatd.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxjpegd.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_adv.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_aui.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_core.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_gl.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_html.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_media.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_propgrid.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_qa.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_ribbon.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_richtext.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_stc.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_webview.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxmsw30ud_xrc.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxpngd.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxregexud.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxscintillad.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxtiffd.lib"
"${SCOPEFUN_LIB_LINK_WX}/wxzlibd.lib"
"opengl32.lib"
"winmm.lib"
"ole32.lib"
"imm32.lib"
"version.lib"
"uuid.lib"
"oleaut32.lib"
"comctl32.lib"
"winspool.lib"
"ws2_32.lib"
"wsock32.lib"
"setupapi.lib"
"hid.lib"
"Rpcrt4.lib"
"${CMAKE_SOURCE_DIR}/source/osciloscope/rc/osc.res"
)
else()
set(SCOPEFUN_LIBS
"mingw32.a"
"${SCOPEFUN_LIB_LINK_USB}/libusb-1.0.a"
......@@ -84,6 +150,8 @@ set(SCOPEFUN_LIBS
endif()
endif()
if(SCOPEFUN_MACOSX)
set(SCOPEFUN_LIBS
......
......@@ -69,7 +69,7 @@ add_executable(sfScope ${SCOPEFUN_EXE_TYPE}
"${SF_DATA}"
"${SF_LOCALE}"
)
# output
set_target_properties(sfScope
PROPERTIES
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment