diff --git a/3rd_party/glew/CMakeLists.txt b/3rd_party/glew/CMakeLists.txt index 148f46e2..976e1241 100644 --- a/3rd_party/glew/CMakeLists.txt +++ b/3rd_party/glew/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.12) get_filename_component(MODULE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) set(PROJECT_NAME 3rd_${MODULE_NAME}) diff --git a/CMakeLists.txt b/CMakeLists.txt index 839fcc79..e37ca722 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,11 +22,11 @@ message("-- Setting C++11") # Let's also add the version to the path to allow multiple versions of Easy3D in the same directory. if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - if (WIN32 OR MSVC) # windows + if (WIN32) # windows set(CMAKE_INSTALL_PREFIX "C:/Program Files/Easy3D/${Easy3D_VERSION}" CACHE PATH "Installation directory" FORCE) - elseif (APPLE) # macOS + elseif (APPLE) # macOS set(CMAKE_INSTALL_PREFIX "/usr/local/Cellar/easy3d/${Easy3D_VERSION}" CACHE PATH "Installation directory" FORCE) - else () # Linux: different from tradition, let's keep everything together + else () # Linux: different from tradition, let's keep everything together set(CMAKE_INSTALL_PREFIX "/usr/local/easy3d-${Easy3D_VERSION}" CACHE PATH "Installation directory" FORCE) endif () endif () @@ -114,7 +114,7 @@ if (Easy3D_BUILD_SHARED_LIBS) #Ref: Create dlls on Windows without declspec() using new CMake export all feature # https://cmake.org/cmake/help/v3.4/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html#prop_tgt:WINDOWS_EXPORT_ALL_SYMBOLS # https://www.kitware.com/create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/ - if (WIN32 OR MSVC) + if (MSVC) set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE) endif () else () @@ -218,7 +218,7 @@ function(add_module module headers sources private_dependencies public_dependenc SOVERSION ${Easy3D_MAJOR_VERSION} VERSION ${Easy3D_VERSION} ) - if (WIN32 OR MSVC) + if (MSVC) target_compile_definitions(easy3d_${module} PUBLIC NOMINMAX WIN32_LEAN_AND_MEAN VC_EXTRALEAN _CRT_SECURE_NO_WARNINGS _CRT_SECURE_NO_DEPRECATE) # get a clean windows endif () diff --git a/tutorials/Tutorial_203_Viewer_wxWidgets/CMakeLists.txt b/tutorials/Tutorial_203_Viewer_wxWidgets/CMakeLists.txt index 050e5cd3..8d696b52 100644 --- a/tutorials/Tutorial_203_Viewer_wxWidgets/CMakeLists.txt +++ b/tutorials/Tutorial_203_Viewer_wxWidgets/CMakeLists.txt @@ -48,8 +48,8 @@ set(${PROJECT_NAME}_SOURCES window.cpp ) -if (WIN32 OR MSVC) - set(${PROJECT_NAME}_RESOURCES "${CMAKE_CURRENT_LIST_DIR}/resources/sample.rc") +if (MSVC) + set(${PROJECT_NAME}_RESOURCES "${CMAKE_CURRENT_LIST_DIR}/resources/sample.rc") add_executable(${PROJECT_NAME} ${${PROJECT_NAME}_HEADERS} ${${PROJECT_NAME}_SOURCES} ${${PROJECT_NAME}_RESOURCES}) # you can add "WIN32" to disable the console window message(STATUS "Creating the wxWidgets viewer with a console window") elseif (APPLE)