Skip to content

Commit

Permalink
MMVII: Don't use mm3d library anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
meynardc committed Jan 23, 2025
1 parent f522131 commit ea5d764
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
29 changes: 21 additions & 8 deletions MMVII/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ else()
set(CMAKE_CONFIGURATION_TYPES "Release;RelWithDebInfo;Debug" CACHE STRING "" FORCE)
endif()


#######################################################
## Options
#######################################################

option(MMVII_KEEP_LIBRARY_MMV1 "If ON, MMVII will use legacy MMV1 code" OFF)

#######################################################
## Dependencies
#######################################################
Expand Down Expand Up @@ -103,11 +110,13 @@ string(REGEX REPLACE "[-/]D *NDEBUG" "" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_
#######################################################

# micmac v1 library and headers
if (MMVII_KEEP_LIBRARY_MMV1)
set(mmv1_dir "${MMVII_SOURCE_DIR}/..")
set(mmv1_include_dir "${mmv1_dir}/include")
set(mmv1_lib_dir "${mmv1_dir}/lib")
find_library(elise_lib NAME elise PATHS "${mmv1_lib_dir}" NO_DEFAULT_PATH)
find_library(ANN_lib NAME ANN PATHS "${mmv1_lib_dir}" NO_DEFAULT_PATH)
endif()

# MMVII dir
set(mmv2_include_dir "${MMVII_SOURCE_DIR}/include")
Expand Down Expand Up @@ -139,21 +148,25 @@ if(MSVC)
target_compile_options(P2007 PRIVATE "/MP")
endif()

option(MMVII_KEEP_MMV1_IMAGE "If OFF, MMVII will use GDAL only to read/write image" ON)
if(MMVII_KEEP_MMV1_IMAGE)
target_compile_definitions(P2007 PUBLIC MMVII_KEEP_MMV1_IMAGE)
if (MMVII_KEEP_LIBRARY_MMV1)
target_compile_definitions(P2007 PUBLIC MMVII_KEEP_LIBRARY_MMV1=true MMVII_KEEP_MMV1_IMAGE)
else()
target_compile_definitions(P2007 PUBLIC MMVII_KEEP_LIBRARY_MMV1=false)
endif()


#######################################################
## MMVII build (executable)
#######################################################
add_executable(MMVII src/main.cpp)

set(mmv1_libs "${elise_lib};${ANN_lib}")
if(UNIX)
set(mmv2_extlibs -lX11)
else()
set(mmv2_extlibs)
set(mmv2_extlibs)
set(mmv1_libs "")
if(MMVII_KEEP_LIBRARY_MMV1)
set(mmv1_libs "${elise_lib};${ANN_lib}")
if(UNIX)
set(mmv2_extlibs -lX11)
endif()
endif()

target_include_directories(MMVII PRIVATE "${MMVII_SOURCE_DIR}/include" )
Expand Down
20 changes: 15 additions & 5 deletions MMVII/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,27 @@ Some external tools need to be present on your system for **MMVII** to run prope
- **[vcpkg](https://github.com/microsoft/vcpkg/blob/master/README.md)** C/C++ library manager (**Windows only**)

# Installation
This section covers the compilation of **MMVII** source code to generate binaries. Pre-compiled binaries are available **[HERE](https://github.com/micmacIGN/micmac/releases)**.
This section covers the compilation of **MMVII** source code to generate binaries. (Pre-compiled binaries for Windows are available **[HERE](https://github.com/micmacIGN/micmac/releases)**)

Compilation procedure is discribed below for the 3 main operating systems:
- **[Linux Ubuntu distribution](#linux-ubuntu-distribution)**
- **[Windows](#windows)**
- **[macOS](#macos)**


MMVII does not use **MicMac v1** anymore, so installing **MicMac V1** is not required.
However some features of MMVII still require calls to the MicMac v1 library and have not yet been rewritten in MMVII. They are disabled.
For those who really need it, you can reactivate use of the MicMac V1 lib :

- Install **MicMac v1** by following the instructions **[HERE](../README.md)**.

- Activate the CMake option **MMVII_KEEP_LIBRARY_MMV1** in the following step '__Configure CMAKE and generate makefiles:__'
```bash
cmake ../ -DMMVII_KEEP_LIBRARY_MMV1=on
```


## Linux Ubuntu distribution
Before starting the installation, it is necessary to install **MicMac v1** by following the instructions **[HERE](../README.md)**.

Under Linux (Ubuntu) distribution the installation procedure is as follows:

Expand Down Expand Up @@ -80,11 +92,9 @@ Under Linux (Ubuntu) distribution the installation procedure is as follows:
```

## Windows
Before starting the installation, it is necessary to install **MicMac v1** by following the instructions **[HERE](../README.md)**.

Under Windows the installation procedure is as follows:

### Install vcpkg (if not done for **MicMac v1**)
### Install vcpkg
- Open a **Git Bash** terminal
- In another working directory, clone the repository:
```bash
Expand Down

0 comments on commit ea5d764

Please sign in to comment.