Skip to content

Commit b336ef0

Browse files
authored
Fix build with CMake on Windows (#205) (#207)
1 parent b074dff commit b336ef0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+28
-274
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66
*.opendb
77
*.VC.db
88
*.vcxproj.user
9+
.DS_Store
910
.vs
11+
build_cmake
12+
build_cmake*
1013
Debug/
1114
Release/
1215
/lib/

CMakeLists.txt

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@ set(CMAKE_CXX_STANDARD 11 CACHE STRING "C++ Standard")
1818
set(CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL "")
1919
set(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "")
2020
set(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "Postfix for debug binaries")
21-
set(wxWidgets_ROOT_DIR "" CACHE PATH "")
22-
set(wxWidgets_wxrc_EXECUTABLE "" CACHE FILEPATH "")
23-
21+
if (NOT WIN32)
22+
set(wxWidgets_ROOT_DIR "" CACHE PATH "")
23+
set(wxWidgets_wxrc_EXECUTABLE "" CACHE FILEPATH "")
24+
endif()
2425

2526
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
2627
if(BUILD_SHARED_LIBS)

samples/areachart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(AreaChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxareachartapp.h
2114
src/wxareachartapp.cpp
2215
src/wxareachartframe.h

samples/areachart/src/wxareachartframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,4 @@ wxAreaChartFrame::wxAreaChartFrame(const wxString& title)
5252
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
5353
panelSizer->Add(areaChartCtrl, 1, wxEXPAND);
5454
panel->SetSizer(panelSizer);
55-
56-
// Set up the sizer for the frame
57-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
58-
topSizer->Add(panel, 1, wxEXPAND);
59-
SetSizerAndFit(topSizer);
6055
}

samples/barchart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(BarChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxbarchartapp.h
2114
src/wxbarchartapp.cpp
2215
src/wxbarchartframe.h

samples/barchart/src/wxbarchartframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,4 @@ wxBarChartFrame::wxBarChartFrame(const wxString& title)
7373
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
7474
panelSizer->Add(barChartCtrl, 1, wxEXPAND);
7575
panel->SetSizer(panelSizer);
76-
77-
// Set up the sizer for the frame
78-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
79-
topSizer->Add(panel, 1, wxEXPAND);
80-
SetSizerAndFit(topSizer);
8176
}

samples/boxplot/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(BoxPlot
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxboxplotapp.h
2114
src/wxboxplotapp.cpp
2215
src/wxboxplotframe.h

samples/boxplot/src/wxboxplotframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,4 @@ wxBoxPlotFrame::wxBoxPlotFrame(const wxString& title)
5454
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
5555
panelSizer->Add(boxplotChartCtrl, 1, wxEXPAND);
5656
panel->SetSizer(panelSizer);
57-
58-
// Set up the sizer for the frame
59-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
60-
topSizer->Add(panel, 1, wxEXPAND);
61-
SetSizerAndFit(topSizer);
6257
}

samples/bubble/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(Bubble
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxBubbleApp.h
2114
src/WxBubbleApp.cpp
2215
src/WxBubbleFrame.h

samples/bubble/src/WxBubbleFrame.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,4 @@ WxBubbleFrame::WxBubbleFrame(const wxString& title)
7575
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
7676
panelSizer->Add(bubbleChartCtrl, 1, wxEXPAND);
7777
panel->SetSizer(panelSizer);
78-
79-
// Set up the sizer for the frame
80-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
81-
topSizer->Add(panel, 1, wxEXPAND);
82-
SetSizerAndFit(topSizer);
8378
}

samples/candlestick/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(CandleStick
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxCandleStickApp.h
2114
src/WxCandleStickApp.cpp
2215
src/WxCandleStickFrame.h

samples/candlestick/src/WxCandlestickFrame.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,4 @@ WxCandlestickFrame::WxCandlestickFrame(const wxString& title)
6464
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
6565
panelSizer->Add(candlestickChartCtrl, 1, wxEXPAND);
6666
panel->SetSizer(panelSizer);
67-
68-
// Set up the sizer for the frame
69-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
70-
topSizer->Add(panel, 1, wxEXPAND);
71-
SetSizerAndFit(topSizer);
7267
}

samples/columnchart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(ColumnChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxColumnApp.h
2114
src/WxColumnApp.cpp
2215
src/WxColumnFrame.h

samples/columnchart/src/WxColumnFrame.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,4 @@ WxColumnFrame::WxColumnFrame(const wxString& title)
7373
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
7474
panelSizer->Add(columnChartCtrl, 1, wxEXPAND);
7575
panel->SetSizer(panelSizer);
76-
77-
// Set up the sizer for the frame
78-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
79-
topSizer->Add(panel, 1, wxEXPAND);
80-
SetSizerAndFit(topSizer);
8176
}

samples/combinationchart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(CombinationChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxCombinationChartApp.h
2114
src/WxCombinationChartApp.cpp
2215
src/WxCombinationChartFrame.h

samples/combinationchart/src/WxCombinationChartFrame.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,4 @@ WxCombinationChartFrame::WxCombinationChartFrame(const wxString& title)
6262
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
6363
panelSizer->Add(combinationChartCtrl, 1, wxEXPAND);
6464
panel->SetSizer(panelSizer);
65-
66-
// Set up the sizer for the frame
67-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
68-
topSizer->Add(panel, 1, wxEXPAND);
69-
SetSizerAndFit(topSizer);
7065
}

samples/doughnutchart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(DoughnutChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxdoughnutchartapp.h
2114
src/wxdoughnutchartapp.cpp
2215
src/wxdoughnutchartframe.h

samples/doughnutchart/src/wxdoughnutchartframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,4 @@ wxDoughnutChartFrame::wxDoughnutChartFrame(const wxString& title)
5353
panelSizer->Add(doughnutChartCtrl, 1, wxEXPAND);
5454
panelSizer->Add(legendCtrl, 1, wxEXPAND);
5555
panel->SetSizer(panelSizer);
56-
57-
// Set up the sizer for the frame
58-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
59-
topSizer->Add(panel, 1, wxEXPAND);
60-
SetSizerAndFit(topSizer);
6156
}

samples/histogram/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(Histogram
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxhistogramapp.h
2114
src/wxhistogramapp.cpp
2215
src/wxhistogramframe.h

samples/histogram/src/wxhistogramframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,4 @@ wxHistogramFrame::wxHistogramFrame(const wxString& title)
5959
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
6060
panelSizer->Add(histogramCtrl, 1, wxEXPAND);
6161
panel->SetSizer(panelSizer);
62-
63-
// Set up the sizer for the frame
64-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
65-
topSizer->Add(panel, 1, wxEXPAND);
66-
SetSizerAndFit(topSizer);
6762
}

samples/linechart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(LineChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxlinechartapp.h
2114
src/wxlinechartapp.cpp
2215
src/wxlinechartframe.h

samples/linechart/src/wxlinechartframe.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,4 @@ wxLineChartFrame::wxLineChartFrame(const wxString& title)
8080
panelSizer->Add(lineChartCtrl, 1, wxEXPAND);
8181
panelSizer->Add(legendCtrl, 1, wxEXPAND);
8282
panel->SetSizer(panelSizer);
83-
84-
// Set up the sizer for the frame
85-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
86-
topSizer->Add(panel, 1, wxEXPAND);
87-
SetSizerAndFit(topSizer);
8883
}

samples/math2d/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(Math2d
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxMath2DApp.h
2114
src/WxMath2DApp.cpp
2215
src/WxMath2DFrame.h

samples/math2d/src/WxMath2DFrame.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,6 @@ WxMath2DFrame::WxMath2DFrame(const wxString& title)
101101
panelSizer->Add(math2dPlotCtrl, 1, wxEXPAND);
102102
panel->SetSizer(panelSizer);
103103

104-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
105-
topSizer->Add(panel, 1, wxEXPAND);
106-
SetSizerAndFit(topSizer);
107-
108104
Binds();
109105
}
110106

samples/math2dinteractive/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(Math2dInteractive
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxMath2DInteractiveApp.h
2114
src/WxMath2DInteractiveApp.cpp
2215
src/WxMath2DInteractiveFrame.h

samples/math2dinteractive/src/WxMath2DInteractiveFrame.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ WxMath2DInteractiveFrame::WxMath2DInteractiveFrame(const wxString& title)
6363
panelSizer->Add(math2dPlotCtrl, 1, wxEXPAND);
6464
panel->SetSizer(panelSizer);
6565

66-
wxBoxSizer* topSizer = new wxBoxSizer(wxVERTICAL);
67-
topSizer->Add(panel, 1, wxEXPAND);
68-
SetSizerAndFit(topSizer);
69-
7066
m_timer = new wxTimer(this,wxID_EXECUTE);
7167
m_timer->Start(1500);
7268
this->Bind(wxEVT_TIMER, [&](wxTimerEvent& )

samples/ohlc/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(OHLC
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/WxOHLCApp.h
2114
src/WxOHLCApp.cpp
2215
src/WxOHLCFrame.h

samples/ohlc/src/WxOHLCFrame.cpp

-5
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,4 @@ WxOHLCFrame::WxOHLCFrame(const wxString& title)
6464
wxBoxSizer* panelSizer = new wxBoxSizer(wxHORIZONTAL);
6565
panelSizer->Add(ohlcChartCtrl, 1, wxEXPAND);
6666
panel->SetSizer(panelSizer);
67-
68-
// Set up the sizer for the frame
69-
wxBoxSizer* topSizer = new wxBoxSizer(wxHORIZONTAL);
70-
topSizer->Add(panel, 1, wxEXPAND);
71-
SetSizerAndFit(topSizer);
7267
}

samples/piechart/CMakeLists.txt

+1-8
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,8 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
88
find_package(wxWidgets COMPONENTS core base REQUIRED)
99
include(${wxWidgets_USE_FILE})
1010

11-
# This is required for GUI applications on Windows.
12-
if(WIN32)
13-
SET(APP_TYPE WIN32)
14-
else()
15-
SET(APP_TYPE "")
16-
endif(WIN32)
17-
1811
add_executable(PieChart
19-
${APP_TYPE}
12+
WIN32 MACOSX_BUNDLE
2013
src/wxpiechartapp.h
2114
src/wxpiechartapp.cpp
2215
src/wxpiechartframe.h

0 commit comments

Comments
 (0)