Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
418750ce
Commit
418750ce
authored
14 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
first try to use fltk-config to detect fltk (to fix the buggy
find_package(FLTK) on unix platforms)
parent
4f6f471f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
CMakeLists.txt
+87
-93
87 additions, 93 deletions
CMakeLists.txt
with
87 additions
and
93 deletions
CMakeLists.txt
+
87
−
93
View file @
418750ce
...
...
@@ -302,6 +302,27 @@ if(ENABLE_PARSER)
endif
(
ENABLE_PARSER
)
if
(
ENABLE_FLTK
)
# try first to use fltk-config (FindFLTK is buggy on Unix, where
# e.g. xft and xinerama options are not dealt with)
find_program
(
FLTK_CONFIG_SCRIPT fltk-config
)
if
(
FLTK_CONFIG_SCRIPT
)
add_subdirectory
(
Fltk
)
set_config_option
(
HAVE_FLTK
"Fltk"
)
execute_process
(
COMMAND
${
FLTK_CONFIG_SCRIPT
}
--api-version
OUTPUT_VARIABLE FLTK_VERSION
)
string
(
STRIP
${
FLTK_VERSION
}
FLTK_VERSION
)
message
(
STATUS
"Found fltk-config script for FLTK "
${
FLTK_VERSION
}
)
execute_process
(
COMMAND
${
FLTK_CONFIG_SCRIPT
}
--use-gl --use-images --includedir
OUTPUT_VARIABLE FLTK_INCLUDE_DIR
)
string
(
STRIP
${
FLTK_INCLUDE_DIR
}
FLTK_INCLUDE_DIR
)
list
(
APPEND EXTERNAL_INCLUDES
${
FLTK_INCLUDE_DIR
}
)
execute_process
(
COMMAND
${
FLTK_CONFIG_SCRIPT
}
--use-gl --use-images --ldflags
OUTPUT_VARIABLE FLTK_LIBRARIES
)
string
(
STRIP
${
FLTK_LIBRARIES
}
FLTK_LIBRARIES
)
string
(
REGEX MATCH
"fltk[_ ]jpeg"
FLTK_JPEG
${
FLTK_LIBRARIES
}
)
string
(
REGEX MATCH
"fltk[_ ]z"
FLTK_Z
${
FLTK_LIBRARIES
}
)
string
(
REGEX MATCH
"fltk[_ ]png"
FLTK_PNG
${
FLTK_LIBRARIES
}
)
else
(
FLTK_CONFIG_SCRIPT
)
set
(
FLTK_SKIP_FORMS TRUE
)
set
(
FLTK_SKIP_FLUID TRUE
)
find_package
(
FLTK
)
...
...
@@ -309,11 +330,40 @@ if(ENABLE_FLTK)
add_subdirectory
(
Fltk
)
set_config_option
(
HAVE_FLTK
"Fltk"
)
list
(
APPEND EXTERNAL_INCLUDES
${
FLTK_INCLUDE_DIR
}
)
if
(
FLTK_CONFIG_SCRIPT
)
execute_process
(
COMMAND
${
FLTK_CONFIG_SCRIPT
}
--api-version
OUTPUT_VARIABLE FLTK_VERSION
)
string
(
STRIP
${
FLTK_VERSION
}
FLTK_VERSION
)
message
(
STATUS
"Found fltk-config script for FLTK "
${
FLTK_VERSION
}
)
# find fltk jpeg
find_library
(
FLTK_JPEG fltk_jpeg
)
if
(
NOT FLTK_JPEG
)
find_library
(
FLTK_JPEG fltkjpeg
)
endif
(
NOT FLTK_JPEG
)
if
(
FLTK_JPEG
)
list
(
APPEND EXTERNAL_LIBRARIES
${
FLTK_JPEG
}
)
foreach
(
DIR
${
FLTK_INCLUDE_DIR
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
DIR
}
/FL/images
${
DIR
}
/jpeg
)
endforeach
(
DIR
)
endif
(
FLTK_JPEG
)
# find fltk zlib
find_library
(
FLTK_Z fltk_z
)
if
(
NOT FLTK_Z
)
find_library
(
FLTK_Z fltkz
)
endif
(
NOT FLTK_Z
)
if
(
FLTK_Z
)
list
(
APPEND EXTERNAL_LIBRARIES
${
FLTK_Z
}
)
foreach
(
DIR
${
FLTK_INCLUDE_DIR
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
DIR
}
/FL/images
${
DIR
}
/zlib
)
endforeach
(
DIR
)
endif
(
FLTK_Z
)
# find fltk png
find_library
(
FLTK_PNG fltk_png
)
if
(
NOT FLTK_PNG
)
find_library
(
FLTK_PNG fltkpng
)
endif
(
NOT FLTK_PNG
)
if
(
FLTK_PNG
)
list
(
APPEND EXTERNAL_LIBRARIES
${
FLTK_PNG
}
)
foreach
(
DIR
${
FLTK_INCLUDE_DIR
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
DIR
}
/FL/images
${
DIR
}
/png
)
endforeach
(
DIR
)
endif
(
FLTK_PNG
)
endif
(
FLTK_FOUND
)
endif
(
FLTK_CONFIG_SCRIPT
)
if
(
ENABLE_NATIVE_FILE_CHOOSER
)
if
(
NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1
)
...
...
@@ -330,28 +380,6 @@ if(ENABLE_FLTK)
endif
(
NOT FLTK_VERSION OR FLTK_VERSION EQUAL 1.1
)
set_config_option
(
HAVE_FL_TREE
"FlTree"
)
endif
(
ENABLE_FL_TREE
)
if
(
APPLE AND FLTK_VERSION EQUAL 1.3
)
# required for system sounds (until cmake updates find_package(FLTK))
list
(
APPEND FLTK_LIBRARIES
"-framework AudioToolbox"
)
endif
(
APPLE AND FLTK_VERSION EQUAL 1.3
)
if
(
UNIX AND FLTK_CONFIG_SCRIPT
)
# missing Xft/Xinerama (until cmake updates find_package(FLTK))
execute_process
(
COMMAND
${
FLTK_CONFIG_SCRIPT
}
--ldflags
OUTPUT_VARIABLE FLTK_LDFLAGS
)
if
(
X11_Xft_FOUND
)
string
(
REGEX MATCH
".*Xft.*"
${
FLTK_LDFLAGS
}
FLTK_HAVE_XFT
)
if
(
FLTK_HAVE_XFT
)
list
(
APPEND FLTK_LIBRARIES
${
X11_Xft_LIB
}
)
endif
(
FLTK_HAVE_XFT
)
endif
(
X11_Xft_FOUND
)
if
(
X11_Xinerama_FOUND
)
string
(
REGEX MATCH
".*Xinerama.*"
${
FLTK_LDFLAGS
}
FLTK_HAVE_XINERAMA
)
if
(
FLTK_HAVE_XINERAMA
)
list
(
APPEND FLTK_LIBRARIES
${
X11_Xinerama_LIB
}
)
endif
(
FLTK_HAVE_XINERAMA
)
endif
(
X11_Xinerama_FOUND
)
endif
(
UNIX AND FLTK_CONFIG_SCRIPT
)
endif
(
FLTK_FOUND
)
elseif
(
ENABLE_QT
)
find_package
(
Qt4
)
set
(
QT_USE_QTOPENGL TRUE
)
...
...
@@ -368,72 +396,39 @@ if(HAVE_FLTK OR HAVE_QT OR ENABLE_GRAPHICS)
message
(
SEND_ERROR
"Cannot compile GUI without Mesh, Post or Plugin modules"
)
endif
(
NOT HAVE_MESH OR NOT HAVE_POST OR NOT HAVE_PLUGINS
)
# get jpeg lib (if we have fltk first try to get the local jpeg lib)
if
(
HAVE_FLTK
)
find_library
(
FLTK_JPEG fltk_jpeg
)
if
(
NOT FLTK_JPEG
)
find_library
(
FLTK_JPEG fltkjpeg
)
endif
(
NOT FLTK_JPEG
)
if
(
FLTK_JPEG
)
set_config_option
(
HAVE_LIBJPEG
"Jpeg(Fltk)"
)
list
(
APPEND EXTERNAL_LIBRARIES
${
FLTK_JPEG
}
)
foreach
(
DIR
${
FLTK_INCLUDE_DIR
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
DIR
}
/FL/images
${
DIR
}
/jpeg
)
endforeach
(
DIR
)
endif
(
FLTK_JPEG
)
endif
(
HAVE_FLTK
)
if
(
NOT FLTK_JPEG
)
else
(
FLTK_JPEG
)
find_package
(
JPEG
)
if
(
JPEG_FOUND
)
set_config_option
(
HAVE_LIBJPEG
"Jpeg"
)
list
(
APPEND EXTERNAL_LIBRARIES
${
JPEG_LIBRARIES
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
JPEG_INCLUDE_DIR
}
)
endif
(
JPEG_FOUND
)
endif
(
NOT
FLTK_JPEG
)
endif
(
FLTK_JPEG
)
# get zlib (if we have fltk first try to get the local zlib)
if
(
HAVE_FLTK
)
find_library
(
FLTK_Z fltk_z
)
if
(
NOT FLTK_Z
)
find_library
(
FLTK_Z fltkz
)
endif
(
NOT FLTK_Z
)
if
(
FLTK_Z
)
set_config_option
(
HAVE_LIBZ
"Zlib(Fltk)"
)
list
(
APPEND EXTERNAL_LIBRARIES
${
FLTK_Z
}
)
foreach
(
DIR
${
FLTK_INCLUDE_DIR
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
DIR
}
/FL/images
${
DIR
}
/zlib
)
endforeach
(
DIR
)
endif
(
FLTK_Z
)
endif
(
HAVE_FLTK
)
if
(
NOT FLTK_Z
)
else
(
FLTK_Z
)
find_package
(
ZLIB
)
if
(
ZLIB_FOUND
)
set_config_option
(
HAVE_LIBZ
"Zlib"
)
list
(
APPEND EXTERNAL_LIBRARIES
${
ZLIB_LIBRARIES
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
ZLIB_INCLUDE_DIR
}
)
endif
(
ZLIB_FOUND
)
endif
(
NOT
FLTK_Z
)
endif
(
FLTK_Z
)
# get png lib (if we have fltk first try to get the local png lib)
if
(
HAVE_LIBZ
)
if
(
HAVE_FLTK
)
find_library
(
FLTK_PNG fltk_png
)
if
(
NOT FLTK_PNG
)
find_library
(
FLTK_PNG fltkpng
)
endif
(
NOT FLTK_PNG
)
if
(
FLTK_PNG
)
set_config_option
(
HAVE_LIBPNG
"Png(Fltk)"
)
list
(
APPEND EXTERNAL_LIBRARIES
${
FLTK_PNG
}
)
foreach
(
DIR
${
FLTK_INCLUDE_DIR
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
DIR
}
/FL/images
${
DIR
}
/png
)
endforeach
(
DIR
)
endif
(
FLTK_PNG
)
endif
(
HAVE_FLTK
)
if
(
NOT FLTK_PNG
)
else
(
FLTK_PNG
)
find_package
(
PNG
)
if
(
PNG_FOUND
)
set_config_option
(
HAVE_LIBPNG
"Png"
)
list
(
APPEND EXTERNAL_LIBRARIES
${
PNG_LIBRARIES
}
)
list
(
APPEND EXTERNAL_INCLUDES
${
PNG_INCLUDE_DIR
}
)
endif
(
PNG_FOUND
)
endif
(
NOT
FLTK_PNG
)
endif
(
FLTK_PNG
)
endif
(
HAVE_LIBZ
)
find_package
(
OpenGL REQUIRED
)
if
(
OPENGL_GLU_FOUND
)
...
...
@@ -1160,4 +1155,3 @@ message("")
mark_as_advanced
(
BISON FLEX GMP_LIB GMSH_EXTRA_VERSION HDF5_LIB MAKEINFO
MED_LIB OCC_INC SZ_LIB TAUCS_LIB ACIS_LIB TEXI2PDF
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment